Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension/src/openvic-extension/classes/GUIScrollbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int32_t GUIScrollbar::_fp_to_value(const fixed_point_t val) const {
}

fixed_point_t GUIScrollbar::_get_scaled_value(const int32_t val) const {
return offset + fixed_point_t::parse(val) * scale_numerator / scale_denominator;
return offset + fixed_point_t(val) * scale_numerator / scale_denominator;
}

void GUIScrollbar::_calculate_rects() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void ScoreOverview::update() {
//TODO get data from sim

const long available_colonial_power = 123;
const long colonial_power_from_technology = 200;
const int32_t colonial_power_from_technology = 200;
const fixed_point_t colonial_power_invested = 60;
const fixed_point_t colonial_power_maintenance = 40;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ Dictionary MenuSingleton::get_province_info_from_number(int32_t province_number)
}

const fixed_point_t effect_multiplier = job.get_effect_multiplier();
fixed_point_t relative_to_workforce = fixed_point_t::parse(employees_of_type) / max_employee_count;
fixed_point_t relative_to_workforce = fixed_point_t(employees_of_type) / max_employee_count;
const fixed_point_t effect_value = effect_multiplier == fixed_point_t::_1
? relative_to_workforce
: effect_multiplier * std::min(relative_to_workforce, job.get_amount());
Expand Down
12 changes: 6 additions & 6 deletions extension/src/openvic-extension/singletons/MilitaryMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,16 @@ Dictionary MenuSingleton::make_in_progress_unit_dict() const {
const ordered_map<GoodDefinition const*, std::pair<fixed_point_t, fixed_point_t>> required_goods {
{
good_definition_manager.get_good_definition_by_index(good_index_t(0)),
{ fixed_point_t::parse(1234) / 100, fixed_point_t::parse(1900) / 100 }
{ fixed_point_t(1234) / 100, fixed_point_t(1900) / 100 }
}, {
good_definition_manager.get_good_definition_by_index(good_index_t(1)),
{ fixed_point_t::parse(888) / 100, fixed_point_t::parse(1444) / 100 }
{ fixed_point_t(888) / 100, fixed_point_t(1444) / 100 }
}, {
good_definition_manager.get_good_definition_by_index(good_index_t(2)),
{ fixed_point_t::parse(1622) / 100, fixed_point_t::parse(1622) / 100 }
{ fixed_point_t(1622) / 100, fixed_point_t(1622) / 100 }
}, {
good_definition_manager.get_good_definition_by_index(good_index_t(3)),
{ fixed_point_t::parse(211) / 100, fixed_point_t::parse(805) / 100 }
{ fixed_point_t(211) / 100, fixed_point_t(805) / 100 }
}
};

Expand Down Expand Up @@ -483,12 +483,12 @@ Dictionary MenuSingleton::get_military_menu_info() {
*country, *modifier_effect_cache.get_unit_recruitment_time()
);

ret[military_info_combat_width_key] = country->get_combat_width();
ret[military_info_combat_width_key] = type_safe::get(country->get_combat_width());
{
static const StringName base_value_combat_width_localisation_key = "COMWID_BASE";
String combat_width_tooltip = tr(base_value_combat_width_localisation_key).replace(
Utilities::get_short_value_placeholder(), String::num_uint64(
definition_manager.get_define_manager().get_military_defines().get_base_combat_width()
type_safe::get(definition_manager.get_define_manager().get_military_defines().get_base_combat_width())
)
);
const fixed_point_t combat_width = country->get_modifier_effect_value(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Error MenuSingleton::_population_menu_update_filtered_pops() {
}

for (Pop const* pop : population_menu.filtered_pops) {
const fixed_point_t pop_size = fixed_point_t::parse(pop->get_size());
const fixed_point_t pop_size = fixed_point_t(pop->get_size());

population_menu.workforce_distribution[pop->get_type()] += pop_size;
population_menu.religion_distribution[&pop->religion] += pop_size;
Expand Down
2 changes: 1 addition & 1 deletion extension/src/openvic-extension/singletons/TradeMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Dictionary MenuSingleton::get_trade_menu_tables_info() const {
top_producer_template_string,
convert_to<String>(country->get_identifier()),
Utilities::get_country_name(*this, *country),
Utilities::fixed_point_to_string_dp(fixed_point_t::parse(1000) / static_cast<int32_t>(index + 1), 2)
Utilities::fixed_point_to_string_dp(fixed_point_t(1000) / static_cast<int32_t>(index + 1), 2)
);
}

Expand Down
Loading