mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Cache HasFilePicker() value in UiContext
This commit is contained in:
committed by
GitHub
parent
f1cd58c292
commit
430711a33b
@@ -3,6 +3,7 @@
|
|||||||
- Feature: [#14071] “Vandals stopped” statistic for security guards.
|
- Feature: [#14071] “Vandals stopped” statistic for security guards.
|
||||||
- Feature: [#14296] Allow using early scenario completion in multiplayer.
|
- 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: [#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: [#13894] Block brakes do not animate.
|
||||||
- Fix: [#14315] Crash when trying to rename Air Powered Vertical Coaster in Korean.
|
- Fix: [#14315] Crash when trying to rename Air Powered Vertical Coaster in Korean.
|
||||||
- Fix: [#14330] join_server uses default_port from config.
|
- Fix: [#14330] join_server uses default_port from config.
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ namespace OpenRCT2::Ui
|
|||||||
class LinuxContext final : public IPlatformUiContext
|
class LinuxContext final : public IPlatformUiContext
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
mutable std::optional<bool> _hasFilePicker = std::nullopt;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LinuxContext()
|
LinuxContext()
|
||||||
{
|
{
|
||||||
@@ -253,8 +255,13 @@ namespace OpenRCT2::Ui
|
|||||||
|
|
||||||
bool HasFilePicker() const override
|
bool HasFilePicker() const override
|
||||||
{
|
{
|
||||||
std::string dummy;
|
if (!_hasFilePicker.has_value())
|
||||||
return GetDialogApp(&dummy) != DIALOG_TYPE::NONE;
|
{
|
||||||
|
std::string dummy;
|
||||||
|
_hasFilePicker = (GetDialogApp(&dummy) != DIALOG_TYPE::NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _hasFilePicker.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasMenuSupport() override
|
bool HasMenuSupport() override
|
||||||
|
|||||||
Reference in New Issue
Block a user