online multiplayer chess game (note server currently down)
125 files changed, 1560 insertions, 994 deletions
@@ -127,7 +127,7 @@ func flip_board() -> void: func init_labels() -> void: - # foreground.offset = rect_global_position + foreground.offset = rect_global_position for i in range(8): labels.letters.append( init_label(i, Vector2(i, 7), "abcdefgh"[i], VALIGN_BOTTOM, Label.ALIGN_LEFT, Vector2(10, -10)) @@ -145,7 +145,7 @@ func init_label(i: int, position: Vector2, text: String, valign := 0, align := 0 label.rect_position = (position * piece_size) + off label.text = text label.add_color_override("font_color", Globals.board_color1 if i % 2 == 0 else Globals.board_color2) - var font: DynamicFont = load("res://ui/verdana-bold.tres").duplicate() + var font: DynamicFont = load("res://ui/ubuntu-bold.tres").duplicate() font.size = 15 label.add_font_override("font", font) foreground.add_child(label) @@ -25,7 +25,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 mouse_filter = 2 -[node name="Foreground" type="Control" parent="."] +[node name="Foreground" type="CanvasLayer" parent="."] [node name="Darken" type="ColorRect" parent="."] visible = false @@ -8,7 +8,8 @@ bend-n/chess is distributed in the hope that it will be useful, but WITHOUT ANY Files|Author(s)|License(s) --- | --- | --- -|Roboto in assets/ui/Roboto-Medium|[ChristianRobertson](https://fonts.google.com/specimen/Roboto)|[Apache2.0](https://www.apache.org/licenses/LICENSE-2.0)|[SILOpenFontLicense](https://www.fontspace.com/help#license-17)| +|Cascadia Code in assets|Aaron Bell|[SILOpenFontLicense 1.1](https://github.com/eliheuer/caskaydia-cove/blob/master/OFL.txt)| +|Ubuntu in assets|[Daiton Mag](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Ubuntu)|[Ubuntu Font License](https://ubuntu.com/legal/font-licence)| |assets/pieces/horsey|cham, michael1241|[CCBY-NC-SA4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)| |assets/pieces/cburnett|[ColinM.L.Burnett](https://en.wikipedia.org/wiki/User:Cburnett)|[GPLv2+](https://www.gnu.org/licenses/gpl-2.0.txt)| |assets/pieces/pirouetti|[pirouetti](https://lichess.org/@/pirouetti)|AGPLv3+| @@ -2,7 +2,7 @@ extends Node2D var refs := [] # = [[ node : object, variable : string, (code : string) ]] var style: StyleBox = load("res://ui/theme/transblack.tres") -var font: Font = load("res://ui/verdana-bold.tres") +var font: Font = load("res://ui/ubuntu-bold.tres") var debug := false # in debug mode or not var timer := Timer.new() var expr := Expression.new() @@ -7,14 +7,14 @@ [ext_resource path="res://ui/theme/flatblack.tres" type="StyleBox" id=7] [ext_resource path="res://ui/chat/Chat.tscn" type="PackedScene" id=9] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=10] -[ext_resource path="res://assets/ui/verdana-bold.ttf" type="DynamicFontData" id=11] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=11] [ext_resource path="res://ui/theme/buttonhover.tres" type="StyleBox" id=12] -[ext_resource path="res://assets/ui/verdana.ttf" type="DynamicFontData" id=13] +[ext_resource path="res://assets/ui/ubuntu.ttf" type="DynamicFontData" id=13] [ext_resource path="res://ui/theme/button.tres" type="StyleBox" id=14] [ext_resource path="res://assets/ui/button.png" type="Texture" id=15] [ext_resource path="res://assets/ui/checkedbox.png" type="Texture" id=16] [ext_resource path="res://assets/ui/CascadiaCode.ttf" type="DynamicFontData" id=17] -[ext_resource path="res://assets/ui/verdana-bold-italic.ttf" type="DynamicFontData" id=18] +[ext_resource path="res://assets/ui/ubuntu-bold-italic.ttf" type="DynamicFontData" id=18] [ext_resource path="res://Board.tscn" type="PackedScene" id=29] [sub_resource type="StyleBoxTexture" id=6] diff --git a/PGN/test_pgns.gd b/PGN/test_pgns.gd index 2b727aa..f6d76ee 100644 --- a/PGN/test_pgns.gd +++ b/PGN/test_pgns.gd @@ -25,3 +25,7 @@ func _input(_event): get_node("/root/Game").queue_free() get_parent().show() Globals.reset_vars() + + +func _on_test_chat_pressed(): + get_tree().change_scene_to(preload("res://ui/chat/Chat.tscn")) diff --git a/PGN/test_pgns.tscn b/PGN/test_pgns.tscn index eccb21d..a064bb7 100644 --- a/PGN/test_pgns.tscn +++ b/PGN/test_pgns.tscn @@ -11,28 +11,40 @@ script = ExtResource( 2 ) pgns = PoolStringArray( "1.Nf3 Nf6 2.c4 g6 3.Nc3 Bg7 4.d4 O-O 5.Bf4 d5 6.Qb3 dxc4 7.Qxc4 c6 8.e4 Nbd7 9.Rd1 Nb6 10.Qc5 Bg4 11.Bg5 Na4 12.Qa3 Nxc3 13.bxc3 Nxe4 14.Bxe7 Qb6 15.Bc4 Nxc3 16.Bc5 Rfe8+ 17.Kf1 Be6 18.Bxb6 Bxc4+ 19.Kg1 Ne2+ 20.Kf1 Nxd4+ 21.Kg1 Ne2+ 22.Kf1 Nc3+ 23.Kg1 axb6 24.Qb4 Ra4 25.Qxb6 Nxd1 26.h3 Rxa2 27.Kh2 Nxf2 28.Re1 Rxe1 29.Qd8+ Bf8 30.Nxe1 Bd5 31.Nf3 Ne4 32.Qb8 b5 33.h4 h5 34.Ne5 Kg7 35.Kg1 Bc5+ 36.Kf1 Ng3+ 37.Ke1 Bb4+ 38.Kd1 Bb3+ 39.Kc1 Ne2+ 40.Kb1 Nc3+ 41.Kc1 Rc2# 0-1", "1. e4 e5 2. Nf3 Nc6 3. Bb5 Bc5 4. O-O Nf6 5. Nc3 Nb4 6. Nxe5 c6 7. Bc4 d5 8. exd5 cxd5 9. Bb5+ Bd7 10. Bxd7+ Nxd7 11. Nxd7 Qxd7 12. Re1+ Be7 13. a3 Nc6 14. d4 O-O-O 15. h3 Bh4 16. Qh5 Bf6 17. Nb5 Nxd4 18. Nxa7+ Kb8 19. Bg5 Nxc2 20. Bxf6 gxf6 21. a4 Kxa7 22. Qe2 Nxe1 23. Qxe1 Rhe8 24. Qa5+ Kb8 25. Qb4 d4 26. a5 Re6", "1. e4 f5 2. d4 g5 3. Qh5#" ) [node name="gameofthecentury" type="Button" parent="."] -margin_left = 454.0 -margin_right = 967.0 -margin_bottom = 106.0 +margin_left = 489.0 +margin_right = 932.0 +margin_bottom = 102.0 +focus_mode = 0 size_flags_horizontal = 4 text = "game of the century" [node name="test sign" type="Button" parent="."] -margin_left = 585.0 -margin_top = 121.0 -margin_right = 837.0 -margin_bottom = 227.0 +margin_left = 599.0 +margin_top = 117.0 +margin_right = 822.0 +margin_bottom = 219.0 +focus_mode = 0 size_flags_horizontal = 4 text = "test sign" [node name="test mate" type="Button" parent="."] -margin_left = 575.0 -margin_top = 242.0 -margin_right = 846.0 -margin_bottom = 348.0 +margin_left = 590.0 +margin_top = 234.0 +margin_right = 831.0 +margin_bottom = 336.0 +focus_mode = 0 size_flags_horizontal = 4 text = "test mate" +[node name="test chat" type="Button" parent="."] +margin_left = 643.0 +margin_top = 351.0 +margin_right = 779.0 +margin_bottom = 453.0 +size_flags_horizontal = 4 +text = "ﭧ" + [connection signal="pressed" from="gameofthecentury" to="." method="_load" binds= [ 0 ]] [connection signal="pressed" from="test sign" to="." method="_load" binds= [ 1 ]] [connection signal="pressed" from="test mate" to="." method="_load" binds= [ 2 ]] +[connection signal="pressed" from="test chat" to="." method="_on_test_chat_pressed"] diff --git a/TextInput.tscn b/TextInput.tscn deleted file mode 100644 index 588b063..0000000 --- a/TextInput.tscn +++ /dev/null @@ -1,106 +0,0 @@ -[gd_scene load_steps=11 format=2] - -[ext_resource path="res://ui/chat/chat_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/chat/grayscale.shader" type="Shader" id=2] -[ext_resource path="res://ui/chat/emojibutton.gd" type="Script" id=3] -[ext_resource path="res://ui/chat/texteditor.gd" type="Script" id=4] -[ext_resource path="res://ui/chat/TextInput.gd" type="Script" id=5] -[ext_resource path="res://assets/emojis/happy.png" type="Texture" id=6] -[ext_resource path="res://ui/gridmenu/GridMenu.gd" type="Script" id=7] - -[sub_resource type="StyleBoxFlat" id=1] -bg_color = Color( 0.25098, 0.266667, 0.294118, 1 ) - -[sub_resource type="ShaderMaterial" id=2] -shader = ExtResource( 2 ) -shader_param/saturation = 0.0 -shader_param/scale = 1.0 - -[sub_resource type="StyleBoxEmpty" id=3] - -[node name="TextInput" type="PanelContainer"] -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_top = -50.0 -theme = ExtResource( 1 ) -custom_styles/panel = SubResource( 1 ) -script = ExtResource( 5 ) -__meta__ = { -"_edit_lock_": true -} - -[node name="h" type="HBoxContainer" parent="."] -margin_right = 1422.0 -margin_bottom = 50.0 -custom_constants/separation = 0 - -[node name="MC" type="MarginContainer" parent="h"] -margin_right = 1372.0 -margin_bottom = 50.0 -size_flags_horizontal = 3 -custom_constants/margin_right = 5 -custom_constants/margin_left = 5 - -[node name="placeholder" type="Label" parent="h/MC"] -margin_left = 5.0 -margin_top = 15.0 -margin_right = 131.0 -margin_bottom = 35.0 -size_flags_horizontal = 0 -custom_colors/font_color = Color( 1, 1, 1, 0.509804 ) -text = "write text here" -valign = 2 - -[node name="text" type="TextEdit" parent="h/MC"] -margin_left = 5.0 -margin_top = 15.0 -margin_right = 1367.0 -margin_bottom = 35.0 -rect_min_size = Vector2( 200, 20 ) -size_flags_vertical = 4 -context_menu_enabled = false -smooth_scrolling = true -wrap_enabled = true -caret_blink = true -script = ExtResource( 4 ) -max_lines = 4 - -[node name="MC2" type="MarginContainer" parent="h"] -margin_left = 1372.0 -margin_right = 1422.0 -margin_bottom = 50.0 -size_flags_horizontal = 8 -size_flags_vertical = 0 - -[node name="EmojiButton" type="TextureButton" parent="h/MC2"] -material = SubResource( 2 ) -margin_right = 50.0 -margin_bottom = 50.0 -rect_min_size = Vector2( 50, 50 ) -focus_mode = 1 -mouse_default_cursor_shape = 2 -enabled_focus_mode = 1 -texture_normal = ExtResource( 6 ) -expand = true -script = ExtResource( 3 ) -offset = Vector2( -180, -180 ) - -[node name="Popup" type="PopupPanel" parent="h/MC2/EmojiButton"] -margin_right = 40.0 -margin_bottom = 40.0 -custom_styles/panel = SubResource( 3 ) - -[node name="EmojiMenu" type="GridContainer" parent="h/MC2/EmojiButton/Popup"] -margin_right = 40.0 -margin_bottom = 40.0 -custom_constants/vseparation = 10 -custom_constants/hseparation = 10 -script = ExtResource( 7 ) - -[connection signal="send" from="h/MC/text" to="." method="_on_text_send"] -[connection signal="text_changed" from="h/MC/text" to="." method="_on_text_changed"] -[connection signal="emoji_selected" from="h/MC2/EmojiButton" to="h/MC/text" method="_emoji_selected"] -[connection signal="mouse_entered" from="h/MC2/EmojiButton" to="h/MC2/EmojiButton" method="_focused" binds= [ true ]] -[connection signal="mouse_exited" from="h/MC2/EmojiButton" to="h/MC2/EmojiButton" method="_focused" binds= [ false ]] -[connection signal="pressed" from="h/MC2/EmojiButton/Popup/EmojiMenu" to="h/MC2/EmojiButton" method="_on_EmojiMenu_pressed"] @@ -33,12 +33,7 @@ func spotispiece(piece_type: int, spot: Piece) -> bool: static func str_bool(string: String) -> bool: - string = string.to_lower() - if string == "true": - return true - if string == "false": - return false - return false + return string.to_lower().strip_edges() in ["true", "1", "on", "yes", "y", ""] func add_move(move: String) -> void: diff --git a/assets/emojis/3dots.png.import b/assets/emojis/3dots.png.import index be3f458..8e57127 100644 --- a/assets/emojis/3dots.png.import +++ b/assets/emojis/3dots.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/bigsmile.png.import b/assets/emojis/bigsmile.png.import index b60b70e..43f2255 100644 --- a/assets/emojis/bigsmile.png.import +++ b/assets/emojis/bigsmile.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/cold.png.import b/assets/emojis/cold.png.import index f031a62..f26ac40 100644 --- a/assets/emojis/cold.png.import +++ b/assets/emojis/cold.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/cry.png.import b/assets/emojis/cry.png.import index 9a944f5..9dd7c0c 100644 --- a/assets/emojis/cry.png.import +++ b/assets/emojis/cry.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/happy.png.import b/assets/emojis/happy.png.import index 6344300..29d31e8 100644 --- a/assets/emojis/happy.png.import +++ b/assets/emojis/happy.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/hmm.png.import b/assets/emojis/hmm.png.import index a2edef7..3eb716f 100644 --- a/assets/emojis/hmm.png.import +++ b/assets/emojis/hmm.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/huh.png.import b/assets/emojis/huh.png.import index a2e68da..6e28ac1 100644 --- a/assets/emojis/huh.png.import +++ b/assets/emojis/huh.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/smile.png.import b/assets/emojis/smile.png.import index 9bc9691..5738765 100644 --- a/assets/emojis/smile.png.import +++ b/assets/emojis/smile.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/unhappy.png.import b/assets/emojis/unhappy.png.import index d6b71bb..248e4c5 100644 --- a/assets/emojis/unhappy.png.import +++ b/assets/emojis/unhappy.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/upsidedown_smile.png.import b/assets/emojis/upsidedown_smile.png.import index 166fed8..082b818 100644 --- a/assets/emojis/upsidedown_smile.png.import +++ b/assets/emojis/upsidedown_smile.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/weary.png.import b/assets/emojis/weary.png.import index c1c1fcd..4bb948b 100644 --- a/assets/emojis/weary.png.import +++ b/assets/emojis/weary.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/what.png.import b/assets/emojis/what.png.import index ad78de9..b65dd43 100644 --- a/assets/emojis/what.png.import +++ b/assets/emojis/what.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/wink.png.import b/assets/emojis/wink.png.import index d167387..e41aa80 100644 --- a/assets/emojis/wink.png.import +++ b/assets/emojis/wink.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/wink_tongue.png.import b/assets/emojis/wink_tongue.png.import index c4dd846..a765b1c 100644 --- a/assets/emojis/wink_tongue.png.import +++ b/assets/emojis/wink_tongue.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/wow.png.import b/assets/emojis/wow.png.import index 94b076e..c26a143 100644 --- a/assets/emojis/wow.png.import +++ b/assets/emojis/wow.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/emojis/zany.png.import b/assets/emojis/zany.png.import index 562b47f..f10bde8 100644 --- a/assets/emojis/zany.png.import +++ b/assets/emojis/zany.png.import @@ -24,7 +24,7 @@ flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false diff --git a/assets/ui/CascadiaCode.ttf b/assets/ui/CascadiaCode.ttf index fc7474a..e754ad3 100644 --- a/assets/ui/CascadiaCode.ttf +++ b/assets/ui/CascadiaCode.ttf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7393592c0e0d7f3cdc225c2e03b2aadabab67000bb1a4afe7eca02ff4a782263 -size 648736 +oid sha256:5b5c79a4c1327d1f0c7952a985f7055fff02e5aca5e209ffabdad47cf7c6143f +size 908392 diff --git a/assets/ui/Roboto-Medium.ttf b/assets/ui/Roboto-Medium.ttf deleted file mode 100644 index 57e8ca6..0000000 --- a/assets/ui/Roboto-Medium.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ac8e03606ffa4c37f61a6510a2080f1f37a7054f4726c214887d3b23f72e369 -size 168644 diff --git a/assets/ui/check.png b/assets/ui/check.png deleted file mode 100644 index e2702a3..0000000 --- a/assets/ui/check.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35fb4c753d8d80114d1d220cc4125c813368b73aa3861ce8d9ab4a8f5c222a4f -size 1074 diff --git a/assets/ui/check.png.import b/assets/ui/check.png.import deleted file mode 100644 index 7303460..0000000 --- a/assets/ui/check.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/check.png-e8b14fcbaaa1bc4bede83522bb1efa68.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/check.png" -dest_files=[ "res://.import/check.png-e8b14fcbaaa1bc4bede83522bb1efa68.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/circle.png b/assets/ui/circle.png deleted file mode 100644 index 2fd48c8..0000000 --- a/assets/ui/circle.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:794a6f0ef48002aef02e2380b995f9e1e6ced3e4ea7fb9f591afb2a28e4dceab -size 2428 diff --git a/assets/ui/circle.png.import b/assets/ui/circle.png.import deleted file mode 100644 index e7344bf..0000000 --- a/assets/ui/circle.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/circle.png-56c8a136dc4ef80f0ed3434a9d801ecd.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/circle.png" -dest_files=[ "res://.import/circle.png-56c8a136dc4ef80f0ed3434a9d801ecd.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/close.png b/assets/ui/close.png deleted file mode 100644 index 6adef42..0000000 --- a/assets/ui/close.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d85380cab1923227acb640f8cd622908055b37258e2e7426535317f78149c686 -size 665 diff --git a/assets/ui/close.png.import b/assets/ui/close.png.import deleted file mode 100644 index cc924ee..0000000 --- a/assets/ui/close.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/close.png-76ad351b77a5cd8dfb1d712106bc5926.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/close.png" -dest_files=[ "res://.import/close.png-76ad351b77a5cd8dfb1d712106bc5926.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/draw.png b/assets/ui/draw.png deleted file mode 100644 index e7193c6..0000000 --- a/assets/ui/draw.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:599c981a74b927f6910208415667065f291cd9239de24162bbf6e06385a29365 -size 2862 diff --git a/assets/ui/draw.png.import b/assets/ui/draw.png.import deleted file mode 100644 index d7f1480..0000000 --- a/assets/ui/draw.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/draw.png-fd0668639e07dc0335699f2521885008.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/draw.png" -dest_files=[ "res://.import/draw.png-fd0668639e07dc0335699f2521885008.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/eye.png b/assets/ui/eye.png deleted file mode 100644 index f98a9e2..0000000 --- a/assets/ui/eye.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:213a64bbbb569032e4c170636cacefafd4810133e971ddd2a090d1c277becded -size 8252 diff --git a/assets/ui/eye.png.import b/assets/ui/eye.png.import deleted file mode 100644 index c8a951c..0000000 --- a/assets/ui/eye.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/eye.png-0766d2e31698a687d5f47fc9c0ab5dce.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/eye.png" -dest_files=[ "res://.import/eye.png-0766d2e31698a687d5f47fc9c0ab5dce.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/eye_off.png b/assets/ui/eye_off.png deleted file mode 100644 index e9c80dc..0000000 --- a/assets/ui/eye_off.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7034470e856fba9d7ba69cc4aeb4cb4a60cd3e96cf736a1f1d94f6393b95b02c -size 8884 diff --git a/assets/ui/eye_off.png.import b/assets/ui/eye_off.png.import deleted file mode 100644 index 315311f..0000000 --- a/assets/ui/eye_off.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/eye_off.png-c5b39170125b2d6fd97f423ccac6cd2a.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/eye_off.png" -dest_files=[ "res://.import/eye_off.png-c5b39170125b2d6fd97f423ccac6cd2a.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/eyemap.png b/assets/ui/eyemap.png deleted file mode 100644 index 903165e..0000000 --- a/assets/ui/eyemap.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0f1a48f12ac71c5d72663bd1a05b6588806cafbc7bf8ed694385ee02ca716213 -size 552 diff --git a/assets/ui/eyemap.png.import b/assets/ui/eyemap.png.import deleted file mode 100644 index ad4e506..0000000 --- a/assets/ui/eyemap.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/eyemap.png-fa46d6ece12070f161a31275cd239843.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/eyemap.png" -dest_files=[ "res://.import/eyemap.png-fa46d6ece12070f161a31275cd239843.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=false -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/flag.png b/assets/ui/flag.png deleted file mode 100644 index d35a110..0000000 --- a/assets/ui/flag.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d92a4ee251e177f3b72625989c81c856e49d35602cc899dbff1daf771d43f0a -size 389 diff --git a/assets/ui/flag.png.import b/assets/ui/flag.png.import deleted file mode 100644 index c4498fe..0000000 --- a/assets/ui/flag.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/flag.png-77c9b7bf98c3bdd0a6037ebd527e5287.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/flag.png" -dest_files=[ "res://.import/flag.png-77c9b7bf98c3bdd0a6037ebd527e5287.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=false -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/flip_board.png b/assets/ui/flip_board.png deleted file mode 100644 index c659e41..0000000 --- a/assets/ui/flip_board.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f7c7f53324aa9425c2cac81f753f37673ec5689f30bb37b27ea3c0d13f7df591 -size 1506 diff --git a/assets/ui/flip_board.png.import b/assets/ui/flip_board.png.import deleted file mode 100644 index e7166dc..0000000 --- a/assets/ui/flip_board.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/flip_board.png-a6b1203e00ed82fd76f70be2b116ecd2.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/flip_board.png" -dest_files=[ "res://.import/flip_board.png-a6b1203e00ed82fd76f70be2b116ecd2.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/send.png b/assets/ui/send.png deleted file mode 100644 index 3b84ba7..0000000 --- a/assets/ui/send.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dc0554a6f40c02e667a0d2189bec99c80458778006b9a73b28b2f2a83220c30a -size 1844 diff --git a/assets/ui/send.png.import b/assets/ui/send.png.import deleted file mode 100644 index d6cb571..0000000 --- a/assets/ui/send.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/send.png-89ee65caa60422a1523bacb50bebdc8d.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/send.png" -dest_files=[ "res://.import/send.png-89ee65caa60422a1523bacb50bebdc8d.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/svg/arrow.svg b/assets/ui/svg/arrow.svg deleted file mode 100644 index efdc331..0000000 --- a/assets/ui/svg/arrow.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35d646917e87873eb95710d04543630ad1c7464c59ab87b2f7adb6d96e37a6f4 -size 562 diff --git a/assets/ui/svg/check.svg b/assets/ui/svg/check.svg deleted file mode 100644 index 685bc8f..0000000 --- a/assets/ui/svg/check.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:abecd7e5aed2c600aa09b7bc004570b05a5ef621f9be8e62fc08f0e617f41c1b -size 283 diff --git a/assets/ui/svg/circle.svg b/assets/ui/svg/circle.svg deleted file mode 100644 index 2b0a6ec..0000000 --- a/assets/ui/svg/circle.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a67eb74aace290c88bc00d12b67924a67027f07db65ba16bac1fbe8d92c60ffb -size 357 diff --git a/assets/ui/svg/circle_part.svg b/assets/ui/svg/circle_part.svg deleted file mode 100644 index 32725d7..0000000 --- a/assets/ui/svg/circle_part.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b67a90acb95b4ff21d56ca92de85f43b75940585d1a7894968859392dc80cf84 -size 677 diff --git a/assets/ui/svg/close.svg b/assets/ui/svg/close.svg deleted file mode 100644 index b18cf66..0000000 --- a/assets/ui/svg/close.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:38f356123c83fa7592dd773c3f030133d47ffae16e80fbe8274afdeff25d64fd -size 335 diff --git a/assets/ui/svg/draw.svg b/assets/ui/svg/draw.svg deleted file mode 100644 index 27c7f10..0000000 --- a/assets/ui/svg/draw.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba8a0b64ab69629c16aa711fb491e18d6faa118c8a1aa9f7af3152d346198a2b -size 1519 diff --git a/assets/ui/svg/eye.svg b/assets/ui/svg/eye.svg deleted file mode 100644 index c66e3fe..0000000 --- a/assets/ui/svg/eye.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:953200d89cb0b9a6f622ccaf26845ab6df78f9fe69f01372f056c3e8cb715f16 -size 683 diff --git a/assets/ui/svg/eye_off.svg b/assets/ui/svg/eye_off.svg deleted file mode 100644 index 6688807..0000000 --- a/assets/ui/svg/eye_off.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:55680ca4c2287faf4163cfbb07887b282c71e63248dc860da5370401ce75f6a6 -size 898 diff --git a/assets/ui/svg/flag.svg b/assets/ui/svg/flag.svg deleted file mode 100644 index 14f5516..0000000 --- a/assets/ui/svg/flag.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:599e11422e86ea0cb117d3fcd7597fd9c88bfaacfd75462cbd9ef8956574919c -size 239 diff --git a/assets/ui/svg/flip_board.svg b/assets/ui/svg/flip_board.svg deleted file mode 100644 index da3091f..0000000 --- a/assets/ui/svg/flip_board.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9ae3a5cc1a3ca589c258be6cd251ccb080deb9e525c267107e7bea56beb95de6 -size 1005 diff --git a/assets/ui/svg/send.svg b/assets/ui/svg/send.svg deleted file mode 100644 index d7d45ba..0000000 --- a/assets/ui/svg/send.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3f77523e79fa04e160f8288103d002b086ad2f51c3f4a645f5d99cae6bac2b4e -size 435 diff --git a/assets/ui/svg/undo.svg b/assets/ui/svg/undo.svg deleted file mode 100644 index a44e6f2..0000000 --- a/assets/ui/svg/undo.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef0259894db665a24bb92f744073c033622edb75f23f86e21a6271d3483f0df7 -size 422 diff --git a/assets/ui/ubuntu-bold-italic.ttf b/assets/ui/ubuntu-bold-italic.ttf new file mode 100644 index 0000000..062dc92 --- /dev/null +++ b/assets/ui/ubuntu-bold-italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ae696ef951329bd776af3627badad3bade03636cff0cf35dac238f79b0c0458 +size 1037292 diff --git a/assets/ui/ubuntu-bold.ttf b/assets/ui/ubuntu-bold.ttf new file mode 100644 index 0000000..1f2c523 --- /dev/null +++ b/assets/ui/ubuntu-bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26e14caf643f75091f932423f071f6c4a3b0ab123a49576029d154a6f6b8af7f +size 1023720 diff --git a/assets/ui/ubuntu-italic.ttf b/assets/ui/ubuntu-italic.ttf new file mode 100644 index 0000000..2a5e434 --- /dev/null +++ b/assets/ui/ubuntu-italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e5852e303e5812d7a804ec5159d4d7bbb222d5492db07fd1c8df7bf20b192aa +size 1079496 diff --git a/assets/ui/ubuntu.ttf b/assets/ui/ubuntu.ttf new file mode 100644 index 0000000..6f8e012 --- /dev/null +++ b/assets/ui/ubuntu.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1017b5b1120fa5c98526a4d4f0eb5b11bc5951660a7dcfbde349697119b83b1 +size 1050820 diff --git a/assets/ui/uncheckedbox.png.import b/assets/ui/uncheckedbox.png.import deleted file mode 100644 index c73e747..0000000 --- a/assets/ui/uncheckedbox.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/uncheckedbox.png-da54f770d122815b03b3534fcf3d2230.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/uncheckedbox.png" -dest_files=[ "res://.import/uncheckedbox.png-da54f770d122815b03b3534fcf3d2230.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/undo.png b/assets/ui/undo.png deleted file mode 100644 index 6faa65c..0000000 --- a/assets/ui/undo.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17a2bbef97bade7f5a29d6f62029cb532b851602ecbb96a67acfc05439e226bb -size 1138 diff --git a/assets/ui/undo.png.import b/assets/ui/undo.png.import deleted file mode 100644 index 9c9d227..0000000 --- a/assets/ui/undo.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/undo.png-1a08869722195ead3fe48ffb6aa0ef0b.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/ui/undo.png" -dest_files=[ "res://.import/undo.png-1a08869722195ead3fe48ffb6aa0ef0b.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/assets/ui/verdana-bold-italic.ttf b/assets/ui/verdana-bold-italic.ttf deleted file mode 100644 index a697a86..0000000 --- a/assets/ui/verdana-bold-italic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2c5aa27b62da26f432406852303acad6fdc9121b73f468c75fae33ade799ea81 -size 226848 diff --git a/assets/ui/verdana-bold.ttf b/assets/ui/verdana-bold.ttf deleted file mode 100644 index 2c94112..0000000 --- a/assets/ui/verdana-bold.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:174568c4633a8a688d579d283f7508c16e437434fd5ac97d4ce30dfc42d0860b -size 208456 diff --git a/assets/ui/verdana.ttf b/assets/ui/verdana.ttf deleted file mode 100644 index 30d4374..0000000 --- a/assets/ui/verdana.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:886eedb1df75504d383d10cc40404e56f6361be50e50986d7568ba94ea43cac3 -size 149752 diff --git a/assets/ui/whitespace.png.import b/assets/ui/whitespace.png.import index e1eb6a2..d584d4d 100644 --- a/assets/ui/whitespace.png.import +++ b/assets/ui/whitespace.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/html/custom.html b/html/custom.html index b17b095..832478b 100644 --- a/html/custom.html +++ b/html/custom.html @@ -29,7 +29,7 @@ } .godot { - font-family: verdana; + font-family: ubuntu; font-weight: bold; color: #e0e0e0; background-color: black; diff --git a/project.godot b/project.godot index 7f23283..ddda91d 100644 --- a/project.godot +++ b/project.godot @@ -19,11 +19,21 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://pieces/B.gd" }, { +"base": "KeyUtils", +"class": "CapsLock", +"language": "GDScript", +"path": "res://ui/virtual_keyboard/CapsLock.gd" +}, { "base": "Control", "class": "Chat", "language": "GDScript", "path": "res://ui/chat/Chat.gd" }, { +"base": "Button", +"class": "CheckBoxButton", +"language": "GDScript", +"path": "res://ui/checkboxbutton/CheckBoxButton.gd" +}, { "base": "Control", "class": "ColorPickerBetter", "language": "GDScript", @@ -44,15 +54,15 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://ui/confirm/confirm.gd" }, { -"base": "BarTextureButton", +"base": "Button", "class": "ConfirmButton", "language": "GDScript", -"path": "res://ui/barbutton/confirmbutton.gd" +"path": "res://ui/menus/sidebarright/confirmbutton.gd" }, { "base": "ConfirmButton", "class": "DrawButton", "language": "GDScript", -"path": "res://ui/barbutton/drawbutton.gd" +"path": "res://ui/menus/sidebarright/drawbutton.gd" }, { "base": "TextEdit", "class": "ExpandableTextEdit", @@ -69,10 +79,10 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://ui/menus/sidebarright/FENlabel.gd" }, { -"base": "BarTextureButton", +"base": "Button", "class": "FlipButton", "language": "GDScript", -"path": "res://ui/barbutton/flipbutton.gd" +"path": "res://ui/menus/sidebarright/flipbutton.gd" }, { "base": "Control", "class": "Grid", @@ -94,6 +104,16 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://ui/colorpicker/HueSlider.gd" }, { +"base": "KeyUtils", +"class": "Key", +"language": "GDScript", +"path": "res://ui/virtual_keyboard/Key.gd" +}, { +"base": "Button", +"class": "KeyUtils", +"language": "GDScript", +"path": "res://ui/virtual_keyboard/KeyUtils.gd" +}, { "base": "Piece", "class": "King", "language": "GDScript", @@ -112,7 +132,7 @@ _global_script_classes=[ { "base": "PanelContainer", "class": "MessageList", "language": "GDScript", -"path": "res://MessageList.gd" +"path": "res://ui/chat/MessageList.gd" }, { "base": "Resource", "class": "Move", @@ -157,7 +177,7 @@ _global_script_classes=[ { "base": "ConfirmButton", "class": "ResignButton", "language": "GDScript", -"path": "res://ui/barbutton/resignbutton.gd" +"path": "res://ui/menus/sidebarright/resignbutton.gd" }, { "base": "LineEdit", "class": "Restrict", @@ -179,39 +199,58 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://saveload.gd" }, { +"base": "KeyUtils", +"class": "SpecialKey", +"language": "GDScript", +"path": "res://ui/virtual_keyboard/SpecialKey.gd" +}, { "base": "Label", "class": "StatusLabel", "language": "GDScript", "path": "res://ui/Status.gd" }, { +"base": "Container", +"class": "TextEditor", +"language": "GDScript", +"path": "res://ui/chat/TextEditor.gd" +}, { "base": "ConfirmButton", "class": "UndoButton", "language": "GDScript", -"path": "res://ui/barbutton/undobutton.gd" +"path": "res://ui/menus/sidebarright/undobutton.gd" }, { "base": "Control", "class": "UsernamePass", "language": "GDScript", "path": "res://ui/menus/account/usernamepass.gd" +}, { +"base": "CanvasLayer", +"class": "VirtualKeyboard", +"language": "GDScript", +"path": "res://ui/virtual_keyboard/VirtualKeyboard.gd" } ] _global_script_class_icons={ "BarTextureButton": "", "Bishop": "res://assets/pieces/california/wB.png", +"CapsLock": "", "Chat": "", +"CheckBoxButton": "", "ColorPickerBetter": "", "ColorPickerButtonBetter": "", "ColorSelect": "", "Confirm": "", "ConfirmButton": "", -"DrawButton": "res://assets/ui/draw.png", +"DrawButton": "", "ExpandableTextEdit": "", "FEN": "", "FENLabel": "", -"FlipButton": "res://assets/ui/flip_board.png", +"FlipButton": "", "Grid": "", "GridMenu": "", "GridMenuButton": "", "HueSlider": "", +"Key": "", +"KeyUtils": "", "King": "res://assets/pieces/california/wK.png", "Knight": "res://assets/pieces/california/wN.png", "Lobby": "", @@ -224,14 +263,17 @@ _global_script_class_icons={ "Piece": "res://assets/pieces/california/wP.png", "Preview": "", "Queen": "res://assets/pieces/california/wQ.png", -"ResignButton": "res://assets/ui/flag.png", +"ResignButton": "", "Restrict": "", "Rook": "res://assets/pieces/california/wR.png", "SanParser": "", "SaveLoader": "", +"SpecialKey": "", "StatusLabel": "", -"UndoButton": "res://assets/ui/undo.png", -"UsernamePass": "" +"TextEditor": "", +"UndoButton": "", +"UsernamePass": "", +"VirtualKeyboard": "" } [application] @@ -274,10 +316,6 @@ window/size/height=800 window/stretch/mode="2d" window/stretch/aspect="keep" -[editor] - -main_run_args="debug" - [editor_plugins] enabled=PoolStringArray( ) @@ -336,6 +374,16 @@ click={ "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) ] } +caps={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777241,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +shift={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} [rendering] diff --git a/saveload.gd b/saveload.gd index f3772d3..1e1f476 100644 --- a/saveload.gd +++ b/saveload.gd @@ -13,7 +13,7 @@ const default_settings_data = { piece_set = "california", board_color1 = Color(0.870588, 0.890196, 0.901961), board_color2 = Color(0.54902, 0.635294, 0.678431), - rainbow = true + rainbow = false } const default_id_data = {id = "", name = "", country = "rainbow", password = ""} diff --git a/ui/Status.gd b/ui/Status.gd index 99c6697..03f8db1 100644 --- a/ui/Status.gd +++ b/ui/Status.gd @@ -3,7 +3,9 @@ class_name StatusLabel func set_text(newtext: String, time := 7) -> void: + show() text = newtext if time != 0: yield(get_tree().create_timer(time), "timeout") text = "" + hide() diff --git a/ui/barbutton/BarButton.theme b/ui/barbutton/BarButton.theme Binary files differnew file mode 100644 index 0000000..51a77b4 --- /dev/null +++ b/ui/barbutton/BarButton.theme diff --git a/ui/roboto.tres b/ui/barbutton/big-ubuntu-bold.tres index 7c131ca..69bd4ce 100644 --- a/ui/roboto.tres +++ b/ui/barbutton/big-ubuntu-bold.tres @@ -1,7 +1,7 @@ [gd_resource type="DynamicFont" load_steps=2 format=2] -[ext_resource path="res://assets/ui/Roboto-Medium.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] [resource] -size = 70 +size = 85 font_data = ExtResource( 1 ) diff --git a/ui/barbutton/default.tres b/ui/barbutton/default.tres new file mode 100644 index 0000000..1651cef --- /dev/null +++ b/ui/barbutton/default.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.188235, 0.180392, 0.172549, 1 ) diff --git a/ui/barbutton/default_highlight.tres b/ui/barbutton/default_highlight.tres new file mode 100644 index 0000000..a71a53e --- /dev/null +++ b/ui/barbutton/default_highlight.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.670588, 0.352941, 0.352941, 1 ) diff --git a/ui/barbutton/default_pressed.tres b/ui/barbutton/default_pressed.tres new file mode 100644 index 0000000..a5133aa --- /dev/null +++ b/ui/barbutton/default_pressed.tres @@ -0,0 +1,4 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +bg_color = Color( 0.356863, 0.572549, 0.647059, 1 ) diff --git a/ui/barbutton/flipbutton.gd b/ui/barbutton/flipbutton.gd deleted file mode 100644 index 7a6e3ac..0000000 --- a/ui/barbutton/flipbutton.gd +++ /dev/null @@ -1,6 +0,0 @@ -extends BarTextureButton -class_name FlipButton, "res://assets/ui/flip_board.png" - - -func _pressed() -> void: - Globals.grid.flip_board() diff --git a/ui/chat/Chat.gd b/ui/chat/Chat.gd index 143cedf..9cb41d7 100644 --- a/ui/chat/Chat.gd +++ b/ui/chat/Chat.gd @@ -2,6 +2,8 @@ extends Control class_name Chat onready var list: MessageList = $v/MessageList +onready var kb = $v/Keyboard +onready var dsk_input: TextEditor = $v/DesktopInput var regexes := [ [compile("_([^_]+)_"), "[i]$1[/i]"], @@ -15,7 +17,7 @@ var regexes := [ [compile("\\[([^\\]]+)\\]\\(([^\\)]+)\\)"), "[url=$2]$1[/url]"], [compile("([-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*))"), "[url]$1[/url]"], ] -var emoji_replace_regex := compile(":[^:]{1,15}:") +var emoji_replace_regex := compile(":[^:]{1,30}:") const piece_emoji_path = "res://assets/pieces/cburnett/" const emoji_path = "res://assets/emojis/" @@ -48,7 +50,7 @@ var expanded_emojis = {} # create smokey centered text func server(txt: String) -> void: - list.add_label("[center][b][color=#a9a9a9]%s[/color][/b][/center]" % md2bb(txt)) + list.add_label("[center][i][b][color=#a9a9a9]%s[/color][/b][/i][/center]" % md2bb(txt)) func _init(): @@ -59,17 +61,39 @@ func _exit_tree(): Globals.chat = null -func _ready(): +func setup_triggers(): for trigger_list in emojis: for trigger in trigger_list: expanded_emojis[trigger] = emojis[trigger_list] - if PacketHandler: - PacketHandler.connect("chat", self, "add_label_with") - server("Welcome!") + +func setup_text_input(): + if OS.has_touchscreen_ui_hint(): + # dsk_input is a little dummy button that just opens the kb and shows text on mobile + kb.connect("done", self, "send") + kb.connect("closed", dsk_input, "set_text") + kb.text.emojibutton._setup(emojis) + dsk_input.textedit.connect("focus_entered", self, "open_kb") + print("mobile keyboard setup") + else: + kb.free() + dsk_input.show() + dsk_input.connect("done", self, "send") + + dsk_input.emojibutton._setup(emojis) + + +func open_kb(): + kb.open(dsk_input.text) + + +func _ready(): + setup_triggers() + setup_text_input() + PacketHandler.connect("chat", self, "add_label_with") + server("Welcome!") # say hello yield(get_tree().create_timer(.4), "timeout") - server("You can use markdown(sort of)!") - $v/TextInput.setup_emojis(emojis) + server("You can use markdown(sort of)!") # say hello again static func compile(src: String) -> RegEx: @@ -91,7 +115,7 @@ func send(t: String) -> void: var name_data = SaveLoad.get_data("id").name var name = name_data if name_data else "Anonymous" name += "(%s)" % ("Spectator" if Globals.spectating else Globals.get_team()) - if PacketHandler: + if PacketHandler.connected: PacketHandler.relay_signal({"text": t, "who": name}, PacketHandler.RELAYHEADERS.chat) else: add_label_with({text = t, who = name}) # for testing diff --git a/ui/chat/Chat.tscn b/ui/chat/Chat.tscn index 50675f6..0bad13e 100644 --- a/ui/chat/Chat.tscn +++ b/ui/chat/Chat.tscn @@ -1,35 +1,32 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://ui/chat/chat_theme.tres" type="Theme" id=1] [ext_resource path="res://ui/chat/Chat.gd" type="Script" id=2] -[ext_resource path="res://MessageList.tscn" type="PackedScene" id=3] -[ext_resource path="res://TextInput.tscn" type="PackedScene" id=5] +[ext_resource path="res://ui/chat/MessageList.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/virtual_keyboard/VirtualKeyboard.tscn" type="PackedScene" id=4] +[ext_resource path="res://ui/chat/TextEditor.tscn" type="PackedScene" id=5] [node name="Chat" type="MarginContainer"] anchor_right = 1.0 anchor_bottom = 1.0 -margin_right = -918.0 rect_min_size = Vector2( 300, 0 ) theme = ExtResource( 1 ) script = ExtResource( 2 ) [node name="v" type="VBoxContainer" parent="."] -margin_right = 504.0 +margin_right = 1422.0 margin_bottom = 800.0 custom_constants/separation = 0 [node name="MessageList" parent="v" instance=ExtResource( 3 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_right = 504.0 +margin_right = 1422.0 margin_bottom = 750.0 -[node name="TextInput" parent="v" instance=ExtResource( 5 )] -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="DesktopInput" parent="v" instance=ExtResource( 5 )] margin_top = 750.0 -margin_right = 504.0 +margin_right = 1422.0 margin_bottom = 800.0 -[connection signal="send" from="v/TextInput" to="." method="send"] +[node name="Keyboard" parent="v" instance=ExtResource( 4 )] diff --git a/MessageList.gd b/ui/chat/MessageList.gd index aa407f6..aa407f6 100644 --- a/MessageList.gd +++ b/ui/chat/MessageList.gd diff --git a/MessageList.tscn b/ui/chat/MessageList.tscn index 14973ee..ba2703e 100644 --- a/MessageList.tscn +++ b/ui/chat/MessageList.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://MessageList.gd" type="Script" id=1] +[ext_resource path="res://ui/chat/MessageList.gd" type="Script" id=1] [sub_resource type="StyleBoxFlat" id=1] bg_color = Color( 0.188235, 0.180392, 0.172549, 1 ) diff --git a/ui/chat/TextEditor.gd b/ui/chat/TextEditor.gd new file mode 100644 index 0000000..578b7d7 --- /dev/null +++ b/ui/chat/TextEditor.gd @@ -0,0 +1,32 @@ +extends Container +class_name TextEditor + +var text setget set_text, get_text + + +func set_text(new_text: String) -> void: + textedit.text = new_text + _text_changed() + + +func get_text() -> String: + return textedit.text + + +signal done(text) + +export(NodePath) var textedit_path +onready var textedit: TextEdit = get_node(textedit_path) +export(NodePath) var placeholder_path +onready var placeholder := get_node(placeholder_path) + +export(NodePath) var emojibutton_path +onready var emojibutton := get_node(emojibutton_path) + + +func _text_changed() -> void: + placeholder.visible = len(textedit.text) == 0 + + +func _on_text_send(msg: String) -> void: + emit_signal("done", msg) diff --git a/ui/chat/TextEditor.tscn b/ui/chat/TextEditor.tscn new file mode 100644 index 0000000..5d8854a --- /dev/null +++ b/ui/chat/TextEditor.tscn @@ -0,0 +1,105 @@ +[gd_scene load_steps=11 format=2] + +[ext_resource path="res://ui/chat/textedit.gd" type="Script" id=1] +[ext_resource path="res://ui/chat/emojibutton.gd" type="Script" id=2] +[ext_resource path="res://ui/gridmenu/GridMenu.gd" type="Script" id=3] +[ext_resource path="res://ui/chat/grayscale.shader" type="Shader" id=4] +[ext_resource path="res://assets/emojis/happy.png" type="Texture" id=5] +[ext_resource path="res://ui/chat/chat_theme.tres" type="Theme" id=6] +[ext_resource path="res://ui/chat/TextEditor.gd" type="Script" id=7] + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.25098, 0.266667, 0.294118, 1 ) + +[sub_resource type="ShaderMaterial" id=3] +shader = ExtResource( 4 ) +shader_param/saturation = 0.0 +shader_param/scale = 1.0 + +[sub_resource type="StyleBoxEmpty" id=4] + +[node name="TextEditor" type="PanelContainer"] +margin_right = 965.0 +margin_bottom = 50.0 +theme = ExtResource( 6 ) +custom_styles/panel = SubResource( 2 ) +script = ExtResource( 7 ) +textedit_path = NodePath("TextBar/TextEditHolder/text") +placeholder_path = NodePath("TextBar/TextEditHolder/placeholder") +emojibutton_path = NodePath("TextBar/EmojiButtonHoldler/EmojiButton") + +[node name="TextBar" type="HBoxContainer" parent="."] +margin_right = 965.0 +margin_bottom = 50.0 +custom_constants/separation = 0 + +[node name="TextEditHolder" type="MarginContainer" parent="TextBar"] +margin_right = 915.0 +margin_bottom = 50.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_constants/margin_right = 5 +custom_constants/margin_left = 5 + +[node name="placeholder" type="Label" parent="TextBar/TextEditHolder"] +margin_left = 5.0 +margin_top = 13.0 +margin_right = 141.0 +margin_bottom = 36.0 +size_flags_horizontal = 0 +custom_colors/font_color = Color( 1, 1, 1, 0.509804 ) +text = "write text here" +valign = 2 + +[node name="text" type="TextEdit" parent="TextBar/TextEditHolder"] +margin_left = 5.0 +margin_top = 15.0 +margin_right = 910.0 +margin_bottom = 35.0 +rect_min_size = Vector2( 200, 20 ) +size_flags_vertical = 4 +context_menu_enabled = false +virtual_keyboard_enabled = false +smooth_scrolling = true +wrap_enabled = true +caret_blink = true +script = ExtResource( 1 ) +max_lines = 4 + +[node name="EmojiButtonHoldler" type="MarginContainer" parent="TextBar"] +margin_left = 915.0 +margin_right = 965.0 +margin_bottom = 50.0 +size_flags_horizontal = 8 +size_flags_vertical = 0 + +[node name="EmojiButton" type="TextureButton" parent="TextBar/EmojiButtonHoldler"] +material = SubResource( 3 ) +margin_right = 50.0 +margin_bottom = 50.0 +rect_min_size = Vector2( 50, 50 ) +focus_mode = 1 +mouse_default_cursor_shape = 2 +texture_normal = ExtResource( 5 ) +expand = true +script = ExtResource( 2 ) +offset = Vector2( -180, -180 ) + +[node name="Popup" type="PopupPanel" parent="TextBar/EmojiButtonHoldler/EmojiButton"] +margin_right = 40.0 +margin_bottom = 40.0 +custom_styles/panel = SubResource( 4 ) + +[node name="EmojiMenu" type="GridContainer" parent="TextBar/EmojiButtonHoldler/EmojiButton/Popup"] +margin_right = 40.0 +margin_bottom = 40.0 +custom_constants/vseparation = 10 +custom_constants/hseparation = 10 +script = ExtResource( 3 ) + +[connection signal="send" from="TextBar/TextEditHolder/text" to="." method="_on_text_send"] +[connection signal="text_changed" from="TextBar/TextEditHolder/text" to="." method="_text_changed"] +[connection signal="emoji_selected" from="TextBar/EmojiButtonHoldler/EmojiButton" to="TextBar/TextEditHolder/text" method="_emoji_selected"] +[connection signal="mouse_entered" from="TextBar/EmojiButtonHoldler/EmojiButton" to="TextBar/EmojiButtonHoldler/EmojiButton" method="_focused" binds= [ true ]] +[connection signal="mouse_exited" from="TextBar/EmojiButtonHoldler/EmojiButton" to="TextBar/EmojiButtonHoldler/EmojiButton" method="_focused" binds= [ false ]] +[connection signal="pressed" from="TextBar/EmojiButtonHoldler/EmojiButton/Popup/EmojiMenu" to="TextBar/EmojiButtonHoldler/EmojiButton" method="_on_EmojiMenu_pressed"] diff --git a/ui/chat/TextInput.gd b/ui/chat/TextInput.gd deleted file mode 100644 index c3a8134..0000000 --- a/ui/chat/TextInput.gd +++ /dev/null @@ -1,18 +0,0 @@ -extends Control - -signal send(message) - -onready var textedit := $h/MC/text -onready var placeholder := $h/MC/placeholder - - -func _on_text_changed() -> void: - placeholder.visible = len(textedit.text) == 0 - - -func _on_text_send(msg: String) -> void: - emit_signal("send", msg) - - -func setup_emojis(_emojis: Dictionary) -> void: - $h/MC2/EmojiButton._setup(_emojis) diff --git a/ui/chat/chat_theme.tres b/ui/chat/chat_theme.tres index d44effb..eb4cc98 100644 --- a/ui/chat/chat_theme.tres +++ b/ui/chat/chat_theme.tres @@ -1,16 +1,16 @@ [gd_resource type="Theme" load_steps=29 format=2] -[ext_resource path="res://assets/ui/verdana-bold-italic.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu-bold-italic.ttf" type="DynamicFontData" id=1] [ext_resource path="res://assets/ui/CascadiaCode.ttf" type="DynamicFontData" id=2] [ext_resource path="res://assets/ui/button.png" type="Texture" id=3] [ext_resource path="res://assets/ui/whitespace.png" type="Texture" id=4] [ext_resource path="res://assets/ui/checkedbox.png" type="Texture" id=5] -[ext_resource path="res://assets/ui/verdana.ttf" type="DynamicFontData" id=6] -[ext_resource path="res://assets/ui/verdana-bold.ttf" type="DynamicFontData" id=7] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=7] [ext_resource path="res://ui/theme/button.tres" type="StyleBox" id=8] [ext_resource path="res://ui/theme/buttonhover.tres" type="StyleBox" id=9] [ext_resource path="res://ui/theme/transblack.tres" type="StyleBox" id=10] [ext_resource path="res://ui/theme/flatblack.tres" type="StyleBox" id=11] +[ext_resource path="res://assets/ui/ubuntu.ttf" type="DynamicFontData" id=12] [sub_resource type="StyleBoxTexture" id=6] texture = ExtResource( 3 ) @@ -54,7 +54,7 @@ font_data = ExtResource( 2 ) [sub_resource type="DynamicFont" id=20] size = 15 -font_data = ExtResource( 6 ) +font_data = ExtResource( 12 ) [sub_resource type="StyleBoxFlat" id=10] content_margin_left = 30.0 @@ -107,12 +107,12 @@ corner_radius_bottom_left = 30 corner_detail = 15 expand_margin_top = 65.0 -[sub_resource type="DynamicFont" id=15] -size = 15 -font_data = ExtResource( 7 ) +[sub_resource type="DynamicFont" id=22] +size = 20 +font_data = ExtResource( 12 ) [resource] -default_font = SubResource( 15 ) +default_font = SubResource( 22 ) Button/colors/font_color = Color( 1, 1, 1, 1 ) Button/colors/font_color_disabled = Color( 1, 1, 1, 0.305882 ) Button/colors/font_color_focus = Color( 1, 1, 1, 1 ) diff --git a/ui/chat/texteditor.gd b/ui/chat/textedit.gd index 4aa92da..4aa92da 100644 --- a/ui/chat/texteditor.gd +++ b/ui/chat/textedit.gd diff --git a/ui/checkboxbutton/CheckBoxButton.gd b/ui/checkboxbutton/CheckBoxButton.gd new file mode 100644 index 0000000..178fcca --- /dev/null +++ b/ui/checkboxbutton/CheckBoxButton.gd @@ -0,0 +1,16 @@ +extends Button +class_name CheckBoxButton + +onready var tx := text + +export(String) var off_icon = "" +export(String) var on_icon = "" + + +func _toggled(p: bool): + text = (on_icon if p else off_icon) + tx + + +func _ready(): + assert(toggle_mode) + _toggled(pressed) diff --git a/ui/colorpicker/ColorPicker.gd b/ui/colorpicker/ColorPicker.gd index 09c5332..e89e760 100644 --- a/ui/colorpicker/ColorPicker.gd +++ b/ui/colorpicker/ColorPicker.gd @@ -30,7 +30,6 @@ func set_color(newcolor: Color) -> void: func done() -> void: - closebutton._focused(false) emit_signal("done", color) diff --git a/ui/colorpicker/ColorPicker.tscn b/ui/colorpicker/ColorPicker.tscn index db272c0..77350c9 100644 --- a/ui/colorpicker/ColorPicker.tscn +++ b/ui/colorpicker/ColorPicker.tscn @@ -1,13 +1,16 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://ui/colorpicker/ColorPicker.gd" type="Script" id=1] -[ext_resource path="res://assets/ui/close.png" type="Texture" id=2] +[ext_resource path="res://ui/barbutton/BarButton.theme" type="Theme" id=3] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=4] [ext_resource path="res://ui/colorpicker/HueSlider.gd" type="Script" id=6] [ext_resource path="res://ui/colorpicker/ColorSelect.gd" type="Script" id=7] [ext_resource path="res://ui/colorpicker/OldColorView.gd" type="Script" id=9] [ext_resource path="res://ui/colorpicker/huepicker.material" type="Material" id=10] [ext_resource path="res://ui/colorpicker/ColorSelect.material" type="Material" id=11] -[ext_resource path="res://ui/barbutton/BarTextureButton.tscn" type="PackedScene" id=12] + +[sub_resource type="DynamicFont" id=1] +font_data = ExtResource( 4 ) [node name="ColorPicker" type="Control"] margin_right = 125.0 @@ -66,12 +69,16 @@ margin_right = 125.0 margin_bottom = 125.0 custom_constants/separation = 0 -[node name="Close" parent="V/H2" instance=ExtResource( 12 )] +[node name="Close" type="Button" parent="V/H2"] + focus_mode = 0 margin_right = 20.0 margin_bottom = 20.0 rect_min_size = Vector2( 20, 0 ) -texture_normal = ExtResource( 2 ) -normal_color = Color( 0.145098, 0.145098, 0.164706, 1 ) + +mouse_default_cursor_shape = 2 +theme = ExtResource( 3 ) +custom_fonts/font = SubResource( 1 ) +text = "" [node name="Spacer" type="Control" parent="V/H2"] margin_left = 20.0 diff --git a/ui/colorpicker/ColorPickerButton.tscn b/ui/colorpicker/ColorPickerButton.tscn index 5d39c1f..ee56af1 100644 --- a/ui/colorpicker/ColorPickerButton.tscn +++ b/ui/colorpicker/ColorPickerButton.tscn @@ -20,7 +20,6 @@ margin_right = 232.0 margin_bottom = 106.0 focus_mode = 0 theme = ExtResource( 1 ) -enabled_focus_mode = 0 text = "button" script = ExtResource( 2 ) diff --git a/ui/confirm/Confirm.tscn b/ui/confirm/Confirm.tscn index 473b905..338394b 100644 --- a/ui/confirm/Confirm.tscn +++ b/ui/confirm/Confirm.tscn @@ -1,14 +1,11 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] -[ext_resource path="res://ui/barbutton/BarTextureButton.tscn" type="PackedScene" id=2] -[ext_resource path="res://assets/ui/close.png" type="Texture" id=3] +[ext_resource path="res://ui/barbutton/BarButton.theme" type="Theme" id=2] [ext_resource path="res://ui/confirm/confirm.gd" type="Script" id=4] -[ext_resource path="res://assets/ui/check.png" type="Texture" id=5] -[ext_resource path="res://ui/verdana-bold-small.tres" type="DynamicFont" id=6] +[ext_resource path="res://ui/ubuntu-bold-small.tres" type="DynamicFont" id=6] [node name="Confirm" type="WindowDialog"] -visible = true margin_right = 400.0 margin_bottom = 150.0 rect_min_size = Vector2( 400, 150 ) @@ -23,25 +20,29 @@ anchor_bottom = 1.0 custom_constants/separation = 0 alignment = 1 -[node name="no" parent="H" instance=ExtResource( 2 )] +[node name="yes" type="Button" parent="H"] margin_left = 100.0 margin_top = 25.0 margin_right = 200.0 margin_bottom = 125.0 rect_min_size = Vector2( 100, 100 ) -size_flags_horizontal = 4 +focus_mode = 0 +mouse_default_cursor_shape = 2 size_flags_vertical = 4 -texture_normal = ExtResource( 3 ) +theme = ExtResource( 2 ) +text = "" -[node name="yes" parent="H" instance=ExtResource( 2 )] +[node name="no" type="Button" parent="H"] margin_left = 200.0 margin_top = 25.0 margin_right = 300.0 margin_bottom = 125.0 rect_min_size = Vector2( 100, 100 ) -size_flags_horizontal = 4 +focus_mode = 0 +mouse_default_cursor_shape = 2 size_flags_vertical = 4 -texture_normal = ExtResource( 5 ) +theme = ExtResource( 2 ) +text = "" -[connection signal="pressed" from="H/no" to="." method="_pressed" binds= [ false ]] [connection signal="pressed" from="H/yes" to="." method="_pressed" binds= [ true ]] +[connection signal="pressed" from="H/no" to="." method="_pressed" binds= [ false ]] diff --git a/ui/gridmenu/GridMenu.gd b/ui/gridmenu/GridMenu.gd index 8a4f7d8..34bd846 100644 --- a/ui/gridmenu/GridMenu.gd +++ b/ui/gridmenu/GridMenu.gd @@ -29,5 +29,5 @@ func add_item(icon: Texture, tooltip: String, size: Vector2) -> void: func _pressed(index: int): - get_children()[index].get_children()[0]._focused(false) + get_children()[index]._focused(false) emit_signal("pressed", index) diff --git a/ui/gridmenu/GridMenuButton.tscn b/ui/gridmenu/GridMenuButton.tscn index b4af0a1..0676df5 100644 --- a/ui/gridmenu/GridMenuButton.tscn +++ b/ui/gridmenu/GridMenuButton.tscn @@ -5,15 +5,15 @@ [ext_resource path="res://ui/gridmenu/GridMenuButton.gd" type="Script" id=3] [ext_resource path="res://assets/ui/whitespace.png" type="Texture" id=4] [ext_resource path="res://assets/ui/CascadiaCode.ttf" type="DynamicFontData" id=5] -[ext_resource path="res://assets/ui/verdana-bold-italic.ttf" type="DynamicFontData" id=6] -[ext_resource path="res://assets/ui/verdana.ttf" type="DynamicFontData" id=7] +[ext_resource path="res://assets/ui/ubuntu-bold-italic.ttf" type="DynamicFontData" id=6] +[ext_resource path="res://assets/ui/ubuntu.ttf" type="DynamicFontData" id=7] [ext_resource path="res://assets/ui/checkedbox.png" type="Texture" id=8] [ext_resource path="res://ui/theme/transblack.tres" type="StyleBox" id=9] [ext_resource path="res://ui/theme/button.tres" type="StyleBox" id=10] [ext_resource path="res://ui/theme/flatblack.tres" type="StyleBox" id=11] [ext_resource path="res://assets/ui/button.png" type="Texture" id=12] -[ext_resource path="res://ui/verdana-bold.tres" type="DynamicFont" id=13] -[ext_resource path="res://ui/verdana-bold-small.tres" type="DynamicFont" id=14] +[ext_resource path="res://ui/ubuntu-bold.tres" type="DynamicFont" id=13] +[ext_resource path="res://ui/ubuntu-bold-small.tres" type="DynamicFont" id=14] [ext_resource path="res://ui/theme/buttonhover.tres" type="StyleBox" id=15] [ext_resource path="res://ui/theme/panel.tres" type="StyleBox" id=16] @@ -215,9 +215,9 @@ WindowDialog/styles/panel = SubResource( 13 ) [node name="GridMenuButton" type="Button"] margin_right = 12.0 margin_bottom = 20.0 -focus_mode = 0 + theme = ExtResource( 2 ) -enabled_focus_mode = 0 + text = "grid menu button" expand_icon = true script = ExtResource( 3 ) diff --git a/ui/menus/Lobby.tscn b/ui/menus/Lobby.tscn index 477dd78..25a3d3e 100644 --- a/ui/menus/Lobby.tscn +++ b/ui/menus/Lobby.tscn @@ -3,7 +3,7 @@ [ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] [ext_resource path="res://ui/menus/Lobby.gd" type="Script" id=2] [ext_resource path="res://ui/menus/Disclaimer.gd" type="Script" id=3] -[ext_resource path="res://ui/verdana-bold-small.tres" type="DynamicFont" id=4] +[ext_resource path="res://ui/ubuntu-bold-small.tres" type="DynamicFont" id=4] [node name="Lobby" type="CenterContainer"] anchor_right = 1.0 @@ -13,19 +13,20 @@ script = ExtResource( 2 ) [node name="Center" type="CenterContainer" parent="."] margin_left = 411.0 -margin_top = 286.0 +margin_top = 290.0 margin_right = 1011.0 -margin_bottom = 513.0 +margin_bottom = 509.0 [node name="HBox" type="HBoxContainer" parent="Center"] margin_right = 600.0 -margin_bottom = 227.0 +margin_bottom = 219.0 [node name="VBox" type="VBoxContainer" parent="Center/HBox"] margin_right = 600.0 -margin_bottom = 227.0 +margin_bottom = 219.0 [node name="stophost" type="Button" parent="Center/HBox/VBox"] + focus_mode = 0 visible = false margin_left = 7.0 margin_right = 343.0 @@ -35,7 +36,7 @@ text = "stop hosting" [node name="Address" type="LineEdit" parent="Center/HBox/VBox"] margin_right = 600.0 -margin_bottom = 106.0 +margin_bottom = 102.0 rect_min_size = Vector2( 600, 0 ) hint_tooltip = "place game code here" focus_mode = 1 @@ -47,41 +48,44 @@ caret_blink = true caret_blink_speed = 0.5 [node name="buttons" type="HBoxContainer" parent="Center/HBox/VBox"] -margin_top = 121.0 +margin_top = 117.0 margin_right = 600.0 -margin_bottom = 227.0 +margin_bottom = 219.0 [node name="SpectateButton" type="Button" parent="Center/HBox/VBox/buttons"] -margin_right = 249.0 -margin_bottom = 106.0 -focus_mode = 0 + focus_mode = 0 +margin_right = 223.0 +margin_bottom = 102.0 + size_flags_horizontal = 3 size_flags_vertical = 3 disabled = true -enabled_focus_mode = 0 + text = "spectate" [node name="JoinButton" type="Button" parent="Center/HBox/VBox/buttons"] -margin_left = 264.0 -margin_right = 424.0 -margin_bottom = 106.0 + focus_mode = 0 +margin_left = 238.0 +margin_right = 411.0 +margin_bottom = 102.0 rect_min_size = Vector2( 150, 0 ) hint_tooltip = "join the game" -focus_mode = 0 + size_flags_horizontal = 7 disabled = true -enabled_focus_mode = 0 + text = "join" [node name="HostButton" type="Button" parent="Center/HBox/VBox/buttons"] -margin_left = 439.0 + focus_mode = 0 +margin_left = 426.0 margin_right = 600.0 -margin_bottom = 106.0 +margin_bottom = 102.0 hint_tooltip = "host the game" -focus_mode = 0 + size_flags_horizontal = 7 disabled = true -enabled_focus_mode = 0 + text = "host" [node name="StatusOK" type="Label" parent="Center/HBox/VBox"] diff --git a/ui/menus/StartMenu.tscn b/ui/menus/StartMenu.tscn index e282f34..55c6a32 100644 --- a/ui/menus/StartMenu.tscn +++ b/ui/menus/StartMenu.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://ui/menus/account/Account.tscn" type="PackedScene" id=1] [ext_resource path="res://ui/menus/settings/Settings.tscn" type="PackedScene" id=2] -[ext_resource path="res://assets/ui/verdana-bold.ttf" type="DynamicFontData" id=3] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=3] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=4] [ext_resource path="res://ui/menus/Lobby.tscn" type="PackedScene" id=5] [ext_resource path="res://test.gd" type="Script" id=6] @@ -23,10 +23,10 @@ theme = ExtResource( 4 ) script = ExtResource( 7 ) [node name="tabs" type="TabContainer" parent="."] -margin_left = 89.0 -margin_top = 23.0 -margin_right = 1333.0 -margin_bottom = 777.0 +margin_left = 147.0 +margin_top = 57.0 +margin_right = 1275.0 +margin_bottom = 743.0 rect_min_size = Vector2( 2, 2 ) mouse_filter = 1 size_flags_horizontal = 0 @@ -34,34 +34,34 @@ size_flags_vertical = 0 drag_to_rearrange_enabled = true use_hidden_tabs_for_min_size = true -[node name="Lobby" parent="tabs" instance=ExtResource( 5 )] +[node name="" parent="tabs" instance=ExtResource( 5 )] margin_left = 30.0 -margin_top = 90.0 +margin_top = 86.0 margin_right = -30.0 margin_bottom = -30.0 -[node name="Settings" parent="tabs" instance=ExtResource( 2 )] +[node name="漣" parent="tabs" instance=ExtResource( 2 )] visible = false margin_left = 30.0 margin_top = 60.0 margin_right = -30.0 margin_bottom = -30.0 -[node name="account" parent="tabs" instance=ExtResource( 1 )] +[node name="אּ" parent="tabs" instance=ExtResource( 1 )] visible = false margin_left = 30.0 margin_top = 60.0 margin_right = -30.0 margin_bottom = -30.0 -[node name="tests" parent="tabs" instance=ExtResource( 8 )] +[node name="ﭧ" parent="tabs" instance=ExtResource( 8 )] visible = false margin_left = 30.0 margin_top = 60.0 margin_right = -30.0 margin_bottom = -30.0 -[node name="quit" type="Button" parent="tabs"] +[node name="" type="Button" parent="tabs"] visible = false anchor_right = 1.0 anchor_bottom = 1.0 @@ -73,11 +73,10 @@ focus_mode = 0 size_flags_horizontal = 4 size_flags_vertical = 4 custom_fonts/font = SubResource( 1 ) -enabled_focus_mode = 0 text = "exit" [node name="tests" type="Node2D" parent="."] script = ExtResource( 6 ) -[connection signal="tab_changed" from="tabs" to="tabs/Lobby" method="_on_tabs_tab_changed"] -[connection signal="pressed" from="tabs/quit" to="." method="_on_quit_pressed"] +[connection signal="tab_changed" from="tabs" to="tabs/" method="_on_tabs_tab_changed"] +[connection signal="pressed" from="tabs/" to="." method="_on_quit_pressed"] diff --git a/ui/menus/account/Account.gd b/ui/menus/account/Account.gd index fb150e8..93168d3 100644 --- a/ui/menus/account/Account.gd +++ b/ui/menus/account/Account.gd @@ -3,7 +3,7 @@ extends Control onready var flags: PoolStringArray = ["rainbow"] onready var flagchoice: GridMenuButton = $choose/signup/flag onready var data: Dictionary = SaveLoad.get_data("id") -onready var status: Label = $H/InfoLabel # not a StatusLabel +onready var status: StatusLabel = $H/InfoLabel # not a StatusLabel onready var loading = $LoadingAnimation onready var tabs := { @@ -77,7 +77,7 @@ func _on_signup_result(result: String): func reset(reason: String, set_status := true): if set_status: - status.set_text(reason) + status.set_text(reason, 0) data = SaveLoad.default_id_data tabcontainer.show() loading.hide() @@ -89,9 +89,10 @@ func reset(reason: String, set_status := true): func _after_result(): save_data() loading.hide() - status.set_text("Signed in to " + SaveLoad.get_data("id").name) + status.set_text("Signed in to " + SaveLoad.get_data("id").name, 0) set_signed_in(true) # yay $H/LogOut.show() + tabcontainer.hide() diff --git a/ui/menus/account/Account.tscn b/ui/menus/account/Account.tscn index e5e8167..0a693ff 100644 --- a/ui/menus/account/Account.tscn +++ b/ui/menus/account/Account.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://ui/gridmenu/GridMenuButton.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/ui/whitespace.png" type="Texture" id=2] [ext_resource path="res://assets/flags/rainbow.png" type="Texture" id=3] +[ext_resource path="res://ui/Status.gd" type="Script" id=4] [ext_resource path="res://ui/menus/account/usernamepass.tscn" type="PackedScene" id=5] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=6] [ext_resource path="res://ui/animations/thehalo.tres" type="Material" id=7] @@ -16,28 +17,29 @@ script = ExtResource( 8 ) [node name="H" type="HBoxContainer" parent="."] margin_right = 1422.0 -margin_bottom = 50.0 [node name="InfoLabel" type="Label" parent="H"] +visible = false margin_right = 1422.0 -margin_bottom = 50.0 +margin_bottom = 46.0 size_flags_horizontal = 3 +script = ExtResource( 4 ) [node name="LogOut" type="Button" parent="H"] + focus_mode = 0 visible = false -margin_left = 1209.0 -margin_right = 1422.0 -margin_bottom = 106.0 +margin_right = 96.0 +margin_bottom = 102.0 hint_tooltip = "log out" -focus_mode = 0 -enabled_focus_mode = 0 -text = "log out" + + +text = "" [node name="choose" type="TabContainer" parent="."] margin_left = 177.0 -margin_top = 65.0 +margin_top = 15.0 margin_right = 1245.0 -margin_bottom = 634.0 +margin_bottom = 570.0 size_flags_horizontal = 4 size_flags_vertical = 4 use_hidden_tabs_for_min_size = true @@ -46,7 +48,7 @@ use_hidden_tabs_for_min_size = true anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 30.0 -margin_top = 90.0 +margin_top = 86.0 margin_right = -30.0 margin_bottom = -30.0 custom_constants/separation = 5 @@ -55,13 +57,13 @@ custom_constants/separation = 5 anchor_right = 0.0 anchor_bottom = 0.0 margin_right = 1008.0 -margin_bottom = 227.0 +margin_bottom = 225.0 [node name="flag" parent="choose/signup" instance=ExtResource( 1 )] margin_left = 389.0 -margin_top = 232.0 +margin_top = 230.0 margin_right = 619.0 -margin_bottom = 338.0 +margin_bottom = 332.0 rect_min_size = Vector2( 230, 0 ) size_flags_horizontal = 4 text = "flag" @@ -69,23 +71,24 @@ icon = ExtResource( 3 ) offset = Vector2( 50, -400 ) [node name="signupbutton" type="Button" parent="choose/signup"] -margin_left = 389.0 -margin_top = 343.0 -margin_right = 619.0 -margin_bottom = 449.0 -rect_min_size = Vector2( 230, 0 ) + focus_mode = 0 +margin_left = 379.0 +margin_top = 337.0 +margin_right = 629.0 +margin_bottom = 439.0 +rect_min_size = Vector2( 250, 20 ) hint_tooltip = "sign up" -focus_mode = 0 + size_flags_horizontal = 4 -enabled_focus_mode = 0 -text = "sign up" + +text = "sign up " [node name="signin" type="VBoxContainer" parent="choose"] visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 30.0 -margin_top = 90.0 +margin_top = 86.0 margin_right = -30.0 margin_bottom = -30.0 custom_constants/separation = 5 @@ -93,21 +96,21 @@ custom_constants/separation = 5 [node name="usernamepass" parent="choose/signin" instance=ExtResource( 5 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = 177.0 -margin_right = 1185.0 -margin_bottom = 227.0 +margin_right = 1008.0 +margin_bottom = 225.0 [node name="signinbutton" type="Button" parent="choose/signin"] -margin_left = 566.0 -margin_top = 232.0 -margin_right = 796.0 -margin_bottom = 338.0 -rect_min_size = Vector2( 230, 0 ) + focus_mode = 0 +margin_left = 388.0 +margin_top = 230.0 +margin_right = 619.0 +margin_bottom = 332.0 +rect_min_size = Vector2( 250, 20 ) hint_tooltip = "sign in" -focus_mode = 0 + size_flags_horizontal = 4 -enabled_focus_mode = 0 -text = "sign in" + +text = "sign in " [node name="LoadingAnimation" type="TextureRect" parent="."] visible = false diff --git a/ui/menus/account/Secret.gd b/ui/menus/account/Secret.gd index 1410025..0d562ea 100644 --- a/ui/menus/account/Secret.gd +++ b/ui/menus/account/Secret.gd @@ -1,20 +1,8 @@ -extends TextureButton - -export(Color) var focusedcolor := Color(0.396078, 0.423529, 0.45098) -export(Texture) var map_tex +extends Button onready var pw := $"../Password" -func _ready() -> void: - var bitmap := BitMap.new() - bitmap.create_from_image_alpha(map_tex.get_data()) - texture_click_mask = bitmap - - -func _focus(what: bool) -> void: - modulate = focusedcolor if what else Color.white - - -func _toggled(button_pressed: bool) -> void: - pw.secret = button_pressed +func _toggled(p: bool) -> void: + pw.secret = p + text = "" if p else "" diff --git a/ui/menus/account/usernamepass.tscn b/ui/menus/account/usernamepass.tscn index b795feb..78aebb5 100644 --- a/ui/menus/account/usernamepass.tscn +++ b/ui/menus/account/usernamepass.tscn @@ -1,14 +1,18 @@ [gd_scene load_steps=9 format=2] -[ext_resource path="res://assets/ui/eyemap.png" type="Texture" id=1] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] [ext_resource path="res://ui/menus/account/Secret.gd" type="Script" id=2] -[ext_resource path="res://assets/ui/eye.png" type="Texture" id=3] -[ext_resource path="res://assets/ui/eye_off.png" type="Texture" id=4] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=5] [ext_resource path="res://ui/menus/account/usernamepass.gd" type="Script" id=6] [ext_resource path="res://ui/menus/account/Password.gd" type="Script" id=7] [ext_resource path="res://ui/menus/account/Username.gd" type="Script" id=8] +[sub_resource type="DynamicFont" id=2] +size = 85 +font_data = ExtResource( 1 ) + +[sub_resource type="StyleBoxEmpty" id=1] + [node name="usernamepass" type="VBoxContainer"] anchor_right = 1.0 anchor_bottom = 1.0 @@ -21,9 +25,9 @@ script = ExtResource( 6 ) [node name="Username" type="LineEdit" parent="."] margin_left = 361.0 -margin_top = 286.0 +margin_top = 288.0 margin_right = 1061.0 -margin_bottom = 392.0 +margin_bottom = 390.0 rect_min_size = Vector2( 700, 0 ) size_flags_horizontal = 4 size_flags_vertical = 0 @@ -34,16 +38,17 @@ caret_blink_speed = 0.5 script = ExtResource( 8 ) [node name="H" type="HBoxContainer" parent="."] -margin_top = 407.0 +margin_top = 405.0 margin_right = 1422.0 -margin_bottom = 513.0 +margin_bottom = 511.0 custom_constants/separation = 2 alignment = 1 [node name="Password" type="LineEdit" parent="H"] margin_left = 207.0 +margin_top = 2.0 margin_right = 1107.0 -margin_bottom = 106.0 +margin_bottom = 104.0 rect_min_size = Vector2( 900, 0 ) size_flags_horizontal = 4 size_flags_vertical = 4 @@ -55,23 +60,27 @@ caret_blink = true caret_blink_speed = 0.5 script = ExtResource( 7 ) -[node name="Secret" type="TextureButton" parent="H"] +[node name="Secret" type="Button" parent="H"] + focus_mode = 0 margin_left = 1109.0 margin_right = 1215.0 margin_bottom = 106.0 rect_min_size = Vector2( 106, 106 ) -focus_mode = 1 + +custom_colors/font_color_focus = Color( 1, 1, 1, 1 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.976471, 0.937255, 0.937255, 1 ) +custom_colors/font_color_pressed = Color( 1, 1, 1, 1 ) +custom_fonts/font = SubResource( 2 ) +custom_styles/hover = SubResource( 1 ) +custom_styles/pressed = SubResource( 1 ) +custom_styles/focus = SubResource( 1 ) +custom_styles/disabled = SubResource( 1 ) +custom_styles/normal = SubResource( 1 ) toggle_mode = true pressed = true -enabled_focus_mode = 1 -texture_normal = ExtResource( 3 ) -texture_pressed = ExtResource( 4 ) -expand = true +text = "" script = ExtResource( 2 ) -focusedcolor = Color( 0.921569, 0.827451, 0.827451, 1 ) -map_tex = ExtResource( 1 ) [connection signal="text_changed" from="Username" to="Username" method="_on_text_changed"] [connection signal="text_changed" from="H/Password" to="H/Password" method="_on_text_changed"] -[connection signal="mouse_entered" from="H/Secret" to="H/Secret" method="_focus" binds= [ true ]] -[connection signal="mouse_exited" from="H/Secret" to="H/Secret" method="_focus" binds= [ false ]] diff --git a/ui/menus/settings/Preview.gd b/ui/menus/settings/Preview.gd index 8807498..41a7997 100644 --- a/ui/menus/settings/Preview.gd +++ b/ui/menus/settings/Preview.gd @@ -11,6 +11,7 @@ const pieces = [ "K", "Q", "B", "N", "R", ] + func _init() -> void: columns = size.x for x in size.x: @@ -28,12 +29,12 @@ func _init() -> void: update_preview(Color(0.870588, 0.890196, 0.901961), Color(0.54902, 0.635294, 0.678431), "california") -func update_preview(color1:Color, color2:Color, piece_set:String) -> void: +func update_preview(color1: Color, color2: Color, piece_set: String) -> void: var squares := get_children() for i in range(size.x * size.y): squares[i].color = color1 if i % 2 == 0 else color2 var top := (size.x * size.y) / 2 for i in size.x * size.y: - var node :TextureRect= squares[i].get_node("Piece") + var node: TextureRect = squares[i].get_node("Piece") var things := [piece_set, "b" if i < top else "w", pieces[i]] node.texture = load("res://assets/pieces/%s/%s%s.png" % things) diff --git a/ui/menus/settings/Settings.tscn b/ui/menus/settings/Settings.tscn index e2bce7f..ca1b83f 100644 --- a/ui/menus/settings/Settings.tscn +++ b/ui/menus/settings/Settings.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] [ext_resource path="res://ui/menus/settings/Settings.gd" type="Script" id=2] +[ext_resource path="res://ui/checkboxbutton/CheckBoxButton.gd" type="Script" id=3] [ext_resource path="res://ui/menus/settings/Preview.gd" type="Script" id=4] [ext_resource path="res://ui/colorpicker/ColorPickerButton.tscn" type="PackedScene" id=5] [ext_resource path="res://ui/gridmenu/GridMenuButton.tscn" type="PackedScene" id=6] @@ -13,136 +14,138 @@ theme = ExtResource( 1 ) script = ExtResource( 2 ) [node name="H" type="HBoxContainer" parent="."] -margin_left = 119.0 -margin_top = 107.0 -margin_right = 1303.0 -margin_bottom = 693.0 +margin_left = 245.0 +margin_top = 126.0 +margin_right = 1177.0 +margin_bottom = 674.0 mouse_filter = 2 size_flags_horizontal = 0 size_flags_vertical = 0 alignment = 1 [node name="TabContainer" type="TabContainer" parent="H"] -margin_right = 669.0 -margin_bottom = 570.0 +margin_right = 417.0 +margin_bottom = 452.0 size_flags_vertical = 0 custom_constants/hseparation = 20 drag_to_rearrange_enabled = true use_hidden_tabs_for_min_size = true -[node name="colors" type="VBoxContainer" parent="H/TabContainer"] +[node name="" type="VBoxContainer" parent="H/TabContainer"] anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 30.0 -margin_top = 90.0 +margin_top = 86.0 margin_right = -30.0 margin_bottom = -30.0 alignment = 1 -[node name="boardcolor1" parent="H/TabContainer/colors" instance=ExtResource( 5 )] -margin_left = 141.0 -margin_top = 51.0 -margin_right = 467.0 -margin_bottom = 157.0 +[node name="boardcolor1" parent="H/TabContainer/" instance=ExtResource( 5 )] +margin_left = 34.0 +margin_right = 322.0 +margin_bottom = 102.0 size_flags_horizontal = 4 text = "boardcolor1" -[node name="boardcolor2" parent="H/TabContainer/colors" instance=ExtResource( 5 )] -margin_left = 141.0 -margin_top = 172.0 -margin_right = 467.0 -margin_bottom = 278.0 +[node name="boardcolor2" parent="H/TabContainer/" instance=ExtResource( 5 )] +margin_left = 34.0 +margin_top = 117.0 +margin_right = 322.0 +margin_bottom = 219.0 size_flags_horizontal = 4 text = "boardcolor2" -[node name="PieceSet" parent="H/TabContainer/colors" instance=ExtResource( 6 )] -margin_left = 175.0 -margin_top = 293.0 -margin_right = 434.0 -margin_bottom = 399.0 +[node name="PieceSet" parent="H/TabContainer/" instance=ExtResource( 6 )] +margin_left = 64.0 +margin_top = 234.0 +margin_right = 292.0 +margin_bottom = 336.0 size_flags_horizontal = 4 text = "piece set" -[node name="window" type="VBoxContainer" parent="H/TabContainer"] +[node name="" type="VBoxContainer" parent="H/TabContainer"] visible = false anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 30.0 -margin_top = 90.0 +margin_top = 86.0 margin_right = -30.0 margin_bottom = -30.0 mouse_filter = 2 alignment = 1 -[node name="VsyncButton" type="CheckBox" parent="H/TabContainer/window"] -margin_left = 213.0 -margin_right = 486.0 -margin_bottom = 140.0 +[node name="FullscreenButton" type="Button" parent="H/TabContainer/"] +margin_left = 142.0 +margin_right = 391.0 +margin_bottom = 102.0 focus_mode = 0 size_flags_horizontal = 4 -pressed = true -enabled_focus_mode = 0 -text = "vsync" +toggle_mode = true +text = "fullscreen" +script = ExtResource( 3 ) -[node name="FullscreenButton" type="CheckBox" parent="H/TabContainer/window"] -margin_left = 165.0 -margin_top = 155.0 -margin_right = 534.0 -margin_bottom = 295.0 +[node name="VsyncButton" type="Button" parent="H/TabContainer/"] +margin_left = 185.0 +margin_top = 117.0 +margin_right = 348.0 +margin_bottom = 219.0 focus_mode = 0 size_flags_horizontal = 4 -enabled_focus_mode = 0 -text = "fullscreen" +toggle_mode = true +text = "vsync" +script = ExtResource( 3 ) -[node name="Borderless" type="CheckBox" parent="H/TabContainer/window"] -margin_left = 191.0 -margin_top = 310.0 -margin_right = 509.0 -margin_bottom = 450.0 +[node name="Borderless" type="Button" parent="H/TabContainer/"] +margin_left = 165.0 +margin_top = 234.0 +margin_right = 369.0 +margin_bottom = 336.0 focus_mode = 0 size_flags_horizontal = 4 -enabled_focus_mode = 0 +toggle_mode = true text = "borders" +script = ExtResource( 3 ) [node name="misc" type="VBoxContainer" parent="H/TabContainer"] visible = false margin_right = 40.0 margin_bottom = 40.0 -[node name="rainbow" type="CheckBox" parent="H/TabContainer/misc"] +[node name="rainbow" type="Button" parent="H/TabContainer/misc"] margin_right = 609.0 margin_bottom = 140.0 focus_mode = 0 -enabled_focus_mode = 0 -text = "rainbow background" +toggle_mode = true +text = "rgb background" align = 2 +script = ExtResource( 3 ) [node name="Container" type="VBoxContainer" parent="H"] -margin_left = 684.0 -margin_right = 1184.0 -margin_bottom = 586.0 +margin_left = 432.0 +margin_right = 932.0 +margin_bottom = 548.0 rect_min_size = Vector2( 300, 0 ) +custom_constants/separation = 0 [node name="resetbutton" type="Button" parent="H/Container"] -margin_left = 129.0 -margin_right = 370.0 -margin_bottom = 106.0 +margin_left = 118.0 +margin_right = 382.0 +margin_bottom = 102.0 focus_mode = 0 size_flags_horizontal = 4 -enabled_focus_mode = 0 -text = "reset all" +text = "reset all ﰇ" [node name="PreviewLabel" type="Label" parent="H/Container"] -margin_top = 121.0 +margin_top = 102.0 margin_right = 500.0 -margin_bottom = 171.0 +margin_bottom = 148.0 text = "Preview" align = 1 [node name="Preview" type="GridContainer" parent="H/Container"] -margin_top = 186.0 +margin_top = 148.0 margin_right = 500.0 -margin_bottom = 586.0 +margin_bottom = 548.0 rect_min_size = Vector2( 500, 0 ) size_flags_horizontal = 4 custom_constants/vseparation = 0 @@ -153,11 +156,11 @@ __meta__ = { "_edit_group_": true } -[connection signal="newcolor" from="H/TabContainer/colors/boardcolor1" to="." method="_on_boardcolor1_newcolor"] -[connection signal="newcolor" from="H/TabContainer/colors/boardcolor2" to="." method="_on_boardcolor2_newcolor"] -[connection signal="selected" from="H/TabContainer/colors/PieceSet" to="." method="_on_PieceSet_selected"] -[connection signal="toggled" from="H/TabContainer/window/VsyncButton" to="." method="_on_VsyncButton_toggled"] -[connection signal="toggled" from="H/TabContainer/window/FullscreenButton" to="." method="_on_FullscreenButton_toggled"] -[connection signal="toggled" from="H/TabContainer/window/Borderless" to="." method="_on_Borderless_toggled"] +[connection signal="newcolor" from="H/TabContainer//boardcolor1" to="." method="_on_boardcolor1_newcolor"] +[connection signal="newcolor" from="H/TabContainer//boardcolor2" to="." method="_on_boardcolor2_newcolor"] +[connection signal="selected" from="H/TabContainer//PieceSet" to="." method="_on_PieceSet_selected"] +[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/misc/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 b66c5b2..63e5ddb 100644 --- a/ui/menus/sidebarright/SidebarRight.tscn +++ b/ui/menus/sidebarright/SidebarRight.tscn @@ -1,27 +1,61 @@ -[gd_scene load_steps=18 format=2] +[gd_scene load_steps=21 format=2] -[ext_resource path="res://ui/barbutton/drawbutton.gd" type="Script" id=1] -[ext_resource path="res://ui/barbutton/resignbutton.gd" type="Script" id=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/barbutton/BarTextureButton.tscn" type="PackedScene" id=6] -[ext_resource path="res://assets/ui/Roboto-Medium.ttf" type="DynamicFontData" id=12] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" 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-small.tres" type="DynamicFont" id=8] [ext_resource path="res://ui/menus/sidebarright/SidebarRight.gd" type="Script" id=13] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=14] -[ext_resource path="res://assets/ui/undo.png" type="Texture" id=15] -[ext_resource path="res://assets/ui/draw.png" type="Texture" id=16] -[ext_resource path="res://assets/ui/flip_board.png" type="Texture" id=17] -[ext_resource path="res://ui/barbutton/undobutton.gd" type="Script" id=18] -[ext_resource path="res://ui/barbutton/flipbutton.gd" type="Script" id=19] -[ext_resource path="res://assets/ui/flag.png" type="Texture" id=20] +[ext_resource path="res://ui/menus/sidebarright/undobutton.gd" type="Script" id=18] +[ext_resource path="res://ui/menus/sidebarright/flipbutton.gd" type="Script" id=19] [ext_resource path="res://ui/menus/sidebarright/sandisplay/SanDisplay.tscn" type="PackedScene" id=21] [ext_resource path="res://ui/menus/sidebarright/UserPanel.tscn" type="PackedScene" id=22] [sub_resource type="StyleBoxFlat" id=9] bg_color = Color( 0.14902, 0.141176, 0.129412, 0.588235 ) +[sub_resource type="DynamicFont" id=10] +size = 40 +font_data = ExtResource( 4 ) + +[sub_resource type="StyleBoxEmpty" id=11] + +[sub_resource type="StyleBoxFlat" id=21] +content_margin_left = 10.0 +content_margin_right = 10.0 +content_margin_top = 10.0 +content_margin_bottom = 10.0 +bg_color = Color( 0, 0, 0, 0.694118 ) +corner_radius_top_left = 20 +corner_radius_top_right = 20 +corner_radius_bottom_right = 20 +corner_radius_bottom_left = 20 +corner_detail = 15 + [sub_resource type="DynamicFont" id=1] -size = 35 -font_data = ExtResource( 12 ) +size = 85 +font_data = ExtResource( 4 ) + +[sub_resource type="Theme" id=12] +default_font = SubResource( 1 ) +Button/colors/font_color = Color( 1, 1, 1, 1 ) +Button/colors/font_color_disabled = Color( 0.643137, 0.592157, 0.592157, 0.2 ) +Button/colors/font_color_focus = Color( 1, 1, 1, 1 ) +Button/colors/font_color_hover = Color( 1, 1, 1, 1 ) +Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) +Button/fonts/font = SubResource( 10 ) +Button/styles/disabled = ExtResource( 7 ) +Button/styles/focus = SubResource( 11 ) +Button/styles/hover = ExtResource( 5 ) +Button/styles/normal = ExtResource( 7 ) +Button/styles/pressed = ExtResource( 6 ) +TooltipLabel/colors/font_color = Color( 1, 1, 1, 1 ) +TooltipLabel/fonts/font = ExtResource( 8 ) +TooltipPanel/styles/panel = SubResource( 21 ) [node name="SidebarRight" type="PanelContainer"] anchor_right = 1.0 @@ -45,14 +79,14 @@ alignment = 1 [node name="BlackPanel" parent="V" instance=ExtResource( 22 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 214.0 +margin_top = 212.0 margin_right = 1422.0 -margin_bottom = 254.0 +margin_bottom = 252.0 [node name="buttonbarholder" type="PanelContainer" parent="V"] -margin_top = 254.0 +margin_top = 252.0 margin_right = 1422.0 -margin_bottom = 304.0 +margin_bottom = 302.0 rect_min_size = Vector2( 50, 50 ) __meta__ = { "_edit_group_": true, @@ -62,44 +96,56 @@ __meta__ = { [node name="buttonbar" type="HBoxContainer" parent="V/buttonbarholder"] margin_right = 1422.0 margin_bottom = 50.0 +theme = SubResource( 12 ) custom_constants/separation = 0 alignment = 1 -[node name="FlipBoard" parent="V/buttonbarholder/buttonbar" instance=ExtResource( 6 )] +[node name="FlipButton" type="Button" parent="V/buttonbarholder/buttonbar"] margin_right = 355.0 -hint_tooltip = "rotate the board" +margin_bottom = 50.0 +hint_tooltip = "flip the board" +focus_mode = 0 +mouse_default_cursor_shape = 2 size_flags_horizontal = 3 -texture_normal = ExtResource( 17 ) -stretch_mode = 5 +text = "" script = ExtResource( 19 ) -[node name="DrawButton" parent="V/buttonbarholder/buttonbar" instance=ExtResource( 6 )] +[node name="DrawButton" type="Button" parent="V/buttonbarholder/buttonbar"] margin_left = 355.0 margin_right = 711.0 +margin_bottom = 50.0 +rect_min_size = Vector2( 0, 50 ) hint_tooltip = "request a draw" +focus_mode = 0 +mouse_default_cursor_shape = 2 size_flags_horizontal = 3 -texture_normal = ExtResource( 16 ) -stretch_mode = 5 +text = "½-½" script = ExtResource( 1 ) confirm_text = "Your opponent requests a draw" -[node name="ResignButton" parent="V/buttonbarholder/buttonbar" instance=ExtResource( 6 )] +[node name="ResignButton" type="Button" parent="V/buttonbarholder/buttonbar"] margin_left = 711.0 margin_right = 1066.0 +margin_bottom = 50.0 +rect_min_size = Vector2( 0, 50 ) hint_tooltip = "resign" +focus_mode = 0 +mouse_default_cursor_shape = 2 size_flags_horizontal = 3 -texture_normal = ExtResource( 20 ) -stretch_mode = 5 +text = "" script = ExtResource( 2 ) confirm_text = "Resign?" -[node name="UndoButton" parent="V/buttonbarholder/buttonbar" instance=ExtResource( 6 )] +[node name="UndoButton" type="Button" parent="V/buttonbarholder/buttonbar"] margin_left = 1066.0 margin_right = 1422.0 +margin_bottom = 50.0 +rect_min_size = Vector2( 0, 50 ) hint_tooltip = "request a undo" +focus_mode = 0 +mouse_default_cursor_shape = 2 size_flags_horizontal = 3 -texture_normal = ExtResource( 15 ) -stretch_mode = 5 +text = "社" script = ExtResource( 18 ) confirm_text = "Your opponent requests a undo" status = NodePath("../../../Status") @@ -107,23 +153,22 @@ status = NodePath("../../../Status") [node name="SanDisplay" parent="V" instance=ExtResource( 21 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 304.0 +margin_top = 302.0 margin_right = 1422.0 -margin_bottom = 504.0 +margin_bottom = 502.0 rect_min_size = Vector2( 482, 200 ) [node name="WhitePanel" parent="V" instance=ExtResource( 22 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 504.0 +margin_top = 502.0 margin_right = 1422.0 -margin_bottom = 544.0 +margin_bottom = 542.0 [node name="Status" type="Label" parent="V"] -margin_top = 544.0 +margin_top = 542.0 margin_right = 1422.0 -margin_bottom = 586.0 -custom_fonts/font = SubResource( 1 ) +margin_bottom = 588.0 align = 1 autowrap = true script = ExtResource( 3 ) diff --git a/ui/menus/sidebarright/UserPanel.tscn b/ui/menus/sidebarright/UserPanel.tscn index fffa3f6..9bd422a 100644 --- a/ui/menus/sidebarright/UserPanel.tscn +++ b/ui/menus/sidebarright/UserPanel.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://ui/verdana-bold-small.tres" type="DynamicFont" id=1] +[ext_resource path="res://ui/ubuntu-bold-small.tres" type="DynamicFont" id=1] [ext_resource path="res://assets/flags/rainbow.png" type="Texture" id=2] [ext_resource path="res://ui/theme/main.tres" type="Theme" id=3] [ext_resource path="res://ui/menus/sidebarright/UserPanel.gd" type="Script" id=4] diff --git a/ui/barbutton/confirmbutton.gd b/ui/menus/sidebarright/confirmbutton.gd index dbf4987..62d8a60 100644 --- a/ui/barbutton/confirmbutton.gd +++ b/ui/menus/sidebarright/confirmbutton.gd @@ -1,4 +1,4 @@ -extends BarTextureButton +extends Button class_name ConfirmButton const Confirm = preload("res://ui/confirm/Confirm.tscn") @@ -12,6 +12,10 @@ func _ready() -> void: PacketHandler.connect("signal_recieved", self, "_signal_recieved") +func _signal_recieved(_signal: Dictionary) -> void: + pass + + func confirm() -> void: if !waiting_on_answer: var confirm = Confirm.instance() @@ -20,8 +24,9 @@ func confirm() -> void: waiting_on_answer = confirm -func _signal_recieved(_signal: Dictionary) -> void: - pass +func set_disabled(new: bool) -> void: + disabled = new + mouse_default_cursor_shape = CURSOR_FORBIDDEN if new else CURSOR_POINTING_HAND func _confirmed(what: bool) -> void: diff --git a/ui/barbutton/drawbutton.gd b/ui/menus/sidebarright/drawbutton.gd index 14f4f57..877a5ac 100644 --- a/ui/barbutton/drawbutton.gd +++ b/ui/menus/sidebarright/drawbutton.gd @@ -1,5 +1,5 @@ extends ConfirmButton -class_name DrawButton, "res://assets/ui/draw.png" +class_name DrawButton const draw_declined_message = "draw request rejected" const draw_request_message = "%s requests a draw" diff --git a/ui/menus/sidebarright/flipbutton.gd b/ui/menus/sidebarright/flipbutton.gd new file mode 100644 index 0000000..bf9fc51 --- /dev/null +++ b/ui/menus/sidebarright/flipbutton.gd @@ -0,0 +1,6 @@ +extends Button +class_name FlipButton + + +func _pressed() -> void: + Globals.grid.flip_board() diff --git a/ui/barbutton/resignbutton.gd b/ui/menus/sidebarright/resignbutton.gd index e84569d..47b5946 100644 --- a/ui/barbutton/resignbutton.gd +++ b/ui/menus/sidebarright/resignbutton.gd @@ -1,5 +1,5 @@ extends ConfirmButton -class_name ResignButton, "res://assets/ui/flag.png" +class_name ResignButton func _signal_recieved(what: Dictionary) -> void: diff --git a/ui/menus/sidebarright/sandisplay/Base.tscn b/ui/menus/sidebarright/sandisplay/Base.tscn index b1908eb..65339bf 100644 --- a/ui/menus/sidebarright/sandisplay/Base.tscn +++ b/ui/menus/sidebarright/sandisplay/Base.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://ui/menus/sidebarright/sandisplay/Base.gd" type="Script" id=1] -[ext_resource path="res://ui/verdana-bold-small.tres" type="DynamicFont" id=2] +[ext_resource path="res://ui/ubuntu-bold-small.tres" type="DynamicFont" id=2] [node name="Base" type="HBoxContainer"] anchor_right = 1.0 diff --git a/ui/barbutton/undobutton.gd b/ui/menus/sidebarright/undobutton.gd index 6788c5e..1ad96ce 100644 --- a/ui/barbutton/undobutton.gd +++ b/ui/menus/sidebarright/undobutton.gd @@ -1,5 +1,5 @@ extends ConfirmButton -class_name UndoButton, "res://assets/ui/undo.png" +class_name UndoButton export(NodePath) onready var status = get_node(status) as StatusLabel const undo_request_message = "%s requested a undo" diff --git a/ui/theme/main.tres b/ui/theme/main.tres index a28f518..bf927ea 100644 --- a/ui/theme/main.tres +++ b/ui/theme/main.tres @@ -1,6 +1,6 @@ -[gd_resource type="Theme" load_steps=29 format=2] +[gd_resource type="Theme" load_steps=31 format=2] -[ext_resource path="res://ui/verdana-bold.tres" type="DynamicFont" id=1] +[ext_resource path="res://ui/ubuntu-bold-small.tres" type="DynamicFont" id=1] [ext_resource path="res://ui/theme/button.tres" type="StyleBox" id=2] [ext_resource path="res://assets/ui/whitespace.png" type="Texture" id=3] [ext_resource path="res://assets/ui/button.png" type="Texture" id=4] @@ -8,11 +8,12 @@ [ext_resource path="res://assets/ui/checkedbox.png" type="Texture" id=6] [ext_resource path="res://ui/theme/flatblack.tres" type="StyleBox" id=7] [ext_resource path="res://ui/theme/transblack.tres" type="StyleBox" id=8] -[ext_resource path="res://assets/ui/verdana.ttf" type="DynamicFontData" id=9] +[ext_resource path="res://ui/ubuntu-bold.tres" type="DynamicFont" id=9] [ext_resource path="res://assets/ui/CascadiaCode.ttf" type="DynamicFontData" id=10] -[ext_resource path="res://assets/ui/verdana-bold-italic.ttf" type="DynamicFontData" id=11] -[ext_resource path="res://ui/verdana-bold-small.tres" type="DynamicFont" id=12] +[ext_resource path="res://assets/ui/ubuntu.ttf" type="DynamicFontData" id=11] +[ext_resource path="res://assets/ui/ubuntu-bold-italic.ttf" type="DynamicFontData" id=12] [ext_resource path="res://ui/theme/panel.tres" type="StyleBox" id=13] +[ext_resource path="res://assets/ui/ubuntu-italic.ttf" type="DynamicFontData" id=14] [sub_resource type="StyleBoxTexture" id=6] texture = ExtResource( 4 ) @@ -44,7 +45,11 @@ expand_margin_right = 10.0 [sub_resource type="DynamicFont" id=19] size = 20 -font_data = ExtResource( 11 ) +font_data = ExtResource( 14 ) + +[sub_resource type="DynamicFont" id=22] +size = 20 +font_data = ExtResource( 12 ) [sub_resource type="DynamicFont" id=14] size = 20 @@ -52,7 +57,7 @@ font_data = ExtResource( 10 ) [sub_resource type="DynamicFont" id=20] size = 20 -font_data = ExtResource( 9 ) +font_data = ExtResource( 11 ) [sub_resource type="StyleBoxFlat" id=10] content_margin_left = 30.0 @@ -116,7 +121,7 @@ corner_detail = 15 expand_margin_top = 65.0 [resource] -default_font = ExtResource( 1 ) +default_font = ExtResource( 9 ) Button/colors/font_color = Color( 1, 1, 1, 1 ) Button/colors/font_color_disabled = Color( 1, 1, 1, 0.305882 ) Button/colors/font_color_focus = Color( 1, 1, 1, 1 ) @@ -139,12 +144,6 @@ ColorPicker/icons/color_sample = ExtResource( 3 ) ColorPicker/icons/overbright_indicator = ExtResource( 3 ) ColorPicker/icons/preset_bg = ExtResource( 3 ) ColorPicker/icons/screen_picker = ExtResource( 3 ) -ColorPickerButton/colors/font_color = Color( 1, 1, 1, 1 ) -ColorPickerButton/colors/font_color_disabled = Color( 1, 1, 1, 0.301961 ) -ColorPickerButton/colors/font_color_focus = Color( 1, 1, 1, 1 ) -ColorPickerButton/colors/font_color_hover = Color( 1, 1, 1, 1 ) -ColorPickerButton/colors/font_color_pressed = Color( 0.913725, 0.913725, 0.913725, 1 ) -ColorPickerButton/icons/bg = ExtResource( 3 ) HBoxContainer/constants/separation = 15 HSlider/styles/grabber_area = SubResource( 7 ) HSlider/styles/grabber_area_highlight = SubResource( 8 ) @@ -176,9 +175,9 @@ PopupMenu/styles/hover = SubResource( 3 ) PopupMenu/styles/panel = ExtResource( 7 ) PopupPanel/styles/panel = ExtResource( 8 ) RichTextLabel/colors/default_color = Color( 1, 1, 1, 1 ) -RichTextLabel/fonts/bold_font = ExtResource( 12 ) +RichTextLabel/fonts/bold_font = ExtResource( 1 ) RichTextLabel/fonts/bold_italics_font = SubResource( 19 ) -RichTextLabel/fonts/italics_font = SubResource( 19 ) +RichTextLabel/fonts/italics_font = SubResource( 22 ) RichTextLabel/fonts/mono_font = SubResource( 14 ) RichTextLabel/fonts/normal_font = SubResource( 20 ) SpinBox/icons/updown = ExtResource( 3 ) @@ -188,7 +187,7 @@ TabContainer/styles/panel = SubResource( 10 ) TabContainer/styles/tab_bg = SubResource( 12 ) TabContainer/styles/tab_fg = SubResource( 11 ) TooltipLabel/colors/font_color = Color( 1, 1, 1, 1 ) -TooltipLabel/fonts/font = ExtResource( 12 ) +TooltipLabel/fonts/font = ExtResource( 1 ) TooltipPanel/styles/panel = SubResource( 21 ) VBoxContainer/constants/separation = 15 VScrollBar/styles/scroll = SubResource( 5 ) diff --git a/ui/verdana-bold-small.tres b/ui/ubuntu-bold-small.tres index b0fb90a..8466e0c 100644 --- a/ui/verdana-bold-small.tres +++ b/ui/ubuntu-bold-small.tres @@ -1,6 +1,6 @@ [gd_resource type="DynamicFont" load_steps=2 format=2] -[ext_resource path="res://assets/ui/verdana-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] [resource] size = 20 diff --git a/ui/verdana-bold.tres b/ui/ubuntu-bold.tres index 44ebde1..b904cd7 100644 --- a/ui/verdana-bold.tres +++ b/ui/ubuntu-bold.tres @@ -1,6 +1,6 @@ [gd_resource type="DynamicFont" load_steps=2 format=2] -[ext_resource path="res://assets/ui/verdana-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] [resource] size = 40 diff --git a/ui/ubuntu.tres b/ui/ubuntu.tres new file mode 100644 index 0000000..45c68a0 --- /dev/null +++ b/ui/ubuntu.tres @@ -0,0 +1,7 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://assets/ui/ubuntu.ttf" type="DynamicFontData" id=1] + +[resource] +size = 40 +font_data = ExtResource( 1 ) diff --git a/ui/virtual_keyboard/CapsLock.gd b/ui/virtual_keyboard/CapsLock.gd new file mode 100644 index 0000000..16ae665 --- /dev/null +++ b/ui/virtual_keyboard/CapsLock.gd @@ -0,0 +1,9 @@ +extends KeyUtils +class_name CapsLock + + +func _toggled(button_pressed: bool) -> void: + if button_pressed: + simulate_key_input_event(KEY_CAPSLOCK) + else: + simulate_key_input_event(KEY_CAPSLOCK, 0, false) diff --git a/ui/virtual_keyboard/Key.gd b/ui/virtual_keyboard/Key.gd new file mode 100644 index 0000000..fb953ea --- /dev/null +++ b/ui/virtual_keyboard/Key.gd @@ -0,0 +1,64 @@ +extends KeyUtils +class_name Key + +var scncode = 0 +var unicode = 0 +export(String) var key = "" setget set_key +export(String) var shift_key = "" setget set_shift_key +export(bool) var shift_on_capslock = false + +var shift_scncode := 0 +var shift_unicode := 0 + +var shf_p := false setget set_shift_pressed # is shift pressed + + +func set_shift_pressed(is_pressed: bool) -> void: + if shf_p != is_pressed: + shf_p = is_pressed + text = shift_key if shf_p else key + + +func set_shift_key(new_shift_key: String) -> void: + if len(new_shift_key) == 1: + shift_key = new_shift_key + shift_unicode = ord(shift_key) + shift_scncode = OS.find_scancode_from_string(shift_key) + elif new_shift_key: + print_debug("this size is incorrect") + + +func _input(event: InputEvent): + if event is InputEventKey: + if event.scancode == KEY_SHIFT: + if shift_on_capslock and shf_p and Input.is_action_pressed("caps"): + return + set_shift_pressed(event.pressed) + if event.scancode == KEY_CAPSLOCK and shift_on_capslock: + if Input.is_action_pressed("shift") and shf_p: + return + set_shift_pressed(event.pressed) + + +func set_key(new_key: String) -> void: + if len(new_key) == 1: + key = new_key + name = new_key if new_key.validate_node_name() else name + text = new_key + unicode = ord(new_key) + scncode = OS.find_scancode_from_string(key) + elif new_key: + print_debug("this size is incorrect") + + +func pressed(): + simulate_key_input_event(shift_scncode if shf_p else scncode, shift_unicode if shf_p else unicode) + + +func released(): + simulate_key_input_event(shift_scncode if shf_p else scncode, shift_unicode if shf_p else unicode, false) + + +func _ready(): + if !shift_key: + shift_key = key.to_upper() # x -> X diff --git a/ui/virtual_keyboard/Key.tscn b/ui/virtual_keyboard/Key.tscn new file mode 100644 index 0000000..492a1ad --- /dev/null +++ b/ui/virtual_keyboard/Key.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://ui/virtual_keyboard/kb_theme.theme" type="Theme" id=1] +[ext_resource path="res://ui/virtual_keyboard/Key.gd" type="Script" id=2] + +[node name="w" type="Button"] +margin_right = 40.0 +margin_bottom = 40.0 +rect_min_size = Vector2( 60, 60 ) + +theme = ExtResource( 1 ) +action_mode = 0 +keep_pressed_outside = true +text = "w" +script = ExtResource( 2 ) +key = "w" +shift_key = "W" +shift_on_capslock = null diff --git a/ui/virtual_keyboard/KeyUtils.gd b/ui/virtual_keyboard/KeyUtils.gd new file mode 100644 index 0000000..0b06d43 --- /dev/null +++ b/ui/virtual_keyboard/KeyUtils.gd @@ -0,0 +1,44 @@ +extends Button +class_name KeyUtils + +var is_pressed = false + + +func simulate_key_input_event(scancode: int, unicode := 0, pressed := true): + var i = InputEventKey.new() + i.pressed = pressed + i.scancode = scancode + i.unicode = unicode + Input.parse_input_event(i) + + +func is_mouse(event) -> bool: + return event is InputEventMouseButton and event.button_index == BUTTON_LEFT + + +func _input(event: InputEvent) -> void: + if is_mouse(event): + if !event.pressed and is_pressed: + _release() + elif event is InputEventMouseMotion: + if !get_global_rect().has_point(event.position): + _release() + + +func _release(): + if is_pressed != false: + is_pressed = false + released() + + +func _pressed(): + is_pressed = true + pressed() + + +func pressed() -> void: + pass + + +func released() -> void: + pass diff --git a/ui/virtual_keyboard/SpecialKey.gd b/ui/virtual_keyboard/SpecialKey.gd new file mode 100644 index 0000000..a2ea71c --- /dev/null +++ b/ui/virtual_keyboard/SpecialKey.gd @@ -0,0 +1,13 @@ +extends KeyUtils +class_name SpecialKey + +export(int) var k_scncode := 0 +var unicode := 0 + + +func pressed(): + simulate_key_input_event(k_scncode, unicode) + + +func released(): + simulate_key_input_event(k_scncode, unicode, false) diff --git a/ui/virtual_keyboard/VirtualKeyboard.gd b/ui/virtual_keyboard/VirtualKeyboard.gd new file mode 100644 index 0000000..d0a10ff --- /dev/null +++ b/ui/virtual_keyboard/VirtualKeyboard.gd @@ -0,0 +1,47 @@ +extends CanvasLayer +class_name VirtualKeyboard + +onready var holder = $ForceDown +var text: TextEditor + +signal done(text) +signal closed(text) + +export(PackedScene) var text_editor + + +func _ready(): + if !OS.has_touchscreen_ui_hint(): + $ForceDown/Panel/V/KeyHolder.free() # remove keys if not touchscreen + text = text_editor.instance() + $ForceDown/Panel/V.add_child(text) + $ForceDown/Panel/V.move_child(text, 0) + text.connect("done", self, "done") + + +func open(with_text: String = "") -> void: + text.text = with_text + var txedit = text.textedit + txedit.grab_focus() + txedit.cursor_set_line(txedit.get_line_count() - 1) + txedit.cursor_set_column(len(txedit.get_line(txedit.get_line_count() - 1))) + + show() + + +func hide(): + holder.hide() + + +func show(): + holder.show() + + +func done(tx := text.text) -> void: + emit_signal("done", tx) + hide() + + +func _on_Close_pressed(): + hide() + emit_signal("closed", text.text) diff --git a/ui/virtual_keyboard/VirtualKeyboard.tscn b/ui/virtual_keyboard/VirtualKeyboard.tscn new file mode 100644 index 0000000..969a7ca --- /dev/null +++ b/ui/virtual_keyboard/VirtualKeyboard.tscn @@ -0,0 +1,654 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://ui/virtual_keyboard/SpecialKey.gd" type="Script" id=1] +[ext_resource path="res://ui/virtual_keyboard/kb_theme.theme" type="Theme" id=2] +[ext_resource path="res://ui/virtual_keyboard/Key.gd" type="Script" id=3] +[ext_resource path="res://ui/virtual_keyboard/CapsLock.gd" type="Script" id=4] +[ext_resource path="res://ui/virtual_keyboard/VirtualKeyboard.gd" type="Script" id=5] +[ext_resource path="res://ui/chat/TextEditor.tscn" type="PackedScene" id=6] +[ext_resource path="res://ui/virtual_keyboard/Key.tscn" type="PackedScene" id=7] + +[sub_resource type="StyleBoxFlat" id=1] +content_margin_left = 15.0 +content_margin_right = 15.0 +content_margin_top = 15.0 +content_margin_bottom = 15.0 +bg_color = Color( 0.188235, 0.180392, 0.172549, 1 ) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 + +[node name="VirtualKeyboard" type="CanvasLayer"] +script = ExtResource( 5 ) +text_editor = ExtResource( 6 ) + +[node name="ForceDown" type="VBoxContainer" parent="."] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +alignment = 2 +__meta__ = { +"_edit_lock_": true +} + +[node name="Panel" type="PanelContainer" parent="ForceDown"] +margin_left = 213.0 +margin_top = 450.0 +margin_right = 1208.0 +margin_bottom = 800.0 +size_flags_horizontal = 4 +theme = ExtResource( 2 ) +custom_styles/panel = SubResource( 1 ) +__meta__ = { +"_edit_lock_": true, +"_editor_description_": "" +} + +[node name="V" type="VBoxContainer" parent="ForceDown/Panel"] +margin_left = 15.0 +margin_top = 15.0 +margin_right = 980.0 +margin_bottom = 335.0 +__meta__ = { +"_edit_lock_": true +} + +[node name="KeyHolder" type="VBoxContainer" parent="ForceDown/Panel/V"] +margin_right = 965.0 +margin_bottom = 320.0 +custom_constants/separation = 5 +__meta__ = { +"_edit_lock_": true +} + +[node name="Row1" type="HBoxContainer" parent="ForceDown/Panel/V/KeyHolder"] +margin_right = 965.0 +margin_bottom = 60.0 +custom_constants/separation = 5 +alignment = 1 +__meta__ = { +"_edit_lock_": true +} + +[node name="`" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_right = 60.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "`" +key = "`" +shift_key = "~" + +[node name="1" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 65.0 +margin_right = 125.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "1" +key = "1" +shift_key = "!" + +[node name="2" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 130.0 +margin_right = 190.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "2" +key = "2" +shift_key = "@" + +[node name="3" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 195.0 +margin_right = 255.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "3" +key = "3" +shift_key = "#" + +[node name="4" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 260.0 +margin_right = 320.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "4" +key = "4" +shift_key = "$" + +[node name="5" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 325.0 +margin_right = 385.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "5" +key = "5" +shift_key = "%" + +[node name="6" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 390.0 +margin_right = 450.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "6" +key = "6" +shift_key = "^" + +[node name="7" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 455.0 +margin_right = 515.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "7" +key = "7" +shift_key = "&" + +[node name="8" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 520.0 +margin_right = 580.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "8" +key = "8" +shift_key = "*" + +[node name="9" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 585.0 +margin_right = 645.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "9" +key = "9" +shift_key = "(" + +[node name="0" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 650.0 +margin_right = 710.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "0" +key = "0" +shift_key = ")" + +[node name="-" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 715.0 +margin_right = 775.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "-" +key = "-" +shift_key = "_" + +[node name="=" parent="ForceDown/Panel/V/KeyHolder/Row1" instance=ExtResource( 7 )] +margin_left = 780.0 +margin_right = 840.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "=" +key = "=" +shift_key = "+" + +[node name="Backspace" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row1"] +margin_left = 845.0 +margin_right = 965.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 120, 45 ) +focus_mode = 0 +size_flags_horizontal = 3 +theme = ExtResource( 2 ) +action_mode = 0 +text = "" +script = ExtResource( 1 ) +k_scncode = 16777220 + +[node name="Row2" type="HBoxContainer" parent="ForceDown/Panel/V/KeyHolder"] +margin_top = 65.0 +margin_right = 965.0 +margin_bottom = 125.0 +custom_constants/separation = 5 +alignment = 1 +__meta__ = { +"_edit_lock_": true +} + +[node name="tab" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row2"] +margin_right = 90.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 90, 0 ) +focus_mode = 0 +size_flags_horizontal = 3 +text = "" +script = ExtResource( 1 ) +k_scncode = 16777218 + +[node name="q" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 95.0 +margin_right = 155.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "q" +key = "q" +shift_key = "Q" +shift_on_capslock = true + +[node name="w" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 160.0 +margin_right = 220.0 +margin_bottom = 60.0 +focus_mode = 0 +shift_on_capslock = true + +[node name="e" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 225.0 +margin_right = 285.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "e" +key = "e" +shift_key = "E" +shift_on_capslock = true + +[node name="r" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 290.0 +margin_right = 350.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "r" +key = "r" +shift_key = "R" +shift_on_capslock = true + +[node name="t" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 355.0 +margin_right = 415.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "t" +key = "t" +shift_key = "T" +shift_on_capslock = true + +[node name="y" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 420.0 +margin_right = 480.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "y" +key = "y" +shift_key = "Y" +shift_on_capslock = true + +[node name="u" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 485.0 +margin_right = 545.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "u" +key = "u" +shift_key = "U" +shift_on_capslock = true + +[node name="i" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 550.0 +margin_right = 610.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "i" +key = "i" +shift_key = "I" +shift_on_capslock = true + +[node name="o" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 615.0 +margin_right = 675.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "o" +key = "o" +shift_key = "O" +shift_on_capslock = true + +[node name="p" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 680.0 +margin_right = 740.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "p" +key = "p" +shift_key = "P" +shift_on_capslock = true + +[node name="[" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 745.0 +margin_right = 805.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "[" +key = "[" +shift_key = "{" + +[node name="]" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 810.0 +margin_right = 870.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "]" +key = "]" +shift_key = "}" + +[node name="\\" parent="ForceDown/Panel/V/KeyHolder/Row2" instance=ExtResource( 7 )] +margin_left = 875.0 +margin_right = 965.0 +margin_bottom = 60.0 +focus_mode = 0 +size_flags_horizontal = 3 +text = "\\" +key = "\\" +shift_key = "|" + +[node name="Row3" type="HBoxContainer" parent="ForceDown/Panel/V/KeyHolder"] +margin_top = 130.0 +margin_right = 965.0 +margin_bottom = 190.0 +custom_constants/separation = 5 +alignment = 1 +__meta__ = { +"_edit_lock_": true +} + +[node name="caps" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row3"] +margin_right = 122.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 120, 45 ) +focus_mode = 0 +size_flags_horizontal = 3 +theme = ExtResource( 2 ) +toggle_mode = true +action_mode = 0 +text = "" +script = ExtResource( 4 ) + +[node name="a" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 127.0 +margin_right = 187.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "a" +key = "a" +shift_key = "A" +shift_on_capslock = true + +[node name="s" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 192.0 +margin_right = 252.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "s" +key = "s" +shift_key = "S" +shift_on_capslock = true + +[node name="d" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 257.0 +margin_right = 317.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "d" +key = "d" +shift_key = "D" +shift_on_capslock = true + +[node name="f" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 322.0 +margin_right = 382.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "f" +key = "f" +shift_key = "F" +shift_on_capslock = true + +[node name="g" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 387.0 +margin_right = 447.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "g" +key = "g" +shift_key = "G" +shift_on_capslock = true + +[node name="h" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 452.0 +margin_right = 512.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "h" +key = "h" +shift_key = "H" +shift_on_capslock = true + +[node name="j" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 517.0 +margin_right = 577.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "j" +key = "j" +shift_key = "J" +shift_on_capslock = true + +[node name="k" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 582.0 +margin_right = 642.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "k" +key = "k" +shift_key = "K" +shift_on_capslock = true + +[node name="l" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 647.0 +margin_right = 707.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "l" +key = "l" +shift_key = "L" +shift_on_capslock = true + +[node name=";" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 712.0 +margin_right = 772.0 +margin_bottom = 60.0 +focus_mode = 0 +text = ";" +key = ";" +shift_key = ":" + +[node name="\'" parent="ForceDown/Panel/V/KeyHolder/Row3" instance=ExtResource( 7 )] +margin_left = 777.0 +margin_right = 837.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "'" +key = "'" +shift_key = "\"" + +[node name="enter" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row3"] +margin_left = 842.0 +margin_right = 965.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 120, 45 ) +focus_mode = 0 +size_flags_horizontal = 3 +theme = ExtResource( 2 ) +action_mode = 0 +text = "" +script = ExtResource( 1 ) +k_scncode = 16777221 + +[node name="Row4" type="HBoxContainer" parent="ForceDown/Panel/V/KeyHolder"] +margin_top = 195.0 +margin_right = 965.0 +margin_bottom = 255.0 +custom_constants/separation = 5 +alignment = 1 +__meta__ = { +"_edit_lock_": true +} + +[node name="shift" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row4"] +margin_right = 155.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 120, 45 ) +focus_mode = 0 +size_flags_horizontal = 3 +theme = ExtResource( 2 ) +action_mode = 0 +text = "וּ" +script = ExtResource( 1 ) +k_scncode = 16777237 + +[node name="z" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 160.0 +margin_right = 220.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "z" +key = "z" +shift_key = "Z" +shift_on_capslock = true + +[node name="x" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 225.0 +margin_right = 285.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "x" +key = "x" +shift_key = "X" +shift_on_capslock = true + +[node name="c" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 290.0 +margin_right = 350.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "c" +key = "c" +shift_key = "C" +shift_on_capslock = true + +[node name="v" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 355.0 +margin_right = 415.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "v" +key = "v" +shift_key = "V" +shift_on_capslock = true + +[node name="b" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 420.0 +margin_right = 480.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "b" +key = "b" +shift_key = "B" +shift_on_capslock = true + +[node name="n" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 485.0 +margin_right = 545.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "n" +key = "n" +shift_key = "N" +shift_on_capslock = true + +[node name="m" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 550.0 +margin_right = 610.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "m" +key = "m" +shift_key = "M" +shift_on_capslock = true + +[node name="," parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 615.0 +margin_right = 675.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "," +key = "," +shift_key = "<" + +[node name="dot" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 680.0 +margin_right = 740.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "." +key = "." +shift_key = ">" + +[node name="slash" parent="ForceDown/Panel/V/KeyHolder/Row4" instance=ExtResource( 7 )] +margin_left = 745.0 +margin_right = 805.0 +margin_bottom = 60.0 +focus_mode = 0 +text = "/" +key = "/" +shift_key = "?" + +[node name="shift2" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row4"] +margin_left = 810.0 +margin_right = 965.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 120, 45 ) +focus_mode = 0 +size_flags_horizontal = 3 +theme = ExtResource( 2 ) +action_mode = 0 +text = "וּ" +script = ExtResource( 1 ) +k_scncode = 16777237 + +[node name="Row5" type="HBoxContainer" parent="ForceDown/Panel/V/KeyHolder"] +margin_top = 260.0 +margin_right = 965.0 +margin_bottom = 320.0 +custom_constants/separation = 5 +alignment = 1 +__meta__ = { +"_edit_lock_": true +} + +[node name="Spacebar" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row5"] +margin_right = 900.0 +margin_bottom = 60.0 +focus_mode = 0 +size_flags_horizontal = 3 +text = " " +script = ExtResource( 3 ) +key = " " +shift_key = " " + +[node name="Close" type="Button" parent="ForceDown/Panel/V/KeyHolder/Row5"] +margin_left = 905.0 +margin_right = 965.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 60, 60 ) +focus_mode = 0 +theme = ExtResource( 2 ) +action_mode = 0 +keep_pressed_outside = true +text = "" + +[connection signal="pressed" from="ForceDown/Panel/V/KeyHolder/Row5/Close" to="." method="_on_Close_pressed"] diff --git a/ui/virtual_keyboard/high_light.tres b/ui/virtual_keyboard/high_light.tres new file mode 100644 index 0000000..dfe6d61 --- /dev/null +++ b/ui/virtual_keyboard/high_light.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +content_margin_left = 2.0 +content_margin_right = 2.0 +content_margin_top = 2.0 +content_margin_bottom = 2.0 +bg_color = Color( 0.443137, 0.482353, 0.443137, 1 ) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 diff --git a/ui/virtual_keyboard/kb_theme.theme b/ui/virtual_keyboard/kb_theme.theme Binary files differnew file mode 100644 index 0000000..b586a21 --- /dev/null +++ b/ui/virtual_keyboard/kb_theme.theme |