]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' of ssh://gitlab.com/xonotic/xonotic-data.pk3dir into Melanosuch...
authorMattia Basaglia <mattia.basaglia@gmail.com>
Wed, 18 Feb 2015 15:13:25 +0000 (16:13 +0100)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Wed, 18 Feb 2015 15:13:25 +0000 (16:13 +0100)
1  2 
defaultXonotic.cfg
qcsrc/client/hud.qc
qcsrc/dpdefs/csprogsdefs.qh
qcsrc/server/cl_client.qc

diff --combined defaultXonotic.cfg
index ed5b33f1e280fa9485282915f7557c5b65b6b0be,f66dc0128bdb87059cb2a4433fb81f8f7365c75a..ff481316e13f0b289187f78b554283cbdc9ebe72
@@@ -472,7 -472,7 +472,7 @@@ set g_botclip_collisions 1 "0 = disabl
  set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
  
  set g_spawn_alloweffects 1 "allow clients to enable spawn point and event effects such as particles and sounds, see cl_spawn_ cvars for more info"
- set g_spawn_furthest 0.5 "this amount of the spawns shall be far away from any players"
+ set g_spawn_furthest 1.0 "this amount of the spawns shall be far away from any players"
  set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay"
  // respawn delay
  set g_respawn_delay_small 2 "small game number of seconds you have to wait before you can respawn again"
@@@ -1100,6 -1100,7 +1100,6 @@@ seta cl_gentle_damage 0         "client side g
  set g_jetpack 0 "Jetpack mutator"
  
  set g_running_guns 0 "... or wonder, till it drives you mad, what would have followed if you had."
 -set g_bastet 0 "don't try"
  
  set _urllib_nextslot 0 "temp variable"
  set cl_warpzone_usetrace 1 "do not touch"
@@@ -1397,7 -1398,6 +1397,7 @@@ exec gamemodes.cf
  exec mutators.cfg
  exec notifications.cfg
  exec monsters.cfg
 +exec minigames.cfg
  
  // load console command aliases and settings
  exec commands.cfg
diff --combined qcsrc/client/hud.qc
index de7cda425abc2b9a55c9f666be84fd8a573b5889,105cce5f2ea850f6cc95fbc25283b304e726f325..2b75edc946115417aa343b8a296db728658a7ed0
@@@ -530,35 -530,57 +530,57 @@@ void HUD_Weapons(void
                }
  
                vector old_panel_size = panel_size;
-               if(panel_bg_padding)
-                       old_panel_size -= '2 2 0' * panel_bg_padding;
-               // NOTE: the goal is to use the all-weapons layout and remove unneeded cells
-               // this way weapon icons always have the same size regardless of owned weapon count
+               vector padded_panel_size = panel_size - '2 2 0' * panel_bg_padding;
  
                // get the all-weapons layout
-               rows = HUD_GetRowCount(WEP_COUNT, old_panel_size, aspect);
-               columns = ceil(WEP_COUNT/rows);
-               weapon_size.x = old_panel_size.x / columns;
-               weapon_size.y = old_panel_size.y / rows;
+               rows = HUD_GetRowCount(WEP_COUNT, padded_panel_size, aspect);
+               columns = ceil(WEP_COUNT / rows);
+               weapon_size.x = padded_panel_size.x / columns;
+               weapon_size.y = padded_panel_size.y / rows;
  
                // reduce rows and columns as needed
-               columns = ceil(weapon_count / rows);
-               rows = ceil(weapon_count / columns);
-               // NOTE: although weapons should aways look the same even if onlyowned is disabled,
+               // NOTE: although weapons should aways look the same even if onlyowned is enabled,
                // we enlarge them a bit when possible to better match the desired aspect ratio
-               // as they look much better
-               weapon_size.x = min(old_panel_size.x / columns, aspect * weapon_size.y);
-               weapon_size.y = min(old_panel_size.y / rows, weapon_size.x / aspect);
+               if(padded_panel_size.y > padded_panel_size.x)
+               {
+                       columns = ceil(weapon_count / rows);
+                       rows = ceil(weapon_count / columns);
+                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
+                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
+               }
+               else
+               {
+                       rows = ceil(weapon_count / columns);
+                       columns = ceil(weapon_count / rows);
+                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
+                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
+               }
  
                // reduce size of the panel
                panel_size.x = columns * weapon_size.x;
                panel_size.y = rows * weapon_size.y;
-               panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
-               panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
-               if(panel_bg_padding)
-                       panel_size += '2 2 0' * panel_bg_padding;
+               panel_size += '2 2 0' * panel_bg_padding;
+               // center the resized panel, or snap it to the screen edge when close enough
+               if(panel_pos.x > vid_conwidth * 0.001)
+               {
+                       if(panel_pos.x + old_panel_size.x > vid_conwidth * 0.999)
+                               panel_pos.x += old_panel_size.x - panel_size.x;
+                       else
+                               panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
+               }
+               else if(old_panel_size.x > vid_conwidth * 0.999)
+                       panel_pos.x += (old_panel_size.x - panel_size.x) / 2;
+               if(panel_pos.y > vid_conheight * 0.001)
+               {
+                       if(panel_pos.y + old_panel_size.y > vid_conheight * 0.999)
+                               panel_pos.y += old_panel_size.y - panel_size.y;
+                       else
+                               panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
+               }
+               else if(old_panel_size.y > vid_conheight * 0.999)
+                       panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
        }
        else
                weapon_count = WEP_COUNT;
@@@ -4447,30 -4469,12 +4469,30 @@@ void HUD_Buffs(void
  }
  
  
 +// Minigame
 +//
 +#include "../common/minigames/cl_minigames_hud.qc"
 +
  /*
  ==================
  Main HUD system
  ==================
  */
  
 +bool HUD_Panel_CheckFlags(int showflags)
 +{
 +      if ( HUD_Minigame_Showpanels() )
 +              return showflags & PANEL_SHOW_MINIGAME;
 +      return showflags & PANEL_SHOW_MAINGAME;
 +}
 +
 +void HUD_Panel_Draw(entity panent)
 +{
 +      panel = panent;
 +      if ( HUD_Panel_CheckFlags(panel.panel_showflags) )
 +              panel.panel_draw();
 +}
 +
  void HUD_Reset (void)
  {
        // reset gametype specific icons
@@@ -4499,17 -4503,12 +4521,17 @@@ void HUD_Main (void
        // they must fade only when the menu does
        if(scoreboard_fade_alpha == 1)
        {
 -              (panel = HUD_PANEL(CENTERPRINT)).panel_draw();
 +              HUD_Panel_Draw(HUD_PANEL(CENTERPRINT));
                return;
        }
  
        if(!autocvar__hud_configure && !hud_fade_alpha)
 +      {
 +              hud_fade_alpha = 1;
 +              HUD_Panel_Draw(HUD_PANEL(VOTE));
 +              hud_fade_alpha = 0;
                return;
 +      }
  
        // Drawing stuff
        if (hud_skin_prev != autocvar_hud_skin)
        hud_draw_maximized = 0;
        // draw panels in order specified by panel_order array
        for(i = HUD_PANEL_NUM - 1; i >= 0; --i)
 -              (panel = hud_panel[panel_order[i]]).panel_draw();
 +              HUD_Panel_Draw(hud_panel[panel_order[i]]);
  
        hud_draw_maximized = 1; // panels that may be maximized must check this var
        // draw maximized panels on top
        if(hud_panel_radar_maximized)
 -              (panel = HUD_PANEL(RADAR)).panel_draw();
 +              HUD_Panel_Draw(HUD_PANEL(RADAR));
        if(autocvar__con_chat_maximized)
 -              (panel = HUD_PANEL(CHAT)).panel_draw();
 +              HUD_Panel_Draw(HUD_PANEL(CHAT));
  
        HUD_Configure_PostDraw();
  
index 79b3e9b3546871bea95dd4632daaa31ea8522960,4effe6492446b65192b91d838bebd11da4828c1b..adfd7bfeeaf5ffd07590321310ab88bd00e0336b
@@@ -421,7 -421,6 +421,7 @@@ float( float b, ... ) max = #95
  float(float minimum, float val, float maximum) bound = #96;
  float(float f, float f) pow = #97;
  entity(entity start, .float fld, float match) findfloat = #98;
 +entity(entity start, .entity fld, entity match) findentity = #98;
  float(string s) checkextension = #99;
  // FrikaC and Telejano range #100-#199
  
@@@ -1421,6 -1420,12 +1421,12 @@@ void(float fh, entity e) writetofile = 
  float(string s) isfunction = #607;
  void(entity e, string s) parseentitydata = #608;
  
+ //DP_COVERAGE
+ //idea: divVerent
+ //darkplaces implementation: divVerent
+ //function definitions:
+ void coverage() = #642;  // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
  // assorted builtins
  //const int STAT_MOVEVARS_TICRATE             = 240;
  //const int STAT_MOVEVARS_TIMESCALE           = 241;
index a3598512ed4823372bc68f74c6ae691c4d4b9d38,405d558504a7399ae9b8d598049918cdb8a89a20..95c62ea37e41fe4bb874352376d65646f12cd24b
@@@ -19,8 -19,6 +19,8 @@@
  
  #include "../common/net_notice.qh"
  
 +#include "../common/minigames/sv_minigames.qh"
 +
  #include "../common/monsters/sv_monsters.qh"
  
  #include "../warpzonelib/server.qh"
@@@ -1002,7 -1000,7 +1002,7 @@@ float PlayerInIDList(entity p, string i
        float n, i;
        string s;
  
-       // NOTE: we do NOT check crypto_keyfp here, an unsigned ID is fine too for this
+       // NOTE: we do NOT check crypto_idfp_signed here, an unsigned ID is fine too for this
        if (!p.crypto_idfp)
                return 0;
  
@@@ -1275,9 -1273,6 +1275,9 @@@ void ClientDisconnect (void
  
        PlayerStats_GameReport_FinalizePlayer(self);
  
 +      if ( self.active_minigame )
 +              part_minigame(self);
 +
        if(IS_PLAYER(self)) { pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1); }
  
        CheatShutdownClient();
@@@ -1355,20 -1350,14 +1355,20 @@@ void ChatBubbleThink(
                remove(self);
                return;
        }
 -      if ((self.owner.BUTTON_CHAT && !self.owner.deadflag)
 -#ifdef TETRIS
 -              || self.owner.tetris_on
 -#endif
 -      )
 -              self.model = self.mdl;
 -      else
 -              self.model = "";
 +      
 +      self.mdl = "";
 +      
 +      if ( !self.owner.deadflag && IS_PLAYER(self.owner) )
 +      {
 +              if ( self.owner.active_minigame )
 +                      self.mdl = "models/sprites/minigame_busy.iqm";
 +              else if ( self.owner.BUTTON_CHAT )
 +                      self.mdl = "models/misc/chatbubble.spr";
 +      }
 +      
 +      if ( self.model != self.mdl )
 +              setmodel(self, self.mdl);
 +
  }
  
  void UpdateChatBubble()
                self.chatbubbleentity.nextthink = time;
                setmodel(self.chatbubbleentity, "models/misc/chatbubble.spr"); // precision set below
                //setorigin(self.chatbubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1');
 -              setorigin(self.chatbubbleentity, '0 0 15' + self.maxs.z * '0 0 1');
 +              setorigin(self.chatbubbleentity, '0 0 15' + self.maxs_z * '0 0 1');
                setattachment(self.chatbubbleentity, self, "");  // sticks to moving player better, also conserves bandwidth
                self.chatbubbleentity.mdl = self.chatbubbleentity.model;
 -              self.chatbubbleentity.model = "";
 +              //self.chatbubbleentity.model = "";
                self.chatbubbleentity.effects = EF_LOWPRECISION;
        }
  }
@@@ -2110,11 -2099,6 +2110,11 @@@ void PrintWelcomeMessage(
  
  void ObserverThink()
  {
 +      if ( self.impulse )
 +      {
 +              MinigameImpulse(self.impulse);
 +              self.impulse = 0;
 +      }
        float prefered_movetype;
        if (self.flags & FL_JUMPRELEASED) {
                if (self.BUTTON_JUMP && !self.version_mismatch) {
  
  void SpectatorThink()
  {
 +      if ( self.impulse )
 +      {
 +              MinigameImpulse(self.impulse);
 +              self.impulse = 0;
 +      }
        if (self.flags & FL_JUMPRELEASED) {
                if (self.BUTTON_JUMP && !self.version_mismatch) {
                        self.flags &= ~FL_JUMPRELEASED;
@@@ -2330,6 -2309,11 +2330,6 @@@ void PlayerPreThink (void
                self.max_armorvalue = 0;
        }
  
 -#ifdef TETRIS
 -      if (TetrisPreFrame())
 -              return;
 -#endif
 -
        if(self.frozen == 2)
        {
                self.revive_progress = bound(0, self.revive_progress + frametime * self.revive_speed, 1);
@@@ -2651,6 -2635,13 +2651,6 @@@ void PlayerPostThink (void
                }
        }
  
 -#ifdef TETRIS
 -      if(self.impulse == 100)
 -              ImpulseCommands();
 -      if (!TetrisPostFrame())
 -      {
 -#endif
 -
        CheatFrame();
  
        //CheckPlayerJump();
                GetPressedKeys();
        }
  
 -#ifdef TETRIS
 -      }
 -#endif
 -
        /*
        float i;
        for(i = 0; i < 1000; ++i)