]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/menu_fixes' into 'master'
authorMario <zacjardine@y7mail.com>
Mon, 4 Jan 2016 11:51:32 +0000 (11:51 +0000)
committerMario <zacjardine@y7mail.com>
Mon, 4 Jan 2016 11:51:32 +0000 (11:51 +0000)
Menu fixes

Misc bug fixes, most notable ones are in the first 2 commits:
* Increase number of rows of Game Settings tabs so they match Settings tab rows and add back items that long time ago got removed when nested tabs were introduced
* Add back a few Apply buttons and update/fix their commands

See merge request !264

1  2 
qcsrc/common/mutators/mutator/damagetext/damagetext.qc
qcsrc/menu/xonotic/dialog_teamselect.qc

index a6110b01a21e492870dc74c0761d2f8693affec5,264a412b0c14eb1d483f4a8b734f05a45fbaa813..5fb4b1bf4cc3615bf98aefffab3b6e2a7db7eaca
@@@ -2,7 -2,7 +2,7 @@@
  #define MUTATOR_DAMAGETEXT_H
  
  #ifdef MENUQC
 -#include "../../../../menu/xonotic/tab.qc"
 +#include <menu/xonotic/tab.qc>
  #endif
  
  #endif
@@@ -88,24 -88,23 +88,24 @@@ MUTATOR_HOOKFUNCTION(damagetext, Player
      const int armor = MUTATOR_ARGV(1, int);
      const int deathtype = MUTATOR_ARGV(2, int);
      const vector location = hit.origin;
 -    entity e;
 -    FOR_EACH_REALCLIENT(e) if (
 -        (SV_DAMAGETEXT_ALL()) ||
 -        (SV_DAMAGETEXT_PLAYERS() && e == attacker) ||
 -        (SV_DAMAGETEXT_SPECTATORS_ONLY() && IS_SPEC(e) && e.enemy == attacker) ||
 -        (SV_DAMAGETEXT_SPECTATORS_ONLY() && IS_OBSERVER(e))
 -    ) {
 -        msg_entity = e;
 -        WriteHeader(MSG_ONE, damagetext);
 -        WriteShort(MSG_ONE, health);
 -        WriteShort(MSG_ONE, armor);
 -        WriteEntity(MSG_ONE, hit);
 -        WriteCoord(MSG_ONE, location.x);
 -        WriteCoord(MSG_ONE, location.y);
 -        WriteCoord(MSG_ONE, location.z);
 -        WriteInt24_t(MSG_ONE, deathtype);
 -    }
 +    FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
 +        if (
 +            (SV_DAMAGETEXT_ALL()) ||
 +            (SV_DAMAGETEXT_PLAYERS() && it == attacker) ||
 +            (SV_DAMAGETEXT_SPECTATORS_ONLY() && IS_SPEC(it) && it.enemy == attacker) ||
 +            (SV_DAMAGETEXT_SPECTATORS_ONLY() && IS_OBSERVER(it))
 +        ) {
 +            msg_entity = it;
 +            WriteHeader(MSG_ONE, damagetext);
 +            WriteShort(MSG_ONE, health);
 +            WriteShort(MSG_ONE, armor);
 +            WriteEntity(MSG_ONE, hit);
 +            WriteCoord(MSG_ONE, location.x);
 +            WriteCoord(MSG_ONE, location.y);
 +            WriteCoord(MSG_ONE, location.z);
 +            WriteInt24_t(MSG_ONE, deathtype);
 +        }
 +    ));
  }
  #endif
  
@@@ -134,11 -133,11 +134,11 @@@ NET_HANDLE(damagetext, bool isNew
  
  #ifdef MENUQC
  CLASS(XonoticDamageTextSettings, XonoticTab)
 -    #include "../../../../menu/gamesettings.qh"
 +    #include <menu/gamesettings.qh>
      REGISTER_SETTINGS(damagetext, NEW(XonoticDamageTextSettings));
      ATTRIB(XonoticDamageTextSettings, title, string, _("Damage text"))
      ATTRIB(XonoticDamageTextSettings, intendedWidth, float, 0.9)
-     ATTRIB(XonoticDamageTextSettings, rows, float, 13)
+     ATTRIB(XonoticDamageTextSettings, rows, float, 15.5)
      ATTRIB(XonoticDamageTextSettings, columns, float, 5)
      INIT(XonoticDamageTextSettings) { this.configureDialog(this); }
      METHOD(XonoticDamageTextSettings, showNotify, void(entity this)) { loadAllCvars(this); }
index 9185a1f6ea15f825caeed300e5f0e0bb63238cca,f3bb1aaa8ac26ed43c7201852f77a7e334c9ad43..15e023f79a2356106696dac0933183b663872044
@@@ -2,9 -2,9 +2,9 @@@
  #define DIALOG_TEAMSELECT_H
  #include "rootdialog.qc"
  CLASS(XonoticTeamSelectDialog, XonoticRootDialog)
-       METHOD(XonoticTeamSelectDialog, fill, void(entity)); // to be overridden by user to fill the dialog with controls
+       METHOD(XonoticTeamSelectDialog, fill, void(entity));
        METHOD(XonoticTeamSelectDialog, showNotify, void(entity));
-       ATTRIB(XonoticTeamSelectDialog, title, string, _("Team Selection")) // ;)
+       ATTRIB(XonoticTeamSelectDialog, title, string, _("Team Selection"))
        ATTRIB(XonoticTeamSelectDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticTeamSelectDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticTeamSelectDialog, rows, float, 5)
@@@ -32,7 -32,6 +32,7 @@@ entity makeTeamButton(string theName, v
  
  void XonoticTeamSelectDialog_showNotify(entity me)
  {
 +      SUPER(XonoticTeamSelectDialog).showNotify(me);
        float teams, nTeams;
        teams = cvar("_teams_available");
        nTeams = 0;