mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-13 14:52:35 +00:00
Moved menus into their own folder, stubbed bunch of menus
This commit is contained in:
@@ -11,8 +11,13 @@ require_relative "lib/camera"
|
||||
require_relative "lib/states/boot"
|
||||
require_relative "lib/states/game"
|
||||
require_relative "lib/states/closing"
|
||||
require_relative "lib/states/about_menu"
|
||||
require_relative "lib/states/main_menu"
|
||||
require_relative "lib/states/menus/main_menu"
|
||||
require_relative "lib/states/menus/credits_menu"
|
||||
require_relative "lib/states/menus/settings_menu"
|
||||
require_relative "lib/states/menus/solo_play_menu"
|
||||
require_relative "lib/states/menus/multiplayer_menu"
|
||||
require_relative "lib/states/menus/solo_lobby_menu"
|
||||
require_relative "lib/states/menus/multiplayer_lobby_menu"
|
||||
|
||||
require_relative "lib/zorder"
|
||||
require_relative "lib/entity"
|
||||
|
||||
@@ -11,19 +11,27 @@ class IMICRTS
|
||||
|
||||
label "SIDEBAR", text_size: 78, margin_bottom: 20
|
||||
|
||||
@h = button("Harvester", width: 1.0) do
|
||||
@units << Entity.new(
|
||||
images: Gosu::Image.new("#{ASSETS_PATH}/vehicles/harvester/images/harvester.png", retro: true),
|
||||
position: CyberarmEngine::Vector.new(rand(window.width), rand(window.height), ZOrder::GROUND_VEHICLE),
|
||||
angle: rand(360)
|
||||
)
|
||||
end
|
||||
@c = button("Construction Worker", width: 1.0) do
|
||||
@units << Entity.new(
|
||||
images: Gosu::Image.new("#{ASSETS_PATH}/vehicles/construction_worker/images/construction_worker.png", retro: true),
|
||||
position: CyberarmEngine::Vector.new(rand(window.width), rand(window.height), ZOrder::GROUND_VEHICLE),
|
||||
angle: rand(360)
|
||||
)
|
||||
flow do
|
||||
@buttons = stack(width: 75) do
|
||||
@h = button("Harvester", width: 1.0) do
|
||||
@units << Entity.new(
|
||||
images: Gosu::Image.new("#{ASSETS_PATH}/vehicles/harvester/images/harvester.png", retro: true),
|
||||
position: CyberarmEngine::Vector.new(rand(window.width), rand(window.height), ZOrder::GROUND_VEHICLE),
|
||||
angle: rand(360)
|
||||
)
|
||||
end
|
||||
@c = button("Construction Worker", width: 1.0) do
|
||||
@units << Entity.new(
|
||||
images: Gosu::Image.new("#{ASSETS_PATH}/vehicles/construction_worker/images/construction_worker.png", retro: true),
|
||||
position: CyberarmEngine::Vector.new(rand(window.width), rand(window.height), ZOrder::GROUND_VEHICLE),
|
||||
angle: rand(360)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
stack(width: 0.25, height: 1.0) do
|
||||
background Gosu::Color::GREEN
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
class IMICRTS
|
||||
class MainMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
self.show_cursor = true
|
||||
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
label "I-MIC-RTS", text_size: 78, margin: 20
|
||||
button("Play", width: 1.0) do
|
||||
push_state(Game)
|
||||
end
|
||||
|
||||
button("About", width: 1.0) do
|
||||
push_state(AboutMenu)
|
||||
end
|
||||
|
||||
button("Exit", width: 1.0) do
|
||||
push_state(Closing)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
class IMICRTS
|
||||
class AboutMenu < CyberarmEngine::GuiState
|
||||
class CreditsMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
@@ -9,7 +9,7 @@ class IMICRTS
|
||||
label "About I-MIC-RTS", text_size: 78, margin: 20
|
||||
label "Words go here.\nMore words also go here. Thank you and have a nice day."
|
||||
|
||||
button("Back", width: 1.0) do
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
34
lib/states/menus/main_menu.rb
Normal file
34
lib/states/menus/main_menu.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
class IMICRTS
|
||||
class MainMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
self.show_cursor = true
|
||||
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
label "I-MIC-RTS", text_size: 78, margin: 20
|
||||
button("Solo Play", width: 1.0) do
|
||||
# push_state(SoloPlayMenu)
|
||||
push_state(SoloLobbyMenu)
|
||||
end
|
||||
|
||||
button("Multiplayer", width: 1.0) do
|
||||
push_state(MultiplayerMenu)
|
||||
end
|
||||
|
||||
button("Settings", width: 1.0, margin_top: 20) do
|
||||
push_state(SettingsMenu)
|
||||
end
|
||||
|
||||
button("Credits", width: 1.0) do
|
||||
push_state(CreditsMenu)
|
||||
end
|
||||
|
||||
button("Exit", width: 1.0, margin_top: 20) do
|
||||
push_state(Closing)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
33
lib/states/menus/multiplayer_menu.rb
Normal file
33
lib/states/menus/multiplayer_menu.rb
Normal file
@@ -0,0 +1,33 @@
|
||||
class IMICRTS
|
||||
class MultiplayerMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Multiplayer", text_size: 78, margin: 20
|
||||
label "Games", text_size: 32
|
||||
@games_list = stack(border_color: Gosu::Color::WHITE, border_thickness: 2) do
|
||||
end
|
||||
flow do
|
||||
button("Refresh") do
|
||||
# refresh_games
|
||||
end
|
||||
button("Host Game")
|
||||
button("Join Game")
|
||||
end
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def refresh_games
|
||||
@games_list.clear do
|
||||
label "No games found..."
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
18
lib/states/menus/settings_menu.rb
Normal file
18
lib/states/menus/settings_menu.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class IMICRTS
|
||||
class SettingsMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Settings", text_size: 78, margin: 20
|
||||
label "Nothing to see here, move along."
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
48
lib/states/menus/solo_lobby_menu.rb
Normal file
48
lib/states/menus/solo_lobby_menu.rb
Normal file
@@ -0,0 +1,48 @@
|
||||
class IMICRTS
|
||||
class SoloLobbyMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Lobby", text_size: 78, margin: 20
|
||||
stack do
|
||||
flow do
|
||||
|
||||
elements = [:edit_line, :button, :button, :toggle_button]
|
||||
["Players", "Color", "Team", "Map Preview"].each_with_index do |item, index|
|
||||
stack do
|
||||
label item, background: 0xff7a0d71
|
||||
|
||||
stack do
|
||||
case elements[index]
|
||||
when :edit_line
|
||||
edit_line "Novice"
|
||||
when :button
|
||||
button item
|
||||
when :toggle_button
|
||||
toggle_button
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
stack(height: 100) do
|
||||
end
|
||||
end
|
||||
|
||||
flow do
|
||||
button("Accept", width: 0.4) do
|
||||
push_state(Game)
|
||||
end
|
||||
|
||||
button("Back", width: 0.4, margin_left: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
25
lib/states/menus/solo_play_menu.rb
Normal file
25
lib/states/menus/solo_play_menu.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class IMICRTS
|
||||
class SoloPlayMenu < CyberarmEngine::GuiState
|
||||
def setup
|
||||
background [0xff7b6ead, 0xff7a0d71, 0xff7a0d71, 0xff7b6ead]
|
||||
|
||||
stack(height: 1.0) do
|
||||
background [0xff555555, Gosu::Color::GRAY]
|
||||
|
||||
label "Solo Play", text_size: 78, margin: 20
|
||||
label "Words go here.\nMore words also go here. Thank you and have a nice day."
|
||||
|
||||
button("Campaign", width: 1.0) do
|
||||
end
|
||||
|
||||
button("Skirmish", width: 1.0) do
|
||||
push_state(SoloLobbyMenu)
|
||||
end
|
||||
|
||||
button("Back", width: 1.0, margin_top: 20) do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user