mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Renamed MapLoader to MapParser, added level select menu
This commit is contained in:
@@ -13,7 +13,7 @@ class IMICFPS
|
||||
push_state(SettingsMenu)
|
||||
end
|
||||
|
||||
link "Disconnect" do
|
||||
link "Quit" do
|
||||
push_state(MainMenu)
|
||||
end
|
||||
end
|
||||
|
||||
20
lib/ui/menus/level_select_menu.rb
Normal file
20
lib/ui/menus/level_select_menu.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class IMICFPS
|
||||
class LevelSelectMenu < Menu
|
||||
def setup
|
||||
title "I-MIC FPS"
|
||||
subtitle "Choose a Map"
|
||||
|
||||
Dir.glob(GAME_ROOT_PATH + "/maps/*.json").map { |file| [file, MapParser.new(map_file: file)]}.each do |file, map|
|
||||
link map.metadata.name do
|
||||
push_state(
|
||||
LoadingState.new(forward: Game, map_file: file)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
link "Back" do
|
||||
pop_state
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3,7 +3,8 @@ class IMICFPS
|
||||
def setup
|
||||
title "I-MIC FPS"
|
||||
link "Single Player" do
|
||||
push_state(LoadingState.new(forward: Game, map_file: GAME_ROOT_PATH + "/maps/test_map.json"))
|
||||
push_state(LevelSelectMenu)
|
||||
# push_state(LoadingState.new(forward: Game, map_file: GAME_ROOT_PATH + "/maps/test_map.json"))
|
||||
end
|
||||
link "Settings" do
|
||||
push_state(SettingsMenu)
|
||||
@@ -13,4 +14,4 @@ class IMICFPS
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user