Emscripten: Disable a few options
Namely broken window frame options and pointless data folder options.
This commit is contained in:
parent
3d4ce09a80
commit
25b15208cf
@ -19,6 +19,8 @@ constexpr bool SECURE_CIPHERS_ONLY = @SECURE_CIPHERS_ONLY@;
|
|||||||
constexpr bool FFTW_PLAN_MEASURE = @FFTW_PLAN_MEASURE@;
|
constexpr bool FFTW_PLAN_MEASURE = @FFTW_PLAN_MEASURE@;
|
||||||
constexpr bool DEFAULT_VSYNC = @DEFAULT_VSYNC@;
|
constexpr bool DEFAULT_VSYNC = @DEFAULT_VSYNC@;
|
||||||
constexpr bool ALLOW_QUIT = @ALLOW_QUIT@;
|
constexpr bool ALLOW_QUIT = @ALLOW_QUIT@;
|
||||||
|
constexpr bool ALLOW_WINDOW_FRAME_OPS = @ALLOW_WINDOW_FRAME_OPS@;
|
||||||
|
constexpr bool ALLOW_DATA_FOLDER = @ALLOW_DATA_FOLDER@;
|
||||||
constexpr char PATH_SEP_CHAR = '@PATH_SEP_CHAR@';
|
constexpr char PATH_SEP_CHAR = '@PATH_SEP_CHAR@';
|
||||||
|
|
||||||
constexpr char SERVER[] = "@SERVER@";
|
constexpr char SERVER[] = "@SERVER@";
|
||||||
|
@ -252,6 +252,8 @@ OptionsView::OptionsView() : ui::Window(ui::Point(-1, -1), ui::Point(320, 340))
|
|||||||
c->SetScale(scale->GetOption().second);
|
c->SetScale(scale->GetOption().second);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (ALLOW_WINDOW_FRAME_OPS)
|
||||||
|
{
|
||||||
resizable = addCheckbox(0, "Resizable \bg- allow resizing and maximizing window", "", [this] {
|
resizable = addCheckbox(0, "Resizable \bg- allow resizing and maximizing window", "", [this] {
|
||||||
c->SetResizable(resizable->GetChecked());
|
c->SetResizable(resizable->GetChecked());
|
||||||
});
|
});
|
||||||
@ -264,6 +266,7 @@ OptionsView::OptionsView() : ui::Window(ui::Point(-1, -1), ui::Point(320, 340))
|
|||||||
forceIntegerScaling = addCheckbox(1, "Force integer scaling \bg- less blurry", "", [this] {
|
forceIntegerScaling = addCheckbox(1, "Force integer scaling \bg- less blurry", "", [this] {
|
||||||
c->SetForceIntegerScaling(forceIntegerScaling->GetChecked());
|
c->SetForceIntegerScaling(forceIntegerScaling->GetChecked());
|
||||||
});
|
});
|
||||||
|
}
|
||||||
addSeparator();
|
addSeparator();
|
||||||
if (ALLOW_QUIT)
|
if (ALLOW_QUIT)
|
||||||
{
|
{
|
||||||
@ -298,8 +301,9 @@ OptionsView::OptionsView() : ui::Window(ui::Point(-1, -1), ui::Point(320, 340))
|
|||||||
c->SetDecoSpace(decoSpace->GetOption().second);
|
c->SetDecoSpace(decoSpace->GetOption().second);
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
|
||||||
currentY += 4;
|
currentY += 4;
|
||||||
|
if (ALLOW_DATA_FOLDER)
|
||||||
|
{
|
||||||
auto *dataFolderButton = new ui::Button(ui::Point(10, currentY), ui::Point(90, 16), "Open data folder");
|
auto *dataFolderButton = new ui::Button(ui::Point(10, currentY), ui::Point(90, 16), "Open data folder");
|
||||||
dataFolderButton->SetActionCallback({ [] {
|
dataFolderButton->SetActionCallback({ [] {
|
||||||
ByteString cwd = Platform::GetCwd();
|
ByteString cwd = Platform::GetCwd();
|
||||||
@ -424,10 +428,22 @@ void OptionsView::NotifySettingsChanged(OptionsModel * sender)
|
|||||||
decoSpace->SetOption(sender->GetDecoSpace());
|
decoSpace->SetOption(sender->GetDecoSpace());
|
||||||
edgeMode->SetOption(sender->GetEdgeMode());
|
edgeMode->SetOption(sender->GetEdgeMode());
|
||||||
scale->SetOption(sender->GetScale());
|
scale->SetOption(sender->GetScale());
|
||||||
|
if (resizable)
|
||||||
|
{
|
||||||
resizable->SetChecked(sender->GetResizable());
|
resizable->SetChecked(sender->GetResizable());
|
||||||
|
}
|
||||||
|
if (fullscreen)
|
||||||
|
{
|
||||||
fullscreen->SetChecked(sender->GetFullscreen());
|
fullscreen->SetChecked(sender->GetFullscreen());
|
||||||
|
}
|
||||||
|
if (altFullscreen)
|
||||||
|
{
|
||||||
altFullscreen->SetChecked(sender->GetAltFullscreen());
|
altFullscreen->SetChecked(sender->GetAltFullscreen());
|
||||||
|
}
|
||||||
|
if (forceIntegerScaling)
|
||||||
|
{
|
||||||
forceIntegerScaling->SetChecked(sender->GetForceIntegerScaling());
|
forceIntegerScaling->SetChecked(sender->GetForceIntegerScaling());
|
||||||
|
}
|
||||||
if (fastquit)
|
if (fastquit)
|
||||||
{
|
{
|
||||||
fastquit->SetChecked(sender->GetFastQuit());
|
fastquit->SetChecked(sender->GetFastQuit());
|
||||||
|
@ -5,35 +5,41 @@ mod_id = get_option('mod_id')
|
|||||||
is_snapshot = get_option('snapshot')
|
is_snapshot = get_option('snapshot')
|
||||||
is_beta = get_option('beta')
|
is_beta = get_option('beta')
|
||||||
is_mod = mod_id > 0
|
is_mod = mod_id > 0
|
||||||
conf_data.set('X86', is_x86 ? 'true' : 'false')
|
conf_data.set('X86', is_x86.to_string())
|
||||||
conf_data.set('BETA', is_beta ? 'true' : 'false')
|
conf_data.set('BETA', is_beta.to_string())
|
||||||
conf_data.set('MOD_ID', mod_id)
|
conf_data.set('MOD_ID', mod_id)
|
||||||
conf_data.set('DEBUG', is_debug ? 'true' : 'false')
|
conf_data.set('DEBUG', is_debug.to_string())
|
||||||
conf_data.set('MOD', is_mod ? 'true' : 'false')
|
conf_data.set('MOD', is_mod.to_string())
|
||||||
conf_data.set('SNAPSHOT', is_snapshot ? 'true' : 'false')
|
conf_data.set('SNAPSHOT', is_snapshot.to_string())
|
||||||
conf_data.set('SNAPSHOT_ID', get_option('snapshot_id'))
|
conf_data.set('SNAPSHOT_ID', get_option('snapshot_id'))
|
||||||
conf_data.set('ALLOW_FAKE_NEWER_VERSION', (is_snapshot or is_beta or is_debug or is_mod) ? 'true' : 'false')
|
conf_data.set('ALLOW_FAKE_NEWER_VERSION', (is_snapshot or is_beta or is_debug or is_mod).to_string())
|
||||||
conf_data.set('IDENT_PLATFORM', ident_platform)
|
conf_data.set('IDENT_PLATFORM', ident_platform)
|
||||||
conf_data.set('IDENT', '@0@-@1@-@2@'.format(host_arch, host_platform, host_libc).to_upper())
|
conf_data.set('IDENT', '@0@-@1@-@2@'.format(host_arch, host_platform, host_libc).to_upper())
|
||||||
|
|
||||||
update_server = get_option('update_server')
|
update_server = get_option('update_server')
|
||||||
conf_data.set('UPDATESERVER', update_server)
|
conf_data.set('UPDATESERVER', update_server)
|
||||||
conf_data.set('USE_UPDATESERVER', update_server != '' ? 'true' : 'false')
|
conf_data.set('USE_UPDATESERVER', (update_server != '').to_string())
|
||||||
|
|
||||||
enforce_https = get_option('enforce_https')
|
enforce_https = get_option('enforce_https')
|
||||||
allow_quit = true
|
allow_quit = true
|
||||||
|
allow_window_frame_ops = true
|
||||||
|
allow_data_folder = true
|
||||||
if host_platform == 'emscripten'
|
if host_platform == 'emscripten'
|
||||||
allow_quit = false
|
allow_quit = false
|
||||||
|
allow_window_frame_ops = false
|
||||||
|
allow_data_folder = false
|
||||||
endif
|
endif
|
||||||
secure_ciphers_only = get_option('secure_ciphers_only')
|
secure_ciphers_only = get_option('secure_ciphers_only')
|
||||||
if not is_debug and not enforce_https
|
if not is_debug and not enforce_https
|
||||||
error('refusing to build a release binary without enforcing HTTPS, configure with -Denforce_https=true to fix this error')
|
error('refusing to build a release binary without enforcing HTTPS, configure with -Denforce_https=true to fix this error')
|
||||||
endif
|
endif
|
||||||
conf_data.set('ALLOW_QUIT', allow_quit ? 'true' : 'false')
|
conf_data.set('ALLOW_QUIT', allow_quit.to_string())
|
||||||
conf_data.set('ENFORCE_HTTPS', enforce_https ? 'true' : 'false')
|
conf_data.set('ALLOW_WINDOW_FRAME_OPS', allow_window_frame_ops.to_string())
|
||||||
conf_data.set('SECURE_CIPHERS_ONLY', secure_ciphers_only ? 'true' : 'false')
|
conf_data.set('ALLOW_DATA_FOLDER', allow_data_folder.to_string())
|
||||||
|
conf_data.set('ENFORCE_HTTPS', enforce_https.to_string())
|
||||||
|
conf_data.set('SECURE_CIPHERS_ONLY', secure_ciphers_only.to_string())
|
||||||
|
|
||||||
conf_data.set('IGNORE_UPDATES', get_option('ignore_updates') ? 'true' : 'false')
|
conf_data.set('IGNORE_UPDATES', get_option('ignore_updates').to_string())
|
||||||
conf_data.set('SERVER', get_option('server'))
|
conf_data.set('SERVER', get_option('server'))
|
||||||
conf_data.set('STATICSERVER', get_option('static_server'))
|
conf_data.set('STATICSERVER', get_option('static_server'))
|
||||||
conf_data.set('APPNAME', get_option('app_name'))
|
conf_data.set('APPNAME', get_option('app_name'))
|
||||||
|
Reference in New Issue
Block a user