X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2FMain.qc;h=9fb86a6e23bb0eda1a12e2c9bdb5f33ae24f2705;hb=3d0056945167985679ec91db307c0284406640d1;hp=de74def1816f6f319e2f98f144c03b52280845ad;hpb=58eefc4a87421dd598529152f6b7eb45c6e82f26;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index de74def18..9fb86a6e2 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -94,6 +94,7 @@ void CSQC_Init(void) registercmd("-button3"); registercmd("+button4"); registercmd("-button4"); + registercmd("+showscores");registercmd("-showscores"); registercmd("+showaccuracy");registercmd("-showaccuracy"); #ifndef CAMERATEST @@ -112,7 +113,7 @@ void CSQC_Init(void) } #endif registercvar("hud_usecsqc", "1"); - registercvar("hud_columns", "default", CVAR_SAVE); + registercvar("scoreboard_columns", "default", CVAR_SAVE); gametype = 0; @@ -129,14 +130,13 @@ void CSQC_Init(void) GetTeam(COLOR_SPECTATOR, true); // add specs first - cvar_clientsettemp("_supports_weaponpriority", "1"); - RegisterWeapons(); WaypointSprite_Load(); // precaches Projectile_Precache(); + Hook_Precache(); GibSplash_Precache(); Casings_Precache(); DamageInfo_Precache(); @@ -184,6 +184,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 +214,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"); } } @@ -341,7 +342,7 @@ void TrueAim_Init(); void PostInit(void) { print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n")); - localcmd(strcat("\nhud_columns_set ", cvar_string("hud_columns"), ";\n")); + localcmd(strcat("\nscoreboard_columns_set ", cvar_string("scoreboard_columns"), ";\n")); entity playerchecker; playerchecker = spawn(); @@ -405,16 +406,16 @@ float CSQC_ConsoleCommand(string strMessage) button_attack2 = 0; return false; } else if(strCmd == "+showscores") { - sb_showscores = true; + scoreboard_showscores = true; return true; } else if(strCmd == "-showscores") { - sb_showscores = false; + scoreboard_showscores = false; return true; } else if(strCmd == "+showaccuracy") { - sb_showaccuracy = true; + scoreboard_showaccuracy = true; return true; } else if(strCmd == "-showaccuracy") { - sb_showaccuracy = false; + scoreboard_showaccuracy = false; return true; } @@ -522,8 +523,8 @@ void GameCommand(string msg) { print("Usage: cl_cmd COMMAND..., where possible commands are:\n"); print(" settemp cvar value\n"); - print(" hud_columns_set ...\n"); - print(" hud_columns_help\n"); + print(" scoreboard_columns_set ...\n"); + print(" scoreboard_columns_help\n"); GameCommand_Generic("help"); return; } @@ -539,10 +540,10 @@ void GameCommand(string msg) else if(cmd == "settemp") { cvar_clientsettemp(argv(1), argv(2)); } - else if(cmd == "hud_columns_set") { + else if(cmd == "scoreboard_columns_set") { Cmd_HUD_SetFields(argc); } - else if(cmd == "hud_columns_help") { + else if(cmd == "scoreboard_columns_help") { Cmd_HUD_Help(argc); } #ifdef BLURTEST @@ -632,15 +633,13 @@ void GameCommand(string msg) // bInputType = 0 is key pressed, 1 is key released, 2 is mouse input. // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0. // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta. -float hudconf_active; float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary) { local float bSkipKey; bSkipKey = false; - if(hudconf_active) - if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary)) - return true; + if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary)) + return true; if (MapVote_InputEvent(bInputType, nPrimary, nSecondary)) return true; @@ -783,7 +782,7 @@ void Ent_ClientData() f = ReadByte(); - sb_showscores_force = (f & 1); + scoreboard_showscores_force = (f & 1); if(f & 2) { @@ -963,14 +962,11 @@ void Gamemode_Init() precache_pic("gfx/ons-cp-blue.tga"); precache_pic("gfx/ons-frame.tga"); precache_pic("gfx/ons-frame-team.tga"); - } else if(gametype == GAME_KEYHUNT) { - precache_pic("gfx/sb_key_carrying"); - precache_pic("gfx/sb_key_carrying_outline"); } if not(isdemo()) { - localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), ";"); + localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), "\n"); calledhooks |= HOOK_START; } } @@ -1027,9 +1023,14 @@ void Ent_Init() nb_pb_period = ReadByte() / 32; //Accuracy of 1/32th - hook_shotorigin_x = ReadCoord(); - hook_shotorigin_y = ReadCoord(); - hook_shotorigin_z = ReadCoord(); + hook_shotorigin[0] = decompressShotOrigin(ReadInt24_t()); + hook_shotorigin[1] = decompressShotOrigin(ReadInt24_t()); + hook_shotorigin[2] = decompressShotOrigin(ReadInt24_t()); + hook_shotorigin[3] = decompressShotOrigin(ReadInt24_t()); + electro_shotorigin[0] = decompressShotOrigin(ReadInt24_t()); + electro_shotorigin[1] = decompressShotOrigin(ReadInt24_t()); + electro_shotorigin[2] = decompressShotOrigin(ReadInt24_t()); + electro_shotorigin[3] = decompressShotOrigin(ReadInt24_t()); if(forcefog) strunzone(forcefog); @@ -1229,13 +1230,13 @@ void Net_ReadPingPLReport() void Net_VoteDialog(float highlight) { if(highlight) { - vote_highlighted = ReadShort(); + vote_highlighted = ReadByte(); return; } - vote_yescount = ReadShort(); - vote_nocount = ReadShort(); - vote_needed = ReadShort(); + vote_yescount = ReadByte(); + vote_nocount = ReadByte(); + vote_needed = ReadByte(); vote_active = 1; } @@ -1243,6 +1244,32 @@ void Net_VoteDialogReset() { vote_active = 0; } +void Net_Notify() { + float type; + type = ReadByte(); + + if(type == CSQC_KILLNOTIFY) + { + HUD_KillNotify(ReadString(), ReadString(), ReadString(), ReadShort(), ReadByte()); + } + else if(type == CSQC_CENTERPRINT) + { + HUD_Centerprint(ReadString(), ReadString(), ReadShort(), ReadByte()); + } +} + +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. @@ -1269,7 +1296,7 @@ float CSQC_Parse_TempEntity() Net_ReadRace(); bHandled = true; break; - case 13: // TE_BEAM + case TE_CSQC_BEAM: Net_GrapplingHook(); bHandled = true; break; @@ -1309,6 +1336,14 @@ float CSQC_Parse_TempEntity() announce_snd = strzone(ReadString()); bHandled = true; break; + case TE_CSQC_NOTIFY: + 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;