online multiplayer chess game (note server currently down)
add chat button & fix lfs limits
bendn 2022-07-27
parent 81a9fee · commit 96f7943
-rw-r--r--.github/workflows/export.yml73
-rw-r--r--export_presets.cfg27
-rw-r--r--ui/chat/Chat.tscn4
-rw-r--r--ui/chat/TextEditor.gd16
-rw-r--r--ui/chat/TextEditor.tscn47
-rw-r--r--ui/chat/textedit.gd6
6 files changed, 88 insertions, 85 deletions
diff --git a/.github/workflows/export.yml b/.github/workflows/export.yml
index f71fb96..e188043 100644
--- a/.github/workflows/export.yml
+++ b/.github/workflows/export.yml
@@ -18,57 +18,58 @@ env:
NAME: ${{ github.event.repository.name }}
jobs:
- export-windows:
- name: Windows Export
- runs-on: ubuntu-20.04
+ export:
+ runs-on: ubuntu-latest
container:
image: ghcr.io/bend-n/godot-2d:3.5.rc
+ name: ${{ matrix.name }}
+ strategy:
+ matrix:
+ include:
+ - name: Windows export
+ platform: windows
+
+ - name: Linux export
+ platform: linux
+
+ - name: Mac export
+ platform: mac
+
+ - name: Web export
+ platform: web
+
+ - name: Android export
+ platform: android
+
steps:
- - name: Build
+ - name: Ckeckout(bypass lfs)
+ run: echo "::group::Checkout";wget -nv --no-check-certificate 'https://docs.google.com/uc?export=download&id=10AMw1fV0plROQ93koJCi4T5Mgew4en4f' -O main.zip;unzip -z main.zip | tail -n1 | head -c 7 > version;unzip main.zip;rm main.zip;echo "::endgroup::"
+
+ - name: Build (Windows)
+ if: matrix.platform == 'windows'
uses: bend-n/godot-actions/.github/actions/export-windows@main
- export-linux:
- name: Linux Export
- runs-on: ubuntu-20.04
- container:
- image: ghcr.io/bend-n/godot-2d:3.5.rc
- steps:
- - name: Build
+ - name: Build (Linux)
+ if: matrix.platform == 'linux'
uses: bend-n/godot-actions/.github/actions/export-linux@main
- export-web:
- name: Web Export
- runs-on: ubuntu-20.04
- container:
- image: ghcr.io/bend-n/godot-2d:3.5.rc
- steps:
- - name: Build
- uses: bend-n/godot-actions/.github/actions/export-web@main
-
- export-mac:
- name: Mac Export
- runs-on: ubuntu-20.04
- container:
- image: ghcr.io/bend-n/godot-2d:3.5.rc
- steps:
- - name: Build
+ - name: Build (Mac)
+ if: matrix.platform == 'mac'
uses: bend-n/godot-actions/.github/actions/export-mac@main
- export-android:
- name: Android Export
- runs-on: ubuntu-20.04
- container:
- image: ghcr.io/bend-n/godot-2d:3.5.rc
- steps:
- - name: Build
+ - name: Build (Web)
+ if: matrix.platform == 'web'
+ uses: bend-n/godot-actions/.github/actions/export-web@main
+
+ - name: Build (Android)
+ if: matrix.platform == 'android'
uses: bend-n/godot-actions/.github/actions/export-android@main
with:
android-keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
android-password: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
push-itch:
- needs:
- [export-windows, export-linux, export-web, export-mac, export-android]
+ needs: [export]
name: Push to itch.io
runs-on: ubuntu-20.04
steps:
diff --git a/export_presets.cfg b/export_presets.cfg
index 847a219..d4f4f39 100644
--- a/export_presets.cfg
+++ b/export_presets.cfg
@@ -81,7 +81,7 @@ custom_features=""
export_filter="all_resources"
include_filter="COPYING.md, LICENSE, version"
exclude_filter="assets/pieces/alpha/*, assets/pieces/governor/*, assets/pieces/horsey/*, assets/pieces/libra/*, assets/pieces/maestro/*, assets/pieces/pixel/*"
-export_path=""
+export_path="exports/folder/index.html"
script_export_mode=1
script_encryption_key=""
@@ -380,28 +380,3 @@ permissions/write_sms=false
permissions/write_social_stream=false
permissions/write_sync_settings=false
permissions/write_user_dictionary=false
-
-[preset.5]
-
-name="Linux/X11"
-platform="Linux/X11"
-runnable=false
-custom_features=""
-export_filter="all_resources"
-include_filter=""
-exclude_filter=""
-export_path=""
-script_export_mode=1
-script_encryption_key=""
-
-[preset.5.options]
-
-custom_template/debug=""
-custom_template/release=""
-binary_format/64_bits=true
-binary_format/embed_pck=false
-texture_format/bptc=false
-texture_format/s3tc=true
-texture_format/etc=false
-texture_format/etc2=false
-texture_format/no_bptc_fallbacks=true
diff --git a/ui/chat/Chat.tscn b/ui/chat/Chat.tscn
index ce924d9..1488cda 100644
--- a/ui/chat/Chat.tscn
+++ b/ui/chat/Chat.tscn
@@ -23,11 +23,11 @@ custom_constants/separation = 0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1422.0
-margin_bottom = 777.0
+margin_bottom = 780.0
mouse_filter = 2
[node name="Input" parent="v" instance=ExtResource( 5 )]
-margin_top = 777.0
+margin_top = 780.0
margin_right = 1422.0
margin_bottom = 800.0
diff --git a/ui/chat/TextEditor.gd b/ui/chat/TextEditor.gd
index aa879b3..a3e75eb 100644
--- a/ui/chat/TextEditor.gd
+++ b/ui/chat/TextEditor.gd
@@ -15,15 +15,19 @@ func get_text() -> String:
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)
+onready var textedit: TextEdit = $"%text"
+onready var placeholder := $"%placeholder"
+onready var sendbutton := $"%SendButton"
func _text_changed() -> void:
placeholder.visible = len(textedit.text) == 0
+ sendbutton.visible = len(textedit.text) != 0
-func _on_text_send(msg: String) -> void:
- emit_signal("done", msg)
+func send(msg := textedit.text) -> void:
+ msg = msg.strip_edges()
+ if msg:
+ textedit.text = ""
+ textedit.emit_signal("text_changed")
+ emit_signal("done", msg)
diff --git a/ui/chat/TextEditor.tscn b/ui/chat/TextEditor.tscn
index 199ba2e..b611ddd 100644
--- a/ui/chat/TextEditor.tscn
+++ b/ui/chat/TextEditor.tscn
@@ -1,6 +1,10 @@
-[gd_scene load_steps=6 format=2]
+[gd_scene load_steps=11 format=2]
[ext_resource path="res://ui/chat/textedit.gd" type="Script" id=1]
+[ext_resource path="res://ui/barbutton/BarButton.theme" type="Theme" id=2]
+[ext_resource path="res://assets/ui/ubuntu/ubuntu-normal-nerd.ttf" type="DynamicFontData" id=3]
+[ext_resource path="res://assets/ui/migu.ttf" type="DynamicFontData" id=4]
+[ext_resource path="res://assets/ui/ubuntu/ubuntu-bold.ttf" type="DynamicFontData" 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]
@@ -8,16 +12,24 @@
[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 0.1, 0.0948, 0.087, 0.784314 )
+[sub_resource type="DynamicFont" id=3]
+size = 40
+font_data = ExtResource( 5 )
+fallback/0 = ExtResource( 3 )
+fallback/1 = ExtResource( 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("TextEditHolder/text")
-placeholder_path = NodePath("TextEditHolder/placeholder")
-[node name="TextEditHolder" type="MarginContainer" parent="."]
+[node name="H" type="HBoxContainer" parent="."]
+margin_right = 965.0
+margin_bottom = 50.0
+
+[node name="TextEditHolder" type="MarginContainer" parent="H"]
margin_right = 965.0
margin_bottom = 50.0
size_flags_horizontal = 3
@@ -25,17 +37,19 @@ size_flags_vertical = 3
custom_constants/margin_right = 5
custom_constants/margin_left = 5
-[node name="placeholder" type="Label" parent="TextEditHolder"]
+[node name="placeholder" type="Label" parent="H/TextEditHolder"]
+unique_name_in_owner = true
margin_left = 5.0
-margin_top = 13.0
-margin_right = 141.0
-margin_bottom = 36.0
+margin_top = 24.0
+margin_right = 20.0
+margin_bottom = 26.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="TextEditHolder"]
+[node name="text" type="TextEdit" parent="H/TextEditHolder"]
+unique_name_in_owner = true
margin_left = 5.0
margin_top = 15.0
margin_right = 960.0
@@ -51,5 +65,16 @@ caret_blink_speed = 0.45
script = ExtResource( 1 )
max_lines = 4
-[connection signal="send" from="TextEditHolder/text" to="." method="_on_text_send"]
-[connection signal="text_changed" from="TextEditHolder/text" to="." method="_text_changed"]
+[node name="SendButton" type="Button" parent="H"]
+unique_name_in_owner = true
+visible = false
+margin_left = 962.0
+margin_right = 965.0
+margin_bottom = 50.0
+theme = ExtResource( 2 )
+custom_fonts/font = SubResource( 3 )
+text = "  "
+
+[connection signal="send" from="H/TextEditHolder/text" to="." method="send"]
+[connection signal="text_changed" from="H/TextEditHolder/text" to="." method="_text_changed"]
+[connection signal="pressed" from="H/SendButton" to="." method="send"]
diff --git a/ui/chat/textedit.gd b/ui/chat/textedit.gd
index e34a6f4..32abf00 100644
--- a/ui/chat/textedit.gd
+++ b/ui/chat/textedit.gd
@@ -1,6 +1,6 @@
extends ExpandableTextEdit
-signal send(msg)
+signal send()
func _input(event: InputEvent) -> void:
@@ -13,8 +13,6 @@ func _input(event: InputEvent) -> void:
if has_focus():
text = text.strip_edges()
if text:
- emit_signal("send", text)
- text = ""
- emit_signal("text_changed")
+ emit_signal("send")
else:
grab_focus()