From: terencehill Date: Wed, 5 Mar 2025 10:04:42 +0000 (+0100) Subject: Mutators menu: Add radio buttons for g_new_toys_autoreplace. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8d9d8c0a28d71a05200abf11c69e6e37d8b1355d;p=xonotic%2Fxonotic-data.pk3dir.git Mutators menu: Add radio buttons for g_new_toys_autoreplace. Also improve g_new_toys checkbox tooltip and g_new_toys* cvar descriptions. --- diff --git a/mutators.cfg b/mutators.cfg index 9b1476868..5559fbf43 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -324,8 +324,8 @@ set g_campcheck_typecheck 0 "damage campers who are typing" // ========== // new toys // ========== -set g_new_toys 1 "Mutator 'New Toys': enable extra fun guns" // script-ignore -set g_new_toys_autoreplace 0 "\"0\" = never replace, \"1\" = always auto replace guns by available new toys, \"2\" = randomly auto replace guns by available new toys" +set g_new_toys 1 "allow maps to spawn additional weapons (new toys)" +set g_new_toys_autoreplace 0 "\"0\" = never replace, \"1\" = automatically replace some weapons of the map with their corresponding additional weapons, \"2\" = like 1 but randomly spawn normal weapons or their corresponding additional weapons" set g_new_toys_use_pickupsound 0 "play the 'new toys, new toys!' roflsound when picking up a new toys weapon" diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc index 44dd568d6..23026c98f 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc @@ -45,6 +45,12 @@ float checkCompatibility_newtoys(entity me) return 0; return 1; } +float checkCompatibility_newtoys_autoreplace(entity me) +{ + if(!cvar("g_new_toys")) + return 0; + return checkCompatibility_newtoys(me); +} float checkCompatibility_weaponarena_weapon(entity me) { if(cvar("g_instagib")) @@ -129,9 +135,20 @@ void XonoticMutatorsDialog_fill(entity me) setDependent(e, "g_instagib", 0, 0); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.8, e = makeXonoticCheckBox_T(0, "g_new_toys", _("New Toys"), - _("Some weapon spawns will be randomly replaced with new weapons: Heavy Laser Assault Cannon, Mine Layer, Rifle, T.A.G. Seeker"))); + me.TD(me, 1, 1.8 / 2, e = makeXonoticCheckBox_T(0, "g_new_toys", _("New Toys"), + _("Allow maps to spawn additional weapons (new toys)"))); setDependentWeird(e, checkCompatibility_newtoys); + me.TD(me, 1, 1.8 / 2, e = makeXonoticTextLabel(0, _("Replacement:"))); + setDependentWeird(e, checkCompatibility_newtoys_autoreplace); + string nta_tooltip = _("Automatically replace some normal weapons of the map with their corresponding additional weapons"); + me.TR(me); + me.TDempty(me, 0.4); + me.TD(me, 1, 1.6 / 3, e = makeXonoticRadioButton_T(3, "g_new_toys_autoreplace", "0", _("Never"), nta_tooltip)); + setDependentWeird(e, checkCompatibility_newtoys_autoreplace); + me.TD(me, 1, 1.6 / 3, e = makeXonoticRadioButton_T(3, "g_new_toys_autoreplace", "1", _("Always"), nta_tooltip)); + setDependentWeird(e, checkCompatibility_newtoys_autoreplace); + me.TD(me, 1, 1.6 / 3, e = makeXonoticRadioButton_T(3, "g_new_toys_autoreplace", "2", _("Randomly"), nta_tooltip)); + setDependentWeird(e, checkCompatibility_newtoys_autoreplace); me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.8, e = makeXonoticCheckBox_T(0, "g_rocket_flying", _("Rocket Flying"), @@ -151,7 +168,7 @@ void XonoticMutatorsDialog_fill(entity me) me.gotoRC(me, 0, 2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 2, e = makeXonoticRadioButton(1, string_null, string_null, _("Regular (no arena)"))); - string weaponarena_tooltip = strzone(_("Players will be given a set of weapons at spawn as well as unlimited ammo, without weapon pickups")); + string weaponarena_tooltip = _("Players will be given a set of weapons at spawn as well as unlimited ammo, without weapon pickups"); me.TR(me); me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Weapon arenas:"))); me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qh b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qh index 6722e1eac..5aaf8a632 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qh @@ -8,7 +8,7 @@ CLASS(XonoticMutatorsDialog, XonoticDialog) ATTRIB(XonoticMutatorsDialog, title, string, _("Mutators")); ATTRIB(XonoticMutatorsDialog, color, vector, SKINCOLOR_DIALOG_MUTATORS); ATTRIB(XonoticMutatorsDialog, intendedWidth, float, 0.9); - ATTRIB(XonoticMutatorsDialog, rows, float, 20); + ATTRIB(XonoticMutatorsDialog, rows, float, 21); ATTRIB(XonoticMutatorsDialog, columns, float, 6); ATTRIB(XonoticMutatorsDialog, refilterEntity, entity); ENDCLASS(XonoticMutatorsDialog)