diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json
index afaae27..8d68ef1 100644
--- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json
+++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json
@@ -1,16 +1 @@
-{
- "Position": {
- "X": -8,
- "Y": -5
- },
- "Size": {
- "X": 22,
- "Y": 20
- },
- "DoorAreaInfos": [],
- "GroupName": "TestGroup1",
- "RoomType": 0,
- "RoomName": "Room1",
- "Weight": 100,
- "Remark": ""
-}
\ No newline at end of file
+{"Position":{"X":-8,"Y":-5},"Size":{"X":22,"Y":20},"DoorAreaInfos":[{"Direction":1,"Start":48,"End":272},{"Direction":2,"Start":192,"End":320},{"Direction":0,"Start":64,"End":288},{"Direction":3,"Start":32,"End":240}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Room1","Weight":100,"Remark":""}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json
index a1edc66..3b1bc6d 100644
--- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json
+++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json
@@ -1,1885 +1 @@
-{
- "NavigationList": [
- {
- "Type": 0,
- "Points": [
- -72,
- -56,
- 120,
- -56,
- 120,
- 8,
- 200,
- 8,
- 200,
- 224,
- 88,
- 224,
- 88,
- 112,
- -40,
- 112,
- -40,
- 208,
- -104,
- 208,
- -104,
- -8,
- -88,
- -8,
- -88,
- -24,
- -72,
- -24
- ]
- },
- {
- "Type": 1,
- "Points": [
- -40,
- -32,
- 56,
- -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1,0,1,7,9,-1,0,2,7,10,-1,0,2,7,11,-1,0,2,7,12,-1,0,2,7],"Top":[-8,-2,0,3,4,-8,-1,0,3,3,-8,0,0,3,3,-8,1,0,3,3,-8,2,0,3,3,-8,3,0,3,3,-8,4,0,3,3,-8,5,0,3,3,-8,6,0,3,3,-8,7,0,3,3,-8,8,0,3,3,-8,9,0,3,3,-8,10,0,3,3,-8,11,0,3,3,-8,12,0,3,3,-8,13,0,11,2,-7,-3,0,3,4,-7,13,0,2,2,-6,-5,0,3,4,-6,-4,0,3,3,-6,13,0,2,2,-5,13,0,2,2,-4,13,0,2,2,-3,13,0,2,2,-2,-2,0,1,2,-2,-1,0,1,3,-2,0,0,1,3,-2,7,0,1,2,-2,8,0,1,3,-2,9,0,1,3,-2,10,0,1,3,-2,11,0,1,3,-2,12,0,1,3,-2,13,0,13,2,-1,-2,0,2,2,-1,7,0,2,2,0,-2,0,2,2,0,1,0,1,4,0,2,0,1,3,0,7,0,2,2,1,-2,0,2,2,1,7,0,2,2,2,-2,0,3,2,2,-1,0,3,3,2,0,0,3,3,2,1,0,3,3,2,2,0,3,3,2,7,0,2,2,3,7,0,2,2,4,7,0,3,2,4,8,0,3,3,4,9,0,3,3,4,10,0,3,3,4,11,0,3,3,4,12,0,3,3,4,13,0,3,3,4,14,0,11,2,5,14,0,2,2,6,14,0,2,2,7,14,0,2,2,8,-5,0,1,4,8,-4,0,1,3,8,-3,0,1,3,8,-2,0,1,3,8,14,0,2,2,9,14,0,2,2,10,14,0,2,2,11,14,0,2,2,12,14,0,2,2,13,-1,0,1,4,13,0,0,1,3,13,1,0,1,3,13,2,0,1,3,13,3,0,1,3,13,4,0,1,3,13,5,0,1,3,13,6,0,1,3,13,7,0,1,3,13,8,0,1,3,13,9,0,1,3,13,10,0,1,3,13,11,0,1,3,13,12,0,1,3,13,13,0,1,3,13,14,0,13,2]}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Room1/Room1_roomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Room1/Room1_roomInfo.json
index 51d5581..b234081 100644
--- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Room1/Room1_roomInfo.json
+++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Room1/Room1_roomInfo.json
@@ -1 +1 @@
-{"Position":{"X":-1,"Y":-1},"Size":{"X":11,"Y":9},"DoorAreaInfos":[{"Direction":3,"Start":16,"End":-16},{"Direction":2,"Start":16,"End":-16},{"Direction":1,"Start":16,"End":-16},{"Direction":0,"Start":16,"End":-16}],"GroupName":"TestGroup1","RoomType":1,"RoomName":"Room1","Weight":100,"Remark":""}
\ No newline at end of file
+{"Position":{"X":-1,"Y":-1},"Size":{"X":11,"Y":9},"DoorAreaInfos":[{"Direction":3,"Start":16,"End":112},{"Direction":2,"Start":16,"End":144},{"Direction":1,"Start":16,"End":112},{"Direction":0,"Start":16,"End":112}],"GroupName":"TestGroup1","RoomType":1,"RoomName":"Room1","Weight":100,"Remark":""}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/framework/map/data/DoorAreaInfo.cs b/DungeonShooting_Godot/src/framework/map/data/DoorAreaInfo.cs
index 0ee84b0..fe428b0 100644
--- a/DungeonShooting_Godot/src/framework/map/data/DoorAreaInfo.cs
+++ b/DungeonShooting_Godot/src/framework/map/data/DoorAreaInfo.cs
@@ -16,27 +16,27 @@
/// 起始位置, 相对 tilemap 的横/纵轴原点, 单位: 像素
///
[JsonInclude]
- public float Start = 0;
+ public int Start = 0;
///
/// 结束位置, 相对 tilemap 的横/纵轴原点, 单位: 像素
///
[JsonInclude]
- public float End = 16;
+ public int End = 16;
///
/// 起始点坐标, 该坐标为模板场景的世界坐标, 单位: 像素, 不参与序列化与反序列化
///
- public Vector2 StartPosition;
+ public Vector2I StartPosition;
///
/// 结束点坐标, 该坐标为模板场景的世界坐标, 单位: 像素, 不参与序列化与反序列化
///
- public Vector2 EndPosition;
+ public Vector2I EndPosition;
public DoorAreaInfo()
{
}
- public DoorAreaInfo(DoorDirection direction, float start, float end)
+ public DoorAreaInfo(DoorDirection direction, int start, int end)
{
Direction = direction;
Start = start;
@@ -46,25 +46,25 @@
///
/// 自动计算 startPosition 和 endPosition
///
- public void CalcPosition(Vector2 rootPosition, Vector2 rootSize)
+ public void CalcPosition(Vector2I rootPosition, Vector2I rootSize)
{
switch (Direction)
{
case DoorDirection.E:
- StartPosition = new Vector2(rootPosition.X, rootPosition.Y + Start);
- EndPosition = new Vector2(rootPosition.X, rootPosition.Y + End);
+ StartPosition = new Vector2I(rootPosition.X, rootPosition.Y + Start);
+ EndPosition = new Vector2I(rootPosition.X, rootPosition.Y + End);
break;
case DoorDirection.W:
- StartPosition = new Vector2(rootPosition.X + rootSize.X, rootPosition.Y + Start);
- EndPosition = new Vector2(rootPosition.X + rootSize.X, rootPosition.Y + End);
+ StartPosition = new Vector2I(rootPosition.X + rootSize.X, rootPosition.Y + Start);
+ EndPosition = new Vector2I(rootPosition.X + rootSize.X, rootPosition.Y + End);
break;
case DoorDirection.S:
- StartPosition = new Vector2(rootPosition.X + Start, rootPosition.Y + rootSize.Y);
- EndPosition = new Vector2(rootPosition.X + End, rootPosition.Y + rootSize.Y);
+ StartPosition = new Vector2I(rootPosition.X + Start, rootPosition.Y + rootSize.Y);
+ EndPosition = new Vector2I(rootPosition.X + End, rootPosition.Y + rootSize.Y);
break;
case DoorDirection.N:
- StartPosition = new Vector2(rootPosition.X + Start, rootPosition.Y);
- EndPosition = new Vector2(rootPosition.X + End, rootPosition.Y);
+ StartPosition = new Vector2I(rootPosition.X + Start, rootPosition.Y);
+ EndPosition = new Vector2I(rootPosition.X + End, rootPosition.Y);
break;
}
}
diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs
index 6e70d64..8dee7b6 100644
--- a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs
+++ b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs
@@ -401,6 +401,11 @@
// doorPos, DoorDirection.E,
// 0 * GameConfig.TileCellSize, 4 * GameConfig.TileCellSize
// );
+ //加载门编辑区域
+ foreach (var doorAreaInfo in _doorConfigs)
+ {
+ MapEditorToolsPanel.CreateDoorTool(doorAreaInfo);
+ }
return true;
}
@@ -788,7 +793,6 @@
/// 需要检测的门
/// 起始坐标, 单位: 像素
/// 结束坐标, 单位: 像素
- ///
public bool CheckDoorArea(DoorAreaInfo target, int start, int end)
{
foreach (var item in _doorConfigs)
@@ -810,6 +814,14 @@
var size = GameConfig.TileCellSize;
return !(h2 < o1 - 3 * size || o2 + 3 * size < h1);
}
+
+ ///
+ /// 移除门区域数据
+ ///
+ public void RemoveDoorArea(DoorAreaInfo doorAreaInfo)
+ {
+ _doorConfigs.Remove(doorAreaInfo);
+ }
//保存房间配置
private void SaveRoomInfoConfig()
diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs
index 381f3ac..c843b23 100644
--- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs
+++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs
@@ -24,13 +24,19 @@
public DoorAreaInfo DoorAreaInfo { get; set; }
///
+ /// 所属悬停区域
+ ///
+ public DoorHoverArea DoorHoverArea { get; private set; }
+
+ ///
/// 所属 Ui 对象
///
public MapEditorToolsPanel MapEditorToolsPanel { get; private set; }
private DoorDragButton _startButton;
private DoorDragButton _endButton;
-
+
+ private bool _mouseHover = false;
private MapEditorTools.DoorToolTemplate _node;
private Vector2 _startTempPos;
private Vector2 _endTempPos;
@@ -59,14 +65,19 @@
_startButton.DragEvent += OnStartAreaDrag;
_endButton.DragEvent += OnEndAreaDrag;
+ node.L_DoorArea.Instance.MouseEntered += OnMouseEntered;
+ node.L_DoorArea.Instance.MouseExited += OnMouseExited;
SetDoorAreaSize(GameConfig.TileCellSize * 4);
- SetDoorAreaDirection(DoorDirection.N);
}
public override void _Process(double delta)
{
- if (_isDragMode)
+ if (_mouseHover && !DoorHoverArea.IsDrag && Input.IsMouseButtonPressed(MouseButton.Right)) //右键删除区域
+ {
+ MapEditorToolsPanel.RemoveDoorTool(_node);
+ }
+ else if (_isDragMode)
{
if (!Input.IsMouseButtonPressed(MouseButton.Left)) //松开了右键
{
@@ -104,22 +115,23 @@
}
///
- /// 设置门区域的方向
+ /// 设置所属悬停区域
///
- public void SetDoorAreaDirection(DoorDirection direction)
+ public void SetDoorHoverArea(DoorHoverArea hoverArea)
{
- Direction = direction;
- if (direction == DoorDirection.N)
+ DoorHoverArea = hoverArea;
+ Direction = hoverArea.Direction;
+ if (Direction == DoorDirection.N)
{
Scale = new Vector2(1, 1);
RotationDegrees = 0;
}
- else if (direction == DoorDirection.E)
+ else if (Direction == DoorDirection.E)
{
Scale = new Vector2(1, 1);
RotationDegrees = 90;
}
- else if (direction == DoorDirection.S)
+ else if (Direction == DoorDirection.S)
{
Scale = new Vector2(-1, 1);
RotationDegrees = 180;
@@ -207,7 +219,7 @@
}
var position = _startTempPos;
- position.X = position.X += offset.X;
+ position.X += offset.X + _startButton.Size.X;
var endPosition = _endButton.Position;
//拖拽模式
@@ -228,27 +240,28 @@
}
//计算区域大小
- var areaSize = (int)(endPosition.X - position.X - _startButton.Size.X);
- _startButton.Position = position;
+ var areaSize = (int)(endPosition.X - position.X);
+ _startButton.Position = position - new Vector2(_startButton.Size.X, 0);
//刷新区域位置
SetDoorAreaSize(areaSize);
//起始点坐标必须要小于终点坐标, 且起点坐标大于0
- if (position.X < endPosition.X && position.X >= 0)
+ if (position.X < endPosition.X && (DoorHoverArea == null || position.X >= 0))
{
//区域必须大于等于 4 格宽度
if (areaSize >= GameConfig.TileCellSize * 4)
{
- if (DoorAreaInfo == null)
- {
- //可以提交
- _canComment = true;
- _node.L_DoorArea.Instance.Color = _defaultColor;
- return;
- }
var doorAreaRange = GetDoorAreaRange();
//检测是否撞到其他区域
- var checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(DoorAreaInfo, doorAreaRange.X, doorAreaRange.Y);
+ bool checkResult;
+ if (DoorAreaInfo == null)
+ {
+ checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(Direction, doorAreaRange.X, doorAreaRange.Y);
+ }
+ else
+ {
+ checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(DoorAreaInfo, doorAreaRange.X, doorAreaRange.Y);
+ }
if (checkResult)
{
//可以提交
@@ -281,6 +294,10 @@
//提交数据
SubmitData();
}
+ if (DoorHoverArea != null)
+ {
+ DoorHoverArea.EmitSignal(Control.SignalName.MouseExited);
+ }
}
}
@@ -297,7 +314,7 @@
{
var position = _endTempPos;
position.X = position.X += offset.X;
- var startPosition = _startButton.Position;
+ var startPosition = _startButton.Position + new Vector2(_startButton.Size.X, 0);
//拖拽模式
if (_isDragMode)
@@ -317,26 +334,27 @@
}
//区域大小
- var areaSize = (int)(position.X - _startButton.Position.X - _startButton.Size.X);
+ var areaSize = (int)(position.X - startPosition.X);
//刷新区域位置
SetDoorAreaSize(areaSize);
//终点坐标必须要大于起始点坐标, 且终点坐标必须小于宽度
- if (position.X > startPosition.X && position.X < startPosition.X + _areaSize)
+ if (position.X > startPosition.X && (DoorHoverArea == null || position.X <= DoorHoverArea.Size.X))
{
//区域必须大于等于 4 格宽度
if (areaSize >= GameConfig.TileCellSize * 4)
{
- if (DoorAreaInfo == null)
- {
- //可以提交
- _canComment = true;
- _node.L_DoorArea.Instance.Color = _defaultColor;
- return;
- }
var doorAreaRange = GetDoorAreaRange();
//检测是否撞到其他区域
- var checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(DoorAreaInfo, doorAreaRange.X, doorAreaRange.Y);
+ bool checkResult;
+ if (DoorAreaInfo == null)
+ {
+ checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(Direction, doorAreaRange.X, doorAreaRange.Y);
+ }
+ else
+ {
+ checkResult = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(DoorAreaInfo, doorAreaRange.X, doorAreaRange.Y);
+ }
if (checkResult)
{
//可以提交
@@ -369,6 +387,10 @@
//提交数据
SubmitData();
}
+ if (DoorHoverArea != null)
+ {
+ DoorHoverArea.EmitSignal(Control.SignalName.MouseExited);
+ }
}
}
@@ -398,4 +420,14 @@
GD.Print("submit: " + doorAreaRange);
}
}
+
+ private void OnMouseEntered()
+ {
+ _mouseHover = true;
+ }
+
+ private void OnMouseExited()
+ {
+ _mouseHover = false;
+ }
}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs
index d1a7f91..f0e2db6 100644
--- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs
+++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs
@@ -56,7 +56,7 @@
if (Input.IsMouseButtonPressed(MouseButton.Left))
{
IsDrag = true;
- _currToolTemplate = MapEditorToolsPanel.CreateDragDoorTool(_parent.Position, Direction, start,
+ _currToolTemplate = MapEditorToolsPanel.CreateDragDoorTool(this, start,
OnSubmitDoorArea, OnCancelDoorArea);
}
}
diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs
index b695bc5..803edaf 100644
--- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs
+++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs
@@ -42,7 +42,7 @@
S_HoverPreviewRoot.Instance.Visible = ActiveHoverArea != null && !DoorHoverArea.IsDrag;
}
- public DoorHoverArea GetDoorHoverAreaByDir(DoorDirection direction)
+ public DoorHoverArea GetDoorHoverAreaByDirection(DoorDirection direction)
{
switch (direction)
{
@@ -69,37 +69,33 @@
S_HoverPreviewRoot.Instance.Reparent(S_DoorToolRoot.Instance, false);
}
}
-
+
///
/// 创建门区域设置工具
///
- /// 原点坐标, 单位: 像素
- /// 方向
- /// 起始位置, 单位: 像素
- /// 区域大小, 单位: 像素
- public DoorToolTemplate CreateDoorTool(Vector2 position, DoorDirection direction, int start, int size)
+ /// 门区域数据
+ public DoorToolTemplate CreateDoorTool(DoorAreaInfo doorAreaInfo)
{
- var inst = CreateDoorToolInstance(GetDoorHoverAreaByDir(direction));
- inst.Instance.SetDoorAreaPosition(position);
- inst.Instance.SetDoorAreaDirection(direction);
- inst.Instance.SetDoorAreaRange(start, size);
+ var doorHoverArea = GetDoorHoverAreaByDirection(doorAreaInfo.Direction);
+ var inst = CreateDoorToolInstance(doorHoverArea);
+ inst.Instance.DoorAreaInfo = doorAreaInfo;
+ inst.Instance.SetDoorAreaPosition(doorHoverArea.GetParent().Position);
+ inst.Instance.SetDoorAreaRange(doorAreaInfo.Start, doorAreaInfo.End - doorAreaInfo.Start);
return inst;
}
///
/// 创建拖拽状态下的门区域工具, 用于创建门区域
///
- /// 原点坐标, 单位: 像素
- /// 方向
+ /// 悬停区域
/// 起始位置, 单位: 像素
/// 成功提交时回调, 参数1为方向, 参数2为起始点, 参数3为大小
/// 取消提交时调用
- public DoorToolTemplate CreateDragDoorTool(Vector2 position, DoorDirection direction, int start,
+ public DoorToolTemplate CreateDragDoorTool(DoorHoverArea doorHoverArea, int start,
Action onSubmit, Action onCancel)
{
- var inst = CreateDoorToolInstance(GetDoorHoverAreaByDir(direction));
- inst.Instance.SetDoorAreaPosition(position);
- inst.Instance.SetDoorAreaDirection(direction);
+ var inst = CreateDoorToolInstance(doorHoverArea);
+ inst.Instance.SetDoorAreaPosition(doorHoverArea.GetParent().Position);
inst.Instance.SetDoorAreaRange(start, 0);
inst.Instance.MakeDragMode(onSubmit, () =>
{
@@ -115,6 +111,10 @@
public void RemoveDoorTool(DoorToolTemplate toolInstance)
{
_doorTools.Remove(toolInstance);
+ if (toolInstance.Instance.DoorAreaInfo != null)
+ {
+ EditorMap.Instance.RemoveDoorArea(toolInstance.Instance.DoorAreaInfo);
+ }
toolInstance.Instance.QueueFree();
}
@@ -156,6 +156,7 @@
doorTool.Instance.SetDoorDragAreaNode(doorTool);
doorTool.L_StartBtn.Instance.SetMapEditorToolsPanel(this);
doorTool.L_EndBtn.Instance.SetMapEditorToolsPanel(this);
+ doorTool.Instance.SetDoorHoverArea(doorHoverArea);
_doorTools.Add(doorTool);
return doorTool;
}