Project Alice
Loading...
Searching...
No Matches
gui_project_investment_window.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
gui_element_types.hpp
"
4
5
namespace
ui
{
6
7
class
project_investment_header
:
public
simple_text_element_base
{
8
public
:
9
std::string
get_text
(
sys::state
&
state
, std::string csv)
noexcept
{
10
return
text::produce_simple_string
(
state
, csv);
11
}
12
13
void
on_update
(
sys::state
&
state
)
noexcept
override
{
14
set_text
(
state
,
get_text
(
state
,
"invest_project_title"
));
15
}
16
};
17
18
class
project_investment_current_funds
:
public
simple_text_element_base
{
19
public
:
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
{
25
set_text
(
state
,
get_text
(
state
));
26
}
27
};
28
29
class
project_investment_window
:
public
window_element_base
{
30
public
:
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
ui::project_investment_current_funds
Definition:
gui_project_investment_window.hpp:18
ui::project_investment_current_funds::on_update
void on_update(sys::state &state) noexcept override
Definition:
gui_project_investment_window.hpp:24
ui::project_investment_current_funds::get_text
std::string get_text(sys::state &state) noexcept
Definition:
gui_project_investment_window.hpp:20
ui::project_investment_header
Definition:
gui_project_investment_window.hpp:7
ui::project_investment_header::on_update
void on_update(sys::state &state) noexcept override
Definition:
gui_project_investment_window.hpp:13
ui::project_investment_header::get_text
std::string get_text(sys::state &state, std::string csv) noexcept
Definition:
gui_project_investment_window.hpp:9
ui::project_investment_window
Definition:
gui_project_investment_window.hpp:29
ui::project_investment_window::make_child
std::unique_ptr< element_base > make_child(sys::state &state, std::string_view name, dcon::gui_def_id id) noexcept override
Definition:
gui_project_investment_window.hpp:31
ui::simple_text_element_base
Definition:
gui_element_types.hpp:358
ui::simple_text_element_base::set_text
void set_text(sys::state &state, std::string const &new_text)
Definition:
gui_element_types.cpp:790
ui::window_element_base
Definition:
gui_element_types.hpp:443
gui_element_types.hpp
nations::get_treasury
float get_treasury(sys::state &state, dcon::nation_id n)
Definition:
nations.cpp:1042
text::format_money
std::string format_money(float num)
Definition:
text.cpp:1029
text::produce_simple_string
std::string produce_simple_string(sys::state const &state, dcon::text_key id)
Definition:
text.cpp:617
ui
Definition:
constants.hpp:582
ui::production_sort_order::name
@ name
sys::state
Definition:
system_state.hpp:472
ui::state
Definition:
gui_graphics.hpp:403
src
gui
topbar_subwindows
production_subwindows
gui_project_investment_window.hpp
Generated by
1.9.5