Refreshed a few menus, stubbed Settings menu

This commit is contained in:
2020-05-05 10:46:23 -05:00
parent c1eb02a106
commit a078645b94
11 changed files with 259 additions and 40 deletions

View File

@@ -1,13 +1,9 @@
class IMICFPS
class AssetViewerTool
class MainMenu < CyberarmEngine::GuiState
include CommonMethods
class MainMenu < Menu
def setup
window.needs_cursor = true
label "#{IMICFPS::NAME}", text_size: 50
label "Asset Viewer", text_size: 28
@manifests = []
Dir.glob(GAME_ROOT_PATH + "/assets/**/manifest.yaml").each do |manifest|
begin
@@ -19,24 +15,31 @@ class IMICFPS
@manifests.sort_by! { |m| m.name.downcase }
button "Back", margin_bottom: 25 do
pop_state
end
label "#{IMICFPS::NAME}", text_size: 100, color: Gosu::Color::BLACK
label "Asset Viewer", text_size: 50
flow(margin: 10) do
@manifests.each do |manifest|
button manifest.name do
push_state(TurnTable, manifest: manifest)
flow(width: 1.0, height: 1.0) do
stack(width: 0.25, height: 1.0) do
button "Refresh" do
request_recalculate
end
button "Back", margin_bottom: 25 do
pop_state
end
end
stack(width: 0.5, height: 1.0) do
flow(width: 1.0, height: 1.0) do
@manifests.each do |manifest|
button manifest.name do
push_state(TurnTable, manifest: manifest)
end
end
end
end
end
end
def draw
menu_background(Menu::PRIMARY_COLOR, Menu::ACCENT_COLOR, Menu::BAR_COLOR_STEP, Menu::BAR_ALPHA, Menu::BAR_SIZE, Menu::BAR_SLOPE)
super
end
def update
super

View File

@@ -1,8 +1,6 @@
class IMICFPS
class MapEditorTool
class MainMenu < CyberarmEngine::GuiState
include CommonMethods
class MainMenu < Menu
def setup
window.needs_cursor = true
@@ -37,11 +35,6 @@ class IMICFPS
end
end
def draw
menu_background(Menu::PRIMARY_COLOR, Menu::ACCENT_COLOR, Menu::BAR_COLOR_STEP, Menu::BAR_ALPHA, Menu::BAR_SIZE, Menu::BAR_SLOPE)
super
end
def update
super