Codechange: use std::optional<std::string> over char * for text query results

This commit is contained in:
Rubidium
2024-05-07 21:08:20 +02:00
committed by rubidium42
parent 3819ab25bf
commit 14200212b7
22 changed files with 126 additions and 126 deletions

View File

@@ -607,11 +607,11 @@ public:
this->ResizeWindowAsNeeded();
}
void OnQueryTextFinished(char *str) override
void OnQueryTextFinished(std::optional<std::string> str) override
{
if (str == nullptr) return;
if (!str.has_value()) return;
Command<CMD_RENAME_TOWN>::Post(STR_ERROR_CAN_T_RENAME_TOWN, this->window_number, str);
Command<CMD_RENAME_TOWN>::Post(STR_ERROR_CAN_T_RENAME_TOWN, this->window_number, *str);
}
IntervalTimer<TimerGameCalendar> daily_interval = {{TimerGameCalendar::DAY, TimerGameCalendar::Priority::NONE}, [this](auto) {