@@ -24,25 +24,25 @@ Dictionary MenuSingleton::get_technology_menu_defines() const {
2424
2525 Dictionary ret;
2626
27- std ::vector<OpenVic:: TechnologyFolder> const & tech_folders = GameSingleton::get_singleton ()->get_definition_manager ()
27+ memory ::vector<TechnologyFolder> const & tech_folders = GameSingleton::get_singleton ()->get_definition_manager ()
2828 .get_research_manager ().get_technology_manager ().get_technology_folders ();
2929
3030 PackedStringArray tech_folder_identifiers {};
3131 TypedArray<PackedStringArray> tech_area_identifiers {};
3232 Array tech_identifiers {};
3333 PackedInt32Array folder_tech_count {};
3434 for (TechnologyFolder const & folder : tech_folders) {
35- tech_folder_identifiers.push_back (Utilities::std_to_godot_string ( folder.get_identifier ()));
35+ tech_folder_identifiers.push_back (folder.get_identifier (). data ( ));
3636 int32_t num_in_folder = 0 ;
3737
3838 PackedStringArray folder_areas {};
3939 TypedArray<PackedStringArray> tech_folder_nested_array {}; // tech_identifiers has three levels of nested arrays :P
4040 for (TechnologyArea const * area : folder.get_technology_areas ()) {
41- folder_areas.push_back (Utilities::std_to_godot_string ( area->get_identifier ()));
41+ folder_areas.push_back (area->get_identifier (). data ( ));
4242
4343 PackedStringArray area_technologies {};
4444 for (Technology const * tech : area->get_technologies ()) {
45- area_technologies.push_back (Utilities::std_to_godot_string ( tech->get_identifier ()));
45+ area_technologies.push_back (tech->get_identifier (). data ( ));
4646 num_in_folder++;
4747 }
4848 tech_folder_nested_array.push_back (std::move (area_technologies));
@@ -85,17 +85,17 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
8585
8686 Dictionary ret;
8787
88- CountryInstance const * country = PlayerSingleton::get_singleton ()->get_player_country ();
88+ CountryInstance* country = PlayerSingleton::get_singleton ()->get_player_country ();
8989 if (country == nullptr ) {
9090 return ret;
9191 }
9292
93- TechnologySchool const * tech_school = country->get_tech_school ();
93+ TechnologySchool const * tech_school = country->get_tech_school (). get_untracked () ;
9494 if (tech_school == nullptr ) {
9595 tech_school = tech_manager.get_technology_school_by_index (0 );
9696 }
9797 if (tech_school != nullptr ) {
98- ret[tech_school_key] = Utilities::std_to_godot_string ( tech_school->get_identifier ());
98+ ret[tech_school_key] =tech_school->get_identifier (). data ( );
9999 PackedFloat32Array school_modifier_values;
100100 PackedInt32Array school_modifier_icons;
101101 PackedStringArray school_modifier_tt;
@@ -104,9 +104,9 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
104104 definition_manager.get_modifier_manager ().get_modifier_effect_cache ().get_research_bonus_effects ()
105105 ) {
106106 const fixed_point_t research_bonus_value = tech_school->get_effect (*research_bonus_effect);
107- if (research_bonus_value != fixed_point_t::_0 () ) {
108- school_modifier_values.push_back (research_bonus_value. to_float ( ));
109- school_modifier_icons.push_back (1 + tech_folder.get_index () );
107+ if (research_bonus_value != fixed_point_t ::_0) {
108+ school_modifier_values.push_back (static_cast < float >(research_bonus_value ));
109+ school_modifier_icons.push_back (1 + tech_folder.index . value_ );
110110 school_modifier_tt.push_back (_make_modifier_effect_tooltip (*research_bonus_effect, research_bonus_value));
111111 }
112112 }
@@ -119,32 +119,32 @@ Dictionary MenuSingleton::get_technology_menu_info() const {
119119 PackedStringArray researchable_technologies {};
120120 for (Technology const & tech : tech_manager.get_technologies ()) {
121121 if (country->is_technology_unlocked (tech)) {
122- researched_technologies.push_back (Utilities::std_to_godot_string ( tech.get_identifier ()));
122+ researched_technologies.push_back (tech.get_identifier (). data ( ));
123123 }
124124 if (country->can_research_tech (tech, instance_manager->get_today ())) {
125- researchable_technologies.push_back (Utilities::std_to_godot_string ( tech.get_identifier ()));
125+ researchable_technologies.push_back (tech.get_identifier (). data ( ));
126126 }
127127 }
128128 ret[researched_technologies_key] = std::move (researched_technologies);
129129 ret[researchable_technologies_key] = std::move (researchable_technologies);
130130
131- Technology const * current_research = country->get_current_research ();
131+ Technology const * current_research = country->get_current_research (). get_untracked () ;
132132 if (current_research != nullptr ) {
133- ret[current_research_tech_key] = Utilities::std_to_godot_string ( current_research->get_identifier ());
133+ ret[current_research_tech_key] = current_research->get_identifier (). data ( );
134134 ret[current_research_cat_key] =
135- tr (Utilities::std_to_godot_string ( current_research->get_area (). get_folder () .get_identifier ())) + " , " +
136- tr (Utilities::std_to_godot_string ( current_research->get_area () .get_identifier ()));
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 ( );
135+ tr (current_research->area . folder .get_identifier (). data ( )) + " , " +
136+ tr (current_research->area .get_identifier (). data ( ));
137+ ret[current_research_finish_date_key] = Utilities::date_to_string (country->get_expected_research_completion_date (). get_untracked () );
138+ ret[current_research_invested_key] = static_cast < int32_t >( country->get_invested_research_points ().get_untracked () );
139+ ret[current_research_cost_key] = static_cast < int32_t >( country->get_current_research_cost ().get_untracked () );
140140 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 ( );
141+ ret[current_research_progress_key] = static_cast < float >( country->research_progress . get_untracked () );
142142 }
143143
144144 return ret;
145145}
146146
147- Dictionary MenuSingleton::get_specific_technology_info (String technology_identifier) const {
147+ Dictionary MenuSingleton::get_specific_technology_info (const String& technology_identifier) const {
148148 DefinitionManager const & definition_manager = GameSingleton::get_singleton ()->get_definition_manager ();
149149
150150 static const StringName effect_tooltip_key = " effects_tooltip" ;
@@ -156,22 +156,18 @@ Dictionary MenuSingleton::get_specific_technology_info(String technology_identif
156156
157157 Technology const * technology =
158158 definition_manager.get_research_manager ().get_technology_manager ().get_technology_by_identifier (
159- Utilities::godot_to_std_string ( technology_identifier)
159+ technology_identifier. utf8 (). get_data ( )
160160 );
161161 CountryInstance const * player_country = PlayerSingleton::get_singleton ()->get_player_country ();
162162 if (technology == nullptr || player_country == nullptr ) {
163163 return ret;
164164 }
165165
166166 ret[effect_tooltip_key] = _make_modifier_effects_tooltip (*technology).trim_prefix (" \n " );
167- ret[research_points_key] = player_country->calculate_research_cost (
168- *technology, definition_manager.get_modifier_manager ().get_modifier_effect_cache ()
169- ).to_int32_t ();
167+ ret[research_points_key] = static_cast <int32_t >(player_country->calculate_research_cost (*technology));
170168 ret[start_year_key] = technology->get_year ();
171- if (technology->get_index_in_area () > 0 ) {
172- ret[prerequisite_key] = Utilities::std_to_godot_string (
173- technology->get_area ().get_technologies ()[technology->get_index_in_area () - 1 ]->get_identifier ()
174- );
169+ if (technology->index_in_area > 0 ) {
170+ ret[prerequisite_key] = technology->area .get_technologies ()[technology->index_in_area - 1 ]->get_identifier ().data ();
175171 }
176172
177173 return ret;
0 commit comments