From: terencehill Date: Fri, 26 Aug 2016 23:46:25 +0000 (+0200) Subject: Fix condition for splitting accuracy panel row in 2 (before it was split showing... X-Git-Tag: xonotic-v0.8.2~667 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1c3db9834928d31d77586c3bc28224be9b799e05;p=xonotic%2Fxonotic-data.pk3dir.git Fix condition for splitting accuracy panel row in 2 (before it was split showing 22 weapons, now 8 weapons are sufficient) --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index a229719f6..ade7b982f 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1004,19 +1004,25 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) WepSet weapons_stat = WepSet_GetFromStat(); WepSet weapons_inmap = WepSet_GetFromStat_InMap(); int disownedcnt = 0; + int nHidden = 0; FOREACH(Weapons, it != WEP_Null, { int weapon_stats = weapon_accuracy[i - WEP_FIRST]; WepSet set = it.m_wepset; - if (weapon_stats < 0 && !(weapons_stat & set || weapons_inmap & set)) - ++disownedcnt; + if (weapon_stats < 0) + { + if (!(weapons_stat & set) && (it.spawnflags & WEP_FLAG_HIDDEN || it.spawnflags & WEP_FLAG_MUTATORBLOCKED)) + nHidden += 1; + else if (!(weapons_stat & set || weapons_inmap & set)) + ++disownedcnt; + } }); - int weapon_cnt = (Weapons_COUNT - 1) - disownedcnt; + int weapon_cnt = (Weapons_COUNT - 1) - disownedcnt - nHidden; if (weapon_cnt <= 0) return pos; int rows = 1; - if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((Weapons_COUNT - 1) * 0.5)) + if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((Weapons_COUNT - nHidden - 1) * 0.5)) rows = 2; int columnns = ceil(weapon_cnt / rows); diff --git a/qcsrc/client/hud/panel/weapons.qc b/qcsrc/client/hud/panel/weapons.qc index 206bebc2f..db25d532a 100644 --- a/qcsrc/client/hud/panel/weapons.qc +++ b/qcsrc/client/hud/panel/weapons.qc @@ -25,7 +25,7 @@ int weaponorder_cmp(int i, int j, entity pass) int nHidden = 0; \ FOREACH(Weapons, it != WEP_Null, { \ if (weapons_stat & WepSet_FromWeapon(it)) continue; \ - if (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1; \ + if (it.spawnflags & WEP_FLAG_HIDDEN || it.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1; \ }); \ vector table_size = HUD_GetTableSize_BestItemAR((Weapons_COUNT - 1) - nHidden, panel_size, aspect); \ columns = table_size.x; \