now save player name from SoloLobby, made Director know able game so that construction workers can set active tool for Game (todo: implement tools :D), drafted 'structure' document

This commit is contained in:
2019-11-22 17:18:44 -06:00
parent 8b6f629a6a
commit 2b1ff35a34
8 changed files with 56 additions and 19 deletions

View File

@@ -8,7 +8,7 @@ class IMICRTS
@options[:networking_mode] ||= :host
@player = Player.new(id: 0)
@director = Director.new(map: Map.new(map_file: "maps/test_map.tmx"), networking_mode: @options[:networking_mode], players: [@player])
@director = Director.new(game: self, map: Map.new(map_file: "maps/test_map.tmx"), networking_mode: @options[:networking_mode], players: [@player])
@entity_controller = EntityController.new(game: self, director: @director, player: @player)
@overlays = []
@@ -172,8 +172,12 @@ class IMICRTS
@player.camera.button_up(id)
end
def set_tool(tool, *args)
pp tool, args
end
def finalize
@director.finalize
end
end
end
end

View File

@@ -12,7 +12,7 @@ class IMICRTS
end
flow do
button("Refresh") do
# refresh_games
refresh_games
end
button("Host Game")
button("Join Game")
@@ -25,9 +25,9 @@ class IMICRTS
end
def refresh_games
@games_list.clear do
label "No games found..."
@games_list.clear do |stack|
stack.label "No games found..."
end
end
end
end
end

View File

@@ -35,15 +35,22 @@ class IMICRTS
flow(width: 1.0) do
button("Accept", width: 0.5) do
Setting.set(:player_name, @player_name.value)
save_playerdata
push_state(Game, networking_mode: :virtual)
end
button("Back", align: :right) do
save_playerdata
push_state(MainMenu)
end
end
end
end
def save_playerdata
Setting.set(:player_name, @player_name.value)
Setting.save!
end
end
end
end