Project Alice
Loading...
Searching...
No Matches
gui_project_investment_window.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace ui {
6
8public:
9 std::string get_text(sys::state& state, std::string csv) noexcept {
11 }
12
13 void on_update(sys::state& state) noexcept override {
14 set_text(state, get_text(state, "invest_project_title"));
15 }
16};
17
19public:
20 std::string get_text(sys::state& state) noexcept {
21 return text::format_money(nations::get_treasury(state, state.local_player_nation));
22 }
23
24 void on_update(sys::state& state) noexcept override {
26 }
27};
28
30public:
31 std::unique_ptr<element_base> make_child(sys::state& state, std::string_view name, dcon::gui_def_id id) noexcept override {
32 if(name == "window_bg") {
33 auto ptr = make_element_by_type<draggable_target>(state, id);
34 return ptr;
35 } else if(name == "close_button") {
36 return make_element_by_type<generic_close_button>(state, id);
37 } else if(name == "header") {
38 return make_element_by_type<project_investment_header>(state, id);
39 } else if(name == "invest") {
40 return make_element_by_type<button_element_base>(state, id);
41 } else if(name == "max") {
42 return make_element_by_type<button_element_base>(state, id);
43 } else if(name == "current_budget_label") {
44 return make_element_by_type<simple_text_element_base>(state, id); // NOT
45 } else if(name == "your_investment_label") {
46 return make_element_by_type<simple_text_element_base>(state, id); // NOT
47 } else if(name == "left_value") {
48 return make_element_by_type<project_investment_current_funds>(state, id);
49 } else if(name == "your_investment") {
50 return make_element_by_type<simple_text_element_base>(state, id);
51 } else if(name == "right_value") {
52 return make_element_by_type<simple_text_element_base>(state, id); // NOT
53 } else if(name == "transfer_slider") {
54 return make_element_by_type<scrollbar>(state, id);
55 } else {
56 return nullptr;
57 }
58 }
59};
60
61} // namespace ui
void on_update(sys::state &state) noexcept override
std::string get_text(sys::state &state) noexcept
void on_update(sys::state &state) noexcept override
std::string get_text(sys::state &state, std::string csv) noexcept
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
void set_text(sys::state &state, std::string const &new_text)
float get_treasury(sys::state &state, dcon::nation_id n)
Definition: nations.cpp:1042
std::string format_money(float num)
Definition: text.cpp:1029
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
Definition: text.cpp:617