mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #6740
6740: Don't remove the `.map` suffix in editor file dialog r=def- a=Robyt3 This otherwise breaks file loading because the file extension is expected in this input buffer even when the input is not rendered. Regression from #6736. ## Checklist - [X] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
6cfac056ec
|
@ -4850,10 +4850,7 @@ void CEditor::RenderFileDialog()
|
|||
str_copy(m_aFilesSelectedName, m_vpFilteredFileList[m_FilesSelectedIndex]->m_aName);
|
||||
const bool WasChanged = m_FileDialogFileNameInput.WasChanged();
|
||||
if(!m_vpFilteredFileList[m_FilesSelectedIndex]->m_IsDir)
|
||||
{
|
||||
m_FileDialogFileNameInput.Set(m_vpFilteredFileList[m_FilesSelectedIndex]->m_aFilename);
|
||||
m_FileDialogFileNameInput.SetRange("", m_FileDialogFileNameInput.GetLength() - str_length(".map"), m_FileDialogFileNameInput.GetLength());
|
||||
}
|
||||
else
|
||||
m_FileDialogFileNameInput.Clear();
|
||||
if(!WasChanged) // ensure that changed flag is not set if it wasn't previously set, as this would reset the selection after DoEditBox is called
|
||||
|
|
Loading…
Reference in a new issue