online multiplayer chess game (note server currently down)
Emoji font usage
I hope this works on windows and mac
94 files changed, 438 insertions, 1140 deletions
@@ -35,10 +35,14 @@ func _init() -> void: Globals.grid = self +func _on_game_over(_reason: String, _isok: bool): + stop_input = true + + func _ready() -> void: + Events.connect("game_over", self, "_on_game_over") rect_pivot_offset = rect_size / 2 - if PacketHandler: - PacketHandler.connect("move_data", self, "play_san") + PacketHandler.connect("move_data", self, "play_san") init_board() # create the tile squares init_matrix() # create 2d matrix init_pieces() # create the pieces @@ -153,20 +157,22 @@ func init_label(i: int, position: Vector2, text: String, valign := 0, align := 0 func drawed(reason := "") -> void: - ui.set_status("draw by " + reason, 0) - Events.emit_signal("game_over") + var string = "draw by " + reason + ui.set_status(string, 0) + Events.emit_signal("game_over", string, true) SoundFx.play("Draw") yield(get_tree().create_timer(5), "timeout") - Events.emit_signal("go_back") + Events.emit_signal("go_back", string, true) func win(winner: bool, reason := "") -> void: - ui.set_status("%s won the game by %s" % ["white" if winner else "black", reason], 0) #: black won the game by checkmate - Events.emit_signal("game_over") - Log.info("%s won the game in %s turns!" % ["white" if winner else "black", Globals.fullmove]) + var string = "%s won the game by %s" % ["white" if winner else "black", reason] + ui.set_status(string, 0) #: black won the game by checkmate + Events.emit_signal("game_over", string, true) + Log.info([string, Utils.get_pgn()]) SoundFx.play("Victory") yield(get_tree().create_timer(5), "timeout") - Events.emit_signal("go_back") + Events.emit_signal("go_back", string, true) func check_in_check(prin := false) -> bool: # check if in_check @@ -8,8 +8,9 @@ bend-n/chess is distributed in the hope that it will be useful, but WITHOUT ANY Files|Author(s)|License(s) --- | --- | --- -|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)| +|NotoColorEmoji in assets|[Google](?)|[Apache 2.0](https://github.com/googlefonts/noto-emoji/blob/main/LICENSE)| +|Cascadia Code in assets|Aaron Bell|[SILOpenFontLicense 1.1](https://github.com/microsoft/cascadia-code/blob/main/LICENSE)| +|[Ubuntu](https://fonts.google.com/specimen/Ubuntu) in assets ([nerd font](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Ubuntu))|Daiton Mag|[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+| @@ -4,7 +4,7 @@ extends Node signal turn_over signal just_before_turn_over # called just before turn over signal outoftime # called when the time is up -signal game_over # called when the game is over -signal go_back # called when the game is over, and were ready to go back +signal game_over(reason, isok) # called when the game is over +signal go_back(reason, isok) # called when the game is over, and were ready to go back signal data_recieved # called every time the data comes in signal set_signed_in(signed_in) @@ -9,8 +9,7 @@ onready var panels := [ func _ready() -> void: - if PacketHandler: - PacketHandler.connect("info_recieved", self, "_spectate_info" if Globals.spectating else "_on_info") + PacketHandler.connect("info_recieved", self, "_spectate_info" if Globals.spectating else "_on_info") func set_status(text: String, length := 5) -> void: @@ -22,9 +21,9 @@ func get_board() -> Node: func _spectate_info(info: Dictionary) -> void: - var whitepnl = panels[Globals.WHITE] + var whitepnl = panels[int(Globals.WHITE)] set_panel(whitepnl, info.white.name, info.white.country) - var blackpnl = panels[Globals.BLACK] #black + var blackpnl = panels[int(Globals.BLACK)] set_panel(blackpnl, info.black.name, info.black.country) @@ -6,15 +6,15 @@ [ext_resource path="res://ui/menus/sidebarright/SidebarRight.tscn" type="PackedScene" id=4] [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/ubuntu-bold.ttf" type="DynamicFontData" id=11] +[ext_resource path="res://ui/theme/main.theme" type="Theme" id=10] +[ext_resource path="res://assets/ui/ubuntu/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/ubuntu.ttf" type="DynamicFontData" id=13] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.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/ubuntu-bold-italic.ttf" type="DynamicFontData" id=18] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold-italic.ttf" type="DynamicFontData" id=18] [ext_resource path="res://Board.tscn" type="PackedScene" id=29] [sub_resource type="StyleBoxTexture" id=6] @@ -1,7 +1,7 @@ extends Node -const WHITE = 1 -const BLACK = 0 +const WHITE = true +const BLACK = false var __nosethalfmove := false var pawns := [] # PoolPawnArray diff --git a/PGN/test_pgns.tscn b/PGN/test_pgns.tscn index a064bb7..cd94e8f 100644 --- a/PGN/test_pgns.tscn +++ b/PGN/test_pgns.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] +[ext_resource path="res://ui/theme/main.theme" type="Theme" id=1] [ext_resource path="res://PGN/test_pgns.gd" type="Script" id=2] [node name="tests" type="VBoxContainer"] diff --git a/assets/NotoColorEmoji.ttf b/assets/NotoColorEmoji.ttf new file mode 100644 index 0000000..e4685a0 --- /dev/null +++ b/assets/NotoColorEmoji.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33d225e31cabfbd738168ca5f02ec031f61abc97caab916c63f92124e59544fa +size 450740 diff --git a/assets/emojis/3dots.png b/assets/emojis/3dots.png deleted file mode 100644 index 733bebb..0000000 --- a/assets/emojis/3dots.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c7661ec9462c56fc1bcfb5a7b2dc5ff6283f3457892792230cc3d019e0eab694 -size 187 diff --git a/assets/emojis/3dots.png.import b/assets/emojis/3dots.png.import deleted file mode 100644 index 8e57127..0000000 --- a/assets/emojis/3dots.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/3dots.png-265edc5f23fc0c6d796ec934ecab4e46.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/3dots.png" -dest_files=[ "res://.import/3dots.png-265edc5f23fc0c6d796ec934ecab4e46.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=false -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/emojis/bigsmile.png b/assets/emojis/bigsmile.png deleted file mode 100644 index a8ceed8..0000000 --- a/assets/emojis/bigsmile.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f9817c119db6cb4785e6e1ca071fe5e82035fce02c3362e037d478480dcca0ad -size 196 diff --git a/assets/emojis/bigsmile.png.import b/assets/emojis/bigsmile.png.import deleted file mode 100644 index 43f2255..0000000 --- a/assets/emojis/bigsmile.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/bigsmile.png-37d595856c6fae91b765da3fbb2b16cf.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/bigsmile.png" -dest_files=[ "res://.import/bigsmile.png-37d595856c6fae91b765da3fbb2b16cf.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=false -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/emojis/cold.png b/assets/emojis/cold.png deleted file mode 100644 index 138b664..0000000 --- a/assets/emojis/cold.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:49947911c27b8570498f406314447c49ee2bdc58bac9e743894781d5a923f0b2 -size 210 diff --git a/assets/emojis/cold.png.import b/assets/emojis/cold.png.import deleted file mode 100644 index f26ac40..0000000 --- a/assets/emojis/cold.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/cold.png-0cce578f1713b0c54933093400e00150.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/cold.png" -dest_files=[ "res://.import/cold.png-0cce578f1713b0c54933093400e00150.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=false -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/emojis/cry.png b/assets/emojis/cry.png deleted file mode 100644 index 6481a14..0000000 --- a/assets/emojis/cry.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5834e1249c9424535f4bdcb3bc02abfb8ae31580135f648f4472d7b17eece0eb -size 194 diff --git a/assets/emojis/cry.png.import b/assets/emojis/cry.png.import deleted file mode 100644 index 9dd7c0c..0000000 --- a/assets/emojis/cry.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/cry.png-5eea26eebdb21806dd811b40630ca00a.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/cry.png" -dest_files=[ "res://.import/cry.png-5eea26eebdb21806dd811b40630ca00a.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=false -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/emojis/happy.png b/assets/emojis/happy.png deleted file mode 100644 index 84d02dd..0000000 --- a/assets/emojis/happy.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ee2e81ef530dcdd525d62133d825e1e7da7e8cfee42d2e06dc75f079f1bd3f7 -size 191 diff --git a/assets/emojis/happy.png.import b/assets/emojis/happy.png.import deleted file mode 100644 index 29d31e8..0000000 --- a/assets/emojis/happy.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/happy.png-dbd339b0e9993622ba2629b1b1d62332.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/happy.png" -dest_files=[ "res://.import/happy.png-dbd339b0e9993622ba2629b1b1d62332.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=false -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/emojis/hmm.png b/assets/emojis/hmm.png deleted file mode 100644 index 959d290..0000000 --- a/assets/emojis/hmm.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:459b1ab2008880d2e37aae0fa9fe86366334b0b458f2189fbe1a30156fe45c62 -size 187 diff --git a/assets/emojis/hmm.png.import b/assets/emojis/hmm.png.import deleted file mode 100644 index 3eb716f..0000000 --- a/assets/emojis/hmm.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/hmm.png-60dd2211e19c2fc4717bcd6c242d9de5.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/hmm.png" -dest_files=[ "res://.import/hmm.png-60dd2211e19c2fc4717bcd6c242d9de5.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=false -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/emojis/huh.png b/assets/emojis/huh.png deleted file mode 100644 index ebc9477..0000000 --- a/assets/emojis/huh.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:92958f71129436470d563dc6a26f7ebf41534b88918ae2d3d5a6e976e97cec23 -size 185 diff --git a/assets/emojis/huh.png.import b/assets/emojis/huh.png.import deleted file mode 100644 index 6e28ac1..0000000 --- a/assets/emojis/huh.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/huh.png-67b14d49681c9c51c118c83fbd509ad0.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/huh.png" -dest_files=[ "res://.import/huh.png-67b14d49681c9c51c118c83fbd509ad0.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=false -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/emojis/smile.png b/assets/emojis/smile.png deleted file mode 100644 index c1bbb0c..0000000 --- a/assets/emojis/smile.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2d61ce5475c851b2b7b0d84a3537e417cb1acaf075b3f93965cce5e477af51cb -size 187 diff --git a/assets/emojis/smile.png.import b/assets/emojis/smile.png.import deleted file mode 100644 index 5738765..0000000 --- a/assets/emojis/smile.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/smile.png-27d755ca199321b47ecec446fbc5d653.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/smile.png" -dest_files=[ "res://.import/smile.png-27d755ca199321b47ecec446fbc5d653.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=false -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/emojis/unhappy.png b/assets/emojis/unhappy.png deleted file mode 100644 index 3491a67..0000000 --- a/assets/emojis/unhappy.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aeaf6bce90e7ab8742b9fbb470f9114d2f3f329ed8d7c3935e87fff5fbc0df42 -size 189 diff --git a/assets/emojis/unhappy.png.import b/assets/emojis/unhappy.png.import deleted file mode 100644 index 248e4c5..0000000 --- a/assets/emojis/unhappy.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/unhappy.png-a12fc470e4e81d2afdbd2729a860262b.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/unhappy.png" -dest_files=[ "res://.import/unhappy.png-a12fc470e4e81d2afdbd2729a860262b.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=false -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/emojis/upsidedown_smile.png b/assets/emojis/upsidedown_smile.png deleted file mode 100644 index d9653be..0000000 --- a/assets/emojis/upsidedown_smile.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:47071359f047e3a390ec073b15948218fdf24e62461402d76be162619590d4fa -size 188 diff --git a/assets/emojis/upsidedown_smile.png.import b/assets/emojis/upsidedown_smile.png.import deleted file mode 100644 index 082b818..0000000 --- a/assets/emojis/upsidedown_smile.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/upsidedown_smile.png-c7866fffad0bf377cf32ef6308457098.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/upsidedown_smile.png" -dest_files=[ "res://.import/upsidedown_smile.png-c7866fffad0bf377cf32ef6308457098.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=false -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/emojis/weary.png b/assets/emojis/weary.png deleted file mode 100644 index 7d04786..0000000 --- a/assets/emojis/weary.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ee819f32b56d9ec678a534d18aba356492ab485a2271864997275ba3e8dbf6dc -size 195 diff --git a/assets/emojis/weary.png.import b/assets/emojis/weary.png.import deleted file mode 100644 index 4bb948b..0000000 --- a/assets/emojis/weary.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/weary.png-b27709e5f2dde47a64e943a8c9409597.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/weary.png" -dest_files=[ "res://.import/weary.png-b27709e5f2dde47a64e943a8c9409597.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=false -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/emojis/what.png b/assets/emojis/what.png deleted file mode 100644 index 10a95a2..0000000 --- a/assets/emojis/what.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:37751748c271c93743cbdde075531dc24b9a7bf81236e67cc48952154ddf8d8f -size 190 diff --git a/assets/emojis/what.png.import b/assets/emojis/what.png.import deleted file mode 100644 index b65dd43..0000000 --- a/assets/emojis/what.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/what.png-f4be2dcec75571c42863b35c08940afb.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/what.png" -dest_files=[ "res://.import/what.png-f4be2dcec75571c42863b35c08940afb.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=false -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/emojis/wink.png b/assets/emojis/wink.png deleted file mode 100644 index 018aa2d..0000000 --- a/assets/emojis/wink.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ef0a033ade24b51e0d6608e148d0b711fd6086c49d69ee824a98e7cdf9a3ae5 -size 189 diff --git a/assets/emojis/wink.png.import b/assets/emojis/wink.png.import deleted file mode 100644 index e41aa80..0000000 --- a/assets/emojis/wink.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/wink.png-e680b178ae3f0c2149ab991ba21f425b.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/wink.png" -dest_files=[ "res://.import/wink.png-e680b178ae3f0c2149ab991ba21f425b.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=false -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/emojis/wink_tongue.png b/assets/emojis/wink_tongue.png deleted file mode 100644 index 365cc6c..0000000 --- a/assets/emojis/wink_tongue.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d076f4296dc50cb65df27c11c353644e33bac15ea5eb3f97eb1709d283243087 -size 197 diff --git a/assets/emojis/wink_tongue.png.import b/assets/emojis/wink_tongue.png.import deleted file mode 100644 index a765b1c..0000000 --- a/assets/emojis/wink_tongue.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/wink_tongue.png-aac93965a129476ddae8270e19ba524a.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/wink_tongue.png" -dest_files=[ "res://.import/wink_tongue.png-aac93965a129476ddae8270e19ba524a.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=false -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/emojis/wow.png b/assets/emojis/wow.png deleted file mode 100644 index c618efc..0000000 --- a/assets/emojis/wow.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:32d671ba9dec01f7d49dd8c3540b7c09e0b94b1aadb5168058b2b17e9d577a3d -size 189 diff --git a/assets/emojis/wow.png.import b/assets/emojis/wow.png.import deleted file mode 100644 index c26a143..0000000 --- a/assets/emojis/wow.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/wow.png-764db233f7502e13012a9580d7059723.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/wow.png" -dest_files=[ "res://.import/wow.png-764db233f7502e13012a9580d7059723.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=false -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/emojis/zany.png b/assets/emojis/zany.png deleted file mode 100644 index b281505..0000000 --- a/assets/emojis/zany.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:68225d350d6d05b5ce8b39cd83759477dbdee38f775e932189ef4b8423b995f2 -size 205 diff --git a/assets/emojis/zany.png.import b/assets/emojis/zany.png.import deleted file mode 100644 index f10bde8..0000000 --- a/assets/emojis/zany.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/zany.png-4608f795480fa8c4814644f3e9749b86.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/emojis/zany.png" -dest_files=[ "res://.import/zany.png-4608f795480fa8c4814644f3e9749b86.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=false -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/flags/non-binary.png b/assets/flags/non-binary.png deleted file mode 100644 index f63a01c..0000000 --- a/assets/flags/non-binary.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6acb9fa79eda8bf1dd9019be19916692d2a8425df73806c129c39c6810b56ad1 -size 361 diff --git a/assets/flags/non-binary.png.import b/assets/flags/non-binary.png.import deleted file mode 100644 index 8484757..0000000 --- a/assets/flags/non-binary.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/non-binary.png-72b49165330997f7b165a204533b34c0.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/flags/non-binary.png" -dest_files=[ "res://.import/non-binary.png-72b49165330997f7b165a204533b34c0.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/CascadiaCode.ttf b/assets/ui/CascadiaCode.ttf index e754ad3..fc7474a 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:5b5c79a4c1327d1f0c7952a985f7055fff02e5aca5e209ffabdad47cf7c6143f -size 908392 +oid sha256:7393592c0e0d7f3cdc225c2e03b2aadabab67000bb1a4afe7eca02ff4a782263 +size 648736 diff --git a/assets/ui/button.png b/assets/ui/button.png index aaed7aa..f11648d 100644 --- a/assets/ui/button.png +++ b/assets/ui/button.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd365ce84f3c8e01cd97f5e515f53013e0542c77a6081fa5018b821fa6b26c53 -size 479 +oid sha256:0569376b6a16884cac86d28ef79579471f6148fdec2164959ddeb8c05e2adc51 +size 301 diff --git a/assets/ui/buttonhover.png b/assets/ui/buttonhover.png index 0cbe2d5..bc4247e 100644 --- a/assets/ui/buttonhover.png +++ b/assets/ui/buttonhover.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ecab17713907f4259599b9427c27c848db9fdb4fd26f27ac7c05af848e23eff7 -size 420 +oid sha256:5968d8cff6f00154c2ddbe1a006d423537064a4a7921888df310ad957a3e57ac +size 246 diff --git a/assets/ui/checkedbox.png b/assets/ui/checkedbox.png index 0ebee87..c1da256 100644 --- a/assets/ui/checkedbox.png +++ b/assets/ui/checkedbox.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14fe7fe2dc395f0a992dc4beaaf89158487a50ca5ee4ad7894f915dcfd466aab -size 491 +oid sha256:a3d0a5c114adec8a6bec333f5e91622c477e4b9339f94dd129501667814758d4 +size 330 diff --git a/assets/ui/ubuntu-bold-italic.ttf b/assets/ui/ubuntu-bold-italic.ttf deleted file mode 100644 index 062dc92..0000000 --- a/assets/ui/ubuntu-bold-italic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 1f2c523..0000000 --- a/assets/ui/ubuntu-bold.ttf +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 2a5e434..0000000 --- a/assets/ui/ubuntu-italic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e5852e303e5812d7a804ec5159d4d7bbb222d5492db07fd1c8df7bf20b192aa -size 1079496 diff --git a/assets/ui/ubuntu/ubuntu-bold-italic.ttf b/assets/ui/ubuntu/ubuntu-bold-italic.ttf new file mode 100644 index 0000000..db9afd1 --- /dev/null +++ b/assets/ui/ubuntu/ubuntu-bold-italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09f71d154f90e8073c37daf7f74bd219733713c68e527e44ba4a348a1bc3842f +size 282700 diff --git a/assets/ui/ubuntu/ubuntu-bold.ttf b/assets/ui/ubuntu/ubuntu-bold.ttf new file mode 100644 index 0000000..44a3ea3 --- /dev/null +++ b/assets/ui/ubuntu/ubuntu-bold.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f83793a3c75680a14fc163f7d8c466f5e8693de92b187c07c9ee6307ad9d382b +size 269584 diff --git a/assets/ui/ubuntu/ubuntu-italic.ttf b/assets/ui/ubuntu/ubuntu-italic.ttf new file mode 100644 index 0000000..d2696da --- /dev/null +++ b/assets/ui/ubuntu/ubuntu-italic.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:053426c27bd66cc911700c560ef7ba2ee8422d1e7b5cd967213b1feb726a6d89 +size 326292 diff --git a/assets/ui/ubuntu.ttf b/assets/ui/ubuntu/ubuntu-normal-nerd.ttf index 6f8e012..6f8e012 100644 --- a/assets/ui/ubuntu.ttf +++ b/assets/ui/ubuntu/ubuntu-normal-nerd.ttf diff --git a/networking/Network.gd b/networking/Network.gd index fdba7a9..aa3f13d 100644 --- a/networking/Network.gd +++ b/networking/Network.gd @@ -1,15 +1,13 @@ extends Node class_name Network -var ws := WebSocketClient.new() +const url := "wss://gd-chess-server.herokuapp.com/" +var ws := WebSocketClient.new() var connected := false -signal game_over(problem, isok) signal connection_established -const url := "wss://gd-chess-server.herokuapp.com/" - func _ready(): SaveLoad.save_string("user://network_log.log", "") # overwrite last log @@ -38,14 +36,12 @@ func _connection_closed(_was_clean_closed) -> void: connected = false Log.net("DISCONNECTED FROM %s" % url) Log.err("Connection closed") - emit_signal("game_over", "Connection closed", false) func _connection_error() -> void: connected = false Log.err("Connection error") Log.net("DISCONNECTED FROM %s" % url) - emit_signal("game_over", "Connection error", false) func _data_recieved(): @@ -58,11 +54,13 @@ func _process(_delta: float) -> void: ws.poll() -func send_packet(variant, header: String) -> void: +func send_packet(variant, header: String) -> int: var pckt = {header = header, data = variant} if ws.get_peer(1).is_connected_to_host(): ws.get_peer(1).put_var(pckt) Log.net("SENT: %s" % pckt) + return OK else: Log.err("not connected to server: packet %s not sent" % pckt) Log.net("FAILED SEND: %s" % pckt) + return ERR_CONNECTION_ERROR diff --git a/networking/PacketHandler.gd b/networking/PacketHandler.gd index 01f410b..ea69b50 100644 --- a/networking/PacketHandler.gd +++ b/networking/PacketHandler.gd @@ -45,12 +45,11 @@ func return() -> void: # return to the void if hosting: leaving = true stopgame("") # stop hosting - lobby.set_status("", true) set_hosting(false) - lobby.set_buttons(true) func _ready() -> void: + Events.connect("go_back", self, "go_back") if Utils.internet and get_tree().get_root().has_node("StartMenu"): yield(get_tree().create_timer(.1), "timeout") open() # open connection @@ -99,7 +98,7 @@ func _data_recieved() -> void: Globals.grid.play_pgn(text, true) # call deferred wont work since grid obj may be null HEADERS.stopgame: if !leaving: # dont emit the signal if its a stophost thing (HACK) - emit_signal("game_over", text, true) + go_back(text, true) leaving = false HEADERS.signal: var signal: Dictionary = text @@ -116,14 +115,23 @@ func _data_recieved() -> void: func _connection_established(protocol) -> void: ._connection_established(protocol) - lobby.set_status("", true) - lobby.set_buttons(true) + + +func _connection_closed(_was_clean_closed) -> void: + ._connection_closed(_was_clean_closed) + go_back("Connection closed, please reload the game", false) + + +func _connection_error() -> void: + ._connection_error() + go_back("Connection error, please reload the game", false) func join_result(accepted) -> void: if handle_result(accepted, "Joined!"): yield(get_tree(), "idle_frame") - Globals.grid.flip_board() # joine should be black; flip the board + if Globals.team == Globals.BLACK: + Globals.grid.flip_board() func host_result(accepted) -> void: @@ -140,15 +148,14 @@ func handle_result(accepted, resultstring: String) -> bool: return false -func _handle_game_over(error := "game over", isok := true) -> void: - stopgame(error) +func go_back(error: String, isok: bool) -> void: Globals.reset_vars() if has_node("/root/Game"): - get_node("/root/Game").queue_free() + $"/root/Game".queue_free() lobby.set_status(error, isok) lobby.toggle(true) + lobby.focus() lobby.set_buttons(true) - emit_signal("game_over") func _start_game() -> void: diff --git a/project.godot b/project.godot index ddda91d..5ac0b22 100644 --- a/project.godot +++ b/project.godot @@ -322,7 +322,7 @@ enabled=PoolStringArray( ) [gui] -theme/custom="res://ui/theme/main.tres" +theme/custom="res://ui/theme/main.theme" [importer_defaults] diff --git a/ui/barbutton/BarButton.theme b/ui/barbutton/BarButton.theme Binary files differindex 51a77b4..326ad03 100644 --- a/ui/barbutton/BarButton.theme +++ b/ui/barbutton/BarButton.theme diff --git a/ui/barbutton/big-ubuntu-bold.tres b/ui/barbutton/big-ubuntu-bold.tres index 69bd4ce..9e5894d 100644 --- a/ui/barbutton/big-ubuntu-bold.tres +++ b/ui/barbutton/big-ubuntu-bold.tres @@ -1,7 +1,11 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="DynamicFont" load_steps=4 format=2] -[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold.ttf" type="DynamicFontData" id=3] [resource] size = 85 -font_data = ExtResource( 1 ) +font_data = ExtResource( 3 ) +fallback/0 = ExtResource( 2 ) +fallback/1 = ExtResource( 1 ) diff --git a/ui/chat/Chat.gd b/ui/chat/Chat.gd index 9cb41d7..5cc2d97 100644 --- a/ui/chat/Chat.gd +++ b/ui/chat/Chat.gd @@ -22,28 +22,87 @@ var emoji_replace_regex := compile(":[^:]{1,30}:") const piece_emoji_path = "res://assets/pieces/cburnett/" const emoji_path = "res://assets/emojis/" const emojis := { - [":cold:"]: emoji_path + "cold.png", - [":bigsmile:"]: emoji_path + "bigsmile.png", - [":cry:", ":sad:"]: emoji_path + "cry.png", - [":happy:"]: emoji_path + "happy.png", - [":hmm:"]: emoji_path + "hmm.png", - [":huh:"]: emoji_path + "huh.png", - [":smile:"]: emoji_path + "smile.png", - [":unhappy:"]: emoji_path + "unhappy.png", - [":upsidedown_smile:"]: emoji_path + "upsidedown_smile.png", - [":weary:"]: emoji_path + "weary.png", - [":what:"]: emoji_path + "what.png", - [":wink_tongue:"]: emoji_path + "wink_tongue.png", - [":wink:"]: emoji_path + "wink.png", - [":wow:"]: emoji_path + "wow.png", - [":zany:"]: emoji_path + "zany.png", - [":...:"]: emoji_path + "3dots.png", - [":R:", ":rook:"]: piece_emoji_path + "wR.png", - [":N:", ":knight:"]: piece_emoji_path + "wN.png", - [":B:", ":bishop:"]: piece_emoji_path + "wB.png", - [":Q:", ":queen:"]: piece_emoji_path + "wQ.png", - [":K:", ":king:"]: piece_emoji_path + "wK.png", - [":P:", ":pawn:"]: piece_emoji_path + "wP.png", + ":grinning:": "😀", + ":smiley:": "😃", + ":smile:": "😄", + ":grin:": "😁", + [":laughing:", ":satisfied:"]: "😆", + ":sweat_smile:": "😅", + ":joy:": "😂", + ":rofl:": "🤣", + ":blush:": "😊", + ":innocent:": "😇", + [":slight_smile:", ":slightly_smiling:"]: "🙂", + [":upside_down:", ":upside_down:"]: "🙃", + ":wink:": "😉", + ":relieved:": "😌", + ":tear_smile:": "🥲", + ":heart_eyes:": "😍", + ":hearty:": "🥰", + ":stuck_out_tongue_winking_eye:": "😜", + ":yum:": "😋", + ":stuck_out_tongue_closed_eyes:": "😝", + ":stuck_out_tongue:": "😛", + ":raised_eyebrow:": "🤨", + ":sunglasses:": "😎", + ":nerd:": "🤓", + ":star_struck:": "🤩", + ":partying:": "🥳", + ":smirk:": "😏", + ":unamused:": "😒", + ":disappointed:": "😞", + ":pensive:": "😔", + ":worried:": "😟", + ":confused:": "😕", + ":frown:": "🙁", + ":persevere:": "😣", + ":confounded:": "😖", + ":tired:": "😫", + ":weary:": "😩", + ":cry:": "😢", + ":sob:": "😭", + ":triumph:": "😤", + ":angry:": "😠", + ":rage:": "😡", + ":no_mouth:": "😶", + ":sleeping:": "😴", + ":cold:": "🥶", + ":neutral:": "😐", + ":expressionless:": "😑", + ":hushed:": "😯", + ":frowning:": "😦", + ":anguished:": "😧", + ":open_mouth:": "😮", + ":astonished:": "😲", + ":dizzy:": "😵", + ":scream:": "😱", + ":fearful:": "😨", + ":cold_sweat:": "😰", + ":disappointed_relieved:": "😥", + ":sweat:": "😓", + ":sleepy:": "😪", + ":devil:": "😈", + ":face_with_rolling_eyes:": "🙄", + ":lying:": "🤥", + ":grimacing:": "😬", + ":zipped_mouth:": "🤐", + ":nauseated:": "🤢", + ":sneezing:": "🤧", + ":mask:": "😷", + ":face_with_thermometer:": "🤒", + ":face_with_head_bandage:": "🤕", + ":smiley_cat:": "😺", + ":smile_cat:": "😸", + ":joy_cat:": "😹", + ":heart_eyes_cat:": "😻", + ":turtle:": "🐢", + ":cat:": "🐈", + ":smirk_cat:": "😼", + ":scream_cat:": "🙀", + ":cat_joy:": "😹", + ":cat_grin:": "😸", + ":crying_cat:": "😿", + ":pouting_cat:": "😾", } var expanded_emojis = {} @@ -61,10 +120,13 @@ func _exit_tree(): Globals.chat = null -func setup_triggers(): +func expand_emojis(): for trigger_list in emojis: - for trigger in trigger_list: - expanded_emojis[trigger] = emojis[trigger_list] + if typeof(trigger_list) == TYPE_ARRAY: + for trigger in trigger_list: + expanded_emojis[trigger] = emojis[trigger_list] + else: + expanded_emojis[trigger_list] = emojis[trigger_list] func setup_text_input(): @@ -74,7 +136,7 @@ func setup_text_input(): 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") + Log.info("Mobile keyboard setup") else: kb.free() dsk_input.show() @@ -88,7 +150,7 @@ func open_kb(): func _ready(): - setup_triggers() + expand_emojis() setup_text_input() PacketHandler.connect("chat", self, "add_label_with") server("Welcome!") # say hello @@ -140,5 +202,5 @@ func emoji2bb(input: String) -> String: for i in emoji_replace_regex.search_all(input): var emoji = i.strings[0] if emoji in expanded_emojis: - input = input.replace(emoji, "[img=30]%s[/img]" % expanded_emojis[emoji]) + input = input.replace(emoji, "%s" % expanded_emojis[emoji]) return input diff --git a/ui/chat/TextEditor.tscn b/ui/chat/TextEditor.tscn index 5d8854a..8b61bab 100644 --- a/ui/chat/TextEditor.tscn +++ b/ui/chat/TextEditor.tscn @@ -1,12 +1,13 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=13 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/emoji_button_font.tres" type="DynamicFont" 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] +[ext_resource path="res://ui/theme/richtextlabel/tiny.tres" type="DynamicFont" id=8] [sub_resource type="StyleBoxFlat" id=2] bg_color = Color( 0.25098, 0.266667, 0.294118, 1 ) @@ -14,7 +15,8 @@ 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=5] [sub_resource type="StyleBoxEmpty" id=4] @@ -58,6 +60,7 @@ margin_right = 910.0 margin_bottom = 35.0 rect_min_size = Vector2( 200, 20 ) size_flags_vertical = 4 +custom_fonts/font = ExtResource( 8 ) context_menu_enabled = false virtual_keyboard_enabled = false smooth_scrolling = true @@ -73,28 +76,31 @@ margin_bottom = 50.0 size_flags_horizontal = 8 size_flags_vertical = 0 -[node name="EmojiButton" type="TextureButton" parent="TextBar/EmojiButtonHoldler"] +[node name="EmojiButton" type="Button" 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 +custom_fonts/font = ExtResource( 5 ) +custom_styles/hover = SubResource( 5 ) +custom_styles/pressed = SubResource( 5 ) +custom_styles/focus = SubResource( 5 ) +custom_styles/disabled = SubResource( 5 ) +custom_styles/normal = SubResource( 5 ) +text = "😿" +flat = true script = ExtResource( 2 ) -offset = Vector2( -180, -180 ) +offset = Vector2( -350, -350 ) [node name="Popup" type="PopupPanel" parent="TextBar/EmojiButtonHoldler/EmojiButton"] -margin_right = 40.0 -margin_bottom = 40.0 +visible = true 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 +custom_constants/vseparation = 0 +custom_constants/hseparation = 0 script = ExtResource( 3 ) [connection signal="send" from="TextBar/TextEditHolder/text" to="." method="_on_text_send"] diff --git a/ui/chat/chat_theme.tres b/ui/chat/chat_theme.tres index eb4cc98..5b507a1 100644 --- a/ui/chat/chat_theme.tres +++ b/ui/chat/chat_theme.tres @@ -1,25 +1,25 @@ -[gd_resource type="Theme" load_steps=29 format=2] +[gd_resource type="Theme" load_steps=30 format=2] -[ext_resource path="res://assets/ui/ubuntu-bold-italic.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://ui/theme/richtextlabel/tiny-bold.tres" type="DynamicFont" 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/ubuntu-bold.ttf" type="DynamicFontData" id=7] +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=6] +[ext_resource path="res://ui/theme/richtextlabel/tiny-italic.tres" type="DynamicFont" 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/barbutton/default_pressed.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] +[ext_resource path="res://ui/theme/richtextlabel/tiny.tres" type="DynamicFont" id=12] +[ext_resource path="res://ui/barbutton/default_highlight.tres" type="StyleBox" id=13] +[ext_resource path="res://ui/barbutton/default.tres" type="StyleBox" id=14] +[ext_resource path="res://ui/theme/richtextlabel/tiny-bold-italic.tres" type="DynamicFont" id=15] +[ext_resource path="res://ui/theme/richtextlabel/tiny-Cascadia-Code.tres" type="DynamicFont" id=16] -[sub_resource type="StyleBoxTexture" id=6] -texture = ExtResource( 3 ) -region_rect = Rect2( 0, 0, 84, 84 ) -margin_left = 28.0 -margin_right = 28.0 -margin_top = 28.0 -margin_bottom = 28.0 -modulate_color = Color( 0.772549, 0.772549, 0.772549, 0.54902 ) +[sub_resource type="DynamicFont" id=28] +size = 40 +font_data = ExtResource( 6 ) + +[sub_resource type="StyleBoxEmpty" id=11] [sub_resource type="StyleBoxEmpty" id=7] @@ -40,22 +40,6 @@ corner_detail = 20 expand_margin_left = 10.0 expand_margin_right = 10.0 -[sub_resource type="DynamicFont" id=18] -size = 15 -font_data = ExtResource( 7 ) - -[sub_resource type="DynamicFont" id=19] -size = 15 -font_data = ExtResource( 1 ) - -[sub_resource type="DynamicFont" id=14] -size = 15 -font_data = ExtResource( 2 ) - -[sub_resource type="DynamicFont" id=20] -size = 15 -font_data = ExtResource( 12 ) - [sub_resource type="StyleBoxFlat" id=10] content_margin_left = 30.0 content_margin_right = 30.0 @@ -79,7 +63,7 @@ border_width_right = 3 border_width_bottom = 1 border_color = Color( 0, 0, 0, 0.392157 ) -[sub_resource type="StyleBoxFlat" id=11] +[sub_resource type="StyleBoxFlat" id=23] content_margin_left = 10.0 content_margin_right = 10.0 bg_color = Color( 0.188235, 0.188235, 0.188235, 1 ) @@ -93,7 +77,7 @@ border_color = Color( 0, 0, 0, 0.392157 ) [sub_resource type="StyleBoxEmpty" id=5] -[sub_resource type="StyleBoxFlat" id=13] +[sub_resource type="StyleBoxFlat" id=24] content_margin_left = 10.0 content_margin_right = 10.0 content_margin_bottom = 10.0 @@ -107,30 +91,27 @@ corner_radius_bottom_left = 30 corner_detail = 15 expand_margin_top = 65.0 -[sub_resource type="DynamicFont" id=22] +[sub_resource type="DynamicFontData" id=26] +font_path = "res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" + +[sub_resource type="DynamicFont" id=27] size = 20 -font_data = ExtResource( 12 ) +font_data = SubResource( 26 ) +fallback/0 = ExtResource( 2 ) [resource] -default_font = SubResource( 22 ) +default_font = SubResource( 27 ) Button/colors/font_color = Color( 1, 1, 1, 1 ) -Button/colors/font_color_disabled = Color( 1, 1, 1, 0.305882 ) +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( 0, 0, 0, 1 ) +Button/colors/font_color_hover = Color( 1, 1, 1, 1 ) Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) -Button/styles/disabled = SubResource( 6 ) -Button/styles/focus = ExtResource( 8 ) -Button/styles/hover = ExtResource( 9 ) -Button/styles/normal = ExtResource( 8 ) -Button/styles/pressed = ExtResource( 8 ) -CheckBox/icons/checked = ExtResource( 5 ) -CheckBox/icons/checked_disabled = null -CheckBox/icons/radio_checked = null -CheckBox/icons/radio_checked_disabled = null -CheckBox/icons/radio_unchecked = null -CheckBox/icons/radio_unchecked_disabled = null -CheckBox/icons/unchecked = ExtResource( 3 ) -CheckBox/icons/unchecked_disabled = null +Button/fonts/font = SubResource( 28 ) +Button/styles/disabled = ExtResource( 14 ) +Button/styles/focus = SubResource( 11 ) +Button/styles/hover = ExtResource( 13 ) +Button/styles/normal = ExtResource( 14 ) +Button/styles/pressed = ExtResource( 9 ) ColorPicker/icons/color_sample = ExtResource( 4 ) ColorPicker/icons/overbright_indicator = ExtResource( 4 ) ColorPicker/icons/preset_bg = ExtResource( 4 ) @@ -170,17 +151,17 @@ PopupMenu/styles/hover = SubResource( 3 ) PopupMenu/styles/panel = ExtResource( 11 ) PopupPanel/styles/panel = ExtResource( 10 ) RichTextLabel/colors/default_color = Color( 1, 1, 1, 1 ) -RichTextLabel/fonts/bold_font = SubResource( 18 ) -RichTextLabel/fonts/bold_italics_font = SubResource( 19 ) -RichTextLabel/fonts/italics_font = SubResource( 19 ) -RichTextLabel/fonts/mono_font = SubResource( 14 ) -RichTextLabel/fonts/normal_font = SubResource( 20 ) +RichTextLabel/fonts/bold_font = ExtResource( 1 ) +RichTextLabel/fonts/bold_italics_font = ExtResource( 15 ) +RichTextLabel/fonts/italics_font = ExtResource( 7 ) +RichTextLabel/fonts/mono_font = ExtResource( 16 ) +RichTextLabel/fonts/normal_font = ExtResource( 12 ) SpinBox/icons/updown = ExtResource( 4 ) TabContainer/colors/font_color_bg = Color( 0.709804, 0.709804, 0.709804, 0.72549 ) TabContainer/colors/font_color_fg = Color( 1, 1, 1, 1 ) TabContainer/styles/panel = SubResource( 10 ) TabContainer/styles/tab_bg = SubResource( 12 ) -TabContainer/styles/tab_fg = SubResource( 11 ) +TabContainer/styles/tab_fg = SubResource( 23 ) TextEdit/styles/normal = SubResource( 21 ) VBoxContainer/constants/separation = 15 VScrollBar/styles/scroll = SubResource( 5 ) @@ -190,4 +171,4 @@ WindowDialog/constants/close_v_ofs = 0 WindowDialog/constants/title_height = 60 WindowDialog/icons/close = ExtResource( 4 ) WindowDialog/icons/close_highlight = ExtResource( 4 ) -WindowDialog/styles/panel = SubResource( 13 ) +WindowDialog/styles/panel = SubResource( 24 ) diff --git a/ui/chat/emoji_button_font.tres b/ui/chat/emoji_button_font.tres new file mode 100644 index 0000000..fc2bb55 --- /dev/null +++ b/ui/chat/emoji_button_font.tres @@ -0,0 +1,7 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=2] + +[resource] +size = 50 +font_data = ExtResource( 2 ) diff --git a/ui/chat/emojibutton.gd b/ui/chat/emojibutton.gd index b63e418..5303da4 100644 --- a/ui/chat/emojibutton.gd +++ b/ui/chat/emojibutton.gd @@ -1,12 +1,12 @@ -extends TextureButton +extends Button export(float) var scale_normal := 0.8 export(float) var scale_hover := 1.0 -var cur_scale := 0.8 +var cur_scale := scale_normal export(float) var saturation_normal := 0.0 export(float) var saturation_hover := 1.0 -var cur_saturation := 0.0 +var cur_saturation := saturation_normal export(float) var weight := 0.35 @@ -20,15 +20,17 @@ signal emoji_selected(emoji) onready var emojimenu: GridMenu = $Popup/EmojiMenu onready var popup: PopupPanel = $Popup +var font: DynamicFont = load("res://ui/chat/emoji_button_font.tres") +onready var font_size = font.size func change_icon(): if emojis: - texture_normal = load(emojis.values()[randi() % len(emojis)]) + text = emojis.values()[randi() % len(emojis)] func _ready(): - material.set_shader_param("scale", scale_normal) + scale() set_process(false) @@ -36,14 +38,16 @@ func _setup(_emojis: Dictionary): emojis = _emojis change_icon() for key in emojis.keys(): - emojimenu.add_item(load(emojis[key]), arr2tooltip(key), Vector2(30, 30)) + emojimenu.add_text_item(emojis[key], arr2tooltip(key), Vector2(40, 40)) -func arr2tooltip(arr: Array) -> String: - var string = "" - for i in arr: - string += i + " " - return string +func arr2tooltip(arr) -> String: + if typeof(arr) == TYPE_ARRAY: + var string = "" + for i in arr: + string += i + " " + return string + return arr func _focused(q: bool): @@ -63,10 +67,14 @@ func _process(_delta: float) -> void: if is_equal_approx(cur_scale, scale_normal): set_process(false) - material.set_shader_param("scale", cur_scale) + scale() material.set_shader_param("saturation", cur_saturation) +func scale(): + font.size = cur_scale * font_size + + func _pressed() -> void: popup.popup() emojimenu.open() @@ -75,5 +83,8 @@ func _pressed() -> void: func _on_EmojiMenu_pressed(index: int): - emit_signal("emoji_selected", emojis.keys()[index][0]) + emit_signal( + "emoji_selected", + emojis.keys()[index] if typeof(emojis.keys()[index]) == TYPE_STRING else emojis.keys()[index][0] + ) popup.hide() diff --git a/ui/chat/grayscale.shader b/ui/chat/grayscale.shader index 3188c10..61f3970 100644 --- a/ui/chat/grayscale.shader +++ b/ui/chat/grayscale.shader @@ -1,10 +1,8 @@ shader_type canvas_item; uniform float saturation: hint_range(0.0, 1.0) = 0.0; -uniform float scale: hint_range(0.0, 1.0) = 1.0; -const float pivot = 0.5; void fragment() { - vec4 tex_color = texture(TEXTURE, (UV - pivot) * (2.0 - scale) + pivot); + vec4 tex_color = texture(TEXTURE, (UV)); COLOR.rgb = mix(vec3(dot(tex_color.rgb, vec3(0.299, 0.587, 0.114))), tex_color.rgb, saturation); // magic numbers COLOR.a = tex_color.a; }
\ No newline at end of file diff --git a/ui/colorpicker/ColorPicker.tscn b/ui/colorpicker/ColorPicker.tscn index 77350c9..e499dc5 100644 --- a/ui/colorpicker/ColorPicker.tscn +++ b/ui/colorpicker/ColorPicker.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://ui/colorpicker/ColorPicker.gd" type="Script" id=1] [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://assets/ui/ubuntu/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] diff --git a/ui/colorpicker/ColorPickerButton.tscn b/ui/colorpicker/ColorPickerButton.tscn index ee56af1..a170f06 100644 --- a/ui/colorpicker/ColorPickerButton.tscn +++ b/ui/colorpicker/ColorPickerButton.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] +[ext_resource path="res://ui/theme/main.theme" type="Theme" id=1] [ext_resource path="res://ui/colorpicker/ColorPickerButton.gd" type="Script" id=2] [ext_resource path="res://ui/colorpicker/ColorPicker.tscn" type="PackedScene" id=3] diff --git a/ui/confirm/Confirm.tscn b/ui/confirm/Confirm.tscn index 338394b..16df721 100644 --- a/ui/confirm/Confirm.tscn +++ b/ui/confirm/Confirm.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] +[ext_resource path="res://ui/theme/main.theme" type="Theme" id=1] [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://ui/ubuntu-bold-small.tres" type="DynamicFont" id=6] diff --git a/ui/gridmenu/GridMenu.gd b/ui/gridmenu/GridMenu.gd index 34bd846..815fc7b 100644 --- a/ui/gridmenu/GridMenu.gd +++ b/ui/gridmenu/GridMenu.gd @@ -10,8 +10,8 @@ func open(): show() -func add_item(icon: Texture, tooltip: String, size: Vector2) -> void: - var tex := texture_button.instance() +func add_icon_item(icon: Texture, tooltip: String, size: Vector2) -> BarTextureButton: + var tex: BarTextureButton = texture_button.instance() tex.connect("pressed", self, "_pressed", [get_child_count()]) tex.expand = true tex.texture_normal = icon @@ -19,15 +19,20 @@ func add_item(icon: Texture, tooltip: String, size: Vector2) -> void: tex.rect_min_size = size tex.hint_tooltip = tooltip tex.stretch_mode = tex.STRETCH_KEEP_ASPECT_CENTERED - tex.set_anchors_preset(PRESET_WIDE) - var back: ColorRect = tex.get_node("Background") - back.margin_left = -5 - back.margin_right = 5 - back.margin_top = -5 - back.margin_bottom = 5 add_child(tex) + return tex + + +func add_text_item(text: String, tooltip: String, size: Vector2) -> Button: + var b := Button.new() + b.hint_tooltip = tooltip + b.name = tooltip + b.rect_min_size = size + b.text = text + b.connect("pressed", self, "_pressed", [get_child_count()]) + add_child(b) + return b func _pressed(index: int): - get_children()[index]._focused(false) emit_signal("pressed", index) diff --git a/ui/gridmenu/GridMenuButton.gd b/ui/gridmenu/GridMenuButton.gd index 91ca486..aebc47c 100644 --- a/ui/gridmenu/GridMenuButton.gd +++ b/ui/gridmenu/GridMenuButton.gd @@ -8,13 +8,20 @@ signal selected(index) export(Vector2) var offset = Vector2(50, -50) +onready var txt = text + var selected := 0 setget set_selected var items := [] -func add_item(icon, tooltip := "", size := Vector2(40, 30)): +func add_text_item(text: String, tooltip := "", size := Vector2(40, 30)) -> Button: + items.append(text) + return gridmenu.add_text_item(text, tooltip, size) + + +func add_icon_item(icon: Texture, tooltip := "", size := Vector2(40, 30)) -> BarTextureButton: items.append(icon) - gridmenu.add_item(icon, tooltip, size) + return gridmenu.add_icon_item(icon, tooltip, size) func _on_GridMenu_pressed(index: int): @@ -25,7 +32,10 @@ func _on_GridMenu_pressed(index: int): func set_selected(index: int): selected = index - icon = items[index] + if typeof(items[index]) == TYPE_OBJECT: + icon = items[index] + else: + text = items[index] + txt func _pressed() -> void: diff --git a/ui/gridmenu/GridMenuButton.tscn b/ui/gridmenu/GridMenuButton.tscn index 0676df5..07f5f9d 100644 --- a/ui/gridmenu/GridMenuButton.tscn +++ b/ui/gridmenu/GridMenuButton.tscn @@ -1,12 +1,12 @@ [gd_scene load_steps=35 format=2] [ext_resource path="res://ui/gridmenu/GridMenu.gd" type="Script" id=1] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=2] +[ext_resource path="res://ui/theme/main.theme" type="Theme" id=2] [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/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/ubuntu/ubuntu-bold-italic.ttf" type="DynamicFontData" id=6] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.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] @@ -215,9 +215,8 @@ WindowDialog/styles/panel = SubResource( 13 ) [node name="GridMenuButton" type="Button"] margin_right = 12.0 margin_bottom = 20.0 - +focus_mode = 0 theme = ExtResource( 2 ) - text = "grid menu button" expand_icon = true script = ExtResource( 3 ) diff --git a/ui/menus/Lobby.gd b/ui/menus/Lobby.gd index a1f2549..1250bc5 100644 --- a/ui/menus/Lobby.gd +++ b/ui/menus/Lobby.gd @@ -14,11 +14,21 @@ func toggle(onoff: bool) -> void: func _ready() -> void: PacketHandler.lobby = self PacketHandler.connect("hosting", find_node("stophost"), "set_visible") + PacketHandler.connect("connection_established", self, "reset") if !Utils.internet: set_status("no internet", false) set_buttons(false) +func reset(): + set_status("", true) + set_buttons(true) + + +func focus(): + get_parent().current_tab = get_parent().get_children().find(self) + + func set_status(text: String, isok: bool) -> void: # Simple way to show status. if isok: status_ok.set_text(text) @@ -74,10 +84,6 @@ func _on_spectate_pressed(): set_status("Invalid address", false) -func _on_tabs_tab_changed(tab: int): - if self != get_parent().get_children()[tab]: - PacketHandler.return() - - func _on_stophost_pressed() -> void: PacketHandler.return() + reset() diff --git a/ui/menus/Lobby.tscn b/ui/menus/Lobby.tscn index 25a3d3e..d798bb2 100644 --- a/ui/menus/Lobby.tscn +++ b/ui/menus/Lobby.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] +[ext_resource path="res://ui/theme/main.theme" 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/ubuntu-bold-small.tres" type="DynamicFont" id=4] @@ -17,24 +17,20 @@ margin_top = 290.0 margin_right = 1011.0 margin_bottom = 509.0 -[node name="HBox" type="HBoxContainer" parent="Center"] +[node name="VBox" type="VBoxContainer" parent="Center"] margin_right = 600.0 margin_bottom = 219.0 -[node name="VBox" type="VBoxContainer" parent="Center/HBox"] -margin_right = 600.0 -margin_bottom = 219.0 - -[node name="stophost" type="Button" parent="Center/HBox/VBox"] - focus_mode = 0 +[node name="stophost" type="Button" parent="Center/VBox"] visible = false -margin_left = 7.0 -margin_right = 343.0 -margin_bottom = 106.0 +margin_left = 152.0 +margin_right = 448.0 +margin_bottom = 102.0 +focus_mode = 0 size_flags_horizontal = 4 text = "stop hosting" -[node name="Address" type="LineEdit" parent="Center/HBox/VBox"] +[node name="Address" type="LineEdit" parent="Center/VBox"] margin_right = 600.0 margin_bottom = 102.0 rect_min_size = Vector2( 600, 0 ) @@ -47,48 +43,42 @@ placeholder_text = "game_code" caret_blink = true caret_blink_speed = 0.5 -[node name="buttons" type="HBoxContainer" parent="Center/HBox/VBox"] +[node name="buttons" type="HBoxContainer" parent="Center/VBox"] margin_top = 117.0 margin_right = 600.0 margin_bottom = 219.0 -[node name="SpectateButton" type="Button" parent="Center/HBox/VBox/buttons"] - focus_mode = 0 +[node name="SpectateButton" type="Button" parent="Center/VBox/buttons"] margin_right = 223.0 margin_bottom = 102.0 - +focus_mode = 0 size_flags_horizontal = 3 size_flags_vertical = 3 disabled = true - text = "spectate" -[node name="JoinButton" type="Button" parent="Center/HBox/VBox/buttons"] - focus_mode = 0 +[node name="JoinButton" type="Button" parent="Center/VBox/buttons"] 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 - text = "join" -[node name="HostButton" type="Button" parent="Center/HBox/VBox/buttons"] - focus_mode = 0 +[node name="HostButton" type="Button" parent="Center/VBox/buttons"] margin_left = 426.0 margin_right = 600.0 margin_bottom = 102.0 hint_tooltip = "host the game" - +focus_mode = 0 size_flags_horizontal = 7 disabled = true - text = "host" -[node name="StatusOK" type="Label" parent="Center/HBox/VBox"] +[node name="StatusOK" type="Label" parent="Center/VBox"] visible = false margin_top = 242.0 margin_right = 350.0 @@ -96,7 +86,7 @@ margin_bottom = 292.0 custom_colors/font_color = Color( 1, 1, 1, 1 ) autowrap = true -[node name="StatusFail" type="Label" parent="Center/HBox/VBox"] +[node name="StatusFail" type="Label" parent="Center/VBox"] visible = false margin_top = 242.0 margin_right = 350.0 @@ -104,7 +94,7 @@ margin_bottom = 292.0 custom_colors/font_color = Color( 0.698039, 0.415686, 0.415686, 1 ) autowrap = true -[node name="Disclaimer" type="Label" parent="Center/HBox/VBox"] +[node name="Disclaimer" type="Label" parent="Center/VBox"] visible = false margin_top = 242.0 margin_right = 350.0 @@ -118,15 +108,15 @@ text = " Currently logged out. valign = 1 script = ExtResource( 3 ) -[node name="ColorRect" type="ColorRect" parent="Center/HBox/VBox/Disclaimer"] +[node name="ColorRect" type="ColorRect" parent="Center/VBox/Disclaimer"] show_behind_parent = true anchor_right = 1.0 anchor_bottom = 1.0 margin_right = -46.0 color = Color( 0.588235, 0.560784, 0.309804, 1 ) -[connection signal="pressed" from="Center/HBox/VBox/stophost" to="." method="_on_stophost_pressed"] -[connection signal="text_entered" from="Center/HBox/VBox/Address" to="." method="_on_Address_text_entered"] -[connection signal="pressed" from="Center/HBox/VBox/buttons/SpectateButton" to="." method="_on_spectate_pressed"] -[connection signal="pressed" from="Center/HBox/VBox/buttons/JoinButton" to="." method="_on_join_pressed"] -[connection signal="pressed" from="Center/HBox/VBox/buttons/HostButton" to="." method="_on_HostButton_pressed"] +[connection signal="pressed" from="Center/VBox/stophost" to="." method="_on_stophost_pressed"] +[connection signal="text_entered" from="Center/VBox/Address" to="." method="_on_Address_text_entered"] +[connection signal="pressed" from="Center/VBox/buttons/SpectateButton" to="." method="_on_spectate_pressed"] +[connection signal="pressed" from="Center/VBox/buttons/JoinButton" to="." method="_on_join_pressed"] +[connection signal="pressed" from="Center/VBox/buttons/HostButton" to="." method="_on_HostButton_pressed"] diff --git a/ui/menus/StartMenu.gd b/ui/menus/StartMenu.gd index a3156d2..63bbd63 100644 --- a/ui/menus/StartMenu.gd +++ b/ui/menus/StartMenu.gd @@ -2,8 +2,8 @@ extends Control func _ready() -> void: - if OS.has_feature("HTML5"): - find_node("quit").queue_free() + if OS.has_feature("web"): + find_node("").queue_free() func _on_quit_pressed() -> void: diff --git a/ui/menus/StartMenu.tscn b/ui/menus/StartMenu.tscn index 55c6a32..f720f72 100644 --- a/ui/menus/StartMenu.tscn +++ b/ui/menus/StartMenu.tscn @@ -2,8 +2,8 @@ [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/ubuntu-bold.ttf" type="DynamicFontData" id=3] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=4] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold.ttf" type="DynamicFontData" id=3] +[ext_resource path="res://ui/theme/main.theme" 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] [ext_resource path="res://ui/menus/StartMenu.gd" type="Script" id=7] @@ -34,7 +34,7 @@ size_flags_vertical = 0 drag_to_rearrange_enabled = true use_hidden_tabs_for_min_size = true -[node name="" parent="tabs" instance=ExtResource( 5 )] +[node name="🇿🇦" parent="tabs" instance=ExtResource( 5 )] margin_left = 30.0 margin_top = 86.0 margin_right = -30.0 @@ -78,5 +78,4 @@ text = "exit" [node name="tests" type="Node2D" parent="."] script = ExtResource( 6 ) -[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 93168d3..29ce00e 100644 --- a/ui/menus/account/Account.gd +++ b/ui/menus/account/Account.gd @@ -30,7 +30,7 @@ func _ready(): PacketHandler.connect("connection_established", self, "attempt_autologin") flags.append_array(Utils.walk_dir("res://assets/flags", false, ["rainbow"])) for i in flags: # add the items - flagchoice.add_item(load("res://assets/flags/%s.png" % i), i.replace("_", " ")) + flagchoice.add_icon_item(load("res://assets/flags/%s.png" % i), i.replace("_", " ")) flagchoice.selected = 0 diff --git a/ui/menus/account/Account.tscn b/ui/menus/account/Account.tscn index 0a693ff..a51d609 100644 --- a/ui/menus/account/Account.tscn +++ b/ui/menus/account/Account.tscn @@ -1,11 +1,10 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=8 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/theme/main.theme" type="Theme" id=6] [ext_resource path="res://ui/animations/thehalo.tres" type="Material" id=7] [ext_resource path="res://ui/menus/account/Account.gd" type="Script" id=8] @@ -26,13 +25,11 @@ size_flags_horizontal = 3 script = ExtResource( 4 ) [node name="LogOut" type="Button" parent="H"] - focus_mode = 0 visible = false margin_right = 96.0 margin_bottom = 102.0 hint_tooltip = "log out" - - +focus_mode = 0 text = "" [node name="choose" type="TabContainer" parent="."] @@ -67,20 +64,17 @@ margin_bottom = 332.0 rect_min_size = Vector2( 230, 0 ) size_flags_horizontal = 4 text = "flag" -icon = ExtResource( 3 ) offset = Vector2( 50, -400 ) [node name="signupbutton" type="Button" parent="choose/signup"] - 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 - text = "sign up " [node name="signin" type="VBoxContainer" parent="choose"] @@ -100,16 +94,14 @@ margin_right = 1008.0 margin_bottom = 225.0 [node name="signinbutton" type="Button" parent="choose/signin"] - 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 - text = "sign in " [node name="LoadingAnimation" type="TextureRect" parent="."] diff --git a/ui/menus/account/usernamepass.tscn b/ui/menus/account/usernamepass.tscn index 78aebb5..9ec2469 100644 --- a/ui/menus/account/usernamepass.tscn +++ b/ui/menus/account/usernamepass.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=9 format=2] -[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold.ttf" type="DynamicFontData" id=1] [ext_resource path="res://ui/menus/account/Secret.gd" type="Script" id=2] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=5] +[ext_resource path="res://ui/theme/main.theme" 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] diff --git a/ui/menus/settings/Settings.gd b/ui/menus/settings/Settings.gd index fc91565..ef58eb2 100644 --- a/ui/menus/settings/Settings.gd +++ b/ui/menus/settings/Settings.gd @@ -41,7 +41,7 @@ func _ready() -> void: if OS.has_feature("HTML5"): borderlessbutton.queue_free() for i in piece_sets: # add the items - piece_set_button.add_item(load("res://assets/pieces/" + i + "/wP.png"), i, Vector2(50, 50)) + piece_set_button.add_icon_item(load("res://assets/pieces/" + i + "/wP.png"), i, Vector2(50, 50)) piece_set_button.selected = Array(piece_sets).find(settings.piece_set) update_vars() update_button_visuals() diff --git a/ui/menus/settings/Settings.tscn b/ui/menus/settings/Settings.tscn index ca1b83f..706d1d5 100644 --- a/ui/menus/settings/Settings.tscn +++ b/ui/menus/settings/Settings.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] -[ext_resource path="res://ui/theme/main.tres" type="Theme" id=1] +[ext_resource path="res://ui/theme/main.theme" 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] +[ext_resource path="res://assets/pieces/california/wP.png" type="Texture" id=7] [node name="Settings" type="CenterContainer"] anchor_right = 1.0 @@ -25,7 +26,7 @@ alignment = 1 [node name="TabContainer" type="TabContainer" parent="H"] margin_right = 417.0 -margin_bottom = 452.0 +margin_bottom = 470.0 size_flags_vertical = 0 custom_constants/hseparation = 20 drag_to_rearrange_enabled = true @@ -56,12 +57,14 @@ size_flags_horizontal = 4 text = "boardcolor2" [node name="PieceSet" parent="H/TabContainer/" instance=ExtResource( 6 )] -margin_left = 64.0 +margin_left = 28.0 margin_top = 234.0 -margin_right = 292.0 -margin_bottom = 336.0 +margin_right = 328.0 +margin_bottom = 354.0 +rect_min_size = Vector2( 300, 120 ) size_flags_horizontal = 4 text = "piece set" +icon = ExtResource( 7 ) [node name="" type="VBoxContainer" parent="H/TabContainer"] visible = false diff --git a/ui/menus/sidebarright/SidebarRight.tscn b/ui/menus/sidebarright/SidebarRight.tscn index 63e5ddb..ad25a5c 100644 --- a/ui/menus/sidebarright/SidebarRight.tscn +++ b/ui/menus/sidebarright/SidebarRight.tscn @@ -1,15 +1,15 @@ -[gd_scene load_steps=21 format=2] +[gd_scene load_steps=19 format=2] [ext_resource path="res://ui/menus/sidebarright/drawbutton.gd" type="Script" id=1] [ext_resource path="res://ui/menus/sidebarright/resignbutton.gd" type="Script" id=2] [ext_resource path="res://ui/Status.gd" type="Script" id=3] -[ext_resource path="res://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/ubuntu-bold.tres" type="DynamicFont" id=9] [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://ui/theme/main.theme" type="Theme" id=14] [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] @@ -18,10 +18,6 @@ [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] @@ -36,18 +32,13 @@ corner_radius_bottom_right = 20 corner_radius_bottom_left = 20 corner_detail = 15 -[sub_resource type="DynamicFont" id=1] -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/fonts/font = ExtResource( 9 ) Button/styles/disabled = ExtResource( 7 ) Button/styles/focus = SubResource( 11 ) Button/styles/hover = ExtResource( 5 ) @@ -107,6 +98,7 @@ hint_tooltip = "flip the board" focus_mode = 0 mouse_default_cursor_shape = 2 size_flags_horizontal = 3 +custom_fonts/font = ExtResource( 9 ) text = "" script = ExtResource( 19 ) diff --git a/ui/menus/sidebarright/TimerLabels.gd b/ui/menus/sidebarright/TimerLabels.gd index 96feee8..5cd1ed5 100644 --- a/ui/menus/sidebarright/TimerLabels.gd +++ b/ui/menus/sidebarright/TimerLabels.gd @@ -36,7 +36,7 @@ func _ready() -> void: Events.connect("game_over", self, "_on_game_over") -func _on_game_over() -> void: +func _on_game_over(_ar: String, _arg: bool) -> void: stop = true diff --git a/ui/menus/sidebarright/UserPanel.tscn b/ui/menus/sidebarright/UserPanel.tscn index 9bd422a..a3cbbad 100644 --- a/ui/menus/sidebarright/UserPanel.tscn +++ b/ui/menus/sidebarright/UserPanel.tscn @@ -2,7 +2,7 @@ [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/theme/main.theme" type="Theme" id=3] [ext_resource path="res://ui/menus/sidebarright/UserPanel.gd" type="Script" id=4] [node name="UserPanel" type="PanelContainer"] diff --git a/ui/menus/sidebarright/confirmbutton.gd b/ui/menus/sidebarright/confirmbutton.gd index 62d8a60..3d596eb 100644 --- a/ui/menus/sidebarright/confirmbutton.gd +++ b/ui/menus/sidebarright/confirmbutton.gd @@ -7,9 +7,12 @@ export(String) var confirm_text = "" func _ready() -> void: - PacketHandler.connect("game_over", self, "set_disabled", [true]) - if PacketHandler: - PacketHandler.connect("signal_recieved", self, "_signal_recieved") + Events.connect("game_over", self, "disable") + PacketHandler.connect("signal_recieved", self, "_signal_recieved") + + +func disable(_a: String, _ar: bool) -> void: + disabled = true func _signal_recieved(_signal: Dictionary) -> void: diff --git a/ui/menus/sidebarright/undobutton.gd b/ui/menus/sidebarright/undobutton.gd index 1ad96ce..20244c4 100644 --- a/ui/menus/sidebarright/undobutton.gd +++ b/ui/menus/sidebarright/undobutton.gd @@ -7,8 +7,7 @@ const undo_declined_message = "undo declined" func _ready() -> void: - if PacketHandler: - PacketHandler.connect("undo", self, "undo_signal_recieved") + PacketHandler.connect("undo", self, "undo_signal_recieved") func _pressed() -> void: @@ -52,7 +51,7 @@ func _confirmed(what: bool) -> void: func undo(): - var numberex = SanParse.compile("([0-9]+)\\.", false) + var numberex = SanParse.compile("(^[0-9]+)\\.", false) var which_move = 0 var mov = Utils.moves_list[-1] var result = numberex.search(mov) diff --git a/ui/theme/main.theme b/ui/theme/main.theme Binary files differnew file mode 100644 index 0000000..6c5984f --- /dev/null +++ b/ui/theme/main.theme diff --git a/ui/theme/main.tres b/ui/theme/main.tres deleted file mode 100644 index bf927ea..0000000 --- a/ui/theme/main.tres +++ /dev/null @@ -1,200 +0,0 @@ -[gd_resource type="Theme" load_steps=31 format=2] - -[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] -[ext_resource path="res://ui/theme/buttonhover.tres" type="StyleBox" id=5] -[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://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/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 ) -region_rect = Rect2( 0, 0, 84, 84 ) -margin_left = 28.0 -margin_right = 28.0 -margin_top = 28.0 -margin_bottom = 28.0 -modulate_color = Color( 0.772549, 0.772549, 0.772549, 0.54902 ) - -[sub_resource type="StyleBoxEmpty" id=7] - -[sub_resource type="StyleBoxEmpty" id=8] - -[sub_resource type="StyleBoxEmpty" id=9] - -[sub_resource type="StyleBoxEmpty" id=4] - -[sub_resource type="StyleBoxFlat" id=3] -bg_color = Color( 0.0784314, 0.0784314, 0.0784314, 1 ) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -border_color = Color( 1, 1, 1, 1 ) -corner_detail = 20 -expand_margin_left = 10.0 -expand_margin_right = 10.0 - -[sub_resource type="DynamicFont" id=19] -size = 20 -font_data = ExtResource( 14 ) - -[sub_resource type="DynamicFont" id=22] -size = 20 -font_data = ExtResource( 12 ) - -[sub_resource type="DynamicFont" id=14] -size = 20 -font_data = ExtResource( 10 ) - -[sub_resource type="DynamicFont" id=20] -size = 20 -font_data = ExtResource( 11 ) - -[sub_resource type="StyleBoxFlat" id=10] -content_margin_left = 30.0 -content_margin_right = 30.0 -content_margin_top = 30.0 -content_margin_bottom = 30.0 -bg_color = Color( 0, 0, 0, 0.313726 ) -border_blend = true -corner_radius_top_left = 50 -corner_radius_top_right = 50 -corner_radius_bottom_right = 30 -corner_radius_bottom_left = 30 -corner_detail = 15 - -[sub_resource type="StyleBoxFlat" id=12] -content_margin_left = 10.0 -content_margin_right = 10.0 -bg_color = Color( 0, 0, 0, 0.313726 ) -border_width_left = 3 -border_width_top = 3 -border_width_right = 3 -border_width_bottom = 1 -border_color = Color( 0, 0, 0, 0.392157 ) - -[sub_resource type="StyleBoxFlat" id=11] -content_margin_left = 10.0 -content_margin_right = 10.0 -bg_color = Color( 0.188235, 0.188235, 0.188235, 1 ) -border_width_left = 3 -border_width_top = 3 -border_width_right = 3 -border_width_bottom = 1 -border_color = Color( 0, 0, 0, 0.392157 ) - -[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="StyleBoxEmpty" id=5] - -[sub_resource type="StyleBoxFlat" id=13] -content_margin_left = 10.0 -content_margin_right = 10.0 -content_margin_bottom = 10.0 -bg_color = Color( 0, 0, 0, 0.588235 ) -border_width_top = 65 -border_color = Color( 0.180392, 0.180392, 0.180392, 1 ) -corner_radius_top_left = 30 -corner_radius_top_right = 30 -corner_radius_bottom_right = 30 -corner_radius_bottom_left = 30 -corner_detail = 15 -expand_margin_top = 65.0 - -[resource] -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 ) -Button/colors/font_color_hover = Color( 0, 0, 0, 1 ) -Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) -Button/styles/disabled = SubResource( 6 ) -Button/styles/focus = ExtResource( 2 ) -Button/styles/hover = ExtResource( 5 ) -Button/styles/normal = ExtResource( 2 ) -Button/styles/pressed = ExtResource( 2 ) -CheckBox/icons/checked = ExtResource( 6 ) -CheckBox/icons/checked_disabled = null -CheckBox/icons/radio_checked = null -CheckBox/icons/radio_checked_disabled = null -CheckBox/icons/radio_unchecked = null -CheckBox/icons/radio_unchecked_disabled = null -CheckBox/icons/unchecked = ExtResource( 4 ) -CheckBox/icons/unchecked_disabled = null -ColorPicker/icons/color_sample = ExtResource( 3 ) -ColorPicker/icons/overbright_indicator = ExtResource( 3 ) -ColorPicker/icons/preset_bg = ExtResource( 3 ) -ColorPicker/icons/screen_picker = ExtResource( 3 ) -HBoxContainer/constants/separation = 15 -HSlider/styles/grabber_area = SubResource( 7 ) -HSlider/styles/grabber_area_highlight = SubResource( 8 ) -HSlider/styles/slider = SubResource( 9 ) -ItemList/colors/font_color = Color( 1, 1, 1, 1 ) -ItemList/colors/font_color_selected = Color( 0.905882, 0.905882, 0.905882, 1 ) -ItemList/styles/bg = SubResource( 4 ) -ItemList/styles/bg_focus = ExtResource( 7 ) -LineEdit/colors/cursor_color = Color( 1, 1, 1, 1 ) -LineEdit/colors/font_color = Color( 1, 1, 1, 1 ) -LineEdit/colors/font_color_uneditable = Color( 1, 1, 1, 0.67451 ) -LineEdit/styles/focus = ExtResource( 2 ) -LineEdit/styles/normal = ExtResource( 2 ) -LineEdit/styles/read_only = ExtResource( 2 ) -OptionButton/colors/font_color = Color( 1, 1, 1, 1 ) -OptionButton/colors/font_color_focus = Color( 1, 1, 1, 1 ) -OptionButton/colors/font_color_hover = Color( 0, 0, 0, 1 ) -OptionButton/colors/font_color_pressed = Color( 1, 1, 1, 1 ) -OptionButton/icons/arrow = ExtResource( 3 ) -Panel/styles/panel = ExtResource( 13 ) -PanelContainer/styles/panel = ExtResource( 13 ) -PopupMenu/colors/font_color = Color( 1, 1, 1, 1 ) -PopupMenu/colors/font_color_accel = Color( 1, 1, 1, 0.8 ) -PopupMenu/colors/font_color_hover = Color( 1, 1, 1, 1 ) -PopupMenu/colors/font_color_separator = Color( 0.262745, 0.262745, 0.262745, 1 ) -PopupMenu/icons/radio_checked = ExtResource( 3 ) -PopupMenu/icons/radio_unchecked = ExtResource( 3 ) -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( 1 ) -RichTextLabel/fonts/bold_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 ) -TabContainer/colors/font_color_bg = Color( 0.709804, 0.709804, 0.709804, 0.72549 ) -TabContainer/colors/font_color_fg = Color( 1, 1, 1, 1 ) -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( 1 ) -TooltipPanel/styles/panel = SubResource( 21 ) -VBoxContainer/constants/separation = 15 -VScrollBar/styles/scroll = SubResource( 5 ) -WindowDialog/colors/title_color = Color( 1, 1, 1, 1 ) -WindowDialog/constants/close_h_ofs = 0 -WindowDialog/constants/close_v_ofs = 0 -WindowDialog/constants/title_height = 60 -WindowDialog/icons/close = ExtResource( 3 ) -WindowDialog/icons/close_highlight = ExtResource( 3 ) -WindowDialog/styles/panel = SubResource( 13 ) diff --git a/ui/theme/richtextlabel/tiny-Cascadia-Code.tres b/ui/theme/richtextlabel/tiny-Cascadia-Code.tres new file mode 100644 index 0000000..e2d9b0e --- /dev/null +++ b/ui/theme/richtextlabel/tiny-Cascadia-Code.tres @@ -0,0 +1,11 @@ +[gd_resource type="DynamicFont" load_steps=4 format=2] + +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://assets/ui/CascadiaCode.ttf" type="DynamicFontData" id=3] + +[resource] +size = 20 +font_data = ExtResource( 3 ) +fallback/0 = ExtResource( 1 ) +fallback/1 = ExtResource( 2 ) diff --git a/ui/theme/richtextlabel/tiny-bold-italic.tres b/ui/theme/richtextlabel/tiny-bold-italic.tres new file mode 100644 index 0000000..0284b53 --- /dev/null +++ b/ui/theme/richtextlabel/tiny-bold-italic.tres @@ -0,0 +1,11 @@ +[gd_resource type="DynamicFont" load_steps=4 format=2] + +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold-italic.ttf" type="DynamicFontData" id=3] + +[resource] +size = 20 +font_data = ExtResource( 3 ) +fallback/0 = ExtResource( 1 ) +fallback/1 = ExtResource( 2 ) diff --git a/ui/theme/richtextlabel/tiny-bold.tres b/ui/theme/richtextlabel/tiny-bold.tres new file mode 100644 index 0000000..303efda --- /dev/null +++ b/ui/theme/richtextlabel/tiny-bold.tres @@ -0,0 +1,11 @@ +[gd_resource type="DynamicFont" load_steps=4 format=2] + +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=3] + +[resource] +size = 20 +font_data = ExtResource( 1 ) +fallback/0 = ExtResource( 2 ) +fallback/1 = ExtResource( 3 ) diff --git a/ui/theme/richtextlabel/tiny-italic.tres b/ui/theme/richtextlabel/tiny-italic.tres new file mode 100644 index 0000000..81da42d --- /dev/null +++ b/ui/theme/richtextlabel/tiny-italic.tres @@ -0,0 +1,11 @@ +[gd_resource type="DynamicFont" load_steps=4 format=2] + +[ext_resource path="res://assets/ui/ubuntu/ubuntu-italic.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=3] + +[resource] +size = 20 +font_data = ExtResource( 1 ) +fallback/0 = ExtResource( 2 ) +fallback/1 = ExtResource( 3 ) diff --git a/ui/theme/richtextlabel/tiny.tres b/ui/theme/richtextlabel/tiny.tres new file mode 100644 index 0000000..b8209a3 --- /dev/null +++ b/ui/theme/richtextlabel/tiny.tres @@ -0,0 +1,9 @@ +[gd_resource type="DynamicFont" load_steps=3 format=2] + +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=2] + +[resource] +size = 20 +font_data = ExtResource( 2 ) +fallback/0 = ExtResource( 1 ) diff --git a/ui/ubuntu-bold-small.tres b/ui/ubuntu-bold-small.tres index 8466e0c..303efda 100644 --- a/ui/ubuntu-bold-small.tres +++ b/ui/ubuntu-bold-small.tres @@ -1,7 +1,11 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="DynamicFont" load_steps=4 format=2] -[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=3] [resource] size = 20 font_data = ExtResource( 1 ) +fallback/0 = ExtResource( 2 ) +fallback/1 = ExtResource( 3 ) diff --git a/ui/ubuntu-bold.tres b/ui/ubuntu-bold.tres index b904cd7..e47a781 100644 --- a/ui/ubuntu-bold.tres +++ b/ui/ubuntu-bold.tres @@ -1,7 +1,11 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="DynamicFont" load_steps=4 format=2] -[ext_resource path="res://assets/ui/ubuntu-bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold.ttf" type="DynamicFontData" id=3] [resource] size = 40 -font_data = ExtResource( 1 ) +font_data = ExtResource( 3 ) +fallback/0 = ExtResource( 2 ) +fallback/1 = ExtResource( 1 ) diff --git a/ui/ubuntu.tres b/ui/ubuntu.tres index 45c68a0..1463533 100644 --- a/ui/ubuntu.tres +++ b/ui/ubuntu.tres @@ -1,7 +1,9 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="DynamicFont" load_steps=3 format=2] -[ext_resource path="res://assets/ui/ubuntu.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/NotoColorEmoji.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=2] [resource] size = 40 -font_data = ExtResource( 1 ) +font_data = ExtResource( 2 ) +fallback/0 = ExtResource( 1 ) |