mirror of https://github.com/OpenRCT2/OpenRCT2.git
Cache HasFilePicker() value in UiContext
This commit is contained in:
parent
f1cd58c292
commit
430711a33b
|
@ -3,6 +3,7 @@
|
|||
- Feature: [#14071] “Vandals stopped” statistic for security guards.
|
||||
- Feature: [#14296] Allow using early scenario completion in multiplayer.
|
||||
- Fix: [#11829] Visual glitches and crashes when using RCT1 assets from mismatched or corrupt CSG1.DAT and CSG1i.DAT files.
|
||||
- Fix: [#13581] Opening the Options menu causes a noticeable drop in FPS.
|
||||
- Fix: [#13894] Block brakes do not animate.
|
||||
- Fix: [#14315] Crash when trying to rename Air Powered Vertical Coaster in Korean.
|
||||
- Fix: [#14330] join_server uses default_port from config.
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace OpenRCT2::Ui
|
|||
class LinuxContext final : public IPlatformUiContext
|
||||
{
|
||||
private:
|
||||
mutable std::optional<bool> _hasFilePicker = std::nullopt;
|
||||
|
||||
public:
|
||||
LinuxContext()
|
||||
{
|
||||
|
@ -253,8 +255,13 @@ namespace OpenRCT2::Ui
|
|||
|
||||
bool HasFilePicker() const override
|
||||
{
|
||||
std::string dummy;
|
||||
return GetDialogApp(&dummy) != DIALOG_TYPE::NONE;
|
||||
if (!_hasFilePicker.has_value())
|
||||
{
|
||||
std::string dummy;
|
||||
_hasFilePicker = (GetDialogApp(&dummy) != DIALOG_TYPE::NONE);
|
||||
}
|
||||
|
||||
return _hasFilePicker.value();
|
||||
}
|
||||
|
||||
bool HasMenuSupport() override
|
||||
|
|
Loading…
Reference in New Issue