Compare commits

...

11 commits

Author SHA1 Message Date
Dennis Felsing 7e8dc57194
Merge pull request #8150 from furo321/freezebar-fix
Fix freeze bar not being correct after returning from pause
2024-03-23 23:26:04 +00:00
Dennis Felsing 7826b2a4f7
Merge pull request #8149 from BlaiZephyr/finalize-german.txt
german.txt fix
2024-03-23 23:25:04 +00:00
Dennis Felsing a4aafb78bd
Merge pull request #8147 from dobrykafe/pr-fix-style
`fix_style.py`: check for newline at the end of source files
2024-03-23 23:24:02 +00:00
Dennis Felsing eefcb83a4f
Merge pull request #8144 from Robyt3/Client-Skin-Reset-Cleanup
Use `CTeeRenderInfo::Reset`
2024-03-23 23:22:44 +00:00
Dennis Felsing 3d6c022d0e
Merge pull request #8145 from Robyt3/Format-CPU-ID-Naming-Fix
Fix more variable names (`GPU` -> `Gpu`, `ID` -> `Id`)
2024-03-23 23:22:28 +00:00
c0d3d3v ab3991f821 fix freeze bar not beeing correct after returning from pause
m_FreezeStart is now corrected by the ticks the character was paused
Possible physical changes: Until now it was possible if you sit inside freeze to re-freeze instant
after unpause. Now you re-freeze after the second that was dawned before
the pause. I do not excpect that this is used on any map, and it did not
bring any benifit.
2024-03-23 23:05:14 +01:00
BlaiZephyr 6f8fca2d3b keep Anti-Ping style consistent
forgot to change credit
2024-03-23 20:56:37 +01:00
dobrykafe 6175022e39 add missing newline at EOF 2024-03-23 16:01:16 +01:00
dobrykafe e46f16ed91 check for newline at the end of source files 2024-03-23 16:01:00 +01:00
Robert Müller 134961015a Fix more variable names (GPU -> Gpu, ID -> Id) 2024-03-23 12:06:31 +01:00
Robert Müller 4d6a00d827 Use CTeeRenderInfo::Reset
To reduce duplicate code and ensure all members are reset.
2024-03-23 11:57:08 +01:00
8 changed files with 44 additions and 25 deletions

View file

@ -21,7 +21,7 @@
# timakro 2014-06-30 18:26:59
# deen 2020-06-26 18:32:00
# bluesky 2022-07-05 21:00:00
# BlaiZephyr 2024-03-19 20:05:00
# BlaiZephyr 2024-03-23 20:55:00
##### /authors #####
##### translated strings #####
@ -690,7 +690,7 @@ Normal message
== Normale Nachricht
AntiPing: predict grenade paths
== AntiPing: Granatenflugkurve vorberechnen
== Anti-Ping: Granatenflugkurve vorberechnen
Search
== Suche
@ -708,7 +708,7 @@ Enable highlighted chat sound
== Ton für Nachrichten an dich aktivieren
AntiPing: predict weapons
== AntiPing: Waffen vorberechnen
== Anti-Ping: Waffen vorberechnen
Highlighted message
== Hervorgehobene Nachricht

View file

@ -52,10 +52,29 @@ def find_clang_format(version):
clang_format_bin = find_clang_format(10)
def reformat(filenames):
for filename in filenames:
with open(filename, 'r+b') as f:
try:
f.seek(-1, os.SEEK_END)
if f.read(1) != b'\n':
f.write(b'\n')
except OSError:
f.seek(0)
subprocess.check_call([clang_format_bin, "-i"] + filenames)
def warn(filenames):
return subprocess.call([clang_format_bin, "-Werror", "--dry-run"] + filenames)
clang = subprocess.call([clang_format_bin, "-Werror", "--dry-run"] + filenames)
newline = 0
for filename in filenames:
with open(filename, 'rb') as f:
try:
f.seek(-1, os.SEEK_END)
if f.read(1) != b'\n':
print(filename + ": error: missing newline at EOF", file=sys.stderr)
newline = 1
except OSError:
f.seek(0)
return clang or newline
def main():
p = argparse.ArgumentParser(description="Check and fix style of changed files")

View file

@ -236,4 +236,4 @@ void CFreezeBars::OnRender()
{
RenderFreezeBar(LocalClientId);
}
}
}

View file

@ -1809,8 +1809,8 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
}
// GPU list
const auto &GPUList = Graphics()->GetGpus();
if(GPUList.m_vGpus.size() > 1)
const auto &GpuList = Graphics()->GetGpus();
if(GpuList.m_vGpus.size() > 1)
{
CUIRect Text, GpuDropDown;
MainView.HSplitTop(10.0f, nullptr, &MainView);
@ -1819,20 +1819,20 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
MainView.HSplitTop(20.0f, &GpuDropDown, &MainView);
Ui()->DoLabel(&Text, Localize("Graphics card"), 16.0f, TEXTALIGN_MC);
static std::vector<const char *> s_vpGpuIDNames;
static std::vector<const char *> s_vpGpuIdNames;
size_t GPUCount = GPUList.m_vGpus.size() + 1;
s_vpGpuIDNames.resize(GPUCount);
size_t GpuCount = GpuList.m_vGpus.size() + 1;
s_vpGpuIdNames.resize(GpuCount);
char aCurDeviceName[256 + 4];
int OldSelectedGpu = -1;
for(size_t i = 0; i < GPUCount; ++i)
for(size_t i = 0; i < GpuCount; ++i)
{
if(i == 0)
{
str_format(aCurDeviceName, sizeof(aCurDeviceName), "%s (%s)", Localize("auto"), GPUList.m_AutoGpu.m_aName);
s_vpGpuIDNames[i] = aCurDeviceName;
str_format(aCurDeviceName, sizeof(aCurDeviceName), "%s (%s)", Localize("auto"), GpuList.m_AutoGpu.m_aName);
s_vpGpuIdNames[i] = aCurDeviceName;
if(str_comp("auto", g_Config.m_GfxGpuName) == 0)
{
OldSelectedGpu = 0;
@ -1840,8 +1840,8 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
}
else
{
s_vpGpuIDNames[i] = GPUList.m_vGpus[i - 1].m_aName;
if(str_comp(GPUList.m_vGpus[i - 1].m_aName, g_Config.m_GfxGpuName) == 0)
s_vpGpuIdNames[i] = GpuList.m_vGpus[i - 1].m_aName;
if(str_comp(GpuList.m_vGpus[i - 1].m_aName, g_Config.m_GfxGpuName) == 0)
{
OldSelectedGpu = i;
}
@ -1855,13 +1855,13 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
static CUi::SDropDownState s_GpuDropDownState;
static CScrollRegion s_GpuDropDownScrollRegion;
s_GpuDropDownState.m_SelectionPopupContext.m_pScrollRegion = &s_GpuDropDownScrollRegion;
const int NewGpu = Ui()->DoDropDown(&GpuDropDown, OldSelectedGpu, s_vpGpuIDNames.data(), GPUCount, s_GpuDropDownState);
const int NewGpu = Ui()->DoDropDown(&GpuDropDown, OldSelectedGpu, s_vpGpuIdNames.data(), GpuCount, s_GpuDropDownState);
if(OldSelectedGpu != NewGpu)
{
if(NewGpu == 0)
str_copy(g_Config.m_GfxGpuName, "auto");
else
str_copy(g_Config.m_GfxGpuName, GPUList.m_vGpus[NewGpu - 1].m_aName);
str_copy(g_Config.m_GfxGpuName, GpuList.m_vGpus[NewGpu - 1].m_aName);
CheckSettings = true;
s_GfxGpuChanged = NewGpu != s_OldSelectedGpu;
}

View file

@ -2223,13 +2223,7 @@ void CGameClient::CClientData::Reset()
m_Afk = false;
m_Paused = false;
m_Spec = false;
m_SkinInfo.m_BloodColor = ColorRGBA(1, 1, 1);
m_SkinInfo.m_ColorableRenderSkin.Reset();
m_SkinInfo.m_OriginalRenderSkin.Reset();
m_SkinInfo.m_CustomColoredSkin = false;
m_SkinInfo.m_ColorBody = ColorRGBA(1, 1, 1);
m_SkinInfo.m_ColorFeet = ColorRGBA(1, 1, 1);
m_SkinInfo.m_SkinMetrics.Reset();
m_SkinInfo.Reset();
m_Solo = false;
m_Jetpack = false;

View file

@ -79,4 +79,4 @@ bool CEditorImage::DataEquals(const CEditorImage &Other) const
}
return true;
}
}

View file

@ -2263,12 +2263,17 @@ void CCharacter::Pause(bool Pause)
ResetHook();
GameWorld()->ReleaseHooked(GetPlayer()->GetCid());
}
m_PausedTick = Server()->Tick();
}
else
{
m_Core.m_Vel = vec2(0, 0);
GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCid()] = &m_Core;
GameServer()->m_World.InsertEntity(this);
if(m_Core.m_FreezeStart > 0 && m_PausedTick >= 0)
{
m_Core.m_FreezeStart += Server()->Tick() - m_PausedTick;
}
}
}

View file

@ -104,6 +104,7 @@ private:
bool m_Alive;
bool m_Paused;
int m_PausedTick;
int m_NeededFaketuning;
// weapon info