MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / updateSoldierButtons

Method updateSoldierButtons

game/ui/tileview/battleview.cpp:2020–2185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2018}
2019
2020void BattleView::updateSoldierButtons()
2021{
2022 bool cease_fire = false;
2023 bool at_will = false;
2024 bool aimed = false;
2025 bool snap = false;
2026 bool auto_fire = false;
2027 bool kneeling = false;
2028 bool not_kneeling = false;
2029 bool prone = false;
2030 bool walk = false;
2031 bool run = false;
2032 bool evasive = false;
2033 bool normal = false;
2034 bool aggressive = false;
2035 bool reserve_aimed_set = false;
2036 bool reserve_snap_set = false;
2037 bool reserve_auto_set = false;
2038 bool reserve_kneel_set = false;
2039 bool reserve_shot_unset = false;
2040 bool reserve_kneel_unset = false;
2041 for (auto &u : battle.battleViewSelectedUnits)
2042 {
2043 switch (u->fire_aiming_mode)
2044 {
2045 case WeaponAimingMode::Aimed:
2046 aimed = true;
2047 break;
2048 case WeaponAimingMode::Snap:
2049 snap = true;
2050 break;
2051 case WeaponAimingMode::Auto:
2052 auto_fire = true;
2053 break;
2054 }
2055 if (u->fire_permission_mode == BattleUnit::FirePermissionMode::CeaseFire)
2056 {
2057 cease_fire = true;
2058 }
2059 else
2060 {
2061 at_will = true;
2062 }
2063 switch (u->behavior_mode)
2064 {
2065 case BattleUnit::BehaviorMode::Evasive:
2066 evasive = true;
2067 break;
2068 case BattleUnit::BehaviorMode::Normal:
2069 normal = true;
2070 break;
2071 case BattleUnit::BehaviorMode::Aggressive:
2072 aggressive = true;
2073 break;
2074 }
2075 switch (u->movement_mode)
2076 {
2077 case MovementMode::Prone:

Callers

nothing calls this directly

Calls 10

trFunction · 0.85
formatFunction · 0.85
getFirstItemInSlotMethod · 0.80
getFireCostMethod · 0.80
emptyMethod · 0.80
isThrowingMethod · 0.80
setStateMethod · 0.45
setCheckedMethod · 0.45
sizeMethod · 0.45
canFireMethod · 0.45

Tested by

no test coverage detected