mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Renamed MapLoader to MapParser, added level select menu
This commit is contained in:
@@ -2,11 +2,11 @@ class IMICFPS
|
||||
class LoadingState < Menu
|
||||
def setup
|
||||
window.needs_cursor = false
|
||||
@map_loader = MapLoader.new(map_file: @options[:map_file])
|
||||
@map_parser = MapParser.new(map_file: @options[:map_file])
|
||||
|
||||
title "I-MIC FPS"
|
||||
@subheading = Text.new("Loading Map: #{@map_loader.metadata.name}", y: 100, size: 50, alignment: :center)
|
||||
@description = Text.new("Map created by: #{@map_loader.metadata.authors.join(", ")}\n#{@map_loader.metadata.description}", y: 180, size: 24, alignment: :center)
|
||||
@subheading = Text.new("Loading Map: #{@map_parser.metadata.name}", y: 100, size: 50, alignment: :center)
|
||||
@description = Text.new("Map created by: #{@map_parser.metadata.authors.join(", ")}\n#{@map_parser.metadata.description}", y: 180, size: 24, alignment: :center)
|
||||
@state = Text.new("Preparing...", y: window.height/2-40, size: 40, alignment: :center)
|
||||
@percentage = Text.new("0%", y: window.height - 100 + 25, size: 50, alignment: :center)
|
||||
|
||||
@@ -15,9 +15,9 @@ class IMICFPS
|
||||
@asset_index = 0
|
||||
add_asset(:shader, nil, "default")
|
||||
|
||||
add_asset(:model, @map_loader.terrain.package, @map_loader.terrain.name)
|
||||
add_asset(:model, @map_loader.skydome.package, @map_loader.skydome.name)
|
||||
@map_loader.entities.each do |entity|
|
||||
add_asset(:model, @map_parser.terrain.package, @map_parser.terrain.name)
|
||||
add_asset(:model, @map_parser.skydome.package, @map_parser.skydome.name)
|
||||
@map_parser.entities.each do |entity|
|
||||
add_asset(:model, entity.package, entity.name)
|
||||
end
|
||||
|
||||
@@ -69,7 +69,7 @@ class IMICFPS
|
||||
|
||||
unless @asset_index < @assets.count
|
||||
if @act && Gosu.milliseconds-@completed_for_ms > 250
|
||||
push_state(@options[:forward], map_loader: @map_loader)
|
||||
push_state(@options[:forward], map_parser: @map_parser)
|
||||
else
|
||||
@act = true
|
||||
@completed_for_ms = Gosu.milliseconds unless @lock
|
||||
|
||||
Reference in New Issue
Block a user