From: terencehill Date: Wed, 29 Jan 2025 02:04:02 +0000 (+0100) Subject: Menu Settings/Game/Weapons: fix checkbox on the bottom overlapping the Apply button X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9abf63204642296fb9a0dbcc3430176a7576a19c;p=xonotic%2Fxonotic-data.pk3dir.git Menu Settings/Game/Weapons: fix checkbox on the bottom overlapping the Apply button Also fix non-empty string checks in a few display functions --- diff --git a/qcsrc/common/items/item.qh b/qcsrc/common/items/item.qh index fb8ea45a2..3b5970a4a 100644 --- a/qcsrc/common/items/item.qh +++ b/qcsrc/common/items/item.qh @@ -135,7 +135,7 @@ CLASS(GameItem, Object) METHOD(GameItem, display, void(GameItem this, void(string name, string icon) returns)) { TC(GameItem, this); - returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon) : string_null); + returns(this.m_name, (this.m_icon != "") ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon) : string_null); } METHOD(GameItem, show, void(GameItem this)) { diff --git a/qcsrc/common/mutators/mutator/status_effects/all.qh b/qcsrc/common/mutators/mutator/status_effects/all.qh index b2f8ec4e5..726733036 100644 --- a/qcsrc/common/mutators/mutator/status_effects/all.qh +++ b/qcsrc/common/mutators/mutator/status_effects/all.qh @@ -54,6 +54,6 @@ CLASS(StatusEffect, Object) METHOD(StatusEffect, display, void(StatusEffect this, void(string name, string icon) returns)) { TC(StatusEffect, this); - returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon) : string_null); + returns(this.m_name, (this.m_icon != "") ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.m_icon) : string_null); } ENDCLASS(StatusEffect) diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 0a7813428..611f8f5f7 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -127,7 +127,7 @@ CLASS(Weapon, Object) /** (SERVER) update cvar based properties */ METHOD(Weapon, wr_update, void(Weapon this)) {} METHOD(Weapon, display, void(entity this, void(string name, string icon) returns)) { - returns(this.m_name, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.model2) : string_null); + returns(this.m_name, (this.model2 != "") ? sprintf("/gfx/hud/%s/%s", cvar_string("hud_skin"), this.model2) : string_null); } ENDCLASS(Weapon) diff --git a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc index 0be20329d..0254e3d04 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc @@ -101,14 +101,11 @@ void XonoticGameWeaponsSettingsTab_fill(entity me) me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "cl_tracers_teamcolor", "2", _("Always"))); me.TR(me); me.TR(me); - me.TDempty(me, 0.2); - me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "cl_followmodel", _("Gun model swaying"), "-")); - makeMulti(e, "cl_leanmodel"); - setDependent(e, "r_drawviewmodel", 1, 1); - me.TR(me); - me.TDempty(me, 0.2); - me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_bobmodel", _("Gun model bobbing"))); - setDependent(e, "r_drawviewmodel", 1, 1); + me.TD(me, 1, 2.8 / 2, e = makeXonoticCheckBox_T(0, "cl_followmodel", _("Gun model swaying"), "-")); + makeMulti(e, "cl_leanmodel"); + setDependent(e, "r_drawviewmodel", 1, 1); + me.TD(me, 1, 2.8 / 2, e = makeXonoticCheckBox(0, "cl_bobmodel", _("Gun model bobbing"))); + setDependent(e, "r_drawviewmodel", 1, 1); me.gotoRC(me, me.rows - 1, 0); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, me.columns, weaponsApplyButton); }