diff --git a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn index 2e6a5b1..bb37d00 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://src/game/ui/mapEditor/MapEditorPanel.cs" id="1_5s7a0"] [ext_resource type="Texture2D" uid="uid://cajcnlimvoxk" path="res://resource/sprite/ui/commonIcon/Back.png" id="2_gkcw7"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="2_vrg60"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_vrg60"] [ext_resource type="Texture2D" uid="uid://cat35d7ueu7gu" path="res://resource/sprite/ui/commonIcon/Save.png" id="3_qq8k4"] [ext_resource type="Texture2D" uid="uid://7l7aqhsaexoh" path="res://resource/sprite/ui/commonIcon/Play.png" id="4_2imnr"] [ext_resource type="Texture2D" uid="uid://0878uloew5jo" path="res://resource/sprite/ui/mapEditor/ErrorCell.png" id="4_465u2"] @@ -221,6 +221,10 @@ [node name="MapEditorTools" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer/MapView/SubViewport/CanvasLayer" instance=ExtResource("6_7pvgu")] +[node name="MapView2" type="TextureRect" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer"] +visible = false +layout_mode = 2 + [node name="Right" type="Panel" parent="Bg/VBoxContainer/HSplitContainer"] custom_minimum_size = Vector2(300, 0) layout_mode = 2 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn index c13ed68..a5f72c9 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn @@ -184,7 +184,7 @@ offset_left = 2.0 offset_top = 2.0 offset_right = -2.0 -offset_bottom = -85.0 +offset_bottom = -87.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 @@ -237,7 +237,7 @@ [node name="ErrorTexture" type="TextureRect" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/ScrollContainer/RoomButton"] layout_mode = 0 offset_left = 157.0 -offset_top = 159.0 +offset_top = 158.0 offset_right = 197.0 -offset_bottom = 199.0 +offset_bottom = 198.0 texture = ExtResource("9_xrt38") diff --git a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json index de2d899..1fc1e12 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json @@ -48,16 +48,5 @@ "ShopList": [], "EventList": [], "Remark": "\u6D4B\u8BD5\u7EC4" - }, - "TestGroup2": { - "GroupName": "TestGroup2", - "BattleList": [], - "InletList": [], - "OutletList": [], - "BossList": [], - "RewardList": [], - "ShopList": [], - "EventList": [], - "Remark": "\u6D4B\u8BD5\u7EC4" } } \ 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 bd1d3bd..b4b3ffb 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 +1 @@ -{"NavigationList":[{"Type":0,"Points":[-24,-184,88,-184,88,-168,120,-168,120,-96,56,-96,56,-64,40,-64,40,-8,104,-8,104,-56,120,-56,120,64,72,64,72,104,120,104,120,128,24,128,24,104,56,104,56,64,8,64,8,0,-56,0,-56,80,-72,80,-72,-168,-24,-168]},{"Type":1,"Points":[-56,-64,8,-64,8,-24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0,2,2,7,4,0,2,2,7,8,0,2,2,8,-12,0,1,4,8,-11,0,1,3,8,-10,0,1,3,8,-9,0,1,3,8,-8,0,1,3,8,-7,0,1,3,8,-6,0,13,2,8,-5,0,1,4,8,-4,0,1,3,8,-3,0,1,3,8,-2,0,1,3,8,-1,0,1,3,8,0,0,1,3,8,1,0,1,3,8,2,0,1,3,8,3,0,1,3,8,4,0,13,2,8,5,0,1,4,8,6,0,1,3,8,7,0,1,3,8,8,0,13,2]} \ No newline at end of file +{"NavigationList":[{"Type":0,"Points":[-24,-184,88,-184,88,-168,120,-168,120,-96,56,-96,56,-64,40,-64,40,-8,104,-8,104,-56,120,-56,120,64,72,64,72,104,120,104,120,128,24,128,24,104,56,104,56,64,8,64,8,0,-56,0,-56,80,-72,80,-72,-168,-24,-168]},{"Type":1,"Points":[-56,-64,8,-64,8,-24,-56,-24]}],"Floor":[-5,4,0,0,8,-5,-11,0,0,8,-5,-5,0,0,8,-5,-4,0,0,8,-5,-3,0,0,8,-5,-2,0,0,8,-5,-1,0,0,8,-5,0,0,0,8,-5,1,0,0,8,-5,2,0,0,8,-5,3,0,0,8,-5,-6,0,0,8,-5,-7,0,0,8,-5,-8,0,0,8,-5,-9,0,0,8,-5,-10,0,0,8,-4,-11,0,0,8,-4,-5,0,0,8,-4,-4,0,0,8,-4,-3,0,0,8,-4,-2,0,0,8,-4,-1,0,0,8,-4,0,0,0,8,-4,1,0,0,8,-4,2,0,0,8,-4,3,0,0,8,-4,-6,0,0,8,-4,-7,0,0,8,-4,-8,0,0,8,-4,-10,0,0,8,-4,-9,0,0,8,-4,4,0,0,8,-3,-5,0,0,8,-3,-11,0,0,8,-3,-2,0,0,8,-3,-1,0,0,8,-3,-7,0,0,8,-3,-6,0,0,8,-3,-8,0,0,8,-3,-10,0,0,8,-3,-9,0,0,8,-2,-8,0,0,8,-2,-9,0,0,8,-2,-12,0,0,8,-2,-5,0,0,8,-2,-6,0,0,8,-2,-2,0,0,8,-2,-1,0,0,8,-2,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4,0,1,2,-3,0,0,1,2,-3,1,0,1,3,-3,2,0,1,3,-3,3,0,1,3,-3,4,0,1,3,-3,5,0,13,2,-2,-4,0,2,2,-2,0,0,2,2,-1,-4,0,3,2,-1,0,0,3,2,-1,1,0,3,3,-1,2,0,3,3,-1,3,0,3,3,-1,4,0,11,2,0,4,0,2,2,0,5,0,3,4,0,6,0,3,3,0,7,0,3,3,0,8,0,11,2,1,4,0,2,2,1,8,0,2,2,2,4,0,3,2,2,8,0,2,2,3,-4,0,1,2,3,-3,0,1,3,3,8,0,2,2,4,-6,0,1,2,4,-5,0,1,3,4,-4,0,13,2,4,8,0,2,2,5,-6,0,2,2,5,-5,0,3,4,5,-4,0,3,3,5,-3,0,3,3,5,4,0,1,2,5,8,0,2,2,6,-13,0,1,4,6,-6,0,2,2,6,4,0,2,2,6,8,0,2,2,7,-6,0,2,2,7,4,0,2,2,7,8,0,2,2,8,-12,0,1,4,8,-11,0,1,3,8,-10,0,1,3,8,-9,0,1,3,8,-8,0,1,3,8,-7,0,1,3,8,-6,0,13,2,8,-5,0,1,4,8,-4,0,1,3,8,-3,0,1,3,8,-2,0,1,3,8,-1,0,1,3,8,0,0,1,3,8,1,0,1,3,8,2,0,1,3,8,3,0,1,3,8,4,0,13,2,8,5,0,1,4,8,6,0,1,3,8,7,0,1,3,8,8,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import index 7e5d2de..5dc61b5 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://ddhkhfaos2w1g" -path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex" +path="res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/enemy0001/Enemy0001.png" -dest_files=["res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex"] +source_file="res://resource/sprite/role/enemy0001/enemy0001.png" +dest_files=["res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import index aa89659..2f4c450 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cn64eauvwx1uj" -path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex" +path="res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/enemy0001/Enemy0001_Debris.png" -dest_files=["res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex"] +source_file="res://resource/sprite/role/enemy0001/enemy0001_Debris.png" +dest_files=["res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex"] [params] diff --git a/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs b/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs index 867235f..ffd97ec 100644 --- a/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs +++ b/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs @@ -179,7 +179,6 @@ var startTime = DateTime.Now; //File.WriteAllBytes("d:/image.png", image.SavePngToBuffer()); //绘制完成需要调用回调的列表 - var index = 0; do { var item = _drawingQueueItems.Dequeue(); @@ -188,7 +187,6 @@ redrawCanvas.Add(item.ImageCanvas); //处理绘图 HandleDrawing(image, item); - index++; if (item.OnDrawingComplete != null) { if (callDrawingCompleteList == null) @@ -245,7 +243,6 @@ var startTime = DateTime.Now; var hasFail = false; //执行绘制操作 - var index = 0; for (var i = 0; i < _queueItems.Count; i++) { var item = _queueItems[i]; @@ -260,7 +257,6 @@ { _queueItems.RemoveAt(i); i--; - index++; } else //进入渲染队列失败 { diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs index aaf67ac..01274ad 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs @@ -334,6 +334,15 @@ } /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView2 + /// + public class MapView2 : UiNode + { + public MapView2(MapEditorPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override MapView2 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer /// public class MarginContainer : UiNode @@ -351,6 +360,19 @@ } private MapView _L_MapView; + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MapView2 + /// + public MapView2 L_MapView2 + { + get + { + if (_L_MapView2 == null) _L_MapView2 = new MapView2(UiPanel, Instance.GetNode("MapView2")); + return _L_MapView2; + } + } + private MapView2 _L_MapView2; + public MarginContainer(MapEditorPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); } @@ -696,6 +718,11 @@ public MapView S_MapView => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView; /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView2 + /// + public MapView2 S_MapView2 => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView2; + + /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left /// public Left S_Left => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 239f55c..6934073 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.Text.Json; using Godot; @@ -166,8 +167,16 @@ _eventFactory.AddEventListener(EventEnum.OnSelectEditTool, _editorTileMap.Instance.OnSelectEditTool); _eventFactory.AddEventListener(EventEnum.OnClickCenterTool, _editorTileMap.Instance.OnClickCenterTool); _eventFactory.AddEventListener(EventEnum.OnEditorDirty, _editorTileMap.Instance.OnEditorDirty); + + RenderingServer.FramePostDraw += OnFramePostDraw; } + public void OnDestroy() + { + _eventFactory.RemoveAllEventListener(); + RenderingServer.FramePostDraw -= OnFramePostDraw; + } + public override void _Ready() { InitLayer(); @@ -440,14 +449,19 @@ public void TriggerSave(RoomErrorType errorType) { GD.Print("保存地牢房间数据..."); - CurrRoomSplit.ErrorType = errorType; - SaveRoomInfoConfig(); - SaveTileInfoConfig(); - SavePreinstallConfig(); - IsDirty = false; - MapEditorPanel.SetTitleDirty(false); - //派发保存事件 - EventManager.EmitEvent(EventEnum.OnEditorSave); + //执行创建预览图流程 + RunSavePreviewImage(() => + { + //执行保存数据流程 + CurrRoomSplit.ErrorType = errorType; + SaveRoomInfoConfig(); + SaveTileInfoConfig(); + SavePreinstallConfig(); + IsDirty = false; + MapEditorPanel.SetTitleDirty(false); + //派发保存事件 + EventManager.EmitEvent(EventEnum.OnEditorSave); + }); } /// @@ -1001,9 +1015,30 @@ } } } - - public void OnDestroy() + + private void RunSavePreviewImage(Action action) { - _eventFactory.RemoveAllEventListener(); + //先截图, 将图像数据放置到 S_MapView2 节点上 + var subViewport = MapEditorPanel.S_SubViewport.Instance; + var viewportTexture = subViewport.GetTexture(); + var tex = ImageTexture.CreateFromImage(viewportTexture.GetImage()); + var textureRect = MapEditorPanel.S_MapView2.Instance; + textureRect.Texture = tex; + textureRect.Visible = true; + + //隐藏工具栏 + //MapEditorToolsPanel. + + // using (var image = viewportTexture.GetImage()) + // { + // GD.Print("test1:" + image.IsCompressed()); + // image.Resize(196, 196, Image.Interpolation.Lanczos); + // image.SavePng("D:\\test.png"); + // } + } + + private void OnFramePostDraw() + { + } } \ No newline at end of file