Skip to content

Commit 0878805

Browse files
committed
Address some PR comments
1 parent 2e3d389 commit 0878805

2 files changed

Lines changed: 113 additions & 83 deletions

File tree

extension/src/openvic-extension/singletons/TechnologyMenu.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Dictionary MenuSingleton::get_technology_menu_defines() const {
3636
int32_t num_in_folder = 0;
3737

3838
PackedStringArray folder_areas {};
39-
Array tech_folder_nested_array {}; // tech_identifiers has three levels of nested arrays :P
39+
TypedArray<PackedStringArray> tech_folder_nested_array {}; // tech_identifiers has three levels of nested arrays :P
4040
for (TechnologyArea const* area : folder.get_technology_areas()) {
4141
folder_areas.push_back(Utilities::std_to_godot_string(area->get_identifier()));
4242

@@ -68,20 +68,20 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
6868
TechnologyManager const& tech_manager = definition_manager.get_research_manager().get_technology_manager();
6969

7070
static const StringName tech_school_key = "tech_school";
71-
static const StringName tech_school_mod_values = "tech_school_mod_values";
72-
static const StringName tech_school_mod_icons = "tech_school_mod_icons";
73-
static const StringName tech_school_mod_tt = "tech_school_mod_tt";
71+
static const StringName tech_school_mod_values_key = "tech_school_mod_values";
72+
static const StringName tech_school_mod_icons_key = "tech_school_mod_icons";
73+
static const StringName tech_school_mod_tt_key = "tech_school_mod_tt";
7474

7575
static const StringName researched_technologies_key = "researched_technologies";
7676
static const StringName researchable_technologies_key = "researchable_technologies";
7777

78-
static const StringName current_research_tech = "current_research_tech";
79-
static const StringName current_research_cat = "current_research_cat";
80-
static const StringName current_research_finish_date = "current_research_finish_date";
81-
static const StringName current_research_invested = "current_research_invested";
82-
static const StringName current_research_cost = "current_research_cost";
83-
static const StringName current_research_effect_tt = "current_research_effect_tt";
84-
static const StringName current_research_progress = "current_research_progress";
78+
static const StringName current_research_tech_key = "current_research_tech";
79+
static const StringName current_research_cat_key = "current_research_cat";
80+
static const StringName current_research_finish_date_key = "current_research_finish_date";
81+
static const StringName current_research_invested_key = "current_research_invested";
82+
static const StringName current_research_cost_key = "current_research_cost";
83+
static const StringName current_research_effect_tt_key = "current_research_effect_tt";
84+
static const StringName current_research_progress_key = "current_research_progress";
8585

8686
Dictionary ret;
8787

@@ -90,7 +90,7 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
9090
return ret;
9191
}
9292

93-
TechnologySchool const* tech_school = country->get_tech_school();
93+
TechnologySchool const* tech_school = country->get_tech_school();
9494
if (tech_school == nullptr) {
9595
tech_school = tech_manager.get_technology_school_by_index(0);
9696
}
@@ -110,9 +110,9 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
110110
school_modifier_tt.push_back(_make_modifier_effect_tooltip(*research_bonus_effect, research_bonus_value));
111111
}
112112
}
113-
ret[tech_school_mod_values] = std::move(school_modifier_values);
114-
ret[tech_school_mod_icons] = std::move(school_modifier_icons);
115-
ret[tech_school_mod_tt] = std::move(school_modifier_tt);
113+
ret[tech_school_mod_values_key] = std::move(school_modifier_values);
114+
ret[tech_school_mod_icons_key] = std::move(school_modifier_icons);
115+
ret[tech_school_mod_tt_key] = std::move(school_modifier_tt);
116116
}
117117

118118
PackedStringArray researched_technologies {};
@@ -130,15 +130,15 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
130130

131131
Technology const* current_research = country->get_current_research();
132132
if (current_research != nullptr) {
133-
ret[current_research_tech] = Utilities::std_to_godot_string(current_research->get_identifier());
134-
ret[current_research_cat] =
133+
ret[current_research_tech_key] = Utilities::std_to_godot_string(current_research->get_identifier());
134+
ret[current_research_cat_key] =
135135
tr(Utilities::std_to_godot_string(current_research->get_area().get_folder().get_identifier())) + ", " +
136136
tr(Utilities::std_to_godot_string(current_research->get_area().get_identifier()));
137-
ret[current_research_finish_date] = Utilities::date_to_string(country->get_expected_research_completion_date());
138-
ret[current_research_invested] = country->get_invested_research_points().to_int32_t();
139-
ret[current_research_cost] = country->get_current_research_cost().to_int32_t();
140-
ret[current_research_effect_tt] = _make_modifier_effects_tooltip(*current_research).trim_prefix("\n");
141-
ret[current_research_progress] = country->get_research_progress().to_float();
137+
ret[current_research_finish_date_key] = Utilities::date_to_string(country->get_expected_research_completion_date());
138+
ret[current_research_invested_key] = country->get_invested_research_points().to_int32_t();
139+
ret[current_research_cost_key] = country->get_current_research_cost().to_int32_t();
140+
ret[current_research_effect_tt_key] = _make_modifier_effects_tooltip(*current_research).trim_prefix("\n");
141+
ret[current_research_progress_key] = country->get_research_progress().to_float();
142142
}
143143

144144
return ret;
@@ -147,7 +147,7 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
147147
Dictionary MenuSingleton::get_specific_technology_info(String technology_identifier) const {
148148
DefinitionManager const& definition_manager = GameSingleton::get_singleton()->get_definition_manager();
149149

150-
static const StringName effect_tooltip_key = "effects";
150+
static const StringName effect_tooltip_key = "effects_tooltip";
151151
static const StringName research_points_key = "research_points";
152152
static const StringName start_year_key = "start_year";
153153
static const StringName prerequisite_key = "prerequisite";

0 commit comments

Comments
 (0)