Codechange: Make FileToSaveLoad's title std::string and simplify assignments

This commit is contained in:
Rubidium
2023-04-16 21:44:53 +02:00
committed by rubidium42
parent f0a1ddd81c
commit ee723f26ba
6 changed files with 14 additions and 28 deletions

View File

@@ -406,7 +406,7 @@ struct GenerateLandscapeWindow : public Window {
uint widget_id;
uint x;
uint y;
char name[64];
std::string name;
GenerateLandscapeWindowMode mode;
GenerateLandscapeWindow(WindowDesc *desc, WindowNumber number = 0) : Window(desc)
@@ -1057,7 +1057,7 @@ static void _ShowGenerateLandscape(GenerateLandscapeWindowMode mode)
if (mode == GLWM_HEIGHTMAP) {
w->x = x;
w->y = y;
strecpy(w->name, _file_to_saveload.title, lastof(w->name));
w->name = _file_to_saveload.title;
}
SetWindowDirty(WC_GENERATE_LANDSCAPE, mode);