 [WIP] Split up lobby -> menu, lobby, custom_game
lobby.gd had gotten big, bloated, ugly, and hard to read. It needed a
refactor. The first thing I did is split up the *GUI* into the logical
steps it should be. So the new flow is:
- Start the game
- Click "Quick Play"
- Matchmaking begins on my dedicated server
- Start the game
- Click "Custom Game"
- *Only now* am I presented with server / client options
- Start the game
- Click "Singleplayer"
- Singleplayer
NOW, and only now, and NO MATTER WHAT PATH I TAKE, I am taken to the
*lobby*, which now is where I:
- Choose my name
- Choose hero
- See list of players
- Get my team assigned
- Anything else that I might like to put in
The point here is that this has *nothing* to do with handshaking /
matchmaking / etc! This is just part of the game! At this point I have
*already been connected* to the server. I've already been aquainted with
my other players. The game has begun.
I put the things that don't belong in any of these flows in
networking.gd, a sort of model-view sorta thing. All of these flows use
some sort of networking thing like `init_server` that tbh should be
*completely* abstracted from the UI.
It's totally a WIP!!! Above is the IDEA, but below is what I've actually
*done*:
- Made the scenes, made a passable UI for each one that at least
indicates ~what they'll do
- Made the corresponding scripts, and split up the lobby script into
ABOUT where I think it'll end up, but no promises
It still errors all over the place, and it's nowhere near properly
organized. PLUS, I'd also like to rewrite a lot of the code / rename
things as part of the initial refactor goal of making me able to
actually think about networking.
7 years ago |
|
- [gd_scene load_steps=5 format=2]
-
- [ext_resource path="res://assets/theme.tres" type="Theme" id=1]
- [ext_resource path="res://scripts/menu.gd" type="Script" id=2]
-
- [sub_resource type="DynamicFontData" id=1]
-
- font_path = "res://assets/DejaVuSansMono.ttf"
-
- [sub_resource type="DynamicFont" id=2]
-
- size = 30
- use_mipmaps = false
- use_filter = false
- font_data = SubResource( 1 )
-
- [node name="Menu" type="Control"]
-
- anchor_left = 0.0
- anchor_top = 0.0
- anchor_right = 0.0
- anchor_bottom = 0.0
- margin_right = 1024.0
- margin_bottom = 600.0
- rect_pivot_offset = Vector2( 0, 0 )
- mouse_filter = 0
- mouse_default_cursor_shape = 0
- size_flags_horizontal = 1
- size_flags_vertical = 1
- theme = ExtResource( 1 )
- script = ExtResource( 2 )
-
- [node name="Title" type="Label" parent="." index="0"]
-
- anchor_left = 0.0
- anchor_top = 0.0
- anchor_right = 0.0
- anchor_bottom = 0.0
- margin_left = 60.0
- margin_top = 50.0
- margin_right = 248.0
- margin_bottom = 90.0
- rect_pivot_offset = Vector2( 0, 0 )
- mouse_filter = 2
- mouse_default_cursor_shape = 0
- size_flags_horizontal = 1
- size_flags_vertical = 4
- custom_fonts/font = SubResource( 2 )
- text = "VANAGLORIA"
- percent_visible = 1.0
- lines_skipped = 0
- max_lines_visible = -1
-
- [node name="Center" type="Control" parent="." index="1"]
-
- anchor_left = 0.5
- anchor_top = 0.5
- anchor_right = 0.5
- anchor_bottom = 0.5
- margin_left = -20.0
- margin_top = -20.0
- margin_right = 20.0
- margin_bottom = 20.0
- rect_pivot_offset = Vector2( 0, 0 )
- mouse_filter = 0
- mouse_default_cursor_shape = 0
- size_flags_horizontal = 1
- size_flags_vertical = 1
-
- [node name="Play" type="Button" parent="Center" index="0"]
-
- anchor_left = 0.0
- anchor_top = 0.0
- anchor_right = 0.0
- anchor_bottom = 0.0
- margin_left = -250.0
- margin_top = -70.0
- margin_right = 298.0
- margin_bottom = -10.0
- rect_pivot_offset = Vector2( 0, 0 )
- focus_mode = 2
- mouse_filter = 0
- mouse_default_cursor_shape = 0
- size_flags_horizontal = 1
- size_flags_vertical = 1
- toggle_mode = false
- enabled_focus_mode = 2
- shortcut = null
- group = null
- text = "Quick Play"
- flat = false
- align = 1
-
- [node name="CustomGame" type="Button" parent="Center" index="1"]
-
- anchor_left = 0.0
- anchor_top = 0.0
- anchor_right = 0.0
- anchor_bottom = 0.0
- margin_left = -252.0
- margin_top = 14.0
- margin_right = 300.0
- margin_bottom = 75.0
- rect_pivot_offset = Vector2( 0, 0 )
- focus_mode = 2
- mouse_filter = 0
- mouse_default_cursor_shape = 0
- size_flags_horizontal = 1
- size_flags_vertical = 1
- toggle_mode = false
- enabled_focus_mode = 2
- shortcut = null
- group = null
- text = "Custom Game"
- flat = false
- align = 1
-
- [node name="Singleplayer" type="Button" parent="Center" index="2"]
-
- anchor_left = 0.0
- anchor_top = 0.0
- anchor_right = 0.0
- anchor_bottom = 0.0
- margin_left = -251.0
- margin_top = 104.0
- margin_right = 299.0
- margin_bottom = 170.0
- rect_pivot_offset = Vector2( 0, 0 )
- focus_mode = 2
- mouse_filter = 0
- mouse_default_cursor_shape = 0
- size_flags_horizontal = 1
- size_flags_vertical = 1
- toggle_mode = false
- enabled_focus_mode = 2
- shortcut = null
- group = null
- text = "Singleplayer"
- flat = false
- align = 1
-
-
|