online multiplayer chess game (note server currently down)
minor fixes
- fix barbutton theme button colors - make version label un-obtrusive - make piece set button buttons larger - fix colorpicker hue not being set - change GameConfig to use icons - normalize size of Sidebar buttons
bendn 2022-08-10
parent de183bf · commit 61c994a
-rw-r--r--ui/barbutton/BarButton.themebin640 -> 664 bytes
-rw-r--r--ui/board/Board.gd8
-rw-r--r--ui/colorpicker/ColorPicker.gd1
-rw-r--r--ui/menus/lobby/GameConfig.tscn32
-rw-r--r--ui/menus/settings/Settings.gd2
-rw-r--r--ui/menus/settings/Settings.tscn8
-rw-r--r--ui/menus/sidebarright/SidebarRight.tscn6
-rw-r--r--ui/menus/startmenu/StartMenu.tscn1
8 files changed, 28 insertions, 30 deletions
diff --git a/ui/barbutton/BarButton.theme b/ui/barbutton/BarButton.theme
index 5f9e838..aa6ab4d 100644
--- a/ui/barbutton/BarButton.theme
+++ b/ui/barbutton/BarButton.theme
Binary files differ
diff --git a/ui/board/Board.gd b/ui/board/Board.gd
index 19a9047..3a3c336 100644
--- a/ui/board/Board.gd
+++ b/ui/board/Board.gd
@@ -249,7 +249,7 @@ func square_clicked(clicked_square: BackgroundSquare) -> void:
return
var p := get_piece(clicked_square.square)
-
+
if chess.turn != Globals.team and is_instance_valid(last_clicked):
# PREMOVE AREA
var p_sq: int = Chess.SQUARE_MAP[clicked_square.square]
@@ -383,14 +383,14 @@ func _on_turn_over():
if premove:
background_array[premove.from].premove_indicator.hide()
background_array[premove.to].premove_indicator.hide()
- if board[premove.from]: # see if its valid
+ if board[premove.from]: # see if its valid
if premove.flags & (Chess.BITS.CAPTURE | Chess.BITS.EP_CAPTURE) && not board[premove.to]:
return
- var san = chess.__move_to_san(premove,chess.__generate_moves({legal = true}),false)
+ var san = chess.__move_to_san(premove, chess.__generate_moves({legal = true}), false)
if san:
var legal_moves = chess.moves({square = chess.algebraic(premove.from), stripped = true})
var is_possible_move = legal_moves.find(chess.stripped_san(san)) != -1
- if chess.__move_from_san(san, true) and (is_possible_move): # it is valid
+ if chess.__move_from_san(san, true) and (is_possible_move): # it is valid
Log.debug(["Executing premove:", san])
move(san, true, false) # make the move, send it to the opponent, dont prompt for premoves
premove = {}
diff --git a/ui/colorpicker/ColorPicker.gd b/ui/colorpicker/ColorPicker.gd
index e89e760..365e9ad 100644
--- a/ui/colorpicker/ColorPicker.gd
+++ b/ui/colorpicker/ColorPicker.gd
@@ -20,6 +20,7 @@ func open(newcolor: Color) -> void:
func update_color() -> void:
newcolorpreview.color = color
+ hueslider.hue = color.h
colorselect.color = color
diff --git a/ui/menus/lobby/GameConfig.tscn b/ui/menus/lobby/GameConfig.tscn
index 046e25b..20090f1 100644
--- a/ui/menus/lobby/GameConfig.tscn
+++ b/ui/menus/lobby/GameConfig.tscn
@@ -15,7 +15,7 @@ theme = ExtResource( 1 )
script = ExtResource( 5 )
button_group = ExtResource( 2 )
-[node name="General" type="VBoxContainer" parent="."]
+[node name="" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 25.0
@@ -23,13 +23,13 @@ margin_top = 79.0
margin_right = -25.0
margin_bottom = -25.0
-[node name="H" type="HBoxContainer" parent="General"]
+[node name="H" type="HBoxContainer" parent=""]
margin_right = 1372.0
margin_bottom = 100.0
custom_constants/separation = 0
alignment = 1
-[node name="Black" parent="General/H" instance=ExtResource( 7 )]
+[node name="Black" parent="/H" instance=ExtResource( 7 )]
margin_left = 586.0
margin_right = 686.0
margin_bottom = 100.0
@@ -39,7 +39,7 @@ group = ExtResource( 2 )
texture_normal = ExtResource( 4 )
pressed_color = Color( 0.576471, 0.631373, 0.631373, 1 )
-[node name="White" parent="General/H" instance=ExtResource( 7 )]
+[node name="White" parent="/H" instance=ExtResource( 7 )]
margin_left = 686.0
margin_right = 786.0
margin_bottom = 100.0
@@ -50,27 +50,27 @@ group = ExtResource( 2 )
texture_normal = ExtResource( 3 )
pressed_color = Color( 0.576471, 0.631373, 0.631373, 1 )
-[node name="H2" type="HBoxContainer" parent="General"]
+[node name="H2" type="HBoxContainer" parent=""]
margin_top = 110.0
margin_right = 1372.0
margin_bottom = 164.0
alignment = 1
-[node name="Stop" type="Button" parent="General/H2"]
+[node name="Stop" type="Button" parent="/H2"]
margin_left = 535.0
margin_right = 642.0
margin_bottom = 54.0
size_flags_horizontal = 4
text = "exit"
-[node name="Continue" type="Button" parent="General/H2"]
+[node name="Continue" type="Button" parent="/H2"]
margin_left = 652.0
margin_right = 836.0
margin_bottom = 54.0
size_flags_horizontal = 4
text = "continue "
-[node name="Advanced" type="VBoxContainer" parent="."]
+[node name="" type="VBoxContainer" parent="."]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
@@ -79,16 +79,16 @@ margin_top = 56.0
margin_right = -30.0
margin_bottom = -30.0
-[node name="Pgn" type="HBoxContainer" parent="Advanced"]
+[node name="Pgn" type="HBoxContainer" parent=""]
margin_right = 1362.0
margin_bottom = 54.0
-[node name="Label" type="Label" parent="Advanced/Pgn"]
+[node name="Label" type="Label" parent="/Pgn"]
margin_right = 40.0
margin_bottom = 34.0
text = "pgn: "
-[node name="PgnInput" type="LineEdit" parent="Advanced/Pgn"]
+[node name="PgnInput" type="LineEdit" parent="/Pgn"]
unique_name_in_owner = true
margin_right = 1352.0
margin_bottom = 54.0
@@ -96,13 +96,13 @@ size_flags_horizontal = 3
placeholder_text = "1. e4"
script = ExtResource( 6 )
-[node name="Checkmark" type="Label" parent="Advanced/Pgn"]
+[node name="Checkmark" type="Label" parent="/Pgn"]
margin_left = 1362.0
margin_top = 10.0
margin_right = 1362.0
margin_bottom = 44.0
-[connection signal="pressed" from="General/H2/Stop" to="." method="_on_Stop_pressed"]
-[connection signal="pressed" from="General/H2/Continue" to="." method="_on_Continue_pressed"]
-[connection signal="pgn_selected" from="Advanced/Pgn/PgnInput" to="." method="_on_pgn_selected"]
-[connection signal="text_changed" from="Advanced/Pgn/PgnInput" to="Advanced/Pgn/PgnInput" method="text_changed"]
+[connection signal="pressed" from="/H2/Stop" to="." method="_on_Stop_pressed"]
+[connection signal="pressed" from="/H2/Continue" to="." method="_on_Continue_pressed"]
+[connection signal="pgn_selected" from="/Pgn/PgnInput" to="." method="_on_pgn_selected"]
+[connection signal="text_changed" from="/Pgn/PgnInput" to="/Pgn/PgnInput" method="text_changed"]
diff --git a/ui/menus/settings/Settings.gd b/ui/menus/settings/Settings.gd
index 7151d9e..3d569a0 100644
--- a/ui/menus/settings/Settings.gd
+++ b/ui/menus/settings/Settings.gd
@@ -53,7 +53,7 @@ func _ready() -> void:
if OS.has_feature("HTML5"):
borderlessbutton.queue_free()
for i in piece_sets: # add the items
- piece_set_button.add_icon_item(load("res://assets/pieces/" + i + "/wP.png"), i, Vector2(50, 50))
+ piece_set_button.add_icon_item(load("res://assets/pieces/" + i + "/wP.png"), i, Vector2(75, 75))
piece_set_button.selected = Array(piece_sets).find(settings.piece_set)
update_vars()
update_button_visuals()
diff --git a/ui/menus/settings/Settings.tscn b/ui/menus/settings/Settings.tscn
index da97e8d..ad9ee97 100644
--- a/ui/menus/settings/Settings.tscn
+++ b/ui/menus/settings/Settings.tscn
@@ -65,7 +65,7 @@ rect_min_size = Vector2( 200, 60 )
size_flags_horizontal = 4
text = "piece set"
icon = ExtResource( 7 )
-offset = null
+offset = Vector2( 50, -50 )
[node name="" type="VBoxContainer" parent="H/TabContainer"]
visible = false
@@ -110,12 +110,12 @@ toggle_mode = true
text = "borders"
script = ExtResource( 3 )
-[node name="" type="VBoxContainer" parent="H/TabContainer"]
+[node name="" type="VBoxContainer" parent="H/TabContainer"]
visible = false
margin_right = 40.0
margin_bottom = 40.0
-[node name="rainbow" type="Button" parent="H/TabContainer/"]
+[node name="rainbow" type="Button" parent="H/TabContainer/"]
margin_right = 609.0
margin_bottom = 140.0
focus_mode = 0
@@ -168,5 +168,5 @@ __meta__ = {
[connection signal="toggled" from="H/TabContainer//FullscreenButton" to="." method="_on_FullscreenButton_toggled"]
[connection signal="toggled" from="H/TabContainer//VsyncButton" to="." method="_on_VsyncButton_toggled"]
[connection signal="toggled" from="H/TabContainer//Borderless" to="." method="_on_Borderless_toggled"]
-[connection signal="toggled" from="H/TabContainer//rainbow" to="." method="_on_rainbow_toggled"]
+[connection signal="toggled" from="H/TabContainer//rainbow" to="." method="_on_rainbow_toggled"]
[connection signal="pressed" from="H/Container/resetbutton" to="." method="_on_resetbutton_pressed"]
diff --git a/ui/menus/sidebarright/SidebarRight.tscn b/ui/menus/sidebarright/SidebarRight.tscn
index 07654e2..6b06dfe 100644
--- a/ui/menus/sidebarright/SidebarRight.tscn
+++ b/ui/menus/sidebarright/SidebarRight.tscn
@@ -1,14 +1,12 @@
-[gd_scene load_steps=24 format=2]
+[gd_scene load_steps=22 format=2]
[ext_resource path="res://ui/menus/sidebarright/drawbutton.gd" type="Script" id=1]
[ext_resource path="res://ui/menus/sidebarright/resignbutton.gd" type="Script" id=2]
[ext_resource path="res://ui/Status.gd" type="Script" id=3]
-[ext_resource path="res://ui/ubuntu-medium.tres" type="DynamicFont" id=4]
[ext_resource path="res://ui/barbutton/default_highlight.tres" type="StyleBox" id=5]
[ext_resource path="res://ui/barbutton/default_pressed.tres" type="StyleBox" id=6]
[ext_resource path="res://ui/barbutton/default.tres" type="StyleBox" id=7]
[ext_resource path="res://ui/ubuntu-bold-regular.tres" type="DynamicFont" id=8]
-[ext_resource path="res://ui/ubuntu-bold-medium.tres" type="DynamicFont" id=9]
[ext_resource path="res://ui/menus/sidebarright/OpeningLabel.gd" type="Script" id=10]
[ext_resource path="res://ui/menus/sidebarright/material/MaterialLabelManager.gd" type="Script" id=11]
[ext_resource path="res://ui/menus/sidebarright/material/MaterialLabel.gd" type="Script" id=12]
@@ -126,7 +124,6 @@ hint_tooltip = "flip the board"
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
-custom_fonts/font = ExtResource( 9 )
text = "ﮨ"
script = ExtResource( 19 )
@@ -139,7 +136,6 @@ hint_tooltip = "request a draw"
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
-custom_fonts/font = ExtResource( 4 )
text = "½-½"
script = ExtResource( 1 )
confirm_text = "Your opponent requests a draw"
diff --git a/ui/menus/startmenu/StartMenu.tscn b/ui/menus/startmenu/StartMenu.tscn
index 3e3cd1a..c6ffc88 100644
--- a/ui/menus/startmenu/StartMenu.tscn
+++ b/ui/menus/startmenu/StartMenu.tscn
@@ -88,6 +88,7 @@ anchor_bottom = 1.0
margin_top = -34.0
margin_right = -11.0
margin_bottom = -11.0
+custom_colors/font_color = Color( 0.345098, 0.431373, 0.458824, 1 )
custom_fonts/font = ExtResource( 4 )
text = "ver "
align = 2