diff --git a/changelog.md b/changelog.md index f42623b148f..fea4e40e98c 100644 --- a/changelog.md +++ b/changelog.md @@ -13,7 +13,7 @@ ### Units ### User interface ### WML Engine - * [unit] no longer accepts hp_bar_scaling and xp_bar_scaling keys + * [unit] and [unit_type] no longer accept hp_bar_scaling and xp_bar_scaling keys ### Miscellaneous and Bug Fixes ## Version 1.19.8 diff --git a/data/schema/units/types.cfg b/data/schema/units/types.cfg index 0bf9da93a51..1c9bc4c403c 100644 --- a/data/schema/units/types.cfg +++ b/data/schema/units/types.cfg @@ -19,7 +19,6 @@ {SIMPLE_KEY healed_sound string} {SIMPLE_KEY hide_help bool} {SIMPLE_KEY hitpoints int} - {SIMPLE_KEY hp_bar_scaling real} {SIMPLE_KEY ignore_race_traits bool} {SIMPLE_KEY image string} {SIMPLE_KEY image_icon string} @@ -36,7 +35,6 @@ {SIMPLE_KEY undead_variation string} {SIMPLE_KEY usage ai_usage} {SIMPLE_KEY vision int} - {SIMPLE_KEY xp_bar_scaling real} {SIMPLE_KEY bar_offset_x int} {SIMPLE_KEY bar_offset_y int} {SIMPLE_KEY zoc bool} diff --git a/src/units/drawer.cpp b/src/units/drawer.cpp index 278bbebb82f..4519d233c95 100644 --- a/src/units/drawer.cpp +++ b/src/units/drawer.cpp @@ -373,7 +373,7 @@ void unit_drawer::redraw_unit(const unit& u) const if(u.max_hitpoints() > 0) { bars.AGGREGATE_EMPLACE( - energy_bar::get_height(u.max_hitpoints(), u.hp_bar_scaling()), + energy_bar::get_height(u.max_hitpoints(), game_config::hp_bar_scaling), energy_bar::get_filled(u.hitpoints(), u.max_hitpoints()), energy_bar::get_color(u.hp_color(), bar_focus) ); @@ -381,7 +381,7 @@ void unit_drawer::redraw_unit(const unit& u) const if(u.experience() > 0 && u.can_advance()) { bars.AGGREGATE_EMPLACE( - energy_bar::get_height(u.max_experience(), u.xp_bar_scaling() / std::max(u.level(), 1)), + energy_bar::get_height(u.max_experience(), game_config::xp_bar_scaling / std::max(u.level(), 1)), energy_bar::get_filled(u.experience(), u.max_experience()), energy_bar::get_color(u.xp_color(), bar_focus) ); diff --git a/src/units/types.cpp b/src/units/types.cpp index 4cfd5955672..aa62678e2d0 100644 --- a/src/units/types.cpp +++ b/src/units/types.cpp @@ -59,8 +59,6 @@ unit_type::unit_type(const unit_type& o) , type_name_(o.type_name_) , description_(o.description_) , hitpoints_(o.hitpoints_) - , hp_bar_scaling_(o.hp_bar_scaling_) - , xp_bar_scaling_(o.xp_bar_scaling_) , level_(o.level_) , recall_cost_(o.recall_cost_) , movement_(o.movement_) @@ -110,8 +108,6 @@ unit_type::unit_type(defaut_ctor_t, const config& cfg, const std::string & paren , type_name_() , description_() , hitpoints_(0) - , hp_bar_scaling_(0.0) - , xp_bar_scaling_(0.0) , level_(0) , recall_cost_() , movement_(0) @@ -217,9 +213,6 @@ void unit_type::build_full( game_config::add_color_info(game_config_view::wrap(get_cfg())); - hp_bar_scaling_ = get_cfg()["hp_bar_scaling"].to_double(game_config::hp_bar_scaling); - xp_bar_scaling_ = get_cfg()["xp_bar_scaling"].to_double(game_config::xp_bar_scaling); - // Propagate the build to the variations. for(variations_map::value_type& variation : variations_) { variation.second.build_full(mv_types, races, traits); diff --git a/src/units/types.hpp b/src/units/types.hpp index 3db8ef62430..be043b73e3a 100644 --- a/src/units/types.hpp +++ b/src/units/types.hpp @@ -159,8 +159,6 @@ public: */ std::vector special_notes() const; int hitpoints() const { return hitpoints_; } - double hp_bar_scaling() const { return hp_bar_scaling_; } - double xp_bar_scaling() const { return xp_bar_scaling_; } int level() const { return level_; } int recall_cost() const { return recall_cost_;} int movement() const { return movement_; } @@ -330,7 +328,6 @@ private: t_string description_; std::vector special_notes_; int hitpoints_; - double hp_bar_scaling_, xp_bar_scaling_; int level_; int recall_cost_; int movement_; diff --git a/src/units/unit.cpp b/src/units/unit.cpp index deb185fe019..f4bdcc05ff4 100644 --- a/src/units/unit.cpp +++ b/src/units/unit.cpp @@ -2779,16 +2779,6 @@ void unit::set_hidden(bool state) const anim_comp_->clear_haloes(); } -double unit::hp_bar_scaling() const -{ - return type().hp_bar_scaling(); -} - -double unit::xp_bar_scaling() const -{ - return type().xp_bar_scaling(); -} - void unit::set_image_halo(const std::string& halo) { appearance_changed_ = true; diff --git a/src/units/unit.hpp b/src/units/unit.hpp index 4674db81240..32b26ed26da 100644 --- a/src/units/unit.hpp +++ b/src/units/unit.hpp @@ -725,18 +725,6 @@ public: /** Sets whether the unit is hidden on the map. */ void set_hidden(bool state) const; - /** - * The factor by which the HP bar should be scaled. - * Convenience wrapper around the unit_type value. - */ - double hp_bar_scaling() const; - - /** - * The factor by which the XP bar should be scaled. - * Convenience wrapper around the unit_type value. - */ - double xp_bar_scaling() const; - /** * Whether the unit has been instructed to hold its position. * This excludes it from the unit cycling function.