From c6fd4a2cc57f8d9dec7164aff98f5a73abc9698d Mon Sep 17 00:00:00 2001 From: Shereef Marzouk Date: Thu, 11 Aug 2011 10:59:14 +0200 Subject: General whitespace and tab cleanup --- src/game/client/components/menus_settings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/game/client/components/menus_settings.cpp') diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 51fdbd29..7692ac27 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -543,7 +543,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView) WeaponSettings.HSplitTop(14.0f+5.0f+10.0f, 0, &WeaponSettings); UiDoGetButtons(5, 12, WeaponSettings); } - + // defaults { ResetButton.HSplitTop(10.0f, 0, &ResetButton); @@ -554,7 +554,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView) if(DoButton_Menu((void*)&s_DefaultButton, Localize("Reset to defaults"), 0, &ResetButton)) m_pClient->m_pBinds->SetDefaults(); } - + // voting settings { VotingSettings.VSplitLeft(10.0f, 0, &VotingSettings); -- cgit 1.4.1 From 713dd3bc08c0bec4b94b02f990811198f2e6c177 Mon Sep 17 00:00:00 2001 From: Choupom Date: Sun, 4 Dec 2011 18:06:48 +0100 Subject: fixed controls rendering with low ui scale --- src/game/client/components/menus_settings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/game/client/components/menus_settings.cpp') diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 7692ac27..c9b44567 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -504,10 +504,11 @@ void CMenus::RenderSettingsControls(CUIRect MainView) } CUIRect MovementSettings, WeaponSettings, VotingSettings, ChatSettings, MiscSettings, ResetButton; - MainView.VSplitLeft(MainView.w/2-5.0f, &MovementSettings, &VotingSettings); + MainView.VSplitMid(&MovementSettings, &VotingSettings); // movement settings { + MovementSettings.VMargin(5.0f, &MovementSettings); MovementSettings.HSplitTop(MainView.h/3+60.0f, &MovementSettings, &WeaponSettings); RenderTools()->DrawUIRect(&MovementSettings, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f); MovementSettings.Margin(10.0f, &MovementSettings); @@ -550,6 +551,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView) RenderTools()->DrawUIRect(&ResetButton, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f); ResetButton.HMargin(10.0f, &ResetButton); ResetButton.VMargin(30.0f, &ResetButton); + ResetButton.HSplitTop(20.0f, &ResetButton, 0); static int s_DefaultButton = 0; if(DoButton_Menu((void*)&s_DefaultButton, Localize("Reset to defaults"), 0, &ResetButton)) m_pClient->m_pBinds->SetDefaults(); @@ -557,7 +559,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView) // voting settings { - VotingSettings.VSplitLeft(10.0f, 0, &VotingSettings); + VotingSettings.VMargin(5.0f, &VotingSettings); VotingSettings.HSplitTop(MainView.h/3-75.0f, &VotingSettings, &ChatSettings); RenderTools()->DrawUIRect(&VotingSettings, vec4(1,1,1,0.25f), CUI::CORNER_ALL, 10.0f); VotingSettings.Margin(10.0f, &VotingSettings); -- cgit 1.4.1 From b592d7a591f32ecdc2c91a79b76c58f77a2b5fee Mon Sep 17 00:00:00 2001 From: oy Date: Fri, 6 Jan 2012 19:38:40 +0100 Subject: cleaned up playing of global sounds --- src/game/client/components/chat.cpp | 6 +-- src/game/client/components/effects.cpp | 6 +-- src/game/client/components/menus.cpp | 2 +- src/game/client/components/menus_settings.cpp | 4 +- src/game/client/components/players.cpp | 2 +- src/game/client/components/sounds.cpp | 65 ++++++++++++++++++--------- src/game/client/components/sounds.h | 5 ++- src/game/client/gameclient.cpp | 4 +- 8 files changed, 61 insertions(+), 33 deletions(-) (limited to 'src/game/client/components/menus_settings.cpp') diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index a3bf5252..a89d2b7e 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -323,11 +323,11 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine) // play sound if(ClientID == -1) - m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_SERVER, 0, vec2(0,0)); + m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_SERVER, 0); else if(Highlighted) - m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_HIGHLIGHT, 0, vec2(0.0f, 0.0f)); + m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_HIGHLIGHT, 0); else - m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_CLIENT, 0, vec2(0,0)); + m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_CLIENT, 0); } void CChat::OnRender() diff --git a/src/game/client/components/effects.cpp b/src/game/client/components/effects.cpp index 8554b7ba..933e7fe6 100644 --- a/src/game/client/components/effects.cpp +++ b/src/game/client/components/effects.cpp @@ -44,7 +44,7 @@ void CEffects::AirJump(vec2 Pos) p.m_Pos = Pos + vec2(6.0f, 16.0f); m_pClient->m_pParticles->Add(CParticles::GROUP_GENERAL, &p); - m_pClient->m_pSounds->Play(CSounds::CHN_WORLD, SOUND_PLAYER_AIRJUMP, 1.0f, Pos); + m_pClient->m_pSounds->PlayAt(CSounds::CHN_WORLD, SOUND_PLAYER_AIRJUMP, 1.0f, Pos); } void CEffects::DamageIndicator(vec2 Pos, vec2 Dir) @@ -147,7 +147,7 @@ void CEffects::PlayerSpawn(vec2 Pos) m_pClient->m_pParticles->Add(CParticles::GROUP_GENERAL, &p); } - m_pClient->m_pSounds->Play(CSounds::CHN_WORLD, SOUND_PLAYER_SPAWN, 1.0f, Pos); + m_pClient->m_pSounds->PlayAt(CSounds::CHN_WORLD, SOUND_PLAYER_SPAWN, 1.0f, Pos); } void CEffects::PlayerDeath(vec2 Pos, int ClientID) @@ -242,7 +242,7 @@ void CEffects::HammerHit(vec2 Pos) p.m_EndSize = 0; p.m_Rot = frandom()*pi*2; m_pClient->m_pParticles->Add(CParticles::GROUP_EXPLOSIONS, &p); - m_pClient->m_pSounds->Play(CSounds::CHN_WORLD, SOUND_HAMMER_HIT, 1.0f, Pos); + m_pClient->m_pSounds->PlayAt(CSounds::CHN_WORLD, SOUND_HAMMER_HIT, 1.0f, Pos); } void CEffects::OnRender() diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 0e61ec6e..a2ccfba4 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1404,7 +1404,7 @@ void CMenus::OnStateChange(int NewState, int OldState) if(NewState == IClient::STATE_OFFLINE) { if(OldState >= IClient::STATE_ONLINE) - m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0)); + m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f); m_Popup = POPUP_NONE; if(Client()->ErrorString() && Client()->ErrorString()[0] != 0) { diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index c9b44567..de4b10bd 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -763,7 +763,7 @@ void CMenus::RenderSettingsSound(CUIRect MainView) if(g_Config.m_SndEnable) { if(g_Config.m_SndMusic) - m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0)); + m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f); } else m_pClient->m_pSounds->Stop(SOUND_MENU); @@ -778,7 +778,7 @@ void CMenus::RenderSettingsSound(CUIRect MainView) { g_Config.m_SndMusic ^= 1; if(g_Config.m_SndMusic) - m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f, vec2(0, 0)); + m_pClient->m_pSounds->Play(CSounds::CHN_MUSIC, SOUND_MENU, 1.0f); else m_pClient->m_pSounds->Stop(SOUND_MENU); } diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 6811c2ad..2ce73384 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -347,7 +347,7 @@ void CPlayers::RenderPlayer( static int64 SkidSoundTime = 0; if(time_get()-SkidSoundTime > time_freq()/10) { - m_pClient->m_pSounds->Play(CSounds::CHN_WORLD, SOUND_PLAYER_SKID, 0.25f, Position); + m_pClient->m_pSounds->PlayAt(CSounds::CHN_WORLD, SOUND_PLAYER_SKID, 0.25f, Position); SkidSoundTime = time_get(); } diff --git a/src/game/client/components/sounds.cpp b/src/game/client/components/sounds.cpp index 65fb56fb..be63415c 100644 --- a/src/game/client/components/sounds.cpp +++ b/src/game/client/components/sounds.cpp @@ -34,6 +34,30 @@ static int LoadSoundsThread(void *pUser) return 0; } + +int CSounds::GetSampleId(int SetId) +{ + if(!g_Config.m_SndEnable || !Sound()->IsSoundEnabled() || m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds) + return -1; + + CDataSoundset *pSet = &g_pData->m_aSounds[SetId]; + if(!pSet->m_NumSounds) + return -1; + + if(pSet->m_NumSounds == 1) + return pSet->m_aSounds[0].m_Id; + + // return random one + int Id; + do + { + Id = rand() % pSet->m_NumSounds; + } + while(Id == pSet->m_Last); + pSet->m_Last = Id; + return pSet->m_aSounds[Id].m_Id; +} + void CSounds::OnInit() { // setup sound channels @@ -98,7 +122,7 @@ void CSounds::OnRender() int64 Now = time_get(); if(m_QueueWaitTime <= Now) { - Play(m_aQueue[0].m_Channel, m_aQueue[0].m_SetId, 1.0f, vec2(0,0)); + Play(m_aQueue[0].m_Channel, m_aQueue[0].m_SetId, 1.0f); m_QueueWaitTime = Now+time_freq()*3/10; // wait 300ms before playing the next one if(--m_QueuePos > 0) mem_move(m_aQueue, m_aQueue+1, m_QueuePos*sizeof(QueueEntry)); @@ -132,38 +156,39 @@ void CSounds::PlayAndRecord(int Chn, int SetId, float Vol, vec2 Pos) Msg.m_SoundID = SetId; Client()->SendPackMsg(&Msg, MSGFLAG_NOSEND|MSGFLAG_RECORD); - Play(Chn, SetId, Vol, Pos); + Play(Chn, SetId, Vol); } -void CSounds::Play(int Chn, int SetId, float Vol, vec2 Pos) +void CSounds::Play(int Chn, int SetId, float Vol) { - if(!g_Config.m_SndEnable || !Sound()->IsSoundEnabled() || (Chn == CHN_MUSIC && !g_Config.m_SndMusic) || m_WaitForSoundJob || SetId < 0 || SetId >= g_pData->m_NumSounds) + if(Chn == CHN_MUSIC && !g_Config.m_SndMusic) return; - CDataSoundset *pSet = &g_pData->m_aSounds[SetId]; - - if(!pSet->m_NumSounds) + int SampleId = GetSampleId(SetId); + if(SampleId == -1) return; int Flags = 0; if(Chn == CHN_MUSIC) Flags = ISound::FLAG_LOOP; - if(pSet->m_NumSounds == 1) - { - Sound()->PlayAt(Chn, pSet->m_aSounds[0].m_Id, Flags, Pos.x, Pos.y); + Sound()->Play(Chn, SampleId, Flags); +} + +void CSounds::PlayAt(int Chn, int SetId, float Vol, vec2 Pos) +{ + if(Chn == CHN_MUSIC && !g_Config.m_SndMusic) + return; + + int SampleId = GetSampleId(SetId); + if(SampleId == -1) return; - } - // play a random one - int Id; - do - { - Id = rand() % pSet->m_NumSounds; - } - while(Id == pSet->m_Last); - Sound()->PlayAt(Chn, pSet->m_aSounds[Id].m_Id, Flags, Pos.x, Pos.y); - pSet->m_Last = Id; + int Flags = 0; + if(Chn == CHN_MUSIC) + Flags = ISound::FLAG_LOOP; + + Sound()->PlayAt(Chn, SampleId, Flags, Pos.x, Pos.y); } void CSounds::Stop(int SetId) diff --git a/src/game/client/components/sounds.h b/src/game/client/components/sounds.h index ab9cc8e6..9d647398 100644 --- a/src/game/client/components/sounds.h +++ b/src/game/client/components/sounds.h @@ -19,6 +19,8 @@ class CSounds : public CComponent int64 m_QueueWaitTime; class CJob m_SoundJob; bool m_WaitForSoundJob; + + int GetSampleId(int SetId); public: // sound channels @@ -37,7 +39,8 @@ public: void ClearQueue(); void Enqueue(int Channel, int SetId); - void Play(int Channel, int SetId, float Vol, vec2 Pos); + void Play(int Channel, int SetId, float Vol); + void PlayAt(int Channel, int SetId, float Vol, vec2 Pos); void PlayAndRecord(int Channel, int SetId, float Vol, vec2 Pos); void Stop(int SetId); }; diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 6bcf21de..6e94c830 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -551,7 +551,7 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker) pMsg->m_SoundID == SOUND_CTF_GRAB_PL) g_GameClient.m_pSounds->Enqueue(CSounds::CHN_GLOBAL, pMsg->m_SoundID); else - g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_SoundID, 1.0f, vec2(0,0)); + g_GameClient.m_pSounds->Play(CSounds::CHN_GLOBAL, pMsg->m_SoundID, 1.0f); } } @@ -626,7 +626,7 @@ void CGameClient::ProcessEvents() else if(Item.m_Type == NETEVENTTYPE_SOUNDWORLD) { CNetEvent_SoundWorld *ev = (CNetEvent_SoundWorld *)pData; - g_GameClient.m_pSounds->Play(CSounds::CHN_WORLD, ev->m_SoundID, 1.0f, vec2(ev->m_X, ev->m_Y)); + g_GameClient.m_pSounds->PlayAt(CSounds::CHN_WORLD, ev->m_SoundID, 1.0f, vec2(ev->m_X, ev->m_Y)); } } } -- cgit 1.4.1 From 535324d6ed365d32c14e46f6a9f058edf99c4fd0 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 8 Jan 2012 00:20:02 +0100 Subject: added an entry for the kill command to the controls menu. Closes #652 --- data/languages/belarusian.txt | 3 ++ data/languages/bosnian.txt | 3 ++ data/languages/brazilian_portuguese.txt | 3 ++ data/languages/bulgarian.txt | 3 ++ data/languages/czech.txt | 3 ++ data/languages/danish.txt | 40 +++++++++++++------------ data/languages/dutch.txt | 3 ++ data/languages/finnish.txt | 3 ++ data/languages/french.txt | 3 ++ data/languages/german.txt | 3 ++ data/languages/hungarian.txt | 3 ++ data/languages/italian.txt | 3 ++ data/languages/norwegian.txt | 3 ++ data/languages/polish.txt | 3 ++ data/languages/portuguese.txt | 3 ++ data/languages/romanian.txt | 3 ++ data/languages/russian.txt | 5 ++++ data/languages/serbian.txt | 4 +++ data/languages/slovak.txt | 3 ++ data/languages/spanish.txt | 3 ++ data/languages/swedish.txt | 3 ++ data/languages/turkish.txt | 42 +++++++++++++++------------ data/languages/ukrainian.txt | 3 ++ src/game/client/components/menus_settings.cpp | 5 ++-- 24 files changed, 114 insertions(+), 39 deletions(-) (limited to 'src/game/client/components/menus_settings.cpp') diff --git a/data/languages/belarusian.txt b/data/languages/belarusian.txt index 672995c0..88e8f414 100644 --- a/data/languages/belarusian.txt +++ b/data/languages/belarusian.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/bosnian.txt b/data/languages/bosnian.txt index 4888db6a..ce82a3a2 100644 --- a/data/languages/bosnian.txt +++ b/data/languages/bosnian.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/brazilian_portuguese.txt b/data/languages/brazilian_portuguese.txt index a83a0d05..5bebe251 100644 --- a/data/languages/brazilian_portuguese.txt +++ b/data/languages/brazilian_portuguese.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/bulgarian.txt b/data/languages/bulgarian.txt index 38df7891..5bcee12b 100644 --- a/data/languages/bulgarian.txt +++ b/data/languages/bulgarian.txt @@ -672,6 +672,9 @@ no limit ##### needs translation ##### +Respawn +== + Spectate previous == diff --git a/data/languages/czech.txt b/data/languages/czech.txt index 5d50f47a..8b53ff6f 100644 --- a/data/languages/czech.txt +++ b/data/languages/czech.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/danish.txt b/data/languages/danish.txt index d8d0e706..646d8a33 100644 --- a/data/languages/danish.txt +++ b/data/languages/danish.txt @@ -1,3 +1,4 @@ + ##### translated strings ##### %d Bytes @@ -144,6 +145,9 @@ Delete demo Demo details == Demoinformation +Demofile: %s +== Demo fil: %s + Demos == Demoer @@ -387,9 +391,15 @@ Pistol Play == Spil +Play background music +== Spil baggrunds musik + Player == Spiller +Player country: +== Spillernes land: + Player options == Spillermuligheder @@ -537,6 +547,12 @@ Sound volume Spectate == Kig på +Spectate next +== Kig på næste + +Spectate previous +== Kig på forrige + Spectator mode == Tilskuer mode @@ -552,6 +568,9 @@ Standard map Stop record == Stop optagelse +Strict gametype filter +== Streng spiltype filter + Sudden Death == Sudden Death @@ -654,25 +673,10 @@ Your skin no limit == Ingen grænse -Demofile: %s -== Demo fil: %s - -Play background music -== Spil baggrunds musik - -Player country: -== Spillernes land: - -Spectate next -== Kig på næste - -Spectate previous -== Kig på forrige - -Strict gametype filter -== Streng spiltype filter - ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/dutch.txt b/data/languages/dutch.txt index 4375f784..30733489 100644 --- a/data/languages/dutch.txt +++ b/data/languages/dutch.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/finnish.txt b/data/languages/finnish.txt index 77ce6cf7..587af4d8 100644 --- a/data/languages/finnish.txt +++ b/data/languages/finnish.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/french.txt b/data/languages/french.txt index 5ea3b935..a2947bf8 100644 --- a/data/languages/french.txt +++ b/data/languages/french.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/german.txt b/data/languages/german.txt index 17720d60..8110cd2f 100644 --- a/data/languages/german.txt +++ b/data/languages/german.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/hungarian.txt b/data/languages/hungarian.txt index 49f3116a..d265dabc 100644 --- a/data/languages/hungarian.txt +++ b/data/languages/hungarian.txt @@ -666,6 +666,9 @@ Play background music Player country: == +Respawn +== + Spectate next == diff --git a/data/languages/italian.txt b/data/languages/italian.txt index d566da49..4fecf787 100644 --- a/data/languages/italian.txt +++ b/data/languages/italian.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations #####  diff --git a/data/languages/norwegian.txt b/data/languages/norwegian.txt index db362e93..09bb30b9 100644 --- a/data/languages/norwegian.txt +++ b/data/languages/norwegian.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/polish.txt b/data/languages/polish.txt index e955e1e6..bc21c6f7 100644 --- a/data/languages/polish.txt +++ b/data/languages/polish.txt @@ -675,6 +675,9 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### utracić swojej pracy! diff --git a/data/languages/portuguese.txt b/data/languages/portuguese.txt index e3c7c6cb..4f1ca5d5 100644 --- a/data/languages/portuguese.txt +++ b/data/languages/portuguese.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/romanian.txt b/data/languages/romanian.txt index e38faadb..dede932e 100644 --- a/data/languages/romanian.txt +++ b/data/languages/romanian.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/russian.txt b/data/languages/russian.txt index 93a32912..549c2880 100644 --- a/data/languages/russian.txt +++ b/data/languages/russian.txt @@ -1,3 +1,4 @@ + ##### translated strings ##### %d Bytes @@ -674,4 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### + diff --git a/data/languages/serbian.txt b/data/languages/serbian.txt index 58525494..40ba2db1 100644 --- a/data/languages/serbian.txt +++ b/data/languages/serbian.txt @@ -1,3 +1,4 @@ + ##### translated strings ##### %d Bytes @@ -674,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/slovak.txt b/data/languages/slovak.txt index 48816234..d8b190b3 100644 --- a/data/languages/slovak.txt +++ b/data/languages/slovak.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/spanish.txt b/data/languages/spanish.txt index 5348d16a..ff47f3bb 100644 --- a/data/languages/spanish.txt +++ b/data/languages/spanish.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/swedish.txt b/data/languages/swedish.txt index 7f48d95d..944a9146 100644 --- a/data/languages/swedish.txt +++ b/data/languages/swedish.txt @@ -675,5 +675,8 @@ no limit ##### needs translation ##### +Respawn +== + ##### old translations ##### diff --git a/data/languages/turkish.txt b/data/languages/turkish.txt index 55b2c191..9b2a9711 100644 --- a/data/languages/turkish.txt +++ b/data/languages/turkish.txt @@ -1,4 +1,4 @@ - + ##### translated strings ##### %d Bytes @@ -145,6 +145,9 @@ Delete demo Demo details == Demo ayrıntıları +Demofile: %s +== Demo dosyası + Demos == Demolar @@ -200,7 +203,7 @@ Folder == Dosya Force vote -== Oylamayı zorla +== Oylamayı zorla Free-View == Serbest Görüntü @@ -388,6 +391,9 @@ Pistol Play == Oynat +Play background music +== Arkaplan müziğini çal + Player == Oyuncu @@ -538,6 +544,12 @@ Sound volume Spectate == İzle +Spectate next +== Sıradakini izle + +Spectate previous +== Öncekini izle + Spectator mode == İzleyici modu @@ -553,6 +565,9 @@ Standard map Stop record == Kaydı durdur +Strict gametype filter +== Sıkı oyun türü filtresi + Sudden Death == Ani ölüm @@ -655,27 +670,16 @@ Your skin no limit == limit yok -Demofile: %s -== Demo dosyası - -Play background music -== Arkaplan müziğini çal - -Player country: -== Oyuncu ülkesi +##### needs translation ##### Player country: == -Spectate next -== Sıradakini izle - -Spectate previous -== Öncekini izle - -Strict gametype filter -== Sıkı oyun türü filtresi +Respawn +== -#### needs translation ##### ##### old translations ##### + +== ## translated strings ##### + diff --git a/data/languages/ukrainian.txt b/data/languages/ukrainian.txt index 93566829..97f5ca48 100644 --- a/data/languages/ukrainian.txt +++ b/data/languages/ukrainian.txt @@ -615,6 +615,9 @@ Rename Rename demo == +Respawn +== + Server address: == diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index de4b10bd..c7a76cea 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -446,13 +446,14 @@ static CKeyInfo gs_aKeys[] = { "Remote console", "toggle_remote_console", 0 }, { "Screenshot", "screenshot", 0 }, { "Scoreboard", "+scoreboard", 0 }, + { "Respawn", "kill", 0 }, }; /* This is for scripts/update_localization.py to work, don't remove! Localize("Move left");Localize("Move right");Localize("Jump");Localize("Fire");Localize("Hook");Localize("Hammer"); Localize("Pistol");Localize("Shotgun");Localize("Grenade");Localize("Rifle");Localize("Next weapon");Localize("Prev. weapon"); Localize("Vote yes");Localize("Vote no");Localize("Chat");Localize("Team chat");Localize("Show chat");Localize("Emoticon"); - Localize("Spectator mode");Localize("Spectate next");Localize("Spectate previous");Localize("Console");Localize("Remote console");Localize("Screenshot");Localize("Scoreboard"); + Localize("Spectator mode");Localize("Spectate next");Localize("Spectate previous");Localize("Console");Localize("Remote console");Localize("Screenshot");Localize("Scoreboard");Localize("Respawn"); */ const int g_KeyCount = sizeof(gs_aKeys) / sizeof(CKeyInfo); @@ -592,7 +593,7 @@ void CMenus::RenderSettingsControls(CUIRect MainView) TextRender()->Text(0, MiscSettings.x, MiscSettings.y, 14.0f*UI()->Scale(), Localize("Miscellaneous"), -1); MiscSettings.HSplitTop(14.0f+5.0f+10.0f, 0, &MiscSettings); - UiDoGetButtons(17, 25, MiscSettings); + UiDoGetButtons(17, 26, MiscSettings); } } -- cgit 1.4.1 From e960cbdff3bea74edfbca157679dcf65359e0739 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 8 Jan 2012 18:16:38 +0100 Subject: added a config to display the code string of a country flag instead of the image. Closes #897 --- src/engine/shared/config_variables.h | 1 + src/game/client/components/countryflags.cpp | 46 ++++++++++++++++++++++----- src/game/client/components/countryflags.h | 2 +- src/game/client/components/menus.cpp | 8 ++--- src/game/client/components/menus_browser.cpp | 16 +++------- src/game/client/components/menus_settings.cpp | 18 ++++------- src/game/client/components/scoreboard.cpp | 9 ++---- 7 files changed, 55 insertions(+), 45 deletions(-) (limited to 'src/game/client/components/menus_settings.cpp') diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index dfeeeaf6..ac913162 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -17,6 +17,7 @@ MACRO_CONFIG_INT(ConsoleOutputLevel, console_output_level, 0, 0, 2, CFGFLAG_CLIE MACRO_CONFIG_INT(ClCpuThrottle, cl_cpu_throttle, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "") MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "") +MACRO_CONFIG_INT(ClLoadCountryFlags, cl_load_country_flags, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Load and show country flags") MACRO_CONFIG_INT(ClAutoDemoRecord, cl_auto_demo_record, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically record demos") MACRO_CONFIG_INT(ClAutoDemoMax, cl_auto_demo_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically recorded demos (0 = no limit)") diff --git a/src/game/client/components/countryflags.cpp b/src/game/client/components/countryflags.cpp index c2af9a59..e62f4e51 100644 --- a/src/game/client/components/countryflags.cpp +++ b/src/game/client/components/countryflags.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -57,22 +58,30 @@ void CCountryFlags::LoadCountryflagsIndexfile() // load the graphic file char aBuf[128]; - str_format(aBuf, sizeof(aBuf), "countryflags/%s.png", aOrigin); CImageInfo Info; - if(!Graphics()->LoadPNG(&Info, aBuf, IStorage::TYPE_ALL)) + if(g_Config.m_ClLoadCountryFlags) { - char aMsg[128]; - str_format(aMsg, sizeof(aMsg), "failed to load '%s'", aBuf); - Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aMsg); - continue; + str_format(aBuf, sizeof(aBuf), "countryflags/%s.png", aOrigin); + if(!Graphics()->LoadPNG(&Info, aBuf, IStorage::TYPE_ALL)) + { + char aMsg[128]; + str_format(aMsg, sizeof(aMsg), "failed to load '%s'", aBuf); + Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "countryflags", aMsg); + continue; + } } // add entry CCountryFlag CountryFlag; CountryFlag.m_CountryCode = CountryCode; str_copy(CountryFlag.m_aCountryCodeString, aOrigin, sizeof(CountryFlag.m_aCountryCodeString)); - CountryFlag.m_Texture = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0); - mem_free(Info.m_pData); + if(g_Config.m_ClLoadCountryFlags) + { + CountryFlag.m_Texture = Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, 0); + mem_free(Info.m_pData); + } + else + CountryFlag.m_Texture = -1; if(g_Config.m_Debug) { str_format(aBuf, sizeof(aBuf), "loaded country flag '%s'", aOrigin); @@ -117,3 +126,24 @@ const CCountryFlags::CCountryFlag *CCountryFlags::GetByIndex(int Index) const { return &m_aCountryFlags[max(0, Index%m_aCountryFlags.size())]; } + +void CCountryFlags::Render(int CountryCode, const vec4 *pColor, float x, float y, float w, float h) +{ + const CCountryFlag *pFlag = GetByCountryCode(CountryCode); + if(pFlag->m_Texture != -1) + { + Graphics()->TextureSet(pFlag->m_Texture); + Graphics()->QuadsBegin(); + Graphics()->SetColor(pColor->r, pColor->g, pColor->b, pColor->a); + IGraphics::CQuadItem QuadItem(x, y, w, h); + Graphics()->QuadsDrawTL(&QuadItem, 1); + Graphics()->QuadsEnd(); + } + else + { + CTextCursor Cursor; + TextRender()->SetCursor(&Cursor, x, y, 10.0f, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END); + Cursor.m_LineWidth = w; + TextRender()->TextEx(&Cursor, pFlag->m_aCountryCodeString, -1); + } +} diff --git a/src/game/client/components/countryflags.h b/src/game/client/components/countryflags.h index ad24a762..df934821 100644 --- a/src/game/client/components/countryflags.h +++ b/src/game/client/components/countryflags.h @@ -23,7 +23,7 @@ public: int Num() const; const CCountryFlag *GetByCountryCode(int CountryCode) const; const CCountryFlag *GetByIndex(int Index) const; - //int Find(int CountryCode) const; + void Render(int CountryCode, const vec4 *pColor, float x, float y, float w, float h); private: enum diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 15837efc..5ef6b1ae 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1132,12 +1132,8 @@ int CMenus::Render() float OldWidth = Item.m_Rect.w; Item.m_Rect.w = Item.m_Rect.h*2; Item.m_Rect.x += (OldWidth-Item.m_Rect.w)/ 2.0f; - Graphics()->TextureSet(pEntry->m_Texture); - Graphics()->QuadsBegin(); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); - IGraphics::CQuadItem QuadItem(Item.m_Rect.x, Item.m_Rect.y, Item.m_Rect.w, Item.m_Rect.h); - Graphics()->QuadsDrawTL(&QuadItem, 1); - Graphics()->QuadsEnd(); + vec4 Color(1.0f, 1.0f, 1.0f, 1.0f); + m_pClient->m_pCountryFlags->Render(pEntry->m_CountryCode, &Color, Item.m_Rect.x, Item.m_Rect.y, Item.m_Rect.w, Item.m_Rect.h); UI()->DoLabel(&Label, pEntry->m_aCountryCodeString, 10.0f, 0); } } diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 825fe3da..a9c434b3 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -567,12 +567,8 @@ void CMenus::RenderServerbrowserFilters(CUIRect View) float OldWidth = Rect.w; Rect.w = Rect.h*2; Rect.x += (OldWidth-Rect.w)/2.0f; - Graphics()->TextureSet(m_pClient->m_pCountryFlags->GetByCountryCode(g_Config.m_BrFilterCountryIndex)->m_Texture); - Graphics()->QuadsBegin(); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, g_Config.m_BrFilterCountry?1.0f: 0.5f); - IGraphics::CQuadItem QuadItem(Rect.x, Rect.y, Rect.w, Rect.h); - Graphics()->QuadsDrawTL(&QuadItem, 1); - Graphics()->QuadsEnd(); + vec4 Color(1.0f, 1.0f, 1.0f, g_Config.m_BrFilterCountry?1.0f: 0.5f); + m_pClient->m_pCountryFlags->Render(g_Config.m_BrFilterCountryIndex, &Color, Rect.x, Rect.y, Rect.w, Rect.h); if(g_Config.m_BrFilterCountry && UI()->DoButtonLogic(&g_Config.m_BrFilterCountryIndex, "", 0, &Rect)) m_Popup = POPUP_COUNTRY; @@ -766,12 +762,8 @@ void CMenus::RenderServerbrowserServerDetail(CUIRect View) TextRender()->TextEx(&Cursor, pClan, -1); // flag - Graphics()->TextureSet(m_pClient->m_pCountryFlags->GetByCountryCode(pSelectedServer->m_aClients[i].m_Country)->m_Texture); - Graphics()->QuadsBegin(); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.5f); - IGraphics::CQuadItem QuadItem(Flag.x, Flag.y, Flag.w, Flag.h); - Graphics()->QuadsDrawTL(&QuadItem, 1); - Graphics()->QuadsEnd(); + vec4 Color(1.0f, 1.0f, 1.0f, 0.5f); + m_pClient->m_pCountryFlags->Render(pSelectedServer->m_aClients[i].m_Country, &Color, Flag.x, Flag.y, Flag.w, Flag.h); } } } diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index c7a76cea..ea4fee90 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -221,13 +221,10 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView) float OldWidth = Item.m_Rect.w; Item.m_Rect.w = Item.m_Rect.h*2; Item.m_Rect.x += (OldWidth-Item.m_Rect.w)/ 2.0f; - Graphics()->TextureSet(pEntry->m_Texture); - Graphics()->QuadsBegin(); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f); - IGraphics::CQuadItem QuadItem(Item.m_Rect.x, Item.m_Rect.y, Item.m_Rect.w, Item.m_Rect.h); - Graphics()->QuadsDrawTL(&QuadItem, 1); - Graphics()->QuadsEnd(); - UI()->DoLabel(&Label, pEntry->m_aCountryCodeString, 10.0f, 0); + vec4 Color(1.0f, 1.0f, 1.0f, 1.0f); + m_pClient->m_pCountryFlags->Render(pEntry->m_CountryCode, &Color, Item.m_Rect.x, Item.m_Rect.y, Item.m_Rect.w, Item.m_Rect.h); + if(pEntry->m_Texture != -1) + UI()->DoLabel(&Label, pEntry->m_aCountryCodeString, 10.0f, 0); } } @@ -920,11 +917,8 @@ void CMenus::RenderLanguageSelection(CUIRect MainView) Item.m_Rect.VSplitLeft(Item.m_Rect.h*2.0f, &Rect, &Item.m_Rect); Rect.VMargin(6.0f, &Rect); Rect.HMargin(3.0f, &Rect); - Graphics()->TextureSet(m_pClient->m_pCountryFlags->GetByCountryCode(r.front().m_CountryCode)->m_Texture); - Graphics()->QuadsBegin(); - IGraphics::CQuadItem QuadItem(Rect.x, Rect.y, Rect.w, Rect.h); - Graphics()->QuadsDrawTL(&QuadItem, 1); - Graphics()->QuadsEnd(); + vec4 Color(1.0f, 1.0f, 1.0f, 1.0f); + m_pClient->m_pCountryFlags->Render(r.front().m_CountryCode, &Color, Rect.x, Rect.y, Rect.w, Rect.h); Item.m_Rect.HSplitTop(2.0f, 0, &Item.m_Rect); UI()->DoLabelScaled(&Item.m_Rect, r.front().m_Name, 16.0f, -1); } diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index ae11c7ea..935f7bad 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -273,12 +273,9 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch TextRender()->TextEx(&Cursor, m_pClient->m_aClients[pInfo->m_ClientID].m_aClan, -1); // country flag - Graphics()->TextureSet(m_pClient->m_pCountryFlags->GetByCountryCode(m_pClient->m_aClients[pInfo->m_ClientID].m_Country)->m_Texture); - Graphics()->QuadsBegin(); - Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.5f); - IGraphics::CQuadItem QuadItem(CountryOffset, y+(Spacing+TeeSizeMod*5.0f)/2.0f, CountryLength, LineHeight-Spacing-TeeSizeMod*5.0f); - Graphics()->QuadsDrawTL(&QuadItem, 1); - Graphics()->QuadsEnd(); + vec4 Color(1.0f, 1.0f, 1.0f, 0.5f); + m_pClient->m_pCountryFlags->Render(m_pClient->m_aClients[pInfo->m_ClientID].m_Country, &Color, + CountryOffset, y+(Spacing+TeeSizeMod*5.0f)/2.0f, CountryLength, LineHeight-Spacing-TeeSizeMod*5.0f); // ping str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, 0, 1000)); -- cgit 1.4.1 From 3e918075df63245bbc117c7dace711fb3e619003 Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 9 Jan 2012 23:29:15 +0100 Subject: added an option to show only chat messages from friends --- src/game/client/components/chat.cpp | 3 ++- src/game/client/components/menus_settings.cpp | 6 ++++++ src/game/variables.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/game/client/components/menus_settings.cpp') diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index a0eeb0b3..340b9da1 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -266,7 +266,8 @@ void CChat::OnMessage(int MsgType, void *pRawMsg) void CChat::AddLine(int ClientID, int Team, const char *pLine) { if(ClientID != -1 && (m_pClient->m_aClients[ClientID].m_aName[0] == '\0' || // unknown client - m_pClient->m_aClients[ClientID].m_ChatIgnore)) + m_pClient->m_aClients[ClientID].m_ChatIgnore || + (m_pClient->m_Snap.m_LocalClientID != ClientID && g_Config.m_ClShowChatFriends && !m_pClient->m_aClients[ClientID].m_Friend))) return; bool Highlighted = false; diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index ea4fee90..553195b1 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -96,6 +96,12 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView) if(DoButton_CheckBox(&g_Config.m_ClShowhud, Localize("Show ingame HUD"), g_Config.m_ClShowhud, &Button)) g_Config.m_ClShowhud ^= 1; + // chat messages + Left.HSplitTop(5.0f, 0, &Left); + Left.HSplitTop(20.0f, &Button, &Left); + if(DoButton_CheckBox(&g_Config.m_ClShowChatFriends, Localize("Show only chat messages from friends"), g_Config.m_ClShowChatFriends, &Button)) + g_Config.m_ClShowChatFriends ^= 1; + // name plates Right.HSplitTop(20.0f, &Button, &Right); if(DoButton_CheckBox(&g_Config.m_ClNameplates, Localize("Show name plates"), g_Config.m_ClNameplates, &Button)) diff --git a/src/game/variables.h b/src/game/variables.h index 4faa109d..e57a0954 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -14,6 +14,7 @@ MACRO_CONFIG_INT(ClNameplatesSize, cl_nameplates_size, 50, 0, 100, CFGFLAG_CLIEN MACRO_CONFIG_INT(ClAutoswitchWeapons, cl_autoswitch_weapons, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Auto switch weapon on pickup") MACRO_CONFIG_INT(ClShowhud, cl_showhud, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD") +MACRO_CONFIG_INT(ClShowChatFriends, cl_show_chat_friends, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show only chat messages from friends") MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame FPS counter") MACRO_CONFIG_INT(ClAirjumpindicator, cl_airjumpindicator, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "") -- cgit 1.4.1