From dd1a1cd6206695b0b716ae0854fa7bbc7c3b4aa1 Mon Sep 17 00:00:00 2001 From: ws3917 Date: Tue, 13 May 2025 19:40:53 +0800 Subject: [PATCH] 12345 --- Animations/Portraits.tres | 24 +++--- Main.tscn | 42 ++++----- Scripts-new/Audio.cs.uid | 1 + Scripts-new/BattleStats.cs.uid | 1 + Scripts-new/Common.cs.uid | 1 + Scripts-new/Coroutine.cs.uid | 1 + Scripts-new/EventPart.cs.uid | 1 + Scripts-new/IBullet.cs.uid | 1 + Scripts-new/IEvent.cs.uid | 1 + Scripts-new/IPuzzle.cs.uid | 1 + Scripts-new/Interacteable.cs.uid | 1 + Scripts-new/Texts.cs.uid | 1 + Scripts/UI/Joystick.cs | 59 ------------- Scripts/UI/Joystick.cs.uid | 1 - Scripts/UI/TouchControls.cs | 110 ------------------------ Scripts/UI/TouchControls.cs.uid | 1 - Sprites/Menus/Mobile/buttonR.png | Bin 0 -> 460 bytes Sprites/Menus/Mobile/buttonR.png.import | 34 ++++++++ default_bus_layout.tres | 2 +- 19 files changed, 78 insertions(+), 205 deletions(-) create mode 100644 Scripts-new/Audio.cs.uid create mode 100644 Scripts-new/BattleStats.cs.uid create mode 100644 Scripts-new/Common.cs.uid create mode 100644 Scripts-new/Coroutine.cs.uid create mode 100644 Scripts-new/EventPart.cs.uid create mode 100644 Scripts-new/IBullet.cs.uid create mode 100644 Scripts-new/IEvent.cs.uid create mode 100644 Scripts-new/IPuzzle.cs.uid create mode 100644 Scripts-new/Interacteable.cs.uid create mode 100644 Scripts-new/Texts.cs.uid delete mode 100644 Scripts/UI/Joystick.cs delete mode 100644 Scripts/UI/Joystick.cs.uid delete mode 100644 Scripts/UI/TouchControls.cs delete mode 100644 Scripts/UI/TouchControls.cs.uid create mode 100644 Sprites/Menus/Mobile/buttonR.png create mode 100644 Sprites/Menus/Mobile/buttonR.png.import diff --git a/Animations/Portraits.tres b/Animations/Portraits.tres index bc2e57a..6beff29 100644 --- a/Animations/Portraits.tres +++ b/Animations/Portraits.tres @@ -1,11 +1,11 @@ -[gd_resource type="SpriteFrames" load_steps=204 format=3] +[gd_resource type="SpriteFrames" load_steps=204 format=3 uid="uid://gk3ccjsd3rvd"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/feisty.png" id="1"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/axis.png" id="2"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/bearportrait.png" id="3"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/warden.png" id="4"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/ketsukanes.png" id="5"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/dalv.png" id="6"] +[ext_resource type="Texture2D" uid="uid://q84plpxvvgjv" path="res://Sprites/Portraits/feisty.png" id="1"] +[ext_resource type="Texture2D" uid="uid://duqy7swwclrta" path="res://Sprites/Portraits/axis.png" id="2"] +[ext_resource type="Texture2D" uid="uid://uxufc2dcn02p" path="res://Sprites/Portraits/bearportrait.png" id="3"] +[ext_resource type="Texture2D" uid="uid://0bomc1ksqeqg" path="res://Sprites/Portraits/warden.png" id="4"] +[ext_resource type="Texture2D" uid="uid://de12lpwml8eyq" path="res://Sprites/Portraits/ketsukanes.png" id="5"] +[ext_resource type="Texture2D" uid="uid://b7uirrx8namg5" path="res://Sprites/Portraits/dalv.png" id="6"] [ext_resource type="Texture2D" path="res://Sprites/Props/Fish/Bass.tres" id="7"] [ext_resource type="Texture2D" path="res://Sprites/Props/Fish/Bluegill.tres" id="8"] [ext_resource type="Texture2D" path="res://Sprites/Props/Fish/Carp.tres" id="9"] @@ -17,11 +17,11 @@ [ext_resource type="Texture2D" path="res://Sprites/Props/Fish/Salmon.tres" id="15"] [ext_resource type="Texture2D" path="res://Sprites/Props/Fish/Snakehead.tres" id="16"] [ext_resource type="Texture2D" path="res://Sprites/Props/Fish/Trout.tres" id="17"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/julePortraits.png" id="18"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/kanako portraits.png" id="19"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/martletportraits.png" id="20"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/melody.png" id="21"] -[ext_resource type="Texture2D" path="res://Sprites/Portraits/starlo.png" id="22"] +[ext_resource type="Texture2D" uid="uid://nuqgwear3gen" path="res://Sprites/Portraits/julePortraits.png" id="18"] +[ext_resource type="Texture2D" uid="uid://ro5axx3so6g3" path="res://Sprites/Portraits/kanako portraits.png" id="19"] +[ext_resource type="Texture2D" uid="uid://b0f8eyo2bxcy6" path="res://Sprites/Portraits/martletportraits.png" id="20"] +[ext_resource type="Texture2D" uid="uid://cr05g67c0bl3n" path="res://Sprites/Portraits/melody.png" id="21"] +[ext_resource type="Texture2D" uid="uid://b4oeggi5ynsxm" path="res://Sprites/Portraits/starlo.png" id="22"] [sub_resource type="AtlasTexture" id="AtlasTexture_fhf2g"] atlas = ExtResource("1") diff --git a/Main.tscn b/Main.tscn index 5eddcf4..270a832 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,23 +1,23 @@ -[gd_scene load_steps=48 format=3] +[gd_scene load_steps=48 format=3 uid="uid://bl5b0bl5pbewo"] -[ext_resource type="Script" path="res://Scripts/Main.cs" id="1"] -[ext_resource type="Texture2D" path="res://Sprites/Menus/dwbox.png" id="2"] -[ext_resource type="Script" path="res://Scripts/Common/TextSystem.cs" id="3"] -[ext_resource type="SpriteFrames" path="res://Animations/Portraits.tres" id="4"] -[ext_resource type="FontFile" path="res://Fonts/DTM-Mono.otf" id="5"] +[ext_resource type="Script" uid="uid://cqejt8xpuq0we" path="res://Scripts/Main.cs" id="1"] +[ext_resource type="Texture2D" uid="uid://ca4ame0uqm16i" path="res://Sprites/Menus/dwbox.png" id="2"] +[ext_resource type="Script" uid="uid://dcaadyrf44f2s" path="res://Scripts/Common/TextSystem.cs" id="3"] +[ext_resource type="SpriteFrames" uid="uid://gk3ccjsd3rvd" path="res://Animations/Portraits.tres" id="4"] +[ext_resource type="FontFile" uid="uid://dnnxmwpetnwst" path="res://Fonts/DTM-Mono.otf" id="5"] [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/Soul.tres" id="6"] -[ext_resource type="Script" path="res://Scripts/CameraController.cs" id="7"] -[ext_resource type="Texture2D" path="res://Sprites/MobileControl/Z.png" id="7_ny7u2"] -[ext_resource type="Script" path="res://Scripts/DebugMenu.cs" id="8"] -[ext_resource type="Texture2D" path="res://Sprites/MobileControl/X.png" id="8_x3yn0"] -[ext_resource type="Script" path="res://Scripts/UI/LWMenu.cs" id="9"] -[ext_resource type="Texture2D" path="res://Sprites/MobileControl/C.png" id="9_1w2xm"] -[ext_resource type="Texture2D" path="res://Sprites/Menus/gui.png" id="10"] -[ext_resource type="Texture2D" path="res://Sprites/MobileControl/Direction.png" id="10_x3yn0"] -[ext_resource type="Texture2D" path="res://Sprites/Menus/utbox.png" id="11"] -[ext_resource type="FontFile" path="res://Fonts/TroubleBeneathTheDome.ttf" id="12"] -[ext_resource type="FontFile" path="res://Fonts/DTM-Sans.otf" id="13"] -[ext_resource type="Script" path="res://Scripts/UI/DWMenu.cs" id="14"] +[ext_resource type="Script" uid="uid://c6tb02l2w3pkf" path="res://Scripts/CameraController.cs" id="7"] +[ext_resource type="Texture2D" uid="uid://borwa3xavq2yq" path="res://Sprites/Menus/Mobile/ButtonZ.png" id="7_ny7u2"] +[ext_resource type="Script" uid="uid://bpgi5e11le8ft" path="res://Scripts/DebugMenu.cs" id="8"] +[ext_resource type="Texture2D" uid="uid://diiegqyqmfse8" path="res://Sprites/Menus/Mobile/ButtonX.png" id="8_x3yn0"] +[ext_resource type="Script" uid="uid://cjh5kwd7xrs7d" path="res://Scripts/UI/LWMenu.cs" id="9"] +[ext_resource type="Texture2D" uid="uid://beun6iki5130q" path="res://Sprites/Menus/Mobile/ButtonC.png" id="9_1w2xm"] +[ext_resource type="Texture2D" uid="uid://dnm66f5ii885g" path="res://Sprites/Menus/gui.png" id="10"] +[ext_resource type="Texture2D" uid="uid://dhcfih1gqgfdt" path="res://Sprites/Menus/Mobile/buttonR.png" id="10_x3yn0"] +[ext_resource type="Texture2D" uid="uid://dvcauf0wkk8je" path="res://Sprites/Menus/utbox.png" id="11"] +[ext_resource type="FontFile" uid="uid://benu2xtgythyn" path="res://Fonts/TroubleBeneathTheDome.ttf" id="12"] +[ext_resource type="FontFile" uid="uid://7dfp3lculoyo" path="res://Fonts/DTM-Sans.otf" id="13"] +[ext_resource type="Script" uid="uid://dtk1i5ahr1pab" path="res://Scripts/UI/DWMenu.cs" id="14"] [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/TPBar.tres" id="15"] [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/TP.tres" id="16"] [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/TPBar2.tres" id="17"] @@ -34,10 +34,10 @@ [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/DWPauseMagic.tres" id="28"] [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/DWPauseTalk.tres" id="29"] [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/DWPauseSettings.tres" id="30"] -[ext_resource type="FontFile" path="res://Fonts/dotumche-pixel.ttf" id="31"] +[ext_resource type="FontFile" uid="uid://befndkvd8tm72" path="res://Fonts/dotumche-pixel.ttf" id="31"] [ext_resource type="PackedScene" path="res://Objects/UI/PartyUi.tscn" id="32"] -[ext_resource type="Shader" path="res://Materials/scroll.gdshader" id="33"] -[ext_resource type="Texture2D" path="res://Sprites/Menus/utbox3.png" id="34"] +[ext_resource type="Shader" uid="uid://bfivpospbfroi" path="res://Materials/scroll.gdshader" id="33"] +[ext_resource type="Texture2D" uid="uid://srs8tht248xr" path="res://Sprites/Menus/utbox3.png" id="34"] [ext_resource type="Texture2D" path="res://Sprites/Menus/Menu Sprites/HPBar4.tres" id="35"] [ext_resource type="PackedScene" path="res://Objects/UI/MainMenu.tscn" id="36"] diff --git a/Scripts-new/Audio.cs.uid b/Scripts-new/Audio.cs.uid new file mode 100644 index 0000000..0f494a9 --- /dev/null +++ b/Scripts-new/Audio.cs.uid @@ -0,0 +1 @@ +uid://d37glcadpwbmg diff --git a/Scripts-new/BattleStats.cs.uid b/Scripts-new/BattleStats.cs.uid new file mode 100644 index 0000000..dd12bda --- /dev/null +++ b/Scripts-new/BattleStats.cs.uid @@ -0,0 +1 @@ +uid://b4lehdmsj68nu diff --git a/Scripts-new/Common.cs.uid b/Scripts-new/Common.cs.uid new file mode 100644 index 0000000..b4ec0e8 --- /dev/null +++ b/Scripts-new/Common.cs.uid @@ -0,0 +1 @@ +uid://delrhdgmycg6w diff --git a/Scripts-new/Coroutine.cs.uid b/Scripts-new/Coroutine.cs.uid new file mode 100644 index 0000000..525c606 --- /dev/null +++ b/Scripts-new/Coroutine.cs.uid @@ -0,0 +1 @@ +uid://u30yubcwihnv diff --git a/Scripts-new/EventPart.cs.uid b/Scripts-new/EventPart.cs.uid new file mode 100644 index 0000000..302c5f5 --- /dev/null +++ b/Scripts-new/EventPart.cs.uid @@ -0,0 +1 @@ +uid://dmb70op5g2toq diff --git a/Scripts-new/IBullet.cs.uid b/Scripts-new/IBullet.cs.uid new file mode 100644 index 0000000..bf2d31e --- /dev/null +++ b/Scripts-new/IBullet.cs.uid @@ -0,0 +1 @@ +uid://b4y6ay7i17g3y diff --git a/Scripts-new/IEvent.cs.uid b/Scripts-new/IEvent.cs.uid new file mode 100644 index 0000000..a422f1f --- /dev/null +++ b/Scripts-new/IEvent.cs.uid @@ -0,0 +1 @@ +uid://bjs85kwdy6o12 diff --git a/Scripts-new/IPuzzle.cs.uid b/Scripts-new/IPuzzle.cs.uid new file mode 100644 index 0000000..48b80b2 --- /dev/null +++ b/Scripts-new/IPuzzle.cs.uid @@ -0,0 +1 @@ +uid://ch77jnwti70fc diff --git a/Scripts-new/Interacteable.cs.uid b/Scripts-new/Interacteable.cs.uid new file mode 100644 index 0000000..bafca2e --- /dev/null +++ b/Scripts-new/Interacteable.cs.uid @@ -0,0 +1 @@ +uid://cwfsyrbsyoiy diff --git a/Scripts-new/Texts.cs.uid b/Scripts-new/Texts.cs.uid new file mode 100644 index 0000000..7575c7f --- /dev/null +++ b/Scripts-new/Texts.cs.uid @@ -0,0 +1 @@ +uid://f0qco7w1kyo7 diff --git a/Scripts/UI/Joystick.cs b/Scripts/UI/Joystick.cs deleted file mode 100644 index 61027a7..0000000 --- a/Scripts/UI/Joystick.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Godot; -using System; - -public partial class Joystick : Control -{ - private Vector2 _startTouchPos = Vector2.Zero; - private Vector2 _currentTouchPos = Vector2.Zero; - private bool _touching = false; - - [Export] public float DeadzoneRadius = 30f; - [Export] public float MaxRadius = 90f; - - public override void _GuiInput(InputEvent @event) - { - if (@event is InputEventScreenTouch touch) - { - if (touch.Pressed) - { - _touching = true; - _startTouchPos = touch.Position; - _currentTouchPos = touch.Position; - } - else - { - _touching = false; - } - } - else if (@event is InputEventScreenDrag drag && _touching) - { - _currentTouchPos = drag.Position; - } - } - - public Vector2 GetDirection() - { - if (!_touching) return Vector2.Zero; - - Vector2 offset = _currentTouchPos - _startTouchPos; - if (offset.Length() < DeadzoneRadius) - return Vector2.Zero; - - return offset.Normalized() * Mathf.Min(offset.Length(), MaxRadius); - } - - public override void _Draw() - { - Vector2 center = new Vector2(0, 0); - Vector2 handleOffset = _touching ? (_currentTouchPos - _startTouchPos).Normalized() * Mathf.Min((_currentTouchPos - _startTouchPos).Length(), MaxRadius) : Vector2.Zero; - - DrawCircle(center, MaxRadius, new Color(1, 1, 1, 1), false); - DrawCircle(center, DeadzoneRadius, new Color(1, 1, 0, 1), false); - DrawCircle(center + handleOffset, DeadzoneRadius, new Color(1, 1, 1, 0.3f), false); // 当前触点 - } - - public override void _Process(double delta) - { - QueueRedraw(); - } -} diff --git a/Scripts/UI/Joystick.cs.uid b/Scripts/UI/Joystick.cs.uid deleted file mode 100644 index dfb9eb6..0000000 --- a/Scripts/UI/Joystick.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://d0oevmfoonvv diff --git a/Scripts/UI/TouchControls.cs b/Scripts/UI/TouchControls.cs deleted file mode 100644 index e84e57c..0000000 --- a/Scripts/UI/TouchControls.cs +++ /dev/null @@ -1,110 +0,0 @@ - using Godot; - using System; - - public partial class TouchControls : CanvasLayer - { - public override void _Ready() - { - // 仅在 Android 平台启用 - if (OS.GetName() != "Android") - { - QueueFree(); - return; - } - SetButtonTextures(); - SetupButtonBindings(); - UpdateButtonPositions(); // 设置初始位置 - } - - public override void _Process(double delta) - { - Vector2 dir = GetNode("Joystick").GetDirection(); - UpdateDirectionInput(dir); - } - - private void SetButtonTextures() - { - string basePath = "res://Sprites/Menus/Mobile/"; - GetNode("Buttons/ButtonZ").TextureNormal = GD.Load(basePath + "ButtonZ.png"); - GetNode("Buttons/ButtonX").TextureNormal = GD.Load(basePath + "ButtonX.png"); - GetNode("Buttons/ButtonC").TextureNormal = GD.Load(basePath + "ButtonC.png"); - } - - private void SetupButtonBindings() - { - BindButton("Buttons/ButtonZ", "Confirm"); - BindButton("Buttons/ButtonX", "Cancel"); - BindButton("Buttons/ButtonC", "Menu"); - } - - private void BindButton(string path, string actionName) - { - var button = GetNode(path); - button.Modulate = new Color(1, 1, 1, 0.5f); // 初始透明度 - - button.Pressed += () => - { - Input.ActionPress(actionName); - button.Modulate = new Color(1, 1, 1, 1); // 按下全不透明 - }; - - button.ButtonUp += () => - { - Input.ActionRelease(actionName); - button.Modulate = new Color(1, 1, 1, 0.5f); // 松开恢复 - }; - } - - private void UpdateButtonPositions() - { - Vector2 viewportSize = GetViewport().GetVisibleRect().Size; - - SetButtonPosition("Buttons/ButtonZ", viewportSize, new Vector2(0.35f, 0.20f)); - SetButtonPosition("Buttons/ButtonX", viewportSize, new Vector2(0.25f, 0.35f)); - SetButtonPosition("Buttons/ButtonC", viewportSize, new Vector2(0.15f, 0.50f)); - - var joystick = GetNode("Joystick"); - Vector2 joyPos = new Vector2( - viewportSize.X * 0.20f, - viewportSize.Y * 0.75f - ); - - joystick.AnchorLeft = 0; - joystick.AnchorTop = 0; - joystick.AnchorRight = 0; - joystick.AnchorBottom = 0; - joystick.Position = joyPos; - GD.Print(joystick.Position); - } - - private void SetButtonPosition(string path, Vector2 viewportSize, Vector2 offsetPercent) - { - var button = GetNode(path); - Vector2 finalPosition = new Vector2( - viewportSize.X * (1 - offsetPercent.X), - viewportSize.Y * (1 - offsetPercent.Y) - ); - - button.AnchorRight = 1; - button.AnchorBottom = 1; - button.AnchorLeft = 1; - button.AnchorTop = 1; - button.Position = finalPosition; // 从右下角反向偏移 - } - - private void UpdateDirectionInput(Vector2 dir) - { - string[] actions = { "Left", "Right", "Up", "Down" }; - Vector2[] vectors = { Vector2.Left, Vector2.Right, Vector2.Up, Vector2.Down }; - const float thresholdAngle = 57f; - - for (int i = 0; i < actions.Length; i++) - { - float angle = Mathf.RadToDeg(Mathf.Abs(dir.AngleTo(vectors[i]))); - if (dir.Length() > 0.1f && angle < thresholdAngle) - Input.ActionPress(actions[i]); - else - Input.ActionRelease(actions[i]); - } - } - } diff --git a/Scripts/UI/TouchControls.cs.uid b/Scripts/UI/TouchControls.cs.uid deleted file mode 100644 index 0fc26eb..0000000 --- a/Scripts/UI/TouchControls.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://gm1gx4pdogmb diff --git a/Sprites/Menus/Mobile/buttonR.png b/Sprites/Menus/Mobile/buttonR.png new file mode 100644 index 0000000000000000000000000000000000000000..ac1eef8ddd06a73cb3b533f486ea9eec0a8bcb1e GIT binary patch literal 460 zcmeAS@N?(olHy`uVBq!ia0y~yVDJH94mJh`hU3!%wHX)~7>k44ofy`glX=O&z}V*L z;uumf=k3k2dCdj_42i)X@A=N36LU$!-YhX-L;2*Nd26d2l#_$shj{(ey_KW4bV_QZ zU-NwB*34OcpWpH`&sW{^-}S5U56eq419=#!KO4t$E!rd=K*KAc?WxdDfp-osc+K_M^iG;q d-n$c$O$A}sLw~$`&A`CG;OXk;vd$@?2>{Ki%T53Q literal 0 HcmV?d00001 diff --git a/Sprites/Menus/Mobile/buttonR.png.import b/Sprites/Menus/Mobile/buttonR.png.import new file mode 100644 index 0000000..26b1fa2 --- /dev/null +++ b/Sprites/Menus/Mobile/buttonR.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dhcfih1gqgfdt" +path="res://.godot/imported/buttonR.png-6b75f23954d0c5691627718101be3e4c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/Menus/Mobile/buttonR.png" +dest_files=["res://.godot/imported/buttonR.png-6b75f23954d0c5691627718101be3e4c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/default_bus_layout.tres b/default_bus_layout.tres index 485362d..b9e103e 100644 --- a/default_bus_layout.tres +++ b/default_bus_layout.tres @@ -1,4 +1,4 @@ -[gd_resource type="AudioBusLayout" load_steps=3 format=3] +[gd_resource type="AudioBusLayout" load_steps=3 format=3 uid="uid://ccd3dghvwddv2"] [sub_resource type="AudioEffectLimiter" id="AudioEffectLimiter_cmj7n"] resource_name = "Limiter"