diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json index e01ee7b..119a4eb 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json @@ -1 +1 @@ -[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":47,"Y":22},"Size":{"X":16,"Y":16},"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"}}]}],[{"Position":{"X":0,"Y":0},"Size":{"X":16,"Y":16},"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"}}]}]]},{"Name":"test2","Weight":100,"Remark":"","WaveList":[[]]}] \ No newline at end of file +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":20,"Y":-32},"Size":{"X":92,"Y":134},"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"}}]}],[{"Position":{"X":61,"Y":34},"Size":{"X":86,"Y":72},"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"}}]}]]},{"Name":"test2","Weight":100,"Remark":"","WaveList":[[]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Icon.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Icon.png.import new file mode 100644 index 0000000..1ed803e --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8doglpj4hmes" +path="res://.godot/imported/Enemy0001_Icon.png-d471a4b79cc3353b9c770dc482e4deec.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/enemy0001/Enemy0001_Icon.png" +dest_files=["res://.godot/imported/Enemy0001_Icon.png-d471a4b79cc3353b9c770dc482e4deec.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/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import new file mode 100644 index 0000000..5dc61b5 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddhkhfaos2w1g" +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-1247a3ddf8a1a163d812cad12c4340fd.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/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import new file mode 100644 index 0000000..2f4c450 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cn64eauvwx1uj" +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-297a2fb6680cb862a9a085cf58f8268c.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/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkAreaTool.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkAreaTool.cs index d96a5a3..25022ac 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkAreaTool.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkAreaTool.cs @@ -43,6 +43,8 @@ _toolRoot = toolRoot; _markTool = markTool; _markInfo = markTool.MarkInfo; + _startWidth = _markInfo.Size.X; + _startHeight = _markInfo.Size.Y; } public override void _Process(double delta) @@ -58,6 +60,13 @@ { if (!Input.IsMouseButtonPressed(MouseButton.Left)) //松开拖拽 { + if (_markInfo.Size.X != _startWidth || _markInfo.Size.Y != _startHeight) + { + _startWidth = _markInfo.Size.X; + _startHeight = _markInfo.Size.Y; + //派发修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } IsDrag = false; } else //拖拽中 diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkTool.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkTool.cs index 9b3a803..271ee4f 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkTool.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkTool.cs @@ -23,6 +23,7 @@ private bool _isDown; private Vector2 _offset; private MarkAreaTool _markAreaToolUp; + private Vector2 _startPos; public void SetUiNode(IUiNode uiNode) { @@ -51,6 +52,13 @@ { _isDown = false; IsDrag = false; + //移动过, 就派发修改事件 + var pos = GlobalPosition; + if (_startPos != pos) + { + _startPos = pos; + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } } } else if (_enter && !_isDown) @@ -71,6 +79,7 @@ { _offset = GlobalPosition - GetGlobalMousePosition(); IsDrag = true; + _startPos = GlobalPosition; } } } @@ -102,6 +111,7 @@ { MarkInfo = markInfo; Position = markInfo.Position.AsVector2() - (Size / 2).Ceil(); + _startPos = GlobalPosition; _markAreaToolUp.InitData(_toolNode.UiPanel.S_ToolRoot, this); }