X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmain.qc;h=df13ca7f62fad43879b6ba209b78153d2e4cc9b9;hp=efb1fa204eed951d8014b976eee0528865dc8f94;hb=e7e4e095eaeac5b8dbc60723f239547bdee88ef5;hpb=4181392df811a93dee6b97c303c3f7655f2f0a23 diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index efb1fa204e..df13ca7f62 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -8,11 +8,13 @@ #include #include #include "hud/_mod.qh" +#include "commands/cl_cmd.qh" #include "mapvoting.qh" #include #include "hud/panel/scoreboard.qh" #include "hud/panel/quickmenu.qh" #include "shownames.qh" +#include "view.qh" #include #include "weapons/projectile.qh" #include @@ -90,7 +92,6 @@ void LoadMenuSkinValues() // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load) // Useful for precaching things -void ConsoleCommand_macro_init(); void CSQC_Init() { prvm_language = strzone(cvar_string("prvm_language")); @@ -229,7 +230,7 @@ void Shutdown() .float has_team; float SetTeam(entity o, int Team) { - TC(int, Team); + TC(int, Team); devassert_once(Team); entity tm; if(teamplay) @@ -342,7 +343,6 @@ void Playerchecker_Think(entity this) this.nextthink = time + 0.2; } -void TrueAim_Init(); void PostInit() { entity playerchecker = new_pure(playerchecker); @@ -363,20 +363,21 @@ void PostInit() // In the case of mouse input after a setcursormode(1) call, nPrimary is xpos, nSecondary is ypos. float CSQC_InputEvent(int bInputType, float nPrimary, float nSecondary) { - TC(int, bInputType); - if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary)) + TC(int, bInputType); + bool override = false; + override |= HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary); + if (override) return true; - if (QuickMenu_InputEvent(bInputType, nPrimary, nSecondary)) - return true; + override |= QuickMenu_InputEvent(bInputType, nPrimary, nSecondary); - if (HUD_Radar_InputEvent(bInputType, nPrimary, nSecondary)) - return true; + override |= HUD_Radar_InputEvent(bInputType, nPrimary, nSecondary); - if (MapVote_InputEvent(bInputType, nPrimary, nSecondary)) - return true; + override |= MapVote_InputEvent(bInputType, nPrimary, nSecondary); - if (HUD_Minigame_InputEvent(bInputType, nPrimary, nSecondary)) + override |= HUD_Minigame_InputEvent(bInputType, nPrimary, nSecondary); + + if(override) return true; return false; @@ -388,8 +389,6 @@ float CSQC_InputEvent(int bInputType, float nPrimary, float nSecondary) // -------------------------------------------------------------------------- // BEGIN OPTIONAL CSQC FUNCTIONS -void Ent_Remove(entity this); - void Ent_RemovePlayerScore(entity this) { if(this.owner) { @@ -946,7 +945,6 @@ void Fog_Force() localcmd(sprintf("\nfog %s\nr_fog_exp2 0\nr_drawfog 1\n", forcefog)); } -void Gamemode_Init(); NET_HANDLE(ENT_CLIENT_SCORES_INFO, bool isnew) { make_pure(this); @@ -1219,7 +1217,8 @@ NET_HANDLE(TE_CSQC_PINGPLREPORT, bool isNew) NET_HANDLE(TE_CSQC_WEAPONCOMPLAIN, bool isNew) { - complain_weapon = ReadByte(); + int weapon_id = ReadByte(); + complain_weapon = Weapons_from(weapon_id); complain_weapon_type = ReadByte(); return = true; @@ -1228,9 +1227,9 @@ NET_HANDLE(TE_CSQC_WEAPONCOMPLAIN, bool isNew) switch(complain_weapon_type) { - case 0: Local_Notification(MSG_MULTI, ITEM_WEAPON_NOAMMO, complain_weapon); break; - case 1: Local_Notification(MSG_MULTI, ITEM_WEAPON_DONTHAVE, complain_weapon); break; - default: Local_Notification(MSG_MULTI, ITEM_WEAPON_UNAVAILABLE, complain_weapon); break; + case 0: Local_Notification(MSG_MULTI, ITEM_WEAPON_NOAMMO, weapon_id); break; + case 1: Local_Notification(MSG_MULTI, ITEM_WEAPON_DONTHAVE, weapon_id); break; + default: Local_Notification(MSG_MULTI, ITEM_WEAPON_UNAVAILABLE, weapon_id); break; } }