12345
This commit is contained in:
parent
0acda608aa
commit
dd1a1cd620
@ -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")
|
||||
|
42
Main.tscn
42
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"]
|
||||
|
||||
|
1
Scripts-new/Audio.cs.uid
Normal file
1
Scripts-new/Audio.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://d37glcadpwbmg
|
1
Scripts-new/BattleStats.cs.uid
Normal file
1
Scripts-new/BattleStats.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b4lehdmsj68nu
|
1
Scripts-new/Common.cs.uid
Normal file
1
Scripts-new/Common.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://delrhdgmycg6w
|
1
Scripts-new/Coroutine.cs.uid
Normal file
1
Scripts-new/Coroutine.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://u30yubcwihnv
|
1
Scripts-new/EventPart.cs.uid
Normal file
1
Scripts-new/EventPart.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://dmb70op5g2toq
|
1
Scripts-new/IBullet.cs.uid
Normal file
1
Scripts-new/IBullet.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b4y6ay7i17g3y
|
1
Scripts-new/IEvent.cs.uid
Normal file
1
Scripts-new/IEvent.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bjs85kwdy6o12
|
1
Scripts-new/IPuzzle.cs.uid
Normal file
1
Scripts-new/IPuzzle.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://ch77jnwti70fc
|
1
Scripts-new/Interacteable.cs.uid
Normal file
1
Scripts-new/Interacteable.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cwfsyrbsyoiy
|
1
Scripts-new/Texts.cs.uid
Normal file
1
Scripts-new/Texts.cs.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://f0qco7w1kyo7
|
@ -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();
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
uid://d0oevmfoonvv
|
@ -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>("Joystick").GetDirection();
|
||||
UpdateDirectionInput(dir);
|
||||
}
|
||||
|
||||
private void SetButtonTextures()
|
||||
{
|
||||
string basePath = "res://Sprites/Menus/Mobile/";
|
||||
GetNode<TextureButton>("Buttons/ButtonZ").TextureNormal = GD.Load<Texture2D>(basePath + "ButtonZ.png");
|
||||
GetNode<TextureButton>("Buttons/ButtonX").TextureNormal = GD.Load<Texture2D>(basePath + "ButtonX.png");
|
||||
GetNode<TextureButton>("Buttons/ButtonC").TextureNormal = GD.Load<Texture2D>(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<TextureButton>(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>("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<TextureButton>(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]);
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
uid://gm1gx4pdogmb
|
BIN
Sprites/Menus/Mobile/buttonR.png
Normal file
BIN
Sprites/Menus/Mobile/buttonR.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 460 B |
34
Sprites/Menus/Mobile/buttonR.png.import
Normal file
34
Sprites/Menus/Mobile/buttonR.png.import
Normal file
@ -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
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user