Don't load local cyberarm_engine of building release, fixed FieldPlanner and DriverTeamRotationGenerator not excluded from 'no configuration loaded' redirect

This commit is contained in:
2021-09-23 08:30:46 -05:00
parent 606032c81d
commit 9d75d2c09b
2 changed files with 13 additions and 7 deletions

View File

@@ -172,14 +172,11 @@ class Editor < CyberarmEngine::GuiState
@status_bar.clear
@body.clear
if window.backend.settings.config.empty?
if [TAC::Pages::Home, TAC::Pages::TACNET, TAC::Pages::Simulator, TAC::Pages::Configurations].include?(klass)
else
push_state(TAC::Dialog::AlertDialog, title: "No Config Loaded", message: "A config must be loaded.")
page(TAC::Pages::Configurations)
if window.backend.settings.config.empty? && page_requires_configuration?(klass)
push_state(TAC::Dialog::AlertDialog, title: "No Config Loaded", message: "A config must be loaded.")
page(TAC::Pages::Configurations)
return
end
return
end
@page.blur if @page
@@ -191,4 +188,12 @@ class Editor < CyberarmEngine::GuiState
@page.setup
@page.focus
end
def page_requires_configuration?(klass)
[
TAC::Pages::Editor,
TAC::Pages::Presets,
TAC::Pages::Search
].include?(klass)
end
end