X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2FMain.qc;h=f24b483d6d7b5ce9181212abf199f44a7f757ba1;hb=44e7b9d6058eef0fa6612930ef5d57dd6df1ca77;hp=575f8b0622deb1b433f54702e79c17a2cf10a352;hpb=1f5d48dd87aaf7d479958202f3960de01ac877d2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 575f8b062..f24b483d6 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -27,7 +27,7 @@ void cvar_clientsettemp_restore() void() menu_show_error = { - drawstring('0 200 0', "ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!", '8 8 0', '1 0 0', 1, 0); + drawstring('0 200 0', _("ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!"), '8 8 0', '1 0 0', 1, 0); }; // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load) @@ -46,33 +46,34 @@ string cl_announcer_prev; void WaypointSprite_Load(); void CSQC_Init(void) { + prvm_language = cvar_string("prvm_language"); + #ifdef USE_FTE #pragma target ID __engine_check = checkextension("DP_SV_WRITEPICTURE"); if(!__engine_check) { - print("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n"); + print(_("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n")); localcmd("\ndisconnect\n"); return; } #pragma target FTE #endif - + check_unacceptable_compiler_bugs(); #ifdef WATERMARK - print("^4CSQC Build information: ", WATERMARK(), "\n"); + print(sprintf(_("^4CSQC Build information: %s\n"), WATERMARK())); #endif float i; - CSQC_CheckEngine(); binddb = db_create(); tempdb = db_create(); ClientProgsDB = db_load("client.db"); compressShortVector_init(); - drawfont = 0; + drawfont = FONT_USER+1; menu_visible = FALSE; menu_show = menu_show_error; menu_action = menu_sub_null; @@ -86,12 +87,15 @@ void CSQC_Init(void) // localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used //registercmd("ctf_menu"); registercmd("ons_map"); + registercmd("hud_configure"); + registercmd("hud_save"); //registercmd("menu_action"); registercmd("+button3"); registercmd("-button3"); registercmd("+button4"); registercmd("-button4"); + registercmd("+showscores");registercmd("-showscores"); registercmd("+showaccuracy");registercmd("-showaccuracy"); #ifndef CAMERATEST @@ -109,14 +113,14 @@ void CSQC_Init(void) #ifndef CAMERATEST } #endif - registercvar("sbar_usecsqc", "1"); - registercvar("sbar_columns", "default", CVAR_SAVE); + registercvar("hud_usecsqc", "1"); + registercvar("scoreboard_columns", "default", CVAR_SAVE); gametype = 0; - // sbar_fields uses strunzone on the titles! - for(i = 0; i < MAX_SBAR_FIELDS; ++i) - sbar_title[i] = strzone("(null)"); + // hud_fields uses strunzone on the titles! + for(i = 0; i < MAX_HUD_FIELDS; ++i) + hud_title[i] = strzone("(null)"); postinit = false; @@ -127,42 +131,26 @@ void CSQC_Init(void) GetTeam(COLOR_SPECTATOR, true); // add specs first - cvar_clientsettemp("_supports_weaponpriority", "1"); - RegisterWeapons(); WaypointSprite_Load(); // precaches + precache_sound("misc/hit.wav"); + precache_sound("misc/typehit.wav"); Projectile_Precache(); + Hook_Precache(); GibSplash_Precache(); Casings_Precache(); DamageInfo_Precache(); - if(cvar_string("cl_announcer") != cl_announcer_prev) { + if(autocvar_cl_announcer != cl_announcer_prev) { Announcer_Precache(); if(cl_announcer_prev) strunzone(cl_announcer_prev); - cl_announcer_prev = strzone(cvar_string("cl_announcer")); + cl_announcer_prev = strzone(autocvar_cl_announcer); } Tuba_Precache(); -#ifdef UID - { - // find the user ID - string uid; - registercvar("_cl_userid", "", CVAR_SAVE); - uid = cvar_string("_cl_userid"); - if(strlen(uid) < 16) - { - uid = ""; - for(i = 0; i < 4; ++i) - uid = strcat(uid, substring(ftos(floor(10000 + random() * 10000)), 1, -1)); - } - cvar_set("_cl_userid", uid); - localcmd(strcat("\ncmd uid ", uid, "\n")); - } -#endif - get_mi_min_max_texcoords(1); // try the CLEVER way first minimapname = strcat("gfx/", mi_shortname, "_radar.tga"); shortmapname = mi_shortname; @@ -182,6 +170,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) @@ -200,7 +189,10 @@ void CSQC_Shutdown(void) remove(players); db_close(binddb); db_close(tempdb); - db_save(ClientProgsDB, "client.db"); + if(autocvar_cl_db_saveasdump) + db_dump(ClientProgsDB, "client.db"); + else + db_save(ClientProgsDB, "client.db"); db_close(ClientProgsDB); cvar_clientsettemp_restore(); @@ -211,9 +203,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"); } } @@ -234,7 +226,7 @@ float SetTeam(entity o, float Team) default: if(GetTeam(Team, false) == NULL) { - print("trying to switch to unsupported team ", ftos(Team), "\n"); + print(sprintf(_("trying to switch to unsupported team %d\n"), Team)); Team = COLOR_SPECTATOR; } break; @@ -250,7 +242,7 @@ float SetTeam(entity o, float Team) default: if(GetTeam(Team, false) == NULL) { - print("trying to switch to unsupported team ", ftos(Team), "\n"); + print(sprintf(_("trying to switch to unsupported team %d\n"), Team)); Team = COLOR_SPECTATOR; } break; @@ -260,7 +252,6 @@ float SetTeam(entity o, float Team) { if(o.has_team) { - //print("(DISCONNECT) leave team ", ftos(o.team), "\n"); tm = GetTeam(o.team, false); tm.team_size -= 1; o.has_team = 0; @@ -271,7 +262,6 @@ float SetTeam(entity o, float Team) { if not(o.has_team) { - //print("(CONNECT) enter team ", ftos(o.team), "\n"); o.team = Team; tm = GetTeam(Team, true); tm.team_size += 1; @@ -280,11 +270,9 @@ float SetTeam(entity o, float Team) } else if(Team != o.team) { - //print("(CHANGE) leave team ", ftos(o.team), "\n"); tm = GetTeam(o.team, false); tm.team_size -= 1; o.team = Team; - //print("(CHANGE) enter team ", ftos(o.team), "\n"); tm = GetTeam(Team, true); tm.team_size += 1; return TRUE; @@ -304,7 +292,6 @@ void Playerchecker_Think() { if(e.sort_prev) { - //print("playerchecker: KILL KILL KILL\n"); // player disconnected SetTeam(e, -1); RemovePlayer(e); @@ -316,7 +303,6 @@ void Playerchecker_Think() { if not(e.sort_prev) { - //print("playerchecker: SPAWN SPAWN SPAWN\n"); // player connected if not(e) playerslots[i] = e = spawn(); @@ -325,9 +311,9 @@ void Playerchecker_Think() e.ping_packetloss = 0; e.ping_movementloss = 0; //e.gotscores = 0; // we might already have the scores... - SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams + SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with HUD_UpdatePlayerTeams RegisterPlayer(e); - Sbar_UpdatePlayerPos(e); + HUD_UpdatePlayerPos(e); } } } @@ -338,8 +324,7 @@ void Porto_Init(); void TrueAim_Init(); void PostInit(void) { - print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n")); - localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n")); + localcmd(strcat("\nscoreboard_columns_set ", autocvar_scoreboard_columns, ";\n")); entity playerchecker; playerchecker = spawn(); @@ -355,8 +340,8 @@ void PostInit(void) // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it. float button_zoom; -void Cmd_Sbar_SetFields(float); -void Cmd_Sbar_Help(float); +void Cmd_HUD_SetFields(float); +void Cmd_HUD_Help(float); float CSQC_ConsoleCommand(string strMessage) { float argc; @@ -368,7 +353,18 @@ float CSQC_ConsoleCommand(string strMessage) local string strCmd; strCmd = argv(0); - if(strCmd == "+button4") { // zoom + if(strCmd == "hud_configure") { // config hud + cvar_set("_hud_configure", ftos(!autocvar__hud_configure)); + return true; + } else if(strCmd == "hud_save") { // save hud config + if(argv(1) == "" || argv(2)) { + print(_("Usage:\n")); + print(_("hud_save configname (saves to hud_skinname_configname.cfg)\n")); + } + else + HUD_Panel_ExportCfg(argv(1)); + return true; + } else if(strCmd == "+button4") { // zoom // return false, because the message shall be sent to the server anyway (for demos/speccing) if(ignore_plus_zoom) { @@ -392,16 +388,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; } @@ -443,7 +439,9 @@ void ShotOrg_Draw() self.angles = view_angles; self.angles_x = -self.angles_x; if not(self.cnt) - R_AddEntity(self); + self.drawmask = MASK_NORMAL; + else + self.drawmask = 0; } void ShotOrg_Draw2D() { @@ -490,11 +488,12 @@ void DrawDebugModel() if(time - floor(time) > 0.5) { PolyDrawModel(self); + self.drawmask = 0; } else { self.renderflags = 0; - R_AddEntity(self); + self.drawmask = MASK_NORMAL; } } @@ -507,11 +506,10 @@ void GameCommand(string msg) if(argv(0) == "help" || argc == 0) { - print("Usage: cl_cmd COMMAND..., where possible commands are:\n"); - print(" settemp cvar value\n"); - print(" radar\n"); - print(" sbar_columns_set ...\n"); - print(" sbar_columns_help\n"); + print(_("Usage: cl_cmd COMMAND..., where possible commands are:\n")); + print(_(" settemp cvar value\n")); + print(_(" scoreboard_columns_set ...\n")); + print(_(" scoreboard_columns_help\n")); GameCommand_Generic("help"); return; } @@ -527,14 +525,11 @@ void GameCommand(string msg) else if(cmd == "settemp") { cvar_clientsettemp(argv(1), argv(2)); } - else if(cmd == "radar") { - ons_showmap = !ons_showmap; - } - else if(cmd == "sbar_columns_set") { - Cmd_Sbar_SetFields(argc); + else if(cmd == "scoreboard_columns_set") { + Cmd_HUD_SetFields(argc); } - else if(cmd == "sbar_columns_help") { - Cmd_Sbar_Help(argc); + else if(cmd == "scoreboard_columns_help") { + Cmd_HUD_Help(argc); } #ifdef BLURTEST else if(cmd == "blurtest") { @@ -589,15 +584,15 @@ void GameCommand(string msg) } else if(cmd == "sendcvar") { // W_FixWeaponOrder will trash argv, so save what we need. - string cvar; - cvar = strzone(argv(1)); - s = cvar_string(cvar); - if(cvar == "cl_weaponpriority") + string thiscvar; + thiscvar = strzone(argv(1)); + s = cvar_string(thiscvar); + if(thiscvar == "cl_weaponpriority") s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1); - else if(substring(cvar, 0, 17) == "cl_weaponpriority" && strlen(cvar) == 18) + else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18) s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0); - localcmd("cmd sentcvar ", cvar, " \"", s, "\"\n"); - strunzone(cvar); + localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n"); + strunzone(thiscvar); } else if(cmd == "spawn") { s = argv(1); @@ -609,6 +604,35 @@ void GameCommand(string msg) e.draw = DrawDebugModel; e.classname = "debugmodel"; } + else if(cmd == "vyes") + { + if(uid2name_dialog) + { + vote_active = 0; // force the panel to disappear right as we have selected the value (to prevent it from fading out in the normal vote panel pos) + vote_prev = 0; + cvar_set("cl_allow_uid2name", "1"); + vote_change = -9999; + } + else + { + localcmd("cmd vote yes\n"); + } + } + else if(cmd == "vno") + { + if(uid2name_dialog) + { + vote_active = 0; + vote_prev = 0; + cvar_set("cl_allow_uid2name", "0"); + vote_change = -9999; + } + else + { + localcmd("cmd vote no\n"); + } + } + else { print("Invalid command. For a list of supported commands, try cl_cmd help.\n"); @@ -628,12 +652,16 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary) local float bSkipKey; bSkipKey = false; + if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary)) + return true; + if (MapVote_InputEvent(bInputType, nPrimary, nSecondary)) return true; if(menu_visible) if(menu_action(bInputType, nPrimary, nSecondary)) return TRUE; + return bSkipKey; } @@ -678,7 +706,7 @@ void Ent_ReadPlayerScore() float isNew; entity o; - // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN + // damnit -.- don't want to go change every single .sv_entnum in hud.qc AGAIN // (no I've never heard of M-x replace-string, sed, or anything like that) isNew = !self.owner; // workaround for DP bug n = ReadByte()-1; @@ -686,7 +714,7 @@ void Ent_ReadPlayerScore() #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED if(!isNew && n != self.sv_entnum) { - print("A CSQC entity changed its owner!\n"); + print(_("A CSQC entity changed its owner!\n")); isNew = true; Ent_Remove(); self.enttype = ENT_CLIENT_SCORES; @@ -724,7 +752,7 @@ void Ent_ReadPlayerScore() } if(o.sort_prev) - Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet! + HUD_UpdatePlayerPos(o); // if not registered, we cannot do this yet! self.entremove = Ent_RemovePlayerScore; } @@ -755,7 +783,7 @@ void Ent_ReadTeamScore() o.(teamscores[i]) = ReadChar(); } - Sbar_UpdateTeamPos(o); + HUD_UpdateTeamPos(o); } void Net_Reset() @@ -769,7 +797,7 @@ void Ent_ClientData() f = ReadByte(); - sb_showscores_force = (f & 1); + scoreboard_showscores_force = (f & 1); if(f & 2) { @@ -795,11 +823,6 @@ void Ent_ClientData() if(newspectatee_status != spectatee_status) { float i; - // clear the weapon accuracy stats - for(i = WEP_FIRST; i <= WEP_LAST; ++i) { - weapon_hits[i] = 0; - weapon_fired[i] = 0; - } // clear race stuff race_laptime = 0; @@ -851,6 +874,32 @@ void Ent_RandomSeed() psrandom(s); } +void Ent_ReadAccuracy(void) +{ + float sf, f, w, b; + sf = ReadInt24_t(); + if(sf == 0) + { + for(w = 0; w <= WEP_LAST - WEP_FIRST; ++w) + weapon_accuracy[w] = -1; + return; + } + + for(w = 0, f = 1; w <= WEP_LAST - WEP_FIRST; ++w, f *= 2) + { + if(sf & f) + { + b = ReadByte(); + if(b == 0) + weapon_accuracy[w] = -1; + else if(b == 255) + weapon_accuracy[w] = 1.0; // no better error handling yet, sorry + else + weapon_accuracy[w] = (b - 1.0) / 100.0; + } + } +} + // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured. // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS. void Ent_RadarLink(); @@ -879,7 +928,7 @@ void(float bIsNewEntity) CSQC_Ent_Update = if(self.enttype) if(t != self.enttype) { - print("A CSQC entity changed its type!\n"); + print(_("A CSQC entity changed its type!\n")); Ent_Remove(); bIsNewEntity = 1; } @@ -911,8 +960,12 @@ void(float bIsNewEntity) CSQC_Ent_Update = case ENT_CLIENT_WARPZONE: WarpZone_Read(bIsNewEntity); break; case ENT_CLIENT_WARPZONE_CAMERA: WarpZone_Camera_Read(bIsNewEntity); break; case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break; + case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break; + case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break; + case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break; + case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break; default: - error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n")); + error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype)); break; } @@ -949,14 +1002,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; } } @@ -1003,7 +1053,7 @@ void Ent_ScoresInfo() teamscores_label[i] = strzone(ReadString()); teamscores_flags[i] = ReadByte(); } - Sbar_InitScores(); + HUD_InitScores(); Gamemode_Init(); } @@ -1013,9 +1063,18 @@ 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()); + gauntlet_shotorigin[0] = decompressShotOrigin(ReadInt24_t()); + gauntlet_shotorigin[1] = decompressShotOrigin(ReadInt24_t()); + gauntlet_shotorigin[2] = decompressShotOrigin(ReadInt24_t()); + gauntlet_shotorigin[3] = decompressShotOrigin(ReadInt24_t()); if(forcefog) strunzone(forcefog); @@ -1025,8 +1084,21 @@ void Ent_Init() g_weaponswitchdelay = ReadByte() / 255.0; - g_balance_grenadelauncher_secondary_bouncefactor = ReadCoord(); - g_balance_grenadelauncher_secondary_bouncestop = ReadCoord(); + g_balance_grenadelauncher_bouncefactor = ReadCoord(); + g_balance_grenadelauncher_bouncestop = ReadCoord(); + g_balance_electro_secondary_bouncefactor = ReadCoord(); + g_balance_electro_secondary_bouncestop = ReadCoord(); + + nex_scope = !ReadByte(); + sniperrifle_scope = !ReadByte(); + + serverflags = ReadByte(); + + cr_maxbullets = ReadByte(); + + minelayer_maxmines = ReadByte(); + + g_trueaim_minrange = ReadCoord(); if(!postinit) PostInit(); @@ -1215,13 +1287,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; } @@ -1229,6 +1301,33 @@ 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; + weapontime = time; // ping the weapon panel +} + // 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. @@ -1255,10 +1354,6 @@ float CSQC_Parse_TempEntity() Net_ReadRace(); bHandled = true; break; - case 13: // TE_BEAM - Net_GrapplingHook(); - bHandled = true; - break; case TE_CSQC_SPAWN: Net_ReadSpawn(); bHandled = true; @@ -1295,6 +1390,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; @@ -1309,7 +1412,7 @@ string getcommandkey(string text, string command) string keys; float n, j, k, l; - if (!sbar_showbinds) + if (!hud_showbinds) return text; keys = db_get(binddb, command); @@ -1327,7 +1430,7 @@ string getcommandkey(string text, string command) keys = strcat(keys, ", ", keynumtostring(k)); ++l; - if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break; + if (hud_showbinds_limit > 0 && hud_showbinds_limit >= l) break; } } @@ -1335,13 +1438,13 @@ string getcommandkey(string text, string command) } if ("" == keys) { - if (sbar_showbinds > 1) - return strcat(text, " (not bound)"); + if (hud_showbinds > 1) + return sprintf(_("%s (not bound)"), text); else return text; } - else if (sbar_showbinds > 1) - return strcat(text, " (", keys, ")"); + else if (hud_showbinds > 1) + return sprintf(_("%s (%s)"), text, keys); else return keys; }