1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
#include "GUIMaskedFlagButton.hpp"
#include "openvic-extension/utility/ClassBindings.hpp"
using namespace godot;
using namespace OpenVic;
void GUIMaskedFlagButton::_bind_methods() {
OV_BIND_METHOD(GUIMaskedFlagButton::get_gfx_masked_flag_texture);
OV_BIND_METHOD(GUIMaskedFlagButton::set_gfx_masked_flag_name, { "gfx_masked_flag_name" });
OV_BIND_METHOD(GUIMaskedFlagButton::get_gfx_masked_flag_name);
OV_BIND_METHOD(GUIMaskedFlagButton::set_flag_country_name_and_type, { "flag_country_name", "flag_type" });
OV_BIND_METHOD(GUIMaskedFlagButton::set_flag_country_name, { "flag_country_name" });
OV_BIND_METHOD(GUIMaskedFlagButton::get_flag_country_name);
OV_BIND_METHOD(GUIMaskedFlagButton::get_flag_type);
}
Error GUIMaskedFlagButton::set_gfx_masked_flag(GFX::MaskedFlag const* gfx_masked_flag) {
const bool needs_setting = gfx_masked_flag_texture.is_null();
if (needs_setting) {
gfx_masked_flag_texture.instantiate();
ERR_FAIL_NULL_V(gfx_masked_flag_texture, FAILED);
}
Error err = gfx_masked_flag_texture->set_gfx_masked_flag(gfx_masked_flag);
if (needs_setting && set_gfx_button_state_having_texture(gfx_masked_flag_texture) != OK) {
err = FAILED;
}
return err;
}
Ref<GFXMaskedFlagTexture> GUIMaskedFlagButton::get_gfx_masked_flag_texture() const {
ERR_FAIL_NULL_V(gfx_masked_flag_texture, nullptr);
return gfx_masked_flag_texture;
}
Error GUIMaskedFlagButton::set_gfx_masked_flag_name(String const& gfx_masked_flag_name) {
const bool needs_setting = gfx_masked_flag_texture.is_null();
if (needs_setting) {
gfx_masked_flag_texture.instantiate();
ERR_FAIL_NULL_V(gfx_masked_flag_texture, FAILED);
}
Error err = gfx_masked_flag_texture->set_gfx_masked_flag_name(gfx_masked_flag_name);
if (needs_setting && set_gfx_button_state_having_texture(gfx_masked_flag_texture) != OK) {
err = FAILED;
}
return err;
}
String GUIMaskedFlagButton::get_gfx_masked_flag_name() const {
ERR_FAIL_NULL_V(gfx_masked_flag_texture, {});
return gfx_masked_flag_texture->get_gfx_masked_flag_name();
}
Error GUIMaskedFlagButton::set_flag_country_name_and_type(String const& flag_country_name, StringName const& flag_type) const {
ERR_FAIL_NULL_V(gfx_masked_flag_texture, FAILED);
return gfx_masked_flag_texture->set_flag_country_name_and_type(flag_country_name, flag_type);
}
Error GUIMaskedFlagButton::set_flag_country_name(String const& flag_country_name) const {
ERR_FAIL_NULL_V(gfx_masked_flag_texture, FAILED);
return gfx_masked_flag_texture->set_flag_country_name(flag_country_name);
}
String GUIMaskedFlagButton::get_flag_country_name() const {
ERR_FAIL_NULL_V(gfx_masked_flag_texture, {});
return gfx_masked_flag_texture->get_flag_country_name();
}
String GUIMaskedFlagButton::get_flag_type() const {
ERR_FAIL_NULL_V(gfx_masked_flag_texture, {});
return gfx_masked_flag_texture->get_flag_type();
}
|