mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Merge pull request #8455 from Robyt3/Client-Demo-Cut-Filename-Fix
Fix wrong file extension being removed in demo cut popup
This commit is contained in:
commit
abc7d05fca
|
@ -830,13 +830,15 @@ void CMenus::RenderDemoPlayerSliceSavePopup(CUIRect MainView)
|
||||||
static CButtonContainer s_ButtonOk;
|
static CButtonContainer s_ButtonOk;
|
||||||
if(DoButton_Menu(&s_ButtonOk, Localize("Ok"), 0, &OkButton) || (!Ui()->IsPopupOpen() && Ui()->ConsumeHotkey(CUi::HOTKEY_ENTER)))
|
if(DoButton_Menu(&s_ButtonOk, Localize("Ok"), 0, &OkButton) || (!Ui()->IsPopupOpen() && Ui()->ConsumeHotkey(CUi::HOTKEY_ENTER)))
|
||||||
{
|
{
|
||||||
char aDemoName[IO_MAX_PATH_LENGTH];
|
if(str_endswith(m_DemoSliceInput.GetString(), ".demo"))
|
||||||
|
{
|
||||||
char aNameWithoutExt[IO_MAX_PATH_LENGTH];
|
char aNameWithoutExt[IO_MAX_PATH_LENGTH];
|
||||||
DemoPlayer()->GetDemoName(aDemoName, sizeof(aDemoName));
|
|
||||||
|
|
||||||
fs_split_file_extension(m_DemoSliceInput.GetString(), aNameWithoutExt, sizeof(aNameWithoutExt));
|
fs_split_file_extension(m_DemoSliceInput.GetString(), aNameWithoutExt, sizeof(aNameWithoutExt));
|
||||||
m_DemoSliceInput.Set(aNameWithoutExt);
|
m_DemoSliceInput.Set(aNameWithoutExt);
|
||||||
|
}
|
||||||
|
|
||||||
|
char aDemoName[IO_MAX_PATH_LENGTH];
|
||||||
|
DemoPlayer()->GetDemoName(aDemoName, sizeof(aDemoName));
|
||||||
if(str_comp(aDemoName, m_DemoSliceInput.GetString()) == 0)
|
if(str_comp(aDemoName, m_DemoSliceInput.GetString()) == 0)
|
||||||
{
|
{
|
||||||
static CUi::SMessagePopupContext s_MessagePopupContext;
|
static CUi::SMessagePopupContext s_MessagePopupContext;
|
||||||
|
|
Loading…
Reference in a new issue