Compare commits

..

1 commit

Author SHA1 Message Date
Robert Müller 56b9240594 Add "Console" button to start menu
Add button to open the local console in the bottom left of the start menu to ensure that the local console is usable also when no physical keyboard (with F-keys) is available.
2024-08-26 21:30:13 +02:00
113 changed files with 1291 additions and 4148 deletions

View file

@ -2462,7 +2462,6 @@ if(CLIENT)
editor_trackers.cpp
editor_trackers.h
editor_ui.h
enums.h
explanations.cpp
layer_selector.cpp
layer_selector.h
@ -2501,13 +2500,8 @@ if(CLIENT)
mapitems/sound.cpp
mapitems/sound.h
popups.cpp
prompt.cpp
prompt.h
proof_mode.cpp
proof_mode.h
quick_action.h
quick_actions.cpp
quick_actions.h
smooth_value.cpp
smooth_value.h
tileart.cpp
@ -2930,7 +2924,6 @@ if(GTEST_FOUND OR DOWNLOAD_GTEST)
compression.cpp
csv.cpp
datafile.cpp
editor.cpp
fs.cpp
git_revision.cpp
hash.cpp

View file

@ -275,6 +275,9 @@ Player
Player country:
== ﺐﻋﻼﻟﺍ ﺪﻠﺑ:
Player options
== ﺐﻋﻼﻟﺍ ﺕﺍﺩﺍﺪﻋﺍ
Players
== ﻦﻴﺒﻋﻻ
@ -770,6 +773,9 @@ Skin prefix
Show HUD
== ﻞﻜﺸﻟﺍ ﺭﺎﻬﻇﺍ
Reload
== ﻞﻴﻤﺤﺘﻟﺍ ﺓﺩﺎﻋﺍ
9+ new mentions
== 9+ ﺓﺪﻳﺪﺟ ﺕﺍﺭﺎﻌﺷﺍ
@ -1020,6 +1026,9 @@ Debug mode enabled. Press Ctrl+Shift+D to disable debug mode.
Existing Player
== ﺩﻮﺟﻮﻣ ﺐﻋﻼﻟﺍ
Your nickname '%s' is already used (%d points). Do you still want to use it?
==
Checking for existing player with your name
== ﻚﻤﺳﺎﺑ ﺐﻋﻻ ﺩﻮﺟﻭ ﻦﻣ ﻖﻘﺤﺘﻟﺍ
@ -1083,18 +1092,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1225,9 +1225,6 @@ Render complete
Are you sure that you want to restart?
==
Your nickname '%s' is already used (%d points). Do you still want to use it?
==
There's an unsaved map in the editor, you might want to save it.
==
@ -1481,12 +1478,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1654,7 +1645,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1828,39 +1819,6 @@ Unregister protocol and file extensions
DDNet %s is available:
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Extras
==

View file

@ -4,7 +4,6 @@
#modified by:
# Gokturk 2024-06-09 12:00:50
# Gokturk 2024-07-17 02:24:00
# Gokturk 2024-08-29 23:39:00
##### /authors #####
##### translated strings #####
@ -275,6 +274,9 @@ Play background music
Player
== Oyunçu
Player options
== Oyunçu parametrlər
Players
== Oyunçular
@ -650,6 +652,9 @@ Connecting dummy
Connect Dummy
== Dummy daxil ol
Reload
== Yenilə
Deactivate
== Qeyri-aktiv etmək
@ -1445,6 +1450,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace interfeysi
Show client IDs in scoreboard
== Xal lövhəsində klient ID-lərini göstərin
Show DDRace HUD
== DDRace interfeysi göstər
@ -1862,54 +1870,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping
Could not resolve connect address '%s'. See local console for details.
== '%s' Link ünvanını həll etmək mümkün olmadı. Ətraflı məlumat üçün yerli konsola baxın
Connect address error
== Link ünvanı xətası
Could not connect dummy
== Dummy qoşula bilmədi
Dummy is not allowed on this server
== Bu serverdə dummy icazə verilmir
Please wait…
== Zəhmət olmasa gözləyin…
Show client IDs (scoreboard, chat, spectator)
== Klient ID'sini göstərin (aparıcı lövhə, söhbət, izləyici)
Normal:
== Normal:
Team:
== Komanda:
Dummy settings
== Dummy parametrlər
Toggle to edit your dummy settings
== Dummy parametrlərini redaktə etmək üçün açın
Randomize
== Təsadüfi
Are you sure that you want to delete '%s'?
== '%s' Bunu silmək istədiyinizə əminsiniz?
Delete skin
== Skini silin
Basic
== Sadə
Custom
== Xüsusi
Unable to delete skin
== Skin silinə bilməz
Customize
== Fərdiləşdirmək

View file

@ -282,6 +282,9 @@ Player
Player country:
== Краіна гульца:
Player options
== Опцыі гульца
Players
== Гульцы
@ -865,6 +868,9 @@ Loading ghost files
Time
== Час
Reload
== Перазагрузіць
Deactivate
== Выключыць
@ -1161,6 +1167,9 @@ Show votes window after voting
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== Паказваць ID кліента ў табло ачкоў
Show DDRace HUD
== Паказваць DDRace HUD
@ -1697,7 +1706,6 @@ Regular background color
Entities background color
== Колер фону энтыты
[Graphics error]
An error during command recording occurred. Try to update your GPU drivers.
== Адбылася памылка падчас выканання каманды запісу. Паспрабуйце абнавіць драйверы відэакарты.
@ -1866,54 +1874,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
Dummy is not allowed on this server
==
Please wait…
==
Show client IDs (scoreboard, chat, spectator)
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==

View file

@ -280,6 +280,9 @@ Player
Player country:
== Država
Player options
== Postavke igrača
Players
== Igrači
@ -648,6 +651,9 @@ Connecting dummy
Connect Dummy
== Konektuj dummy-a
Reload
== Reload
Deactivate
== Deaktiviraj
@ -945,18 +951,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1388,12 +1385,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1600,7 +1591,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1786,39 +1777,6 @@ Chat command (e.g. showall 1)
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -34,7 +34,6 @@
# Rafael Fontenelle 2024-04-30 14:52:00
# Rafael Fontenelle 2024-06-11 22:43:00
# Rafael Fontenelle 2024-07-17 12:04:00
# Rafael Fontenelle 2024-09-02 16:02:00
##### /authors #####
##### translated strings #####
@ -312,6 +311,9 @@ Player
Player country:
== País do jogador:
Player options
== Opções do jogador
Players
== Jogadores
@ -816,6 +818,9 @@ Show DDNet map finishes in server browser
transmits your player name to info.ddnet.org
== transmite seu nome de jogador para info.ddnet.org
Reload
== Recarregar
Time
== Tempo
@ -1371,6 +1376,9 @@ Show health, shields and ammo
DDRace HUD
== HUD do DDRace
Show client IDs in scoreboard
== Mostrar IDs de cliente no placar
Show DDRace HUD
== Mostrar HUD do DDRace
@ -1893,54 +1901,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping
Could not resolve connect address '%s'. See local console for details.
== Não foi possível resolver o endereço de conexão '%s'. Veja o console local para detalhes.
Connect address error
== Erro no endereço de conexão
Could not connect dummy
== Não foi possível conectar o dummy
Dummy is not allowed on this server
== Dummy não é permitido neste servidor
Please wait…
== Por favor, aguarde…
Show client IDs (scoreboard, chat, spectator)
== Mostrar IDs de clientes (placar, chat, observador)
Normal:
== Normal:
Team:
== Time:
Dummy settings
== Configurações do dummy
Toggle to edit your dummy settings
== Alterne para editar suas configurações do dummy
Randomize
== Aleatorizar
Are you sure that you want to delete '%s'?
== Tem certeza que deseja excluir '%s'?
Delete skin
== Excluir skin
Basic
== Básico
Custom
== Personalizado
Unable to delete skin
== Não foi possível excluir skin
Customize
== Personalizar

View file

@ -277,6 +277,9 @@ Player
Player country:
== Страна на играча:
Player options
== Настройки на Играча
Players
== Играчи
@ -543,18 +546,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1100,12 +1094,6 @@ Are you sure that you want to disconnect?
Connect Dummy
==
Dummy is not allowed on this server
==
Please wait…
==
Connecting dummy
==
@ -1453,7 +1441,7 @@ Show votes window after voting
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1705,6 +1693,9 @@ Regular background color
Entities background color
==
Reload
==
Use current map as background
==
@ -1741,39 +1732,6 @@ No updates available
Check now
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -275,6 +275,9 @@ Player
Player country:
== País del jugador
Player options
== Opcions del jugador
Players
== Jugadors
@ -779,6 +782,9 @@ Show DDNet map finishes in server browser
transmits your player name to info.ddnet.org
== retransmet el teu nom de jugar a info.ddnet.org
Reload
== Recarga
Successfully saved the replay!
== S'ha guardat la repetició correctament!
@ -1191,18 +1197,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1544,12 +1541,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1681,7 +1672,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1837,39 +1828,6 @@ Entities background color
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Extras
==

View file

@ -277,6 +277,9 @@ Player
Player country:
== Çĕршыв:
Player options
== Опцисем
Players
== Çынсем
@ -546,18 +549,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1103,12 +1097,6 @@ Are you sure that you want to disconnect?
Connect Dummy
==
Dummy is not allowed on this server
==
Please wait…
==
Connecting dummy
==
@ -1453,7 +1441,7 @@ Show votes window after voting
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1705,6 +1693,9 @@ Regular background color
Entities background color
==
Reload
==
Use current map as background
==
@ -1741,39 +1732,6 @@ No updates available
Check now
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -6,7 +6,7 @@
# Petr 2011-04-02 23:02:33
# Medik & Petr 2011-07-02 19:37:05
# TeeWorlds-org 2011-07-15 00:34:19
# dobrykafe 2024-08-30 00:00:00
# dobrykafe 2024-06-09 00:00:00
##### /authors #####
##### translated strings #####
@ -281,6 +281,9 @@ Player
Player country:
== Země hráčů:
Player options
== Možnosti hráčů
Players
== Hráči
@ -643,6 +646,9 @@ Connecting dummy
Connect Dummy
== Připojit dummyho
Reload
== Znovu načíst
Deactivate
== Deaktivovat
@ -1628,6 +1634,9 @@ Show local time always
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== Zobrazit ID klientů ve výsledkové tabulce
Show DDRace HUD
== Zobrazit DDRace HUD
@ -1844,77 +1853,26 @@ Tee
Show only chat messages from team members
== Zobrazit pouze zprávy od členů týmu
Could not resolve connect address '%s'. See local console for details.
== Nelze získat adresu k připojení '%s'. Podrobnosti najdete v místní konzoli.
Connect address error
== Chyba v adrese k připojení
Could not connect dummy
== Nepodařilo se připojit dummyho
[Spectating]
Following %s
== Sledujete %s
==
Example of usage
== Příklad použití
Dummy is not allowed on this server
== Dummy není na tomto serveru povolen
Please wait…
== Čekejte prosím…
Show client IDs (scoreboard, chat, spectator)
== Zobrazit ID klientů (výsledková tabulka, chat, divák)
Normal:
== Normální:
Team:
== Tým:
Dummy settings
== Nastavení dummyho
Toggle to edit your dummy settings
== Přepnutím upravíte nastavení dummyho
Randomize
== Randomizovat
Are you sure that you want to delete '%s'?
== Jste si jisti, že chcete smazat '%s'?
Delete skin
== Odstranit skin
Basic
== Základní
Custom
== Vlastní
Unable to delete skin
== Nelze odstranit skin
Customize
== Přizpůsobit
==
Round %d/%d
== Kolo %d/%d
==
[Spectators]
%d others…
== %d dalších…
==
[Team and size]
%d\n(%d/%d)
== %d\n(%d/%d)
==
Team %d (%d/%d)
== Tým %d (%d/%d)
==
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping
==

View file

@ -278,6 +278,9 @@ Player
Player country:
== Spillernes land:
Player options
== Spillermuligheder
Players
== Spillere
@ -673,6 +676,9 @@ Kill
Pause
== Pause
Reload
== Genindlæs
Deactivate
== Deaktiver
@ -1094,18 +1100,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1489,12 +1486,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1662,7 +1653,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1833,39 +1824,6 @@ Chat command (e.g. showall 1)
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Extras
==

View file

@ -290,6 +290,9 @@ Player
Player country:
== Speler land:
Player options
== Speler opties
Players
== Spelers
@ -660,6 +663,9 @@ Connecting dummy
Connect Dummy
== Verbind Dummy
Reload
== Herladen
Deactivate
== Deactiveren
@ -1237,18 +1243,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1587,12 +1584,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1718,7 +1709,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1859,39 +1850,6 @@ Entities background color
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Extras
==

View file

@ -300,6 +300,9 @@ Kill
Pause
== Paŭzi
Player options
== Ludantaj agordoj
Player
== Ludanto
@ -562,18 +565,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1059,12 +1053,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Stop record
==
@ -1493,7 +1481,7 @@ Show votes window after voting
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1736,6 +1724,9 @@ Regular background color
Entities background color
==
Reload
==
Use current map as background
==
@ -1760,39 +1751,6 @@ DDNet Client updated!
No updates available
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -281,6 +281,9 @@ Player
Player country:
== Mängija maa:
Player options
== Mängija sätted
Players
== Mängijad
@ -707,6 +710,9 @@ Kill
Pause
== Paus
Reload
== Lae uuesti
Deactivate
== Deaktiveeri
@ -1599,6 +1605,9 @@ Show local time always
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== Näita kliendi ID-eid tulemustabelis
Show DDRace HUD
== Näita DDRace HUD-i
@ -1863,56 +1872,5 @@ Round %d/%d
Team %d (%d/%d)
== Tiim %d (%d/%d)
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
Dummy is not allowed on this server
==
Please wait…
==
Show client IDs (scoreboard, chat, spectator)
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
https://wiki.ddnet.org/wiki/Mapping
==

View file

@ -280,6 +280,9 @@ Player
Player country:
== Pelaajan maa:
Player options
== Pelaajavalinnat
Players
== Pelaajat
@ -706,6 +709,9 @@ Kill
Pause
== Pysäytä
Reload
== Päivitä
Deactivate
== Deaktivoi
@ -1628,6 +1634,9 @@ Show local time always
DDRace HUD
== DDrace-HUD
Show client IDs in scoreboard
== Näytä asiakas-ID:t pistetaulukossa
Show DDRace HUD
== Näytä DDRace-HUD
@ -1823,15 +1832,6 @@ Loading sound files
Moved ingame
== Liikui pelissä
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
[Spectating]
Following %s
==
@ -1842,57 +1842,15 @@ Following %s
Example of usage
==
Dummy is not allowed on this server
==
Please wait…
==
Converse
==
Tee
==
Show client IDs (scoreboard, chat, spectator)
==
Show only chat messages from team members
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -302,6 +302,9 @@ Player
Player country:
== Origine des Tees:
Player options
== Options des joueurs
Players
== Joueurs
@ -607,6 +610,9 @@ AntiPing: predict other players
Are you sure that you want to disconnect your dummy?
== Êtes vous sûrs de vouloir déconnecter votre dummy ?
Reload
== Recharger
Server best:
== Meilleur score du serveur
@ -1384,6 +1390,9 @@ Name Plate
Hook Collisions
== Collisions du grappin
Show client IDs in scoreboard
== Afficher les IDs des clients dans le tableau des scores
Hook collision line width
== Largeur de la ligne de collision du grappin
@ -1865,15 +1874,6 @@ Entities background color
Moved ingame
== Déplacé en jeu
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
[Spectating]
Following %s
==
@ -1881,48 +1881,6 @@ Following %s
Example of usage
==
Dummy is not allowed on this server
==
Please wait…
==
Show client IDs (scoreboard, chat, spectator)
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -280,6 +280,9 @@ Player
Player country:
== País do xogador
Player options
== Opcións de xogador
Players
== Xogadores
@ -649,6 +652,9 @@ Connecting dummy
Connect Dummy
== Conectar Dummy
Reload
== Recargar
Deactivate
== Desactivar
@ -1352,6 +1358,9 @@ Show health, shields and ammo
DDRace HUD
== HUD DDRace
Show client IDs in scoreboard
== Mostrar IDs de cliente na táboa de puntuación
Show DDRace HUD
== Mostrar o HUD DDRace
@ -1562,15 +1571,6 @@ Relative
Absolute
== Absoluto
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
Error playing demo
==
@ -1767,12 +1767,6 @@ Delete folder
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1803,9 +1797,6 @@ Info Messages
Show local time always
==
Show client IDs (scoreboard, chat, spectator)
==
Always show chat
==
@ -1860,39 +1851,6 @@ Regular background color
Entities background color
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -299,6 +299,9 @@ Player
Player country:
== Spielerland:
Player options
== Spieleroptionen
Players
== Spieler
@ -362,6 +365,9 @@ Shotgun
Show chat
== Chat anzeigen
Show client IDs in scoreboard
== Client-IDs in der Punktetafel anzeigen
Show DDRace HUD
== DDRace-HUD anzeigen
@ -809,6 +815,9 @@ Skin prefix
Show HUD
== HUD zeigen
Reload
== Neu laden
9+ new mentions
== 9+ Erwähnungen
@ -1878,56 +1887,5 @@ Round %d/%d
Team %d (%d/%d)
== Team %d (%d/%d)
Could not resolve connect address '%s'. See local console for details.
== Konnte Verbindungsadresse '%s' nicht auflösen, siehe lokale Konsole für Details.
Connect address error
== Fehler in Verbindungsadresse
Could not connect dummy
== Konnte Dummy nicht verbinden
Dummy is not allowed on this server
== Dummy ist auf diesem Server nicht erlaubt
Please wait…
== Bitte warten…
Show client IDs (scoreboard, chat, spectator)
== Client-IDs anzeigen (Punktetafel, Chat, Beobachter)
Normal:
== Normal:
Team:
== Team:
Dummy settings
== Dummy-Einstellungen
Toggle to edit your dummy settings
== Zu Dummy-Einstellungen wechseln
Randomize
== Randomisieren
Are you sure that you want to delete '%s'?
== Bist du sicher dass du '%s' löschen willst?
Delete skin
== Skin löschen
Basic
== Einfach
Custom
== Individuell
Unable to delete skin
== Kann Skin nicht löschen
Customize
== Anpassen
https://wiki.ddnet.org/wiki/Mapping
==

View file

@ -280,6 +280,9 @@ Player
Player country:
== Χώρα παίκτη:
Player options
== Επιλογές παίκτη
Players
== Παίκτες
@ -552,18 +555,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1106,12 +1100,6 @@ Are you sure that you want to disconnect?
Connect Dummy
==
Dummy is not allowed on this server
==
Please wait…
==
Connecting dummy
==
@ -1456,7 +1444,7 @@ Show votes window after voting
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1705,6 +1693,9 @@ Regular background color
Entities background color
==
Reload
==
Use current map as background
==
@ -1741,39 +1732,6 @@ No updates available
Check now
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -270,6 +270,9 @@ Pistol
Player
== Játékos
Player options
== Játékosok kezelése
Players
== Játékosok
@ -786,6 +789,9 @@ Show DDNet map finishes in server browser
transmits your player name to info.ddnet.org
== továbbítja a játékosnevedet az info.ddnet.org oldalra
Reload
== Újratöltés
Hammerfly dummy
== Másolat kalapácsolás
@ -1054,6 +1060,9 @@ Auto
Replay
== Visszajátszás
The width of texture %s is not divisible by %d, or the height is not divisible by %d, which might cause visual bugs.
==
Getting server list from master server
== Szerverlista lekérése a fő szerverekről
@ -1329,6 +1338,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== Mutassa a kliensek ID-ét a pontszámtáblán
Show DDRace HUD
== Mutassa a DDRace HUD-ot (Speciális HUD)
@ -1539,15 +1551,6 @@ Unregister protocol and file extensions
Open the directory to add custom assets
== Megnyitni az egyedi Képek helyét
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
Error playing demo
==
@ -1560,9 +1563,6 @@ Saving settings to '%s' failed
Error saving settings
==
The width of texture %s is not divisible by %d, or the height is not divisible by %d, which might cause visual bugs.
==
Loading demo file from storage
==
@ -1772,12 +1772,6 @@ Delete folder
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1808,9 +1802,6 @@ Info Messages
Show local time always
==
Show client IDs (scoreboard, chat, spectator)
==
Always show chat
==
@ -1862,39 +1853,6 @@ Regular background color
Entities background color
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -284,6 +284,9 @@ Player
Player country:
== Filtra per paese:
Player options
== Opzioni giocatore
Players
== Giocatori
@ -706,6 +709,9 @@ Kill
Pause
== Pausa
Reload
== Ricarica
Deactivate
== Disattiva
@ -1267,6 +1273,9 @@ Hook Collisions
Show health, shields and ammo
== Mostra vita, scudi e munizioni
Show client IDs in scoreboard
== Mostra gli ID clienti nella scoreboard
Show DDRace HUD
== Mostra l'HUD DDRace
@ -1402,18 +1411,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1680,12 +1680,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1789,9 +1783,6 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
==
Always show chat
==
@ -1882,39 +1873,6 @@ Regular background color
Entities background color
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Extras
==

View file

@ -274,6 +274,9 @@ Player
Player country:
== 所在地:
Player options
== プレイヤー設定
Players
== プレーヤー
@ -681,6 +684,9 @@ Kill
Pause
== 観察
Reload
== 更新
Deactivate
== 無効にする
@ -1129,18 +1135,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1515,12 +1512,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1673,7 +1664,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1838,39 +1829,6 @@ Chat command (e.g. showall 1)
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Extras
==

View file

@ -280,6 +280,9 @@ Pistol
Player
== 플레이어
Player options
== 플레이어 옵션
Players
== 플레이어
@ -531,6 +534,9 @@ Successfully saved the replay!
Replay feature is disabled!
== 리플레이 기능을 비활성화했습니다!
The width of texture %s is not divisible by %d, or the height is not divisible by %d, which might cause visual bugs.
==
Warning
== 주의
@ -696,6 +702,9 @@ Pause
Time
== 시간
Reload
== 새로고침
Deactivate
== 비활성화
@ -1350,6 +1359,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== 점수판에 클라이언트 ID 표시
Show DDRace HUD
== DDRace HUD 표시
@ -1551,15 +1563,6 @@ Copy info
Create a random skin
== 무작위 스킨 생성
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
Error playing demo
==
@ -1572,9 +1575,6 @@ Saving settings to '%s' failed
Error saving settings
==
The width of texture %s is not divisible by %d, or the height is not divisible by %d, which might cause visual bugs.
==
Loading demo file from storage
==
@ -1784,12 +1784,6 @@ Delete folder
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1820,9 +1814,6 @@ Info Messages
Show local time always
==
Show client IDs (scoreboard, chat, spectator)
==
Always show chat
==
@ -1874,39 +1865,6 @@ Regular background color
Entities background color
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -309,6 +309,9 @@ Player
Player country:
== Өлкөсү:
Player options
== Оюнчу опциялары
Players
== Оюнчулар
@ -543,18 +546,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1097,12 +1091,6 @@ Are you sure that you want to disconnect?
Connect Dummy
==
Dummy is not allowed on this server
==
Please wait…
==
Connecting dummy
==
@ -1447,7 +1435,7 @@ Show votes window after voting
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1696,6 +1684,9 @@ Regular background color
Entities background color
==
Reload
==
Use current map as background
==
@ -1732,39 +1723,6 @@ No updates available
Check now
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -279,6 +279,9 @@ Player
Player country:
== Spillerland:
Player options
== Spillerinstillinger
Players
== Spillere
@ -650,6 +653,9 @@ Connecting dummy
Connect Dummy
== Koble til dummy
Reload
== Last på nytt
Deactivate
== Deaktiver
@ -1095,18 +1101,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1490,12 +1487,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1663,7 +1654,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1834,39 +1825,6 @@ Chat command (e.g. showall 1)
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Extras
==

View file

@ -519,6 +519,9 @@ Kill
Pause
== ﺚﮑﻣ ﺖﻟﺎﺣ
Player options
== ﻦﮑﯾﺯﺎﺑ ﺕﺎﻤﯿﻈﻨﺗ
Player
== ﻦﮑﯾﺯﺎﺑ
@ -540,6 +543,9 @@ Vote command:
Time
== ﻥﺎﻣﺯ
Reload
== ﻩﺭﺎﺑﻭﺩ ﯼﺮﯿﮔﺭﺎﺑ
Deactivate
== ﻥﺩﺮﮐ ﻝﺎﻌﻓﺮﯿﻏ
@ -1219,6 +1225,9 @@ Show votes window after voting
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== ﺯﺎﯿﺘﻣﺍ ﯼﻮﻠﺑﺎﺗ ﺭﺩ ﺖﻨﯾﻼﮐ ID ﺶﯾﺎﻤﻧ
Show DDRace HUD
== DDRace HUD ﺶﯾﺎﻤﻧ
@ -1509,18 +1518,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1754,12 +1754,6 @@ Delete folder
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1793,9 +1787,6 @@ Info Messages
Show local time always
==
Show client IDs (scoreboard, chat, spectator)
==
Always show chat
==
@ -1850,39 +1841,6 @@ Entities background color
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -282,6 +282,9 @@ Player
Player country:
== Narodowość:
Player options
== Opcje gracza
Players
== Gracze
@ -680,6 +683,9 @@ Enable replays
Automatically create statboard csv
== Automatycznie stwórz plik csv z tabelą wyników
Reload
== Przeładuj
Replay feature is disabled!
== Funkcja odtwarzania jest wyłączona!
@ -1633,6 +1639,9 @@ Show health, shields and ammo
Show local time always
== Pokazuj czas lokalny
Show client IDs in scoreboard
== Pokazuj ID klienta w tabeli wyników
Show DDRace HUD
== Pokazuj HUD DDRace
@ -1799,15 +1808,6 @@ Submitting the render commands failed. Try to update your GPU drivers.
Failed to swap framebuffers. Try to update your GPU drivers.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
Match %d of %d
==
@ -1840,12 +1840,6 @@ Folder Link
map not included
==
Dummy is not allowed on this server
==
Please wait…
==
Aim bind
==
@ -1861,45 +1855,9 @@ Tee
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
==
Show only chat messages from team members
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -290,6 +290,9 @@ Player
Player country:
== País do jogador
Player options
== Opções do jogador
Players
== Jogadores
@ -770,6 +773,9 @@ Connect Dummy
Time
== Tempo
Reload
== Recarregar
Deactivate
== Desativar
@ -884,18 +890,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1333,12 +1330,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Kill
==
@ -1572,7 +1563,7 @@ Show local time always
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1776,39 +1767,6 @@ Chat command (e.g. showall 1)
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -286,6 +286,9 @@ Player
Player country:
== Țara jucătorului:
Player options
== Opțiuni jucător
Players
== Jucători
@ -558,18 +561,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1112,12 +1106,6 @@ Are you sure that you want to disconnect?
Connect Dummy
==
Dummy is not allowed on this server
==
Please wait…
==
Connecting dummy
==
@ -1462,7 +1450,7 @@ Show votes window after voting
DDRace HUD
==
Show client IDs (scoreboard, chat, spectator)
Show client IDs in scoreboard
==
Show DDRace HUD
@ -1711,6 +1699,9 @@ Regular background color
Entities background color
==
Reload
==
Use current map as background
==
@ -1747,39 +1738,6 @@ No updates available
Check now
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Emoticons
==

View file

@ -294,6 +294,9 @@ Player
Player country:
== Страна игрока:
Player options
== Опции игрока
Players
== Игроки
@ -631,7 +634,7 @@ Loading DDNet Client
== Загрузка DDNet Client
Normal message
== Обычное
== Обычное с.
Connecting dummy
== Подключение дамми
@ -643,10 +646,10 @@ Save ghost
== Сохранять тень
DDNet Client updated!
== DDNet клиент обновлён!
== DDNet Client обновлён!
Highlighted message
== Выделенное
== Выделенное с.
Demo
== Демо
@ -724,7 +727,7 @@ Downloading %s:
== Скачивание %s:
Update failed! Check log…
== Не удалось обновиться! Подробности в логах
== Ошибка. Проверьте логи
Restart
== Рестарт
@ -747,6 +750,9 @@ Fetch Info
Connect Dummy
== Подключить дамми
Reload
== Перезагрузить
Deactivate
== Выключить
@ -844,7 +850,7 @@ DDNet
== DDNet
Friend message
== Дружеское
== Дружеское с.
Save the best demo of each race
== Сохранять лучшее демо каждой карты
@ -916,10 +922,10 @@ Ratio
== Соотношение
Net
== Сальдо
== Сеть
FPM
== У/мин
== FPM
Spree
== Серия
@ -940,7 +946,7 @@ Grabs
== 9+ упоминаний
Client message
== Клиентское
== Клиентское с.
Warning
== Предупреждение
@ -973,7 +979,7 @@ Run server
== Запустить сервер
Server executable not found, can't run server
== Файл сервера не найден, не удалось запустить сервер
== Файл сервера не найден, невозможно запустить
Editor
== Редактор
@ -1356,6 +1362,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== Показывать ид. игроков
Show DDRace HUD
== Показывать DDRace HUD
@ -1878,54 +1887,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping/ru
Could not resolve connect address '%s'. See local console for details.
== Не удалось определить адрес подключения '%s'. Подробности в локальной консоли.
Connect address error
== Ошибка адреса подключения
Could not connect dummy
== Невозможно подключить дамми
Dummy is not allowed on this server
== Дамми не разрешен на этом сервере
Please wait…
== Пожалуйста, подождите…
Show client IDs (scoreboard, chat, spectator)
== Показывать ID клиента (табло, чат, наблюдатель)
Normal:
== Обычный:
Team:
== В команде:
Dummy settings
== Настройки дамми
Toggle to edit your dummy settings
== Нажмите, чтобы изменить настройки дамми
Randomize
== Случайный
Are you sure that you want to delete '%s'?
== Вы уверены, что хотите удалить '%s'?
Delete skin
== Удалить скин
Basic
== Пресеты
Custom
== Кастомизация
Unable to delete skin
== Невозможно удалить скин
Customize
== Кастомизировать

View file

@ -281,6 +281,9 @@ Player
Player country:
== Država igrača
Player options
== Podešavanja igrača
Players
== Igrači
@ -682,6 +685,9 @@ Kill
Pause
== Pauza
Reload
== Osveži
Deactivate
== Deaktiviraj
@ -1258,6 +1264,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace Prikaz
Show client IDs in scoreboard
== Prikaži identitete na tabli rezultata
Show DDRace HUD
== Prikaži DDRace Prikaz
@ -1640,15 +1649,6 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not connect dummy
==
Error playing demo
==
@ -1785,12 +1785,6 @@ Netversion
map not included
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1815,9 +1809,6 @@ Info Messages
Show local time always
==
Show client IDs (scoreboard, chat, spectator)
==
Always show chat
==
@ -1869,39 +1860,6 @@ Regular background color
Entities background color
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Round %d/%d
==

View file

@ -277,6 +277,9 @@ Player
Player country:
== Држава играча
Player options
== Подешавања играча
Players
== Играчи
@ -681,6 +684,9 @@ Kill
Pause
== Пауза
Reload
== Освежи
Deactivate
== Деактивирај
@ -1257,6 +1263,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace Приказ
Show client IDs in scoreboard
== Прикажи идентитете на табли резултата
Show DDRace HUD
== Прикажи DDRace Приказ
@ -1413,18 +1422,9 @@ Could not initialize the given graphics backend, reverting to the default backen
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
==
Could not resolve connect address '%s'. See local console for details.
==
Connect address error
==
Could not save downloaded map. Try manually deleting this file: %s
==
Could not connect dummy
==
Error playing demo
==
@ -1703,12 +1703,6 @@ Unable to delete the demo '%s'
Unable to delete the folder '%s'. Make sure it's empty first.
==
Dummy is not allowed on this server
==
Please wait…
==
Loading…
==
@ -1772,9 +1766,6 @@ Info Messages
Show local time always
==
Show client IDs (scoreboard, chat, spectator)
==
Always show chat
==
@ -1859,39 +1850,6 @@ Entities background color
Unregister protocol and file extensions
==
Normal:
==
Team:
==
Dummy settings
==
Toggle to edit your dummy settings
==
Randomize
==
Are you sure that you want to delete '%s'?
==
Delete skin
==
Basic
==
Custom
==
Unable to delete skin
==
Customize
==
Open the directory to add custom assets
==

View file

@ -41,7 +41,6 @@
# 2024-04-21 By
# 2024-06-10 By
# 2024-07-21 By
# 2024-08-29 Pioooooo
##### /authors #####
##### translated strings #####
@ -343,6 +342,9 @@ HUD
Player country:
== 玩家国家 / 地区:
Player options
== 玩家选项
Players
== 玩家
@ -829,6 +831,9 @@ Show DDNet map finishes in server browser
transmits your player name to info.ddnet.org
== 将会发送你的玩家昵称到 info.ddnet.org
Reload
== 刷新
Enable replays
== 启用短时回放
@ -1384,6 +1389,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== 显示客户端 IDs (计分板中)
Show DDRace HUD
== 显示 DDRace HUD
@ -1515,7 +1523,7 @@ Are you sure that you want to reset the controls to their defaults?
[Graphics error]
Failed during initialization. Try to change gfx_backend to OpenGL or Vulkan in settings_ddnet.cfg in the config directory and try again.
== 初始化失败。请尝试打开配置目录中的设置文件settings_ddnet.cfg并将 “gfx_backend” 设置为 “gfx_backend OpenGL” 或 “gfx_backend Vulkan” 再重试。
== 初始化失败。请尝试打开配置目录中的设置文件settings_ddnet.cfg并将“gfx_backend OpenGL”修改为“gfx_backend Vulkan”若没有前者则可直接输入后者再重试。
[Graphics error]
Out of VRAM. Try removing custom assets (skins, entities, etc.), especially those with high resolution.
@ -1539,7 +1547,7 @@ Failed to swap framebuffers. Try to update your GPU drivers.
[Graphics error]
Unknown error. Try to change gfx_backend to OpenGL or Vulkan in settings_ddnet.cfg in the config directory and try again.
== 未知错误。请尝试打开配置目录中的设置文件settings_ddnet.cfg并将 “gfx_backend” 设置为 “gfx_backend OpenGL” 或 “gfx_backend Vulkan” 再重试。
== 未知错误。请尝试打开配置目录中的设置文件settings_ddnet.cfg并将“gfx_backend OpenGL”修改为“gfx_backend Vulkan”若没有前者则可直接输入后者再重试。
[Graphics error]
Could not initialize the given graphics backend, reverting to the default backend now.
@ -1567,7 +1575,7 @@ No controller found. Plug in a controller.
== 未检测到任何控制器。请尝试重新连接控制器。
Unregister protocol and file extensions
== 清除协议与文件类型关联
== 未注册的协议与扩充文件
Open the directory to add custom assets
== 打开用以添加自定义资源的文件夹路径
@ -1906,54 +1914,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/index.php?title=Mapping/zh&variant=zh-hans
Could not resolve connect address '%s'. See local console for details.
== 无法解析连接地址 '%s'。检查本地控制台以获取详情。
Connect address error
== 连接地址错误
Could not connect dummy
== 无法连接分身
Dummy is not allowed on this server
== 此服务器禁止使用分身
Please wait…
== 请稍等…
Show client IDs (scoreboard, chat, spectator)
== 显示客户端 ID计分板、聊天、观战者
Normal:
== 正常:
Team:
== 队伍:
Dummy settings
== 分身设置
Toggle to edit your dummy settings
== 切换以编辑分身设置
Randomize
== 随机
Are you sure that you want to delete '%s'?
== 你确定要删除'%s'吗?
Delete skin
== 删除皮肤
Basic
== 基本
Custom
== 自定义
Unable to delete skin
== 无法删除皮肤
Customize
== 自定义

View file

@ -3,7 +3,7 @@
# Limit and Petr
#modified by:
# LimiT 2011-07-02 20:24:44
# dobrykafe 2024-08-30 00:00:00
# dobrykafe 2024-06-09 00:00:00
##### /authors #####
##### translated strings #####
@ -278,6 +278,9 @@ Player
Player country:
== Filter krajín:
Player options
== Nastavenia hráča
Players
== Hráči
@ -1417,6 +1420,9 @@ Show votes window after voting
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== Zobraziť ID klientov vo výsledkovej tabuľke
Show DDRace HUD
== Zobraziť DDRace HUD
@ -1642,6 +1648,9 @@ Regular background color
Entities background color
== Farba pozadia entít
Reload
== Znovu načítať
Use current map as background
== Použiť aktuálnu mapu ako pozadie
@ -1841,77 +1850,26 @@ Tee
Show only chat messages from team members
== Zobraziť iba správy od členov tímu
Could not resolve connect address '%s'. See local console for details.
== Nie je možné získať adresu na pripojenie '%s'. Podrobnosti nájdete v miestnej konzole.
Connect address error
== Chyba v adrese na pripojenie
Could not connect dummy
== Nepodarilo sa pripojiť dummyho
[Spectating]
Following %s
== Sledujete %s
==
Example of usage
== Príklad použitia
Dummy is not allowed on this server
== Dummy nie je na tomto serveri povolený
Please wait…
== Čakajte prosím…
Show client IDs (scoreboard, chat, spectator)
== Zobraziť ID klientov (výsledková tabuľka, chat, divák)
Normal:
== Normálny:
Team:
== Tím:
Dummy settings
== Nastavenie dummyho
Toggle to edit your dummy settings
== Prepnutím upravíte nastavenie dummyho
Randomize
== Randomizovať
Are you sure that you want to delete '%s'?
== Ste si istí, že chcete zmazať '%s'?
Delete skin
== Odstrániť skin
Basic
== Základné
Custom
== Vlastné
Unable to delete skin
== Nedá sa odstrániť skin
Customize
== Prispôsobiť
==
Round %d/%d
== Kolo %d/%d
==
[Spectators]
%d others…
== %d ďalších…
==
[Team and size]
%d\n(%d/%d)
== %d\n(%d/%d)
==
Team %d (%d/%d)
== Tím %d (%d/%d)
==
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping
==

View file

@ -299,6 +299,9 @@ Player
Player country:
== País del jugador
Player options
== Opciones de jugador
Players
== Jugadores
@ -623,7 +626,7 @@ Types
== Tipos
DDNet %s is out!
== ¡DDNet %s ya está disponible!
== ¡DDNet %s ya esta disponible!
Downloading %s:
== Descargando %s:
@ -670,6 +673,9 @@ Connecting dummy
Connect Dummy
== Conectar Dummy
Reload
== Recargar
Deactivate
== Desactivar
@ -1384,6 +1390,9 @@ Show health, shields and ammo
DDRace HUD
== HUD DDRace
Show client IDs in scoreboard
== Mostrar IDs de cliente en la tabla de puntuación
Show DDRace HUD
== Mostrar el HUD DDRace
@ -1882,54 +1891,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping/es
Could not resolve connect address '%s'. See local console for details.
== No se pudo resolver la dirección de conexión '%s'. Ver la consola local para más detalles.
Connect address error
== Error de dirección de conexión
Could not connect dummy
== No se pudo conectar tu dummy
Dummy is not allowed on this server
== No se permiten dummys en este servidor
Please wait…
== Espera por favor…
Show client IDs (scoreboard, chat, spectator)
== Mostrar IDs de cliente (scoreboard, chat, espectador)
Normal:
== Normal:
Team:
== Equipo:
Dummy settings
== Configuración del dummy
Toggle to edit your dummy settings
== Actívalo para configurar tu dummy
Randomize
== Aleatorizar
Are you sure that you want to delete '%s'?
== ¿Estás seguro de que quieres eliminar '%s'?
Delete skin
== Eliminar skin
Basic
== Básico
Custom
== Personalizado
Unable to delete skin
== No se pudo borrar la skin
Customize
== Personalizar

View file

@ -7,7 +7,7 @@
# 3edcxzaq1 2020-06-25 00:00:00
# cur.ie 2020-09-28 00:00:00
# simpygirl 2022-02-20 00:00:00
# furo 2024-08-29 00:00:00
# furo 2024-07-17 00:00:00
##### /authors #####
##### translated strings #####
@ -282,6 +282,9 @@ Player
Player country:
== Land
Player options
== Spelaralternativ
Players
== Spelare
@ -897,6 +900,9 @@ Show HUD
Pause
== Pausa
Reload
== Ladda om
Spree
== Spree
@ -1510,6 +1516,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== Visa klient ID i poänglista
Show DDRace HUD
== Visa DDRace HUD
@ -1866,54 +1875,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping
Could not resolve connect address '%s'. See local console for details.
== Kunde inte förstå anslutnings adress '%s'. Se den lokala konsolen för detaljer.
Connect address error
== Anslutnings problem
Could not connect dummy
== Kunde inte ansluta dummy
Dummy is not allowed on this server
== Dummy är inte tillåten på denna server
Please wait…
== Vänligen vänta…
Show client IDs (scoreboard, chat, spectator)
== Visa klient IDen (poänglistan, chatt, åskadarmeny)
Normal:
== Normal:
Team:
== Lag:
Dummy settings
== Dummy inställningar
Toggle to edit your dummy settings
== Växla för att ändra dina dummy inställningar
Randomize
== Slumpa
Are you sure that you want to delete '%s'?
== Är du säker att du vill ta bort '%s'?
Delete skin
== Ta bort skin
Basic
== Enkel
Custom
== Anpassa
Unable to delete skin
== Kunde inte ta bort skin
Customize
== Ändra

View file

@ -30,7 +30,6 @@
# 2024-04-21 By
# 2024-06-10 By
# 2024-07-21 By
# 2024-08-29 Pioooooo
##### /authors #####
##### translated strings #####
@ -332,6 +331,9 @@ HUD
Player country:
== 玩家國家/地區:
Player options
== 玩家選項
Players
== 玩家
@ -818,6 +820,9 @@ Show DDNet map finishes in server browser
transmits your player name to info.ddnet.org
== 將會發送你的玩家名稱到 info.ddnet.org
Reload
== 重新整理
Enable replays
== 啟用短時回放
@ -1222,7 +1227,7 @@ Team %d
== 隊伍 %d
Position:
== 坐標
== 坐標
Speed:
== 速度
@ -1373,6 +1378,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace HUD
Show client IDs in scoreboard
== 顯示客戶端 IDs (計分板中)
Show DDRace HUD
== 顯示 DDRace HUD
@ -1504,7 +1512,7 @@ Are you sure that you want to reset the controls to their defaults?
[Graphics error]
Failed during initialization. Try to change gfx_backend to OpenGL or Vulkan in settings_ddnet.cfg in the config directory and try again.
== 初始化失敗。請嘗試打開配置目錄中的設定檔案 (settings_ddnet.cfg) 并將 “gfx_backend” 設定為 “gfx_backend OpenGL” 或 “gfx_backend Vulkan” 再重試。
== 初始化失敗。請嘗試打開配置目錄中的設定檔案 (settings_ddnet.cfg) 并將“gfx_backend OpenGL”修改為“gfx_backend Vulkan” (若沒有前者則可直接輸入後者) 再重試。
[Graphics error]
Out of VRAM. Try removing custom assets (skins, entities, etc.), especially those with high resolution.
@ -1528,7 +1536,7 @@ Failed to swap framebuffers. Try to update your GPU drivers.
[Graphics error]
Unknown error. Try to change gfx_backend to OpenGL or Vulkan in settings_ddnet.cfg in the config directory and try again.
== 未知錯誤。請嘗試打開配置目錄中的設定檔案 (settings_ddnet.cfg) 并將 “gfx_backend” 設定為 “gfx_backend OpenGL” 或 “gfx_backend Vulkan” 再重試。
== 未知錯誤。請嘗試打開配置目錄中的設定檔案 (settings_ddnet.cfg) 并將“gfx_backend OpenGL”修改為“gfx_backend Vulkan” (若沒有前者則可直接輸入後者) 再重試。
[Graphics error]
Could not initialize the given graphics backend, reverting to the default backend now.
@ -1556,7 +1564,7 @@ No controller found. Plug in a controller.
== 未檢測到任何控制器。請嘗試重新連接控制器。
Unregister protocol and file extensions
== 清除連結與檔案類型關聯
== 未注冊的協議與擴充檔案
Open the directory to add custom assets
== 打開用以新增自定義材質的資料夾路徑
@ -1895,54 +1903,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/index.php?title=Mapping/zh&variant=zh-hant
Could not resolve connect address '%s'. See local console for details.
== 無法解析連線地址 '%s'。檢查本機控制台以取得詳情。
Connect address error
== 連線地址錯誤
Could not connect dummy
== 無法連線分身
Dummy is not allowed on this server
== 此服務器禁止使用分身
Please wait…
== 請稍等…
Show client IDs (scoreboard, chat, spectator)
== 顯示客戶端 ID計分板、聊天、旁觀者
Normal:
== 正常:
Team:
== 隊伍:
Dummy settings
== 分身設定
Toggle to edit your dummy settings
== 切換以編輯分身設定
Randomize
== 隨機
Are you sure that you want to delete '%s'?
== 你確定要刪除'%s'嗎?
Delete skin
== 刪除外觀
Basic
== 基本
Custom
== 自定義
Unable to delete skin
== 無法刪除外觀
Customize
== 自定義

View file

@ -16,7 +16,6 @@
# Gokturk 2024-04-24 03:01:50
# Gokturk 2024-06-09 12:00:50
# Gokturk 2024-07-17 02:24:00
# Gokturk 2024-08-29 23:31:00
##### /authors #####
##### translated strings #####
@ -288,6 +287,9 @@ Play background music
Player
== Oyuncu
Player options
== Oyuncu ayarları
Players
== Oyuncular
@ -663,6 +665,9 @@ Connecting dummy
Connect Dummy
== Dummy Katıl
Reload
== Yenile
Deactivate
== Devre dışı bırak
@ -1458,6 +1463,9 @@ Show health, shields and ammo
DDRace HUD
== DDRace arayüzü
Show client IDs in scoreboard
== Skor tablosunda ki istemci ID'lerini göster
Show DDRace HUD
== DDRace arayüzünü göster
@ -1875,54 +1883,3 @@ Team %d (%d/%d)
https://wiki.ddnet.org/wiki/Mapping
== https://wiki.ddnet.org/wiki/Mapping/tr
Could not resolve connect address '%s'. See local console for details.
== '%s' Bağlantı adresi çözümlenemedi. Detaylar için yerel konsola bakın
Connect address error
== Bağlantı adresi hatası
Could not connect dummy
== Dummy bağlanamadı
Dummy is not allowed on this server
== Bu sunucuda dummy izin verilmiyor
Please wait…
== Lütfen bekleyin…
Show client IDs (scoreboard, chat, spectator)
== İstemci ID'sini göster (skor tablosu, sohbet, izleyici)
Normal:
== Normal:
Team:
== Takım:
Dummy settings
== Dummy ayarları
Toggle to edit your dummy settings
== Dummy ayarlarını düzenlemek için açın
Randomize
== Rastgele
Are you sure that you want to delete '%s'?
== '%s' bunu silmek istediğine emin misin?
Delete skin
== Skini sil
Basic
== Basit
Custom
== Özel
Unable to delete skin
== Skin silinemiyor
Customize
== Özelleştir

View file

@ -4,7 +4,6 @@
#modified by:
# 404_not_found 2011-07-30 19:50:58
# EGYT5453 (15.05.2024-04.06.2024)
# veydzh3r (31.08.2024-01.09.2024)
##### /authors #####
##### translated strings #####
@ -33,10 +32,10 @@
== ще %d…
%d player
== Гравці: %d
== Гравців: %d
%d players
== Гравці: %d
== Гравців: %d
[Demo player duration]
%d sec.
@ -77,10 +76,10 @@
== Нових згадок: 9+
A demo with this name already exists
== Демо з цією назвою уже існує
== Демо з цією назвою вже існує
A folder with this name already exists
== Тека з цією назвою уже існує
== Тека з цією назвою вже існує
[Graphics error]
A render command failed. Try to update your GPU drivers.
@ -121,7 +120,7 @@ AFR
== АФР
Aim bind
== Привязка
== Прив'язка
All
== Усі
@ -166,9 +165,6 @@ AntiPing: predict weapons
Appearance
== Вигляд
Are you sure that you want to delete '%s'?
== Ви дійсно хочете видалити '%s'?
Are you sure that you want to delete the demo '%s'?
== Ви дійсно хочете видалити демо '%s'?
@ -176,13 +172,13 @@ Are you sure that you want to delete the folder '%s'?
== Ви дійсно хочете видалити теку '%s'?
Are you sure that you want to disconnect?
== Ви дійсно хочете відєднатися?
== Ви дійсно хочете від'єднатися?
Are you sure that you want to disconnect and switch to a different server?
== Ви дійсно хочете відєднатися й приєднатися до іншого сервера?
== Ви дійсно хочете від'єднатися й приєднатися до іншого сервера?
Are you sure that you want to disconnect your dummy?
== Ви дійсно хочете відєднати свого даммі?
== Ви дійсно хочете від'єднати свого даммі?
Are you sure that you want to quit?
== Ви дійсно хочете вийти?
@ -194,7 +190,7 @@ Are you sure that you want to remove the player '%s' from your friends list?
== Ви дійсно хочете прибрати гравця '%s' зі списку друзів?
Are you sure that you want to reset the controls to their defaults?
== Ви дійсно хочете скинути налаштування керувань до початкових значень?
== Ви дійсно хочете скинути налаштування керування до значень за замовчуванням?
Are you sure that you want to restart?
== Ви дійсно хочете перезапустити?
@ -212,7 +208,7 @@ AUS
== АВС
Authed name color in scoreboard
== Колір авторизованих у таблиці
== Колір авторизованих у таблі
Auto
== Авто
@ -221,7 +217,7 @@ auto
== автоматично
Automatically create statboard csv
== Автоматично зберігати статистику у файл CSV
== Автоматично зберігати статистику у CSV-файл
Automatically record demos
== Автоматично записувати демо
@ -236,14 +232,11 @@ Axis
== Осі
Background
== Тло
== Фон
Background music volume
== Гучність фонової музики
Basic
== Базовий
Best
== НКом
@ -263,7 +256,7 @@ Call vote
== Голосувати
Can't find a Tutorial server
== Не вдається знайти навчальний сервер
== Не вдалося знайти сервер-посібник
Cancel
== Скасувати
@ -296,13 +289,13 @@ Check now
== Перевірити
Checking for existing player with your name
== Перевірка на наявність гравця з вашим ім’ям
== Перевіряємо Ваш нікнейм на доступність
CHN
== КИТ
Choose default eyes when joining a server
== Типові очі під час приєднання до сервера
== Очі, які відображатимуться за замовчуванням
Clan
== Клан
@ -329,7 +322,7 @@ Close the demo player
== Закрити програвач демо
Colors of the hook collision line, in case of a possible collision with:
== Кольори лінії зіткнення гака, в разі можливого зіткнення з:
== Кольори лінії зіткнення гака, якщо він може зіштовхнутися з:
Communities
== Спільноти
@ -337,29 +330,26 @@ Communities
Config directory
== Тека налаштувань
Connect address error
== Помилка адреси з’єднання
Connect Dummy
== Під’єднати даммі
== Приєднати даммі
Connected
== Під’єднано
== Приєднано
Connecting dummy
== Під’єднання даммі
== Приєднуємо даммі
Connecting to
== Під’єднання до
== Приєднуємося до
Connection Problems…
== Проблеми зі зєднанням…
== Проблеми зі з'єднанням…
Console
== Консоль
Continue anyway?
== Усе одно продовжити?
== Все одно продовжити?
Controller
== Контролер
@ -376,25 +366,19 @@ Converse
Copy info
== Скопіювати
Could not connect dummy
== Не вдалося під’єднати даммі
[Graphics error]
Could not initialize the given graphics backend, reverting to the default backend now.
== Не вдалося ініціалізувати заданий графічний рушій, повернення до тпового рушія.
== Не вдалося ініціалізувати заданий графічний рушій, повертаємося до рушія за замовчуванням.
[Graphics error]
Could not initialize the given graphics backend, this is probably because you didn't install the driver of the integrated graphics card.
== Не вдалося ініціалізувати заданий графічний рушій, імовірно, ви не встановили драйвери на вбудовану відеокарту.
Could not resolve connect address '%s'. See local console for details.
== Не вдалося визначити адресу з’єднання '%s'. Див. локальну консоль для подробиць.
== Не вдалося ініціалізувати заданий графічний рушій, можливо тому що ви не встановили драйвери на вбудовану відеокарту.
Could not save downloaded map. Try manually deleting this file: %s
== Не вдалося зберегти завантажену мапу. Спробуйте самостійно видалити цей файл: %s
Count players only
== Рахувати лише гравців
== Рахувати тільки гравців
Countries
== Країни
@ -411,15 +395,9 @@ Current
custom
== власний
Custom
== Власний
Custom colors
== Власні кольори
Customize
== Налаштувати
Cut interval
== Інтервал
@ -439,7 +417,7 @@ DDNet %s is out!
== Вийшов DDNet %s!
DDNet Client needs to be restarted to complete update!
== Потрібно перезапустити клієнт DDNet для завершення оновлення!
== Потрібно перезапустити клієнт DDNet, щоб завершити оновлення!
DDNet Client updated!
== Клієнт DDNet оновлено!
@ -448,22 +426,22 @@ DDRace HUD
== HUD DDRace
DDraceNetwork is a cooperative online game where the goal is for you and your group of tees to reach the finish line of the map. As a newcomer you should start on Novice servers, which host the easiest maps. Consider the ping to choose a server close to you.
== DDraceNetwork — кооперативна мережева гра, ціль якої — дістатися разом зі своєю групою тії до фінішної прямої. Новачкам варто почати із серверів «Для новачків» (Novice), на яких є найпростіші мапи. Зважайте на затримку, коли вибираєте сервер.
== DDraceNetwork — кооперативна мережева гра, ціль якої — дістатися разом зі своєю групою тії до фінішної прямої. Новачкам варто почати із серверів "Для новачків" (Novice), на яких є найпростіші мапи. Зважайте на затримку, коли вибираєте сервер.
Deactivate
== Деактивувати
Deactivate all
== Деактивувати всіх
== Деактивувати усіх
Deaths
== Смерті
== С
Debug mode enabled. Press Ctrl+Shift+D to disable debug mode.
== Увімкнено режим налагодження. Натисніть Ctrl+Shift+D, щоб його вимкнути.
default
== типово
== за замовчуванням
Default length
== Звичайна тривалість
@ -480,9 +458,6 @@ Delete demo
Delete folder
== Видалити теку
Delete skin
== Видалити скін
Demo
== Демо
@ -496,16 +471,16 @@ Demos directory
== Тека демо
Desktop fullscreen
== Робочий стіл на весь екран
== Стільничний повноекранний
Disconnect
== Відєднатися
== Від'єднатися
Disconnect Dummy
== Відєднати даммі
== Від'єднати даммі
Disconnected
== Відєднано
== Від'єднано
Discord
== Discord
@ -523,10 +498,10 @@ Download skins
== Завантажувати скіни
Downloading %s:
== Завантаження %s:
== Завантажуємо %s:
Downloading map
== Завантаження мапи
== Завантажуємо мапу
Draw!
== Нічия!
@ -537,14 +512,8 @@ Dummy
Dummy copy
== Повторювати рухи
Dummy is not allowed on this server
== Використання даммі заборонене на цьому сервері
Dummy settings
== Налаштування даммі
Dynamic Camera
== Динамічна камера
== Рухома камера
Editor
== Редактор
@ -577,7 +546,7 @@ Enable regular chat sound
== Звук звичайного повідомлення
Enable replays
== Увімкнути повтори
== Повтори
Enable server message sound
== Звук повідомлення сервера
@ -589,13 +558,13 @@ Enter Password
== Введіть пароль
Enter Username
== Введіть ім’я користувача
== Введіть логін
Entities
== Сутності
Entities background color
== Колір тла сутностей
== Колір фону сутностей
Error
== Помилка
@ -613,13 +582,13 @@ EUR
== ЄВР
Example of usage
== Приклад використання
== Наприклад
Exclude
== Виключити
Existing Player
== Гравець уже існує
== Гравець вже існує
Export cut as a separate demo
== Експортувати фрагмент як окреме демо
@ -682,7 +651,7 @@ Following
[Spectating]
Following %s
== Cпостерігання за %s
== Слідуємо за %s
Force vote
== Форсувати
@ -712,7 +681,7 @@ FSAA samples
== Вибірка FSAA
Fullscreen
== На весь екран
== Повноекранний
Game
== Гра
@ -739,13 +708,13 @@ Gameplay
== Ігролад
General
== Загальні
== Загальне
Getting game info
== Отримання інформації про гру
== Отримуємо інформацію про гру
Getting server list from master server
== Отримання списку серверів з головного сервера
== Отримуємо список серверів з головного сервера
Ghost
== Привид
@ -757,7 +726,7 @@ Go back one marker
== Перемотати до попередньої мітки
Go back one tick
== Перемотати вперед на один такт
== Перемотати вперед на один тік
Go back the specified duration
== Перемотати назад
@ -766,7 +735,7 @@ Go forward one marker
== Перемотати до наступної мітки
Go forward one tick
== Перемотати вперед на один такт
== Перемотати назад на один тік
Go forward the specified duration
== Перемотати вперед
@ -832,31 +801,31 @@ HUD
== HUD
Hue
== Відтінок
== Тон
Indicate map finish
== Позначати пройдені мапи
Info Messages
== Інфо. повідомлення
== Інфо-повідомлення
Ingame controller mode
== Режим контролера у грі
Ingame controller sens.
== Чутливість у грі
== Чутл. у грі
Ingame mouse sens.
== Чутливість у грі
== Чутл. у грі
Initializing assets
== Ініціалізація текстур
== Ініціалізуємо текстури
Initializing components
== Ініціалізація компонентів
== Ініціалізуємо компоненти
Initializing map logic
== Ініціалізація логіки мапи
== Ініціалізуємо логіку мапи
Internet
== Інтернет
@ -865,7 +834,7 @@ Invalid Demo
== Недійсне демо
It's recommended that you check the settings to adjust them to your liking before joining a server.
== Перед тим, як приєднатися до сервера, рекомендуємо змінити налаштування до ваших уподобань.
== Перед тим як приєднатися до сервера, рекомендуємо змінити налаштування до ваших уподобань.
Join blue
== До синіх
@ -877,7 +846,7 @@ Join red
== До червоних
Join Tutorial Server
== Приєднатися до навчального сервера
== Приєднатися до сервера-посібника
Jump
== Стрибок
@ -916,52 +885,52 @@ Loading…
== Завантаження…
Loading assets
== Завантаження текстур
== Завантажуємо текстури
Loading commands…
== Завантаження команд
== Завантажуємо команди
Loading DDNet Client
== Завантаження клієнта DDNet
== Завантажуємо клієнт DDNet
Loading demo file from storage
== Завантаження демо-файлу зі сховища
== Завантажуємо демо-файл зі сховища
Loading demo files
== Завантаження демо-файлів
== Завантажуємо демо-файли
Loading ghost files
== Завантаження файлів привида
== Завантажуємо файли привида
Loading map file from storage
== Завантаження файлу мапи зі сховища
== Завантажуємо файл мапи зі сховища
Loading menu images
== Завантаження зображень меню
== Завантажуємо зображення меню
Loading menu themes
== Завантаження тем меню
== Завантажуємо теми меню
Loading race demo files
== Завантаження демо-файлів забігів
== Завантажуємо демо-файли забігів
Loading skin files
== Завантаження файлів скінів
== Завантажуємо файли скінів
Loading sound files
== Завантаження звукових файлів
== Завантажуємо звукові файли
Lock team
== Замкнути команду
Locked
== Замкнено
== Заблоковано
Main menu
== Головне меню
Manual
== Уручну
== Вручну
Map
== Мапа
@ -971,7 +940,7 @@ map not included
== мапу не включено
Map sound volume
== Гучність звуків мапи
== Гучність мапи
Mark the beginning of a cut (right click to reset)
== Позначити початок фрагмента (права кнопка миші, щоб скинути)
@ -986,13 +955,13 @@ Match %d of %d
== Збіг %d з %d
Max CSVs
== Макс. кількість файлів CSV
== Найбільше CSV-файлів
Max demos
== Макс. кількість демо-файлів
== Найбільше демо-файлів
Max Screenshots
== Макс. кількість знімків екрана
== Найбільше знімків екрана
may cause delay
== може спричинити затримку
@ -1016,7 +985,7 @@ Move left
== Вліво
Move player to spectators
== Зробити гравця глядачем
== Зробити гравця спостерігачем
Move right
== Вправо
@ -1031,7 +1000,7 @@ Multi-View
== Мульти-камера
Mute when not active
== Приглушувати звук поза грою
== Приглушувати, якщо вікно неактивне
NA
== ПНА
@ -1052,7 +1021,7 @@ Netversion
== Версія
New name:
== Нова назва:
== Нова назва
New random timeout code
== Новий випадковий код тайм-ауту
@ -1064,16 +1033,16 @@ Next weapon
== Наст. зброя
Nickname
== Псевдонім
== Нікнейм
No
== Ні
No answer from server yet.
== Поки що немає відповіді від сервера.
== Сервер ще не відповів.
No controller found. Plug in a controller.
== Жодного контролера не знайдено. Під’єднайте контролер.
== Жодного контролера не знайдено. Підключіть контролер.
No demo selected
== Жодного демо не вибрано
@ -1102,9 +1071,6 @@ No updates available
None
== Немає
Normal:
== Звичайний:
Normal Color
== Колір звичайних повідомлень
@ -1112,23 +1078,23 @@ Normal message
== Звичайні повідомлення
NOT CONNECTED
== НЕ ПІД’ЄДНАНО
== НЕ ПРИЄДНАНО
Nothing hookable
== нічим, за що можна зачепитися
[friends (server browser)]
Offline (%d)
== Не в мережі (%d)
== Офлайн (%d)
Ok
== Гаразд
Online clanmates (%d)
== Співклановці в мережі (%d)
== Онлайн клановці (%d)
Online players (%d)
== Гравці в мережі (%d)
== Онлайн гравці (%d)
Only save improvements
== Зберігати лише покращення
@ -1159,7 +1125,7 @@ Open the settings file
[Graphics error]
Out of VRAM. Try removing custom assets (skins, entities, etc.), especially those with high resolution.
== Недостатньо відеопамяті. Спробуйте видалити власні текстури (скіни, сутності і т.д.), особливо ті, що мають високу роздільність.
== Недостатньо відеопам'яті. Спробуйте видалити власні текстури (скіни, сутності і т.п.), особливо ті, що мають високу роздільну здатність.
Overlay entities
== Накладати сутності
@ -1168,7 +1134,7 @@ Parent Folder
== Батьківська тека
Particles
== Частинки
== Часточки
Pause
== Пауза
@ -1210,6 +1176,9 @@ Player country:
Player info change cooldown
== Затримка зміни інформації про гравця
Player options
== Налаштування гравців
Players
== Гравці
@ -1222,14 +1191,11 @@ Please enter your nickname below.
Please use a different filename
== Будь ласка, назвіть файл по-іншому
Please wait…
== Будь ласка, зачекайте…
Position:
== Позиція:
Preparing demo playback
== Підготовлення відтворення демо
== Підготовлюємо відтворення демо
Press a key…
== Натисніть клавішу…
@ -1244,7 +1210,7 @@ Quads are used for background decoration
== Квади використовуються для декорацій
Quit
== Вийти
== Вихід
Quitting. Please wait…
== Вихід. Будь ласка, зачекайте…
@ -1252,9 +1218,6 @@ Quitting. Please wait…
Race
== Забіг
Randomize
== Навмання
Ratio
== У/С
@ -1262,7 +1225,7 @@ Reason:
== Причина:
Reconnect in %d sec
== Повторне під’єднання за %dс
== Переприєднання через %dс
Record demo
== Запис демо
@ -1277,12 +1240,15 @@ Refresh Rate
== Частота кадрів
Regular background color
== Колір звичайного тла
== Колір звичайного фону
[Ingame controller mode]
Relative
== Відносний
Reload
== Оновити
Remote console
== Віддалена консоль
@ -1320,10 +1286,10 @@ Replay
== Повтор
Replay feature is disabled!
== Повтори вимкнено!
== Повтори відключено!
Requesting to join the game
== Запит на приєднання до гри
== Запитуємо приєднання до гри
Reset
== Скинути
@ -1335,7 +1301,7 @@ Reset filter
== Скинути фільтр
Reset to defaults
== Скинути до типових
== Скинути
Restart
== Перезапустити
@ -1362,7 +1328,7 @@ SA
== ПДА
Same clan color in scoreboard
== Колір співклановців у таблиці
== Колір співклановців у таблі
Sat.
== Насич.
@ -1374,7 +1340,7 @@ Save ghost
== Зберігати привида
Save power by lowering refresh rate (higher input latency)
== Економити енергію шляхом зниження частоти кадрів (вища затримка введення)
== Зберігати енергію зниженням частоти кадрів (вища затримка вводу)
Save the best demo of each race
== Зберігати найкраще демо кожного забігу
@ -1389,7 +1355,7 @@ Score limit
== Гра до
Scoreboard
== Таблиця
== Табло
Screen
== Екран
@ -1401,10 +1367,10 @@ Search
== Пошук
Searching
== Пошук
== Шукаємо
Sending initial client info
== Надсилання початкових даних клієнта
== Надсилаємо початкові дані клієнта
Server address:
== Адреса сервера:
@ -1425,7 +1391,7 @@ Server not full
== Неповний сервер
Set all to Rifle
== Установити так, як у гвинтівки
== Встановити так, як у гвинтівки
Settings
== Налаштування
@ -1451,8 +1417,8 @@ Show chat
Show clan above name plates
== Показувати клан над ніками
Show client IDs (scoreboard, chat, spectator)
== Показувати ID клієнта (таблиця, чат, глядачі)
Show client IDs in scoreboard
== Показувати ID клієнта в таблі
Show DDNet map finishes in server browser
== Показувати пройдені мапи DDNet у браузері серверів
@ -1464,7 +1430,7 @@ Show dummy actions
== Показувати дії з даммі
Show entities
== Показ сутностей
== Сутності
Show finish messages
== Показувати повідомлення про фініші
@ -1473,7 +1439,7 @@ Show freeze bars
== Показувати смугу заморозки
Show friend mark (♥) in name plates
== Показувати позначку друга (♥) біля псевдонімів
== Показувати позначку друга (♥) біля ніків
Show friends only
== Показувати лише з друзями
@ -1482,10 +1448,10 @@ Show ghost
== Показувати привида
Show health, shields and ammo
== Показувати здоров’я, захист і набої
== Показувати здоров'я, щити й набої
Show hook strength icon indicator
== Показувати іконку індикатора сили гака
== Показувати графічний індикатор сили гака
Show hook strength number indicator
== Показувати числовий індикатор сили гака
@ -1509,10 +1475,10 @@ Show local time always
== Завжди показувати місцевий час
Show name plates
== Показувати псевдоніми
== Показувати ніки
Show names in chat in team colors
== Показувати імена в чаті в кольорах команди
== Фарбувати ніки в чаті в кольори команд
Show only chat messages from friends
== Показувати лише повідомлення від друзів
@ -1551,7 +1517,7 @@ Show text entities
== Текстові сутності
Show tiles layers from BG map
== Показувати плитки з мапи фону
== Показувати тайли з мапи фону
Show quads
== Показувати квади
@ -1581,13 +1547,13 @@ Slow down the demo
== Сповільнити
Smooth Dynamic Camera
== Гладка динамічна камера
== Гладка рухома камера
Some map images could not be loaded. Check the local console for details.
== Деякі зображення мапи не завантажилися. Див. локальну консоль для подробиць.
== Деякі зображення мапи не завантажилися. Деталі у локальній консолі.
Some map sounds could not be loaded. Check the local console for details.
== Деякі звуки мапи не завантажилися. Див. локальну консоль для подробиць.
== Деякі звуки мапи не завантажилися. Деталі у локальній консолі.
Something hookable
== чимось, за що можна зачепитися
@ -1611,10 +1577,10 @@ Spectate previous
== Попер. гравець
Spectator mode
== Режим глядача
== Режим спостерігача
Spectators
== Глядачі
== Спостерігачі
Speed
== Швидкість
@ -1666,7 +1632,7 @@ Switch weapon on pickup
== Змінювати зброю при підхопленні
Switch weapon when out of ammo
== Змінювати зброю при закінченні набоїв
== Змінювати зброю коли закінчуються набої
System message
== Повідомлення системи
@ -1674,9 +1640,6 @@ System message
Team
== Команда
Team:
== Командний:
Team %d
== Команда %d
@ -1732,10 +1695,7 @@ Toggle ghost
== Привид
Toggle keyboard shortcuts
== Перемкнути сполучення
Toggle to edit your dummy settings
== Перемкніть, щоб змінити налаштування даммі
== Перемкнути скорочення
transmits your player name to info.ddnet.org
== передає ваш нікнейм до info.ddnet.org
@ -1747,7 +1707,7 @@ Try again
== Спробувати ще раз
Trying to determine UDP connectivity…
== Спроба визначити UDP-з’єднання…
== Намагаємося визначити UDP-з'єднання…
Tutorial
== Посібник
@ -1768,13 +1728,10 @@ UI Color
== Колір інтерфейсу
UI controller sens.
== Чутл. в інтерфейсі
== Чутл. у інтерфейсі
UI mouse sens.
== Чутл. в інтерфейсі
Unable to delete skin
== Не вдалося видалити скін
== Чутл. у інтерфейсі
Unable to delete the demo '%s'
== Не вдалося видалити демо '%s'
@ -1799,25 +1756,25 @@ Unregister protocol and file extensions
== Розреєструвати протокол і розширення файлів
Update failed! Check log…
== Помилка оновлення! Перевірте журнал…
== Оновлення не вдалося! Перевірте журнал…
Update now
== Оновити
Updating…
== Оновлення
== Оновлюємо
Uploading map data to GPU
== Вивантаження даних мапи до відеокарти
== Вивантажуємо дані мапи до відеокарти
Use current map as background
== Використовувати поточну мапу як тло
== Використовувати поточну мапу як фон
Use high DPI
== Високий DPI
Use k key to kill (restart), q to pause and watch other players. See settings for other key binds.
== Натисніть «k», щоб умерти (почати спочатку), «q», щоб спостерігати за іншими гравцями. Інші призначення клавіш дивіться у налаштуваннях.
== Натисніть "k", щоб умерти (почати спочатку), "q", щоб спостерігати за іншими гравцями. Інші скорочення дивіться у налаштуваннях.
Use old chat style
== Старий стиль чату
@ -1841,7 +1798,7 @@ Video name:
== Назва відео:
Video was saved to '%s'
== Відео збережено до '%s'
== Відео було збережено до '%s'
Videos directory
== Тека відео
@ -1886,13 +1843,13 @@ Why are you slowmo replaying to read this?
== Чому ви переглядаєте це у повторі?
Windowed
== У вікні
== Віконний
Windowed borderless
== Вікно без рамок
== Віконний без рамок
Windowed fullscreen
== Вікно на весь екран
== Віконний повноекранний
Yes
== Так
@ -1901,10 +1858,10 @@ Your movements are not taken into account when calculating the line colors
== Ваші рухи не враховуються при розранку кольору лінії
You must restart the game for all settings to take effect.
== Щоб налаштування набули чинності, перезапустіть гру.
== Щоб налаштування набрали чинності, перезапустіть гру.
Your nickname '%s' is already used (%d points). Do you still want to use it?
== Ваш псевдонім «%s» вже зайнято (%d балів). Усе ще хочете використовувати його?
== Нікнейм '%s' вже зайнято (%d балів). Все ще хочете використовувати його?
Your skin
== Ваш скін

View file

@ -7,6 +7,8 @@ export MAKEFLAGS
ANDROID_NDK_VERSION="$(cd "$ANDROID_HOME/ndk" && find . -maxdepth 1 | sort -n | tail -1)"
ANDROID_NDK_VERSION="${ANDROID_NDK_VERSION:2}"
# ANDROID_NDK_VERSION must be exported for build.sh step
export ANDROID_NDK_VERSION
# ANDROID_NDK_HOME must be exported for cargo-ndk
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION"
@ -195,7 +197,6 @@ cd "${BUILD_FOLDER}" || exit 1
mkdir -p src/main
mkdir -p src/main/res/values
mkdir -p src/main/res/xml
mkdir -p src/main/res/mipmap
function copy_dummy_files() {
@ -212,7 +213,6 @@ copy_dummy_files scripts/android/files/proguard-rules.pro proguard-rules.pro
copy_dummy_files scripts/android/files/settings.gradle settings.gradle
copy_dummy_files scripts/android/files/AndroidManifest.xml src/main/AndroidManifest.xml
copy_dummy_files scripts/android/files/res/values/strings.xml src/main/res/values/strings.xml
copy_dummy_files scripts/android/files/res/xml/shortcuts.xml src/main/res/xml/shortcuts.xml
copy_dummy_files other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher.png
copy_dummy_files other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher_round.png

View file

@ -30,8 +30,7 @@
android:name="org.ddnet.client.NativeMain"
android:exported="true"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:screenOrientation="landscape"
android:launchMode="singleInstance">
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@ -39,9 +38,6 @@
<meta-data
android:name="android.app.lib_name"
android:value="DDNet" />
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
</application>
</manifest>

View file

@ -18,6 +18,7 @@ java {
android {
compileSdkVersion 34
ndkVersion "TW_NDK_VERSION"
defaultConfig {
applicationId "org.ddnet.client"
namespace("org.ddnet.client")

View file

@ -45,13 +45,12 @@ sed -i "s/TW_KEY_NAME/${TW_KEY_NAME_ESCAPED}/g" build.gradle
sed -i "s/TW_KEY_PW/${TW_KEY_PW_ESCAPED}/g" build.gradle
sed -i "s/TW_KEY_ALIAS/${TW_KEY_ALIAS_ESCAPED}/g" build.gradle
sed -i "s/TW_NDK_VERSION/${ANDROID_NDK_VERSION}/g" build.gradle
sed -i "s/TW_VERSION_CODE/${TW_VERSION_CODE}/g" build.gradle
sed -i "s/TW_VERSION_NAME/${TW_VERSION_NAME}/g" build.gradle
sed -i "s/DDNet/${APK_BASENAME}/g" src/main/res/values/strings.xml
sed -i "s/org.ddnet.client/${APK_PACKAGE_NAME}/g" src/main/res/xml/shortcuts.xml
sed -i "s/\"DDNet\"/\"${APK_BASENAME}\"/g" src/main/AndroidManifest.xml
sed -i "s/org.ddnet.client/${APK_PACKAGE_NAME}/g" src/main/AndroidManifest.xml

View file

@ -10,8 +10,6 @@ public class NativeMain extends SDLActivity {
private static final int COMMAND_RESTART_APP = SDLActivity.COMMAND_USER + 1;
private String[] launchArguments = new String[0];
@Override
protected String[] getLibraries() {
return new String[] {
@ -22,35 +20,17 @@ public class NativeMain extends SDLActivity {
@Override
public void onCreate(Bundle SavedInstanceState) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
Intent intent = getIntent();
if(intent != null) {
String gfxBackend = intent.getStringExtra("gfx-backend");
if(gfxBackend != null) {
if(gfxBackend.equals("Vulkan")) {
launchArguments = new String[] {"gfx_backend Vulkan"};
} else if(gfxBackend.equals("OpenGL")) {
launchArguments = new String[] {"gfx_backend OpenGL"};
}
}
}
super.onCreate(SavedInstanceState);
}
@Override
protected String[] getArguments() {
return launchArguments;
}
@Override
protected boolean onUnhandledMessage(int command, Object param) {
if(command == COMMAND_RESTART_APP) {
restartApp();
return true;
}
return false;
}
return false;
}
private void restartApp() {
Intent restartIntent =

View file

@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">DDNet</string>
<string name="shortcut_play_vulkan_short">Play (Vulkan)</string>
<string name="shortcut_play_opengl_short">Play (OpenGL)</string>
<string name="app_name">DDNet</string>
</resources>

View file

@ -1,30 +0,0 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="play-vulkan"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:shortcutShortLabel="@string/shortcut_play_vulkan_short">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="org.ddnet.client"
android:targetClass="org.ddnet.client.NativeMain">
<extra
android:name="gfx-backend"
android:value="Vulkan" />
</intent>
</shortcut>
<shortcut
android:shortcutId="play-opengl"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:shortcutShortLabel="@string/shortcut_play_opengl_short">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="org.ddnet.client"
android:targetClass="org.ddnet.client.NativeMain">
<extra
android:name="gfx-backend"
android:value="OpenGL" />
</intent>
</shortcut>
</shortcuts>

View file

@ -37,7 +37,7 @@ def decode(fileobj, elements_per_key):
if current_key:
if len(data[current_key]) != 1+elements_per_key:
raise LanguageDecodeError("Wrong number of elements per key", fileobj.name, index)
data[current_key].append(index - 1 if current_context else index)
data[current_key].append(index)
if line in data:
raise LanguageDecodeError("Key defined multiple times: " + line, fileobj.name, index)
data[(line, current_context)] = [index - 1 if current_context else index]

View file

@ -1236,7 +1236,6 @@ int str_format_int(char *buffer, size_t buffer_size, int value);
template<typename... Args>
int str_format_opt(char *buffer, int buffer_size, const char *format, Args... args)
{
static_assert(sizeof...(args) > 0, "Use str_copy instead of str_format without format arguments");
return str_format(buffer, buffer_size, format, args...);
}

View file

@ -443,9 +443,7 @@ static bool BackendInitGlew(EBackendType BackendType, int &GlewMajor, int &GlewM
#ifdef CONF_GLEW_HAS_CONTEXT_INIT
if(GLEW_OK != glewContextInit())
#else
GLenum InitResult = glewInit();
const char *pVideoDriver = SDL_GetCurrentVideoDriver();
if(GLEW_OK != InitResult && pVideoDriver && !str_comp(pVideoDriver, "wayland") && GLEW_ERROR_NO_GLX_DISPLAY != InitResult)
if(GLEW_OK != glewInit())
#endif
return false;
@ -1021,13 +1019,6 @@ int CGraphicsBackend_SDL_GL::Init(const char *pName, int *pScreen, int *pWidth,
SDL_GetVersion(&Linked);
dbg_msg("sdl", "SDL version %d.%d.%d (compiled = %d.%d.%d)", Linked.major, Linked.minor, Linked.patch,
Compiled.major, Compiled.minor, Compiled.patch);
#if CONF_PLATFORM_LINUX && SDL_VERSION_ATLEAST(2, 0, 22)
// needed to workaround SDL from forcing exclusively X11 if linking against the GLX flavour of GLEW instead of the EGL one
// w/o this on Wayland systems (no XWayland support) SDL's Video subsystem will fail to load (starting from SDL2.30+)
if(Linked.major == 2 && Linked.minor >= 30)
SDL_SetHint(SDL_HINT_VIDEODRIVER, "x11,wayland");
#endif
}
if(!SDL_WasInit(SDL_INIT_VIDEO))

View file

@ -247,7 +247,11 @@ void CClient::SendReady(int Conn)
void CClient::SendMapRequest()
{
dbg_assert(!m_MapdownloadFileTemp, "Map download already in progress");
if(m_MapdownloadFileTemp)
{
io_close(m_MapdownloadFileTemp);
Storage()->RemoveFile(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE);
}
m_MapdownloadFileTemp = Storage()->OpenFile(m_aMapdownloadFilenameTemp, IOFLAG_WRITE, IStorage::TYPE_SAVE);
if(IsSixup())
{
@ -652,7 +656,6 @@ void CClient::DisconnectWithReason(const char *pReason)
m_aRconAuthed[0] = 0;
mem_zero(m_aRconUsername, sizeof(m_aRconUsername));
mem_zero(m_aRconPassword, sizeof(m_aRconPassword));
m_MapDetailsPresent = false;
m_ServerSentCapabilities = false;
m_UseTempRconCommands = 0;
m_ExpectedRconCommands = -1;
@ -668,7 +671,22 @@ void CClient::DisconnectWithReason(const char *pReason)
m_CurrentServerCurrentPingTime = -1;
m_CurrentServerNextPingTime = -1;
ResetMapDownload(true);
// disable all downloads
m_MapdownloadChunk = 0;
if(m_pMapdownloadTask)
m_pMapdownloadTask->Abort();
if(m_MapdownloadFileTemp)
{
io_close(m_MapdownloadFileTemp);
Storage()->RemoveFile(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE);
}
m_MapdownloadFileTemp = 0;
m_MapdownloadSha256Present = false;
m_MapdownloadSha256 = SHA256_ZEROED;
m_MapdownloadCrc = 0;
m_MapdownloadTotalsize = -1;
m_MapdownloadAmount = 0;
m_MapDetailsPresent = false;
// clear the current server info
mem_zero(&m_CurrentServerInfo, sizeof(m_CurrentServerInfo));
@ -1525,8 +1543,6 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
DummyDisconnect(0);
}
ResetMapDownload(true);
SHA256_DIGEST *pMapSha256 = nullptr;
const char *pMapUrl = nullptr;
if(MapDetailsWerePresent && str_comp(m_aMapDetailsName, pMap) == 0 && m_MapDetailsCrc == MapCrc)
@ -1543,6 +1559,12 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
}
else
{
if(m_MapdownloadFileTemp)
{
io_close(m_MapdownloadFileTemp);
Storage()->RemoveFile(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE);
}
// start map download
FormatMapDownloadFilename(pMap, pMapSha256, MapCrc, false, m_aMapdownloadFilename, sizeof(m_aMapdownloadFilename));
FormatMapDownloadFilename(pMap, pMapSha256, MapCrc, true, m_aMapdownloadFilenameTemp, sizeof(m_aMapdownloadFilenameTemp));
@ -1551,11 +1573,16 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
str_format(aBuf, sizeof(aBuf), "starting to download map to '%s'", m_aMapdownloadFilenameTemp);
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "client/network", aBuf);
m_MapdownloadChunk = 0;
str_copy(m_aMapdownloadName, pMap);
m_MapdownloadSha256Present = (bool)pMapSha256;
m_MapdownloadSha256 = pMapSha256 ? *pMapSha256 : SHA256_ZEROED;
m_MapdownloadCrc = MapCrc;
m_MapdownloadTotalsize = MapSize;
m_MapdownloadAmount = 0;
ResetMapDownload();
if(pMapSha256)
{
@ -2193,44 +2220,24 @@ int CClient::UnpackAndValidateSnapshot(CSnapshot *pFrom, CSnapshot *pTo)
return Builder.Finish(pTo);
}
void CClient::ResetMapDownload(bool ResetActive)
void CClient::ResetMapDownload()
{
if(m_pMapdownloadTask)
{
m_pMapdownloadTask->Abort();
m_pMapdownloadTask = nullptr;
}
if(m_MapdownloadFileTemp)
{
io_close(m_MapdownloadFileTemp);
m_MapdownloadFileTemp = 0;
}
if(Storage()->FileExists(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE))
{
Storage()->RemoveFile(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE);
}
if(ResetActive)
{
m_MapdownloadChunk = 0;
m_MapdownloadSha256Present = false;
m_MapdownloadSha256 = SHA256_ZEROED;
m_MapdownloadCrc = 0;
m_MapdownloadTotalsize = -1;
m_MapdownloadAmount = 0;
m_aMapdownloadFilename[0] = '\0';
m_aMapdownloadFilenameTemp[0] = '\0';
m_aMapdownloadName[0] = '\0';
m_pMapdownloadTask = NULL;
}
m_MapdownloadFileTemp = 0;
m_MapdownloadAmount = 0;
}
void CClient::FinishMapDownload()
{
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "client/network", "download complete, loading map");
SHA256_DIGEST *pSha256 = m_MapdownloadSha256Present ? &m_MapdownloadSha256 : nullptr;
int Prev = m_MapdownloadTotalsize;
m_MapdownloadTotalsize = -1;
SHA256_DIGEST *pSha256 = m_MapdownloadSha256Present ? &m_MapdownloadSha256 : 0;
bool FileSuccess = true;
if(Storage()->FileExists(m_aMapdownloadFilename, IStorage::TYPE_SAVE))
@ -2238,26 +2245,36 @@ void CClient::FinishMapDownload()
FileSuccess &= Storage()->RenameFile(m_aMapdownloadFilenameTemp, m_aMapdownloadFilename, IStorage::TYPE_SAVE);
if(!FileSuccess)
{
ResetMapDownload();
char aError[128 + IO_MAX_PATH_LENGTH];
str_format(aError, sizeof(aError), Localize("Could not save downloaded map. Try manually deleting this file: %s"), m_aMapdownloadFilename);
DisconnectWithReason(aError);
return;
}
// load map
const char *pError = LoadMap(m_aMapdownloadName, m_aMapdownloadFilename, pSha256, m_MapdownloadCrc);
if(!pError)
{
ResetMapDownload(true);
ResetMapDownload();
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "client/network", "loading done");
SendReady(CONN_MAIN);
}
else if(m_pMapdownloadTask) // fallback
{
ResetMapDownload(false);
ResetMapDownload();
m_MapdownloadTotalsize = Prev;
SendMapRequest();
}
else
{
if(m_MapdownloadFileTemp)
{
io_close(m_MapdownloadFileTemp);
m_MapdownloadFileTemp = 0;
Storage()->RemoveFile(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE);
}
ResetMapDownload();
DisconnectWithReason(pError);
}
}
@ -2783,7 +2800,7 @@ void CClient::Update()
else if(m_pMapdownloadTask->State() == EHttpState::ERROR || m_pMapdownloadTask->State() == EHttpState::ABORTED)
{
dbg_msg("webdl", "http failed, falling back to gameserver");
ResetMapDownload(false);
ResetMapDownload();
SendMapRequest();
}
}
@ -3316,7 +3333,7 @@ bool CClient::InitNetworkClient(char *pError, size_t ErrorSize)
if(g_Config.m_Bindaddr[0])
str_format(pError, ErrorSize, "Could not open the network client, try changing or unsetting the bindaddr '%s'.", g_Config.m_Bindaddr);
else
str_copy(pError, "Could not open the network client.", ErrorSize);
str_format(pError, ErrorSize, "Could not open the network client.");
return false;
}
}
@ -4357,20 +4374,8 @@ void CClient::RegisterCommands()
// used for server browser update
m_pConsole->Chain("br_filter_string", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_exclude_string", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_full", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_empty", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_spectators", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_friends", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_country", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_country_index", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_pw", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_gametype", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_gametype_strict", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_connecting_players", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_serveraddress", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_unfinished_map", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("br_filter_login", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("add_favorite", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("remove_favorite", ConchainServerBrowserUpdate, this);
m_pConsole->Chain("end_favorite_group", ConchainServerBrowserUpdate, this);

View file

@ -360,7 +360,7 @@ public:
int UnpackAndValidateSnapshot(CSnapshot *pFrom, CSnapshot *pTo);
void ResetMapDownload(bool ResetActive);
void ResetMapDownload();
void FinishMapDownload();
void RequestDDNetInfo() override;

View file

@ -27,6 +27,9 @@
#include <engine/http.h>
#include <engine/storage.h>
static constexpr const char *COMMUNITY_COUNTRY_NONE = "none";
static constexpr const char *COMMUNITY_TYPE_NONE = "None";
class CSortWrap
{
typedef bool (CServerBrowser::*SortFunc)(int, int) const;

View file

@ -228,8 +228,10 @@ int CSound::Init()
return -1;
}
m_MixingRate = g_Config.m_SndRate;
SDL_AudioSpec Format, FormatOut;
Format.freq = g_Config.m_SndRate;
Format.freq = m_MixingRate;
Format.format = AUDIO_S16;
Format.channels = 2;
Format.samples = g_Config.m_SndBufferSize;
@ -237,7 +239,7 @@ int CSound::Init()
Format.userdata = this;
// Open the audio device and start playing sound!
m_Device = SDL_OpenAudioDevice(nullptr, 0, &Format, &FormatOut, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
m_Device = SDL_OpenAudioDevice(nullptr, 0, &Format, &FormatOut, 0);
if(m_Device == 0)
{
dbg_msg("sound", "unable to open audio: %s", SDL_GetError());
@ -246,7 +248,6 @@ int CSound::Init()
else
dbg_msg("sound", "sound init successful using audio driver '%s'", SDL_GetCurrentAudioDriver());
m_MixingRate = FormatOut.freq;
m_MaxFrames = FormatOut.samples * 2;
#if defined(CONF_VIDEORECORDER)
m_MaxFrames = maximum<uint32_t>(m_MaxFrames, 1024 * 2); // make the buffer bigger just in case

View file

@ -53,7 +53,7 @@ public:
virtual int GetInteger(unsigned Index) const = 0;
virtual float GetFloat(unsigned Index) const = 0;
virtual const char *GetString(unsigned Index) const = 0;
virtual std::optional<ColorHSLA> GetColor(unsigned Index, bool Light) const = 0;
virtual ColorHSLA GetColor(unsigned Index, bool Light) const = 0;
virtual void RemoveArgument(unsigned Index) = 0;

View file

@ -254,7 +254,6 @@ public:
virtual void Ban(int ClientId, int Seconds, const char *pReason, bool VerbatimReason) = 0;
virtual void RedirectClient(int ClientId, int Port, bool Verbose = false) = 0;
virtual void ChangeMap(const char *pMap) = 0;
virtual void ReloadMap() = 0;
virtual void DemoRecorder_HandleAutoStart() = 0;

View file

@ -2341,7 +2341,7 @@ void CServer::UpdateRegisterServerInfo()
JsonWriter.WriteAttribute("map");
JsonWriter.BeginObject();
JsonWriter.WriteAttribute("name");
JsonWriter.WriteStrValue(GetMapName());
JsonWriter.WriteStrValue(m_aCurrentMap);
JsonWriter.WriteAttribute("sha256");
JsonWriter.WriteStrValue(aMapSha256);
JsonWriter.WriteAttribute("size");
@ -2551,11 +2551,6 @@ void CServer::ChangeMap(const char *pMap)
m_MapReload = str_comp(Config()->m_SvMap, m_aCurrentMap) != 0;
}
void CServer::ReloadMap()
{
m_MapReload = true;
}
int CServer::LoadMap(const char *pMapName)
{
m_MapReload = false;

View file

@ -379,7 +379,6 @@ public:
void ChangeMap(const char *pMap) override;
const char *GetMapName() const override;
void ReloadMap() override;
int LoadMap(const char *pMapName);
void SaveDemo(int ClientId, float Time) override;

View file

@ -309,9 +309,6 @@ public:
static constexpr const char *COMMUNITY_DDNET = "ddnet";
static constexpr const char *COMMUNITY_NONE = "none";
static constexpr const char *COMMUNITY_COUNTRY_NONE = "none";
static constexpr const char *COMMUNITY_TYPE_NONE = "None";
/**
* Special community value for country/type filters that
* affect all communities.

View file

@ -111,29 +111,22 @@ void SIntConfigVariable::ResetToOld()
void SColorConfigVariable::CommandCallback(IConsole::IResult *pResult, void *pUserData)
{
SColorConfigVariable *pData = static_cast<SColorConfigVariable *>(pUserData);
char aBuf[IConsole::CMDLINE_LENGTH + 64];
if(pResult->NumArguments())
{
if(pData->CheckReadOnly())
return;
const auto Color = pResult->GetColor(0, pData->m_Light);
if(Color)
{
const unsigned Value = Color->Pack(pData->m_Light ? 0.5f : 0.0f, pData->m_Alpha);
const ColorHSLA Color = pResult->GetColor(0, pData->m_Light);
const unsigned Value = Color.Pack(pData->m_Light ? 0.5f : 0.0f, pData->m_Alpha);
*pData->m_pVariable = Value;
if(pResult->m_ClientId != IConsole::CLIENT_ID_GAME)
pData->m_OldValue = Value;
}
else
{
str_format(aBuf, sizeof(aBuf), "%s is not a valid color.", pResult->GetString(0));
pData->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "config", aBuf);
}
*pData->m_pVariable = Value;
if(pResult->m_ClientId != IConsole::CLIENT_ID_GAME)
pData->m_OldValue = Value;
}
else
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "Value: %u", *pData->m_pVariable);
pData->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "config", aBuf);
@ -500,8 +493,8 @@ void CConfigManager::Con_Toggle(IConsole::IResult *pResult, void *pUserData)
{
SColorConfigVariable *pColorVariable = static_cast<SColorConfigVariable *>(pVariable);
const float Darkest = pColorVariable->m_Light ? 0.5f : 0.0f;
const std::optional<ColorHSLA> Value = *pColorVariable->m_pVariable == pResult->GetColor(1, pColorVariable->m_Light).value_or(ColorHSLA(0, 0, 0)).Pack(Darkest, pColorVariable->m_Alpha) ? pResult->GetColor(2, pColorVariable->m_Light) : pResult->GetColor(1, pColorVariable->m_Light);
pColorVariable->SetValue(Value.value_or(ColorHSLA(0, 0, 0)).Pack(Darkest, pColorVariable->m_Alpha));
const ColorHSLA Value = *pColorVariable->m_pVariable == pResult->GetColor(1, pColorVariable->m_Light).Pack(Darkest, pColorVariable->m_Alpha) ? pResult->GetColor(2, pColorVariable->m_Light) : pResult->GetColor(1, pColorVariable->m_Light);
pColorVariable->SetValue(Value.Pack(Darkest, pColorVariable->m_Alpha));
}
else if(pVariable->m_Type == SConfigVariable::VAR_STRING)
{

View file

@ -105,7 +105,6 @@ MACRO_CONFIG_INT(EdZoomTarget, ed_zoom_target, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG
MACRO_CONFIG_INT(EdShowkeys, ed_showkeys, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show pressed keys")
MACRO_CONFIG_INT(EdAlignQuads, ed_align_quads, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Enable/disable quad alignment. When enabled, red lines appear to show how quad/points are aligned and snapped to other quads/points when moving them")
MACRO_CONFIG_INT(EdShowQuadsRect, ed_show_quads_rect, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show the bounds of the selected quad. In case of multiple quads, it shows the bounds of the englobing rect. Can be helpful when aligning a group of quads")
MACRO_CONFIG_INT(EdAutoMapReload, ed_auto_map_reload, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Run 'hot_reload' on the local server while rcon authed on map save")
MACRO_CONFIG_INT(ClShowWelcome, cl_show_welcome, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show welcome message indicating the first launch of the client")
MACRO_CONFIG_INT(ClMotdTime, cl_motd_time, 10, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How long to show the server message of the day")
@ -344,9 +343,6 @@ MACRO_CONFIG_INT(BrDemoSort, br_demo_sort, 0, 0, 2, CFGFLAG_SAVE | CFGFLAG_CLIEN
MACRO_CONFIG_INT(BrDemoSortOrder, br_demo_sort_order, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Sorting order in demo browser")
MACRO_CONFIG_INT(BrDemoFetchInfo, br_demo_fetch_info, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Whether to auto fetch demo infos on refresh")
MACRO_CONFIG_INT(GhSort, gh_sort, 1, 0, 2, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Sorting column in ghost list")
MACRO_CONFIG_INT(GhSortOrder, gh_sort_order, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Sorting order in ghost list")
MACRO_CONFIG_INT(SndBufferSize, snd_buffer_size, 512, 128, 32768, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Sound buffer size (may cause delay if large)")
MACRO_CONFIG_INT(SndRate, snd_rate, 48000, 5512, 384000, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Sound mixing rate")
MACRO_CONFIG_INT(SndEnable, snd_enable, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Sound enable")

View file

@ -40,29 +40,22 @@ float CConsole::CResult::GetFloat(unsigned Index) const
return str_tofloat(m_apArgs[Index]);
}
std::optional<ColorHSLA> CConsole::CResult::GetColor(unsigned Index, bool Light) const
ColorHSLA CConsole::CResult::GetColor(unsigned Index, bool Light) const
{
if(Index >= m_NumArgs)
return std::nullopt;
return ColorHSLA(0, 0, 0);
const char *pStr = m_apArgs[Index];
if(str_isallnum(pStr) || ((pStr[0] == '-' || pStr[0] == '+') && str_isallnum(pStr + 1))) // Teeworlds Color (Packed HSL)
{
unsigned long Value = str_toulong_base(pStr, 10);
if(Value == std::numeric_limits<unsigned long>::max())
return std::nullopt;
const ColorHSLA Hsla = ColorHSLA(Value, true);
const ColorHSLA Hsla = ColorHSLA(str_toulong_base(pStr, 10), true);
if(Light)
return Hsla.UnclampLighting();
return Hsla;
}
else if(*pStr == '$') // Hex RGB/RGBA
{
auto ParsedColor = color_parse<ColorRGBA>(pStr + 1);
if(ParsedColor)
return color_cast<ColorHSLA>(ParsedColor.value());
else
return std::nullopt;
return color_cast<ColorHSLA>(color_parse<ColorRGBA>(pStr + 1).value_or(ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)));
}
else if(!str_comp_nocase(pStr, "red"))
return ColorHSLA(0.0f / 6.0f, 1, .5f);
@ -83,7 +76,7 @@ std::optional<ColorHSLA> CConsole::CResult::GetColor(unsigned Index, bool Light)
else if(!str_comp_nocase(pStr, "black"))
return ColorHSLA(0, 0, 0);
return std::nullopt;
return ColorHSLA(0, 0, 0);
}
const IConsole::CCommandInfo *CConsole::CCommand::NextCommandInfo(int AccessLevel, int FlagMask) const
@ -136,12 +129,12 @@ int CConsole::ParseStart(CResult *pResult, const char *pString, int Length)
return 0;
}
int CConsole::ParseArgs(CResult *pResult, const char *pFormat, bool IsColor)
int CConsole::ParseArgs(CResult *pResult, const char *pFormat)
{
char Command = *pFormat;
char *pStr;
int Optional = 0;
int Error = PARSEARGS_OK;
int Error = 0;
pResult->ResetVictim();
@ -162,7 +155,7 @@ int CConsole::ParseArgs(CResult *pResult, const char *pFormat, bool IsColor)
{
if(!Optional)
{
Error = PARSEARGS_MISSING_VALUE;
Error = 1;
break;
}
@ -198,7 +191,7 @@ int CConsole::ParseArgs(CResult *pResult, const char *pFormat, bool IsColor)
pStr++; // skip due to escape
}
else if(pStr[0] == 0)
return PARSEARGS_MISSING_VALUE; // return error
return 1; // return error
*pDst = *pStr;
pDst++;
@ -222,7 +215,13 @@ int CConsole::ParseArgs(CResult *pResult, const char *pFormat, bool IsColor)
if(Command == 'r') // rest of the string
break;
else if(Command == 'v' || Command == 'i' || Command == 'f' || Command == 's')
else if(Command == 'v') // validate victim
pStr = str_skip_to_whitespace(pStr);
else if(Command == 'i') // validate int
pStr = str_skip_to_whitespace(pStr);
else if(Command == 'f') // validate float
pStr = str_skip_to_whitespace(pStr);
else if(Command == 's') // validate string
pStr = str_skip_to_whitespace(pStr);
if(pStr[0] != 0) // check for end of string
@ -231,32 +230,6 @@ int CConsole::ParseArgs(CResult *pResult, const char *pFormat, bool IsColor)
pStr++;
}
// validate args
if(Command == 'i')
{
// don't validate colors here
if(!IsColor)
{
int Value;
if(!str_toint(pResult->GetString(pResult->NumArguments() - 1), &Value) ||
Value == std::numeric_limits<int>::max() || Value == std::numeric_limits<int>::min())
{
Error = PARSEARGS_INVALID_INTEGER;
break;
}
}
}
else if(Command == 'f')
{
float Value;
if(!str_tofloat(pResult->GetString(pResult->NumArguments() - 1), &Value) ||
Value == std::numeric_limits<float>::max() || Value == std::numeric_limits<float>::min())
{
Error = PARSEARGS_INVALID_FLOAT;
break;
}
}
if(pVictim)
{
pResult->SetVictim(pVictim);
@ -514,15 +487,10 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientId, bo
if(Stroke || IsStrokeCommand)
{
if(int Error = ParseArgs(&Result, pCommand->m_pParams, pCommand->m_pfnCallback == &SColorConfigVariable::CommandCallback))
if(ParseArgs(&Result, pCommand->m_pParams))
{
char aBuf[CMDLINE_LENGTH + 64];
if(Error == PARSEARGS_INVALID_INTEGER)
str_format(aBuf, sizeof(aBuf), "%s is not a valid integer.", Result.GetString(Result.NumArguments() - 1));
else if(Error == PARSEARGS_INVALID_FLOAT)
str_format(aBuf, sizeof(aBuf), "%s is not a valid decimal number.", Result.GetString(Result.NumArguments() - 1));
else
str_format(aBuf, sizeof(aBuf), "Invalid arguments. Usage: %s %s", pCommand->m_pName, pCommand->m_pParams);
char aBuf[TEMPCMD_NAME_LENGTH + TEMPCMD_PARAMS_LENGTH + 32];
str_format(aBuf, sizeof(aBuf), "Invalid arguments. Usage: %s %s", pCommand->m_pName, pCommand->m_pParams);
Print(OUTPUT_LEVEL_STANDARD, "chatresp", aBuf);
}
else if(m_StoreCommands && pCommand->m_Flags & CFGFLAG_STORE)

View file

@ -115,7 +115,7 @@ class CConsole : public IConsole
const char *GetString(unsigned Index) const override;
int GetInteger(unsigned Index) const override;
float GetFloat(unsigned Index) const override;
std::optional<ColorHSLA> GetColor(unsigned Index, bool Light) const override;
ColorHSLA GetColor(unsigned Index, bool Light) const override;
void RemoveArgument(unsigned Index) override
{
@ -144,16 +144,7 @@ class CConsole : public IConsole
};
int ParseStart(CResult *pResult, const char *pString, int Length);
enum
{
PARSEARGS_OK = 0,
PARSEARGS_MISSING_VALUE,
PARSEARGS_INVALID_INTEGER,
PARSEARGS_INVALID_FLOAT,
};
int ParseArgs(CResult *pResult, const char *pFormat, bool IsColor = false);
int ParseArgs(CResult *pResult, const char *pFormat);
/*
this function will set pFormat to the next parameter (i,s,r,v,?) it contains and

View file

@ -490,7 +490,8 @@ void CNetBan::ConBans(IConsole::IResult *pResult, void *pUser)
if(NumBans == 0)
{
pThis->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "net_ban", "The ban list is empty.");
str_format(aMsg, sizeof(aMsg), "The ban list is empty.");
pThis->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "net_ban", aMsg);
return;
}

View file

@ -4,16 +4,6 @@
#include "protocolglue.h"
int GameFlags_ClampToSix(int Flags)
{
int Six = 0;
if(Flags & GAMEFLAG_TEAMS)
Six |= GAMEFLAG_TEAMS;
if(Flags & GAMEFLAG_FLAGS)
Six |= GAMEFLAG_FLAGS;
return Six;
}
int PlayerFlags_SevenToSix(int Flags)
{
int Six = 0;

View file

@ -1,7 +1,6 @@
#ifndef ENGINE_SHARED_PROTOCOLGLUE_H
#define ENGINE_SHARED_PROTOCOLGLUE_H
int GameFlags_ClampToSix(int Flags);
int PlayerFlags_SevenToSix(int Flags);
int PlayerFlags_SixToSeven(int Flags);
void PickupType_SevenToSix(int Type7, int &Type6, int &SubType6);

View file

@ -96,7 +96,6 @@ public:
CreateFolder("mapres", TYPE_SAVE);
CreateFolder("downloadedmaps", TYPE_SAVE);
CreateFolder("skins", TYPE_SAVE);
CreateFolder("skins7", TYPE_SAVE);
CreateFolder("downloadedskins", TYPE_SAVE);
CreateFolder("themes", TYPE_SAVE);
CreateFolder("communityicons", TYPE_SAVE);

View file

@ -93,7 +93,6 @@ MAYBE_UNUSED static const char *FONT_ICON_EARTH_AMERICAS = "\xEF\x95\xBD";
MAYBE_UNUSED static const char *FONT_ICON_NETWORK_WIRED = "\xEF\x9B\xBF";
MAYBE_UNUSED static const char *FONT_ICON_LIST_UL = "\xEF\x83\x8A";
MAYBE_UNUSED static const char *FONT_ICON_INFO = "\xEF\x84\xA9";
MAYBE_UNUSED static const char *FONT_ICON_TERMINAL = "\xEF\x84\xA0";
MAYBE_UNUSED static const char *FONT_ICON_SLASH = "\xEF\x9C\x95";
MAYBE_UNUSED static const char *FONT_ICON_PLAY = "\xEF\x81\x8B";

View file

@ -1693,7 +1693,8 @@ void CHud::RenderRecord()
if(m_ServerRecord > 0.0f)
{
char aBuf[64];
TextRender()->Text(5, 75, 6, Localize("Server best:"), -1.0f);
str_format(aBuf, sizeof(aBuf), Localize("Server best:"));
TextRender()->Text(5, 75, 6, aBuf, -1.0f);
char aTime[32];
str_time_float(m_ServerRecord, TIME_HOURS_CENTISECS, aTime, sizeof(aTime));
str_format(aBuf, sizeof(aBuf), "%s%s", m_ServerRecord > 3600 ? "" : " ", aTime);
@ -1704,7 +1705,8 @@ void CHud::RenderRecord()
if(PlayerRecord > 0.0f)
{
char aBuf[64];
TextRender()->Text(5, 82, 6, Localize("Personal best:"), -1.0f);
str_format(aBuf, sizeof(aBuf), Localize("Personal best:"));
TextRender()->Text(5, 82, 6, aBuf, -1.0f);
char aTime[32];
str_time_float(PlayerRecord, TIME_HOURS_CENTISECS, aTime, sizeof(aTime));
str_format(aBuf, sizeof(aBuf), "%s%s", PlayerRecord > 3600 ? "" : " ", aTime);

View file

@ -1208,7 +1208,7 @@ void CMenus::RenderPopupFullscreen(CUIRect Screen)
pButtonText = Localize("Ok");
if(Client()->ReconnectTime() > 0)
{
str_format(aBuf, sizeof(aBuf), Localize("Reconnect in %d sec"), (int)((Client()->ReconnectTime() - time_get()) / time_freq()) + 1);
str_format(aBuf, sizeof(aBuf), Localize("Reconnect in %d sec"), (int)((Client()->ReconnectTime() - time_get()) / time_freq()));
pTitle = Client()->ErrorString();
pExtraText = aBuf;
pButtonText = Localize("Abort");
@ -1282,11 +1282,6 @@ void CMenus::RenderPopupFullscreen(CUIRect Screen)
pButtonText = m_aMessageButton;
TopAlign = true;
}
else if(m_Popup == POPUP_SAVE_SKIN)
{
pTitle = Localize("Save skin");
pExtraText = Localize("Are you sure you want to save your skin? If a skin with this name already exists, it will be replaced.");
}
CUIRect Box, Part;
Box = Screen;
@ -1761,52 +1756,6 @@ void CMenus::RenderPopupFullscreen(CUIRect Screen)
SetActive(false);
}
}
else if(m_Popup == POPUP_SAVE_SKIN)
{
CUIRect Label, TextBox, Yes, No;
Box.HSplitBottom(20.f, &Box, &Part);
Box.HSplitBottom(24.f, &Box, &Part);
Part.VMargin(80.0f, &Part);
Part.VSplitMid(&No, &Yes);
Yes.VMargin(20.0f, &Yes);
No.VMargin(20.0f, &No);
static CButtonContainer s_ButtonNo;
if(DoButton_Menu(&s_ButtonNo, Localize("No"), 0, &No) || Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE))
m_Popup = POPUP_NONE;
static CButtonContainer s_ButtonYes;
if(DoButton_Menu(&s_ButtonYes, Localize("Yes"), m_SkinNameInput.IsEmpty() ? 1 : 0, &Yes) || Ui()->ConsumeHotkey(CUi::HOTKEY_ENTER))
{
if(m_SkinNameInput.GetLength())
{
if(m_SkinNameInput.GetString()[0] != 'x' && m_SkinNameInput.GetString()[1] != '_')
{
if(m_pClient->m_Skins7.SaveSkinfile(m_SkinNameInput.GetString(), m_Dummy))
{
m_Popup = POPUP_NONE;
m_SkinListNeedsUpdate = true;
}
else
PopupMessage(Localize("Error"), Localize("Unable to save the skin"), Localize("Ok"), POPUP_SAVE_SKIN);
}
else
PopupMessage(Localize("Error"), Localize("Unable to save the skin with a reserved name"), Localize("Ok"), POPUP_SAVE_SKIN);
}
}
Box.HSplitBottom(60.f, &Box, &Part);
Box.HSplitBottom(24.f, &Box, &Part);
Part.VMargin(60.0f, &Label);
Label.VSplitLeft(100.0f, &Label, &TextBox);
TextBox.VSplitLeft(20.0f, nullptr, &TextBox);
Ui()->DoLabel(&Label, Localize("Name"), 18.0f, TEXTALIGN_ML);
Ui()->DoClearableEditBox(&m_SkinNameInput, &TextBox, 12.0f);
}
else
{
Box.HSplitBottom(20.f, &Box, &Part);

View file

@ -768,14 +768,6 @@ public:
bool HasFile() const { return m_aFilename[0]; }
};
enum
{
GHOST_SORT_NONE = -1,
GHOST_SORT_NAME,
GHOST_SORT_TIME,
GHOST_SORT_DATE,
};
std::vector<CGhostItem> m_vGhosts;
std::chrono::nanoseconds m_GhostPopulateStartTime{0};
@ -784,7 +776,6 @@ public:
CGhostItem *GetOwnGhost();
void UpdateOwnGhost(CGhostItem Item);
void DeleteGhostItem(int Index);
void SortGhostlist();
bool CanDisplayWarning() const;
@ -811,7 +802,6 @@ public:
POPUP_QUIT,
POPUP_RESTART,
POPUP_WARNING,
POPUP_SAVE_SKIN,
// demo player states
DEMOPLAYER_NONE = 0,

View file

@ -869,14 +869,11 @@ void CMenus::RenderServerbrowserDDNetFilter(CUIRect View,
{
if(Click == 1)
{
// Left click: when all are active, only activate one and none
// Left click: when all are active, only activate one
for(int j = 0; j < MaxItems; ++j)
{
if(const char *pItemName = GetItemName(j);
j != ItemIndex &&
!((&Filter == &ServerBrowser()->CountriesFilter() && str_comp(pItemName, IServerBrowser::COMMUNITY_COUNTRY_NONE) == 0) ||
(&Filter == &ServerBrowser()->TypesFilter() && str_comp(pItemName, IServerBrowser::COMMUNITY_TYPE_NONE) == 0)))
Filter.Add(pItemName);
if(j != ItemIndex)
Filter.Add(GetItemName(j));
}
}
else if(Click == 2)
@ -893,10 +890,7 @@ void CMenus::RenderServerbrowserDDNetFilter(CUIRect View,
bool AllFilteredExceptUs = true;
for(int j = 0; j < MaxItems; ++j)
{
if(const char *pItemName = GetItemName(j);
j != ItemIndex && !Filter.Filtered(pItemName) &&
!((&Filter == &ServerBrowser()->CountriesFilter() && str_comp(pItemName, IServerBrowser::COMMUNITY_COUNTRY_NONE) == 0) ||
(&Filter == &ServerBrowser()->TypesFilter() && str_comp(pItemName, IServerBrowser::COMMUNITY_TYPE_NONE) == 0)))
if(j != ItemIndex && !Filter.Filtered(GetItemName(j)))
{
AllFilteredExceptUs = false;
break;
@ -904,7 +898,7 @@ void CMenus::RenderServerbrowserDDNetFilter(CUIRect View,
}
// When last one is removed, re-enable all currently selectable items.
// Don't use Clear, to avoid enabling also currently unselectable items.
if(AllFilteredExceptUs && Active)
if(AllFilteredExceptUs)
{
for(int j = 0; j < MaxItems; ++j)
{

View file

@ -175,12 +175,12 @@ void CMenus::RenderDemoPlayer(CUIRect MainView)
// increase/decrease speed
if(!Input()->ModifierIsPressed() && !Input()->ShiftIsPressed() && !Input()->AltIsPressed())
{
if(Input()->KeyPress(KEY_UP) || (m_MenuActive && Input()->KeyPress(KEY_MOUSE_WHEEL_UP)))
if(Input()->KeyPress(KEY_MOUSE_WHEEL_UP) || Input()->KeyPress(KEY_UP))
{
DemoPlayer()->AdjustSpeedIndex(+1);
UpdateLastSpeedChange();
}
else if(Input()->KeyPress(KEY_DOWN) || (m_MenuActive && Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN)))
else if(Input()->KeyPress(KEY_MOUSE_WHEEL_DOWN) || Input()->KeyPress(KEY_DOWN))
{
DemoPlayer()->AdjustSpeedIndex(-1);
UpdateLastSpeedChange();

View file

@ -76,7 +76,7 @@ void CMenus::RenderGame(CUIRect MainView)
if(!Client()->DummyAllowed())
{
DoButton_Menu(&s_DummyButton, Localize("Connect Dummy"), 1, &Button);
GameClient()->m_Tooltips.DoToolTip(&s_DummyButton, &Button, Localize("Dummy is not allowed on this server"));
GameClient()->m_Tooltips.DoToolTip(&s_DummyButton, &Button, Localize("Dummy is not allowed on this server."));
}
else if(Client()->DummyConnectingDelayed())
{
@ -944,7 +944,7 @@ void CMenus::GhostlistPopulate()
m_vGhosts.clear();
m_GhostPopulateStartTime = time_get_nanoseconds();
Storage()->ListDirectoryInfo(IStorage::TYPE_ALL, m_pClient->m_Ghost.GetGhostDir(), GhostlistFetchCallback, this);
SortGhostlist();
std::sort(m_vGhosts.begin(), m_vGhosts.end());
CGhostItem *pOwnGhost = 0;
for(auto &Ghost : m_vGhosts)
@ -1000,7 +1000,6 @@ void CMenus::UpdateOwnGhost(CGhostItem Item)
Item.m_Date = std::time(0);
Item.m_Failed = false;
m_vGhosts.insert(std::lower_bound(m_vGhosts.begin(), m_vGhosts.end(), Item), Item);
SortGhostlist();
}
void CMenus::DeleteGhostItem(int Index)
@ -1010,22 +1009,6 @@ void CMenus::DeleteGhostItem(int Index)
m_vGhosts.erase(m_vGhosts.begin() + Index);
}
void CMenus::SortGhostlist()
{
if(g_Config.m_GhSort == GHOST_SORT_NAME)
std::stable_sort(m_vGhosts.begin(), m_vGhosts.end(), [](const CGhostItem &Left, const CGhostItem &Right) {
return g_Config.m_GhSortOrder ? (str_comp(Left.m_aPlayer, Right.m_aPlayer) > 0) : (str_comp(Left.m_aPlayer, Right.m_aPlayer) < 0);
});
else if(g_Config.m_GhSort == GHOST_SORT_TIME)
std::stable_sort(m_vGhosts.begin(), m_vGhosts.end(), [](const CGhostItem &Left, const CGhostItem &Right) {
return g_Config.m_GhSortOrder ? (Left.m_Time > Right.m_Time) : (Left.m_Time < Right.m_Time);
});
else if(g_Config.m_GhSort == GHOST_SORT_DATE)
std::stable_sort(m_vGhosts.begin(), m_vGhosts.end(), [](const CGhostItem &Left, const CGhostItem &Right) {
return g_Config.m_GhSortOrder ? (Left.m_Date > Right.m_Date) : (Left.m_Date < Right.m_Date);
});
}
void CMenus::RenderGhost(CUIRect MainView)
{
// render background
@ -1046,12 +1029,10 @@ void CMenus::RenderGhost(CUIRect MainView)
Headers.Draw(ColorRGBA(1, 1, 1, 0.25f), IGraphics::CORNER_T, 5.0f);
Headers.VSplitRight(20.0f, &Headers, 0);
class CColumn
struct CColumn
{
public:
const char *m_pCaption;
int m_Id;
int m_Sort;
float m_Width;
CUIRect m_Rect;
};
@ -1065,11 +1046,11 @@ void CMenus::RenderGhost(CUIRect MainView)
};
static CColumn s_aCols[] = {
{"", -1, GHOST_SORT_NONE, 2.0f, {0}},
{"", COL_ACTIVE, GHOST_SORT_NONE, 30.0f, {0}},
{Localizable("Name"), COL_NAME, GHOST_SORT_NAME, 200.0f, {0}},
{Localizable("Time"), COL_TIME, GHOST_SORT_TIME, 90.0f, {0}},
{Localizable("Date"), COL_DATE, GHOST_SORT_DATE, 150.0f, {0}},
{"", -1, 2.0f, {0}},
{"", COL_ACTIVE, 30.0f, {0}},
{Localizable("Name"), COL_NAME, 200.0f, {0}},
{Localizable("Time"), COL_TIME, 90.0f, {0}},
{Localizable("Date"), COL_DATE, 150.0f, {0}},
};
int NumCols = std::size(s_aCols);
@ -1084,22 +1065,8 @@ void CMenus::RenderGhost(CUIRect MainView)
}
// do headers
for(const auto &Col : s_aCols)
{
if(DoButton_GridHeader(&Col.m_Id, Localize(Col.m_pCaption), g_Config.m_GhSort == Col.m_Sort, &Col.m_Rect))
{
if(Col.m_Sort != GHOST_SORT_NONE)
{
if(g_Config.m_GhSort == Col.m_Sort)
g_Config.m_GhSortOrder ^= 1;
else
g_Config.m_GhSortOrder = 0;
g_Config.m_GhSort = Col.m_Sort;
SortGhostlist();
}
}
}
for(int i = 0; i < NumCols; i++)
DoButton_GridHeader(&s_aCols[i].m_Id, Localize(s_aCols[i].m_pCaption), 0, &s_aCols[i].m_Rect);
View.Draw(ColorRGBA(0, 0, 0, 0.15f), 0, 0);

View file

@ -3310,15 +3310,15 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
}
}
else if(State >= IUpdater::GETTING_MANIFEST && State < IUpdater::NEED_RESTART)
str_copy(aBuf, Localize("Updating…"));
str_format(aBuf, sizeof(aBuf), Localize("Updating…"));
else if(State == IUpdater::NEED_RESTART)
{
str_copy(aBuf, Localize("DDNet Client updated!"));
str_format(aBuf, sizeof(aBuf), Localize("DDNet Client updated!"));
m_NeedRestartUpdate = true;
}
else
{
str_copy(aBuf, Localize("No updates available"));
str_format(aBuf, sizeof(aBuf), Localize("No updates available"));
UpdaterRect.VSplitLeft(TextRender()->TextWidth(14.0f, aBuf, -1, -1.0f) + 10.0f, &UpdaterRect, &Button);
Button.VSplitLeft(100.0f, &Button, nullptr);
static CButtonContainer s_ButtonUpdate;

View file

@ -52,12 +52,10 @@ void CMenus::RenderSettingsTee7(CUIRect MainView)
MainView.HSplitBottom(40.0f, &MainView, &BottomView);
BottomView.HSplitTop(20.f, 0, &BottomView);
CUIRect QuickSearch, DirectoryButton, Buttons;
CUIRect QuickSearch, Buttons;
CUIRect ButtonLeft, ButtonMiddle, ButtonRight;
BottomView.VSplitMid(&QuickSearch, &Buttons, 10.0f);
QuickSearch.VSplitLeft(240.0f, &QuickSearch, &DirectoryButton);
QuickSearch.VSplitRight(10.0f, &QuickSearch, nullptr);
BottomView.VSplitMid(&QuickSearch, &Buttons);
const float ButtonSize = Buttons.w / 3;
Buttons.VSplitLeft(ButtonSize, &ButtonLeft, &Buttons);
@ -239,14 +237,6 @@ void CMenus::RenderSettingsTee7(CUIRect MainView)
// bottom buttons
if(s_CustomSkinMenu)
{
static CButtonContainer s_CustomSkinSaveButton;
if(DoButton_Menu(&s_CustomSkinSaveButton, Localize("Save"), 0, &ButtonLeft))
{
m_Popup = POPUP_SAVE_SKIN;
m_SkinNameInput.SelectAll();
Ui()->SetActiveItem(&m_SkinNameInput);
}
static CButtonContainer s_RandomizeSkinButton;
if(DoButton_Menu(&s_RandomizeSkinButton, Localize("Randomize"), 0, &ButtonMiddle))
{
@ -261,7 +251,7 @@ void CMenus::RenderSettingsTee7(CUIRect MainView)
if(DoButton_Menu(&s_CustomSkinDeleteButton, Localize("Delete"), 0, &ButtonMiddle) || Ui()->ConsumeHotkey(CUi::HOTKEY_DELETE))
{
char aBuf[128];
str_format(aBuf, sizeof(aBuf), Localize("Are you sure that you want to delete '%s'?"), m_pSelectedSkin->m_aName);
str_format(aBuf, sizeof(aBuf), Localize("Are you sure that you want to delete the skin '%s'?"), m_pSelectedSkin->m_aName);
PopupConfirm(Localize("Delete skin"), aBuf, Localize("Yes"), Localize("No"), &CMenus::PopupConfirmDeleteSkin7);
}
}
@ -301,16 +291,6 @@ void CMenus::RenderSettingsTee7(CUIRect MainView)
if(Ui()->DoClearableEditBox(&s_SkinFilterInput, &QuickSearch, 14.0f))
m_SkinListNeedsUpdate = true;
}
static CButtonContainer s_DirectoryButton;
if(DoButton_Menu(&s_DirectoryButton, Localize("Skins directory"), 0, &DirectoryButton))
{
char aBuf[128 + IO_MAX_PATH_LENGTH];
Storage()->GetCompletePath(IStorage::TYPE_SAVE, "skins7", aBuf, sizeof(aBuf));
Storage()->CreateFolder("skins7", IStorage::TYPE_SAVE);
Client()->ViewFile(aBuf);
}
GameClient()->m_Tooltips.DoToolTip(&s_DirectoryButton, &DirectoryButton, Localize("Open the directory to add custom skins"));
}
void CMenus::PopupConfirmDeleteSkin7()
@ -319,7 +299,7 @@ void CMenus::PopupConfirmDeleteSkin7()
if(!m_pClient->m_Skins7.RemoveSkin(m_pSelectedSkin))
{
PopupMessage(Localize("Error"), Localize("Unable to delete skin"), Localize("Ok"));
PopupMessage(Localize("Error"), Localize("Unable to delete the skin"), Localize("Ok"));
return;
}
m_pSelectedSkin = nullptr;

View file

@ -17,8 +17,6 @@
#include "menus.h"
using namespace FontIcons;
void CMenus::RenderStartMenu(CUIRect MainView)
{
GameClient()->m_MenuBackground.ChangePosition(CMenuBackground::POS_START);
@ -41,6 +39,14 @@ void CMenus::RenderStartMenu(CUIRect MainView)
MainView.VSplitLeft(30.0f, 0, &ExtMenu);
ExtMenu.VSplitLeft(100.0f, &ExtMenu, 0);
ExtMenu.HSplitBottom(20.0f, &ExtMenu, &Button);
ExtMenu.HSplitBottom(5.0f, &ExtMenu, nullptr);
static CButtonContainer s_ConsoleButton;
if(DoButton_Menu(&s_ConsoleButton, Localize("Console"), 0, &Button, nullptr, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
{
GameClient()->m_GameConsole.Toggle(CGameConsole::CONSOLETYPE_LOCAL);
}
ExtMenu.HSplitBottom(20.0f, &ExtMenu, &Button);
static CButtonContainer s_DiscordButton;
if(DoButton_Menu(&s_DiscordButton, Localize("Discord"), 0, &Button, 0, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.25f)))
@ -188,27 +194,13 @@ void CMenus::RenderStartMenu(CUIRect MainView)
}
// render version
CUIRect CurVersion, ConsoleButton;
MainView.HSplitBottom(45.0f, nullptr, &CurVersion);
CurVersion.VSplitRight(40.0f, &CurVersion, nullptr);
CurVersion.HSplitTop(20.0f, &ConsoleButton, &CurVersion);
CurVersion.HSplitTop(5.0f, nullptr, &CurVersion);
ConsoleButton.VSplitRight(40.0f, nullptr, &ConsoleButton);
CUIRect VersionUpdate, CurVersion;
MainView.HSplitBottom(20.0f, nullptr, &VersionUpdate);
VersionUpdate.VSplitRight(50.0f, &CurVersion, nullptr);
VersionUpdate.VMargin(VMargin, &VersionUpdate);
Ui()->DoLabel(&CurVersion, GAME_RELEASE_VERSION, 14.0f, TEXTALIGN_MR);
static CButtonContainer s_ConsoleButton;
TextRender()->SetFontPreset(EFontPreset::ICON_FONT);
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
if(DoButton_Menu(&s_ConsoleButton, FONT_ICON_TERMINAL, 0, &ConsoleButton, nullptr, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.1f)))
{
GameClient()->m_GameConsole.Toggle(CGameConsole::CONSOLETYPE_LOCAL);
}
TextRender()->SetRenderFlags(0);
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);
CUIRect VersionUpdate;
MainView.HSplitBottom(20.0f, nullptr, &VersionUpdate);
VersionUpdate.VMargin(VMargin, &VersionUpdate);
#if defined(CONF_AUTOUPDATE)
CUIRect UpdateButton;
VersionUpdate.VSplitRight(100.0f, &VersionUpdate, &UpdateButton);
@ -256,12 +248,12 @@ void CMenus::RenderStartMenu(CUIRect MainView)
}
else if(State == IUpdater::FAIL)
{
str_copy(aBuf, Localize("Update failed! Check log…"));
str_format(aBuf, sizeof(aBuf), Localize("Update failed! Check log…"));
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
}
else if(State == IUpdater::NEED_RESTART)
{
str_copy(aBuf, Localize("DDNet Client updated!"));
str_format(aBuf, sizeof(aBuf), Localize("DDNet Client updated!"));
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
}
Ui()->DoLabel(&VersionUpdate, aBuf, 14.0f, TEXTALIGN_ML);

View file

@ -349,247 +349,240 @@ void CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
char aBuf[64];
int MaxTeamSize = m_pClient->Config()->m_SvMaxTeamSize;
for(int RenderDead = 0; RenderDead < 2; RenderDead++)
for(int i = 0; i < MAX_CLIENTS; i++)
{
for(int i = 0; i < MAX_CLIENTS; i++)
// make sure that we render the correct team
const CNetObj_PlayerInfo *pInfo = GameClient()->m_Snap.m_apInfoByDDTeamScore[i];
if(!pInfo || pInfo->m_Team != Team)
continue;
if(CountRendered++ < CountStart)
continue;
int DDTeam = GameClient()->m_Teams.Team(pInfo->m_ClientId);
int NextDDTeam = 0;
bool RenderDead = Client()->m_TranslationContext.m_aClients[pInfo->m_ClientId].m_PlayerFlags7 & protocol7::PLAYERFLAG_DEAD;
ColorRGBA TextColor = TextRender()->DefaultTextColor();
TextColor.a = RenderDead ? 0.5f : 1.0f;
TextRender()->TextColor(TextColor);
for(int j = i + 1; j < MAX_CLIENTS; j++)
{
// make sure that we render the correct team
const CNetObj_PlayerInfo *pInfo = GameClient()->m_Snap.m_apInfoByDDTeamScore[i];
if(!pInfo || pInfo->m_Team != Team)
const CNetObj_PlayerInfo *pInfoNext = GameClient()->m_Snap.m_apInfoByDDTeamScore[j];
if(!pInfoNext || pInfoNext->m_Team != Team)
continue;
if(CountRendered++ < CountStart)
continue;
NextDDTeam = GameClient()->m_Teams.Team(pInfoNext->m_ClientId);
break;
}
int DDTeam = GameClient()->m_Teams.Team(pInfo->m_ClientId);
int NextDDTeam = 0;
bool IsDead = Client()->m_TranslationContext.m_aClients[pInfo->m_ClientId].m_PlayerFlags7 & protocol7::PLAYERFLAG_DEAD;
if(!RenderDead && IsDead)
continue;
if(RenderDead && !IsDead)
continue;
ColorRGBA TextColor = TextRender()->DefaultTextColor();
TextColor.a = RenderDead ? 0.5f : 1.0f;
TextRender()->TextColor(TextColor);
for(int j = i + 1; j < MAX_CLIENTS; j++)
if(PrevDDTeam == -1)
{
for(int j = i - 1; j >= 0; j--)
{
const CNetObj_PlayerInfo *pInfoNext = GameClient()->m_Snap.m_apInfoByDDTeamScore[j];
if(!pInfoNext || pInfoNext->m_Team != Team)
const CNetObj_PlayerInfo *pInfoPrev = GameClient()->m_Snap.m_apInfoByDDTeamScore[j];
if(!pInfoPrev || pInfoPrev->m_Team != Team)
continue;
NextDDTeam = GameClient()->m_Teams.Team(pInfoNext->m_ClientId);
PrevDDTeam = GameClient()->m_Teams.Team(pInfoPrev->m_ClientId);
break;
}
if(PrevDDTeam == -1)
{
for(int j = i - 1; j >= 0; j--)
{
const CNetObj_PlayerInfo *pInfoPrev = GameClient()->m_Snap.m_apInfoByDDTeamScore[j];
if(!pInfoPrev || pInfoPrev->m_Team != Team)
continue;
PrevDDTeam = GameClient()->m_Teams.Team(pInfoPrev->m_ClientId);
break;
}
}
CUIRect RowAndSpacing, Row;
Scoreboard.HSplitTop(LineHeight + Spacing, &RowAndSpacing, &Scoreboard);
RowAndSpacing.HSplitTop(LineHeight, &Row, nullptr);
// team background
if(DDTeam != TEAM_FLOCK)
{
const ColorRGBA Color = GameClient()->GetDDTeamColor(DDTeam).WithAlpha(0.5f);
int TeamRectCorners = 0;
if(PrevDDTeam != DDTeam)
{
TeamRectCorners |= IGraphics::CORNER_T;
State.m_TeamStartX = Row.x;
State.m_TeamStartY = Row.y;
}
if(NextDDTeam != DDTeam)
TeamRectCorners |= IGraphics::CORNER_B;
RowAndSpacing.Draw(Color, TeamRectCorners, RoundRadius);
CurrentDDTeamSize++;
if(NextDDTeam != DDTeam)
{
const float TeamFontSize = FontSize / 1.5f;
if(NumPlayers > 8)
{
if(DDTeam == TEAM_SUPER)
str_copy(aBuf, Localize("Super"));
else if(CurrentDDTeamSize <= 1)
str_format(aBuf, sizeof(aBuf), "%d", DDTeam);
else
str_format(aBuf, sizeof(aBuf), Localize("%d\n(%d/%d)", "Team and size"), DDTeam, CurrentDDTeamSize, MaxTeamSize);
TextRender()->Text(State.m_TeamStartX, maximum(State.m_TeamStartY + Row.h / 2.0f - TeamFontSize, State.m_TeamStartY + 3.0f /* padding top */), TeamFontSize, aBuf);
}
else
{
if(DDTeam == TEAM_SUPER)
str_copy(aBuf, Localize("Super"));
else if(CurrentDDTeamSize > 1)
str_format(aBuf, sizeof(aBuf), Localize("Team %d (%d/%d)"), DDTeam, CurrentDDTeamSize, MaxTeamSize);
else
str_format(aBuf, sizeof(aBuf), Localize("Team %d"), DDTeam);
TextRender()->Text(Row.x + Row.w / 2.0f - TextRender()->TextWidth(TeamFontSize, aBuf) / 2.0f + 10.0f, Row.y + Row.h, TeamFontSize, aBuf);
}
CurrentDDTeamSize = 0;
}
}
PrevDDTeam = DDTeam;
// background so it's easy to find the local player or the followed one in spectator mode
if((!GameClient()->m_Snap.m_SpecInfo.m_Active && pInfo->m_Local) ||
(GameClient()->m_Snap.m_SpecInfo.m_SpectatorId == SPEC_FREEVIEW && pInfo->m_Local) ||
(GameClient()->m_Snap.m_SpecInfo.m_Active && pInfo->m_ClientId == GameClient()->m_Snap.m_SpecInfo.m_SpectatorId))
{
Row.Draw(ColorRGBA(1.0f, 1.0f, 1.0f, 0.25f), IGraphics::CORNER_ALL, RoundRadius);
}
// score
if(Race7)
{
if(pInfo->m_Score == -1)
{
aBuf[0] = '\0';
}
else
{
// 0.7 uses milliseconds and ddnets str_time wants centiseconds
// 0.7 servers can also send the amount of precision the client should use
// we ignore that and always show 3 digit precision
str_time((int64_t)absolute(pInfo->m_Score / 10), TIME_MINS_CENTISECS, aBuf, sizeof(aBuf));
}
}
else if(TimeScore)
{
if(pInfo->m_Score == -9999)
{
aBuf[0] = '\0';
}
else
{
str_time((int64_t)absolute(pInfo->m_Score) * 100, TIME_HOURS, aBuf, sizeof(aBuf));
}
}
else
{
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Score, -999, 99999));
}
TextRender()->Text(ScoreOffset + ScoreLength - TextRender()->TextWidth(FontSize, aBuf), Row.y + (Row.h - FontSize) / 2.0f, FontSize, aBuf);
// CTF flag
if(pGameInfoObj && (pGameInfoObj->m_GameFlags & GAMEFLAG_FLAGS) &&
pGameDataObj && (pGameDataObj->m_FlagCarrierRed == pInfo->m_ClientId || pGameDataObj->m_FlagCarrierBlue == pInfo->m_ClientId))
{
Graphics()->BlendNormal();
Graphics()->TextureSet(pGameDataObj->m_FlagCarrierBlue == pInfo->m_ClientId ? GameClient()->m_GameSkin.m_SpriteFlagBlue : GameClient()->m_GameSkin.m_SpriteFlagRed);
Graphics()->QuadsBegin();
Graphics()->QuadsSetSubset(1.0f, 0.0f, 0.0f, 1.0f);
IGraphics::CQuadItem QuadItem(TeeOffset, Row.y - 5.0f - Spacing / 2.0f, Row.h / 2.0f, Row.h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
}
const CGameClient::CClientData &ClientData = GameClient()->m_aClients[pInfo->m_ClientId];
// skin
if(RenderDead)
{
Graphics()->BlendNormal();
Graphics()->TextureSet(client_data7::g_pData->m_aImages[client_data7::IMAGE_DEADTEE].m_Id);
Graphics()->QuadsBegin();
if(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags & GAMEFLAG_TEAMS)
{
ColorRGBA Color = m_pClient->m_Skins7.GetTeamColor(true, 0, m_pClient->m_aClients[pInfo->m_ClientId].m_Team, protocol7::SKINPART_BODY);
Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a);
}
CTeeRenderInfo TeeInfo = m_pClient->m_aClients[pInfo->m_ClientId].m_RenderInfo;
TeeInfo.m_Size *= TeeSizeMod;
IGraphics::CQuadItem QuadItem(TeeOffset, Row.y, TeeInfo.m_Size, TeeInfo.m_Size);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
}
else
{
CTeeRenderInfo TeeInfo = ClientData.m_RenderInfo;
TeeInfo.m_Size *= TeeSizeMod;
vec2 OffsetToMid;
CRenderTools::GetRenderTeeOffsetToRenderedTee(CAnimState::GetIdle(), &TeeInfo, OffsetToMid);
const vec2 TeeRenderPos = vec2(TeeOffset + TeeLength / 2, Row.y + Row.h / 2.0f + OffsetToMid.y);
RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, EMOTE_NORMAL, vec2(1.0f, 0.0f), TeeRenderPos);
}
// name
{
CTextCursor Cursor;
TextRender()->SetCursor(&Cursor, NameOffset, Row.y + (Row.h - FontSize) / 2.0f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);
Cursor.m_LineWidth = NameLength;
if(ClientData.m_AuthLevel)
{
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClAuthedPlayerColor)));
}
if(g_Config.m_ClShowIds)
{
char aClientId[16];
GameClient()->FormatClientId(pInfo->m_ClientId, aClientId, EClientIdFormat::INDENT_AUTO);
TextRender()->TextEx(&Cursor, aClientId);
}
TextRender()->TextEx(&Cursor, ClientData.m_aName);
// ready / watching
if(Client()->IsSixup() && Client()->m_TranslationContext.m_aClients[pInfo->m_ClientId].m_PlayerFlags7 & protocol7::PLAYERFLAG_READY)
{
TextRender()->TextColor(0.1f, 1.0f, 0.1f, TextColor.a);
TextRender()->TextEx(&Cursor, "");
}
}
// clan
{
if(str_comp(ClientData.m_aClan, GameClient()->m_aClients[GameClient()->m_aLocalIds[g_Config.m_ClDummy]].m_aClan) == 0)
{
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClSameClanColor)));
}
else
{
TextRender()->TextColor(TextColor);
}
CTextCursor Cursor;
TextRender()->SetCursor(&Cursor, ClanOffset + (ClanLength - minimum(TextRender()->TextWidth(FontSize, ClientData.m_aClan), ClanLength)) / 2.0f, Row.y + (Row.h - FontSize) / 2.0f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);
Cursor.m_LineWidth = ClanLength;
TextRender()->TextEx(&Cursor, ClientData.m_aClan);
}
// country flag
GameClient()->m_CountryFlags.Render(ClientData.m_Country, ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f),
CountryOffset, Row.y + (Spacing + TeeSizeMod * 5.0f) / 2.0f, CountryLength, Row.h - Spacing - TeeSizeMod * 5.0f);
// ping
if(g_Config.m_ClEnablePingColor)
{
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA((300.0f - clamp(pInfo->m_Latency, 0, 300)) / 1000.0f, 1.0f, 0.5f)));
}
else
{
TextRender()->TextColor(TextRender()->DefaultTextColor());
}
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, 0, 999));
TextRender()->Text(PingOffset + PingLength - TextRender()->TextWidth(FontSize, aBuf), Row.y + (Row.h - FontSize) / 2.0f, FontSize, aBuf);
TextRender()->TextColor(TextRender()->DefaultTextColor());
if(CountRendered == CountEnd)
break;
}
CUIRect RowAndSpacing, Row;
Scoreboard.HSplitTop(LineHeight + Spacing, &RowAndSpacing, &Scoreboard);
RowAndSpacing.HSplitTop(LineHeight, &Row, nullptr);
// team background
if(DDTeam != TEAM_FLOCK)
{
const ColorRGBA Color = GameClient()->GetDDTeamColor(DDTeam).WithAlpha(0.5f);
int TeamRectCorners = 0;
if(PrevDDTeam != DDTeam)
{
TeamRectCorners |= IGraphics::CORNER_T;
State.m_TeamStartX = Row.x;
State.m_TeamStartY = Row.y;
}
if(NextDDTeam != DDTeam)
TeamRectCorners |= IGraphics::CORNER_B;
RowAndSpacing.Draw(Color, TeamRectCorners, RoundRadius);
CurrentDDTeamSize++;
if(NextDDTeam != DDTeam)
{
const float TeamFontSize = FontSize / 1.5f;
if(NumPlayers > 8)
{
if(DDTeam == TEAM_SUPER)
str_copy(aBuf, Localize("Super"));
else if(CurrentDDTeamSize <= 1)
str_format(aBuf, sizeof(aBuf), "%d", DDTeam);
else
str_format(aBuf, sizeof(aBuf), Localize("%d\n(%d/%d)", "Team and size"), DDTeam, CurrentDDTeamSize, MaxTeamSize);
TextRender()->Text(State.m_TeamStartX, maximum(State.m_TeamStartY + Row.h / 2.0f - TeamFontSize, State.m_TeamStartY + 3.0f /* padding top */), TeamFontSize, aBuf);
}
else
{
if(DDTeam == TEAM_SUPER)
str_copy(aBuf, Localize("Super"));
else if(CurrentDDTeamSize > 1)
str_format(aBuf, sizeof(aBuf), Localize("Team %d (%d/%d)"), DDTeam, CurrentDDTeamSize, MaxTeamSize);
else
str_format(aBuf, sizeof(aBuf), Localize("Team %d"), DDTeam);
TextRender()->Text(Row.x + Row.w / 2.0f - TextRender()->TextWidth(TeamFontSize, aBuf) / 2.0f + 10.0f, Row.y + Row.h, TeamFontSize, aBuf);
}
CurrentDDTeamSize = 0;
}
}
PrevDDTeam = DDTeam;
// background so it's easy to find the local player or the followed one in spectator mode
if((!GameClient()->m_Snap.m_SpecInfo.m_Active && pInfo->m_Local) ||
(GameClient()->m_Snap.m_SpecInfo.m_SpectatorId == SPEC_FREEVIEW && pInfo->m_Local) ||
(GameClient()->m_Snap.m_SpecInfo.m_Active && pInfo->m_ClientId == GameClient()->m_Snap.m_SpecInfo.m_SpectatorId))
{
Row.Draw(ColorRGBA(1.0f, 1.0f, 1.0f, 0.25f), IGraphics::CORNER_ALL, RoundRadius);
}
// score
if(Race7)
{
if(pInfo->m_Score == -1)
{
aBuf[0] = '\0';
}
else
{
// 0.7 uses milliseconds and ddnets str_time wants centiseconds
// 0.7 servers can also send the amount of precision the client should use
// we ignore that and always show 3 digit precision
str_time((int64_t)absolute(pInfo->m_Score / 10), TIME_MINS_CENTISECS, aBuf, sizeof(aBuf));
}
}
else if(TimeScore)
{
if(pInfo->m_Score == -9999)
{
aBuf[0] = '\0';
}
else
{
str_time((int64_t)absolute(pInfo->m_Score) * 100, TIME_HOURS, aBuf, sizeof(aBuf));
}
}
else
{
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Score, -999, 99999));
}
TextRender()->Text(ScoreOffset + ScoreLength - TextRender()->TextWidth(FontSize, aBuf), Row.y + (Row.h - FontSize) / 2.0f, FontSize, aBuf);
// CTF flag
if(pGameInfoObj && (pGameInfoObj->m_GameFlags & GAMEFLAG_FLAGS) &&
pGameDataObj && (pGameDataObj->m_FlagCarrierRed == pInfo->m_ClientId || pGameDataObj->m_FlagCarrierBlue == pInfo->m_ClientId))
{
Graphics()->BlendNormal();
Graphics()->TextureSet(pGameDataObj->m_FlagCarrierBlue == pInfo->m_ClientId ? GameClient()->m_GameSkin.m_SpriteFlagBlue : GameClient()->m_GameSkin.m_SpriteFlagRed);
Graphics()->QuadsBegin();
Graphics()->QuadsSetSubset(1.0f, 0.0f, 0.0f, 1.0f);
IGraphics::CQuadItem QuadItem(TeeOffset, Row.y - 5.0f - Spacing / 2.0f, Row.h / 2.0f, Row.h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
}
const CGameClient::CClientData &ClientData = GameClient()->m_aClients[pInfo->m_ClientId];
// skin
if(RenderDead)
{
Graphics()->BlendNormal();
Graphics()->TextureSet(client_data7::g_pData->m_aImages[client_data7::IMAGE_DEADTEE].m_Id);
Graphics()->QuadsBegin();
if(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags & GAMEFLAG_TEAMS)
{
ColorRGBA Color = m_pClient->m_Skins7.GetTeamColor(true, 0, m_pClient->m_aClients[pInfo->m_ClientId].m_Team, protocol7::SKINPART_BODY);
Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a);
}
CTeeRenderInfo TeeInfo = m_pClient->m_aClients[pInfo->m_ClientId].m_RenderInfo;
TeeInfo.m_Size *= TeeSizeMod;
IGraphics::CQuadItem QuadItem(TeeOffset, Row.y, TeeInfo.m_Size, TeeInfo.m_Size);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
}
else
{
CTeeRenderInfo TeeInfo = ClientData.m_RenderInfo;
TeeInfo.m_Size *= TeeSizeMod;
vec2 OffsetToMid;
CRenderTools::GetRenderTeeOffsetToRenderedTee(CAnimState::GetIdle(), &TeeInfo, OffsetToMid);
const vec2 TeeRenderPos = vec2(TeeOffset + TeeLength / 2, Row.y + Row.h / 2.0f + OffsetToMid.y);
RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, EMOTE_NORMAL, vec2(1.0f, 0.0f), TeeRenderPos);
}
// name
{
CTextCursor Cursor;
TextRender()->SetCursor(&Cursor, NameOffset, Row.y + (Row.h - FontSize) / 2.0f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);
Cursor.m_LineWidth = NameLength;
if(ClientData.m_AuthLevel)
{
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClAuthedPlayerColor)));
}
if(g_Config.m_ClShowIds)
{
char aClientId[16];
GameClient()->FormatClientId(pInfo->m_ClientId, aClientId, EClientIdFormat::INDENT_AUTO);
TextRender()->TextEx(&Cursor, aClientId);
}
TextRender()->TextEx(&Cursor, ClientData.m_aName);
// ready / watching
if(Client()->IsSixup() && Client()->m_TranslationContext.m_aClients[pInfo->m_ClientId].m_PlayerFlags7 & protocol7::PLAYERFLAG_READY)
{
TextRender()->TextColor(0.1f, 1.0f, 0.1f, TextColor.a);
TextRender()->TextEx(&Cursor, "");
}
}
// clan
{
if(str_comp(ClientData.m_aClan, GameClient()->m_aClients[GameClient()->m_aLocalIds[g_Config.m_ClDummy]].m_aClan) == 0)
{
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClSameClanColor)));
}
else
{
TextRender()->TextColor(TextColor);
}
CTextCursor Cursor;
TextRender()->SetCursor(&Cursor, ClanOffset + (ClanLength - minimum(TextRender()->TextWidth(FontSize, ClientData.m_aClan), ClanLength)) / 2.0f, Row.y + (Row.h - FontSize) / 2.0f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);
Cursor.m_LineWidth = ClanLength;
TextRender()->TextEx(&Cursor, ClientData.m_aClan);
}
// country flag
GameClient()->m_CountryFlags.Render(ClientData.m_Country, ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f),
CountryOffset, Row.y + (Spacing + TeeSizeMod * 5.0f) / 2.0f, CountryLength, Row.h - Spacing - TeeSizeMod * 5.0f);
// ping
if(g_Config.m_ClEnablePingColor)
{
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA((300.0f - clamp(pInfo->m_Latency, 0, 300)) / 1000.0f, 1.0f, 0.5f)));
}
else
{
TextRender()->TextColor(TextRender()->DefaultTextColor());
}
str_format(aBuf, sizeof(aBuf), "%d", clamp(pInfo->m_Latency, 0, 999));
TextRender()->Text(PingOffset + PingLength - TextRender()->TextWidth(FontSize, aBuf), Row.y + (Row.h - FontSize) / 2.0f, FontSize, aBuf);
TextRender()->TextColor(TextRender()->DefaultTextColor());
if(CountRendered == CountEnd)
break;
}
}
@ -797,16 +790,15 @@ bool CScoreboard::Active() const
if(m_Active)
return true;
const CNetObj_GameInfo *pGameInfoObj = GameClient()->m_Snap.m_pGameInfoObj;
if(GameClient()->m_Snap.m_pLocalInfo && !GameClient()->m_Snap.m_SpecInfo.m_Active)
{
// we are not a spectator, check if we are dead and the game isn't paused
if(!GameClient()->m_Snap.m_pLocalCharacter && g_Config.m_ClScoreboardOnDeath &&
!(pGameInfoObj && pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_PAUSED))
// we are not a spectator, check if we are dead
if(!GameClient()->m_Snap.m_pLocalCharacter && g_Config.m_ClScoreboardOnDeath)
return true;
}
// if the game is over
const CNetObj_GameInfo *pGameInfoObj = GameClient()->m_Snap.m_pGameInfoObj;
if(pGameInfoObj && pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_GAMEOVER)
return true;

View file

@ -18,7 +18,7 @@
#include "menus.h"
#include "skins7.h"
const char *const CSkins7::ms_apSkinPartNames[protocol7::NUM_SKINPARTS] = {"body", "marking", "decoration", "hands", "feet", "eyes"};
const char *const CSkins7::ms_apSkinPartNames[protocol7::NUM_SKINPARTS] = {"body", "marking", "decoration", "hands", "feet", "eyes"}; /* Localize("body","skins");Localize("marking","skins");Localize("decoration","skins");Localize("hands","skins");Localize("feet","skins");Localize("eyes","skins"); */
const char *const CSkins7::ms_apColorComponents[NUM_COLOR_COMPONENTS] = {"hue", "sat", "lgt", "alp"};
char *CSkins7::ms_apSkinVariables[NUM_DUMMIES][protocol7::NUM_SKINPARTS] = {{0}};
@ -525,7 +525,7 @@ bool CSkins7::ValidateSkinParts(char *apPartNames[protocol7::NUM_SKINPARTS], int
bool CSkins7::SaveSkinfile(const char *pSaveSkinName, int Dummy)
{
char aBuf[IO_MAX_PATH_LENGTH];
str_format(aBuf, sizeof(aBuf), SKINS_DIR "/%s.json", pSaveSkinName);
str_format(aBuf, sizeof(aBuf), "skins/%s.json", pSaveSkinName);
IOHANDLE File = Storage()->OpenFile(aBuf, IOFLAG_WRITE, IStorage::TYPE_SAVE);
if(!File)
return false;
@ -547,7 +547,7 @@ bool CSkins7::SaveSkinfile(const char *pSaveSkinName, int Dummy)
Writer.WriteAttribute("filename");
Writer.WriteStrValue(ms_apSkinVariables[Dummy][PartIndex]);
const bool CustomColors = *ms_apUCCVariables[Dummy][PartIndex];
const bool CustomColors = *ms_apUCCVariables[PartIndex];
Writer.WriteAttribute("custom_colors");
Writer.WriteBoolValue(CustomColors);

View file

@ -191,26 +191,6 @@ void CGameClient::OnConsoleInit()
Console()->Chain("player_color_feet", ConchainSpecialInfoupdate, this);
Console()->Chain("player_skin", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_skin", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_skin_body", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_skin_marking", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_skin_decoration", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_skin_hands", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_skin_feet", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_skin_eyes", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_color_body", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_color_marking", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_color_decoration", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_color_hands", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_color_feet", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_color_eyes", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_use_custom_color_body", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_use_custom_color_marking", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_use_custom_color_decoration", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_use_custom_color_hands", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_use_custom_color_feet", ConchainSpecialInfoupdate, this);
Console()->Chain("player7_use_custom_color_eyes", ConchainSpecialInfoupdate, this);
Console()->Chain("dummy_name", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy_clan", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy_country", ConchainSpecialDummyInfoupdate, this);
@ -219,26 +199,6 @@ void CGameClient::OnConsoleInit()
Console()->Chain("dummy_color_feet", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy_skin", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_skin", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_skin_body", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_skin_marking", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_skin_decoration", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_skin_hands", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_skin_feet", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_skin_eyes", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_color_body", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_color_marking", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_color_decoration", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_color_hands", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_color_feet", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_color_eyes", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_use_custom_color_body", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_use_custom_color_marking", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_use_custom_color_decoration", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_use_custom_color_hands", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_use_custom_color_feet", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("dummy7_use_custom_color_eyes", ConchainSpecialDummyInfoupdate, this);
Console()->Chain("cl_skin_download_url", ConchainRefreshSkins, this);
Console()->Chain("cl_skin_community_download_url", ConchainRefreshSkins, this);
Console()->Chain("cl_download_skins", ConchainRefreshSkins, this);
@ -2500,7 +2460,7 @@ void CGameClient::SendSwitchTeam(int Team)
void CGameClient::SendStartInfo7(bool Dummy) const
{
protocol7::CNetMsg_Cl_StartInfo Msg;
Msg.m_pName = Dummy ? Client()->DummyName() : Client()->PlayerName();
Msg.m_pName = Dummy ? Client()->DummyName() : Config()->m_PlayerName;
Msg.m_pClan = Dummy ? Config()->m_ClDummyClan : Config()->m_PlayerClan;
Msg.m_Country = Dummy ? Config()->m_ClDummyCountry : Config()->m_PlayerCountry;
for(int p = 0; p < protocol7::NUM_SKINPARTS; p++)

View file

@ -49,10 +49,10 @@ struct CGameMsg7
};
static CGameMsg7 gs_GameMsgList7[protocol7::NUM_GAMEMSGS] = {
{/*GAMEMSG_TEAM_SWAP*/ DO_CHAT, PARA_NONE, "Teams were swapped"},
{/*GAMEMSG_TEAM_SWAP*/ DO_CHAT, PARA_NONE, "Teams were swapped"}, // Localize("Teams were swapped")
{/*GAMEMSG_SPEC_INVALIDID*/ DO_CHAT, PARA_NONE, "Invalid spectator id used"}, //!
{/*GAMEMSG_TEAM_SHUFFLE*/ DO_CHAT, PARA_NONE, "Teams were shuffled"},
{/*GAMEMSG_TEAM_BALANCE*/ DO_CHAT, PARA_NONE, "Teams have been balanced"},
{/*GAMEMSG_TEAM_SHUFFLE*/ DO_CHAT, PARA_NONE, "Teams were shuffled"}, // Localize("Teams were shuffled")
{/*GAMEMSG_TEAM_BALANCE*/ DO_CHAT, PARA_NONE, "Teams have been balanced"}, // Localize("Teams have been balanced")
{/*GAMEMSG_CTF_DROP*/ DO_SPECIAL, PARA_NONE, ""}, // special - play ctf drop sound
{/*GAMEMSG_CTF_RETURN*/ DO_SPECIAL, PARA_NONE, ""}, // special - play ctf return sound
@ -70,10 +70,10 @@ void CGameClient::DoTeamChangeMessage7(const char *pName, int ClientId, int Team
char aBuf[128];
switch(GetStrTeam7(Team, m_pClient->m_TranslationContext.m_GameFlags & protocol7::GAMEFLAG_TEAMS))
{
case STR_TEAM_GAME: str_format(aBuf, sizeof(aBuf), "'%s' %sjoined the game", pName, pPrefix); break;
case STR_TEAM_RED: str_format(aBuf, sizeof(aBuf), "'%s' %sjoined the red team", pName, pPrefix); break;
case STR_TEAM_BLUE: str_format(aBuf, sizeof(aBuf), "'%s' %sjoined the blue team", pName, pPrefix); break;
case STR_TEAM_SPECTATORS: str_format(aBuf, sizeof(aBuf), "'%s' %sjoined the spectators", pName, pPrefix); break;
case STR_TEAM_GAME: str_format(aBuf, sizeof(aBuf), Localize("'%s' %sjoined the game"), pName, pPrefix); break;
case STR_TEAM_RED: str_format(aBuf, sizeof(aBuf), Localize("'%s' %sjoined the red team"), pName, pPrefix); break;
case STR_TEAM_BLUE: str_format(aBuf, sizeof(aBuf), Localize("'%s' %sjoined the blue team"), pName, pPrefix); break;
case STR_TEAM_SPECTATORS: str_format(aBuf, sizeof(aBuf), Localize("'%s' %sjoined the spectators"), pName, pPrefix); break;
}
m_Chat.AddLine(-1, 0, aBuf);
}
@ -233,9 +233,9 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
protocol7::CNetMsg_Sv_ServerSettings *pMsg = (protocol7::CNetMsg_Sv_ServerSettings *)pRawMsg;
if(!m_pClient->m_TranslationContext.m_ServerSettings.m_TeamLock && pMsg->m_TeamLock)
m_Chat.AddLine(-1, 0, "Teams were locked");
m_Chat.AddLine(-1, 0, Localize("Teams were locked"));
else if(m_pClient->m_TranslationContext.m_ServerSettings.m_TeamLock && !pMsg->m_TeamLock)
m_Chat.AddLine(-1, 0, "Teams were unlocked");
m_Chat.AddLine(-1, 0, Localize("Teams were unlocked"));
m_pClient->m_TranslationContext.m_ServerSettings.m_KickVote = pMsg->m_KickVote;
m_pClient->m_TranslationContext.m_ServerSettings.m_KickMin = pMsg->m_KickMin;
@ -387,18 +387,18 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
switch(pMsg7->m_Type)
{
case protocol7::VOTE_START_OP:
str_format(aBuf, sizeof(aBuf), "'%s' called vote to change server option '%s' (%s)", pName, pMsg7->m_pDescription, pMsg7->m_pReason);
str_format(aBuf, sizeof(aBuf), Localize("'%s' called vote to change server option '%s' (%s)"), pName, pMsg7->m_pDescription, pMsg7->m_pReason);
m_Chat.AddLine(-1, 0, aBuf);
break;
case protocol7::VOTE_START_KICK:
{
str_format(aBuf, sizeof(aBuf), "'%s' called for vote to kick '%s' (%s)", pName, pMsg7->m_pDescription, pMsg7->m_pReason);
str_format(aBuf, sizeof(aBuf), Localize("'%s' called for vote to kick '%s' (%s)"), pName, pMsg7->m_pDescription, pMsg7->m_pReason);
m_Chat.AddLine(-1, 0, aBuf);
break;
}
case protocol7::VOTE_START_SPEC:
{
str_format(aBuf, sizeof(aBuf), "'%s' called for vote to move '%s' to spectators (%s)", pName, pMsg7->m_pDescription, pMsg7->m_pReason);
str_format(aBuf, sizeof(aBuf), Localize("'%s' called for vote to move '%s' to spectators (%s)"), pName, pMsg7->m_pDescription, pMsg7->m_pReason);
m_Chat.AddLine(-1, 0, aBuf);
}
}
@ -409,24 +409,24 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
switch(pMsg7->m_Type)
{
case protocol7::VOTE_START_OP:
str_format(aBuf, sizeof(aBuf), "Admin forced server option '%s' (%s)", pMsg7->m_pDescription, pMsg7->m_pReason);
str_format(aBuf, sizeof(aBuf), Localize("Admin forced server option '%s' (%s)"), pMsg7->m_pDescription, pMsg7->m_pReason);
m_Chat.AddLine(-1, 0, aBuf);
break;
case protocol7::VOTE_START_SPEC:
str_format(aBuf, sizeof(aBuf), "Admin moved '%s' to spectator (%s)", pMsg7->m_pDescription, pMsg7->m_pReason);
str_format(aBuf, sizeof(aBuf), Localize("Admin moved '%s' to spectator (%s)"), pMsg7->m_pDescription, pMsg7->m_pReason);
m_Chat.AddLine(-1, 0, aBuf);
break;
case protocol7::VOTE_END_ABORT:
m_Voting.OnReset();
m_Chat.AddLine(-1, 0, "Vote aborted");
m_Chat.AddLine(-1, 0, Localize("Vote aborted"));
break;
case protocol7::VOTE_END_PASS:
m_Voting.OnReset();
m_Chat.AddLine(-1, 0, pMsg7->m_ClientId == -1 ? "Admin forced vote yes" : "Vote passed");
m_Chat.AddLine(-1, 0, pMsg7->m_ClientId == -1 ? Localize("Admin forced vote yes") : Localize("Vote passed"));
break;
case protocol7::VOTE_END_FAIL:
m_Voting.OnReset();
m_Chat.AddLine(-1, 0, pMsg7->m_ClientId == -1 ? "Admin forced vote no" : "Vote failed");
m_Chat.AddLine(-1, 0, pMsg7->m_ClientId == -1 ? Localize("Admin forced vote no") : Localize("Vote failed"));
}
}
@ -630,10 +630,10 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
const char *pMsg = "";
switch(GetStrTeam7(aParaI[0], TeamPlay))
{
case STR_TEAM_GAME: pMsg = "All players were moved to the game"; break;
case STR_TEAM_RED: pMsg = "All players were moved to the red team"; break;
case STR_TEAM_BLUE: pMsg = "All players were moved to the blue team"; break;
case STR_TEAM_SPECTATORS: pMsg = "All players were moved to the spectators"; break;
case STR_TEAM_GAME: pMsg = Localize("All players were moved to the game"); break;
case STR_TEAM_RED: pMsg = Localize("All players were moved to the red team"); break;
case STR_TEAM_BLUE: pMsg = Localize("All players were moved to the blue team"); break;
case STR_TEAM_SPECTATORS: pMsg = Localize("All players were moved to the spectators"); break;
}
m_Broadcast.DoBroadcast(pMsg); // client side broadcast
}
@ -643,8 +643,8 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
const char *pMsg = "";
switch(GetStrTeam7(aParaI[0], TeamPlay))
{
case STR_TEAM_RED: pMsg = "You were moved to the red team due to team balancing"; break;
case STR_TEAM_BLUE: pMsg = "You were moved to the blue team due to team balancing"; break;
case STR_TEAM_RED: pMsg = Localize("You were moved to the red team due to team balancing"); break;
case STR_TEAM_BLUE: pMsg = Localize("You were moved to the blue team due to team balancing"); break;
}
m_Broadcast.DoBroadcast(pMsg); // client side broadcast
}
@ -655,7 +655,7 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
case protocol7::GAMEMSG_GAME_PAUSED:
{
int ClientId = clamp(aParaI[0], 0, MAX_CLIENTS - 1);
str_format(aBuf, sizeof(aBuf), "'%s' initiated a pause", m_aClients[ClientId].m_aName);
str_format(aBuf, sizeof(aBuf), Localize("'%s' initiated a pause"), m_aClients[ClientId].m_aName);
SendChat(aBuf);
}
break;
@ -669,22 +669,22 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
{
if(aParaI[0])
{
str_format(aBuf, sizeof(aBuf), "The blue flag was captured by '%s' (%.2f seconds)", m_aClients[ClientId].m_aName, Time);
str_format(aBuf, sizeof(aBuf), Localize("The blue flag was captured by '%s' (%.2f seconds)"), m_aClients[ClientId].m_aName, Time);
}
else
{
str_format(aBuf, sizeof(aBuf), "The red flag was captured by '%s' (%.2f seconds)", m_aClients[ClientId].m_aName, Time);
str_format(aBuf, sizeof(aBuf), Localize("The red flag was captured by '%s' (%.2f seconds)"), m_aClients[ClientId].m_aName, Time);
}
}
else
{
if(aParaI[0])
{
str_format(aBuf, sizeof(aBuf), "The blue flag was captured by '%s'", m_aClients[ClientId].m_aName);
str_format(aBuf, sizeof(aBuf), Localize("The blue flag was captured by '%s'"), m_aClients[ClientId].m_aName);
}
else
{
str_format(aBuf, sizeof(aBuf), "The red flag was captured by '%s'", m_aClients[ClientId].m_aName);
str_format(aBuf, sizeof(aBuf), Localize("The red flag was captured by '%s'"), m_aClients[ClientId].m_aName);
}
}
SendChat(aBuf);
@ -696,7 +696,7 @@ void *CGameClient::TranslateGameMsg(int *pMsgId, CUnpacker *pUnpacker, int Conn)
const char *pText = "";
if(NumParaI == 0)
{
pText = gs_GameMsgList7[GameMsgId].m_pText;
pText = Localize(gs_GameMsgList7[GameMsgId].m_pText);
}
// handle message

View file

@ -1332,18 +1332,9 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
Rail.VSplitLeft(pColorInner ? 8.0f : clamp(33.0f, Rail.h, Rail.w / 3.0f), &Handle, 0);
Handle.x += (Rail.w - Handle.w) * Current;
CUIRect HandleArea = Handle;
if(!pColorInner)
{
HandleArea.h = pRect->h * 0.9f;
HandleArea.y = pRect->y + pRect->h * 0.05f;
HandleArea.w += 6.0f;
HandleArea.x -= 3.0f;
}
// logic
const bool InsideRail = MouseHovered(&Rail);
const bool InsideHandle = MouseHovered(&HandleArea);
const bool InsideHandle = MouseHovered(&Handle);
bool Grabbed = false; // whether to apply the offset
if(CheckActiveItem(pId))
@ -1375,12 +1366,6 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
Grabbed = true;
}
if(!pColorInner && (InsideHandle || Grabbed) && (CheckActiveItem(pId) || HotItem() == pId))
{
Handle.h += 3.0f;
Handle.y -= 1.5f;
}
if(InsideHandle && !MouseButton(0))
{
SetHotItem(pId);
@ -1409,7 +1394,7 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
else
{
Rail.Draw(ColorRGBA(1.0f, 1.0f, 1.0f, 0.25f), IGraphics::CORNER_ALL, Rail.h / 2.0f);
Handle.Draw(HandleColor, IGraphics::CORNER_ALL, Rail.h / 2.0f);
Handle.Draw(HandleColor, IGraphics::CORNER_ALL, Handle.h / 2.0f);
}
return ReturnValue;

View file

@ -1074,9 +1074,11 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar)
// proof button
TB_Top.VSplitLeft(40.0f, &Button, &TB_Top);
if(DoButton_Ex(&m_QuickActionProof, m_QuickActionProof.Label(), m_QuickActionProof.Active(), &Button, 0, m_QuickActionProof.Description(), IGraphics::CORNER_L))
static int s_ProofButton = 0;
if(DoButton_Ex(&s_ProofButton, "Proof", MapView()->ProofMode()->IsEnabled(), &Button, 0, "[ctrl+p] Toggles proof borders. These borders represent the area that a player can see with default zoom.", IGraphics::CORNER_L) ||
(m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_P) && ModPressed))
{
m_QuickActionProof.Call();
MapView()->ProofMode()->Toggle();
}
TB_Top.VSplitLeft(14.0f, &Button, &TB_Top);
@ -1102,10 +1104,10 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar)
// grid button
TB_Top.VSplitLeft(25.0f, &Button, &TB_Top);
static int s_GridButton = 0;
if(DoButton_FontIcon(&s_GridButton, FONT_ICON_BORDER_ALL, m_QuickActionToggleGrid.Active(), &Button, 0, m_QuickActionToggleGrid.Description(), IGraphics::CORNER_L) ||
if(DoButton_FontIcon(&s_GridButton, FONT_ICON_BORDER_ALL, MapView()->MapGrid()->IsEnabled(), &Button, 0, "[ctrl+g] Toggle Grid", IGraphics::CORNER_L) ||
(m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_G) && ModPressed && !ShiftPressed))
{
m_QuickActionToggleGrid.Call();
MapView()->MapGrid()->Toggle();
}
// grid settings button
@ -1121,23 +1123,23 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar)
// zoom group
TB_Top.VSplitLeft(20.0f, &Button, &TB_Top);
static int s_ZoomOutButton = 0;
if(DoButton_FontIcon(&s_ZoomOutButton, FONT_ICON_MINUS, 0, &Button, 0, m_QuickActionZoomOut.Description(), IGraphics::CORNER_L))
if(DoButton_FontIcon(&s_ZoomOutButton, FONT_ICON_MINUS, 0, &Button, 0, "[NumPad-] Zoom out", IGraphics::CORNER_L))
{
m_QuickActionZoomOut.Call();
MapView()->Zoom()->ChangeValue(50.0f);
}
TB_Top.VSplitLeft(25.0f, &Button, &TB_Top);
static int s_ZoomNormalButton = 0;
if(DoButton_FontIcon(&s_ZoomNormalButton, FONT_ICON_MAGNIFYING_GLASS, 0, &Button, 0, m_QuickActionResetZoom.Description(), IGraphics::CORNER_NONE))
if(DoButton_FontIcon(&s_ZoomNormalButton, FONT_ICON_MAGNIFYING_GLASS, 0, &Button, 0, "[NumPad*] Zoom to normal and remove editor offset", IGraphics::CORNER_NONE))
{
m_QuickActionResetZoom.Call();
MapView()->ResetZoom();
}
TB_Top.VSplitLeft(20.0f, &Button, &TB_Top);
static int s_ZoomInButton = 0;
if(DoButton_FontIcon(&s_ZoomInButton, FONT_ICON_PLUS, 0, &Button, 0, m_QuickActionZoomIn.Description(), IGraphics::CORNER_R))
if(DoButton_FontIcon(&s_ZoomInButton, FONT_ICON_PLUS, 0, &Button, 0, "[NumPad+] Zoom in", IGraphics::CORNER_R))
{
m_QuickActionZoomIn.Call();
MapView()->Zoom()->ChangeValue(-50.0f);
}
TB_Top.VSplitLeft(5.0f, nullptr, &TB_Top);
@ -1228,10 +1230,10 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar)
static char s_PipetteButton;
ColorPalette.VSplitLeft(PipetteButtonWidth, &Button, &ColorPalette);
ColorPalette.VSplitLeft(Spacing, nullptr, &ColorPalette);
if(DoButton_FontIcon(&s_PipetteButton, FONT_ICON_EYE_DROPPER, m_QuickActionPipette.Active(), &Button, 0, m_QuickActionPipette.Description(), IGraphics::CORNER_ALL) ||
if(DoButton_FontIcon(&s_PipetteButton, FONT_ICON_EYE_DROPPER, m_ColorPipetteActive ? 1 : 0, &Button, 0, "[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.", IGraphics::CORNER_ALL) ||
(CLineInput::GetActiveInput() == nullptr && ModPressed && ShiftPressed && Input()->KeyPress(KEY_C)))
{
m_QuickActionPipette.Call();
m_ColorPipetteActive = !m_ColorPipetteActive;
}
// Palette color pickers
@ -1252,9 +1254,10 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar)
// refocus button
{
TB_Bottom.VSplitLeft(50.0f, &Button, &TB_Bottom);
static int s_RefocusButton = 0;
int FocusButtonChecked = MapView()->IsFocused() ? -1 : 1;
if(DoButton_Editor(&m_QuickActionRefocus, m_QuickActionRefocus.Label(), FocusButtonChecked, &Button, 0, m_QuickActionRefocus.Description()) || (m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_HOME)))
m_QuickActionRefocus.Call();
if(DoButton_Editor(&s_RefocusButton, "Refocus", FocusButtonChecked, &Button, 0, "[HOME] Restore map focus") || (m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr && Input()->KeyPress(KEY_HOME)))
MapView()->Focus();
TB_Bottom.VSplitLeft(5.0f, nullptr, &TB_Bottom);
}
@ -4299,9 +4302,12 @@ void CEditor::RenderLayers(CUIRect LayersBox)
if(s_ScrollRegion.AddRect(AddGroupButton))
{
AddGroupButton.HSplitTop(RowHeight, &AddGroupButton, 0);
if(DoButton_Editor(&m_QuickActionAddGroup, m_QuickActionAddGroup.Label(), 0, &AddGroupButton, IGraphics::CORNER_R, m_QuickActionAddGroup.Description()))
static int s_AddGroupButton = 0;
if(DoButton_Editor(&s_AddGroupButton, "Add group", 0, &AddGroupButton, IGraphics::CORNER_R, "Adds a new group"))
{
m_QuickActionAddGroup.Call();
m_Map.NewGroup();
m_SelectedGroup = m_Map.m_vpGroups.size() - 1;
m_EditorHistory.RecordAction(std::make_shared<CEditorActionGroup>(this, m_SelectedGroup, false));
}
}
@ -4800,8 +4806,8 @@ void CEditor::RenderImagesList(CUIRect ToolBox)
{
AddImageButton.HSplitTop(5.0f, nullptr, &AddImageButton);
AddImageButton.HSplitTop(RowHeight, &AddImageButton, nullptr);
if(DoButton_Editor(&s_AddImageButton, m_QuickActionAddImage.Label(), 0, &AddImageButton, 0, m_QuickActionAddImage.Description()))
m_QuickActionAddImage.Call();
if(DoButton_Editor(&s_AddImageButton, "Add", 0, &AddImageButton, 0, "Load a new image to use in the map"))
InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_IMG, "Add Image", "Add", "mapres", false, AddImage, this);
}
s_ScrollRegion.End();
}
@ -5739,25 +5745,30 @@ void CEditor::RenderModebar(CUIRect View)
void CEditor::RenderStatusbar(CUIRect View, CUIRect *pTooltipRect)
{
const bool ButtonsDisabled = m_ShowPicker;
CUIRect Button;
View.VSplitRight(100.0f, &View, &Button);
if(DoButton_Editor(&m_QuickActionEnvelopes, m_QuickActionEnvelopes.Label(), m_QuickActionEnvelopes.Color(), &Button, 0, m_QuickActionEnvelopes.Description()) == 1)
static int s_EnvelopeButton = 0;
if(DoButton_Editor(&s_EnvelopeButton, "Envelopes", ButtonsDisabled ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES, &Button, 0, "Toggles the envelope editor.") == 1)
{
m_QuickActionEnvelopes.Call();
m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES ? EXTRAEDITOR_NONE : EXTRAEDITOR_ENVELOPES;
}
View.VSplitRight(10.0f, &View, nullptr);
View.VSplitRight(100.0f, &View, &Button);
if(DoButton_Editor(&m_QuickActionServerSettings, m_QuickActionServerSettings.Label(), m_QuickActionServerSettings.Color(), &Button, 0, m_QuickActionServerSettings.Description()) == 1)
static int s_SettingsButton = 0;
if(DoButton_Editor(&s_SettingsButton, "Server settings", ButtonsDisabled ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS, &Button, 0, "Toggles the server settings editor.") == 1)
{
m_QuickActionServerSettings.Call();
m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS;
}
View.VSplitRight(10.0f, &View, nullptr);
View.VSplitRight(100.0f, &View, &Button);
if(DoButton_Editor(&m_QuickActionHistory, m_QuickActionHistory.Label(), m_QuickActionHistory.Color(), &Button, 0, m_QuickActionHistory.Description()) == 1)
static int s_HistoryButton = 0;
if(DoButton_Editor(&s_HistoryButton, "History", ButtonsDisabled ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY, &Button, 0, "Toggles the editor history view.") == 1)
{
m_QuickActionHistory.Call();
m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY;
}
View.VSplitRight(10.0f, pTooltipRect, nullptr);
@ -7691,7 +7702,7 @@ void CEditor::RenderMenubar(CUIRect MenuBar)
if(DoButton_Ex(&s_SettingsButton, "Settings", 0, &SettingsButton, 0, nullptr, IGraphics::CORNER_T, EditorFontSizes::MENU, TEXTALIGN_ML))
{
static SPopupMenuId s_PopupMenuEntitiesId;
Ui()->DoPopupMenu(&s_PopupMenuEntitiesId, SettingsButton.x, SettingsButton.y + SettingsButton.h - 1.0f, 200.0f, 106.0f, this, PopupMenuSettings, PopupProperties);
Ui()->DoPopupMenu(&s_PopupMenuEntitiesId, SettingsButton.x, SettingsButton.y + SettingsButton.h - 1.0f, 200.0f, 92.0f, this, PopupMenuSettings, PopupProperties);
}
CUIRect ChangedIndicator, Info, Help, Close;
@ -7908,7 +7919,7 @@ void CEditor::Render()
InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, CallbackSaveCopyMap, this);
// ctrl+shift+s to save as
else if(Input()->KeyPress(KEY_S) && ModPressed && ShiftPressed)
m_QuickActionSaveAs.Call();
InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, CallbackSaveMap, this);
// ctrl+s to save
else if(Input()->KeyPress(KEY_S) && ModPressed)
{
@ -8351,7 +8362,6 @@ void CEditor::Init()
m_vComponents.emplace_back(m_MapView);
m_vComponents.emplace_back(m_MapSettingsBackend);
m_vComponents.emplace_back(m_LayerSelector);
m_vComponents.emplace_back(m_Prompt);
for(CEditorComponent &Component : m_vComponents)
Component.OnInit(this);
@ -8592,29 +8602,21 @@ void CEditor::HandleWriterFinishJobs()
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "editor/save", aBuf);
// send rcon.. if we can
if(Client()->RconAuthed() && g_Config.m_EdAutoMapReload)
if(Client()->RconAuthed())
{
CServerInfo CurrentServerInfo;
Client()->GetServerInfo(&CurrentServerInfo);
NETADDR ServerAddr = Client()->ServerAddress();
const unsigned char aIpv4Localhost[16] = {127, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
const unsigned char aIpv6Localhost[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
NETADDR pAddr = Client()->ServerAddress();
char aAddrStr[NETADDR_MAXSTRSIZE];
net_addr_str(&Client()->ServerAddress(), aAddrStr, sizeof(aAddrStr), true);
// and if we're on a local address
bool IsLocalAddress = false;
if(pAddr.ip[0] == 127 || pAddr.ip[0] == 10 || (pAddr.ip[0] == 192 && pAddr.ip[1] == 168) || (pAddr.ip[0] == 172 && (pAddr.ip[1] >= 16 && pAddr.ip[1] <= 31)))
IsLocalAddress = true;
if(str_startswith(aAddrStr, "[fe80:") || str_startswith(aAddrStr, "[::1"))
IsLocalAddress = true;
if(IsLocalAddress)
// and if we're on localhost
if(!mem_comp(ServerAddr.ip, aIpv4Localhost, sizeof(aIpv4Localhost)) || !mem_comp(ServerAddr.ip, aIpv6Localhost, sizeof(aIpv6Localhost)))
{
char aMapName[128];
IStorage::StripPathAndExtension(pJob->GetRealFileName(), aMapName, sizeof(aMapName));
if(!str_comp(aMapName, CurrentServerInfo.m_aMap))
Client()->Rcon("hot_reload");
Client()->Rcon("reload");
}
}
}

View file

@ -11,7 +11,6 @@
#include <game/client/ui_listbox.h>
#include <game/mapitems.h>
#include <game/editor/enums.h>
#include <game/editor/mapitems/envelope.h>
#include <game/editor/mapitems/layer.h>
#include <game/editor/mapitems/layer_front.h>
@ -39,8 +38,6 @@
#include "layer_selector.h"
#include "map_view.h"
#include "smooth_value.h"
#include <game/editor/prompt.h>
#include <game/editor/quick_action.h>
#include <deque>
#include <functional>
@ -63,8 +60,7 @@ enum
DIALOG_NONE = 0,
DIALOG_FILE,
DIALOG_MAPSETTINGS_ERROR,
DIALOG_QUICK_PROMPT,
DIALOG_MAPSETTINGS_ERROR
};
class CEditorImage;
@ -282,7 +278,6 @@ class CEditor : public IEditor
std::vector<std::reference_wrapper<CEditorComponent>> m_vComponents;
CMapView m_MapView;
CLayerSelector m_LayerSelector;
CPrompt m_Prompt;
bool m_EditorWasUsedBefore = false;
@ -324,20 +319,7 @@ public:
const CMapView *MapView() const { return &m_MapView; }
CLayerSelector *LayerSelector() { return &m_LayerSelector; }
void FillGameTiles(EGameTileOp FillTile) const;
bool CanFillGameTiles() const;
void AddGroup();
void AddTileLayer();
void LayerSelectImage();
bool IsNonGameTileLayerSelected() const;
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description) CQuickAction m_QuickAction##name;
#include <game/editor/quick_actions.h>
#undef REGISTER_QUICK_ACTION
CEditor() :
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description) m_QuickAction##name(text, description, callback, disabled, active, button_color),
#include <game/editor/quick_actions.h>
#undef REGISTER_QUICK_ACTION
m_ZoomEnvelopeX(1.0f, 0.1f, 600.0f),
m_ZoomEnvelopeY(640.0f, 0.1f, 32000.0f),
m_MapSettingsCommandContext(m_MapSettingsBackend.NewContext(&m_SettingsCommandInput))

View file

@ -320,7 +320,7 @@ void CEditorActionDeleteQuad::Redo()
CEditorActionEditQuadPoint::CEditorActionEditQuadPoint(CEditor *pEditor, int GroupIndex, int LayerIndex, int QuadIndex, std::vector<CPoint> const &vPreviousPoints, std::vector<CPoint> const &vCurrentPoints) :
CEditorActionLayerBase(pEditor, GroupIndex, LayerIndex), m_QuadIndex(QuadIndex), m_vPreviousPoints(vPreviousPoints), m_vCurrentPoints(vCurrentPoints)
{
str_copy(m_aDisplayText, "Edit quad points");
str_format(m_aDisplayText, sizeof(m_aDisplayText), "Edit quad points");
}
void CEditorActionEditQuadPoint::Undo()
@ -628,7 +628,7 @@ CEditorActionGroup::CEditorActionGroup(CEditor *pEditor, int GroupIndex, bool De
if(m_Delete)
str_format(m_aDisplayText, sizeof(m_aDisplayText), "Delete group %d", m_GroupIndex);
else
str_copy(m_aDisplayText, "New group", sizeof(m_aDisplayText));
str_format(m_aDisplayText, sizeof(m_aDisplayText), "New group");
}
void CEditorActionGroup::Undo()
@ -1198,7 +1198,7 @@ CEditorActionTileArt::CEditorActionTileArt(CEditor *pEditor, int PreviousImageCo
IEditorAction(pEditor), m_PreviousImageCount(PreviousImageCount), m_vImageIndexMap(vImageIndexMap)
{
str_copy(m_aTileArtFile, pTileArtFile);
str_copy(m_aDisplayText, "Tile art");
str_format(m_aDisplayText, sizeof(m_aDisplayText), "Tile art");
}
void CEditorActionTileArt::Undo()
@ -1266,7 +1266,7 @@ CEditorCommandAction::CEditorCommandAction(CEditor *pEditor, EType Type, int *pS
switch(m_Type)
{
case EType::ADD:
str_copy(m_aDisplayText, "Add command");
str_format(m_aDisplayText, sizeof(m_aDisplayText), "Add command");
break;
case EType::EDIT:
str_format(m_aDisplayText, sizeof(m_aDisplayText), "Edit command %d", m_CommandIndex);

View file

@ -1,36 +0,0 @@
#ifndef GAME_EDITOR_ENUMS_H
#define GAME_EDITOR_ENUMS_H
constexpr const char *g_apGametileOpNames[] = {
"Air",
"Hookable",
"Death",
"Unhookable",
"Hookthrough",
"Freeze",
"Unfreeze",
"Deep Freeze",
"Deep Unfreeze",
"Blue Check-Tele",
"Red Check-Tele",
"Live Freeze",
"Live Unfreeze",
};
enum class EGameTileOp
{
AIR,
HOOKABLE,
DEATH,
UNHOOKABLE,
HOOKTHROUGH,
FREEZE,
UNFREEZE,
DEEP_FREEZE,
DEEP_UNFREEZE,
BLUE_CHECK_TELE,
RED_CHECK_TELE,
LIVE_FREEZE,
LIVE_UNFREEZE,
};
#endif

View file

@ -6,7 +6,6 @@
#include <engine/shared/map.h>
#include <game/editor/editor.h>
#include <game/editor/editor_actions.h>
#include <game/editor/enums.h>
#include <iterator>
#include <numeric>
@ -694,126 +693,93 @@ void CLayerTiles::ShowInfo()
Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
}
void CLayerTiles::FillGameTiles(EGameTileOp Fill)
CUi::EPopupMenuFunctionResult CLayerTiles::RenderProperties(CUIRect *pToolBox)
{
if(!CanFillGameTiles())
return;
CUIRect Button;
const bool EntitiesLayer = IsEntitiesLayer();
std::shared_ptr<CLayerGroup> pGroup = m_pEditor->m_Map.m_vpGroups[m_pEditor->m_SelectedGroup];
int Result = (int)Fill;
switch(Fill)
// Game tiles can only be constructed if the layer is relative to the game layer
if(!EntitiesLayer && !(pGroup->m_OffsetX % 32) && !(pGroup->m_OffsetY % 32) && pGroup->m_ParallaxX == 100 && pGroup->m_ParallaxY == 100)
{
case EGameTileOp::HOOKTHROUGH:
Result = TILE_THROUGH_CUT;
break;
case EGameTileOp::FREEZE:
Result = TILE_FREEZE;
break;
case EGameTileOp::UNFREEZE:
Result = TILE_UNFREEZE;
break;
case EGameTileOp::DEEP_FREEZE:
Result = TILE_DFREEZE;
break;
case EGameTileOp::DEEP_UNFREEZE:
Result = TILE_DUNFREEZE;
break;
case EGameTileOp::BLUE_CHECK_TELE:
Result = TILE_TELECHECKIN;
break;
case EGameTileOp::RED_CHECK_TELE:
Result = TILE_TELECHECKINEVIL;
break;
case EGameTileOp::LIVE_FREEZE:
Result = TILE_LFREEZE;
break;
case EGameTileOp::LIVE_UNFREEZE:
Result = TILE_LUNFREEZE;
break;
default:
break;
}
if(Result > -1)
{
const int OffsetX = -pGroup->m_OffsetX / 32;
const int OffsetY = -pGroup->m_OffsetY / 32;
std::vector<std::shared_ptr<IEditorAction>> vpActions;
std::shared_ptr<CLayerTiles> pGLayer = m_pEditor->m_Map.m_pGameLayer;
int GameLayerIndex = std::find(m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin(), m_pEditor->m_Map.m_pGameGroup->m_vpLayers.end(), pGLayer) - m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin();
if(Result != TILE_TELECHECKIN && Result != TILE_TELECHECKINEVIL)
pToolBox->HSplitBottom(12.0f, pToolBox, &Button);
static int s_GameTilesButton = 0;
if(m_pEditor->DoButton_Editor(&s_GameTilesButton, "Game tiles", 0, &Button, 0, "Constructs game tiles from this layer"))
m_pEditor->PopupSelectGametileOpInvoke(m_pEditor->Ui()->MouseX(), m_pEditor->Ui()->MouseY());
const int Selected = m_pEditor->PopupSelectGameTileOpResult();
int Result = Selected;
switch(Selected)
{
if(pGLayer->m_Width < m_Width + OffsetX || pGLayer->m_Height < m_Height + OffsetY)
{
std::map<int, std::shared_ptr<CLayer>> savedLayers;
savedLayers[LAYERTYPE_TILES] = pGLayer->Duplicate();
savedLayers[LAYERTYPE_GAME] = savedLayers[LAYERTYPE_TILES];
int PrevW = pGLayer->m_Width;
int PrevH = pGLayer->m_Height;
const int NewW = pGLayer->m_Width < m_Width + OffsetX ? m_Width + OffsetX : pGLayer->m_Width;
const int NewH = pGLayer->m_Height < m_Height + OffsetY ? m_Height + OffsetY : pGLayer->m_Height;
pGLayer->Resize(NewW, NewH);
vpActions.push_back(std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, GameLayerIndex, ETilesProp::PROP_WIDTH, PrevW, NewW));
const std::shared_ptr<CEditorActionEditLayerTilesProp> &Action1 = std::static_pointer_cast<CEditorActionEditLayerTilesProp>(vpActions[vpActions.size() - 1]);
vpActions.push_back(std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, GameLayerIndex, ETilesProp::PROP_HEIGHT, PrevH, NewH));
const std::shared_ptr<CEditorActionEditLayerTilesProp> &Action2 = std::static_pointer_cast<CEditorActionEditLayerTilesProp>(vpActions[vpActions.size() - 1]);
Action1->SetSavedLayers(savedLayers);
Action2->SetSavedLayers(savedLayers);
}
int Changes = 0;
for(int y = OffsetY < 0 ? -OffsetY : 0; y < m_Height; y++)
{
for(int x = OffsetX < 0 ? -OffsetX : 0; x < m_Width; x++)
{
if(GetTile(x, y).m_Index)
{
const CTile ResultTile = {(unsigned char)Result};
pGLayer->SetTile(x + OffsetX, y + OffsetY, ResultTile);
Changes++;
}
}
}
vpActions.push_back(std::make_shared<CEditorBrushDrawAction>(m_pEditor, m_pEditor->m_SelectedGroup));
char aDisplay[256];
str_format(aDisplay, sizeof(aDisplay), "Construct '%s' game tiles (x%d)", g_apGametileOpNames[(int)Fill], Changes);
m_pEditor->m_EditorHistory.RecordAction(std::make_shared<CEditorActionBulk>(m_pEditor, vpActions, aDisplay, true));
case 4:
Result = TILE_THROUGH_CUT;
break;
case 5:
Result = TILE_FREEZE;
break;
case 6:
Result = TILE_UNFREEZE;
break;
case 7:
Result = TILE_DFREEZE;
break;
case 8:
Result = TILE_DUNFREEZE;
break;
case 9:
Result = TILE_TELECHECKIN;
break;
case 10:
Result = TILE_TELECHECKINEVIL;
break;
case 11:
Result = TILE_LFREEZE;
break;
case 12:
Result = TILE_LUNFREEZE;
break;
default:
break;
}
else
if(Result > -1)
{
if(!m_pEditor->m_Map.m_pTeleLayer)
const int OffsetX = -pGroup->m_OffsetX / 32;
const int OffsetY = -pGroup->m_OffsetY / 32;
static const char *s_apGametileOpNames[] = {
"Air",
"Hookable",
"Death",
"Unhookable",
"Hookthrough",
"Freeze",
"Unfreeze",
"Deep Freeze",
"Deep Unfreeze",
"Blue Check-Tele",
"Red Check-Tele",
"Live Freeze",
"Live Unfreeze",
};
std::vector<std::shared_ptr<IEditorAction>> vpActions;
std::shared_ptr<CLayerTiles> pGLayer = m_pEditor->m_Map.m_pGameLayer;
int GameLayerIndex = std::find(m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin(), m_pEditor->m_Map.m_pGameGroup->m_vpLayers.end(), pGLayer) - m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin();
if(Result != TILE_TELECHECKIN && Result != TILE_TELECHECKINEVIL)
{
std::shared_ptr<CLayerTele> pLayer = std::make_shared<CLayerTele>(m_pEditor, m_Width, m_Height);
m_pEditor->m_Map.MakeTeleLayer(pLayer);
m_pEditor->m_Map.m_pGameGroup->AddLayer(pLayer);
vpActions.push_back(std::make_shared<CEditorActionAddLayer>(m_pEditor, m_pEditor->m_SelectedGroup, m_pEditor->m_Map.m_pGameGroup->m_vpLayers.size() - 1));
if(m_Width != pGLayer->m_Width || m_Height > pGLayer->m_Height)
if(pGLayer->m_Width < m_Width + OffsetX || pGLayer->m_Height < m_Height + OffsetY)
{
std::map<int, std::shared_ptr<CLayer>> savedLayers;
savedLayers[LAYERTYPE_TILES] = pGLayer->Duplicate();
savedLayers[LAYERTYPE_GAME] = savedLayers[LAYERTYPE_TILES];
int NewW = pGLayer->m_Width;
int NewH = pGLayer->m_Height;
if(m_Width > pGLayer->m_Width)
{
NewW = m_Width;
}
if(m_Height > pGLayer->m_Height)
{
NewH = m_Height;
}
int PrevW = pGLayer->m_Width;
int PrevH = pGLayer->m_Height;
pLayer->Resize(NewW, NewH);
const int NewW = pGLayer->m_Width < m_Width + OffsetX ? m_Width + OffsetX : pGLayer->m_Width;
const int NewH = pGLayer->m_Height < m_Height + OffsetY ? m_Height + OffsetY : pGLayer->m_Height;
pGLayer->Resize(NewW, NewH);
vpActions.push_back(std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, GameLayerIndex, ETilesProp::PROP_WIDTH, PrevW, NewW));
const std::shared_ptr<CEditorActionEditLayerTilesProp> &Action1 = std::static_pointer_cast<CEditorActionEditLayerTilesProp>(vpActions[vpActions.size() - 1]);
vpActions.push_back(std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, GameLayerIndex, ETilesProp::PROP_HEIGHT, PrevH, NewH));
@ -822,94 +788,124 @@ void CLayerTiles::FillGameTiles(EGameTileOp Fill)
Action1->SetSavedLayers(savedLayers);
Action2->SetSavedLayers(savedLayers);
}
}
std::shared_ptr<CLayerTele> pTLayer = m_pEditor->m_Map.m_pTeleLayer;
int TeleLayerIndex = std::find(m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin(), m_pEditor->m_Map.m_pGameGroup->m_vpLayers.end(), pTLayer) - m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin();
if(pTLayer->m_Width < m_Width + OffsetX || pTLayer->m_Height < m_Height + OffsetY)
{
std::map<int, std::shared_ptr<CLayer>> savedLayers;
savedLayers[LAYERTYPE_TILES] = pTLayer->Duplicate();
savedLayers[LAYERTYPE_TELE] = savedLayers[LAYERTYPE_TILES];
int PrevW = pTLayer->m_Width;
int PrevH = pTLayer->m_Height;
int NewW = pTLayer->m_Width < m_Width + OffsetX ? m_Width + OffsetX : pTLayer->m_Width;
int NewH = pTLayer->m_Height < m_Height + OffsetY ? m_Height + OffsetY : pTLayer->m_Height;
pTLayer->Resize(NewW, NewH);
std::shared_ptr<CEditorActionEditLayerTilesProp> Action1, Action2;
vpActions.push_back(Action1 = std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, TeleLayerIndex, ETilesProp::PROP_WIDTH, PrevW, NewW));
vpActions.push_back(Action2 = std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, TeleLayerIndex, ETilesProp::PROP_HEIGHT, PrevH, NewH));
Action1->SetSavedLayers(savedLayers);
Action2->SetSavedLayers(savedLayers);
}
int Changes = 0;
for(int y = OffsetY < 0 ? -OffsetY : 0; y < m_Height; y++)
{
for(int x = OffsetX < 0 ? -OffsetX : 0; x < m_Width; x++)
int Changes = 0;
for(int y = OffsetY < 0 ? -OffsetY : 0; y < m_Height; y++)
{
if(GetTile(x, y).m_Index)
for(int x = OffsetX < 0 ? -OffsetX : 0; x < m_Width; x++)
{
auto TileIndex = (y + OffsetY) * pTLayer->m_Width + x + OffsetX;
Changes++;
STeleTileStateChange::SData Previous{
pTLayer->m_pTeleTile[TileIndex].m_Number,
pTLayer->m_pTeleTile[TileIndex].m_Type,
pTLayer->m_pTiles[TileIndex].m_Index};
pTLayer->m_pTiles[TileIndex].m_Index = TILE_AIR + Result;
pTLayer->m_pTeleTile[TileIndex].m_Number = 1;
pTLayer->m_pTeleTile[TileIndex].m_Type = TILE_AIR + Result;
STeleTileStateChange::SData Current{
pTLayer->m_pTeleTile[TileIndex].m_Number,
pTLayer->m_pTeleTile[TileIndex].m_Type,
pTLayer->m_pTiles[TileIndex].m_Index};
pTLayer->RecordStateChange(x, y, Previous, Current);
if(GetTile(x, y).m_Index)
{
const CTile ResultTile = {(unsigned char)Result};
pGLayer->SetTile(x + OffsetX, y + OffsetY, ResultTile);
Changes++;
}
}
}
vpActions.push_back(std::make_shared<CEditorBrushDrawAction>(m_pEditor, m_pEditor->m_SelectedGroup));
char aDisplay[256];
str_format(aDisplay, sizeof(aDisplay), "Construct '%s' game tiles (x%d)", s_apGametileOpNames[Selected], Changes);
m_pEditor->m_EditorHistory.RecordAction(std::make_shared<CEditorActionBulk>(m_pEditor, vpActions, aDisplay, true));
}
else
{
if(!m_pEditor->m_Map.m_pTeleLayer)
{
std::shared_ptr<CLayerTele> pLayer = std::make_shared<CLayerTele>(m_pEditor, m_Width, m_Height);
m_pEditor->m_Map.MakeTeleLayer(pLayer);
m_pEditor->m_Map.m_pGameGroup->AddLayer(pLayer);
vpActions.push_back(std::make_shared<CEditorBrushDrawAction>(m_pEditor, m_pEditor->m_SelectedGroup));
char aDisplay[256];
str_format(aDisplay, sizeof(aDisplay), "Construct 'tele' game tiles (x%d)", Changes);
m_pEditor->m_EditorHistory.RecordAction(std::make_shared<CEditorActionBulk>(m_pEditor, vpActions, aDisplay, true));
vpActions.push_back(std::make_shared<CEditorActionAddLayer>(m_pEditor, m_pEditor->m_SelectedGroup, m_pEditor->m_Map.m_pGameGroup->m_vpLayers.size() - 1));
if(m_Width != pGLayer->m_Width || m_Height > pGLayer->m_Height)
{
std::map<int, std::shared_ptr<CLayer>> savedLayers;
savedLayers[LAYERTYPE_TILES] = pGLayer->Duplicate();
savedLayers[LAYERTYPE_GAME] = savedLayers[LAYERTYPE_TILES];
int NewW = pGLayer->m_Width;
int NewH = pGLayer->m_Height;
if(m_Width > pGLayer->m_Width)
{
NewW = m_Width;
}
if(m_Height > pGLayer->m_Height)
{
NewH = m_Height;
}
int PrevW = pGLayer->m_Width;
int PrevH = pGLayer->m_Height;
pLayer->Resize(NewW, NewH);
vpActions.push_back(std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, GameLayerIndex, ETilesProp::PROP_WIDTH, PrevW, NewW));
const std::shared_ptr<CEditorActionEditLayerTilesProp> &Action1 = std::static_pointer_cast<CEditorActionEditLayerTilesProp>(vpActions[vpActions.size() - 1]);
vpActions.push_back(std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, GameLayerIndex, ETilesProp::PROP_HEIGHT, PrevH, NewH));
const std::shared_ptr<CEditorActionEditLayerTilesProp> &Action2 = std::static_pointer_cast<CEditorActionEditLayerTilesProp>(vpActions[vpActions.size() - 1]);
Action1->SetSavedLayers(savedLayers);
Action2->SetSavedLayers(savedLayers);
}
}
std::shared_ptr<CLayerTele> pTLayer = m_pEditor->m_Map.m_pTeleLayer;
int TeleLayerIndex = std::find(m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin(), m_pEditor->m_Map.m_pGameGroup->m_vpLayers.end(), pTLayer) - m_pEditor->m_Map.m_pGameGroup->m_vpLayers.begin();
if(pTLayer->m_Width < m_Width + OffsetX || pTLayer->m_Height < m_Height + OffsetY)
{
std::map<int, std::shared_ptr<CLayer>> savedLayers;
savedLayers[LAYERTYPE_TILES] = pTLayer->Duplicate();
savedLayers[LAYERTYPE_TELE] = savedLayers[LAYERTYPE_TILES];
int PrevW = pTLayer->m_Width;
int PrevH = pTLayer->m_Height;
int NewW = pTLayer->m_Width < m_Width + OffsetX ? m_Width + OffsetX : pTLayer->m_Width;
int NewH = pTLayer->m_Height < m_Height + OffsetY ? m_Height + OffsetY : pTLayer->m_Height;
pTLayer->Resize(NewW, NewH);
std::shared_ptr<CEditorActionEditLayerTilesProp> Action1, Action2;
vpActions.push_back(Action1 = std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, TeleLayerIndex, ETilesProp::PROP_WIDTH, PrevW, NewW));
vpActions.push_back(Action2 = std::make_shared<CEditorActionEditLayerTilesProp>(m_pEditor, m_pEditor->m_SelectedGroup, TeleLayerIndex, ETilesProp::PROP_HEIGHT, PrevH, NewH));
Action1->SetSavedLayers(savedLayers);
Action2->SetSavedLayers(savedLayers);
}
int Changes = 0;
for(int y = OffsetY < 0 ? -OffsetY : 0; y < m_Height; y++)
{
for(int x = OffsetX < 0 ? -OffsetX : 0; x < m_Width; x++)
{
if(GetTile(x, y).m_Index)
{
auto TileIndex = (y + OffsetY) * pTLayer->m_Width + x + OffsetX;
Changes++;
STeleTileStateChange::SData Previous{
pTLayer->m_pTeleTile[TileIndex].m_Number,
pTLayer->m_pTeleTile[TileIndex].m_Type,
pTLayer->m_pTiles[TileIndex].m_Index};
pTLayer->m_pTiles[TileIndex].m_Index = TILE_AIR + Result;
pTLayer->m_pTeleTile[TileIndex].m_Number = 1;
pTLayer->m_pTeleTile[TileIndex].m_Type = TILE_AIR + Result;
STeleTileStateChange::SData Current{
pTLayer->m_pTeleTile[TileIndex].m_Number,
pTLayer->m_pTeleTile[TileIndex].m_Type,
pTLayer->m_pTiles[TileIndex].m_Index};
pTLayer->RecordStateChange(x, y, Previous, Current);
}
}
}
vpActions.push_back(std::make_shared<CEditorBrushDrawAction>(m_pEditor, m_pEditor->m_SelectedGroup));
char aDisplay[256];
str_format(aDisplay, sizeof(aDisplay), "Construct 'tele' game tiles (x%d)", Changes);
m_pEditor->m_EditorHistory.RecordAction(std::make_shared<CEditorActionBulk>(m_pEditor, vpActions, aDisplay, true));
}
}
}
}
bool CLayerTiles::CanFillGameTiles() const
{
const bool EntitiesLayer = IsEntitiesLayer();
if(EntitiesLayer)
return false;
std::shared_ptr<CLayerGroup> pGroup = m_pEditor->m_Map.m_vpGroups[m_pEditor->m_SelectedGroup];
// Game tiles can only be constructed if the layer is relative to the game layer
return !(pGroup->m_OffsetX % 32) && !(pGroup->m_OffsetY % 32) && pGroup->m_ParallaxX == 100 && pGroup->m_ParallaxY == 100;
}
CUi::EPopupMenuFunctionResult CLayerTiles::RenderProperties(CUIRect *pToolBox)
{
CUIRect Button;
const bool EntitiesLayer = IsEntitiesLayer();
if(CanFillGameTiles())
{
pToolBox->HSplitBottom(12.0f, pToolBox, &Button);
static int s_GameTilesButton = 0;
if(m_pEditor->DoButton_Editor(&s_GameTilesButton, "Game tiles", 0, &Button, 0, "Constructs game tiles from this layer"))
m_pEditor->PopupSelectGametileOpInvoke(m_pEditor->Ui()->MouseX(), m_pEditor->Ui()->MouseY());
const int Selected = m_pEditor->PopupSelectGameTileOpResult();
FillGameTiles((EGameTileOp)Selected);
}
if(m_pEditor->m_Map.m_pGameLayer.get() != this)
{

View file

@ -2,7 +2,6 @@
#define GAME_EDITOR_MAPITEMS_LAYER_TILES_H
#include <game/editor/editor_trackers.h>
#include <game/editor/enums.h>
#include <map>
#include "layer.h"
@ -123,8 +122,6 @@ public:
void BrushSelecting(CUIRect Rect) override;
int BrushGrab(std::shared_ptr<CLayerGroup> pBrush, CUIRect Rect) override;
void FillSelection(bool Empty, std::shared_ptr<CLayer> pBrush, CUIRect Rect) override;
void FillGameTiles(EGameTileOp Fill);
bool CanFillGameTiles() const;
void BrushDraw(std::shared_ptr<CLayer> pBrush, float wx, float wy) override;
void BrushFlipX() override;
void BrushFlipY() override;

View file

@ -68,9 +68,17 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
View.HSplitTop(2.0f, nullptr, &View);
View.HSplitTop(12.0f, &Slot, &View);
if(pEditor->DoButton_MenuItem(&s_OpenCurrentMapButton, pEditor->m_QuickActionLoadCurrentMap.Label(), 0, &Slot, 0, pEditor->m_QuickActionLoadCurrentMap.Description()))
if(pEditor->DoButton_MenuItem(&s_OpenCurrentMapButton, "Load Current Map", 0, &Slot, 0, "Opens the current in game map for editing (ctrl+alt+l)"))
{
pEditor->m_QuickActionLoadCurrentMap.Call();
if(pEditor->HasUnsavedData())
{
pEditor->m_PopupEventType = POPEVENT_LOADCURRENT;
pEditor->m_PopupEventActivated = true;
}
else
{
pEditor->LoadCurrentMap();
}
return CUi::POPUP_CLOSE_CURRENT;
}
@ -99,9 +107,9 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuFile(void *pContext, CUIRect Vie
View.HSplitTop(2.0f, nullptr, &View);
View.HSplitTop(12.0f, &Slot, &View);
if(pEditor->DoButton_MenuItem(&s_SaveAsButton, pEditor->m_QuickActionSaveAs.Label(), 0, &Slot, 0, pEditor->m_QuickActionSaveAs.Description()))
if(pEditor->DoButton_MenuItem(&s_SaveAsButton, "Save As", 0, &Slot, 0, "Saves the current map under a new name (ctrl+shift+s)"))
{
pEditor->m_QuickActionSaveAs.Call();
pEditor->InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save", "maps", true, CEditor::CallbackSaveMap, pEditor);
return CUi::POPUP_CLOSE_CURRENT;
}
@ -306,20 +314,20 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect
static int s_ButtonOff = 0;
static int s_ButtonDec = 0;
static int s_ButtonHex = 0;
CQuickAction *pAction = &pEditor->m_QuickActionShowInfoOff;
if(pEditor->DoButton_Ex(&s_ButtonOff, pAction->LabelShort(), pAction->Active(), &Off, 0, pAction->Description(), IGraphics::CORNER_L))
if(pEditor->DoButton_Ex(&s_ButtonOff, "Off", pEditor->m_ShowTileInfo == SHOW_TILE_OFF, &Off, 0, "Do not show tile information", IGraphics::CORNER_L))
{
pAction->Call();
pEditor->m_ShowTileInfo = SHOW_TILE_OFF;
pEditor->m_ShowEnvelopePreview = SHOWENV_NONE;
}
pAction = &pEditor->m_QuickActionShowInfoDec;
if(pEditor->DoButton_Ex(&s_ButtonDec, pAction->LabelShort(), pAction->Active(), &Dec, 0, pAction->Description(), IGraphics::CORNER_NONE))
if(pEditor->DoButton_Ex(&s_ButtonDec, "Dec", pEditor->m_ShowTileInfo == SHOW_TILE_DECIMAL, &Dec, 0, "[ctrl+i] Show tile information", IGraphics::CORNER_NONE))
{
pAction->Call();
pEditor->m_ShowTileInfo = SHOW_TILE_DECIMAL;
pEditor->m_ShowEnvelopePreview = SHOWENV_NONE;
}
pAction = &pEditor->m_QuickActionShowInfoHex;
if(pEditor->DoButton_Ex(&s_ButtonHex, pAction->LabelShort(), pAction->Active(), &Hex, 0, pAction->Description(), IGraphics::CORNER_R))
if(pEditor->DoButton_Ex(&s_ButtonHex, "Hex", pEditor->m_ShowTileInfo == SHOW_TILE_HEXADECIMAL, &Hex, 0, "[ctrl+shift+i] Show tile information in hexadecimal", IGraphics::CORNER_R))
{
pAction->Call();
pEditor->m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
pEditor->m_ShowEnvelopePreview = SHOWENV_NONE;
}
}
@ -371,30 +379,6 @@ CUi::EPopupMenuFunctionResult CEditor::PopupMenuSettings(void *pContext, CUIRect
}
}
View.HSplitTop(2.0f, nullptr, &View);
View.HSplitTop(12.0f, &Slot, &View);
{
Slot.VMargin(5.0f, &Slot);
CUIRect Label, Selector;
Slot.VSplitMid(&Label, &Selector);
CUIRect No, Yes;
Selector.VSplitMid(&No, &Yes);
pEditor->Ui()->DoLabel(&Label, "Auto map reload", 10.0f, TEXTALIGN_ML);
static int s_ButtonNo = 0;
static int s_ButtonYes = 0;
if(pEditor->DoButton_Ex(&s_ButtonNo, "No", !g_Config.m_EdAutoMapReload, &No, 0, "Do not run 'hot_reload' on the local server while rcon authed on map save", IGraphics::CORNER_L))
{
g_Config.m_EdAutoMapReload = false;
}
if(pEditor->DoButton_Ex(&s_ButtonYes, "Yes", g_Config.m_EdAutoMapReload, &Yes, 0, "Run 'hot_reload' on the local server while rcon authed on map save", IGraphics::CORNER_R))
{
g_Config.m_EdAutoMapReload = true;
}
}
return CUi::POPUP_KEEP_OPEN;
}
@ -594,9 +578,16 @@ CUi::EPopupMenuFunctionResult CEditor::PopupGroup(void *pContext, CUIRect View,
// new tile layer
View.HSplitBottom(5.0f, &View, nullptr);
View.HSplitBottom(12.0f, &View, &Button);
if(pEditor->DoButton_Editor(&pEditor->m_QuickActionAddTileLayer, pEditor->m_QuickActionAddTileLayer.Label(), 0, &Button, 0, pEditor->m_QuickActionAddTileLayer.Description()))
static int s_NewTileLayerButton = 0;
if(pEditor->DoButton_Editor(&s_NewTileLayerButton, "Add tile layer", 0, &Button, 0, "Creates a new tile layer"))
{
pEditor->m_QuickActionAddTileLayer.Call();
std::shared_ptr<CLayer> pTileLayer = std::make_shared<CLayerTiles>(pEditor, pEditor->m_Map.m_pGameLayer->m_Width, pEditor->m_Map.m_pGameLayer->m_Height);
pTileLayer->m_pEditor = pEditor;
pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->AddLayer(pTileLayer);
int LayerIndex = pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_vpLayers.size() - 1;
pEditor->SelectLayer(LayerIndex);
pEditor->m_Map.m_vpGroups[pEditor->m_SelectedGroup]->m_Collapse = false;
pEditor->m_EditorHistory.RecordAction(std::make_shared<CEditorActionAddLayer>(pEditor, pEditor->m_SelectedGroup, LayerIndex));
return CUi::POPUP_CLOSE_CURRENT;
}

View file

@ -1,172 +0,0 @@
#include <engine/keys.h>
#include <game/client/ui_listbox.h>
#include <game/editor/quick_action.h>
#include "editor.h"
#include "prompt.h"
bool FuzzyMatch(const char *pHaystack, const char *pNeedle)
{
if(!pNeedle || !pNeedle[0])
return false;
char aBuf[2] = {0};
const char *pHit = pHaystack;
int NeedleLen = str_length(pNeedle);
for(int i = 0; i < NeedleLen; i++)
{
if(!pHit)
return false;
aBuf[0] = pNeedle[i];
pHit = str_find_nocase(pHit, aBuf);
if(pHit)
pHit++;
}
return pHit;
}
bool CPrompt::IsActive()
{
return CEditorComponent::IsActive() || Editor()->m_Dialog == DIALOG_QUICK_PROMPT;
}
void CPrompt::SetActive()
{
Editor()->m_Dialog = DIALOG_QUICK_PROMPT;
CEditorComponent::SetActive();
Ui()->SetActiveItem(&m_PromptInput);
}
void CPrompt::SetInactive()
{
m_ResetFilterResults = true;
m_PromptInput.Clear();
if(Editor()->m_Dialog == DIALOG_QUICK_PROMPT)
Editor()->m_Dialog = DIALOG_NONE;
CEditorComponent::SetInactive();
}
bool CPrompt::OnInput(const IInput::CEvent &Event)
{
if(Input()->ModifierIsPressed() && Input()->KeyIsPressed(KEY_P))
{
SetActive();
}
return false;
}
void CPrompt::OnInit(CEditor *pEditor)
{
CEditorComponent::OnInit(pEditor);
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description) m_vQuickActions.emplace_back(&Editor()->m_QuickAction##name);
#include <game/editor/quick_actions.h>
#undef REGISTER_QUICK_ACTION
}
void CPrompt::OnRender(CUIRect _)
{
if(!IsActive())
return;
if(Ui()->ConsumeHotkey(CUi::HOTKEY_ESCAPE))
{
SetInactive();
return;
}
static CListBox s_ListBox;
CUIRect Prompt, PromptBox;
CUIRect Suggestions;
Ui()->MapScreen();
CUIRect Overlay = *Ui()->Screen();
Overlay.Draw(ColorRGBA(0, 0, 0, 0.33f), IGraphics::CORNER_NONE, 0.0f);
CUIRect Background;
Overlay.VMargin(150.0f, &Background);
Background.HMargin(50.0f, &Background);
Background.Draw(ColorRGBA(0, 0, 0, 0.80f), IGraphics::CORNER_ALL, 5.0f);
Background.Margin(10.0f, &Prompt);
Prompt.VSplitMid(nullptr, &PromptBox);
Prompt.HSplitTop(16.0f, &PromptBox, &Suggestions);
PromptBox.Draw(ColorRGBA(0, 0, 0, 0.75f), IGraphics::CORNER_ALL, 2.0f);
Suggestions.y += 6.0f;
if(Ui()->DoClearableEditBox(&m_PromptInput, &PromptBox, 10.0f) || m_ResetFilterResults)
{
m_PromptSelectedIndex = 0;
m_vpFilteredPromptList.clear();
if(m_ResetFilterResults && m_pLastAction && !m_pLastAction->Disabled())
{
m_vpFilteredPromptList.push_back(m_pLastAction);
}
for(auto *pQuickAction : m_vQuickActions)
{
if(pQuickAction->Disabled())
continue;
if(m_PromptInput.IsEmpty() || FuzzyMatch(pQuickAction->Label(), m_PromptInput.GetString()))
{
bool Skip = false;
if(m_ResetFilterResults)
if(pQuickAction == m_pLastAction)
Skip = true;
if(!Skip)
m_vpFilteredPromptList.push_back(pQuickAction);
}
}
m_ResetFilterResults = false;
}
s_ListBox.SetActive(!Ui()->IsPopupOpen());
s_ListBox.DoStart(15.0f, m_vpFilteredPromptList.size(), 1, 5, m_PromptSelectedIndex, &Suggestions, false);
float LabelWidth = Overlay.w > 855.0f ? 200.0f : 100.0f;
for(size_t i = 0; i < m_vpFilteredPromptList.size(); i++)
{
const CListboxItem Item = s_ListBox.DoNextItem(m_vpFilteredPromptList[i], m_PromptSelectedIndex >= 0 && (size_t)m_PromptSelectedIndex == i);
if(!Item.m_Visible)
continue;
CUIRect LabelColumn, DescColumn;
float Margin = 5.0f;
Item.m_Rect.VSplitLeft(Margin, nullptr, &LabelColumn);
LabelColumn.VSplitLeft(LabelWidth, &LabelColumn, &DescColumn);
DescColumn.VSplitRight(Margin, &DescColumn, nullptr);
SLabelProperties Props;
Props.m_MaxWidth = LabelColumn.w;
Props.m_EllipsisAtEnd = true;
Ui()->DoLabel(&LabelColumn, m_vpFilteredPromptList[i]->Label(), 10.0f, TEXTALIGN_ML, Props);
Props.m_MaxWidth = DescColumn.w;
ColorRGBA DescColor = TextRender()->DefaultTextColor();
DescColor.a = Item.m_Selected ? 1.0f : 0.8f;
TextRender()->TextColor(DescColor);
Ui()->DoLabel(&DescColumn, m_vpFilteredPromptList[i]->Description(), 10.0f, TEXTALIGN_MR, Props);
TextRender()->TextColor(TextRender()->DefaultTextColor());
}
const int NewSelected = s_ListBox.DoEnd();
if(m_PromptSelectedIndex != NewSelected)
{
m_PromptSelectedIndex = NewSelected;
}
if(s_ListBox.WasItemActivated())
{
if(m_PromptSelectedIndex >= 0)
{
CQuickAction *pBtn = m_vpFilteredPromptList[m_PromptSelectedIndex];
SetInactive();
pBtn->Call();
m_pLastAction = pBtn;
}
}
}

View file

@ -1,29 +0,0 @@
#ifndef GAME_EDITOR_PROMPT_H
#define GAME_EDITOR_PROMPT_H
#include <game/client/lineinput.h>
#include <game/client/ui_rect.h>
#include <game/editor/quick_action.h>
#include "component.h"
class CPrompt : public CEditorComponent
{
bool m_ResetFilterResults = true;
CQuickAction *m_pLastAction = nullptr;
int m_PromptSelectedIndex = -1;
std::vector<CQuickAction *> m_vpFilteredPromptList;
std::vector<CQuickAction *> m_vQuickActions;
CLineInputBuffered<512> m_PromptInput;
public:
void OnInit(CEditor *pEditor) override;
bool OnInput(const IInput::CEvent &Event) override;
void OnRender(CUIRect _) override;
bool IsActive();
void SetActive();
void SetInactive();
};
#endif

View file

@ -1,69 +0,0 @@
#ifndef GAME_EDITOR_QUICK_ACTION_H
#define GAME_EDITOR_QUICK_ACTION_H
#include <functional>
#include <utility>
typedef std::function<void()> FButtonClickCallback;
typedef std::function<bool()> FButtonDisabledCallback;
typedef std::function<bool()> FButtonActiveCallback;
typedef std::function<int()> FButtonColorCallback;
class CQuickAction
{
private:
const char *m_pLabel;
const char *m_pDescription;
FButtonClickCallback m_pfnCallback;
FButtonDisabledCallback m_pfnDisabledCallback;
FButtonActiveCallback m_pfnActiveCallback;
FButtonColorCallback m_pfnColorCallback;
public:
CQuickAction(
const char *pLabel,
const char *pDescription,
FButtonClickCallback pfnCallback,
FButtonDisabledCallback pfnDisabledCallback,
FButtonActiveCallback pfnActiveCallback,
FButtonColorCallback pfnColorCallback) :
m_pLabel(pLabel),
m_pDescription(pDescription),
m_pfnCallback(std::move(pfnCallback)),
m_pfnDisabledCallback(std::move(pfnDisabledCallback)),
m_pfnActiveCallback(std::move(pfnActiveCallback)),
m_pfnColorCallback(std::move(pfnColorCallback))
{
}
// code to run when the action is triggered
void Call() const { m_pfnCallback(); }
// bool that indicates if the action can be performed not or not
bool Disabled() { return m_pfnDisabledCallback(); }
// bool that indicates if the action is currently running
// only applies to actions that can be turned on or off like proof borders
bool Active() { return m_pfnActiveCallback(); }
// color "enum" that represents the state of the quick actions button
// used as Checked argument for DoButton_Editor()
int Color() { return m_pfnColorCallback(); }
const char *Label() const { return m_pLabel; }
// skips to the part of the label after the first colon
// useful for buttons that only show the state
const char *LabelShort() const
{
const char *pShort = str_find(m_pLabel, ": ");
if(!pShort)
return m_pLabel;
return pShort + 2;
}
const char *Description() const { return m_pDescription; }
};
#endif

View file

@ -1,71 +0,0 @@
#include <game/mapitems.h>
#include "editor.h"
#include "editor_actions.h"
void CEditor::FillGameTiles(EGameTileOp FillTile) const
{
std::shared_ptr<CLayerTiles> pTileLayer = std::static_pointer_cast<CLayerTiles>(GetSelectedLayerType(0, LAYERTYPE_TILES));
if(pTileLayer)
pTileLayer->FillGameTiles(FillTile);
}
bool CEditor::CanFillGameTiles() const
{
std::shared_ptr<CLayerTiles> pTileLayer = std::static_pointer_cast<CLayerTiles>(GetSelectedLayerType(0, LAYERTYPE_TILES));
if(pTileLayer)
return pTileLayer->CanFillGameTiles();
return false;
}
void CEditor::AddGroup()
{
m_Map.NewGroup();
m_SelectedGroup = m_Map.m_vpGroups.size() - 1;
m_EditorHistory.RecordAction(std::make_shared<CEditorActionGroup>(this, m_SelectedGroup, false));
}
void CEditor::AddTileLayer()
{
std::shared_ptr<CLayer> pTileLayer = std::make_shared<CLayerTiles>(this, m_Map.m_pGameLayer->m_Width, m_Map.m_pGameLayer->m_Height);
pTileLayer->m_pEditor = this;
m_Map.m_vpGroups[m_SelectedGroup]->AddLayer(pTileLayer);
int LayerIndex = m_Map.m_vpGroups[m_SelectedGroup]->m_vpLayers.size() - 1;
SelectLayer(LayerIndex);
m_Map.m_vpGroups[m_SelectedGroup]->m_Collapse = false;
m_EditorHistory.RecordAction(std::make_shared<CEditorActionAddLayer>(this, m_SelectedGroup, LayerIndex));
}
bool CEditor::IsNonGameTileLayerSelected() const
{
std::shared_ptr<CLayer> pLayer = GetSelectedLayer(0);
if(!pLayer)
return false;
if(pLayer->m_Type != LAYERTYPE_TILES)
return false;
if(
pLayer == m_Map.m_pGameLayer ||
pLayer == m_Map.m_pFrontLayer ||
pLayer == m_Map.m_pSwitchLayer ||
pLayer == m_Map.m_pTeleLayer ||
pLayer == m_Map.m_pSpeedupLayer ||
pLayer == m_Map.m_pTuneLayer)
return false;
return true;
}
void CEditor::LayerSelectImage()
{
if(!IsNonGameTileLayerSelected())
return;
std::shared_ptr<CLayer> pLayer = GetSelectedLayer(0);
std::shared_ptr<CLayerTiles> pTiles = std::static_pointer_cast<CLayerTiles>(pLayer);
static SLayerPopupContext s_LayerPopupContext = {};
s_LayerPopupContext.m_pEditor = this;
Ui()->DoPopupMenu(&s_LayerPopupContext, Ui()->MouseX(), Ui()->MouseY(), 120, 270, &s_LayerPopupContext, PopupLayer);
PopupSelectImageInvoke(pTiles->m_Image, Ui()->MouseX(), Ui()->MouseY());
}

View file

@ -1,281 +0,0 @@
// This file can be included several times.
#ifndef REGISTER_QUICK_ACTION
#define REGISTER_QUICK_ACTION(name, text, callback, disabled, active, button_color, description)
#endif
#define ALWAYS_FALSE []() -> bool { return false; }
#define DEFAULT_BTN []() -> int { return -1; }
REGISTER_QUICK_ACTION(
ToggleGrid,
"Toggle Grid",
[&]() { MapView()->MapGrid()->Toggle(); },
ALWAYS_FALSE,
[&]() -> bool { return MapView()->MapGrid()->IsEnabled(); },
DEFAULT_BTN,
"[Ctrl+G] Toggle Grid.")
REGISTER_QUICK_ACTION(
GameTilesAir,
"Game tiles: Air",
[&]() { FillGameTiles(EGameTileOp::AIR); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesHookable,
"Game tiles: Hookable",
[&]() { FillGameTiles(EGameTileOp::HOOKABLE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesDeath,
"Game tiles: Death",
[&]() { FillGameTiles(EGameTileOp::DEATH); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesUnhookable,
"Game tiles: Unhookable",
[&]() { FillGameTiles(EGameTileOp::UNHOOKABLE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesHookthrough,
"Game tiles: Hookthrough",
[&]() { FillGameTiles(EGameTileOp::HOOKTHROUGH); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesFreeze,
"Game tiles: Freeze",
[&]() { FillGameTiles(EGameTileOp::FREEZE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesUnfreeze,
"Game tiles: Unfreeze",
[&]() { FillGameTiles(EGameTileOp::UNFREEZE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesDeepFreeze,
"Game tiles: Deep Freeze",
[&]() { FillGameTiles(EGameTileOp::DEEP_FREEZE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesDeepUnfreeze,
"Game tiles: Deep Unfreeze",
[&]() { FillGameTiles(EGameTileOp::DEEP_UNFREEZE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesBlueCheckTele,
"Game tiles: Blue Check Tele",
[&]() { FillGameTiles(EGameTileOp::BLUE_CHECK_TELE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesRedCheckTele,
"Game tiles: Red Check Tele",
[&]() { FillGameTiles(EGameTileOp::RED_CHECK_TELE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesLiveFreeze,
"Game tiles: Live Freeze",
[&]() { FillGameTiles(EGameTileOp::LIVE_FREEZE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
GameTilesLiveUnfreeze,
"Game tiles: Live Unfreeze",
[&]() { FillGameTiles(EGameTileOp::LIVE_UNFREEZE); },
[&]() -> bool { return !CanFillGameTiles(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Constructs game tiles from this layer.")
REGISTER_QUICK_ACTION(
AddGroup,
"Add group",
[&]() { AddGroup(); },
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"Adds a new group.")
REGISTER_QUICK_ACTION(
ResetZoom,
"Reset Zoom",
[&]() { MapView()->ResetZoom(); },
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"[Numpad*] Zoom to normal and remove editor offset.")
REGISTER_QUICK_ACTION(
ZoomOut,
"Zoom Out",
[&]() { MapView()->Zoom()->ChangeValue(50.0f); },
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"[Numpad-] Zoom out.")
REGISTER_QUICK_ACTION(
ZoomIn,
"Zoom In",
[&]() { MapView()->Zoom()->ChangeValue(-50.0f); },
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"[Numpad+] Zoom in.")
REGISTER_QUICK_ACTION(
Refocus,
"Refocus",
[&]() { MapView()->Focus(); },
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"[Home] Restore map focus.")
REGISTER_QUICK_ACTION(
Proof,
"Proof",
[&]() { MapView()->ProofMode()->Toggle(); },
ALWAYS_FALSE,
[&]() -> bool { return MapView()->ProofMode()->IsEnabled(); },
DEFAULT_BTN,
"Toggles proof borders. These borders represent the area that a player can see with default zoom.")
REGISTER_QUICK_ACTION(
AddTileLayer, "Add tile layer", [&]() { AddTileLayer(); }, ALWAYS_FALSE, ALWAYS_FALSE, DEFAULT_BTN, "Creates a new tile layer.")
REGISTER_QUICK_ACTION(
SaveAs,
"Save As",
[&]() { InvokeFileDialog(IStorage::TYPE_SAVE, FILETYPE_MAP, "Save map", "Save As", "maps", true, CEditor::CallbackSaveMap, this); },
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"[Ctrl+Shift+S] Saves the current map under a new name.")
REGISTER_QUICK_ACTION(
LoadCurrentMap,
"Load Current Map",
[&]() {
if(HasUnsavedData())
{
m_PopupEventType = POPEVENT_LOADCURRENT;
m_PopupEventActivated = true;
}
else
{
LoadCurrentMap();
}
},
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"[Ctrl+Alt+L] Opens the current in game map for editing.")
REGISTER_QUICK_ACTION(
Envelopes,
"Envelopes",
[&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES ? EXTRAEDITOR_NONE : EXTRAEDITOR_ENVELOPES; },
ALWAYS_FALSE,
ALWAYS_FALSE,
[&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_ENVELOPES; },
"Toggles the envelope editor.")
REGISTER_QUICK_ACTION(
ServerSettings,
"Server settings",
[&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS ? EXTRAEDITOR_NONE : EXTRAEDITOR_SERVER_SETTINGS; },
ALWAYS_FALSE,
ALWAYS_FALSE,
[&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_SERVER_SETTINGS; },
"Toggles the server settings editor.")
REGISTER_QUICK_ACTION(
History,
"History",
[&]() { m_ActiveExtraEditor = m_ActiveExtraEditor == EXTRAEDITOR_HISTORY ? EXTRAEDITOR_NONE : EXTRAEDITOR_HISTORY; },
ALWAYS_FALSE,
ALWAYS_FALSE,
[&]() -> int { return m_ShowPicker ? -1 : m_ActiveExtraEditor == EXTRAEDITOR_HISTORY; },
"Toggles the editor history view.")
REGISTER_QUICK_ACTION(
AddImage,
"Add Image",
[&]() { InvokeFileDialog(IStorage::TYPE_ALL, FILETYPE_IMG, "Add Image", "Add", "mapres", false, AddImage, this); },
ALWAYS_FALSE,
ALWAYS_FALSE,
DEFAULT_BTN,
"Load a new image to use in the map.")
REGISTER_QUICK_ACTION(
LayerPropAddImage,
"Layer: Add Image",
[&]() { LayerSelectImage(); },
[&]() -> bool { return !IsNonGameTileLayerSelected(); },
ALWAYS_FALSE,
DEFAULT_BTN,
"Pick mapres image for currently selected layer.")
REGISTER_QUICK_ACTION(
ShowInfoOff,
"Show Info: Off",
[&]() {
m_ShowTileInfo = SHOW_TILE_OFF;
m_ShowEnvelopePreview = SHOWENV_NONE;
},
ALWAYS_FALSE,
[&]() -> bool { return m_ShowTileInfo == SHOW_TILE_OFF; },
DEFAULT_BTN,
"Do not show tile information.")
REGISTER_QUICK_ACTION(
ShowInfoDec,
"Show Info: Dec",
[&]() {
m_ShowTileInfo = SHOW_TILE_DECIMAL;
m_ShowEnvelopePreview = SHOWENV_NONE;
},
ALWAYS_FALSE,
[&]() -> bool { return m_ShowTileInfo == SHOW_TILE_DECIMAL; },
DEFAULT_BTN,
"[Ctrl+I] Show tile information.")
REGISTER_QUICK_ACTION(
ShowInfoHex,
"Show Info: Hex",
[&]() {
m_ShowTileInfo = SHOW_TILE_HEXADECIMAL;
m_ShowEnvelopePreview = SHOWENV_NONE;
},
ALWAYS_FALSE,
[&]() -> bool { return m_ShowTileInfo == SHOW_TILE_HEXADECIMAL; },
DEFAULT_BTN,
"[Ctrl+Shift+I] Show tile information in hexadecimal.")
REGISTER_QUICK_ACTION(
Pipette,
"Pipette",
[&]() { m_ColorPipetteActive = !m_ColorPipetteActive; },
ALWAYS_FALSE,
[&]() -> bool { return m_ColorPipetteActive; },
DEFAULT_BTN,
"[Ctrl+Shift+C] Color pipette. Pick a color from the screen by clicking on it.")
#undef ALWAYS_FALSE
#undef DEFAULT_BTN

View file

@ -565,7 +565,7 @@ void CGameContext::ConMapInfo(IConsole::IResult *pResult, void *pUserData)
if(pResult->NumArguments() > 0)
pSelf->Score()->MapInfo(pResult->m_ClientId, pResult->GetString(0));
else
pSelf->Score()->MapInfo(pResult->m_ClientId, pSelf->Server()->GetMapName());
pSelf->Score()->MapInfo(pResult->m_ClientId, g_Config.m_SvMap);
}
void CGameContext::ConTimeout(IConsole::IResult *pResult, void *pUserData)

View file

@ -103,35 +103,6 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
TrySetRescue(RESCUEMODE_MANUAL);
Server()->StartRecord(m_pPlayer->GetCid());
int Team = GameServer()->m_aTeamMapping[m_pPlayer->GetCid()];
if(Team != -1)
{
GameServer()->m_pController->Teams().SetForceCharacterTeam(m_pPlayer->GetCid(), Team);
GameServer()->m_aTeamMapping[m_pPlayer->GetCid()] = -1;
if(GameServer()->m_apSavedTeams[Team])
{
GameServer()->m_apSavedTeams[Team]->Load(GameServer(), Team, true, true);
delete GameServer()->m_apSavedTeams[Team];
GameServer()->m_apSavedTeams[Team] = nullptr;
}
if(GameServer()->m_apSavedTees[m_pPlayer->GetCid()])
{
GameServer()->m_apSavedTees[m_pPlayer->GetCid()]->Load(m_pPlayer->GetCharacter(), Team);
delete GameServer()->m_apSavedTees[m_pPlayer->GetCid()];
GameServer()->m_apSavedTees[m_pPlayer->GetCid()] = nullptr;
}
if(GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()])
{
m_pPlayer->m_LastTeleTee = *GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()];
delete GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()];
GameServer()->m_apSavedTeleTees[m_pPlayer->GetCid()] = nullptr;
}
}
return true;
}
@ -241,7 +212,11 @@ void CCharacter::HandleJetpack()
{
if(m_Core.m_Jetpack)
{
float Strength = GetTuning(m_TuneZone)->m_JetpackStrength;
float Strength;
if(!m_TuneZone)
Strength = Tuning()->m_JetpackStrength;
else
Strength = TuningList()[m_TuneZone].m_JetpackStrength;
TakeDamage(Direction * -1.0f * (Strength / 100.0f / 6.11f), 0, m_pPlayer->GetCid(), m_Core.m_ActiveWeapon);
}
}
@ -267,7 +242,7 @@ void CCharacter::HandleNinja()
GameServer()->CreateDamageInd(m_Pos, 0, NinjaTime / Server()->TickSpeed(), TeamMask() & GameServer()->ClientsMaskExcludeClientVersionAndHigher(VERSION_DDNET_NEW_HUD));
}
GameServer()->m_pController->SetArmorProgress(this, NinjaTime);
m_Armor = clamp(10 - (NinjaTime / 15), 0, 10);
// force ninja Weapon
SetWeapon(WEAPON_NINJA);
@ -285,9 +260,12 @@ void CCharacter::HandleNinja()
// Set velocity
m_Core.m_Vel = m_Core.m_Ninja.m_ActivationDir * g_pData->m_Weapons.m_Ninja.m_Velocity;
vec2 OldPos = m_Pos;
vec2 GroundElasticity = vec2(
GetTuning(m_TuneZone)->m_GroundElasticityX,
GetTuning(m_TuneZone)->m_GroundElasticityY);
vec2 GroundElasticity;
if(!m_TuneZone)
GroundElasticity = vec2(Tuning()->m_GroundElasticityX, Tuning()->m_GroundElasticityY);
else
GroundElasticity = vec2(TuningList()[m_TuneZone].m_GroundElasticityX, TuningList()[m_TuneZone].m_GroundElasticityY);
Collision()->MoveBox(&m_Core.m_Pos, &m_Core.m_Vel, vec2(GetProximityRadius(), GetProximityRadius()), GroundElasticity);
@ -449,7 +427,7 @@ void CCharacter::FireWeapon()
if(m_PainSoundTimer <= 0 && !(m_LatestPrevInput.m_Fire & 1))
{
m_PainSoundTimer = 1 * Server()->TickSpeed();
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_PAIN_LONG, TeamMask()); // NOLINT(clang-analyzer-unix.Malloc)
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_PAIN_LONG, TeamMask());
}
return;
}
@ -466,7 +444,7 @@ void CCharacter::FireWeapon()
{
// reset objects Hit
m_NumObjectsHit = 0;
GameServer()->CreateSound(m_Pos, SOUND_HAMMER_FIRE, TeamMask()); // NOLINT(clang-analyzer-unix.Malloc)
GameServer()->CreateSound(m_Pos, SOUND_HAMMER_FIRE, TeamMask());
Antibot()->OnHammerFire(m_pPlayer->GetCid());
@ -498,7 +476,11 @@ void CCharacter::FireWeapon()
else
Dir = vec2(0.f, -1.f);
float Strength = GetTuning(m_TuneZone)->m_HammerStrength;
float Strength;
if(!m_TuneZone)
Strength = Tuning()->m_HammerStrength;
else
Strength = TuningList()[m_TuneZone].m_HammerStrength;
vec2 Temp = pTarget->m_Core.m_Vel + normalize(Dir + vec2(0.f, -1.1f)) * 10.0f;
Temp = ClampVel(pTarget->m_MoveRestrictions, Temp);
@ -518,7 +500,11 @@ void CCharacter::FireWeapon()
// if we Hit anything, we have to wait for the reload
if(Hits)
{
float FireDelay = GetTuning(m_TuneZone)->m_HammerHitFireDelay;
float FireDelay;
if(!m_TuneZone)
FireDelay = Tuning()->m_HammerHitFireDelay;
else
FireDelay = TuningList()[m_TuneZone].m_HammerHitFireDelay;
m_ReloadTimer = FireDelay * Server()->TickSpeed() / 1000;
}
}
@ -528,7 +514,11 @@ void CCharacter::FireWeapon()
{
if(!m_Core.m_Jetpack || !m_pPlayer->m_NinjaJetpack || m_Core.m_HasTelegunGun)
{
int Lifetime = (int)(Server()->TickSpeed() * GetTuning(m_TuneZone)->m_GunLifetime);
int Lifetime;
if(!m_TuneZone)
Lifetime = (int)(Server()->TickSpeed() * Tuning()->m_GunLifetime);
else
Lifetime = (int)(Server()->TickSpeed() * TuningList()[m_TuneZone].m_GunLifetime);
new CProjectile(
GameWorld(),
@ -550,7 +540,11 @@ void CCharacter::FireWeapon()
case WEAPON_SHOTGUN:
{
float LaserReach = GetTuning(m_TuneZone)->m_LaserReach;
float LaserReach;
if(!m_TuneZone)
LaserReach = Tuning()->m_LaserReach;
else
LaserReach = TuningList()[m_TuneZone].m_LaserReach;
new CLaser(&GameServer()->m_World, m_Pos, Direction, LaserReach, m_pPlayer->GetCid(), WEAPON_SHOTGUN);
GameServer()->CreateSound(m_Pos, SOUND_SHOTGUN_FIRE, TeamMask()); // NOLINT(clang-analyzer-unix.Malloc)
@ -559,7 +553,11 @@ void CCharacter::FireWeapon()
case WEAPON_GRENADE:
{
int Lifetime = (int)(Server()->TickSpeed() * GetTuning(m_TuneZone)->m_GrenadeLifetime);
int Lifetime;
if(!m_TuneZone)
Lifetime = (int)(Server()->TickSpeed() * Tuning()->m_GrenadeLifetime);
else
Lifetime = (int)(Server()->TickSpeed() * TuningList()[m_TuneZone].m_GrenadeLifetime);
new CProjectile(
GameWorld(),
@ -574,13 +572,17 @@ void CCharacter::FireWeapon()
MouseTarget // MouseTarget
);
GameServer()->CreateSound(m_Pos, SOUND_GRENADE_FIRE, TeamMask()); // NOLINT(clang-analyzer-unix.Malloc)
GameServer()->CreateSound(m_Pos, SOUND_GRENADE_FIRE, TeamMask());
}
break;
case WEAPON_LASER:
{
float LaserReach = GetTuning(m_TuneZone)->m_LaserReach;
float LaserReach;
if(!m_TuneZone)
LaserReach = Tuning()->m_LaserReach;
else
LaserReach = TuningList()[m_TuneZone].m_LaserReach;
new CLaser(GameWorld(), m_Pos, Direction, LaserReach, m_pPlayer->GetCid(), WEAPON_LASER);
GameServer()->CreateSound(m_Pos, SOUND_LASER_FIRE, TeamMask()); // NOLINT(clang-analyzer-unix.Malloc)
@ -596,7 +598,7 @@ void CCharacter::FireWeapon()
m_Core.m_Ninja.m_CurrentMoveTime = g_pData->m_Weapons.m_Ninja.m_Movetime * Server()->TickSpeed() / 1000;
m_Core.m_Ninja.m_OldVelAmount = length(m_Core.m_Vel);
GameServer()->CreateSound(m_Pos, SOUND_NINJA_FIRE, TeamMask()); // NOLINT(clang-analyzer-unix.Malloc)
GameServer()->CreateSound(m_Pos, SOUND_NINJA_FIRE, TeamMask());
}
break;
}
@ -606,7 +608,10 @@ void CCharacter::FireWeapon()
if(!m_ReloadTimer)
{
float FireDelay;
GetTuning(m_TuneZone)->Get(38 + m_Core.m_ActiveWeapon, &FireDelay);
if(!m_TuneZone)
Tuning()->Get(38 + m_Core.m_ActiveWeapon, &FireDelay);
else
TuningList()[m_TuneZone].Get(38 + m_Core.m_ActiveWeapon, &FireDelay);
m_ReloadTimer = FireDelay * Server()->TickSpeed() / 1000;
}
}
@ -2062,7 +2067,7 @@ void CCharacter::ForceSetRescue(int RescueMode)
void CCharacter::DDRaceTick()
{
mem_copy(&m_Input, &m_SavedInput, sizeof(m_Input));
GameServer()->m_pController->SetArmorProgress(this, m_FreezeTime);
m_Armor = clamp(10 - (m_FreezeTime / 15), 0, 10);
if(m_Input.m_Direction != 0 || m_Input.m_Jump != 0)
m_LastMove = Server()->Tick();

View file

@ -263,7 +263,6 @@ public:
bool IsSuper() const { return m_Core.m_Super; }
CSaveTee &GetLastRescueTeeRef(int Mode = RESCUEMODE_AUTO) { return m_RescueTee[Mode]; }
CTuningParams *GetTuning(int Zone) { return Zone ? &TuningList()[Zone] : Tuning(); }
};
enum

View file

@ -94,7 +94,6 @@ bool CLaser::HitCharacter(vec2 From, vec2 To)
{
pHit->UnFreeze();
}
pHit->TakeDamage(vec2(0, 0), 0, m_Owner, m_Type);
return true;
}

View file

@ -177,8 +177,6 @@ void CProjectile::Tick()
pChr->Freeze();
}
}
else if(pTargetChr)
pTargetChr->TakeDamage(vec2(0, 0), 0, m_Owner, m_Type);
if(pOwnerChar && !GameLayerClipped(ColPos) &&
((m_Type == WEAPON_GRENADE && pOwnerChar->HasTelegunGrenade()) || (m_Type == WEAPON_GUN && pOwnerChar->HasTelegunGun())))

View file

@ -105,17 +105,6 @@ void CGameContext::Construct(int Resetting)
if(Resetting == NO_RESET)
{
for(auto &pSavedTee : m_apSavedTees)
pSavedTee = nullptr;
for(auto &pSavedTeleTee : m_apSavedTeleTees)
pSavedTeleTee = nullptr;
for(auto &pSavedTeam : m_apSavedTeams)
pSavedTeam = nullptr;
std::fill(std::begin(m_aTeamMapping), std::end(m_aTeamMapping), -1);
m_NonEmptySince = 0;
m_pVoteOptionHeap = new CHeap();
}
@ -130,18 +119,7 @@ void CGameContext::Destruct(int Resetting)
delete pPlayer;
if(Resetting == NO_RESET)
{
for(auto &pSavedTee : m_apSavedTees)
delete pSavedTee;
for(auto &pSavedTeleTee : m_apSavedTeleTees)
delete pSavedTeleTee;
for(auto &pSavedTeam : m_apSavedTeams)
delete pSavedTeam;
delete m_pVoteOptionHeap;
}
if(m_pScore)
{
@ -779,6 +757,7 @@ void CGameContext::StartVote(const char *pDesc, const char *pCommand, const char
{
// reset votes
m_VoteEnforce = VOTE_ENFORCE_UNKNOWN;
m_VoteEnforcer = -1;
for(auto &pPlayer : m_apPlayers)
{
if(pPlayer)
@ -1209,7 +1188,7 @@ void CGameContext::OnTick()
}
else if(m_VoteEnforce == VOTE_ENFORCE_YES_ADMIN)
{
Console()->ExecuteLine(m_aVoteCommand, m_VoteCreator);
Console()->ExecuteLine(m_aVoteCommand, m_VoteEnforcer);
SendChat(-1, TEAM_ALL, "Vote passed enforced by authorized player", -1, FLAG_SIX);
EndVote();
}
@ -1282,7 +1261,7 @@ void CGameContext::OnTick()
if(m_SqlRandomMapResult->m_Success)
{
if(PlayerExists(m_SqlRandomMapResult->m_ClientId) && m_SqlRandomMapResult->m_aMessage[0] != '\0')
SendChat(-1, TEAM_ALL, m_SqlRandomMapResult->m_aMessage);
SendChatTarget(m_SqlRandomMapResult->m_ClientId, m_SqlRandomMapResult->m_aMessage);
if(m_SqlRandomMapResult->m_aMap[0] != '\0')
Server()->ChangeMap(m_SqlRandomMapResult->m_aMap);
else
@ -1488,6 +1467,26 @@ void CGameContext::OnClientEnter(int ClientId)
}
m_pController->OnPlayerConnect(m_apPlayers[ClientId]);
if(Server()->IsSixup(ClientId))
{
{
protocol7::CNetMsg_Sv_GameInfo Msg;
Msg.m_GameFlags = protocol7::GAMEFLAG_RACE;
Msg.m_MatchCurrent = 1;
Msg.m_MatchNum = 0;
Msg.m_ScoreLimit = 0;
Msg.m_TimeLimit = 0;
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, ClientId);
}
// /team is essential
{
protocol7::CNetMsg_Sv_CommandInfoRemove Msg;
Msg.m_pName = "team";
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, ClientId);
}
}
{
CNetMsg_Sv_CommandInfoGroupStart Msg;
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NORECORD, ClientId);
@ -1711,17 +1710,6 @@ void CGameContext::OnClientDrop(int ClientId, const char *pReason)
delete m_apPlayers[ClientId];
m_apPlayers[ClientId] = 0;
delete m_apSavedTeams[ClientId];
m_apSavedTeams[ClientId] = nullptr;
delete m_apSavedTees[ClientId];
m_apSavedTees[ClientId] = nullptr;
delete m_apSavedTeleTees[ClientId];
m_apSavedTeleTees[ClientId] = nullptr;
m_aTeamMapping[ClientId] = -1;
m_VoteUpdate = true;
// update spectator modes
@ -3128,8 +3116,6 @@ void CGameContext::ConRandomUnfinishedMap(IConsole::IResult *pResult, void *pUse
CGameContext *pSelf = (CGameContext *)pUserData;
int Stars = pResult->NumArguments() ? pResult->GetInteger(0) : -1;
if(pResult->m_ClientId != -1)
pSelf->m_VoteCreator = pResult->m_ClientId;
pSelf->m_pScore->RandomUnfinishedMap(pSelf->m_VoteCreator, Stars);
}
@ -3208,37 +3194,6 @@ void CGameContext::ConSetTeamAll(IConsole::IResult *pResult, void *pUserData)
pSelf->m_pController->DoTeamChange(pPlayer, Team, false);
}
void CGameContext::ConHotReload(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
for(int i = 0; i < MAX_CLIENTS; i++)
{
if(!pSelf->GetPlayerChar(i))
continue;
CCharacter *pChar = pSelf->GetPlayerChar(i);
// Save the tee individually
pSelf->m_apSavedTees[i] = new CSaveTee();
pSelf->m_apSavedTees[i]->Save(pChar, false);
if(pSelf->m_apPlayers[i])
pSelf->m_apSavedTeleTees[i] = new CSaveTee(pSelf->m_apPlayers[i]->m_LastTeleTee);
// Save the team state
pSelf->m_aTeamMapping[i] = pSelf->GetDDRaceTeam(i);
if(pSelf->m_aTeamMapping[i] == TEAM_SUPER)
pSelf->m_aTeamMapping[i] = pChar->m_TeamBeforeSuper;
if(pSelf->m_apSavedTeams[pSelf->m_aTeamMapping[i]])
continue;
pSelf->m_apSavedTeams[pSelf->m_aTeamMapping[i]] = new CSaveTeam();
pSelf->m_apSavedTeams[pSelf->m_aTeamMapping[i]]->Save(pSelf, pSelf->m_aTeamMapping[i], true, true);
}
pSelf->Server()->ReloadMap();
}
void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
@ -3391,7 +3346,6 @@ void CGameContext::ConForceVote(IConsole::IResult *pResult, void *pUserData)
{
str_format(aBuf, sizeof(aBuf), "authorized player forced server option '%s' (%s)", pValue, pReason);
pSelf->SendChatTarget(-1, aBuf, FLAG_SIX);
pSelf->m_VoteCreator = pResult->m_ClientId;
pSelf->Console()->ExecuteLine(pOption->m_aCommand);
break;
}
@ -3466,18 +3420,8 @@ void CGameContext::ConClearVotes(IConsole::IResult *pResult, void *pUserData)
struct CMapNameItem
{
char m_aName[IO_MAX_PATH_LENGTH - 4];
bool m_IsDirectory;
static bool CompareFilenameAscending(const CMapNameItem Lhs, const CMapNameItem Rhs)
{
if(str_comp(Lhs.m_aName, "..") == 0)
return true;
if(str_comp(Rhs.m_aName, "..") == 0)
return false;
if(Lhs.m_IsDirectory != Rhs.m_IsDirectory)
return Lhs.m_IsDirectory;
return str_comp_filenames(Lhs.m_aName, Rhs.m_aName) < 0;
}
bool operator<(const CMapNameItem &Other) const { return str_comp_nocase(m_aName, Other.m_aName) < 0; }
};
void CGameContext::ConAddMapVotes(IConsole::IResult *pResult, void *pUserData)
@ -3485,48 +3429,19 @@ void CGameContext::ConAddMapVotes(IConsole::IResult *pResult, void *pUserData)
CGameContext *pSelf = (CGameContext *)pUserData;
std::vector<CMapNameItem> vMapList;
const char *pDirectory = pResult->GetString(0);
// Don't allow moving to parent directories
if(str_find_nocase(pDirectory, ".."))
return;
char aPath[IO_MAX_PATH_LENGTH] = "maps/";
str_append(aPath, pDirectory, sizeof(aPath));
pSelf->Storage()->ListDirectory(IStorage::TYPE_ALL, aPath, MapScan, &vMapList);
std::sort(vMapList.begin(), vMapList.end(), CMapNameItem::CompareFilenameAscending);
pSelf->Storage()->ListDirectory(IStorage::TYPE_ALL, "maps", MapScan, &vMapList);
std::sort(vMapList.begin(), vMapList.end());
for(auto &Item : vMapList)
{
if(!str_comp(Item.m_aName, "..") && (!str_comp(aPath, "maps/")))
continue;
char aDescription[64];
str_format(aDescription, sizeof(aDescription), "Map: %s", Item.m_aName);
char aDescription[VOTE_DESC_LENGTH];
str_format(aDescription, sizeof(aDescription), "%s: %s%s", Item.m_IsDirectory ? "Directory" : "Map", Item.m_aName, Item.m_IsDirectory ? "/" : "");
char aCommand[VOTE_CMD_LENGTH];
char aOptionEscaped[IO_MAX_PATH_LENGTH * 2];
char *pDst = aOptionEscaped;
str_escape(&pDst, Item.m_aName, aOptionEscaped + sizeof(aOptionEscaped));
char aDirectory[IO_MAX_PATH_LENGTH] = "";
if(pResult->NumArguments())
str_copy(aDirectory, pDirectory);
if(!str_comp(Item.m_aName, ".."))
{
fs_parent_dir(aDirectory);
str_format(aCommand, sizeof(aCommand), "clear_votes; add_map_votes \"%s\"", aDirectory);
}
else if(Item.m_IsDirectory)
{
str_append(aDirectory, "/", sizeof(aDirectory));
str_append(aDirectory, aOptionEscaped, sizeof(aDirectory));
str_format(aCommand, sizeof(aCommand), "clear_votes; add_map_votes \"%s\"", aDirectory);
}
else
str_format(aCommand, sizeof(aCommand), "change_map \"%s/%s\"", pDirectory, aOptionEscaped);
char aCommand[IO_MAX_PATH_LENGTH * 2 + 10];
char aMapEscaped[IO_MAX_PATH_LENGTH * 2];
char *pDst = aMapEscaped;
str_escape(&pDst, Item.m_aName, aMapEscaped + sizeof(aMapEscaped));
str_format(aCommand, sizeof(aCommand), "change_map \"%s\"", aMapEscaped);
pSelf->AddVote(aDescription, aCommand);
}
@ -3536,15 +3451,11 @@ void CGameContext::ConAddMapVotes(IConsole::IResult *pResult, void *pUserData)
int CGameContext::MapScan(const char *pName, int IsDir, int DirType, void *pUserData)
{
if((!IsDir && !str_endswith(pName, ".map")) || !str_comp(pName, "."))
if(IsDir || !str_endswith(pName, ".map"))
return 0;
CMapNameItem Item;
Item.m_IsDirectory = IsDir;
if(!IsDir)
str_truncate(Item.m_aName, sizeof(Item.m_aName), pName, str_length(pName) - str_length(".map"));
else
str_copy(Item.m_aName, pName);
str_truncate(Item.m_aName, sizeof(Item.m_aName), pName, str_length(pName) - str_length(".map"));
static_cast<std::vector<CMapNameItem> *>(pUserData)->push_back(Item);
return 0;
@ -3641,13 +3552,12 @@ void CGameContext::OnConsoleInit()
Console()->Register("say", "r[message]", CFGFLAG_SERVER, ConSay, this, "Say in chat");
Console()->Register("set_team", "i[id] i[team-id] ?i[delay in minutes]", CFGFLAG_SERVER, ConSetTeam, this, "Set team of player to team");
Console()->Register("set_team_all", "i[team-id]", CFGFLAG_SERVER, ConSetTeamAll, this, "Set team of all players to team");
Console()->Register("hot_reload", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConHotReload, this, "Reload the map while preserving the state of tees and teams");
Console()->Register("add_vote", "s[name] r[command]", CFGFLAG_SERVER, ConAddVote, this, "Add a voting option");
Console()->Register("remove_vote", "r[name]", CFGFLAG_SERVER, ConRemoveVote, this, "remove a voting option");
Console()->Register("force_vote", "s[name] s[command] ?r[reason]", CFGFLAG_SERVER, ConForceVote, this, "Force a voting option");
Console()->Register("clear_votes", "", CFGFLAG_SERVER, ConClearVotes, this, "Clears the voting options");
Console()->Register("add_map_votes", "?s[directory]", CFGFLAG_SERVER, ConAddMapVotes, this, "Automatically adds voting options for all maps");
Console()->Register("add_map_votes", "", CFGFLAG_SERVER, ConAddMapVotes, this, "Automatically adds voting options for all maps");
Console()->Register("vote", "r['yes'|'no']", CFGFLAG_SERVER, ConVote, this, "Force a vote to yes/no");
Console()->Register("votes", "?i[page]", CFGFLAG_SERVER, ConVotes, this, "Show all votes (page 0 by default, 20 entries per page)");
Console()->Register("dump_antibot", "", CFGFLAG_SERVER, ConDumpAntibot, this, "Dumps the antibot status");
@ -3793,7 +3703,7 @@ void CGameContext::RegisterChatCommands()
Console()->Register("rescuemode", "?r['auto'|'manual']", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConRescueMode, this, "Sets one of the two rescue modes (auto or manual). Prints current mode if no arguments provided");
Console()->Register("tp", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConTeleTo, this, "Depending on the number of supplied arguments, teleport yourself to; (0.) where you are spectating or aiming; (1.) the specified player name");
Console()->Register("teleport", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConTeleTo, this, "Depending on the number of supplied arguments, teleport yourself to; (0.) where you are spectating or aiming; (1.) the specified player name");
Console()->Register("tpxy", "s[x] s[y]", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConTeleXY, this, "Teleport yourself to the specified coordinates. A tilde (~) can be used to denote your current position, e.g. '/tpxy ~1 ~' to teleport one tile to the right");
Console()->Register("tpxy", "f[x] f[y]", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConTeleXY, this, "Teleport yourself to the specified coordinates. A tilde (~) can be used to denote your current position, e.g. '/tpxy ~1 ~' to teleport one tile to the right");
Console()->Register("lasttp", "", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConLastTele, this, "Teleport yourself to the last location you teleported to");
Console()->Register("tc", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConTeleCursor, this, "Teleport yourself to player or to where you are spectating/or looking if no player name is given");
Console()->Register("telecursor", "?r[player name]", CFGFLAG_CHAT | CFGFLAG_SERVER | CMDFLAG_PRACTICE, ConTeleCursor, this, "Teleport yourself to player or to where you are spectating/or looking if no player name is given");
@ -4835,6 +4745,7 @@ void CGameContext::ForceVote(int EnforcerId, bool Success)
return;
m_VoteEnforce = Success ? CGameContext::VOTE_ENFORCE_YES_ADMIN : CGameContext::VOTE_ENFORCE_NO_ADMIN;
m_VoteEnforcer = EnforcerId;
char aBuf[256];
const char *pOption = Success ? "yes" : "no";

View file

@ -124,7 +124,6 @@ class CGameContext : public IGameServer
static void ConSay(IConsole::IResult *pResult, void *pUserData);
static void ConSetTeam(IConsole::IResult *pResult, void *pUserData);
static void ConSetTeamAll(IConsole::IResult *pResult, void *pUserData);
static void ConHotReload(IConsole::IResult *pResult, void *pUserData);
static void ConAddVote(IConsole::IResult *pResult, void *pUserData);
static void ConRemoveVote(IConsole::IResult *pResult, void *pUserData);
static void ConForceVote(IConsole::IResult *pResult, void *pUserData);
@ -181,10 +180,6 @@ public:
// keep last input to always apply when none is sent
CNetObj_PlayerInput m_aLastPlayerInput[MAX_CLIENTS];
bool m_aPlayerHasInput[MAX_CLIENTS];
CSaveTeam *m_apSavedTeams[MAX_CLIENTS];
CSaveTee *m_apSavedTees[MAX_CLIENTS];
CSaveTee *m_apSavedTeleTees[MAX_CLIENTS];
int m_aTeamMapping[MAX_CLIENTS];
// returns last input if available otherwise nulled PlayerInput object
// ClientId has to be valid
@ -576,6 +571,7 @@ public:
VOTE_TYPE_SPECTATE,
};
int m_VoteVictim;
int m_VoteEnforcer;
inline bool IsOptionVote() const { return m_VoteType == VOTE_TYPE_OPTION; }
inline bool IsKickVote() const { return m_VoteType == VOTE_TYPE_KICK; }

Some files were not shown because too many files have changed in this diff Show more