]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into fruitiex/newpanelhud_stable
authorFruitieX <rasse@rasse-lappy.localdomain>
Wed, 7 Jul 2010 12:29:40 +0000 (15:29 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Wed, 7 Jul 2010 12:29:40 +0000 (15:29 +0300)
1  2 
defaultXonotic.cfg
qcsrc/client/Main.qc
qcsrc/client/View.qc

diff --combined defaultXonotic.cfg
index 5c2800aa85855dd3eb76cf1017f005b09290d885,307f58fa78b76005964d1a54f514d599d9baac6a..6aeb7e9339c4ab4005803aebb935b7978d4f6fa6
@@@ -206,6 -206,9 +206,9 @@@ seta crosshair_fireball_color_green 1.
  seta crosshair_fireball_color_blue 0.2        "crosshair color blue component to display when wielding the fireball"
  seta crosshair_fireball_color_alpha 1 "crosshair alpha value to display when wielding the fireball"
  seta crosshair_fireball_size 1        "crosshair size when wielding the fireball"
+ seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
+ seta cl_reticle_item_nex 1 "draw aiming recticle for the nex weapon's zoom, 0 disables and values between 0 and 1 change alpha"
+ seta cl_reticle_item_normal 1 "draw recticle when zooming with the zoom button, 0 disables and values between 0 and 1 change alpha"
  fov 90
  seta cl_velocityzoom 0        "velocity based zooming of fov, negative values zoom out"
  seta cl_velocityzoomtime 0.3  "time value for averaging speed values"
@@@ -501,7 -504,6 +504,6 @@@ set g_laserguided_missile 0 "if set to 
  set g_midair 0 "if set to 1 you can only apply damage to your opponent while he is airborne"
  set g_midair_shieldtime 0.3 "number of seconds you are still invincible since you lost contact to the ground"
  set g_spawnsound 1 "set to 0 if you don't want to hear the spawn sound when a player spawns"
- set g_spawnpoints_autodrop 0 "if set to 1, automatically drop spawn point locations if they were placed too high"
  set g_spawnpoints_auto_move_out_of_solid 0 "if set to 1 you will see a warning if a spawn point was placed inside a solid"
  set g_forced_respawn 0 "if set to 1 and a player died, that player gets automatically respawned once <g_respawn_delay> seconds are over"
  set g_fullbrightplayers 0 "brightens up player models (note that the color, skin or model of the players does not change!)"
@@@ -547,6 -549,7 +549,7 @@@ set sv_dodging_wall_distance_threshold 
  set sv_dodging_sound 1 "if 1 dodging makes a sound. if 0 dodging is silent"
  
  set leadlimit 0
+ set leadlimit_and_fraglimit 0 "if set, leadlimit is ANDed with fraglimit (otherwise ORed)"
  
  // this means that timelimit can be overidden globally and fraglimit can be overidden for each game mode: DM/TDM, Domination, CTF, and Runematch.
  seta timelimit_override -1    "Time limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
@@@ -910,8 -913,12 +913,12 @@@ alias sv_loadconfig "exec $serverconfig
  alias sv_restart "say \"Server will restart at the end of the match, you will all be reconnected automatically. $* \"; quit_and_redirect self"
  
  // aliases:
- alias +attack2 +button3
- alias -attack2 -button3
+ alias +fire +attack
+ alias -fire -attack
+ alias +fire2 +button3
+ alias -fire2 -button3
+ alias +attack2 +button3 // old alias from Nexuiz
+ alias -attack2 -button3 // old alias name from Nexuiz
  alias +zoom +button4
  alias -zoom -button4
  alias +crouch +button5
@@@ -954,8 -961,8 +961,8 @@@ bind 8 "impulse 8
  bind 9 "impulse 9"
  bind 0 "impulse 14" // cycles the superweapons
  bind q weaplast
- bind MOUSE1 +attack
- bind MOUSE2 +attack2
+ bind MOUSE1 +fire
+ bind MOUSE2 +fire2
  bind MOUSE3 +zoom
  bind MOUSE4 weaplast
  bind MOUSE5 +hook
@@@ -989,8 -996,8 +996,8 @@@ bind JOY1 "+crouch
  bind JOY2 "+jump"
  bind JOY3 "weapprev"
  bind JOY4 "weapnext"
- bind JOY5 "+attack2"
- bind JOY6 "+attack"
+ bind JOY5 "+fire2"
+ bind JOY6 "+fire"
  bind JOY7 "+zoom"
  bind JOY8 "dropweapon"
  bind JOY9 "menu_showteamselect"
@@@ -1320,8 -1327,8 +1327,8 @@@ set _hud_configure 0 "1 = configure th
  seta hud_configure_checkcollisions 1 "check for collisions against other panels when in hud configure mode"
  seta hud_configure_bg_minalpha 0.25 "minimum panel background alpha when in hud configure mode"
  seta hud_configure_grid 1 "snap to grid when moving/resizing panels"
 -seta hud_configure_grid_x 0.01 "snap to X * vid_conwidth"
 -seta hud_configure_grid_y 0.01 "snap to Y * vid_conheight"
 +seta hud_configure_grid_xsize 0.01 "snap to X * vid_conwidth"
 +seta hud_configure_grid_ysize 0.01 "snap to Y * vid_conheight"
  seta hud_configure_grid_alpha 0.15 "alpha for visible grid when in configure mode"
  
  seta sbar_info_pos 0 "Y-axis distance from lower right corner for engine info prints"
@@@ -1690,6 -1697,7 +1697,7 @@@ alias cl_hook_gamestart_r
  alias cl_hook_gamestart_nexball
  alias cl_hook_gamestart_cts
  alias cl_hook_gameend
+ alias cl_hook_activeweapon
  
  alias _sv_hook_gamestart "set _sv_hook_gametype $1; _sv_hook_gamestart_stage2"
  alias _sv_hook_gamestart_stage2 "sv_hook_gamestart_all; sv_hook_gamestart_${_sv_hook_gametype}"
diff --combined qcsrc/client/Main.qc
index 369f8741ca061c5302ba41ce379530509e99ad73,1a6996ce666bebecedf9b82fd052cca27b0856bd..7d218cb6540ee0621e99aae09e8fe2371d61571c
@@@ -183,7 -183,6 +183,7 @@@ void CSQC_Init(void
        minimapname = strzone(minimapname);
  
        WarpZone_Init();
 +      hud_configure_prev = -1;
  }
  
  // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
@@@ -213,9 -212,9 +213,9 @@@ void CSQC_Shutdown(void
        if not(isdemo())
        {
                if not(calledhooks & HOOK_START)
-                       localcmd("\n_cl_hook_gamestart nop;");
+                       localcmd("\n_cl_hook_gamestart nop\n");
                if not(calledhooks & HOOK_END)
-                       localcmd("\ncl_hook_gameend;");
+                       localcmd("\ncl_hook_gameend\n");
        }
  }
  
@@@ -965,7 -964,7 +965,7 @@@ void Gamemode_Init(
  
        if not(isdemo())
        {
-               localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), ";");
+               localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), "\n");
                calledhooks |= HOOK_START;
        }
  }
@@@ -1252,18 -1251,6 +1252,18 @@@ void Net_Notify() 
        }
  }
  
 +void Net_WeaponComplain() {
 +      complain_weapon = ReadByte();
 +
 +      if(complain_weapon_name)
 +              strunzone(complain_weapon_name);
 +      complain_weapon_name = strzone(ReadString());
 +
 +      complain_weapon_type = ReadByte();
 +
 +      complain_weapon_time = time;
 +}
 +
  // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
  // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
  // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
@@@ -1334,10 -1321,6 +1334,10 @@@ float CSQC_Parse_TempEntity(
                        Net_Notify();
                        bHandled = true;
                        break;
 +              case TE_CSQC_WEAPONCOMPLAIN:
 +                      Net_WeaponComplain();
 +                      bHandled = true;
 +                      break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
diff --combined qcsrc/client/View.qc
index 118f63ce2f5bf73dd8de43a1b8485c43cdff8473,0ec4277b6bf4e9f49ff50ff5a1d05a3a96fc41bd..8c642415ddebede591b7cbe57ae4e86c19cb2364
@@@ -341,6 -341,7 +341,7 @@@ void CSQC_Demo_Camera()
  float HUD_WouldDrawScoreboard ();
  float view_set;
  float camera_mode;
+ float reticle_type;
  string NextFrameCommand;
  void CSQC_SPIDER_HUD();
  void CSQC_RAPTOR_HUD();
@@@ -354,6 -355,8 +355,8 @@@ void CSQC_UpdateView(float w, float h
        float f, i, j;
        vector v, vo;
  
+       vector reticle_pos, reticle_size;
        WaypointSprite_Load();
  
        if(spectatee_status)
        input_angles = warpzone_fixview_cl_viewangles;
        view_angles = warpzone_fixview_angles;
  
 -      if(cvar("cl_lockview") || hud_configure)
 +      if(cvar("cl_lockview") || autocvar__hud_configure)
        {
                pmove_org = freeze_pmove_org;
                input_angles = view_angles = freeze_input_angles;
        if(intermission && !isdemo() && !(calledhooks & HOOK_END))
                if(calledhooks & HOOK_START)
                {
-                       localcmd("\ncl_hook_gameend;");
+                       localcmd("\ncl_hook_gameend\n");
                        calledhooks |= HOOK_END;
                }
  
        if(last_weapon != activeweapon) {
                weapontime = time;
                last_weapon = activeweapon;
+               entity e;
+               e = get_weaponinfo(activeweapon);
+               if(e.netname != "")
+                       localcmd(strcat("\ncl_hook_activeweapon ", e.netname), "\n");
+               else
+                       localcmd("\ncl_hook_activeweapon none\n");
        }
  
        // ALWAYS Clear Current Scene First
        // next R_RenderScene call
        drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
  
+       // Draw the aiming reticle for weapons that use it
+       // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
+       // It must be a persisted float for fading out to work properly (you let go of the zoom button for
+       // the view to go back to normal, so reticle_type would become 0 as we fade out)
+       if(spectatee_status || getstati(STAT_HEALTH) <= 0)
+               reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
+       else if(button_zoom)
+               reticle_type = 1; // normal zoom
+       else if(activeweapon == WEP_NEX && button_attack2)
+               reticle_type = 2; // nex zoom
+       if(cvar("cl_reticle_stretch"))
+       {
+               reticle_size_x = vid_conwidth;
+               reticle_size_y = vid_conheight;
+               reticle_pos_x = 0;
+               reticle_pos_y = 0;
+       }
+       else
+       {
+               reticle_size_x = max(vid_conwidth, vid_conheight);
+               reticle_size_y = max(vid_conwidth, vid_conheight);
+               reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;
+               reticle_pos_y = (vid_conheight - reticle_size_y) / 2;
+       }
+       if(cvar("cl_reticle_item_normal"))
+       {
+               precache_pic("gfx/reticle_normal");
+               if(reticle_type == 1 && current_zoomfraction)
+                       drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', current_zoomfraction * cvar("cl_reticle_item_normal"), DRAWFLAG_NORMAL);
+       }
+       if(cvar("cl_reticle_item_nex"))
+       {
+               precache_pic("gfx/reticle_nex");
+               if(reticle_type == 2 && current_zoomfraction)
+                       drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', current_zoomfraction * cvar("cl_reticle_item_nex"), DRAWFLAG_NORMAL);
+       }
        // Draw the mouse cursor
        // NOTE: drawpic must happen after R_RenderScene for some reason
        //drawpic(getmousepos(), "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);
                cvar_set("vid_conheight", h0);
        }
  
 -      if(hud_configure)
 +      if(autocvar__hud_configure)
                HUD_Panel_Mouse();
        // be safe against triggerbots until everyone has the fixed engine
        // this call is meant to overwrite the trace globals by something