diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn index 26f1371..183f7b3 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn @@ -16,7 +16,6 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_5aioo") -metadata/_edit_horizontal_guides_ = [449.0] [node name="HBoxContainer" type="HBoxContainer" parent="."] layout_mode = 1 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json index b36d17a..669cb82 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json @@ -29,17 +29,5 @@ "ShopList": [], "EventList": [], "Remark": "" - }, - "Test2": { - "GroupName": "Test2", - "TileSet": "TileSet2", - "BattleList": [], - "InletList": [], - "OutletList": [], - "BossList": [], - "RewardList": [], - "ShopList": [], - "EventList": [], - "Remark": "" } } \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png index 1dcebc0..ca8f4da 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/TileInfo.json index 82a8f95..a18030c 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/TileInfo.json @@ -1 +1 @@ -{"NavigationVertices":[{"X":138,"Y":-42},{"X":138,"Y":82},{"X":134,"Y":22},{"X":134,"Y":-14},{"X":58,"Y":82},{"X":54,"Y":54},{"X":74,"Y":38},{"X":118,"Y":38},{"X":22,"Y":118},{"X":58,"Y":130},{"X":-58,"Y":130},{"X":-22,"Y":118},{"X":-26,"Y":22},{"X":-26,"Y":-14},{"X":-22,"Y":18},{"X":-22,"Y":54},{"X":54,"Y":18},{"X":74,"Y":2},{"X":22,"Y":82},{"X":-58,"Y":98},{"X":-22,"Y":82},{"X":90,"Y":-42},{"X":90,"Y":-14},{"X":90,"Y":2},{"X":-42,"Y":-42},{"X":118,"Y":22},{"X":-42,"Y":-58},{"X":90,"Y":-58},{"X":-86,"Y":-14},{"X":-106,"Y":-42},{"X":-106,"Y":98},{"X":-86,"Y":22}],"NavigationPolygon":[[0,1,2,3],[4,5,6,7,1],[8,9,10,11],[12,13,14,15],[6,5,16,17],[4,9,8,18,5],[11,10,19,20],[21,0,3,22],[22,23,17,24],[7,25,2,1],[15,5,18,20],[24,26,27,21],[24,21,22],[24,17,16,13],[16,14,13],[24,13,28,29],[30,29,28,31],[19,30,31,12,15,20]],"Floor":[-3,-4,0,3,-2,-4,0,3,-2,-3,0,3,-3,-3,0,3,-7,-3,0,3,-7,-2,0,3,-7,-1,0,3,-7,0,0,3,-7,1,0,3,-7,2,0,3,-7,3,0,3,-7,4,0,3,-7,5,0,3,-6,-3,0,3,-6,-2,0,3,-6,-1,0,3,-6,0,0,3,-6,1,0,3,-6,2,0,3,-6,3,0,3,-6,4,0,3,-6,5,0,3,-5,-3,0,3,-5,-2,0,3,-5,1,0,3,-5,2,0,3,-5,3,0,3,-5,4,0,3,-5,5,0,3,-4,-3,0,3,-4,-2,0,3,-4,1,0,3,-4,2,0,3,-4,3,0,3,-4,4,0,3,-4,5,0,3,-3,-2,0,3,-3,1,0,3,-3,2,0,3,-3,3,0,3,-3,4,0,3,-3,5,0,3,-2,-2,0,3,-2,-1,0,3,-2,0,0,3,-2,1,0,3,-2,2,0,3,-2,3,0,3,-2,4,0,3,-2,5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,1,56,1,0,2,2,2,0,5,24,1,0,6,3,2,1,-6,63,1,1,-5,2,2,1,1,56,1,1,2,2,2,2,-6,63,1,2,-5,2,2,2,1,24,1,2,2,3,2,3,-6,63,1,3,-5,2,2,4,-6,63,1,4,-5,2,2,5,-6,63,1,5,-5,2,2,5,0,48,1,5,1,1,2,6,-5,54,1,6,-4,1,2,6,0,26,1,6,1,3,2,7,-5,63,1,7,-4,2,2,7,-1,24,1,7,0,3,2,8,-5,63,1,8,-4,2,2],"Top":[-9,-6,511,1,-9,-5,511,1,-9,-4,511,1,-9,-3,511,1,-9,-2,511,1,-9,-1,511,1,-9,0,511,1,-9,1,511,1,-9,2,511,1,-9,3,511,1,-9,4,511,1,-9,5,511,1,-9,6,511,1,-9,7,511,1,-8,-6,511,1,-8,-5,255,1,-8,-4,219,1,-8,-3,219,1,-8,-2,219,1,-8,-1,219,1,-8,0,219,1,-8,1,219,1,-8,2,219,1,-8,3,219,1,-8,4,219,1,-8,5,219,1,-8,6,507,1,-8,7,511,1,-7,-6,511,1,-7,6,504,1,-7,7,511,1,-6,-6,511,1,-6,6,504,1,-6,7,511,1,-6,8,511,1,-6,9,511,1,-5,-7,511,1,-5,-6,511,1,-5,6,216,1,-5,7,219,1,-5,8,507,1,-5,9,511,1,-4,-7,511,1,-4,-6,255,1,-4,8,504,1,-4,9,511,1,-3,-7,511,1,-3,8,504,1,-3,9,511,1,-2,-7,511,1,-2,8,504,1,-2,9,511,1,-1,-7,511,1,-1,8,504,1,-1,9,511,1,0,-7,511,1,0,8,504,1,0,9,511,1,1,-7,511,1,1,8,504,1,1,9,511,1,2,-7,511,1,2,8,504,1,2,9,511,1,3,-7,511,1,3,8,504,1,3,9,511,1,4,-7,511,1,4,5,432,1,4,6,438,1,4,7,438,1,4,8,510,1,4,9,511,1,5,-7,511,1,5,5,504,1,5,6,511,1,5,7,511,1,5,8,511,1,5,9,511,1,6,-7,511,1,6,-6,447,1,6,-1,176,1,6,5,504,1,6,6,511,1,7,-7,511,1,7,-6,511,1,7,5,504,1,7,6,511,1,8,-6,511,1,8,5,504,1,8,6,511,1,9,-6,511,1,9,-5,447,1,9,-4,438,1,9,-3,438,1,9,-2,438,1,9,-1,438,1,9,0,438,1,9,1,438,1,9,2,438,1,9,3,438,1,9,4,438,1,9,5,510,1,9,6,511,1,10,-6,511,1,10,-5,511,1,10,-4,511,1,10,-3,511,1,10,-2,511,1,10,-1,511,1,10,0,511,1,10,1,511,1,10,2,511,1,10,3,511,1,10,4,511,1,10,5,511,1,10,6,511,1],"CustomFloor1":[-2,-3,1,6,14,-1,-3,1,7,14,-4,2,1,7,14,-3,3,1,8,15,-4,3,1,7,15,-5,3,1,6,15,6,4,1,8,15,5,4,1,7,15,-14,-6,0,24,7,-14,-5,0,24,7,-13,-5,0,24,7,-13,-6,0,25,7,-14,-4,0,24,8,-13,-4,0,24,8,-12,-4,0,24,8,-12,-5,0,24,7,-11,-4,0,24,8,-11,-5,0,24,7,-10,-4,0,24,7,-10,-5,0,24,7,-9,-4,0,24,7,-9,-5,0,25,7,-10,-3,0,24,8,-9,-3,0,24,8,-8,-3,0,24,8,-8,-4,0,24,7,-7,-3,1,0,9,-7,-4,0,24,7,-6,-3,1,1,9,-6,-4,0,24,7,-5,-3,1,2,9,-5,-4,0,25,7,-6,-2,0,24,7,-5,-2,1,2,10,-6,-1,1,1,11,-4,-3,0,24,7,-3,-3,0,25,7,-7,-2,1,0,10,-7,-1,1,0,11],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[3,-4,1,5,5,3,-3,1,5,6,2,-4,1,5,5,2,-3,1,5,6,3,-2,1,10,5,3,-1,1,10,6,-3,4,1,10,5,-3,5,1,10,6,2,4,1,10,5,2,5,1,10,6,0,-1,1,18,12,1,-1,1,19,12,1,-2,1,19,11,0,-2,1,18,11,-6,4,1,18,12,-5,4,1,19,12,-5,3,1,19,11,-6,3,1,18,11,4,2,1,12,13,4,3,1,12,14,-6,-3,1,12,13,-6,-2,1,12,14,6,-3,1,15,13,7,-3,1,16,13,7,-2,1,16,14,6,-2,1,15,14,-1,3,1,15,13,0,3,1,16,13,0,4,1,16,14,-1,4,1,15,14],"CustomMiddle2":[-2,-4,1,14,4,-2,-3,1,14,5,-1,-3,1,15,5,-1,-4,1,15,4,-4,1,1,14,4,-4,2,1,14,5,-3,2,1,15,5,-3,1,1,15,4,7,2,1,13,6,-6,1,1,14,6,-4,-3,1,8,11,-4,7,1,6,11,5,-4,1,6,0,5,-3,1,6,1,-2,-1,1,5,0,-2,0,1,5,1],"CustomTop":[]} \ No newline at end of file +{"NavigationVertices":[{"X":138,"Y":-42},{"X":138,"Y":82},{"X":134,"Y":22},{"X":134,"Y":-14},{"X":58,"Y":82},{"X":54,"Y":54},{"X":74,"Y":38},{"X":118,"Y":38},{"X":22,"Y":118},{"X":58,"Y":130},{"X":-58,"Y":130},{"X":-22,"Y":118},{"X":-26,"Y":22},{"X":-26,"Y":-14},{"X":-22,"Y":18},{"X":-22,"Y":54},{"X":54,"Y":18},{"X":74,"Y":2},{"X":22,"Y":82},{"X":-58,"Y":98},{"X":-22,"Y":82},{"X":90,"Y":-42},{"X":90,"Y":-14},{"X":90,"Y":2},{"X":-42,"Y":-42},{"X":118,"Y":22},{"X":-42,"Y":-58},{"X":90,"Y":-58},{"X":-86,"Y":-14},{"X":-106,"Y":-42},{"X":-106,"Y":98},{"X":-86,"Y":22}],"NavigationPolygon":[[0,1,2,3],[4,5,6,7,1],[8,9,10,11],[12,13,14,15],[6,5,16,17],[4,9,8,18,5],[11,10,19,20],[21,0,3,22],[22,23,17,24],[7,25,2,1],[15,5,18,20],[24,26,27,21],[24,21,22],[24,17,16,13],[16,14,13],[24,13,28,29],[30,29,28,31],[19,30,31,12,15,20]],"Floor":[-3,-4,0,3,-2,-4,0,3,-2,-3,0,3,-3,-3,0,3,-7,-3,0,3,-7,-2,0,3,-7,-1,0,3,-7,0,0,3,-7,1,0,3,-7,2,0,3,-7,3,0,3,-7,4,0,3,-7,5,0,3,-6,-3,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,4,0,3,8,-3,0,3,8,-2,0,3,8,-1,0,3,8,0,0,3,8,1,0,3,8,2,0,3,8,3,0,3,8,4,0,3],"Middle":[-7,-5,63,1,-7,-4,2,2,-6,-5,63,1,-6,-4,2,2,-5,-5,63,1,-5,-4,2,2,-5,-1,48,1,-5,0,1,2,-4,-5,27,1,-4,-4,3,2,-4,-1,56,1,-4,0,2,2,-3,-6,63,1,-3,-5,2,2,-3,-1,24,1,-3,0,3,2,-2,-6,63,1,-2,-5,2,2,-1,-6,63,1,-1,-5,2,2,-1,1,48,1,-1,2,1,2,-1,5,48,1,-1,6,1,2,0,-6,63,1,0,-5,2,2,0,1,56,1,0,2,2,2,0,5,24,1,0,6,3,2,1,-6,63,1,1,-5,2,2,1,1,56,1,1,2,2,2,2,-6,63,1,2,-5,2,2,2,1,24,1,2,2,3,2,3,-6,63,1,3,-5,2,2,4,-6,63,1,4,-5,2,2,5,-6,63,1,5,-5,2,2,5,0,48,1,5,1,1,2,6,-5,54,1,6,-4,1,2,6,0,26,1,6,1,3,2,7,-5,63,1,7,-4,2,2,7,-1,24,1,7,0,3,2,8,-5,63,1,8,-4,2,2],"Top":[-9,-6,511,1,-9,-5,511,1,-9,-4,511,1,-9,-3,511,1,-9,-2,511,1,-9,-1,511,1,-9,0,511,1,-9,1,511,1,-9,2,511,1,-9,3,511,1,-9,4,511,1,-9,5,511,1,-9,6,511,1,-9,7,511,1,-8,-6,511,1,-8,-5,255,1,-8,-4,219,1,-8,-3,219,1,-8,-2,219,1,-8,-1,219,1,-8,0,219,1,-8,1,219,1,-8,2,219,1,-8,3,219,1,-8,4,219,1,-8,5,219,1,-8,6,507,1,-8,7,511,1,-7,-6,511,1,-7,6,504,1,-7,7,511,1,-6,-6,511,1,-6,6,504,1,-6,7,511,1,-6,8,511,1,-6,9,511,1,-5,-7,511,1,-5,-6,511,1,-5,6,216,1,-5,7,219,1,-5,8,507,1,-5,9,511,1,-4,-7,511,1,-4,-6,255,1,-4,8,504,1,-4,9,511,1,-3,-7,511,1,-3,8,504,1,-3,9,511,1,-2,-7,511,1,-2,8,504,1,-2,9,511,1,-1,-7,511,1,-1,8,504,1,-1,9,511,1,0,-7,511,1,0,8,504,1,0,9,511,1,1,-7,511,1,1,8,504,1,1,9,511,1,2,-7,511,1,2,8,504,1,2,9,511,1,3,-7,511,1,3,8,504,1,3,9,511,1,4,-7,511,1,4,5,432,1,4,6,438,1,4,7,438,1,4,8,510,1,4,9,511,1,5,-7,511,1,5,5,504,1,5,6,511,1,5,7,511,1,5,8,511,1,5,9,511,1,6,-7,511,1,6,-6,447,1,6,-1,176,1,6,5,504,1,6,6,511,1,7,-7,511,1,7,-6,511,1,7,5,504,1,7,6,511,1,8,-6,511,1,8,5,504,1,8,6,511,1,9,-6,511,1,9,-5,447,1,9,-4,438,1,9,-3,438,1,9,-2,438,1,9,-1,438,1,9,0,438,1,9,1,438,1,9,2,438,1,9,3,438,1,9,4,438,1,9,5,510,1,9,6,511,1,10,-6,511,1,10,-5,511,1,10,-4,511,1,10,-3,511,1,10,-2,511,1,10,-1,511,1,10,0,511,1,10,1,511,1,10,2,511,1,10,3,511,1,10,4,511,1,10,5,511,1,10,6,511,1],"CustomFloor1":[-2,-3,1,6,14,-1,-3,1,7,14,-4,2,1,7,14,-3,3,1,8,15,-4,3,1,7,15,-5,3,1,6,15,6,4,1,8,15,5,4,1,7,15,-14,-6,0,24,7,-14,-5,0,24,7,-13,-5,0,24,7,-13,-6,0,25,7,-14,-4,0,24,8,-13,-4,0,24,8,-12,-4,0,24,8,-12,-5,0,24,7,-11,-4,0,24,8,-11,-5,0,24,7,-10,-4,0,24,7,-10,-5,0,24,7,-9,-4,0,24,7,-9,-5,0,25,7,-10,-3,0,24,8,-9,-3,0,24,8,-8,-3,0,24,8,-8,-4,0,24,7,-7,-3,1,0,9,-7,-4,0,24,7,-6,-3,1,1,9,-6,-4,0,24,7,-5,-3,1,2,9,-5,-4,0,25,7,-6,-2,0,24,7,-5,-2,1,2,10,-6,-1,1,1,11,-4,-3,0,24,7,-3,-3,0,25,7,-7,-2,1,0,10,-7,-1,1,0,11,-5,2,1,6,14,4,3,1,6,14,4,4,1,6,15,6,3,1,8,14,5,3,1,7,14],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[3,-4,1,5,5,3,-3,1,5,6,2,-4,1,5,5,2,-3,1,5,6,3,-2,1,10,5,3,-1,1,10,6,-3,4,1,10,5,-3,5,1,10,6,2,4,1,10,5,2,5,1,10,6,0,-1,1,18,12,1,-1,1,19,12,1,-2,1,19,11,0,-2,1,18,11,-6,4,1,18,12,-5,4,1,19,12,-5,3,1,19,11,-6,3,1,18,11,4,2,1,12,13,4,3,1,12,14,-6,-3,1,12,13,-6,-2,1,12,14,6,-3,1,15,13,7,-3,1,16,13,7,-2,1,16,14,6,-2,1,15,14,-1,3,1,15,13,0,3,1,16,13,0,4,1,16,14,-1,4,1,15,14],"CustomMiddle2":[-2,-4,1,14,4,-2,-3,1,14,5,-1,-3,1,15,5,-1,-4,1,15,4,-4,1,1,14,4,-4,2,1,14,5,-3,2,1,15,5,-3,1,1,15,4,7,2,1,13,6,-6,1,1,14,6,-4,-3,1,8,11,-4,7,1,6,11,5,-4,1,6,0,5,-3,1,6,1,-2,-1,1,5,0,-2,0,1,5,1],"CustomTop":[]} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/event/EventEnum.cs b/DungeonShooting_Godot/src/game/event/EventEnum.cs index 5b325b5..d526ae0 100644 --- a/DungeonShooting_Godot/src/game/event/EventEnum.cs +++ b/DungeonShooting_Godot/src/game/event/EventEnum.cs @@ -80,6 +80,10 @@ /// OnCreateGroupFinish, /// + /// 删除地牢组完成时调用, 参数为 + /// + OnDeleteGroupFinish, + /// /// 创建地牢房间完成时调用, 参数为 /// OnCreateRoomFinish, diff --git a/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs b/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs index c4e9a45..e64a4ef 100644 --- a/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs +++ b/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs @@ -1,5 +1,6 @@  using System; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; @@ -53,7 +54,6 @@ /// 关闭回调, 回调参数为选择的文件路径, 如果选择文件, 则回调参数为null public static void ShowOpenFileDialog(string[] filters, Action onClose) { - //UiManager.Open_EditorFileDialog(); var fileDialog = new FileDialog(); fileDialog.UseNativeDialog = true; fileDialog.ModeOverridesTitle = false; @@ -111,7 +111,7 @@ /// 显示内容 /// 关闭时的回调, 参数如果为 true 表示点击了确定 /// 所属父级Ui - public static void ShowConfirm(string title, string message, Action onClose, UiBase parentUi = null) + public static EditorWindowPanel ShowConfirm(string title, string message, Action onClose, UiBase parentUi = null) { var window = CreateWindowInstance(parentUi); window.SetWindowTitle(title); @@ -132,6 +132,25 @@ ); var body = window.OpenBody(UiManager.UiNames.EditorTips); body.SetMessage(message); + return window; + } + + /// + /// 弹出延时询问窗口 + /// + /// 标题 + /// 显示内容 + /// 延时时间 + /// 关闭时的回调, 参数如果为 true 表示点击了确定 + /// 所属父级Ui + public static void ShowDelayConfirm(string title, string message, float delayTime, Action onClose, UiBase parentUi = null) + { + var window = ShowConfirm(title, message, onClose, parentUi); + if (delayTime > 0) + { + var uiCell = (CustomButtonCell)window.ButtonGrid.GetCell(0); + window.StartCoroutine(DelayTimeLabel(delayTime, uiCell.CellNode.L_Button.Instance)); + } } /// @@ -823,4 +842,18 @@ return UiManager.Open_EditorWindow(); } + + private static IEnumerator DelayTimeLabel(float time, Button button) + { + var text = button.Text; + button.Disabled = true; + for (float i = time; i >= 0; i -= 1) + { + button.Text = $"{text}({(int)i}秒)"; + yield return new WaitForSeconds(1); + } + + button.Text = text; + button.Disabled = false; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/MapProjectManager.cs b/DungeonShooting_Godot/src/game/manager/MapProjectManager.cs index 5dfcc65..fea4640 100644 --- a/DungeonShooting_Godot/src/game/manager/MapProjectManager.cs +++ b/DungeonShooting_Godot/src/game/manager/MapProjectManager.cs @@ -128,6 +128,33 @@ } /// + /// 根据名称删除地牢组 + /// + public static void DeleteGroup(string name) + { + if (GroupMap.Remove(name)) + { + try + { + //删除文件 + var path = CustomMapPath + name; + if (Directory.Exists(path)) + { + Directory.Delete(path, true); + } + } + catch (Exception e) + { + Debug.LogError(e); + } + //将组数据保存为json + SaveGroupMap(); + //删除地牢组事件 + EventManager.EmitEvent(EventEnum.OnDeleteGroupFinish, name); + } + } + + /// /// 创建地牢房间 /// public static void CreateRoom(DungeonRoomSplit roomSplit) diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index 2721a55..b16c876 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -225,9 +225,10 @@ //创建世界场景 World = GameApplication.Instance.CreateNewWorld(); yield return 0; - + var group = GameApplication.Instance.RoomConfig[CurrConfig.GroupName]; + var tileSetSplit = GameApplication.Instance.TileSetConfig[group.TileSet]; + World.TileRoot.TileSet = tileSetSplit.GetTileSet(); //填充地牢 - var tileSetSplit = GameApplication.Instance.TileSetConfig.First().Value; AutoTileConfig = new AutoTileConfig(0, tileSetSplit.TileSetInfo.Sources[0].Terrain[0]); _dungeonTileMap = new DungeonTileMap(World.TileRoot); yield return _dungeonTileMap.AutoFillRoomTile(AutoTileConfig, _dungeonGenerator.StartRoomInfo, random); diff --git a/DungeonShooting_Godot/src/game/room/World.cs b/DungeonShooting_Godot/src/game/room/World.cs index 8c7bef9..73ab5ec 100644 --- a/DungeonShooting_Godot/src/game/room/World.cs +++ b/DungeonShooting_Godot/src/game/room/World.cs @@ -72,10 +72,6 @@ public override void _Ready() { Color = Colors.Black; - - //临时处理, 加载TileSet - var tileSet = GameApplication.Instance.TileSetConfig.First().Value.GetTileSet(); - TileRoot.TileSet = tileSet; //TileRoot.YSortEnabled = false; } diff --git a/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindowPanel.cs b/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindowPanel.cs index 2eae731..d6054cd 100644 --- a/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindowPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindowPanel.cs @@ -29,7 +29,10 @@ /// public event Action CloseEvent; - private UiGrid _uiGrid; + /// + /// 设置按钮列表 + /// + public UiGrid ButtonGrid { get; private set; } public override void OnCreateUi() { @@ -42,14 +45,14 @@ /// public void SetButtonList(params ButtonData[] buttons) { - if (_uiGrid == null) + if (ButtonGrid == null) { S_CustomButton.Instance.Visible = true; - _uiGrid = CreateUiGrid(S_CustomButton); - _uiGrid.SetHorizontalExpand(true); + ButtonGrid = CreateUiGrid(S_CustomButton); + ButtonGrid.SetHorizontalExpand(true); } - _uiGrid.SetColumns(buttons.Length); - _uiGrid.SetDataList(buttons); + ButtonGrid.SetColumns(buttons.Length); + ButtonGrid.SetDataList(buttons); } /// diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs index 4fcaa16..2b3e0d8 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs @@ -8,10 +8,16 @@ public partial class MapEditorProjectPanel : MapEditorProject { - //当前显示的组数据 - private UiGrid _groupGrid; - //当前显示的房间数据 - private UiGrid _roomGrid; + /// + /// 当前显示的组数据 + /// + public UiGrid GroupGrid { get; private set; } + + /// + /// 当前显示的房间数据 + /// + public UiGrid RoomGrid { get; private set; } + private EventFactory _eventFactory; public override void OnCreateUi() @@ -23,29 +29,32 @@ for (var i = 0; i < roomTypes.Length; i++) { var dungeonRoomType = roomTypes[i]; - optionButton.AddItem(DungeonManager.DungeonRoomTypeToDescribeString(dungeonRoomType), (int)dungeonRoomType + 1); + optionButton.AddItem(DungeonManager.DungeonRoomTypeToDescribeString(dungeonRoomType), + (int)dungeonRoomType + 1); } - _groupGrid = new UiGrid(S_GroupButton, typeof(GroupButtonCell)); - _groupGrid.SetCellOffset(new Vector2I(0, 2)); - _groupGrid.SetHorizontalExpand(true); + GroupGrid = new UiGrid(S_GroupButton, typeof(GroupButtonCell)); + GroupGrid.SetCellOffset(new Vector2I(0, 2)); + GroupGrid.SetHorizontalExpand(true); - _roomGrid = new UiGrid(S_RoomButton, typeof(RoomButtonCell)); - _roomGrid.SetAutoColumns(true); - _roomGrid.SetCellOffset(new Vector2I(10, 10)); - _roomGrid.SetHorizontalExpand(true); - + RoomGrid = new UiGrid(S_RoomButton, typeof(RoomButtonCell)); + RoomGrid.SetAutoColumns(true); + RoomGrid.SetCellOffset(new Vector2I(10, 10)); + RoomGrid.SetHorizontalExpand(true); + S_GroupSearchButton.Instance.Pressed += OnSearchGroupButtonClick; S_GroupEditButton.Instance.Pressed += OnEditGroup; S_GroupAddButton.Instance.Pressed += OnCreateGroupClick; - + S_GroupDeleteButton.Instance.Pressed += OnDeleteGroup; + S_RoomSearchButton.Instance.Pressed += OnSearchRoomButtonClick; S_RoomAddButton.Instance.Pressed += OnCreateRoomClick; S_RoomEditButton.Instance.Pressed += OnEditRoom; S_RoomDeleteButton.Instance.Pressed += OnDeleteRoom; - + _eventFactory = EventManager.CreateEventFactory(); _eventFactory.AddEventListener(EventEnum.OnCreateGroupFinish, OnCreateGroupFinish); + _eventFactory.AddEventListener(EventEnum.OnDeleteGroupFinish, OnDeleteGroupFinish); _eventFactory.AddEventListener(EventEnum.OnCreateRoomFinish, OnCreateRoomFinish); } @@ -59,11 +68,11 @@ { _eventFactory.RemoveAllEventListener(); _eventFactory = null; - _groupGrid.Destroy(); - _groupGrid = null; - - _roomGrid.Destroy(); - _roomGrid = null; + GroupGrid.Destroy(); + GroupGrid = null; + + RoomGrid.Destroy(); + RoomGrid = null; } /// @@ -94,15 +103,16 @@ //加载地牢 mapEditor.LoadMap(room, tileSetSplit); } - + //搜索组按钮点击 private void OnSearchGroupButtonClick() { - var select = _groupGrid.SelectIndex; + var select = GroupGrid.SelectIndex; if (select < 0) { select = 0; } + //输入文本 var text = S_GroupSearchInput.Instance.Text; if (!string.IsNullOrEmpty(text)) @@ -116,14 +126,15 @@ list.Add(valuePair.Value); } } - _groupGrid.SetDataList(list.ToArray()); + + GroupGrid.SetDataList(list.ToArray()); } else { - _groupGrid.SetDataList(MapProjectManager.GroupMap.Values.ToArray()); + GroupGrid.SetDataList(MapProjectManager.GroupMap.Values.ToArray()); } - _groupGrid.SelectIndex = select; + GroupGrid.SelectIndex = select; } //搜索房间按钮点击 @@ -137,7 +148,7 @@ var roomType = S_RoomTypeButton.Instance.GetSelectedId(); IEnumerable result = EditorTileMapManager.SelectDungeonGroup.GetAllRoomList(); - + //名称搜索 if (!string.IsNullOrEmpty(text)) { @@ -154,12 +165,12 @@ var type = (DungeonRoomType)(roomType - 1); result = result.Where(split => split.RoomInfo.RoomType == type); } - - _roomGrid.SetDataList(result.ToArray()); + + RoomGrid.SetDataList(result.ToArray()); } else { - _roomGrid.RemoveAll(); + RoomGrid.RemoveAll(); } } @@ -172,28 +183,43 @@ //编辑组按钮点击 private void OnEditGroup() { - if (_groupGrid.SelectIndex != -1) + if (GroupGrid.SelectIndex != -1) { - EditorWindowManager.ShowEditGroup(_groupGrid.SelectData, EditGroup); + EditorWindowManager.ShowEditGroup(GroupGrid.SelectData, EditGroup); } else { EditorWindowManager.ShowTips("提示", "请选择需要编辑的组!"); } } - + + //删除组按钮点击 + private void OnDeleteGroup() + { + if (GroupGrid.SelectIndex != -1) + { + EditorWindowManager.ShowDelayConfirm("提示", "确定删除该组吗?\n该操作不可取消!", 5, DeleteGroup); + } + else + { + EditorWindowManager.ShowTips("提示", "请选择需要删除的组!"); + } + } + //创建地牢房间按钮点击 private void OnCreateRoomClick() { - var groupName = EditorTileMapManager.SelectDungeonGroup != null ? EditorTileMapManager.SelectDungeonGroup.GroupName : null; + var groupName = EditorTileMapManager.SelectDungeonGroup != null + ? EditorTileMapManager.SelectDungeonGroup.GroupName + : null; EditorWindowManager.ShowCreateRoom(groupName, Mathf.Max(S_RoomTypeButton.Instance.Selected - 1, 0), CreateRoom); } - - + + //编辑房间 private void OnEditRoom() { - var selectRoom = _roomGrid.SelectData; + var selectRoom = RoomGrid.SelectData; if (selectRoom == null) { EditorWindowManager.ShowTips("提示", "请选择需要编辑的房间!"); @@ -208,18 +234,18 @@ }); } } - + //删除房间 private void OnDeleteRoom() { - var selectRoom = _roomGrid.SelectData; + var selectRoom = RoomGrid.SelectData; if (selectRoom == null) { EditorWindowManager.ShowTips("提示", "请选择需要删除的房间!"); } else { - EditorWindowManager.ShowConfirm("提示", $"是否删除房间: {selectRoom.RoomInfo.RoomName}, 该操作无法撤销!", result => + EditorWindowManager.ShowDelayConfirm("提示", $"是否删除房间: {selectRoom.RoomInfo.RoomName}, 该操作无法撤销!", 3, result => { if (result) { @@ -245,7 +271,13 @@ { MapProjectManager.SaveGroupMap(); } - + + //删除地牢组 + private void DeleteGroup(bool v) + { + MapProjectManager.DeleteGroup(GroupGrid.SelectData.GroupName); + } + //创建房间 private void CreateRoom(DungeonRoomSplit roomSplit) { @@ -258,7 +290,13 @@ OnSearchGroupButtonClick(); } - //创建地牢房间完成 + //删除地牢组完成 + private void OnDeleteGroupFinish(object group) + { + OnSearchGroupButtonClick(); + } + +//创建地牢房间完成 private void OnCreateRoomFinish(object roomSplit) { OnSearchRoomButtonClick(); diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs index 9419874..9a12446 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs @@ -47,8 +47,8 @@ public override void OnDoubleClick() { - //打开房间编辑器, 临时处理加载TileSet - var tileSetSplit = GameApplication.Instance.TileSetConfig.First().Value; + //加载TileSet + var tileSetSplit = GameApplication.Instance.TileSetConfig[CellNode.UiPanel.GroupGrid.SelectData.TileSet]; //判断tileSet是否可以使用 if (string.IsNullOrEmpty(tileSetSplit.TileSetInfo.Sources[0].SourcePath)) { diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs index d99ae3d..9de3524 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs @@ -109,10 +109,18 @@ } var tileSetSplit = Grid.SelectData; - //这里要判断是否引用, 后面再做 + //这里要判断是否引用 + foreach (var dungeonRoomGroup in GameApplication.Instance.RoomConfig) + { + if (dungeonRoomGroup.Value.TileSet == tileSetSplit.TileSetInfo.Name) + { + EditorWindowManager.ShowTips("提示", $"该TileSet被'{dungeonRoomGroup.Key}'地牢组使用,不能删除!"); + return; + } + } //删除数据 - EditorWindowManager.ShowConfirm("提示", "确认删除该TileSet吗,删除后无法恢复!", (v) => + EditorWindowManager.ShowDelayConfirm("提示", "确认删除该TileSet吗,删除后无法恢复!", 5, (v) => { if (v) { diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs index d431700..15d2760 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs @@ -22,7 +22,11 @@ { get { - var terrain = EditorPanel.TileSetSourceInfo.Terrain; + var terrain = EditorPanel.TileSetSourceInfo?.Terrain; + if (terrain == null) + { + return null; + } if (CurrTerrainIndex < 0 || CurrTerrainIndex >= terrain.Count) { return null;