diff --git "a/DungeonShooting_Document/\345\274\200\345\217\221\346\227\245\345\277\227.md" "b/DungeonShooting_Document/\345\274\200\345\217\221\346\227\245\345\277\227.md" index 31533114356a84c86ae8d1852660e6568f387d6a..d7a93f1fc7940e9e728f0cae4974a1d65e9c89a3 100644 --- "a/DungeonShooting_Document/\345\274\200\345\217\221\346\227\245\345\277\227.md" +++ "b/DungeonShooting_Document/\345\274\200\345\217\221\346\227\245\345\277\227.md" @@ -1,4 +1,22 @@ +--- +### 2023-09-06 +经过两个月漫长的开发, 新版地牢编辑器初版已经开发完成, 目的为了更加方便开发者和玩家制作地图, 新版地牢编辑器提供功能如下: +* 地牢项目管理功能, 可以管理地牢组和房间, 支持房间预览, 支持显示异常房间, 房间支持配置权重 +* 绘制Tile功能, 并且支持验证Tile是否绘制异常, 自动生成地牢导航网格 +* 配置地牢房间连接区域(门生成区域), 支持验证连接区域是否配置正常 +* 房间预设功能, 运行房间时从多个预设中根据权重随机抽取一个执行标记 +* 编辑波数功能, 编辑标记功能, 标记物体可以配置多个刷新目标, 并从配置的目标中随机抽取一个执行生成物体, 支持配置延时时间 + +除此了地图编辑器以外, 游戏本体还有以下更新: +* 地牢房间数据结构大改 +* 更新ui生成工具, 修复bug, UiPanel支持嵌套打开Ui, 新增大量Api, 例如`Cell`排序, 触发点击`Cell`, 双击`Cell`, 帧函数等, 新增`IUiNodeScript`接口, 用于Ui脚本节点获取该节点的`IUiNode`实例对象 +* 修复拾起武器再扔出时有一定概率将武器反着扔出去的bug +* 地牢房间添加预加载波的概念, 玩家在进入房间前就提前生成好了物体, 玩家在进入后激活这些物体 +* 更改地牢房间关门规则, 进入一个新房间, 该房间没有敌人, 且不会生成敌人, 则不会关门 +* 将随机数对象抽出来, 现在地牢生成和其它系统不在共用同一个随机数对象了, 这样的话在生成地牢时就可以指定随机种子了 +* 协程函数更新, 新增`IsCoroutineOver()`函数来判断一个协程是否执行完成, 协程加入异常捕捉函数, 这样执行一个协程发生异常就不会影响其它协程执行 + --- ### 2023-07-10 本轮主要完成主动和被动道具框架, 并且优化游戏中的Ui, 主要工作内容如下: @@ -56,7 +74,6 @@ * 添加用于调试用的功能: 在`GameApplication.DesignatedRoom`中指定地牢生成的房间, 这样地牢就只会在这个指定的随机池中抽取房间, 方便调试房间 * 添加Ai使用武器属性变化: `AiBulletSpeedScale`, Ai使用该武器发射的子弹速度缩放比; `AiAmmoConsumptionProbability`, Ai使用该武器消耗弹药的概率 ---- --- ### 2023-03-19 本周主要完成Godot编辑器插件扩展, 目的为了更加方便为游戏添加内容, 主要工作内容如有: diff --git "a/DungeonShooting_Document/\351\241\271\347\233\256\345\270\256\345\212\251\346\226\207\346\241\243.md" "b/DungeonShooting_Document/\351\241\271\347\233\256\345\270\256\345\212\251\346\226\207\346\241\243.md" index 3abd9efd1e1051f0d55d01deccd76fcb4847d42d..39bdd3a1eb239d31060aab98b7cdeba88217c639 100644 --- "a/DungeonShooting_Document/\351\241\271\347\233\256\345\270\256\345\212\251\346\226\207\346\241\243.md" +++ "b/DungeonShooting_Document/\351\241\271\347\233\256\345\270\256\345\212\251\346\226\207\346\241\243.md" @@ -1,48 +1,9 @@ 前言: 该文档仅针对`DungeonShooting_Godot`目录下的Godot工程 -第一次编写日期: 2023-04-01 -**注意:** 该文档版本比较老, 已经有很多接口和操作方式被更改但是为同步文档, 请谨慎阅读! +**注意:** 新版文档编写中... 目录: - - * [1.启动项目](#1启动项目) - * [2.项目资源](#2项目资源) - * [2.1.目录结构](#21目录结构) - * [2.2.脚本获取资源](#22脚本获取资源) - * [2.3.重新生成ResourcePath](#23重新生成resourcepath) - * [3.游戏框架](#3游戏框架) - * [3.1.简述](#31简述) - * [3.2.游戏核心系统](#32游戏核心系统) - * [3.2.1.什么是ActivityObject](#321什么是activityobject) - * [3.2.2.什么是Activity模板场景](#322什么是activity模板场景) - * [3.2.3.如何创建ActivityObject](#323如何创建activityobject) - * [第一步, 创建模板场景:](#第一步-创建模板场景-) - * [第二步, 创建脚本:](#第二步-创建脚本-) - * [实例化ActivityObject](#实例化activityobject) - * [3.2.4.自定义RegisterActivity](#324自定义registeractivity) - * [3.2.5.ActivityObject常用功能](#325activityobject常用功能) - * [自定义组件](#自定义组件) - * [运动控制](#运动控制) - * [垂直方向运动](#垂直方向运动) - * [协程](#协程) - * [3.3.地牢](#33地牢) - * [3.3.1.地牢概述](#331地牢概述) - * [3.3.2.创建模板房间](#332创建模板房间) - * [创建模板房间](#创建模板房间) - * [绘制房间](#绘制房间) - * [配置房间门生成位置](#配置房间门生成位置) - * [ActivityMark标记](#activitymark标记) - * [扩展ActivityMark标记](#扩展activitymark标记) - * [3.4.UI系统](#34ui系统) - * [3.4.1.UI系统概述](#341ui系统概述) - * [3.4.2.UI代码生器](#342ui代码生器) - * [创建UI](#创建ui) - * [打开UI](#打开ui) - * [3.4.3.常用功能](#343常用功能) - * [生命周期](#生命周期) - * [包裹UI节点的IUiNode](#包裹ui节点的iuinode) - --- ## 1.启动项目 @@ -91,7 +52,8 @@ var resource = ResourceManager.Load(ResourcePath.resource_theme_mainTheme **游戏核心系统**: 以游戏玩法为中心的逻辑代码, 包括玩家, 敌人, 武器, 被动, 道具, 地牢生成, 房间规则, 存档逻辑等 **UI模块系统**: 用户操作界面的逻辑代码 -**代码生成系统**: 自动生成便于开发的资源的逻辑代码, 包括生成UI模板, 生成地牢模板, 生成代码等 +**代码生成系统**: 自动生成便于开发的资源的逻辑代码 +**编辑器系统**: 用于用于自定义游戏内容 ### 3.2.游戏核心系统 @@ -116,77 +78,8 @@ var resource = ResourceManager.Load(ResourcePath.resource_theme_mainTheme 通过下面这张图可以了解游戏中的物体与`ActivityObject`的关系 (注意: 该图为早期开发版本的继承关系图, 后面开发可能会有修改) ![](文档资源/2023-03-26_030144.png) -#### 3.2.2.什么是Activity模板场景 -定义: `Activity模板场景`是指可以可以被实例化出`ActivityObject`对象的场景, 但是场景根节点必须是`ActivityObjectTemplate`节点 - -上面定义看起来有矛盾: `ActivityObjectTemplate`没有继承`ActivityObject`, 为啥以它为根节点的场景却能实例化出`ActivityObject`? -这就得提到一个概念: **场景与脚本分离**, 顾名思义, 场景中的节点与`ActivityObject`的脚本是完全分离的, 场景中的节点并没有挂载`ActivityObject`脚本, 在编辑器中它们是两互不干涉的. -游戏运行中, 如果需要实例化`ActivityObject`, 那么就先需要在`ActivityObject`脚本代码中指定该物体的模板场景, 实例化过程中游戏会先实例化出模板场景, 再用`ActivityObject`的实例顶替掉模板场景的根节点, 因此就能打到最终的效果. -为什么要这么做? 原因很简单, 因为我们的游戏是一个Roguelite游戏, 因此游戏中肯定会有大量的武器道具和敌人来填充内容, 但是总会有类似功能或者类似场景结构的物体, 这样就没有必要每一个物体都新建一个单独的场景, 而是让功能让这些类似功能或者结构的物体使用同一个场景, 但为了因对有不同行为逻辑的物体, 我们就设计了一套**场景与脚本分离**的设计模式来因对上述情况 -总结: `Activity模板场景`是不挂载逻辑脚本的, 但是`ActivityObject`必须包含使用的模板场景, 并由统一的Api来实例化`ActivityObject`对象, 至于`ActivityObject`如何绑定模板场景, 请看: 3.2.3.如何创建一个`ActivityObject` - -通过下面这张图可以更好的立即`Activity模板场景`和`ActivityObject`的关系 -(缺张图...) - -#### 3.2.3.如何创建ActivityObject -这里的创建分为两步: -##### 第一步, 创建模板场景: -创建一个空场景, 并且添加`ActivityObjectTemplate`节点 -![](文档资源/image_4.png) -创建完成后编辑器会自动创建必要的子节点 -![](文档资源/image_5.png) -此时就可以随意添加子节点和重命名更节点了, 最后记得保存到`./prefab`文件夹下 -**注意**: `ShadowSprite`,`AnimatedSprite`,`Collision`这三个节点不能改名, 但是可以修改属性和添加子节点 - -##### 第二步, 创建脚本: -创建脚本放到在`./src/game`下, 脚本必须继直接或间接承`ActivityObject`, 并且需要在类上加`[RegisterActivity(id, path)]`标记用于注册对象, `物体id`必须唯一 -源代码: [RegisterActivity.cs](../DungeonShooting_Godot/src/framework/activity/RegisterActivity.cs) -参考代码如下: -```csharp -using Godot; - -[RegisterActivity("物体唯一Id", "模板场景路径")] -public partial class YourActivity : ActivityObject -{ - -} -``` -为了方便区分物体类型, 可以使用`ActivityIdPrefix`类中的常量来添加`id`前缀, 目前支持的类型如下: -* **Role**: 角色 -* **Enemy**: 敌人 -* **Weapon**: 武器 -* **Bullet**: 子弹 -* **Shell**: 弹壳 -* **Other**: 其他类型, 例如门, 箱子等 -* **Test**: 测试物体 - -例如我们创建一个敌人, 那么`[RegisterActivity()]`就可以这么写: -```csharp -[RegisterActivity(ActivityIdPrefix.Enemy + "0001", ResourcePath.prefab_role_Enemy_tscn)] -``` - -##### 实例化ActivityObject -可通过`ActivityObject.Create(id)`创建物体, 这个`id`可以结合`ActivityIdPrefix`, 那么创建敌人最终可以这样写 -```csharp -var enemy = ActivityObject.Create(ActivityIdPrefix.Enemy + "0001"); -``` -#### 3.2.4.自定义RegisterActivity -某些情况下需要更改`RegisterActivity`的参数, 或者需要对实例化出来的`ActivityInstance`进行统一的操作, 那么就需要我们自己写一个子类来继承`RegisterActivity`. -操作`ActivityInstance`需要重写: -```csharp -/// -/// 该函数在物体实例化后调用, 可用于一些自定义操作, 参数为实例对象 -/// -public virtual void CustomHandler(ActivityObject instance) -{ -} -``` - -例子: 注册武器, [RegisterWeapon.cs](../DungeonShooting_Godot/src/game/item/weapon/RegisterWeapon.cs) -由于创建武器必须指定武器属性数据, 那么原来的`[RegisterActivity()]`就不适用了, `RegisterWeapon`重写了构造函数, 改变了初始化参数, 并且重写`CustomHandler()`, 对`ActivityInstance`进行初始化属性操作 - -#### 3.2.5.ActivityObject常用功能 +#### 3.2.2.ActivityObject常用功能 ##### 自定义组件 这个功能类似于`Unity`的`MonoBehaviour`, 组件必须继承`Component`类, 组件的作用是拆分功能代码, 开发者可以将相同功能的代码放入同一个组件中, 与`Godot`的`Node`不同的是, 挂载到`ActivityObject`上的组件并不会生成一个`Node`节点, 它相比于`Node`更加轻量 @@ -364,90 +257,6 @@ private IEnumerator StartRotation() * **商店**: 玩家买卖道具装备的房间 * **事件房间**: 触发剧情或者解锁NPC的房间 -#### 3.3.2.创建模板房间 -图块层级概述(后续补上, 先默认使用`resource/map/tileset/TileSet1.tres`) - -##### 创建模板房间 -项目提供了一套创建模板房间的工具, 点击`tools`页签, 找到`创建地牢房间`这一项, 输入模板房间名称(注意房间名称不能重复), 即可创建房间, 创建房间完成后会创建房间配置数据, 路径为`resource/map/tiledata/xxx.json`, 并将配置数据注册到`resource/map/RoomConfig.json`中 -![](文档资源/image_7.png) - -##### 绘制房间 -创建好的房间会自动在编辑器中打开, 为场景的根节点选好`TileSet`后就可以画房间了 -![](文档资源/image_8.png) -编辑器会自动计算出房间位置轮廓(绿色线)和导航区域(红色和黄色线), 并绘制出来, 按下`ctrs`+`s`, 编辑器就会将位置轮廓和导航信息存入`resource/map/tiledata/xxx.json`下 -注意, 为了避免Ai运动时卡墙角, 所以计算导航轮廓时特意与墙预留了半个格子的距离, 也就是说如果存在单格的道路, 导航计算就会出错, 所以在画道路时必须为两格以上的宽度, 像下面这两种情况就是不被允许的, 编辑器会绘制出错误的格子 -![](文档资源/image_9.png) -![](文档资源/image_10.png) -如果计算导航网格出错, 那么编辑器将不会保存房间配置信息 - -##### 配置房间门生成位置 -如果某些模板房间需要在指定区域内生成门, 那么就需要设置房间门生成区域 -在模板场景中选中根节点, 再勾选`Enable Edit` -![](文档资源/image_11.png) -此时将鼠标放置在房间轮廓的绿线上就会显示生成区域 -![](文档资源/image_12.png) -点击鼠标左键即可创建门区域, 如果悬停时显示红色方块, 则表示不能在此处创建门区域 -创建门生成区域的约束: 区域不能重叠, 且两个区域的间距至少为4格, 每个区域至少4格宽度 -![](文档资源/gif_1.gif) -新建的区域默认为4格宽度, 如果需要调整宽度, 可以拖拽区域两侧的点来调整范围 -![](文档资源/gif_2.gif) -如果需要删除区域, 则悬停到区域两侧任意一个点上, 按下鼠标中建即可删除 -![](文档资源/gif_3.gif) -门区域需要对齐地面地砖 -![](文档资源/image_13.png) - -注意: -* 如果一个模板房间不设置门生成区域, 则默认四边任何位置都可能生成门 -* 配置好一个房间的门生成区域后, 如果绘制房间时改变了房间的大小或者位置, 则编辑器会清空配置的门区域 -* 编辑门区域功能属于扩展编辑器功能, 因此单纯改变门区域数据不会在场景页签上标`*`(编辑器不会认为该资源有修改), 修改后需要及时按下`ctrl`+`s`保存, 以免造成数据丢失 - -##### ActivityMark标记 - -`ActivityMark`用于模板房间中创建`ActivityObject`对象, 并支配置指定的物体, 第几波生成该物体以及生成物体延时时间 -源代码: [ActivityMark.cs](../DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs) - -在房间根节点中创建`ActivityMark`对象 -![](文档资源/image_18.png) -创建完成后可以看到地图上多了一个`X`, 这个叉就是生成物体的位置, 可自由调整位置 -![](文档资源/image_19.png) -然后就可以在编辑器中设置`ActivityMark`数据了, `ActivityMark`有以下可以导出的属性: -```csharp -/// -/// 物体类型 -/// -[Export] -public ActivityIdPrefix.ActivityPrefixType Type = ActivityIdPrefix.ActivityPrefixType.NonePrefix; - -/// -/// 物体id -/// -[Export] -public string ItemId; - -/// -/// 所在层级 -/// -[Export] -public RoomLayerEnum Layer = RoomLayerEnum.NormalLayer; - -/// -/// 该标记在第几波调用 BeReady, -/// 一个房间内所以敌人清完即可进入下一波 -/// -[Export] -public int WaveNumber = 1; - -/// -/// 延时执行时间,单位:秒 -/// -[Export] -public float DelayTime = 0; -``` - -###### 扩展ActivityMark标记 -项目中提供了以下几个扩展`ActivityMark`属性的节点: -* [WeaponMark](../DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs): 创建武器设置弹药等 -* [EnemyMark](../DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs): 创建敌人并设置武器和弹药 ### 3.4.UI系统 @@ -513,17 +322,21 @@ public virtual void OnCreateUi() /// /// 当前ui显示时调用 /// -public abstract void OnShowUi(); +public virtual void OnShowUi() +{ +} /// /// 当前ui隐藏时调用 /// -public abstract void OnHideUi(); +public virtual void OnHideUi() +{ +} /// /// 销毁当前ui时调用 /// -public virtual void OnDisposeUi() +public virtual void OnDestroy() { } ``` diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old b/DungeonShooting_Godot/DungeonShooting.csproj.old deleted file mode 100644 index 8e15ac56a3ecf4683e454ca333f5ebaf2c5e4f1c..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/DungeonShooting.csproj.old +++ /dev/null @@ -1,11 +0,0 @@ - - - net6.0 - true - - - - - - - \ No newline at end of file diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old.1 b/DungeonShooting_Godot/DungeonShooting.csproj.old.1 deleted file mode 100644 index 4e093b1eaecb9644409dc8bb1568d4b2281884c4..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/DungeonShooting.csproj.old.1 +++ /dev/null @@ -1,11 +0,0 @@ - - - net6.0 - true - - - - - - - \ No newline at end of file diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old.2 b/DungeonShooting_Godot/DungeonShooting.csproj.old.2 deleted file mode 100644 index f88bca05c9319710b1d340cbf413b472f4d5b678..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/DungeonShooting.csproj.old.2 +++ /dev/null @@ -1,11 +0,0 @@ - - - net6.0 - true - - - - - - - \ No newline at end of file diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old.3 b/DungeonShooting_Godot/DungeonShooting.csproj.old.3 deleted file mode 100644 index 1c6b3111c551ff185b6d0c8b556ff2f246c46b24..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/DungeonShooting.csproj.old.3 +++ /dev/null @@ -1,11 +0,0 @@ - - - net6.0 - true - - - - - - - \ No newline at end of file diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old.4 b/DungeonShooting_Godot/DungeonShooting.csproj.old.4 deleted file mode 100644 index ef9302f9d748e444a3240b4a501cf69d833c24f4..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/DungeonShooting.csproj.old.4 +++ /dev/null @@ -1,11 +0,0 @@ - - - net6.0 - true - - - - - - - \ No newline at end of file diff --git a/DungeonShooting_Godot/DungeonShooting.csproj.old.5 b/DungeonShooting_Godot/DungeonShooting.csproj.old.5 deleted file mode 100644 index 4c62c1bf88e3f8aad59b2237afde2dc1212268c0..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/DungeonShooting.csproj.old.5 +++ /dev/null @@ -1,11 +0,0 @@ - - - net6.0 - true - - - - - - - \ No newline at end of file diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs index fc17fffe6fb4de060e2611a49bba6b55d11eabcc..cc9522586cfa9c2fb5704b9e4234903f6314258a 100644 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs +++ b/DungeonShooting_Godot/addons/dungeonShooting_plugin/NodeMonitor.cs @@ -12,14 +12,28 @@ public class NodeMonitor { private class SceneNode : IEquatable { - public SceneNode(string type, string name) + public SceneNode(string type, string name, string scriptPath) { Type = type; Name = name; + ScriptPath = scriptPath; } + /// + /// 节点类型 + /// public string Type; + /// + /// 节点名称 + /// public string Name; + /// + /// 节点脚本路径 + /// + public string ScriptPath; + /// + /// 子节点 + /// public List Children = new List(); public bool Equals(SceneNode other) @@ -29,7 +43,7 @@ public class NodeMonitor return false; } - if (other.Name != Name || other.Type != Type) + if (other.Name != Name || other.Type != Type || other.ScriptPath != ScriptPath) { return false; } @@ -127,7 +141,17 @@ public class NodeMonitor private SceneNode ParseNodeTree(Node node) { - var uiNode = new SceneNode(node.GetType().FullName, node.Name); + var script = node.GetScript().As(); + string scriptPath; + if (script == null) + { + scriptPath = null; + } + else + { + scriptPath = script.ResourcePath; + } + var uiNode = new SceneNode(node.GetType().FullName, node.Name, scriptPath); var count = node.GetChildCount(); for (var i = 0; i < count; i++) { diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs index 0a8809731b0180302e984171008d14e53514af8b..f78f57706ad6807c70a2339cd057678cb9c7ea27 100644 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs +++ b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs @@ -158,7 +158,7 @@ namespace Plugin try { - _editorTools.OnDisposeUi(); + _editorTools.OnDestroyUi(); } catch (Exception e) { diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index c3267c9a2e3ffd7b81a574174416d8b2bd0ca2a8..665ce59d6528e49c437ddf88f790f86f2a65663f 100644 Binary files a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx and b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx differ diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx index c8902810f1ff8613a2dcf4d0b754bb97511e7dfb..536a84724d688d197321cb3e060da14a8d876288 100644 Binary files a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx and b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx differ diff --git a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx index ed47d6dd7059f695da0ea4037e3632f9d581fe7a..877be5069772ec765659f98aeb1ee06cb019ebc5 100644 Binary files a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx and b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx differ diff --git a/DungeonShooting_Godot/prefab/Cursor.tscn b/DungeonShooting_Godot/prefab/Cursor.tscn index 728e892d33f87ccefc3713dbec108a241f8c68bc..a146c9b0011c476bfd363d12b142701a75ed02fd 100644 --- a/DungeonShooting_Godot/prefab/Cursor.tscn +++ b/DungeonShooting_Godot/prefab/Cursor.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=3 uid="uid://d16r232hmj3ow"] [ext_resource type="Script" path="res://src/game/Cursor.cs" id="2"] -[ext_resource type="Texture2D" uid="uid://cjiiu86a42mnj" path="res://resource/sprite/ui/CursorCenter.png" id="2_2j135"] -[ext_resource type="Texture2D" uid="uid://dta28v3fgkfru" path="res://resource/sprite/ui/cursors.png" id="3_ni3bs"] +[ext_resource type="Texture2D" uid="uid://cjiiu86a42mnj" path="res://resource/sprite/ui/sursors/CursorCenter.png" id="2_hg8gd"] +[ext_resource type="Texture2D" uid="uid://dta28v3fgkfru" path="res://resource/sprite/ui/sursors/cursors.png" id="3_8xjp7"] [node name="Cursor" type="Node2D"] z_index = 10 @@ -11,40 +11,32 @@ script = ExtResource("2") [node name="Center" type="Sprite2D" parent="."] visible = false scale = Vector2(4, 4) -texture = ExtResource("2_2j135") +texture = ExtResource("2_hg8gd") [node name="LT" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("3_ni3bs") +texture = ExtResource("3_8xjp7") offset = Vector2(-2, -2) region_enabled = true region_rect = Rect2(67, 35, 4, 4) [node name="LB" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("3_ni3bs") +texture = ExtResource("3_8xjp7") offset = Vector2(-2, 2) region_enabled = true region_rect = Rect2(67, 41, 4, 4) [node name="RT" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("3_ni3bs") +texture = ExtResource("3_8xjp7") offset = Vector2(2, -2) region_enabled = true region_rect = Rect2(73, 35, 4, 4) [node name="RB" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("3_ni3bs") +texture = ExtResource("3_8xjp7") offset = Vector2(2, 2) region_enabled = true region_rect = Rect2(73, 41, 4, 4) - -[node name="Finger" type="Sprite2D" parent="."] -visible = false -position = Vector2(8, 6) -scale = Vector2(4, 4) -texture = ExtResource("3_ni3bs") -region_enabled = true -region_rect = Rect2(68, 21, 7, 9) diff --git a/DungeonShooting_Godot/prefab/prop/buff/Weapon0005.png b/DungeonShooting_Godot/prefab/prop/buff/Weapon0005.png deleted file mode 100644 index dd42c8a20292dc28bf6b51c313b4d30a99adc1b4..0000000000000000000000000000000000000000 Binary files a/DungeonShooting_Godot/prefab/prop/buff/Weapon0005.png and /dev/null differ diff --git a/DungeonShooting_Godot/prefab/ui/EditorTips.tscn b/DungeonShooting_Godot/prefab/ui/EditorTips.tscn new file mode 100644 index 0000000000000000000000000000000000000000..f284eee536f0d9062ac59c8fcb49bebc65fe0c4a --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/EditorTips.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=3 uid="uid://bed63wcgyl08u"] + +[ext_resource type="Script" path="res://src/game/ui/editorTips/EditorTipsPanel.cs" id="1_3mdex"] + +[node name="EditorTips" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource("1_3mdex") + +[node name="Label" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "提示内容" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 diff --git a/DungeonShooting_Godot/prefab/ui/EditorTools.tscn b/DungeonShooting_Godot/prefab/ui/EditorTools.tscn index 27e37f9decfd48be7b852654e11df910f0d3a792..1089ea740dd947fc571ecabe8d86fdaf168ff2f2 100644 --- a/DungeonShooting_Godot/prefab/ui/EditorTools.tscn +++ b/DungeonShooting_Godot/prefab/ui/EditorTools.tscn @@ -166,9 +166,10 @@ text = "运行" [node name="Confirm" type="ConfirmationDialog" parent="."] initial_position = 1 -size = Vector2i(200, 124) +size = Vector2i(350, 200) unresizable = true [node name="Tips" type="AcceptDialog" parent="."] initial_position = 1 +size = Vector2i(350, 200) unresizable = true diff --git a/DungeonShooting_Godot/prefab/ui/EditorWindow.tscn b/DungeonShooting_Godot/prefab/ui/EditorWindow.tscn new file mode 100644 index 0000000000000000000000000000000000000000..1a8f5bb3c6f909c479fcc5a63753b79bb81dcd25 --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/EditorWindow.tscn @@ -0,0 +1,68 @@ +[gd_scene load_steps=2 format=3 uid="uid://bw342xeqc5div"] + +[ext_resource type="Script" path="res://src/game/ui/editorWindow/EditorWindowPanel.cs" id="1_bfitg"] + +[node name="EditorWindow" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_bfitg") +Layer = 3 + +[node name="Bg" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 0.235294) + +[node name="Window" type="Window" parent="."] +canvas_item_default_texture_filter = 0 +title = "标题" +initial_position = 1 +size = Vector2i(500, 350) +visible = false +transient = true +min_size = Vector2i(500, 350) +theme_override_constants/title_height = 33 + +[node name="Panel" type="Panel" parent="Window"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Window/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Body" type="MarginContainer" parent="Window/Panel/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="HBoxContainer" type="HBoxContainer" parent="Window/Panel/VBoxContainer"] +custom_minimum_size = Vector2(0, 70) +layout_mode = 2 + +[node name="CustomButton" type="CenterContainer" parent="Window/Panel/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="Button" type="Button" parent="Window/Panel/VBoxContainer/HBoxContainer/CustomButton"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "确定" diff --git a/DungeonShooting_Godot/prefab/ui/Main.tscn b/DungeonShooting_Godot/prefab/ui/Main.tscn index 860fe85e0057aed144f8d70a275548f99a7abf6c..313872777a1d542748a44b66ec71336c8880aa46 100644 --- a/DungeonShooting_Godot/prefab/ui/Main.tscn +++ b/DungeonShooting_Godot/prefab/ui/Main.tscn @@ -47,6 +47,15 @@ theme = ExtResource("2_bbd6i") text = "开始游戏 " +[node name="Tools" type="Button" parent="ButtonList"] +custom_minimum_size = Vector2(0, 50) +layout_mode = 2 +focus_neighbor_top = NodePath("../Start") +focus_neighbor_bottom = NodePath("../Exit") +theme = ExtResource("2_bbd6i") +theme_override_font_sizes/font_size = 32 +text = "开发者工具" + [node name="Setting" type="Button" parent="ButtonList"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn new file mode 100644 index 0000000000000000000000000000000000000000..0cc0d6a1fd17d5302429ee34ad8de7b152a47504 --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn @@ -0,0 +1,263 @@ +[gd_scene load_steps=15 format=3 uid="uid://csbxfkdupsckv"] + +[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="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"] +[ext_resource type="Script" path="res://src/game/ui/mapEditor/tileView/EditorTileMap.cs" id="4_mhy1a"] +[ext_resource type="Texture2D" uid="uid://bpbfjyj6258da" path="res://resource/sprite/ui/commonIcon/Setting.png" id="5_ubl8b"] +[ext_resource type="PackedScene" uid="uid://b4u66mxndxbrg" path="res://prefab/ui/MapEditorTools.tscn" id="6_7pvgu"] +[ext_resource type="PackedScene" uid="uid://bb2ekkpxifd7g" path="res://prefab/ui/MapEditorMapLayer.tscn" id="7_ychtn"] +[ext_resource type="PackedScene" uid="uid://peo0n8bl15y5" path="res://prefab/ui/MapEditorMapMark.tscn" id="8_8tgeu"] + +[sub_resource type="Animation" id="Animation_o3btm"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 0, 0, 0)] +} + +[sub_resource type="Animation" id="Animation_wnqg6"] +resource_name = "show" +length = 2.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.3, 0.6, 2), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 0, 0, 0), Color(1, 0, 0, 0.490196), Color(1, 0, 0, 0.490196), Color(1, 0, 0, 0)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_371oi"] +_data = { +"RESET": SubResource("Animation_o3btm"), +"show": SubResource("Animation_wnqg6") +} + +[node name="MapEditor" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_5s7a0") + +[node name="Bg" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Bg"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Head" type="Panel" parent="Bg/VBoxContainer"] +custom_minimum_size = Vector2(0, 70) +layout_mode = 2 + +[node name="Back" type="Button" parent="Bg/VBoxContainer/Head"] +layout_mode = 2 +offset_left = 2.0 +offset_top = 2.0 +offset_right = 62.0 +offset_bottom = 68.0 +grow_vertical = 2 +size_flags_horizontal = 0 +icon = ExtResource("2_gkcw7") +icon_alignment = 1 + +[node name="Save" type="Button" parent="Bg/VBoxContainer/Head"] +layout_mode = 2 +offset_left = 64.0 +offset_top = 2.0 +offset_right = 124.0 +offset_bottom = 68.0 +grow_vertical = 2 +size_flags_horizontal = 0 +icon = ExtResource("3_qq8k4") +icon_alignment = 1 + +[node name="Title" type="Label" parent="Bg/VBoxContainer/Head"] +layout_mode = 0 +offset_left = 136.0 +offset_top = 2.0 +offset_right = 272.0 +offset_bottom = 68.0 +text = "正在编辑" +vertical_alignment = 1 + +[node name="Play" type="Button" parent="Bg/VBoxContainer/Head"] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -61.0 +offset_top = 2.0 +offset_right = -1.0 +offset_bottom = 68.0 +grow_horizontal = 2 +size_flags_horizontal = 0 +icon = ExtResource("4_2imnr") +icon_alignment = 1 + +[node name="PlaySetting" type="Button" parent="Bg/VBoxContainer/Head"] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = 1.0 +offset_top = 2.0 +offset_right = 61.0 +offset_bottom = 68.0 +grow_horizontal = 2 +size_flags_horizontal = 0 +icon = ExtResource("5_ubl8b") +icon_alignment = 1 + +[node name="HSplitContainer" type="HSplitContainer" parent="Bg/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Left" type="Panel" parent="Bg/VBoxContainer/HSplitContainer"] +custom_minimum_size = Vector2(1000, 0) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 7.0 + +[node name="MarginContainer" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Left"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="MapView" type="SubViewportContainer" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer"] +layout_mode = 2 + +[node name="SubViewport" type="SubViewport" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer/MapView"] +handle_input_locally = false +canvas_item_default_texture_filter = 0 +size = Vector2i(1334, 1002) +render_target_update_mode = 4 + +[node name="TileMap" type="TileMap" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer/MapView/SubViewport"] +position = Vector2(500, 540) +scale = Vector2(4, 4) +tile_set = ExtResource("2_vrg60") +format = 2 +script = ExtResource("4_mhy1a") + +[node name="ErrorCell" type="Sprite2D" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer/MapView/SubViewport/TileMap"] +visible = false +modulate = Color(1, 0, 0, 0) +z_index = 10 +scale = Vector2(16, 16) +texture = ExtResource("4_465u2") +centered = false + +[node name="ErrorCellAnimationPlayer" type="AnimationPlayer" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer/MapView/SubViewport/TileMap/ErrorCell"] +libraries = { +"": SubResource("AnimationLibrary_371oi") +} + +[node name="Brush" type="Node2D" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer/MapView/SubViewport/TileMap"] +z_index = 100 + +[node name="CanvasLayer" type="CanvasLayer" parent="Bg/VBoxContainer/HSplitContainer/Left/MarginContainer/MapView/SubViewport"] +layer = 2 + +[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 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 3.0 + +[node name="MarginContainer" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="TabContainer" type="TabContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="MapLayer" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer"] +layout_mode = 2 +theme_override_constants/margin_top = 10 + +[node name="MapEditorMapLayer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer" instance=ExtResource("7_ychtn")] +layout_mode = 2 + +[node name="MapMark" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer"] +visible = false +layout_mode = 2 +theme_override_constants/margin_top = 10 + +[node name="MapEditorMapMark" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapMark" instance=ExtResource("8_8tgeu")] +layout_mode = 2 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorCreateGroup.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorCreateGroup.tscn new file mode 100644 index 0000000000000000000000000000000000000000..7f5a45531a4702487ecfcac25533c45c6ecdc50d --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorCreateGroup.tscn @@ -0,0 +1,63 @@ +[gd_scene load_steps=2 format=3 uid="uid://45krchsjrluh"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs" id="1_qoujx"] + +[node name="MapEditorCreateGroup" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource("1_qoujx") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="GroupNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "组名称:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="GroupNameInput" type="LineEdit" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "请输入组名称" + +[node name="HBoxContainer5" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="RemarkNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 20.0 +text = "组备注:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="RemarkInput" type="TextEdit" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +custom_minimum_size = Vector2(0, 150) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "选填" +wrap_mode = 1 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorCreateMark.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorCreateMark.tscn new file mode 100644 index 0000000000000000000000000000000000000000..5e4d4ab41848a50c8fcb26af4f30aacdadda746a --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorCreateMark.tscn @@ -0,0 +1,462 @@ +[gd_scene load_steps=10 format=3 uid="uid://bt4xo2lb4h4rx"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs" id="1_cjivg"] +[ext_resource type="Texture2D" uid="uid://n4atvj5fkcpg" path="res://resource/sprite/ui/commonIcon/Add.png" id="2_pxemo"] +[ext_resource type="Material" uid="uid://cces3bhds7jyi" path="res://resource/material/Blend.tres" id="2_xb40b"] +[ext_resource type="Texture2D" uid="uid://c5778ntk2rdon" path="res://resource/sprite/ui/commonIcon/Delete.png" id="3_7xihk"] +[ext_resource type="Texture2D" uid="uid://dligpyhp72sg7" path="res://resource/sprite/ui/commonIcon/Right.png" id="3_v5clf"] +[ext_resource type="Script" path="res://src/game/ui/mapEditorCreateMark/attribute/NumberAttribute.cs" id="6_1ym7l"] +[ext_resource type="Script" path="res://src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs" id="7_516p2"] +[ext_resource type="Script" path="res://src/game/ui/mapEditorCreateMark/attribute/OptionAttribute.cs" id="7_o1tg2"] +[ext_resource type="Texture2D" uid="uid://dggb6p4sdmfry" path="res://resource/sprite/ui/commonIcon/Edit.png" id="7_yeuy4"] + +[node name="MapEditorCreateMark" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_cjivg") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 20 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 + +[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="PosLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 30.0 +text = "区域位置:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 70.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "X" + +[node name="PosX" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +allow_greater = true +allow_lesser = true +custom_arrow_step = 1.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Y" + +[node name="PosY" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +allow_greater = true +allow_lesser = true +custom_arrow_step = 1.0 + +[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="SizeLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 30.0 +text = "区域大小:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 70.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "X" + +[node name="SizeX" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +max_value = 9999.0 +value = 16.0 +custom_arrow_step = 1.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Y" + +[node name="SizeY" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +max_value = 9999.0 +value = 16.0 +custom_arrow_step = 1.0 + +[node name="DelayContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="DelayNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/DelayContainer"] +custom_minimum_size = Vector2(250, 0) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 30.0 +text = "延时时间(秒):" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="DelayInput" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/DelayContainer"] +custom_minimum_size = Vector2(0, 43) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 70.0 +max_value = 30.0 +step = 0.01 +custom_arrow_step = 0.1 + +[node name="AddMark" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +text = "添加物体" +icon = ExtResource("2_pxemo") + +[node name="Panel" type="Panel" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/Panel/MarginContainer"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 60) +layout_mode = 2 + +[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(80, 0) +layout_mode = 2 + +[node name="IconTitle" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +text = "图标" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="IdTitle" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(250, 0) +layout_mode = 2 +text = "Id" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="NameTitle" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(350, 0) +layout_mode = 2 +text = "名称" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="TypeTitle" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(150, 0) +layout_mode = 2 +text = "类型" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="WeightTitle" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(150, 0) +layout_mode = 2 +text = "权重" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ExtraTitle" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +visible = false +custom_minimum_size = Vector2(250, 0) +layout_mode = 2 +size_flags_horizontal = 3 +text = "额外属性" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="MarkObject" type="PanelContainer" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 + +[node name="ExpandButton" type="Button" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(80, 80) +layout_mode = 2 +size_flags_vertical = 4 +icon = ExtResource("3_v5clf") +flat = true +icon_alignment = 1 + +[node name="Icon" type="TextureRect" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer"] +material = ExtResource("2_xb40b") +custom_minimum_size = Vector2(100, 80) +layout_mode = 2 +stretch_mode = 5 + +[node name="IdLabel" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(250, 0) +layout_mode = 2 +size_flags_vertical = 1 +text = "1001" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="NameLabel" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(350, 0) +layout_mode = 2 +size_flags_vertical = 1 +text = "名称" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="TypeLabel" type="Label" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(150, 0) +layout_mode = 2 +size_flags_vertical = 1 +text = "武器" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + +[node name="WeightEdit" type="SpinBox" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(150, 43) +layout_mode = 2 +size_flags_vertical = 4 +max_value = 1000.0 +value = 100.0 +custom_arrow_step = 1.0 + +[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="DeleteButton" type="Button" parent="MarginContainer/VBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/MarkObject/VBoxContainer/HBoxContainer/CenterContainer"] +custom_minimum_size = Vector2(43, 43) +layout_mode = 2 +size_flags_vertical = 4 +icon = ExtResource("3_7xihk") + +[node name="ExpandPanel" type="MarginContainer" parent="."] +layout_mode = 2 +offset_top = -423.0 +offset_right = 667.0 +offset_bottom = -353.0 +theme_override_constants/margin_left = 80 +theme_override_constants/margin_right = 2 + +[node name="ExpandGrid" type="GridContainer" parent="ExpandPanel"] +layout_mode = 2 +columns = 2 + +[node name="NumberBar" type="Control" parent="."] +custom_minimum_size = Vector2(0, 70) +layout_mode = 2 +anchors_preset = 0 +offset_top = -320.0 +offset_right = 700.0 +offset_bottom = -250.0 +size_flags_horizontal = 3 +script = ExtResource("6_1ym7l") + +[node name="AttrName" type="Label" parent="NumberBar"] +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_top = -21.5 +offset_right = 250.0 +offset_bottom = 21.5 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 40.0 +text = "属性:" + +[node name="NumInput" type="SpinBox" parent="NumberBar"] +custom_minimum_size = Vector2(0, 43) +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_left = 250.0 +offset_top = -21.0 +offset_right = 414.0 +offset_bottom = 22.0 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 60.0 + +[node name="OptionBar" type="Control" parent="."] +custom_minimum_size = Vector2(0, 70) +layout_mode = 2 +anchors_preset = 0 +offset_top = -405.0 +offset_right = 700.0 +offset_bottom = -335.0 +size_flags_horizontal = 3 +script = ExtResource("7_o1tg2") + +[node name="AttrName" type="Label" parent="OptionBar"] +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_top = -21.5 +offset_right = 250.0 +offset_bottom = 21.5 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 40.0 +text = "属性:" + +[node name="OptionInput" type="OptionButton" parent="OptionBar"] +custom_minimum_size = Vector2(0, 43) +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_left = 250.0 +offset_top = -21.0 +offset_right = 414.0 +offset_bottom = 22.0 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 4 +size_flags_stretch_ratio = 60.0 + +[node name="ObjectBar" type="Control" parent="."] +custom_minimum_size = Vector2(0, 70) +layout_mode = 2 +anchors_preset = 0 +offset_top = -234.0 +offset_right = 700.0 +offset_bottom = -164.0 +size_flags_horizontal = 3 +script = ExtResource("7_516p2") + +[node name="AttrName" type="Label" parent="ObjectBar"] +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_top = -21.5 +offset_right = 250.0 +offset_bottom = 21.5 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 25.0 +text = "物体:" + +[node name="HBoxContainer" type="HBoxContainer" parent="ObjectBar"] +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_left = 250.0 +offset_top = -35.0 +offset_right = 539.0 +offset_bottom = 35.0 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 75.0 + +[node name="SelectButton" type="Button" parent="ObjectBar/HBoxContainer"] +custom_minimum_size = Vector2(43, 43) +layout_mode = 2 +size_flags_vertical = 4 +size_flags_stretch_ratio = 60.0 +icon = ExtResource("7_yeuy4") + +[node name="ObjectIcon" type="TextureRect" parent="ObjectBar/HBoxContainer"] +visible = false +material = ExtResource("2_xb40b") +custom_minimum_size = Vector2(70, 70) +layout_mode = 2 +stretch_mode = 5 + +[node name="ObjectName" type="Label" parent="ObjectBar/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "<未选择>" + +[node name="DeleteButton" type="Button" parent="ObjectBar/HBoxContainer"] +visible = false +custom_minimum_size = Vector2(43, 43) +layout_mode = 2 +size_flags_vertical = 4 +size_flags_stretch_ratio = 60.0 +icon = ExtResource("3_7xihk") diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorCreatePreinstall.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorCreatePreinstall.tscn new file mode 100644 index 0000000000000000000000000000000000000000..a90e76d0cd967178dd283f53a0f1587c62ff2e05 --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorCreatePreinstall.tscn @@ -0,0 +1,84 @@ +[gd_scene load_steps=2 format=3 uid="uid://bp1e8nom6wugk"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorCreatePreinstall/MapEditorCreatePreinstallPanel.cs" id="1_um8jr"] + +[node name="MapEditorCreatePreinstall" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_um8jr") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="PreinstallNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "预设名称:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="PreinstallNameInput" type="LineEdit" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "请输入预设名称" + +[node name="HBoxContainer4" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="WeightNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer4"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "预设权重:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="WeightInput" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer4"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +min_value = 1.0 +max_value = 1000.0 +value = 100.0 + +[node name="HBoxContainer5" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="RemarkNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 20.0 +text = "预设备注:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="RemarkInput" type="TextEdit" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +custom_minimum_size = Vector2(0, 150) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "选填" +wrap_mode = 1 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorCreateRoom.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorCreateRoom.tscn new file mode 100644 index 0000000000000000000000000000000000000000..84738ecd80c8f9365ab00c80b5996eac05f2cd07 --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorCreateRoom.tscn @@ -0,0 +1,117 @@ +[gd_scene load_steps=2 format=3 uid="uid://bfx6u04j0pbnu"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorCreateRoom/MapEditorCreateRoomPanel.cs" id="1_dep3f"] + +[node name="MapEditorCreateRoom" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_dep3f") +Layer = 3 + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="RoomNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "房间名称:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="RoomNameInput" type="LineEdit" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "请输入房间名称" + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="GroupNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "所属分组:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="GroupSelect" type="OptionButton" parent="MarginContainer/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 + +[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="TypeNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "房间类型:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="TypeSelect" type="OptionButton" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 + +[node name="HBoxContainer4" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="WeightNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer4"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "房间权重:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="WeightInput" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer4"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +min_value = 1.0 +max_value = 1000.0 +value = 100.0 + +[node name="HBoxContainer5" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="RemarkNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 20.0 +text = "房间备注:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="RemarkInput" type="TextEdit" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +custom_minimum_size = Vector2(0, 150) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "选填" +wrap_mode = 1 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorMapLayer.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorMapLayer.tscn new file mode 100644 index 0000000000000000000000000000000000000000..eabd3a60811081f13f09a06c9f37388e56499a8f --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorMapLayer.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=4 format=3 uid="uid://bb2ekkpxifd7g"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs" id="1_3j05m"] +[ext_resource type="Texture2D" uid="uid://dmm8jw06bhffh" path="res://resource/sprite/ui/commonIcon/Lock.png" id="2_pfhyj"] +[ext_resource type="Texture2D" uid="uid://dqvg18aacx6db" path="res://resource/sprite/ui/commonIcon/Visible.png" id="3_rqjh4"] + +[node name="MapEditorMapLayer" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_3j05m") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="LayerLabel" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "地图层级:" + +[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="LayerButton" type="Button" parent="VBoxContainer/ScrollContainer"] +custom_minimum_size = Vector2(0, 70) +layout_mode = 2 +size_flags_horizontal = 3 +text = "layer1" +icon = ExtResource("2_pfhyj") +alignment = 0 + +[node name="VisibleButton" type="TextureButton" parent="VBoxContainer/ScrollContainer/LayerButton"] +layout_mode = 1 +anchors_preset = 11 +anchor_left = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -55.0 +grow_horizontal = 0 +grow_vertical = 2 +texture_normal = ExtResource("3_rqjh4") +stretch_mode = 3 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorMapMark.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorMapMark.tscn new file mode 100644 index 0000000000000000000000000000000000000000..b39b3e1c20e8a58600e7e574ec1428f6ca66f07c --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorMapMark.tscn @@ -0,0 +1,151 @@ +[gd_scene load_steps=9 format=3 uid="uid://peo0n8bl15y5"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs" id="1_dudey"] +[ext_resource type="Texture2D" uid="uid://n4atvj5fkcpg" path="res://resource/sprite/ui/commonIcon/Add.png" id="2_osya0"] +[ext_resource type="Texture2D" uid="uid://dggb6p4sdmfry" path="res://resource/sprite/ui/commonIcon/Edit.png" id="3_wwaki"] +[ext_resource type="Texture2D" uid="uid://c5778ntk2rdon" path="res://resource/sprite/ui/commonIcon/Delete.png" id="4_urq7y"] +[ext_resource type="Texture2D" uid="uid://d4gduco55dqpk" path="res://resource/sprite/ui/commonIcon/Down.png" id="5_x5dpw"] +[ext_resource type="Texture2D" uid="uid://cgtmjuiks7mot" path="res://resource/sprite/ui/commonIcon/WaveCell.png" id="6_eod5i"] +[ext_resource type="Texture2D" uid="uid://bn47bmilcw4x0" path="res://resource/sprite/ui/commonIcon/Select2.png" id="6_jpt3y"] +[ext_resource type="Texture2D" uid="uid://bylf0kxccwgdw" path="res://resource/sprite/ui/commonIcon/MarkCell.png" id="8_xyhe6"] + +[node name="MapEditorMapMark" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_dudey") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarkLabel" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "编辑预设:" + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 + +[node name="PreinstallOption" type="OptionButton" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="AddPreinstall" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("2_osya0") + +[node name="EditPreinstall" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("3_wwaki") + +[node name="DeletePreinstall" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("4_urq7y") + +[node name="MarkLabel2" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "编辑对象:" + +[node name="DynamicTool" type="HBoxContainer" parent="VBoxContainer"] +visible = false +layout_mode = 2 + +[node name="EditButton" type="Button" parent="VBoxContainer/DynamicTool"] +layout_mode = 2 +icon = ExtResource("3_wwaki") + +[node name="DeleteButton" type="Button" parent="VBoxContainer/DynamicTool"] +layout_mode = 2 +icon = ExtResource("4_urq7y") + +[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="AddWaveButton" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer"] +layout_mode = 2 +text = "添加波数" + +[node name="WaveItem" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="WaveContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem"] +layout_mode = 2 + +[node name="TextureButton" type="TextureButton" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/WaveContainer"] +custom_minimum_size = Vector2(36, 36) +layout_mode = 2 +texture_normal = ExtResource("5_x5dpw") +stretch_mode = 3 + +[node name="WaveButton" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/WaveContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "第1波" +icon = ExtResource("6_eod5i") +alignment = 0 + +[node name="Select" type="NinePatchRect" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/WaveContainer/WaveButton"] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("6_jpt3y") +patch_margin_left = 3 +patch_margin_top = 3 +patch_margin_right = 3 +patch_margin_bottom = 3 + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem"] +layout_mode = 2 +theme_override_constants/margin_left = 40 + +[node name="AddMarkButton" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/MarginContainer"] +layout_mode = 2 +text = "添加标记" +icon_alignment = 1 + +[node name="MarkContainer" type="MarginContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem"] +layout_mode = 2 +theme_override_constants/margin_left = 40 + +[node name="MarkItem" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/MarkContainer"] +layout_mode = 2 + +[node name="MarkButton" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/MarkContainer/MarkItem"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "1001" +icon = ExtResource("8_xyhe6") +alignment = 0 +text_overrun_behavior = 3 + +[node name="Select" type="NinePatchRect" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/MarkContainer/MarkItem/MarkButton"] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("6_jpt3y") +patch_margin_left = 3 +patch_margin_top = 3 +patch_margin_right = 3 +patch_margin_bottom = 3 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn new file mode 100644 index 0000000000000000000000000000000000000000..b4a3d9aeff91a0c5092e360b8db70d7d8869cfbb --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn @@ -0,0 +1,241 @@ +[gd_scene load_steps=9 format=3 uid="uid://dh7y03tq6v0a2"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorProject/MapEditorProjectPanel.cs" id="1_5aioo"] +[ext_resource type="Texture2D" uid="uid://cajcnlimvoxk" path="res://resource/sprite/ui/commonIcon/Back.png" id="2_v0ry0"] +[ext_resource type="Texture2D" uid="uid://blfvsup876agh" path="res://resource/sprite/ui/commonIcon/Search.png" id="3_f5h8c"] +[ext_resource type="Texture2D" uid="uid://n4atvj5fkcpg" path="res://resource/sprite/ui/commonIcon/Add.png" id="4_okvq0"] +[ext_resource type="Texture2D" uid="uid://bn47bmilcw4x0" path="res://resource/sprite/ui/commonIcon/Select2.png" id="5_rcbyx"] +[ext_resource type="Texture2D" uid="uid://dggb6p4sdmfry" path="res://resource/sprite/ui/commonIcon/Edit.png" id="6_qalh0"] +[ext_resource type="Texture2D" uid="uid://c5778ntk2rdon" path="res://resource/sprite/ui/commonIcon/Delete.png" id="7_lnry3"] +[ext_resource type="Texture2D" uid="uid://c4ltpf5a3egu1" path="res://resource/sprite/ui/commonIcon/Error_mini.png" id="9_xrt38"] + +[node name="MapEditorProject" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_5aioo") +metadata/_edit_horizontal_guides_ = [449.0] + +[node name="Bg" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Bg"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/separation = 0 + +[node name="Head" type="Panel" parent="Bg/VBoxContainer"] +custom_minimum_size = Vector2(0, 70) +layout_mode = 2 + +[node name="Back" type="Button" parent="Bg/VBoxContainer/Head"] +layout_mode = 2 +offset_left = 2.0 +offset_top = 2.0 +offset_right = 62.0 +offset_bottom = 68.0 +size_flags_horizontal = 0 +icon = ExtResource("2_v0ry0") +icon_alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="Bg/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_constants/separation = 0 + +[node name="Panel" type="Panel" parent="Bg/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 2.0 + +[node name="MarginContainer" type="MarginContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 12 +theme_override_constants/margin_top = 12 +theme_override_constants/margin_right = 12 +theme_override_constants/margin_bottom = 12 + +[node name="VBoxContainer" type="VBoxContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 45) +layout_mode = 2 + +[node name="GroupSearchInput" type="LineEdit" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "搜索" + +[node name="GroupSearchButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("3_f5h8c") + +[node name="GroupAddButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("4_okvq0") + +[node name="ScrollContainer" type="ScrollContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="GroupButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 +size_flags_horizontal = 3 +text = "testGroup1" +alignment = 0 +text_overrun_behavior = 3 + +[node name="SelectTexture" type="NinePatchRect" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/GroupButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("5_rcbyx") +region_rect = Rect2(0, 0, 36, 36) +patch_margin_left = 3 +patch_margin_top = 3 +patch_margin_right = 3 +patch_margin_bottom = 3 + +[node name="Panel2" type="Panel" parent="Bg/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 8.0 + +[node name="MarginContainer" type="MarginContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel2"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 12 +theme_override_constants/margin_top = 12 +theme_override_constants/margin_right = 12 +theme_override_constants/margin_bottom = 12 + +[node name="VBoxContainer" type="VBoxContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 45) +layout_mode = 2 + +[node name="RoomSearchInput" type="LineEdit" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(500, 0) +layout_mode = 2 +placeholder_text = "搜索" + +[node name="RoomTypeButton" type="OptionButton" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 + +[node name="RoomSearchButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("3_f5h8c") + +[node name="RoomAddButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("4_okvq0") + +[node name="RoomEditButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("6_qalh0") + +[node name="RoomDeleteButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("7_lnry3") + +[node name="ScrollContainer" type="ScrollContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="RoomButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/ScrollContainer"] +custom_minimum_size = Vector2(200, 285) +layout_mode = 2 + +[node name="PreviewImage" type="TextureRect" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/ScrollContainer/RoomButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = -2.0 +offset_bottom = -87.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +stretch_mode = 5 + +[node name="RoomName" type="Label" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/ScrollContainer/RoomButton"] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -86.0 +offset_bottom = -43.0 +grow_horizontal = 2 +grow_vertical = 0 +text = "Room1" +horizontal_alignment = 1 +clip_text = true +text_overrun_behavior = 3 + +[node name="RoomType" type="Label" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/ScrollContainer/RoomButton"] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -43.0 +grow_horizontal = 2 +grow_vertical = 0 +text = "战斗" +horizontal_alignment = 1 +clip_text = true +text_overrun_behavior = 3 + +[node name="SelectTexture" type="NinePatchRect" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/ScrollContainer/RoomButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("5_rcbyx") +region_rect = Rect2(0, 0, 36, 36) +patch_margin_left = 3 +patch_margin_top = 3 +patch_margin_right = 3 +patch_margin_bottom = 3 + +[node name="ErrorTexture" type="TextureRect" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/VBoxContainer/ScrollContainer/RoomButton"] +layout_mode = 0 +offset_left = 157.0 +offset_top = 158.0 +offset_right = 197.0 +offset_bottom = 198.0 +texture = ExtResource("9_xrt38") diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorSelectObject.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorSelectObject.tscn new file mode 100644 index 0000000000000000000000000000000000000000..e56477f378e5974a434e44143d90291c420653fa --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorSelectObject.tscn @@ -0,0 +1,170 @@ +[gd_scene load_steps=5 format=3 uid="uid://ie52mo5t6l2h"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorSelectObject/MapEditorSelectObjectPanel.cs" id="1_hdfkd"] +[ext_resource type="Material" uid="uid://cces3bhds7jyi" path="res://resource/material/Blend.tres" id="2_j6gjm"] +[ext_resource type="Texture2D" uid="uid://bn47bmilcw4x0" path="res://resource/sprite/ui/commonIcon/Select2.png" id="3_4nhjm"] +[ext_resource type="Texture2D" uid="uid://blfvsup876agh" path="res://resource/sprite/ui/commonIcon/Search.png" id="3_laasd"] + +[node name="MapEditorSelectObject" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_hdfkd") + +[node name="HBoxContainer" type="HSplitContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Panel" type="Panel" parent="HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 25.0 + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/Panel/MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer/Panel/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="TypeButton" type="Button" parent="HBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer"] +custom_minimum_size = Vector2(0, 80) +layout_mode = 2 +size_flags_horizontal = 3 +text = "所有类型" + +[node name="Select" type="NinePatchRect" parent="HBoxContainer/Panel/MarginContainer/VBoxContainer/ScrollContainer/TypeButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("3_4nhjm") +patch_margin_left = 3 +patch_margin_top = 3 +patch_margin_right = 3 +patch_margin_bottom = 3 + +[node name="Panel2" type="Panel" parent="HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 75.0 + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/Panel2"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="VBoxContainer2" type="VBoxContainer" parent="HBoxContainer/Panel2/MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2"] +layout_mode = 2 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2/MarginContainer"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 +size_flags_vertical = 3 + +[node name="LineEdit" type="LineEdit" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2/MarginContainer/HBoxContainer"] +custom_minimum_size = Vector2(500, 44) +layout_mode = 2 +size_flags_vertical = 4 +placeholder_text = "搜索名称/id" + +[node name="Search" type="Button" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2/MarginContainer/HBoxContainer"] +custom_minimum_size = Vector2(44, 44) +layout_mode = 2 +size_flags_vertical = 4 +icon = ExtResource("3_laasd") + +[node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 75.0 + +[node name="ObjectButton" type="Button" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2/ScrollContainer"] +custom_minimum_size = Vector2(124, 160) +layout_mode = 2 + +[node name="PreviewImage" type="TextureRect" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2/ScrollContainer/ObjectButton"] +material = ExtResource("2_j6gjm") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = -2.0 +offset_bottom = -38.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +stretch_mode = 5 + +[node name="ObjectName" type="Label" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2/ScrollContainer/ObjectButton"] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -43.0 +offset_right = 124.0 +offset_bottom = 43.0 +grow_horizontal = 2 +grow_vertical = 0 +scale = Vector2(0.5, 0.5) +text = "武器" +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 +clip_text = true +text_overrun_behavior = 3 + +[node name="Select" type="NinePatchRect" parent="HBoxContainer/Panel2/MarginContainer/VBoxContainer2/ScrollContainer/ObjectButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("3_4nhjm") +region_rect = Rect2(0, 0, 36, 36) +patch_margin_left = 8 +patch_margin_top = 8 +patch_margin_right = 8 +patch_margin_bottom = 8 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorTools.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorTools.tscn new file mode 100644 index 0000000000000000000000000000000000000000..e22fa78c1db88ac7d468043a39b9cecacec80c11 --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/MapEditorTools.tscn @@ -0,0 +1,187 @@ +[gd_scene load_steps=10 format=3 uid="uid://b4u66mxndxbrg"] + +[ext_resource type="Script" path="res://src/game/ui/mapEditorTools/MapEditorToolsPanel.cs" id="1_mqp1c"] +[ext_resource type="Script" path="res://src/game/ui/mapEditorTools/DoorHoverArea.cs" id="2_6qfy3"] +[ext_resource type="Texture2D" uid="uid://uhhfgdhpk7i4" path="res://icon.png" id="2_rwvbg"] +[ext_resource type="Script" path="res://src/game/ui/mapEditorTools/DoorDragArea.cs" id="3_3w0w6"] +[ext_resource type="Script" path="res://src/game/ui/mapEditorTools/DoorDragButton.cs" id="3_45muq"] +[ext_resource type="Texture2D" uid="uid://4wupcp53rrpi" path="res://resource/sprite/ui/mapEditorTools/DoorDragButton.png" id="3_trbb5"] +[ext_resource type="Texture2D" uid="uid://dnty1a2tcawos" path="res://resource/sprite/ui/commonIcon/Mark.png" id="6_n7h3g"] +[ext_resource type="Script" path="res://src/game/ui/mapEditorTools/MarkTool.cs" id="7_ekxcj"] +[ext_resource type="Texture2D" uid="uid://cuntr7hec044f" path="res://resource/sprite/ui/commonIcon/Select.png" id="7_mqmd6"] + +[node name="MapEditorTools" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 1 +script = ExtResource("1_mqp1c") + +[node name="ToolRoot" type="Control" parent="."] +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="N_HoverRoot" type="Control" parent="ToolRoot"] +anchors_preset = 0 + +[node name="N_HoverArea" type="ColorRect" parent="ToolRoot/N_HoverRoot"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -36.0 +offset_right = 160.0 +grow_vertical = 0 +color = Color(1, 1, 1, 0) +script = ExtResource("2_6qfy3") + +[node name="E_HoverRoot" type="Control" parent="ToolRoot"] +anchors_preset = 0 +rotation = 1.5708 + +[node name="E_HoverArea" type="ColorRect" parent="ToolRoot/E_HoverRoot"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -36.0 +offset_right = 160.0 +grow_vertical = 0 +color = Color(1, 1, 1, 0) +script = ExtResource("2_6qfy3") + +[node name="S_HoverRoot" type="Control" parent="ToolRoot"] +anchors_preset = 0 +rotation = 3.14159 +scale = Vector2(-1, 1) + +[node name="S_HoverArea" type="ColorRect" parent="ToolRoot/S_HoverRoot"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_left = -9.12665e-05 +offset_top = -36.0 +offset_right = 160.0 +grow_vertical = 0 +color = Color(1, 1, 1, 0) +script = ExtResource("2_6qfy3") + +[node name="W_HoverRoot" type="Control" parent="ToolRoot"] +anchors_preset = 0 +rotation = 4.71239 +scale = Vector2(-1, 1) + +[node name="W_HoverArea" type="ColorRect" parent="ToolRoot/W_HoverRoot"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -36.0 +offset_right = 160.0 +grow_vertical = 0 +color = Color(1, 1, 1, 0) +script = ExtResource("2_6qfy3") + +[node name="HoverPreviewRoot" type="Control" parent="ToolRoot"] +visible = false +anchors_preset = 0 +mouse_filter = 2 + +[node name="HoverPreview" type="TextureRect" parent="ToolRoot/HoverPreviewRoot"] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -2.0 +offset_top = -36.0 +offset_right = 2.0 +grow_horizontal = 2 +grow_vertical = 0 +mouse_filter = 2 +texture = ExtResource("3_trbb5") + +[node name="DoorToolTemplate" type="Control" parent="ToolRoot"] +anchors_preset = 0 +script = ExtResource("3_3w0w6") + +[node name="DoorArea" type="ColorRect" parent="ToolRoot/DoorToolTemplate"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -32.0 +offset_right = 64.0 +grow_vertical = 0 +color = Color(0.184314, 1, 0.0392157, 0.188235) + +[node name="StartBtn" type="TextureButton" parent="ToolRoot/DoorToolTemplate"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -4.0 +offset_top = -36.0 +grow_horizontal = 0 +grow_vertical = 0 +mouse_filter = 1 +texture_normal = ExtResource("3_trbb5") +stretch_mode = 0 +script = ExtResource("3_45muq") + +[node name="EndBtn" type="TextureButton" parent="ToolRoot/DoorToolTemplate"] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_left = 64.0 +offset_top = -36.0 +offset_right = 68.0 +grow_vertical = 0 +texture_normal = ExtResource("3_trbb5") +stretch_mode = 0 +script = ExtResource("3_45muq") + +[node name="MarkTemplate" type="TextureRect" parent="ToolRoot"] +layout_mode = 0 +offset_right = 7.0 +offset_bottom = 7.0 +texture = ExtResource("6_n7h3g") +script = ExtResource("7_ekxcj") + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -84.0 +offset_top = 19.0 +offset_right = -20.0 +offset_bottom = 83.0 +grow_horizontal = 0 + +[node name="ToolButton" type="TextureButton" parent="HBoxContainer"] +layout_mode = 2 +texture_normal = ExtResource("2_rwvbg") + +[node name="Select" type="NinePatchRect" parent="HBoxContainer/ToolButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("7_mqmd6") +region_rect = Rect2(0, 0, 36, 36) +patch_margin_left = 12 +patch_margin_top = 12 +patch_margin_right = 12 +patch_margin_bottom = 12 diff --git a/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn b/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn index 46ffb26f4a80e8b8b5028b98e2e965aa22d0eab2..2a88133c476e17aa54f4a393f7ac571c58b18337 100644 --- a/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn +++ b/DungeonShooting_Godot/prefab/weapon/Weapon0001.tscn @@ -10,12 +10,20 @@ resource_local_to_scene = true shader = ExtResource("3_x1q03") shader_parameter/blend = Color(0, 0, 0, 0.470588) shader_parameter/schedule = 1.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = true +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false [sub_resource type="ShaderMaterial" id="ShaderMaterial_bj7y3"] resource_local_to_scene = true shader = ExtResource("3_x1q03") shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/schedule = 0.0 +shader_parameter/modulate = Color(1, 1, 1, 1) +shader_parameter/show_outline = true +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/outline_rainbow = false [node name="Weapon0001" node_paths=PackedStringArray("FirePoint", "ShellPoint", "GripPoint", "AnimationPlayer", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("1_ykl0r")] script = ExtResource("2_t56pk") diff --git a/DungeonShooting_Godot/resource/config/ActivityObject.json b/DungeonShooting_Godot/resource/config/ActivityObject.json index 0cd7611c89402675f10c6fc8f91d98ae81c45ee3..85aa85b43fb0e44e086b9b96014f1d332bf91958 100644 --- a/DungeonShooting_Godot/resource/config/ActivityObject.json +++ b/DungeonShooting_Godot/resource/config/ActivityObject.json @@ -2,225 +2,321 @@ { "Id": "role0001", "Type": 3, - "Name": "", - "Remark": "\u73A9\u5BB6", - "Prefab": "res://prefab/role/Role0001.tscn" + "Name": "\u73A9\u5BB6", + "Intro": "\u73A9\u5BB6", + "Details": "", + "Prefab": "res://prefab/role/Role0001.tscn", + "Icon": "res://resource/sprite/role/role0001/Role0001_Icon.png", + "ShowInMapEditor": false }, { "Id": "enemy0001", "Type": 4, - "Name": "", - "Remark": "\u654C\u4EBA", - "Prefab": "res://prefab/role/Enemy0001.tscn" + "Name": "\u654C\u4EBA", + "Intro": "\u654C\u4EBA", + "Details": "", + "Prefab": "res://prefab/role/Enemy0001.tscn", + "Icon": "res://resource/sprite/role/enemy0001/Enemy0001_Icon.png", + "ShowInMapEditor": true }, { "Id": "weapon0001", "Type": 5, "Name": "\u6B65\u67AA", - "Remark": "", - "Prefab": "res://prefab/weapon/Weapon0001.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0001.tscn", + "Icon": "res://resource/sprite/weapon/weapon0001/Weapon0001.png", + "ShowInMapEditor": true }, { "Id": "weapon0002", "Type": 5, "Name": "\u9730\u5F39\u67AA", - "Remark": "", - "Prefab": "res://prefab/weapon/Weapon0002.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0002.tscn", + "Icon": "res://resource/sprite/weapon/weapon0002/Weapon0002.png", + "ShowInMapEditor": true }, { "Id": "weapon0003", "Type": 5, "Name": "\u624B\u67AA", - "Remark": "", - "Prefab": "res://prefab/weapon/Weapon0003.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0003.tscn", + "Icon": "res://resource/sprite/weapon/weapon0003/Weapon0003.png", + "ShowInMapEditor": true }, { "Id": "weapon0004", "Type": 5, "Name": "\u5200", - "Remark": "", - "Prefab": "res://prefab/weapon/Weapon0004.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0004.tscn", + "Icon": "res://resource/sprite/weapon/knife1.png", + "ShowInMapEditor": true }, { "Id": "weapon0005", "Type": 5, "Name": "\u72D9\u51FB\u67AA", - "Remark": "", - "Prefab": "res://prefab/weapon/Weapon0005.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0005.tscn", + "Icon": "res://resource/sprite/weapon/weapon0005/Weapon0005.png", + "ShowInMapEditor": true }, { "Id": "weapon0006", "Type": 5, "Name": "\u51B2\u950B\u67AA", - "Remark": "", - "Prefab": "res://prefab/weapon/Weapon0006.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0006.tscn", + "Icon": "res://resource/sprite/weapon/weapon0006/Weapon0006.png", + "ShowInMapEditor": true }, { "Id": "weapon0007", "Type": 5, "Name": "\u6C64\u59C6\u900A\u51B2\u950B\u67AA", - "Remark": "", - "Prefab": "res://prefab/weapon/Weapon0007.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/weapon/Weapon0007.tscn", + "Icon": "res://resource/sprite/weapon/weapon0007/Weapon0007.png", + "ShowInMapEditor": true }, { "Id": "bullet0001", "Type": 6, "Name": "", - "Remark": "", - "Prefab": "res://prefab/bullet/Bullet0001.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/bullet/Bullet0001.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "bullet0002", "Type": 6, "Name": "", - "Remark": "", - "Prefab": "res://prefab/bullet/Bullet0002.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/bullet/Bullet0002.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "bullet0003", "Type": 6, "Name": "", - "Remark": "", - "Prefab": "res://prefab/bullet/Bullet0003.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/bullet/Bullet0003.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "shell0001", "Type": 7, "Name": "", - "Remark": "", - "Prefab": "res://prefab/shell/Shell0001.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/shell/Shell0001.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "shell0002", "Type": 7, "Name": "", - "Remark": "", - "Prefab": "res://prefab/shell/Shell0002.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/shell/Shell0002.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "shell0003", "Type": 7, "Name": "", - "Remark": "", - "Prefab": "res://prefab/shell/Shell0003.tscn" + "Intro": "", + "Details": "", + "Prefab": "res://prefab/shell/Shell0003.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "effect0001", "Type": 8, "Name": "", - "Remark": "\u654C\u4EBA\u6B7B\u4EA1\u788E\u7247", - "Prefab": "res://prefab/effect/activityObject/Effect0001.tscn" + "Intro": "\u654C\u4EBA\u6B7B\u4EA1\u788E\u7247", + "Details": "", + "Prefab": "res://prefab/effect/activityObject/Effect0001.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "prop0001", "Type": 9, "Name": "\u978B\u5B50", - "Remark": "\u63D0\u9AD8\u79FB\u52A8\u901F\u5EA6", - "Prefab": "res://prefab/prop/buff/BuffProp0001.tscn" + "Intro": "\u63D0\u9AD8\u79FB\u52A8\u901F\u5EA6", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0001.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0001.png", + "ShowInMapEditor": true }, { "Id": "prop0002", "Type": 9, "Name": "\u5FC3\u4E4B\u5BB9\u5668", - "Remark": "\u63D0\u9AD8\u8840\u91CF\u4E0A\u9650", - "Prefab": "res://prefab/prop/buff/BuffProp0002.tscn" + "Intro": "\u63D0\u9AD8\u8840\u91CF\u4E0A\u9650", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0002.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0002.png", + "ShowInMapEditor": true }, { "Id": "prop0003", "Type": 9, "Name": "\u62A4\u76FE", - "Remark": "\u53EF\u4EE5\u62B5\u6321\u5B50\u5F39\uFF0C\u968F\u65F6\u95F4\u63A8\u79FB\u81EA\u52A8\u6062\u590D", - "Prefab": "res://prefab/prop/buff/BuffProp0003.tscn" + "Intro": "\u53EF\u4EE5\u62B5\u6321\u5B50\u5F39\uFF0C\u968F\u65F6\u95F4\u63A8\u79FB\u81EA\u52A8\u6062\u590D", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0003.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0003.png", + "ShowInMapEditor": true }, { "Id": "prop0004", "Type": 9, "Name": "\u62A4\u76FE\u8BA1\u65F6\u5668", - "Remark": "\u63D0\u9AD8\u62A4\u76FE\u6062\u590D\u901F\u5EA6", - "Prefab": "res://prefab/prop/buff/BuffProp0004.tscn" + "Intro": "\u63D0\u9AD8\u62A4\u76FE\u6062\u590D\u901F\u5EA6", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0004.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0004.png", + "ShowInMapEditor": true }, { "Id": "prop0005", "Type": 9, "Name": "\u6740\u4F24\u5F39", - "Remark": "\u63D0\u9AD8\u5B50\u5F39\u4F24\u5BB3", - "Prefab": "res://prefab/prop/buff/BuffProp0005.tscn" + "Intro": "\u63D0\u9AD8\u5B50\u5F39\u4F24\u5BB3", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0005.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0005.png", + "ShowInMapEditor": true }, { "Id": "prop0006", "Type": 9, "Name": "\u7EA2\u5B9D\u77F3\u6212\u6307", - "Remark": "\u53D7\u4F24\u540E\u5EF6\u957F\u65E0\u654C\u65F6\u95F4", - "Prefab": "res://prefab/prop/buff/BuffProp0006.tscn" + "Intro": "\u53D7\u4F24\u540E\u5EF6\u957F\u65E0\u654C\u65F6\u95F4", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0006.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0006.png", + "ShowInMapEditor": true }, { "Id": "prop0007", "Type": 9, "Name": "\u5907\u7528\u62A4\u76FE", - "Remark": "\u53D7\u4F24\u65F6\u6709\u4E00\u5B9A\u6982\u7387\u62B5\u6D88\u4F24\u5BB3", - "Prefab": "res://prefab/prop/buff/BuffProp0007.tscn" + "Intro": "\u53D7\u4F24\u65F6\u6709\u4E00\u5B9A\u6982\u7387\u62B5\u6D88\u4F24\u5BB3", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0007.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0007.png", + "ShowInMapEditor": true }, { "Id": "prop0008", "Type": 9, "Name": "\u773C\u955C", - "Remark": "\u63D0\u9AD8\u6B66\u5668\u7CBE\u51C6\u5EA6", - "Prefab": "res://prefab/prop/buff/BuffProp0008.tscn" + "Intro": "\u63D0\u9AD8\u6B66\u5668\u7CBE\u51C6\u5EA6", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0008.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0008.png", + "ShowInMapEditor": true }, { "Id": "prop0009", "Type": 9, "Name": "\u9AD8\u901F\u5B50\u5F39", - "Remark": "\u63D0\u9AD8\u5B50\u5F39\u901F\u5EA6\u548C\u5C04\u7A0B", - "Prefab": "res://prefab/prop/buff/BuffProp0009.tscn" + "Intro": "\u63D0\u9AD8\u5B50\u5F39\u901F\u5EA6\u548C\u5C04\u7A0B", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0009.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0009.png", + "ShowInMapEditor": true }, { "Id": "prop0010", "Type": 9, "Name": "\u5206\u88C2\u5B50\u5F39", - "Remark": "\u5B50\u5F39\u6570\u91CF\u7FFB\u500D, \u4F46\u662F\u7CBE\u51C6\u5EA6\u548C\u4F24\u5BB3\u964D\u4F4E", - "Prefab": "res://prefab/prop/buff/BuffProp0010.tscn" + "Intro": "\u5B50\u5F39\u6570\u91CF\u7FFB\u500D, \u4F46\u662F\u7CBE\u51C6\u5EA6\u548C\u4F24\u5BB3\u964D\u4F4E", + "Details": "", + "Prefab": "res://prefab/prop/buff/BuffProp0010.tscn", + "Icon": "res://resource/sprite/prop/buff/BuffProp0010.png", + "ShowInMapEditor": true }, { "Id": "prop5000", "Type": 9, "Name": "\u533B\u836F\u7BB1", - "Remark": "\u4F7F\u7528\u540E\u56DE\u590D\u4E00\u9897\u7EA2\u5FC3", - "Prefab": "res://prefab/prop/active/ActiveProp5000.tscn" + "Intro": "\u4F7F\u7528\u540E\u56DE\u590D\u4E00\u9897\u7EA2\u5FC3", + "Details": "", + "Prefab": "res://prefab/prop/active/ActiveProp5000.tscn", + "Icon": "res://resource/sprite/prop/active/ActiveProp5000.png", + "ShowInMapEditor": true }, { "Id": "prop5001", "Type": 9, "Name": "\u5F39\u836F\u7BB1", - "Remark": "\u4F7F\u7528\u540E\u8865\u5145\u5F53\u524D\u6B66\u5668\u5907\u7528\u5F39\u836F", - "Prefab": "res://prefab/prop/active/ActiveProp5001.tscn" + "Intro": "\u4F7F\u7528\u540E\u8865\u5145\u5F53\u524D\u6B66\u5668\u5907\u7528\u5F39\u836F", + "Details": "", + "Prefab": "res://prefab/prop/active/ActiveProp5001.tscn", + "Icon": "res://resource/sprite/prop/active/ActiveProp5001.png", + "ShowInMapEditor": true }, { "Id": "other_door_e", "Type": 99, "Name": "", - "Remark": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u4E1C\u4FA7)", - "Prefab": "res://prefab/map/RoomDoor_E.tscn" + "Intro": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u4E1C\u4FA7)", + "Details": "", + "Prefab": "res://prefab/map/RoomDoor_E.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "other_door_w", "Type": 99, "Name": "", - "Remark": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u897F\u4FA7)", - "Prefab": "res://prefab/map/RoomDoor_W.tscn" + "Intro": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u897F\u4FA7)", + "Details": "", + "Prefab": "res://prefab/map/RoomDoor_W.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "other_door_s", "Type": 99, "Name": "", - "Remark": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u5357\u4FA7)", - "Prefab": "res://prefab/map/RoomDoor_S.tscn" + "Intro": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u5357\u4FA7)", + "Details": "", + "Prefab": "res://prefab/map/RoomDoor_S.tscn", + "Icon": "", + "ShowInMapEditor": false }, { "Id": "other_door_n", "Type": 99, "Name": "", - "Remark": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u5317\u4FA7)", - "Prefab": "res://prefab/map/RoomDoor_N.tscn" + "Intro": "\u5730\u7262\u623F\u95F4\u7684\u95E8(\u5317\u4FA7)", + "Details": "", + "Prefab": "res://prefab/map/RoomDoor_N.tscn", + "Icon": "", + "ShowInMapEditor": false } ] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/config/Weapon.json b/DungeonShooting_Godot/resource/config/Weapon.json index 5e197fdc8efdcc35aa3b6901de0500e2dbbe79ba..2ee18aac2c074d402221f59e81d9ab71565de40d 100644 --- a/DungeonShooting_Godot/resource/config/Weapon.json +++ b/DungeonShooting_Godot/resource/config/Weapon.json @@ -3,7 +3,6 @@ "Id": "0001", "WeaponId": "weapon0001", "Remark": "\u6B65\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": true, @@ -76,7 +75,6 @@ "Id": "0002", "WeaponId": "", "Remark": "\u6B65\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": false, @@ -149,7 +147,6 @@ "Id": "0003", "WeaponId": "weapon0002", "Remark": "\u9730\u5F39\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": false, @@ -222,7 +219,6 @@ "Id": "0004", "WeaponId": "", "Remark": "\u9730\u5F39\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": false, @@ -295,7 +291,6 @@ "Id": "0005", "WeaponId": "weapon0003", "Remark": "\u624B\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 20, "WeightType": 1, "ContinuousShoot": false, @@ -368,7 +363,6 @@ "Id": "0006", "WeaponId": "", "Remark": "\u624B\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 20, "WeightType": 1, "ContinuousShoot": false, @@ -441,7 +435,6 @@ "Id": "0007", "WeaponId": "weapon0004", "Remark": "\u5200", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": false, @@ -514,7 +507,6 @@ "Id": "0008", "WeaponId": "", "Remark": "\u5200", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": false, @@ -587,7 +579,6 @@ "Id": "0009", "WeaponId": "weapon0005", "Remark": "\u72D9\u51FB\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 50, "WeightType": 2, "ContinuousShoot": false, @@ -660,7 +651,6 @@ "Id": "0010", "WeaponId": "", "Remark": "\u72D9\u51FB\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 50, "WeightType": 2, "ContinuousShoot": false, @@ -733,7 +723,6 @@ "Id": "0011", "WeaponId": "weapon0006", "Remark": "\u51B2\u950B\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 30, "WeightType": 2, "ContinuousShoot": true, @@ -806,7 +795,6 @@ "Id": "0012", "WeaponId": "", "Remark": "\u51B2\u950B\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 30, "WeightType": 2, "ContinuousShoot": false, @@ -879,7 +867,6 @@ "Id": "0013", "WeaponId": "weapon0007", "Remark": "\u6C64\u59C6\u900A\u51B2\u950B\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": true, @@ -952,7 +939,6 @@ "Id": "0014", "WeaponId": "", "Remark": "\u6C64\u59C6\u900A\u51B2\u950B\u67AA", - "Icon": "res://resource/sprite/gun/gun4.png", "Weight": 40, "WeightType": 2, "ContinuousShoot": false, diff --git a/DungeonShooting_Godot/resource/map/RoomConfig.json b/DungeonShooting_Godot/resource/map/RoomConfig.json deleted file mode 100644 index c718336c95c3ff245fc4d12676888fbeaaeb3619..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/RoomConfig.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "testGroup": { - "GroupName": "testGroup", - "BattleList": [ - { - "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room1.json" - }, - { - "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room2.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room2.json" - }, - { - "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room3.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room3.json" - }, - { - "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room4.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room4.json" - }, - { - "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room5.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room5.json" - }, - { - "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room6.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room6.json" - }, - { - "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room8.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room8.json" - } - ], - "InletList": [ - { - "ScenePath": "res://resource/map/tileMaps/testGroup/inlet/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/inlet/Room1.json" - } - ], - "OutletList": [ - { - "ScenePath": "res://resource/map/tileMaps/testGroup/outlet/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/outlet/Room1.json" - } - ], - "BossList": [ - { - "ScenePath": "res://resource/map/tileMaps/testGroup/boss/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/boss/Room1.json" - } - ], - "RewardList": [], - "ShopList": [], - "EventList": [] - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json new file mode 100644 index 0000000000000000000000000000000000000000..ce8105fe85b91009a1deeaf9a906945037af78ed --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json @@ -0,0 +1,36 @@ +{ + "TestGroup1": { + "GroupName": "TestGroup1", + "BattleList": [ + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/TestGroup1/battle/Battle1" + }, + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/TestGroup1/battle/Battle2" + }, + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/TestGroup1/battle/Battle3" + } + ], + "InletList": [ + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/TestGroup1/inlet/Start1" + } + ], + "OutletList": [ + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/TestGroup1/outlet/End1" + } + ], + "BossList": [], + "RewardList": [], + "ShopList": [], + "EventList": [], + "Remark": "\u6D4B\u8BD5\u7EC4" + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preinstall.json new file mode 100644 index 0000000000000000000000000000000000000000..67fa1843663e996857bf770d39d9f56dc4112ab9 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":-4,"Y":-6},"Size":{"X":30,"Y":26},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0002","CurrAmmon":"7","ResidueAmmo":"7"},"Altitude":0,"VerticalSpeed":0}]},{"Position":{"X":38,"Y":48},"Size":{"X":31,"Y":25},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0002","CurrAmmon":"7","ResidueAmmo":"7"},"Altitude":0,"VerticalSpeed":0}]}],[{"Position":{"X":38,"Y":-3},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0007","CurrAmmon":"60","ResidueAmmo":"60"},"Altitude":0,"VerticalSpeed":0}]}],[{"Position":{"X":-9,"Y":38},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0007","CurrAmmon":"60","ResidueAmmo":"60"},"Altitude":0,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preview.png new file mode 100644 index 0000000000000000000000000000000000000000..eb42965134d7e51aca87cbe46dc0038b436b4958 Binary files /dev/null and b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preview.png differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preview.png.import new file mode 100644 index 0000000000000000000000000000000000000000..67c37b05e32f110adbded0c0fe6eb3f12c8023c8 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b6aer1lyhcs12" +path="res://.godot/imported/Preview.png-31623ec49f994abd8521d4b3faef200a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/TestGroup1/battle/Battle1/Preview.png" +dest_files=["res://.godot/imported/Preview.png-31623ec49f994abd8521d4b3faef200a.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/map/tileMaps/TestGroup1/battle/Battle1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/RoomInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..1e6b2693aeca9d31b4172b917eea0b164be7086c --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-7,"Y":-7},"Size":{"X":23,"Y":16},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":224},{"Direction":2,"Start":0,"End":224},{"Direction":0,"Start":144,"End":208},{"Direction":0,"Start":16,"End":80},{"Direction":1,"Start":0,"End":224}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Battle1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/TileInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..1d76fc51b9414e74083eb461d66db5a58252b801 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle1/TileInfo.json @@ -0,0 +1 @@ +{"NavigationList":[{"Type":0,"Points":[-88,-88,120,-88,120,-8,168,-8,168,-88,184,-88,184,-72,232,-72,232,-16,184,-16,184,56,232,56,232,112,184,112,184,128,168,128,168,32,120,32,120,128,-88,128]},{"Type":1,"Points":[-72,-64,8,-64,8,-24,-24,-24,-24,8,-72,8]},{"Type":1,"Points":[24,-64,104,-64,104,8,56,8,56,-24,24,-24]},{"Type":1,"Points":[-72,32,-24,32,-24,64,8,64,8,104,-72,104]},{"Type":1,"Points":[56,32,104,32,104,104,24,104,24,64,56,64]}],"Floor":[10,-1,0,0,8,10,1,0,0,8,10,0,0,0,8,10,2,0,0,8,10,3,0,0,8,10,4,0,0,8,10,5,0,0,8,10,6,0,0,8,10,7,0,0,8,10,-6,0,0,8,10,-5,0,0,8,10,-4,0,0,8,10,-3,0,0,8,10,-2,0,0,8,9,1,0,0,8,9,0,0,0,8,9,-1,0,0,8,8,1,0,0,8,8,0,0,0,8,8,-1,0,0,8,-6,-6,0,0,8,-6,-5,0,0,8,-6,-4,0,0,8,-6,-3,0,0,8,-6,-2,0,0,8,-6,-1,0,0,8,-6,0,0,0,8,-6,1,0,0,8,-6,2,0,0,8,-6,3,0,0,8,-6,4,0,0,8,-6,5,0,0,8,-6,6,0,0,8,-6,7,0,0,8,-5,-6,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,4,0,0,8,-5,5,0,0,8,-5,6,0,0,8,-5,7,0,0,8,-4,-6,0,0,8,-4,-5,0,0,8,-4,0,0,0,8,-4,1,0,0,8,-4,7,0,0,8,-4,6,0,0,8,-3,-6,0,0,8,-3,-5,0,0,8,-3,0,0,0,8,-3,1,0,0,8,-3,7,0,0,8,-3,6,0,0,8,-2,-6,0,0,8,-2,-5,0,0,8,-2,-2,0,0,8,-2,-1,0,0,8,-2,0,0,0,8,-2,1,0,0,8,-2,2,0,0,8,-2,3,0,0,8,-2,7,0,0,8,-2,6,0,0,8,-1,-6,0,0,8,-1,-5,0,0,8,-1,-2,0,0,8,-1,-1,0,0,8,-1,0,0,0,8,-1,1,0,0,8,-1,2,0,0,8,-1,3,0,0,8,-1,7,0,0,8,-1,6,0,0,8,0,-6,0,0,8,0,-5,0,0,8,0,-4,0,0,8,0,-3,0,0,8,0,-2,0,0,8,0,-1,0,0,8,0,2,0,0,8,0,3,0,0,8,0,4,0,0,8,0,5,0,0,8,0,6,0,0,8,0,7,0,0,8,0,0,0,0,8,0,1,0,0,8,1,-6,0,0,8,1,-5,0,0,8,1,-4,0,0,8,1,-3,0,0,8,1,-2,0,0,8,1,-1,0,0,8,1,2,0,0,8,1,3,0,0,8,1,4,0,0,8,1,5,0,0,8,1,6,0,0,8,1,7,0,0,8,1,1,0,0,8,1,0,0,0,8,2,-6,0,0,8,2,-5,0,0,8,2,-2,0,0,8,2,-1,0,0,8,2,0,0,0,8,2,1,0,0,8,2,2,0,0,8,2,3,0,0,8,2,7,0,0,8,2,6,0,0,8,3,-6,0,0,8,3,-5,0,0,8,3,-2,0,0,8,3,-1,0,0,8,3,0,0,0,8,3,1,0,0,8,3,2,0,0,8,3,3,0,0,8,3,7,0,0,8,3,6,0,0,8,4,-6,0,0,8,4,-5,0,0,8,4,0,0,0,8,4,1,0,0,8,4,7,0,0,8,4,6,0,0,8,5,-6,0,0,8,5,-5,0,0,8,5,0,0,0,8,5,1,0,0,8,5,7,0,0,8,5,6,0,0,8,6,-6,0,0,8,6,-5,0,0,8,6,-4,0,0,8,6,-3,0,0,8,6,-2,0,0,8,6,-1,0,0,8,6,0,0,0,8,6,1,0,0,8,6,2,0,0,8,6,3,0,0,8,6,4,0,0,8,6,5,0,0,8,6,6,0,0,8,6,7,0,0,8,7,-6,0,0,8,7,-5,0,0,8,7,-4,0,0,8,7,-3,0,0,8,7,-2,0,0,8,7,-1,0,0,8,7,0,0,0,8,7,1,0,0,8,7,2,0,0,8,7,3,0,0,8,7,4,0,0,8,7,5,0,0,8,7,6,0,0,8,7,7,0,0,8,11,7,0,0,8,11,6,0,0,8,11,5,0,0,8,11,4,0,0,8,11,3,0,0,8,11,2,0,0,8,11,1,0,0,8,11,0,0,0,8,11,-1,0,0,8,11,-2,0,0,8,11,-3,0,0,8,11,-4,0,0,8,11,-5,0,0,8,11,-6,0,0,8,12,-2,0,0,8,12,-5,0,0,8,12,-3,0,0,8,12,-4,0,0,8,12,3,0,0,8,12,4,0,0,8,12,5,0,0,8,12,6,0,0,8,13,-2,0,0,8,13,-5,0,0,8,13,-4,0,0,8,13,-3,0,0,8,13,6,0,0,8,13,5,0,0,8,13,4,0,0,8,13,3,0,0,8,14,-2,0,0,8,14,-5,0,0,8,14,-4,0,0,8,14,-3,0,0,8,14,4,0,0,8,14,3,0,0,8,14,5,0,0,8,14,6,0,0,8],"Middle":[-6,-7,0,2,7,-5,-7,0,2,7,-4,-7,0,2,7,-4,-1,0,1,7,-4,5,0,1,7,-3,-7,0,2,7,-3,-1,0,3,7,-3,5,0,2,7,-2,-7,0,2,7,-2,-3,0,2,7,-2,5,0,2,7,-1,-7,0,2,7,-1,-3,0,3,7,-1,5,0,3,7,0,-7,0,2,7,1,-7,0,2,7,2,-7,0,2,7,2,-3,0,1,7,2,5,0,1,7,3,-7,0,2,7,3,-3,0,2,7,3,5,0,2,7,4,-7,0,2,7,4,-1,0,1,7,4,5,0,2,7,5,-7,0,2,7,5,-1,0,3,7,5,5,0,3,7,6,-7,0,2,7,7,-7,0,2,7,8,-2,0,1,7,9,-2,0,3,7,10,-7,0,2,7,11,-7,0,2,7,12,-6,0,1,7,12,2,0,1,7,13,-6,0,2,7,13,2,0,2,7,14,-6,0,2,7,14,2,0,2,7],"Top":[-7,-7,0,3,4,-7,-6,0,3,3,-7,-5,0,3,3,-7,-4,0,3,3,-7,-3,0,3,3,-7,-2,0,3,3,-7,-1,0,3,3,-7,0,0,3,3,-7,1,0,3,3,-7,2,0,3,3,-7,3,0,3,3,-7,4,0,3,3,-7,5,0,3,3,-7,6,0,3,3,-7,7,0,3,3,-7,8,0,11,2,-6,8,0,2,2,-5,8,0,2,2,-4,-4,0,1,2,-4,-3,0,1,3,-4,-2,0,1,3,-4,2,0,1,2,-4,3,0,1,3,-4,4,0,1,3,-4,8,0,2,2,-3,-4,0,2,2,-3,-3,0,3,4,-3,-2,0,3,3,-3,2,0,3,2,-3,3,0,3,3,-3,4,0,11,2,-3,8,0,2,2,-2,-4,0,2,2,-2,4,0,2,2,-2,8,0,2,2,-1,-4,0,3,2,-1,4,0,3,2,-1,8,0,2,2,0,8,0,2,2,1,8,0,2,2,2,-4,0,1,2,2,4,0,1,2,2,8,0,2,2,3,-4,0,2,2,3,4,0,2,2,3,8,0,2,2,4,-4,0,2,2,4,-3,0,1,4,4,-2,0,1,3,4,2,0,1,2,4,3,0,1,3,4,4,0,13,2,4,8,0,2,2,5,-4,0,3,2,5,-3,0,3,3,5,-2,0,3,3,5,2,0,3,2,5,3,0,3,3,5,4,0,3,3,5,8,0,2,2,6,8,0,2,2,7,8,0,2,2,8,-7,0,1,4,8,-6,0,1,3,8,-5,0,1,3,8,-4,0,1,3,8,-3,0,1,3,8,2,0,1,2,8,3,0,1,3,8,4,0,1,3,8,5,0,1,3,8,6,0,1,3,8,7,0,1,3,8,8,0,13,2,9,-7,0,3,4,9,-6,0,3,3,9,-5,0,3,3,9,-4,0,3,3,9,-3,0,3,3,9,2,0,3,2,9,3,0,3,3,9,4,0,3,3,9,5,0,3,3,9,6,0,3,3,9,7,0,3,3,9,8,0,11,2,10,8,0,2,2,11,8,0,2,2,12,-7,0,1,4,12,-1,0,1,2,12,0,0,1,3,12,1,0,1,3,12,7,0,1,2,12,8,0,13,2,13,-1,0,2,2,13,7,0,2,2,14,-1,0,2,2,14,7,0,2,2,15,-6,0,1,4,15,-5,0,1,3,15,-4,0,1,3,15,-3,0,1,3,15,-2,0,1,3,15,-1,0,13,2,15,2,0,1,4,15,3,0,1,3,15,4,0,1,3,15,5,0,1,3,15,6,0,1,3,15,7,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preinstall.json new file mode 100644 index 0000000000000000000000000000000000000000..1e5adb4bc647674a03954819a854da6b62453c29 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":178,"Y":-21},"Size":{"X":92,"Y":73},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0007","CurrAmmon":"60","ResidueAmmo":"60"},"Altitude":0,"VerticalSpeed":0}]},{"Position":{"X":76,"Y":140},"Size":{"X":43,"Y":77},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":null},"Altitude":0,"VerticalSpeed":0}]}],[{"Position":{"X":89,"Y":19},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":null},"Altitude":0,"VerticalSpeed":0}]}],[{"Position":{"X":78,"Y":89},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":null},"Altitude":0,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png new file mode 100644 index 0000000000000000000000000000000000000000..7f5ea4d77abb426affe3af4a0ccd7abbefbcf908 Binary files /dev/null and b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png.import new file mode 100644 index 0000000000000000000000000000000000000000..47c9f9a703f3c146138dd657156bb0d345de50d3 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7jrgj84mv7k6" +path="res://.godot/imported/Preview.png-7b1ebf12bb329f0035c1b1e63fdb4dac.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png" +dest_files=["res://.godot/imported/Preview.png-7b1ebf12bb329f0035c1b1e63fdb4dac.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/map/tileMaps/TestGroup1/battle/Battle2/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/RoomInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..24c608af4573ee7bc434458797d7aff1243fcb41 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-8,"Y":-6},"Size":{"X":25,"Y":22},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":64},{"Direction":1,"Start":0,"End":240},{"Direction":2,"Start":96,"End":368},{"Direction":0,"Start":240,"End":320},{"Direction":0,"Start":0,"End":112},{"Direction":3,"Start":144,"End":368}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Battle2","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/TileInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..38a683d75a527ea166a14e8a110314413acae878 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/TileInfo.json @@ -0,0 +1 @@ +{"NavigationList":[{"Type":0,"Points":[-104,-72,-56,-72,-56,56,40,56,40,-72,248,-72,248,32,120,32,120,168,248,168,248,240,-8,240,-8,200,8,200,8,144,-40,144,-40,160,-104,160]}],"Floor":[15,14,0,0,8,15,13,0,0,8,15,12,0,0,8,15,11,0,0,8,15,10,0,0,8,15,1,0,0,8,15,0,0,0,8,15,-1,0,0,8,15,-2,0,0,8,15,-3,0,0,8,15,-4,0,0,8,15,-5,0,0,8,14,14,0,0,8,14,13,0,0,8,14,12,0,0,8,14,11,0,0,8,14,10,0,0,8,14,1,0,0,8,14,0,0,0,8,14,-1,0,0,8,14,-2,0,0,8,14,-3,0,0,8,14,-4,0,0,8,14,-5,0,0,8,13,14,0,0,8,13,13,0,0,8,13,12,0,0,8,13,11,0,0,8,13,10,0,0,8,13,1,0,0,8,13,0,0,0,8,13,-1,0,0,8,13,-2,0,0,8,13,-3,0,0,8,13,-4,0,0,8,13,-5,0,0,8,12,14,0,0,8,12,13,0,0,8,12,12,0,0,8,12,11,0,0,8,12,10,0,0,8,12,1,0,0,8,12,0,0,0,8,12,-1,0,0,8,12,-2,0,0,8,12,-3,0,0,8,12,-4,0,0,8,12,-5,0,0,8,11,14,0,0,8,11,13,0,0,8,11,12,0,0,8,11,11,0,0,8,11,10,0,0,8,11,1,0,0,8,11,0,0,0,8,11,-1,0,0,8,11,-2,0,0,8,11,-3,0,0,8,11,-4,0,0,8,11,-5,0,0,8,10,14,0,0,8,10,13,0,0,8,10,12,0,0,8,10,11,0,0,8,10,10,0,0,8,10,1,0,0,8,10,0,0,0,8,10,-1,0,0,8,10,-2,0,0,8,10,-3,0,0,8,10,-4,0,0,8,10,-5,0,0,8,9,14,0,0,8,9,13,0,0,8,9,12,0,0,8,9,11,0,0,8,9,10,0,0,8,9,1,0,0,8,9,0,0,0,8,9,-1,0,0,8,9,-2,0,0,8,9,-3,0,0,8,9,-4,0,0,8,9,-5,0,0,8,8,14,0,0,8,8,13,0,0,8,8,12,0,0,8,8,11,0,0,8,8,10,0,0,8,8,1,0,0,8,8,0,0,0,8,8,-1,0,0,8,8,-2,0,0,8,8,-3,0,0,8,8,-4,0,0,8,8,-5,0,0,8,7,14,0,0,8,7,13,0,0,8,7,12,0,0,8,7,11,0,0,8,7,10,0,0,8,7,9,0,0,8,7,8,0,0,8,7,7,0,0,8,7,6,0,0,8,7,5,0,0,8,7,4,0,0,8,7,3,0,0,8,7,2,0,0,8,7,1,0,0,8,7,0,0,0,8,7,-1,0,0,8,7,-2,0,0,8,7,-3,0,0,8,7,-4,0,0,8,7,-5,0,0,8,6,14,0,0,8,6,13,0,0,8,6,12,0,0,8,6,11,0,0,8,6,10,0,0,8,6,9,0,0,8,6,8,0,0,8,6,7,0,0,8,6,6,0,0,8,6,5,0,0,8,6,4,0,0,8,6,3,0,0,8,6,2,0,0,8,6,1,0,0,8,6,0,0,0,8,6,-1,0,0,8,6,-2,0,0,8,6,-3,0,0,8,6,-4,0,0,8,6,-5,0,0,8,5,14,0,0,8,5,13,0,0,8,5,12,0,0,8,5,11,0,0,8,5,10,0,0,8,5,9,0,0,8,5,8,0,0,8,5,7,0,0,8,5,6,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,-4,0,0,8,5,-5,0,0,8,4,14,0,0,8,4,13,0,0,8,4,12,0,0,8,4,11,0,0,8,4,10,0,0,8,4,9,0,0,8,4,8,0,0,8,4,7,0,0,8,4,6,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,-4,0,0,8,4,-5,0,0,8,3,14,0,0,8,3,13,0,0,8,3,12,0,0,8,3,11,0,0,8,3,10,0,0,8,3,9,0,0,8,3,8,0,0,8,3,7,0,0,8,3,6,0,0,8,3,5,0,0,8,3,4,0,0,8,3,3,0,0,8,3,2,0,0,8,3,1,0,0,8,3,0,0,0,8,3,-1,0,0,8,3,-2,0,0,8,3,-3,0,0,8,3,-4,0,0,8,3,-5,0,0,8,2,14,0,0,8,2,13,0,0,8,2,12,0,0,8,2,11,0,0,8,2,10,0,0,8,2,9,0,0,8,2,8,0,0,8,2,7,0,0,8,2,6,0,0,8,2,5,0,0,8,2,4,0,0,8,2,3,0,0,8,2,2,0,0,8,2,1,0,0,8,2,0,0,0,8,2,-1,0,0,8,2,-2,0,0,8,2,-3,0,0,8,2,-4,0,0,8,2,-5,0,0,8,-3,9,0,0,8,-3,8,0,0,8,-3,7,0,0,8,-3,6,0,0,8,-3,5,0,0,8,-3,4,0,0,8,-3,3,0,0,8,-4,9,0,0,8,-4,8,0,0,8,-4,7,0,0,8,-4,6,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,-4,0,0,8,-4,-5,0,0,8,-5,9,0,0,8,-5,8,0,0,8,-5,7,0,0,8,-5,6,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,-4,0,0,8,-5,-5,0,0,8,-6,9,0,0,8,-6,8,0,0,8,-6,7,0,0,8,-6,6,0,0,8,-6,5,0,0,8,-6,4,0,0,8,-6,3,0,0,8,-6,2,0,0,8,-6,1,0,0,8,-6,0,0,0,8,-6,-1,0,0,8,-6,-2,0,0,8,-6,-3,0,0,8,-6,-4,0,0,8,-6,-5,0,0,8,-7,9,0,0,8,-7,8,0,0,8,-7,7,0,0,8,-7,6,0,0,8,-7,5,0,0,8,-7,4,0,0,8,-7,3,0,0,8,-7,2,0,0,8,-7,1,0,0,8,-7,0,0,0,8,-7,-1,0,0,8,-7,-2,0,0,8,-7,-3,0,0,8,-7,-4,0,0,8,-7,-5,0,0,8,1,14,0,0,8,1,13,0,0,8,1,12,0,0,8,1,11,0,0,8,1,10,0,0,8,1,9,0,0,8,1,8,0,0,8,1,7,0,0,8,1,6,0,0,8,1,5,0,0,8,1,4,0,0,8,1,3,0,0,8,0,14,0,0,8,0,13,0,0,8,0,12,0,0,8,0,11,0,0,8,0,10,0,0,8,0,9,0,0,8,0,8,0,0,8,0,7,0,0,8,0,6,0,0,8,0,5,0,0,8,0,4,0,0,8,0,3,0,0,8,-1,14,0,0,8,-1,13,0,0,8,-1,12,0,0,8,-1,8,0,0,8,-1,7,0,0,8,-1,6,0,0,8,-1,5,0,0,8,-1,4,0,0,8,-1,3,0,0,8,-2,8,0,0,8,-2,7,0,0,8,-2,6,0,0,8,-2,5,0,0,8,-2,4,0,0,8,-2,3,0,0,8],"Middle":[-7,-6,0,2,7,-6,-6,0,2,7,-5,-6,0,2,7,-4,-6,0,2,7,-3,2,0,1,7,-2,2,0,2,7,-1,2,0,2,7,-1,11,0,3,7,0,2,0,2,7,1,2,0,3,7,2,-6,0,2,7,3,-6,0,2,7,4,-6,0,2,7,5,-6,0,2,7,6,-6,0,2,7,7,-6,0,2,7,8,-6,0,2,7,8,9,0,1,7,9,-6,0,2,7,9,9,0,2,7,10,-6,0,2,7,10,9,0,2,7,11,-6,0,2,7,11,9,0,2,7,12,-6,0,2,7,12,9,0,2,7,13,-6,0,2,7,13,9,0,2,7,14,-6,0,2,7,14,9,0,2,7,15,-6,0,2,7,15,9,0,2,7],"Top":[-8,-6,0,3,4,-8,-5,0,3,3,-8,-4,0,3,3,-8,-3,0,3,3,-8,-2,0,3,3,-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,11,2,-7,10,0,2,2,-6,10,0,2,2,-5,10,0,2,2,-4,10,0,2,2,-3,-6,0,1,4,-3,-5,0,1,3,-3,-4,0,1,3,-3,-3,0,1,3,-3,-2,0,1,3,-3,-1,0,1,3,-3,0,0,1,3,-3,1,0,1,3,-3,10,0,2,2,-2,9,0,1,2,-2,10,0,13,2,-2,11,0,3,4,-2,12,0,3,3,-2,13,0,3,3,-2,14,0,3,3,-2,15,0,11,2,-1,9,0,3,2,-1,10,0,3,3,-1,15,0,2,2,0,15,0,2,2,1,-6,0,3,4,1,-5,0,3,3,1,-4,0,3,3,1,-3,0,3,3,1,-2,0,3,3,1,-1,0,3,3,1,0,0,3,3,1,1,0,3,3,1,15,0,2,2,2,15,0,2,2,3,15,0,2,2,4,15,0,2,2,5,15,0,2,2,6,15,0,2,2,7,15,0,2,2,8,2,0,1,2,8,3,0,1,3,8,4,0,1,3,8,5,0,1,3,8,6,0,1,3,8,7,0,1,3,8,8,0,1,3,8,15,0,2,2,9,2,0,2,2,9,15,0,2,2,10,2,0,2,2,10,15,0,2,2,11,2,0,2,2,11,15,0,2,2,12,2,0,2,2,12,15,0,2,2,13,2,0,2,2,13,15,0,2,2,14,2,0,2,2,14,15,0,2,2,15,2,0,2,2,15,15,0,2,2,16,-6,0,1,4,16,-5,0,1,3,16,-4,0,1,3,16,-3,0,1,3,16,-2,0,1,3,16,-1,0,1,3,16,0,0,1,3,16,1,0,1,3,16,2,0,13,2,16,9,0,1,4,16,10,0,1,3,16,11,0,1,3,16,12,0,1,3,16,13,0,1,3,16,14,0,1,3,16,15,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preinstall.json new file mode 100644 index 0000000000000000000000000000000000000000..2ef21ca5a547205b9a7ab7839a6235b27d57d5cf --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"test12","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":68,"Y":40},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":null},"Altitude":0,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png new file mode 100644 index 0000000000000000000000000000000000000000..12a17debd35e0602509a06f994aa09e3087f5341 Binary files /dev/null and b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png.import new file mode 100644 index 0000000000000000000000000000000000000000..792054f61bf1b503e9605521e5e5d6291035d336 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b3m084aaip558" +path="res://.godot/imported/Preview.png-8c476da21cd7f2ad84205fc0a7e6692d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png" +dest_files=["res://.godot/imported/Preview.png-8c476da21cd7f2ad84205fc0a7e6692d.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/map/tileMaps/TestGroup1/battle/Battle3/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/RoomInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..0f6e03637f5348e384004c3f05a74e2cfe12c35a --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-9,"Y":-4},"Size":{"X":43,"Y":35},"DoorAreaInfos":[{"Direction":1,"Start":368,"End":528},{"Direction":2,"Start":0,"End":448},{"Direction":0,"Start":176,"End":512},{"Direction":3,"Start":80,"End":224}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Battle3","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/TileInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..40d4b30e90590e1e1e6997ca122b35bbf2807b07 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/TileInfo.json @@ -0,0 +1 @@ +{"NavigationList":[{"Type":0,"Points":[-40,-40,88,-40,88,24,376,24,376,136,520,136,520,464,312,464,312,480,-120,480,-120,328,-88,328,-88,168,-72,168,-72,152,72,152,72,80,-40,80]},{"Type":1,"Points":[-40,208,72,208,72,224,296,224,296,328,-40,328]}],"Floor":[-3,19,0,0,8,-3,18,0,0,8,-3,17,0,0,8,-3,16,0,0,8,-3,15,0,0,8,-3,14,0,0,8,-3,13,0,0,8,-3,9,0,0,8,-3,12,0,0,8,-3,10,0,0,8,-3,11,0,0,8,-3,-3,0,0,8,-3,-2,0,0,8,-3,-1,0,0,8,-3,0,0,0,8,-3,1,0,0,8,-3,2,0,0,8,-3,3,0,0,8,-3,4,0,0,8,-3,20,0,0,8,-3,21,0,0,8,-3,22,0,0,8,-3,23,0,0,8,-3,24,0,0,8,-3,25,0,0,8,-3,26,0,0,8,-3,27,0,0,8,-3,28,0,0,8,-3,29,0,0,8,-2,9,0,0,8,-2,11,0,0,8,-2,12,0,0,8,-2,10,0,0,8,-2,-3,0,0,8,-2,-2,0,0,8,-2,-1,0,0,8,-2,0,0,0,8,-2,1,0,0,8,-2,2,0,0,8,-2,3,0,0,8,-2,4,0,0,8,-2,20,0,0,8,-2,21,0,0,8,-2,22,0,0,8,-2,23,0,0,8,-2,24,0,0,8,-2,25,0,0,8,-2,26,0,0,8,-2,27,0,0,8,-2,28,0,0,8,-2,29,0,0,8,-1,9,0,0,8,-1,11,0,0,8,-1,12,0,0,8,-1,10,0,0,8,-1,-3,0,0,8,-1,-2,0,0,8,-1,-1,0,0,8,-1,0,0,0,8,-1,1,0,0,8,-1,2,0,0,8,-1,3,0,0,8,-1,4,0,0,8,-1,20,0,0,8,-1,21,0,0,8,-1,22,0,0,8,-1,23,0,0,8,-1,24,0,0,8,-1,25,0,0,8,-1,26,0,0,8,-1,27,0,0,8,-1,28,0,0,8,-1,29,0,0,8,0,9,0,0,8,0,11,0,0,8,0,12,0,0,8,0,10,0,0,8,0,-3,0,0,8,0,-2,0,0,8,0,-1,0,0,8,0,0,0,0,8,0,1,0,0,8,0,2,0,0,8,0,3,0,0,8,0,4,0,0,8,0,20,0,0,8,0,21,0,0,8,0,22,0,0,8,0,23,0,0,8,0,24,0,0,8,0,25,0,0,8,0,26,0,0,8,0,27,0,0,8,0,28,0,0,8,0,29,0,0,8,1,11,0,0,8,1,12,0,0,8,1,10,0,0,8,1,9,0,0,8,1,-3,0,0,8,1,-2,0,0,8,1,-1,0,0,8,1,0,0,0,8,1,1,0,0,8,1,2,0,0,8,1,3,0,0,8,1,4,0,0,8,1,20,0,0,8,1,21,0,0,8,1,22,0,0,8,1,23,0,0,8,1,24,0,0,8,1,25,0,0,8,1,26,0,0,8,1,27,0,0,8,1,28,0,0,8,1,29,0,0,8,2,11,0,0,8,2,12,0,0,8,2,10,0,0,8,2,9,0,0,8,2,-3,0,0,8,2,-2,0,0,8,2,-1,0,0,8,2,0,0,0,8,2,1,0,0,8,2,2,0,0,8,2,3,0,0,8,2,4,0,0,8,2,20,0,0,8,2,21,0,0,8,2,22,0,0,8,2,23,0,0,8,2,24,0,0,8,2,25,0,0,8,2,26,0,0,8,2,27,0,0,8,2,28,0,0,8,2,29,0,0,8,3,9,0,0,8,3,11,0,0,8,3,12,0,0,8,3,10,0,0,8,3,-3,0,0,8,3,-2,0,0,8,3,-1,0,0,8,3,0,0,0,8,3,1,0,0,8,3,2,0,0,8,3,3,0,0,8,3,4,0,0,8,3,20,0,0,8,3,21,0,0,8,3,22,0,0,8,3,23,0,0,8,3,24,0,0,8,3,25,0,0,8,3,26,0,0,8,3,27,0,0,8,3,28,0,0,8,3,29,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,4,0,0,8,4,5,0,0,8,4,6,0,0,8,4,7,0,0,8,4,8,0,0,8,4,9,0,0,8,4,10,0,0,8,4,11,0,0,8,4,12,0,0,8,4,13,0,0,8,4,20,0,0,8,4,21,0,0,8,4,22,0,0,8,4,23,0,0,8,4,24,0,0,8,4,25,0,0,8,4,26,0,0,8,4,27,0,0,8,4,28,0,0,8,4,29,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,4,0,0,8,5,5,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,5,11,0,0,8,5,12,0,0,8,5,13,0,0,8,5,20,0,0,8,5,21,0,0,8,5,22,0,0,8,5,23,0,0,8,5,24,0,0,8,5,25,0,0,8,5,26,0,0,8,5,27,0,0,8,5,28,0,0,8,5,29,0,0,8,6,1,0,0,8,6,2,0,0,8,6,3,0,0,8,6,4,0,0,8,6,5,0,0,8,6,6,0,0,8,6,7,0,0,8,6,8,0,0,8,6,9,0,0,8,6,10,0,0,8,6,11,0,0,8,6,12,0,0,8,6,13,0,0,8,6,20,0,0,8,6,21,0,0,8,6,22,0,0,8,6,23,0,0,8,6,24,0,0,8,6,25,0,0,8,6,26,0,0,8,6,27,0,0,8,6,28,0,0,8,6,29,0,0,8,7,1,0,0,8,7,2,0,0,8,7,3,0,0,8,7,4,0,0,8,7,5,0,0,8,7,6,0,0,8,7,7,0,0,8,7,8,0,0,8,7,9,0,0,8,7,10,0,0,8,7,11,0,0,8,7,12,0,0,8,7,13,0,0,8,7,20,0,0,8,7,21,0,0,8,7,22,0,0,8,7,23,0,0,8,7,24,0,0,8,7,25,0,0,8,7,26,0,0,8,7,27,0,0,8,7,28,0,0,8,7,29,0,0,8,8,1,0,0,8,8,2,0,0,8,8,3,0,0,8,8,4,0,0,8,8,5,0,0,8,8,6,0,0,8,8,7,0,0,8,8,8,0,0,8,8,9,0,0,8,8,10,0,0,8,8,11,0,0,8,8,12,0,0,8,8,13,0,0,8,8,20,0,0,8,8,21,0,0,8,8,22,0,0,8,8,23,0,0,8,8,24,0,0,8,8,25,0,0,8,8,26,0,0,8,8,27,0,0,8,8,28,0,0,8,8,29,0,0,8,9,1,0,0,8,9,2,0,0,8,9,3,0,0,8,9,4,0,0,8,9,5,0,0,8,9,6,0,0,8,9,7,0,0,8,9,8,0,0,8,9,9,0,0,8,9,10,0,0,8,9,11,0,0,8,9,12,0,0,8,9,13,0,0,8,9,20,0,0,8,9,21,0,0,8,9,22,0,0,8,9,23,0,0,8,9,24,0,0,8,9,25,0,0,8,9,26,0,0,8,9,27,0,0,8,9,28,0,0,8,9,29,0,0,8,10,1,0,0,8,10,2,0,0,8,10,3,0,0,8,10,4,0,0,8,10,5,0,0,8,10,6,0,0,8,10,7,0,0,8,10,8,0,0,8,10,9,0,0,8,10,10,0,0,8,10,11,0,0,8,10,12,0,0,8,10,13,0,0,8,10,20,0,0,8,10,21,0,0,8,10,22,0,0,8,10,23,0,0,8,10,24,0,0,8,10,25,0,0,8,10,26,0,0,8,10,27,0,0,8,10,28,0,0,8,10,29,0,0,8,11,1,0,0,8,11,2,0,0,8,11,3,0,0,8,11,4,0,0,8,11,5,0,0,8,11,6,0,0,8,11,7,0,0,8,11,8,0,0,8,11,9,0,0,8,11,10,0,0,8,11,11,0,0,8,11,12,0,0,8,11,13,0,0,8,11,20,0,0,8,11,21,0,0,8,11,22,0,0,8,11,23,0,0,8,11,24,0,0,8,11,25,0,0,8,11,26,0,0,8,11,27,0,0,8,11,28,0,0,8,11,29,0,0,8,12,1,0,0,8,12,2,0,0,8,12,3,0,0,8,12,4,0,0,8,12,5,0,0,8,12,6,0,0,8,12,7,0,0,8,12,8,0,0,8,12,9,0,0,8,12,10,0,0,8,12,11,0,0,8,12,12,0,0,8,12,13,0,0,8,12,20,0,0,8,12,21,0,0,8,12,22,0,0,8,12,23,0,0,8,12,24,0,0,8,12,25,0,0,8,12,26,0,0,8,12,27,0,0,8,12,28,0,0,8,12,29,0,0,8,13,1,0,0,8,13,2,0,0,8,13,3,0,0,8,13,4,0,0,8,13,5,0,0,8,13,6,0,0,8,13,7,0,0,8,13,8,0,0,8,13,9,0,0,8,13,10,0,0,8,13,11,0,0,8,13,12,0,0,8,13,13,0,0,8,13,20,0,0,8,13,21,0,0,8,13,22,0,0,8,13,23,0,0,8,13,24,0,0,8,13,25,0,0,8,13,26,0,0,8,13,27,0,0,8,13,28,0,0,8,13,29,0,0,8,14,1,0,0,8,14,2,0,0,8,14,3,0,0,8,14,4,0,0,8,14,5,0,0,8,14,6,0,0,8,14,7,0,0,8,14,8,0,0,8,14,9,0,0,8,14,10,0,0,8,14,11,0,0,8,14,12,0,0,8,14,13,0,0,8,14,20,0,0,8,14,21,0,0,8,14,22,0,0,8,14,23,0,0,8,14,24,0,0,8,14,25,0,0,8,14,26,0,0,8,14,27,0,0,8,14,28,0,0,8,14,29,0,0,8,15,1,0,0,8,15,2,0,0,8,15,3,0,0,8,15,4,0,0,8,15,5,0,0,8,15,6,0,0,8,15,7,0,0,8,15,8,0,0,8,15,9,0,0,8,15,10,0,0,8,15,11,0,0,8,15,12,0,0,8,15,13,0,0,8,15,20,0,0,8,15,21,0,0,8,15,22,0,0,8,15,23,0,0,8,15,24,0,0,8,15,25,0,0,8,15,26,0,0,8,15,27,0,0,8,15,28,0,0,8,15,29,0,0,8,16,1,0,0,8,16,2,0,0,8,16,3,0,0,8,16,4,0,0,8,16,5,0,0,8,16,6,0,0,8,16,7,0,0,8,16,8,0,0,8,16,9,0,0,8,16,10,0,0,8,16,11,0,0,8,16,12,0,0,8,16,13,0,0,8,16,20,0,0,8,16,21,0,0,8,16,22,0,0,8,16,23,0,0,8,16,24,0,0,8,16,25,0,0,8,16,26,0,0,8,16,27,0,0,8,16,28,0,0,8,16,29,0,0,8,17,1,0,0,8,17,2,0,0,8,17,3,0,0,8,17,4,0,0,8,17,5,0,0,8,17,6,0,0,8,17,7,0,0,8,17,8,0,0,8,17,9,0,0,8,17,10,0,0,8,17,11,0,0,8,17,12,0,0,8,17,13,0,0,8,17,20,0,0,8,17,21,0,0,8,17,22,0,0,8,17,23,0,0,8,17,24,0,0,8,17,25,0,0,8,17,26,0,0,8,17,27,0,0,8,17,28,0,0,8,17,29,0,0,8,18,1,0,0,8,18,2,0,0,8,18,3,0,0,8,18,4,0,0,8,18,5,0,0,8,18,6,0,0,8,18,7,0,0,8,18,8,0,0,8,18,9,0,0,8,18,10,0,0,8,18,11,0,0,8,18,12,0,0,8,18,13,0,0,8,18,14,0,0,8,18,15,0,0,8,18,16,0,0,8,18,17,0,0,8,18,18,0,0,8,18,19,0,0,8,18,20,0,0,8,18,21,0,0,8,18,22,0,0,8,18,23,0,0,8,18,24,0,0,8,18,25,0,0,8,18,26,0,0,8,18,27,0,0,8,18,28,0,0,8,18,29,0,0,8,19,1,0,0,8,19,2,0,0,8,19,3,0,0,8,19,4,0,0,8,19,5,0,0,8,19,6,0,0,8,19,7,0,0,8,19,8,0,0,8,19,9,0,0,8,19,10,0,0,8,19,11,0,0,8,19,12,0,0,8,19,13,0,0,8,19,14,0,0,8,19,15,0,0,8,19,16,0,0,8,19,17,0,0,8,19,18,0,0,8,19,19,0,0,8,19,20,0,0,8,19,21,0,0,8,19,22,0,0,8,19,23,0,0,8,19,24,0,0,8,19,25,0,0,8,19,26,0,0,8,19,27,0,0,8,19,28,0,0,8,19,29,0,0,8,20,1,0,0,8,20,2,0,0,8,20,3,0,0,8,20,4,0,0,8,20,5,0,0,8,20,6,0,0,8,20,7,0,0,8,20,8,0,0,8,20,9,0,0,8,20,10,0,0,8,20,11,0,0,8,20,12,0,0,8,20,13,0,0,8,20,14,0,0,8,20,15,0,0,8,20,16,0,0,8,20,17,0,0,8,20,18,0,0,8,20,19,0,0,8,20,20,0,0,8,20,21,0,0,8,20,22,0,0,8,20,23,0,0,8,20,24,0,0,8,20,25,0,0,8,20,26,0,0,8,20,27,0,0,8,20,28,0,0,8,21,1,0,0,8,21,2,0,0,8,21,3,0,0,8,21,4,0,0,8,21,5,0,0,8,21,6,0,0,8,21,7,0,0,8,21,8,0,0,8,21,9,0,0,8,21,10,0,0,8,21,11,0,0,8,21,12,0,0,8,21,13,0,0,8,21,14,0,0,8,21,15,0,0,8,21,16,0,0,8,21,17,0,0,8,21,18,0,0,8,21,19,0,0,8,21,20,0,0,8,21,21,0,0,8,21,22,0,0,8,21,23,0,0,8,21,24,0,0,8,21,25,0,0,8,21,26,0,0,8,21,27,0,0,8,21,28,0,0,8,22,1,0,0,8,22,2,0,0,8,22,3,0,0,8,22,4,0,0,8,22,5,0,0,8,22,6,0,0,8,22,7,0,0,8,22,8,0,0,8,22,9,0,0,8,22,10,0,0,8,22,11,0,0,8,22,12,0,0,8,22,13,0,0,8,22,14,0,0,8,22,15,0,0,8,22,16,0,0,8,22,17,0,0,8,22,18,0,0,8,22,19,0,0,8,22,20,0,0,8,22,21,0,0,8,22,22,0,0,8,22,23,0,0,8,22,24,0,0,8,22,25,0,0,8,22,26,0,0,8,22,27,0,0,8,22,28,0,0,8,23,1,0,0,8,23,2,0,0,8,23,3,0,0,8,23,4,0,0,8,23,5,0,0,8,23,6,0,0,8,23,7,0,0,8,23,8,0,0,8,23,9,0,0,8,23,10,0,0,8,23,11,0,0,8,23,12,0,0,8,23,13,0,0,8,23,14,0,0,8,23,15,0,0,8,23,16,0,0,8,23,17,0,0,8,23,18,0,0,8,23,19,0,0,8,23,20,0,0,8,23,21,0,0,8,23,22,0,0,8,23,23,0,0,8,23,24,0,0,8,23,25,0,0,8,23,26,0,0,8,23,27,0,0,8,23,28,0,0,8,24,8,0,0,8,24,9,0,0,8,24,10,0,0,8,24,11,0,0,8,24,12,0,0,8,24,13,0,0,8,24,14,0,0,8,24,15,0,0,8,24,16,0,0,8,24,17,0,0,8,24,18,0,0,8,24,19,0,0,8,24,20,0,0,8,24,21,0,0,8,24,22,0,0,8,24,23,0,0,8,24,24,0,0,8,24,25,0,0,8,24,26,0,0,8,24,27,0,0,8,24,28,0,0,8,25,8,0,0,8,25,9,0,0,8,25,10,0,0,8,25,11,0,0,8,25,12,0,0,8,25,13,0,0,8,25,14,0,0,8,25,15,0,0,8,25,16,0,0,8,25,17,0,0,8,25,18,0,0,8,25,19,0,0,8,25,20,0,0,8,25,21,0,0,8,25,22,0,0,8,25,23,0,0,8,25,24,0,0,8,25,25,0,0,8,25,26,0,0,8,25,27,0,0,8,25,28,0,0,8,26,8,0,0,8,26,9,0,0,8,26,10,0,0,8,26,11,0,0,8,26,12,0,0,8,26,13,0,0,8,26,14,0,0,8,26,15,0,0,8,26,16,0,0,8,26,17,0,0,8,26,18,0,0,8,26,19,0,0,8,26,20,0,0,8,26,21,0,0,8,26,22,0,0,8,26,23,0,0,8,26,24,0,0,8,26,25,0,0,8,26,26,0,0,8,26,27,0,0,8,26,28,0,0,8,27,8,0,0,8,27,9,0,0,8,27,10,0,0,8,27,11,0,0,8,27,12,0,0,8,27,13,0,0,8,27,14,0,0,8,27,15,0,0,8,27,16,0,0,8,27,17,0,0,8,27,18,0,0,8,27,19,0,0,8,27,20,0,0,8,27,21,0,0,8,27,22,0,0,8,27,23,0,0,8,27,24,0,0,8,27,25,0,0,8,27,26,0,0,8,27,27,0,0,8,27,28,0,0,8,28,8,0,0,8,28,9,0,0,8,28,10,0,0,8,28,11,0,0,8,28,12,0,0,8,28,13,0,0,8,28,14,0,0,8,28,15,0,0,8,28,16,0,0,8,28,17,0,0,8,28,18,0,0,8,28,19,0,0,8,28,20,0,0,8,28,21,0,0,8,28,22,0,0,8,28,23,0,0,8,28,24,0,0,8,28,25,0,0,8,28,26,0,0,8,28,27,0,0,8,28,28,0,0,8,29,8,0,0,8,29,9,0,0,8,29,10,0,0,8,29,11,0,0,8,29,12,0,0,8,29,13,0,0,8,29,14,0,0,8,29,15,0,0,8,29,16,0,0,8,29,17,0,0,8,29,18,0,0,8,29,19,0,0,8,29,20,0,0,8,29,21,0,0,8,29,22,0,0,8,29,23,0,0,8,29,24,0,0,8,29,25,0,0,8,29,26,0,0,8,29,27,0,0,8,29,28,0,0,8,30,8,0,0,8,30,9,0,0,8,30,10,0,0,8,30,11,0,0,8,30,12,0,0,8,30,13,0,0,8,30,14,0,0,8,30,15,0,0,8,30,16,0,0,8,30,17,0,0,8,30,18,0,0,8,30,19,0,0,8,30,20,0,0,8,30,21,0,0,8,30,22,0,0,8,30,23,0,0,8,30,24,0,0,8,30,25,0,0,8,30,26,0,0,8,30,27,0,0,8,30,28,0,0,8,31,8,0,0,8,31,9,0,0,8,31,10,0,0,8,31,11,0,0,8,31,12,0,0,8,31,13,0,0,8,31,14,0,0,8,31,15,0,0,8,31,16,0,0,8,31,17,0,0,8,31,18,0,0,8,31,19,0,0,8,31,20,0,0,8,31,21,0,0,8,31,22,0,0,8,31,23,0,0,8,31,24,0,0,8,31,25,0,0,8,31,26,0,0,8,31,27,0,0,8,31,28,0,0,8,32,8,0,0,8,32,9,0,0,8,32,10,0,0,8,32,11,0,0,8,32,12,0,0,8,32,13,0,0,8,32,14,0,0,8,32,15,0,0,8,32,16,0,0,8,32,17,0,0,8,32,18,0,0,8,32,19,0,0,8,32,20,0,0,8,32,21,0,0,8,32,22,0,0,8,32,23,0,0,8,32,24,0,0,8,32,25,0,0,8,32,26,0,0,8,32,27,0,0,8,32,28,0,0,8,-8,20,0,0,8,-8,21,0,0,8,-8,22,0,0,8,-8,23,0,0,8,-8,24,0,0,8,-8,25,0,0,8,-8,26,0,0,8,-8,27,0,0,8,-8,28,0,0,8,-8,29,0,0,8,-7,20,0,0,8,-7,21,0,0,8,-7,22,0,0,8,-7,23,0,0,8,-7,24,0,0,8,-7,25,0,0,8,-7,26,0,0,8,-7,27,0,0,8,-7,28,0,0,8,-7,29,0,0,8,-6,19,0,0,8,-6,18,0,0,8,-6,17,0,0,8,-6,16,0,0,8,-6,15,0,0,8,-6,14,0,0,8,-6,10,0,0,8,-6,13,0,0,8,-6,12,0,0,8,-6,11,0,0,8,-6,20,0,0,8,-6,21,0,0,8,-6,22,0,0,8,-6,23,0,0,8,-6,24,0,0,8,-6,25,0,0,8,-6,26,0,0,8,-6,27,0,0,8,-6,28,0,0,8,-6,29,0,0,8,-5,17,0,0,8,-5,16,0,0,8,-5,15,0,0,8,-5,14,0,0,8,-5,19,0,0,8,-5,18,0,0,8,-5,10,0,0,8,-5,9,0,0,8,-5,12,0,0,8,-5,13,0,0,8,-5,11,0,0,8,-5,20,0,0,8,-5,21,0,0,8,-5,22,0,0,8,-5,23,0,0,8,-5,24,0,0,8,-5,25,0,0,8,-5,26,0,0,8,-5,27,0,0,8,-5,28,0,0,8,-5,29,0,0,8,-4,16,0,0,8,-4,19,0,0,8,-4,18,0,0,8,-4,17,0,0,8,-4,15,0,0,8,-4,14,0,0,8,-4,13,0,0,8,-4,10,0,0,8,-4,9,0,0,8,-4,12,0,0,8,-4,11,0,0,8,-4,20,0,0,8,-4,21,0,0,8,-4,22,0,0,8,-4,23,0,0,8,-4,24,0,0,8,-4,25,0,0,8,-4,26,0,0,8,-4,27,0,0,8,-4,28,0,0,8,-4,29,0,0,8],"Middle":[-8,19,0,2,7,-7,19,0,3,7,-6,9,0,3,7,-5,8,0,2,7,-4,8,0,2,7,-3,-4,0,2,7,-3,8,0,2,7,-2,-4,0,2,7,-2,8,0,2,7,-2,19,0,1,7,-1,-4,0,2,7,-1,8,0,2,7,-1,19,0,2,7,0,-4,0,2,7,0,8,0,2,7,0,19,0,2,7,1,-4,0,2,7,1,8,0,2,7,1,19,0,2,7,2,-4,0,2,7,2,8,0,2,7,2,19,0,2,7,3,-4,0,2,7,3,8,0,3,7,3,19,0,2,7,4,-4,0,2,7,4,19,0,2,7,5,-4,0,2,7,5,19,0,2,7,6,0,0,1,7,6,19,0,2,7,7,0,0,2,7,7,19,0,2,7,8,0,0,2,7,8,19,0,2,7,9,0,0,2,7,9,19,0,2,7,10,0,0,2,7,10,19,0,2,7,11,0,0,2,7,11,19,0,2,7,12,0,0,2,7,12,19,0,2,7,13,0,0,2,7,13,19,0,2,7,14,0,0,2,7,14,19,0,2,7,15,0,0,2,7,15,19,0,2,7,16,0,0,2,7,16,19,0,2,7,17,0,0,2,7,17,19,0,3,7,18,0,0,2,7,19,0,0,2,7,20,0,0,2,7,21,0,0,2,7,22,0,0,2,7,23,0,0,2,7,24,7,0,1,7,25,7,0,2,7,26,7,0,2,7,27,7,0,2,7,28,7,0,2,7,29,7,0,2,7,30,7,0,2,7,31,7,0,2,7,32,7,0,2,7],"Top":[-9,19,0,3,4,-9,20,0,3,3,-9,21,0,3,3,-9,22,0,3,3,-9,23,0,3,3,-9,24,0,3,3,-9,25,0,3,3,-9,26,0,3,3,-9,27,0,3,3,-9,28,0,3,3,-9,29,0,3,3,-9,30,0,11,2,-8,30,0,2,2,-7,9,0,3,4,-7,10,0,3,3,-7,11,0,3,3,-7,12,0,3,3,-7,13,0,3,3,-7,14,0,3,3,-7,15,0,3,3,-7,16,0,3,3,-7,17,0,3,3,-7,18,0,3,3,-7,30,0,2,2,-6,8,0,3,4,-6,30,0,2,2,-5,30,0,2,2,-4,-4,0,3,4,-4,-3,0,3,3,-4,-2,0,3,3,-4,-1,0,3,3,-4,0,0,3,3,-4,1,0,3,3,-4,2,0,3,3,-4,3,0,3,3,-4,4,0,3,3,-4,5,0,11,2,-4,30,0,2,2,-3,5,0,2,2,-3,30,0,2,2,-2,5,0,2,2,-2,13,0,1,2,-2,14,0,1,3,-2,15,0,1,3,-2,16,0,1,3,-2,17,0,1,3,-2,18,0,1,3,-2,30,0,2,2,-1,5,0,2,2,-1,13,0,2,2,-1,30,0,2,2,0,5,0,2,2,0,13,0,2,2,0,30,0,2,2,1,5,0,2,2,1,13,0,2,2,1,30,0,2,2,2,5,0,2,2,2,13,0,2,2,2,30,0,2,2,3,5,0,3,2,3,6,0,3,3,3,7,0,3,3,3,13,0,3,2,3,14,0,11,2,3,30,0,2,2,4,14,0,2,2,4,30,0,2,2,5,14,0,2,2,5,30,0,2,2,6,-4,0,1,4,6,-3,0,1,3,6,-2,0,1,3,6,-1,0,1,3,6,14,0,2,2,6,30,0,2,2,7,14,0,2,2,7,30,0,2,2,8,14,0,2,2,8,30,0,2,2,9,14,0,2,2,9,30,0,2,2,10,14,0,2,2,10,30,0,2,2,11,14,0,2,2,11,30,0,2,2,12,14,0,2,2,12,30,0,2,2,13,14,0,2,2,13,30,0,2,2,14,14,0,2,2,14,30,0,2,2,15,14,0,2,2,15,30,0,2,2,16,14,0,2,2,16,30,0,2,2,17,14,0,3,2,17,15,0,3,3,17,16,0,3,3,17,17,0,3,3,17,18,0,3,3,17,30,0,2,2,18,30,0,2,2,19,30,0,2,2,20,29,0,1,2,20,30,0,13,2,21,29,0,2,2,22,29,0,2,2,23,29,0,2,2,24,0,0,1,4,24,1,0,1,3,24,2,0,1,3,24,3,0,1,3,24,4,0,1,3,24,5,0,1,3,24,6,0,1,3,24,29,0,2,2,25,29,0,2,2,26,29,0,2,2,27,29,0,2,2,28,29,0,2,2,29,29,0,2,2,30,29,0,2,2,31,29,0,2,2,32,29,0,2,2,33,7,0,1,4,33,8,0,1,3,33,9,0,1,3,33,10,0,1,3,33,11,0,1,3,33,12,0,1,3,33,13,0,1,3,33,14,0,1,3,33,15,0,1,3,33,16,0,1,3,33,17,0,1,3,33,18,0,1,3,33,19,0,1,3,33,20,0,1,3,33,21,0,1,3,33,22,0,1,3,33,23,0,1,3,33,24,0,1,3,33,25,0,1,3,33,26,0,1,3,33,27,0,1,3,33,28,0,1,3,33,29,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json new file mode 100644 index 0000000000000000000000000000000000000000..e81e6160b6551640eef9f6945c319faa814cc025 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":8,"Y":19},"Size":{"X":83,"Y":73},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":11,"Y":38},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":-13,"Y":3},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png new file mode 100644 index 0000000000000000000000000000000000000000..7d32b8e9734a5e3864832270bb1e1f77e01ebd82 Binary files /dev/null and b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png.import new file mode 100644 index 0000000000000000000000000000000000000000..74d2d7cdff29b2923ce7d24b3dfa183eabd063f5 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dwr8eoslvwdu2" +path="res://.godot/imported/Preview.png-d30d131cfacf4b4842b55e3203acdd42.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png" +dest_files=["res://.godot/imported/Preview.png-d30d131cfacf4b4842b55e3203acdd42.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/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..02c0b533def142cc30f6133e6ae7d6a506dbaaf4 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-4,"Y":-3},"Size":{"X":9,"Y":8},"DoorAreaInfos":[],"GroupName":"TestGroup1","RoomType":1,"RoomName":"Start1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..34882e2be13a170452deecb2f3da0801854b0df6 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json @@ -0,0 +1 @@ +{"NavigationList":[{"Type":0,"Points":[-40,-24,56,-24,56,64,-40,64]}],"Floor":[3,3,0,0,8,3,2,0,0,8,3,1,0,0,8,3,0,0,0,8,3,-1,0,0,8,3,-2,0,0,8,2,3,0,0,8,2,2,0,0,8,2,1,0,0,8,2,0,0,0,8,2,-1,0,0,8,2,-2,0,0,8,1,3,0,0,8,1,2,0,0,8,1,1,0,0,8,1,0,0,0,8,1,-1,0,0,8,1,-2,0,0,8,0,3,0,0,8,0,2,0,0,8,0,1,0,0,8,0,0,0,0,8,0,-1,0,0,8,0,-2,0,0,8,-1,3,0,0,8,-1,2,0,0,8,-1,1,0,0,8,-1,0,0,0,8,-1,-1,0,0,8,-1,-2,0,0,8,-2,3,0,0,8,-2,2,0,0,8,-2,1,0,0,8,-2,0,0,0,8,-2,-1,0,0,8,-2,-2,0,0,8,-3,3,0,0,8,-3,2,0,0,8,-3,1,0,0,8,-3,0,0,0,8,-3,-1,0,0,8,-3,-2,0,0,8],"Middle":[-3,-3,0,2,7,-2,-3,0,2,7,-1,-3,0,2,7,0,-3,0,2,7,1,-3,0,2,7,2,-3,0,2,7,3,-3,0,2,7],"Top":[-4,-3,0,3,4,-4,-2,0,3,3,-4,-1,0,3,3,-4,0,0,3,3,-4,1,0,3,3,-4,2,0,3,3,-4,3,0,3,3,-4,4,0,11,2,-3,4,0,2,2,-2,4,0,2,2,-1,4,0,2,2,0,4,0,2,2,1,4,0,2,2,2,4,0,2,2,3,4,0,2,2,4,-3,0,1,4,4,-2,0,1,3,4,-1,0,1,3,4,0,0,1,3,4,1,0,1,3,4,2,0,1,3,4,3,0,1,3,4,4,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preinstall.json new file mode 100644 index 0000000000000000000000000000000000000000..d4d67e343c674f6694e501664a290842d2037d4d --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":11,"Y":28},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]}]]},{"Name":"test2","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":-54,"Y":95},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png new file mode 100644 index 0000000000000000000000000000000000000000..8e0a47adf47d14963c1d551cd55ed01bdeb17764 Binary files /dev/null and b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png.import new file mode 100644 index 0000000000000000000000000000000000000000..d756672a8bf249d08a7a4dc0501fe472dff7b6e0 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bi3cl40jqw1bq" +path="res://.godot/imported/Preview.png-de99484c552e8633c08889ca0fe2fe8e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png" +dest_files=["res://.godot/imported/Preview.png-de99484c552e8633c08889ca0fe2fe8e.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/map/tileMaps/TestGroup1/outlet/End1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/RoomInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..ba808d10d140b2b2bd051c8118978ded9ea577e5 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-6,"Y":-4},"Size":{"X":15,"Y":12},"DoorAreaInfos":[],"GroupName":"TestGroup1","RoomType":2,"RoomName":"End1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/TileInfo.json new file mode 100644 index 0000000000000000000000000000000000000000..148a844b528ed57429a0ab1a0212807e3ed18a35 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/TileInfo.json @@ -0,0 +1 @@ +{"NavigationList":[{"Type":0,"Points":[-72,-40,120,-40,120,112,-72,112]}],"Floor":[-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,4,0,0,8,-5,5,0,0,8,-5,6,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,4,0,0,8,-4,5,0,0,8,-4,6,0,0,8,-3,-3,0,0,8,-3,-2,0,0,8,-3,-1,0,0,8,-3,0,0,0,8,-3,1,0,0,8,-3,2,0,0,8,-3,3,0,0,8,-3,4,0,0,8,-3,5,0,0,8,-3,6,0,0,8,-2,-3,0,0,8,-2,-2,0,0,8,-2,-1,0,0,8,-2,0,0,0,8,-2,1,0,0,8,-2,2,0,0,8,-2,3,0,0,8,-2,4,0,0,8,-2,5,0,0,8,-2,6,0,0,8,-1,-3,0,0,8,-1,-2,0,0,8,-1,-1,0,0,8,-1,0,0,0,8,-1,1,0,0,8,-1,2,0,0,8,-1,3,0,0,8,-1,4,0,0,8,-1,5,0,0,8,-1,6,0,0,8,0,-3,0,0,8,0,-2,0,0,8,0,-1,0,0,8,0,0,0,0,8,0,1,0,0,8,0,2,0,0,8,0,3,0,0,8,0,4,0,0,8,0,5,0,0,8,0,6,0,0,8,1,-3,0,0,8,1,-2,0,0,8,1,-1,0,0,8,1,0,0,0,8,1,1,0,0,8,1,2,0,0,8,1,3,0,0,8,1,4,0,0,8,1,5,0,0,8,1,6,0,0,8,2,-3,0,0,8,2,-2,0,0,8,2,-1,0,0,8,2,0,0,0,8,2,1,0,0,8,2,2,0,0,8,2,3,0,0,8,2,4,0,0,8,2,5,0,0,8,2,6,0,0,8,3,-3,0,0,8,3,-2,0,0,8,3,-1,0,0,8,3,0,0,0,8,3,1,0,0,8,3,2,0,0,8,3,3,0,0,8,3,4,0,0,8,3,5,0,0,8,3,6,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,4,0,0,8,4,5,0,0,8,4,6,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,4,0,0,8,5,5,0,0,8,5,6,0,0,8,6,-3,0,0,8,6,-2,0,0,8,6,-1,0,0,8,6,0,0,0,8,6,1,0,0,8,6,2,0,0,8,6,3,0,0,8,6,4,0,0,8,6,5,0,0,8,6,6,0,0,8,7,-3,0,0,8,7,-2,0,0,8,7,-1,0,0,8,7,0,0,0,8,7,1,0,0,8,7,2,0,0,8,7,3,0,0,8,7,4,0,0,8,7,5,0,0,8,7,6,0,0,8],"Middle":[-5,-4,0,2,7,-4,-4,0,2,7,-3,-4,0,2,7,-2,-4,0,2,7,-1,-4,0,2,7,0,-4,0,2,7,1,-4,0,2,7,2,-4,0,2,7,3,-4,0,2,7,4,-4,0,2,7,5,-4,0,2,7,6,-4,0,2,7,7,-4,0,2,7],"Top":[-6,-4,0,3,4,-6,-3,0,3,3,-6,-2,0,3,3,-6,-1,0,3,3,-6,0,0,3,3,-6,1,0,3,3,-6,2,0,3,3,-6,3,0,3,3,-6,4,0,3,3,-6,5,0,3,3,-6,6,0,3,3,-6,7,0,11,2,-5,7,0,2,2,-4,7,0,2,2,-3,7,0,2,2,-2,7,0,2,2,-1,7,0,2,2,0,7,0,2,2,1,7,0,2,2,2,7,0,2,2,3,7,0,2,2,4,7,0,2,2,5,7,0,2,2,6,7,0,2,2,7,7,0,2,2,8,-4,0,1,4,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,1,3,8,5,0,1,3,8,6,0,1,3,8,7,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room1.tscn deleted file mode 100644 index 34a463ced54557698e517afd7853862798cbe5c5..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room1.tscn +++ /dev/null @@ -1,189 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://bltvbn3urhy1q"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_qn8qv"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_68nmn"] -[ext_resource type="Script" path="res://src/framework/map/mark/ActivityMark.cs" id="4_vkqhy"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room1" type="TileMap"] -tile_set = ExtResource("1_qn8qv") -format = 2 -layer_0/tile_data = PackedInt32Array(65543, 0, 8, 7, 0, 8, -65529, 0, 8, -131065, 0, 8, 65542, 0, 8, 6, 0, 8, -65530, 0, 8, -131066, 0, 8, 65541, 0, 8, 5, 0, 8, -65531, 0, 8, -131067, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, 65540, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 65539, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 65538, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 327679, 0, 8, 262143, 0, 8, 196607, 0, 8, 131071, 0, 8, 327678, 0, 8, 262142, 0, 8, 196606, 0, 8, 131070, 0, 8, 65534, 0, 8, -2, 0, 8, -65538, 0, 8, 327677, 0, 8, 262141, 0, 8, 196605, 0, 8, 131069, 0, 8, 65533, 0, 8, -3, 0, 8, -65539, 0, 8, -4, 0, 8, -65540, 0, 8, -131076, 0, 8, -131075, 0, 8, -131074, 0, 8, 65532, 0, 8, 131068, 0, 8, 196604, 0, 8, 262140, 0, 8, 327676, 0, 8, 393214, 0, 8, 393213, 0, 8, 393212, 0, 8, 393215, 0, 8, 327680, 0, 8, 327681, 0, 8, 327682, 0, 8, 327683, 0, 8, 327684, 0, 8, -196603, 0, 8, -196602, 0, 8, -196601, 0, 8, -131064, 0, 8, -65528, 0, 8, -196600, 0, 8, 8, 0, 8, 65544, 0, 8, 458769, 0, 8, 393233, 0, 8, 327697, 0, 8, 262161, 0, 8, 196625, 0, 8, 131089, 0, 8, 65553, 0, 8, 17, 0, 8, -65519, 0, 8, -131055, 0, 8, -196591, 0, 8, -262127, 0, 8, -327663, 0, 8, 458768, 0, 8, 393232, 0, 8, 327696, 0, 8, 262160, 0, 8, 196624, 0, 8, 131088, 0, 8, 65552, 0, 8, 16, 0, 8, -65520, 0, 8, -131056, 0, 8, -196592, 0, 8, -262128, 0, 8, -327664, 0, 8, 458767, 0, 8, 393231, 0, 8, 327695, 0, 8, 262159, 0, 8, 196623, 0, 8, 131087, 0, 8, 65551, 0, 8, 15, 0, 8, -65521, 0, 8, -131057, 0, 8, -196593, 0, 8, -262129, 0, 8, -327665, 0, 8, 458766, 0, 8, 393230, 0, 8, 327694, 0, 8, 14, 0, 8, -65522, 0, 8, -131058, 0, 8, -196594, 0, 8, -262130, 0, 8, -327666, 0, 8, 458765, 0, 8, 393229, 0, 8, 327693, 0, 8, 13, 0, 8, -65523, 0, 8, -131059, 0, 8, -196595, 0, 8, -262131, 0, 8, -327667, 0, 8, 458764, 0, 8, 393228, 0, 8, 327692, 0, 8, 12, 0, 8, -65524, 0, 8, -131060, 0, 8, -196596, 0, 8, -262132, 0, 8, -327668, 0, 8, 458763, 0, 8, 393227, 0, 8, 327691, 0, 8, 11, 0, 8, -65525, 0, 8, -131061, 0, 8, -196597, 0, 8, -262133, 0, 8, -327669, 0, 8, 458762, 0, 8, 393226, 0, 8, 327690, 0, 8, 10, 0, 8, -65526, 0, 8, -131062, 0, 8, -196598, 0, 8, -262134, 0, 8, -327670, 0, 8, 458761, 0, 8, 393225, 0, 8, 9, 0, 8, -65527, 0, 8, -131063, 0, 8, -196599, 0, 8, -262135, 0, 8, -327671, 0, 8, 458760, 0, 8, 393224, 0, 8, -262136, 0, 8, -327672, 0, 8, 458759, 0, 8, 393223, 0, 8, -262137, 0, 8, -327673, 0, 8, 458758, 0, 8, 393222, 0, 8, -262138, 0, 8, -327674, 0, 8, 458757, 0, 8, 393221, 0, 8, -262139, 0, 8, -327675, 0, 8, 458756, 0, 8, 393220, 0, 8, -262140, 0, 8, -327676, 0, 8, 458755, 0, 8, 393219, 0, 8, -262141, 0, 8, -327677, 0, 8, 458754, 0, 8, 393218, 0, 8, -262142, 0, 8, -327678, 0, 8, 458753, 0, 8, 393217, 0, 8, -262143, 0, 8, -327679, 0, 8, 458752, 0, 8, 393216, 0, 8, -262144, 0, 8, -327680, 0, 8, 524287, 0, 8, 458751, 0, 8, -196609, 0, 8, -262145, 0, 8, 524286, 0, 8, 458750, 0, 8, -196610, 0, 8, -262146, 0, 8, 524285, 0, 8, 458749, 0, 8, -196611, 0, 8, -262147, 0, 8, 524284, 0, 8, 458748, 0, 8, -196612, 0, 8, -262148, 0, 8, -196613, 196608, 3, -262149, 196608, 3, -327685, 196608, 4, -327684, 131072, 7, -327683, 131072, 7, -131077, 196608, 3, -65541, 196608, 3, -5, 196608, 3, 65531, 196608, 3, 131067, 196608, 3, 196603, 196608, 3, 262139, 196608, 3, 327675, 196608, 3, 393211, 196608, 3, 458747, 196608, 3, 524283, 196608, 3, 589821, 131072, 2, 589820, 131072, 2, 589819, 720896, 2, -327682, 131072, 7, 589822, 131072, 2, -327681, 131072, 7, 589823, 131072, 2, -393216, 131072, 7, 524288, 131072, 2, -393215, 131072, 7, 524289, 131072, 2, -393214, 131072, 7, 524290, 131072, 2, -393213, 131072, 7, 524291, 131072, 2, -393212, 131072, 7, 524292, 131072, 2, -393211, 131072, 7, 524293, 131072, 2, -393210, 131072, 7, 524294, 131072, 2, -393209, 131072, 7, 524295, 131072, 2, -393208, 131072, 7, 524296, 131072, 2, -393207, 131072, 7, 524297, 131072, 2, -393206, 131072, 7, 524298, 131072, 2, -393205, 131072, 7, 524299, 131072, 2, -393204, 131072, 7, 524300, 131072, 2, -393203, 131072, 7, 524301, 131072, 2, -393202, 131072, 7, 524302, 131072, 2, -393201, 131072, 7, 524303, 131072, 2, -393200, 131072, 7, 524304, 131072, 2, -393199, 131072, 7, 524305, 131072, 2, -327662, 65536, 3, -262126, 65536, 3, -393198, 65536, 4, -196590, 65536, 3, -131054, 65536, 3, -65518, 65536, 3, 18, 65536, 3, 65554, 65536, 3, 131090, 65536, 3, 196626, 65536, 3, 262162, 65536, 3, 327698, 65536, 3, 393234, 65536, 3, 458770, 65536, 3, 524306, 851968, 2, -196604, 0, 8, -196605, 0, 8, -196606, 0, 8, -196607, 0, 8, -196608, 0, 8, -131073, 0, 8, -65537, 65536, 2, -131072, 131072, 2, -131071, 131072, 2, -131070, 196608, 2, -131069, 0, 8, -131068, 0, 8, -1, 65536, 3, 65535, 65536, 7, 0, 196608, 7, 1, 0, 8, 2, 0, 8, 3, 0, 8, 4, 0, 8, -65536, 196608, 4, -65535, 131072, 7, -65534, 196608, 7, -65533, 0, 8, -65532, 0, 8, 262154, 0, 8, 262155, 65536, 7, 262156, 131072, 7, 262157, 131072, 7, 262158, 196608, 7, 65550, 0, 8, 131086, 196608, 2, 196622, 196608, 3, 65549, 0, 8, 65548, 0, 8, 65547, 0, 8, 65546, 0, 8, 65545, 0, 8, 131082, 0, 8, 131083, 0, 8, 131084, 0, 8, 131085, 65536, 2, 196618, 0, 8, 196619, 65536, 2, 196620, 131072, 2, 196621, 851968, 2, 327689, 0, 8, 262153, 0, 8, 196617, 0, 8, 131081, 0, 8, 327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 131080, 0, 8, 327687, 0, 8, 262151, 0, 8, 196615, 0, 8, 131079, 0, 8, 327686, 0, 8, 262150, 0, 8, 196614, 0, 8, 131078, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 131077, 0, 8) -script = ExtResource("dungeonRoomTemplate") - -[node name="EnemyMark" type="Node2D" parent="."] -position = Vector2(1, 75) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 1.0 -BirthRect = Vector2i(90, 90) -Altitude = 0 - -[node name="EnemyMark2" type="Node2D" parent="."] -position = Vector2(226, -22) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 0.5 -BirthRect = Vector2i(90, 90) -Altitude = 0 - -[node name="ActivityMark" type="Node2D" parent="."] -position = Vector2(115, 24) -script = ExtResource("4_vkqhy") -Type = 5 -ItemExpression = "0003(ResidueAmmo:6,CurrAmmon:12)" -DelayTime = 2.0 -BirthRect = Vector2i(50, 50) - -[node name="ActivityMark3" type="Node2D" parent="."] -position = Vector2(116, -39) -script = ExtResource("4_vkqhy") -Type = 5 -ItemExpression = "0003(ResidueAmmo:6,CurrAmmon:12)" -WaveNumber = 2 -BirthRect = Vector2i(50, 50) - -[node name="EnemyMark3" type="Node2D" parent="."] -position = Vector2(126, 77) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(90, 90) -Altitude = 0 - -[node name="EnemyMark4" type="Node2D" parent="."] -position = Vector2(117, -23) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 2.0 -BirthRect = Vector2i(90, 90) -Altitude = 0 - -[node name="ActivityMark4" type="Node2D" parent="."] -position = Vector2(117, 70) -script = ExtResource("4_vkqhy") -Type = 5 -ItemExpression = "0002(ResidueAmmo:7,CurrAmmon:7)" -WaveNumber = 3 -BirthRect = Vector2i(50, 50) - -[node name="ActivityMark5" type="Node2D" parent="."] -position = Vector2(221, -27) -script = ExtResource("4_vkqhy") -Type = 5 -ItemExpression = "0002(ResidueAmmo:7,CurrAmmon:7)" -WaveNumber = 3 -BirthRect = Vector2i(50, 50) - -[node name="EnemyMark5" type="Node2D" parent="."] -position = Vector2(16, -53) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark6" type="Node2D" parent="."] -position = Vector2(208, 107) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.5 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark7" type="Node2D" parent="."] -position = Vector2(11, 80) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 2.0 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark8" type="Node2D" parent="."] -position = Vector2(118, 16) -script = ExtResource("3_68nmn") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 2.5 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark9" type="Node2D" parent="."] -position = Vector2(167, -33) -script = ExtResource("3_68nmn") -Weapon1Id = "0003(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark10" type="Node2D" parent="."] -position = Vector2(52, 58) -script = ExtResource("3_68nmn") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.5 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark11" type="Node2D" parent="."] -position = Vector2(96, 8) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 2.0 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark12" type="Node2D" parent="."] -position = Vector2(163, 8) -script = ExtResource("3_68nmn") -Weapon1Id = "0004(ResidueAmmo:10,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 2.0 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark13" type="Node2D" parent="."] -position = Vector2(82, 94) -script = ExtResource("3_68nmn") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 2.0 -BirthRect = Vector2i(30, 30) -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room2.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room2.tscn deleted file mode 100644 index f8bc58c0373528f26339c592b177b97cded5c971..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room2.tscn +++ /dev/null @@ -1,163 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://bnlsfk3dahtos"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_ar45p"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_v71xh"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room2" type="TileMap"] -tile_set = ExtResource("1_ar45p") -format = 2 -layer_0/tile_data = PackedInt32Array(131079, 0, 8, 65543, 0, 8, 7, 0, 8, -65529, 0, 8, 131078, 0, 8, 65542, 0, 8, 6, 0, 8, -65530, 0, 8, 131077, 0, 8, 65541, 0, 8, 5, 0, 8, -65531, 0, 8, 131076, 0, 8, 65540, 0, 8, 4, 0, 8, -65532, 0, 8, 393219, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 65539, 0, 8, 3, 0, 8, -65533, 0, 8, 393218, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 65538, 0, 8, 2, 0, 8, -65534, 0, 8, 393217, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, -65535, 0, 8, 393216, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, -65536, 0, 8, 458751, 0, 8, 393215, 0, 8, 327679, 0, 8, 262143, 0, 8, 196607, 0, 8, 131071, 0, 8, 65535, 0, 8, -1, 0, 8, 327678, 0, 8, 262142, 0, 8, 196606, 0, 8, 131070, 0, 8, 65534, 0, 8, -2, 0, 8, 65533, 0, 8, -3, 0, 8, -65539, 0, 8, -65538, 0, 8, -65537, 0, 8, 131069, 0, 8, 196605, 0, 8, 262141, 0, 8, 327677, 0, 8, 524287, 0, 8, -131072, 0, 8, 458752, 0, 8, -131071, 0, 8, -131070, 0, 8, -131069, 0, 8, -131068, 0, 8, -131067, 0, 8, -131066, 0, 8, -131065, 0, 8, -65528, 0, 8, 8, 0, 8, -131064, 0, 8, 65544, 0, 8, 131080, 0, 8, 1048600, 0, 8, 983064, 0, 8, 917528, 0, 8, 851992, 0, 8, 1048599, 0, 8, 983063, 0, 8, 917527, 0, 8, 851991, 0, 8, 1048598, 0, 8, 983062, 0, 8, 917526, 0, 8, 851990, 0, 8, 1048597, 0, 8, 983061, 0, 8, 917525, 0, 8, 851989, 0, 8, 786453, 0, 8, 720917, 0, 8, 655381, 0, 8, 589845, 0, 8, 524309, 0, 8, 458773, 0, 8, 65557, 0, 8, 21, 0, 8, -65515, 0, 8, -131051, 0, 8, -196587, 0, 8, -262123, 0, 8, -327659, 0, 8, 1048596, 0, 8, 983060, 0, 8, 917524, 0, 8, 851988, 0, 8, 786452, 0, 8, 720916, 0, 8, 655380, 0, 8, 589844, 0, 8, 524308, 0, 8, 458772, 0, 8, 65556, 0, 8, 20, 0, 8, -65516, 0, 8, -131052, 0, 8, -196588, 0, 8, -262124, 0, 8, -327660, 0, 8, 1048595, 0, 8, 983059, 0, 8, 917523, 0, 8, 851987, 0, 8, 786451, 0, 8, 720915, 0, 8, 655379, 0, 8, 589843, 0, 8, 524307, 0, 8, 458771, 0, 8, 65555, 0, 8, 19, 0, 8, -65517, 0, 8, -131053, 0, 8, -196589, 0, 8, -262125, 0, 8, -327661, 0, 8, 1048594, 0, 8, 983058, 0, 8, 917522, 0, 8, 851986, 0, 8, 786450, 0, 8, 720914, 0, 8, 655378, 0, 8, 589842, 0, 8, 524306, 0, 8, 458770, 0, 8, 65554, 0, 8, 18, 0, 8, -65518, 0, 8, -131054, 0, 8, -196590, 0, 8, -262126, 0, 8, -327662, 0, 8, 1048593, 0, 8, 983057, 0, 8, 917521, 0, 8, 851985, 0, 8, 786449, 0, 8, 720913, 0, 8, 655377, 0, 8, 589841, 0, 8, 524305, 0, 8, 458769, 0, 8, 65553, 0, 8, 17, 0, 8, -65519, 0, 8, -131055, 0, 8, -196591, 0, 8, -262127, 0, 8, -327663, 0, 8, 1048592, 0, 8, 983056, 0, 8, 917520, 0, 8, 851984, 0, 8, 786448, 0, 8, 720912, 0, 8, 655376, 0, 8, 589840, 0, 8, 524304, 0, 8, 458768, 0, 8, 65552, 0, 8, 16, 0, 8, -65520, 0, 8, -131056, 0, 8, -196592, 0, 8, -262128, 0, 8, -327664, 0, 8, 1048591, 0, 8, 983055, 0, 8, 917519, 0, 8, 851983, 0, 8, 786447, 0, 8, 720911, 0, 8, 655375, 0, 8, 589839, 0, 8, 524303, 0, 8, 458767, 0, 8, 393231, 0, 8, 327695, 0, 8, 262159, 0, 8, 196623, 0, 8, 131087, 0, 8, 65551, 0, 8, 15, 0, 8, -65521, 0, 8, -131057, 0, 8, -196593, 0, 8, -262129, 0, 8, -327665, 0, 8, 1048590, 0, 8, 983054, 0, 8, 917518, 0, 8, 851982, 0, 8, 786446, 0, 8, 720910, 0, 8, 655374, 0, 8, 589838, 0, 8, 524302, 0, 8, 458766, 0, 8, 393230, 0, 8, 327694, 0, 8, 262158, 0, 8, 196622, 0, 8, 131086, 0, 8, 65550, 0, 8, 14, 0, 8, -65522, 0, 8, -131058, 0, 8, -196594, 0, 8, -262130, 0, 8, -327666, 0, 8, 1048589, 0, 8, 983053, 0, 8, 917517, 0, 8, 851981, 0, 8, 786445, 0, 8, 720909, 0, 8, 655373, 0, 8, 589837, 0, 8, 524301, 0, 8, 458765, 0, 8, 393229, 0, 8, 327693, 0, 8, 262157, 0, 8, 196621, 0, 8, 131085, 0, 8, 65549, 0, 8, 13, 0, 8, -65523, 0, 8, -131059, 0, 8, -196595, 0, 8, -262131, 0, 8, -327667, 0, 8, 1048588, 0, 8, 983052, 0, 8, 917516, 0, 8, 851980, 0, 8, 786444, 0, 8, 720908, 0, 8, 655372, 0, 8, 589836, 0, 8, 524300, 0, 8, 458764, 0, 8, 393228, 0, 8, 327692, 0, 8, 262156, 0, 8, 196620, 0, 8, 131084, 0, 8, 65548, 0, 8, 12, 0, 8, -65524, 0, 8, -131060, 0, 8, -196596, 0, 8, -262132, 0, 8, -327668, 0, 8, 1048587, 0, 8, 983051, 0, 8, 917515, 0, 8, 851979, 0, 8, 786443, 0, 8, 720907, 0, 8, 655371, 0, 8, 589835, 0, 8, 524299, 0, 8, 458763, 0, 8, 393227, 0, 8, 327691, 0, 8, 262155, 0, 8, 196619, 0, 8, 131083, 0, 8, 65547, 0, 8, 11, 0, 8, -65525, 0, 8, -131061, 0, 8, -196597, 0, 8, -262133, 0, 8, -327669, 0, 8, 786442, 0, 8, 720906, 0, 8, 655370, 0, 8, 589834, 0, 8, 524298, 0, 8, 458762, 0, 8, 393226, 0, 8, 327690, 0, 8, 262154, 0, 8, 196618, 0, 8, 131082, 0, 8, 65546, 0, 8, 10, 0, 8, -65526, 0, 8, -131062, 0, 8, -196598, 0, 8, -262134, 0, 8, -327670, 0, 8, 786441, 0, 8, 720905, 0, 8, 655369, 0, 8, 589833, 0, 8, 524297, 0, 8, 131081, 0, 8, 65545, 0, 8, 9, 0, 8, -65527, 0, 8, -131063, 0, 8, -196599, 0, 8, -262135, 0, 8, -327671, 0, 8, 786440, 0, 8, 720904, 0, 8, 655368, 0, 8, 589832, 0, 8, 524296, 0, 8, -196600, 0, 8, -262136, 0, 8, -327672, 0, 8, 786439, 0, 8, 720903, 0, 8, 655367, 0, 8, 589831, 0, 8, 524295, 0, 8, -196601, 0, 8, -262137, 0, 8, -327673, 0, 8, 786438, 0, 8, 720902, 0, 8, 655366, 0, 8, 589830, 0, 8, 524294, 0, 8, -196602, 0, 8, -262138, 0, 8, -327674, 0, 8, -196603, 0, 8, -262139, 0, 8, -327675, 0, 8, -196604, 0, 8, -262140, 0, 8, -327676, 0, 8, 1048576, 0, 8, 983040, 0, 8, 917504, 0, 8, 851968, 0, 8, 786432, 0, 8, 720896, 0, 8, 655360, 0, 8, 589824, 0, 8, 524288, 0, 8, 1114111, 0, 8, 1048575, 0, 8, 983039, 0, 8, 917503, 0, 8, 851967, 0, 8, 786431, 0, 8, 720895, 0, 8, 655359, 0, 8, 589823, 0, 8, 1114110, 0, 8, 1048574, 0, 8, 983038, 0, 8, 917502, 0, 8, 851966, 0, 8, 786430, 0, 8, 1114109, 0, 8, 1048573, 0, 8, 983037, 0, 8, 917501, 0, 8, 851965, 0, 8, 786429, 0, 8, 1114108, 0, 8, 1048572, 0, 8, 983036, 0, 8, 917500, 0, 8, 851964, 0, 8, 786428, 0, 8, 327676, 0, 8, 262140, 0, 8, 196604, 0, 8, 131068, 0, 8, 65532, 0, 8, -4, 0, 8, -65540, 0, 8, -65541, 196608, 3, -5, 196608, 3, 65531, 196608, 3, 131067, 196608, 3, 196603, 196608, 3, 262139, 196608, 3, 327675, 196608, 3, 786427, 196608, 3, 851963, 196608, 3, 917499, 196608, 3, 983035, 196608, 3, 1048571, 196608, 3, 1114107, 196608, 3, 1179645, 131072, 2, 1179644, 131072, 2, 1179643, 720896, 2, 1179646, 131072, 2, 1179647, 131072, 2, 1114112, 131072, 2, -393212, 131072, 7, -393211, 131072, 7, -393210, 131072, 7, -393209, 131072, 7, -393208, 131072, 7, -393207, 131072, 7, -393206, 131072, 7, -393205, 131072, 7, 1114123, 131072, 2, -393204, 131072, 7, 1114124, 131072, 2, -393203, 131072, 7, 1114125, 131072, 2, -393202, 131072, 7, 1114126, 131072, 2, -393201, 131072, 7, 1114127, 131072, 2, -393200, 131072, 7, 1114128, 131072, 2, -393199, 131072, 7, 1114129, 131072, 2, -393198, 131072, 7, 1114130, 131072, 2, -393197, 131072, 7, 1114131, 131072, 2, -393196, 131072, 7, 1114132, 131072, 2, -393195, 131072, 7, 1114133, 131072, 2, 1114134, 131072, 2, 1114135, 131072, 2, 1114136, 131072, 2, 851993, 65536, 3, 917529, 65536, 3, 983065, 65536, 3, 1048601, 65536, 3, 1114137, 851968, 2, 786437, 0, 8, 720901, 0, 8, 655365, 0, 8, 589829, 0, 8, 524293, 0, 8, 786436, 0, 8, 720900, 0, 8, 655364, 0, 8, 589828, 0, 8, 524292, 0, 8, 786435, 0, 8, 720899, 0, 8, 655363, 0, 8, 589827, 0, 8, 524291, 0, 8, 458755, 0, 8, 1114114, 131072, 2, 1048578, 0, 8, 983042, 0, 8, 917506, 0, 8, 851970, 0, 8, 786434, 0, 8, 720898, 0, 8, 655362, 0, 8, 589826, 0, 8, 524290, 0, 8, 458754, 0, 8, 1114113, 131072, 2, 1048577, 0, 8, 983041, 0, 8, 917505, 0, 8, 851969, 0, 8, 786433, 0, 8, 720897, 0, 8, 655361, 0, 8, 589825, 0, 8, 524289, 0, 8, 458753, 0, 8, 65558, 65536, 3, 458774, 65536, 3, 131088, 65536, 2, 131089, 131072, 2, 131090, 131072, 2, 131091, 131072, 2, 131092, 131072, 2, 131093, 131072, 2, -65514, 65536, 3, 22, 65536, 3, -131050, 65536, 3, 131094, 851968, 2, -327658, 65536, 3, -262122, 65536, 3, -393194, 65536, 4, -196586, 65536, 3, 196624, 65536, 3, 262160, 65536, 3, 327696, 65536, 3, 393232, 65536, 7, 393233, 131072, 7, 393234, 131072, 7, 393235, 131072, 7, 393236, 131072, 7, 393237, 131072, 7, 524310, 65536, 3, 393238, 65536, 4, 589846, 65536, 3, 655382, 65536, 3, 720918, 65536, 7, 786454, 0, 8, 786456, 0, 8, 786455, 0, 8, 720919, 131072, 7, 720920, 131072, 7, 786457, 65536, 3, 720921, 65536, 4, 851971, 65536, 2, 851972, 131072, 2, 851973, 131072, 2, 851974, 131072, 2, 851975, 131072, 2, 851976, 131072, 2, 851977, 131072, 2, 851978, 196608, 2, 917514, 196608, 3, 983050, 196608, 3, 1048586, 196608, 3, 1114122, 720896, 2, 917507, 65536, 3, 983043, 65536, 3, 1048579, 65536, 3, 1114115, 851968, 2, -131077, 196608, 4, -131076, 131072, 7, -131075, 131072, 7, -131074, 131072, 7, -131073, 131072, 7, -196608, 131072, 7, -196607, 131072, 7, -196606, 131072, 7, -196605, 196608, 7, -262141, 196608, 3, -327677, 196608, 3, -393213, 196608, 4, 393213, 131072, 2, 393212, 131072, 2, 393211, 720896, 2, 393214, 196608, 2, 458750, 196608, 3, 524286, 196608, 3, 589822, 196608, 3, 655358, 196608, 3, 720894, 196608, 7, 720891, 196608, 4, 720892, 131072, 7, 720893, 131072, 7, 196612, 65536, 2, 196613, 131072, 2, 196614, 131072, 2, 196615, 131072, 2, 196616, 131072, 2, 196617, 196608, 2, 262148, 65536, 3, 327684, 65536, 3, 393220, 65536, 3, 458756, 65536, 7, 458757, 131072, 7, 458758, 131072, 7, 458759, 131072, 7, 458760, 131072, 7, 458761, 196608, 7, 262153, 196608, 3, 327689, 196608, 3, 393225, 196608, 3) -script = ExtResource("dungeonRoomTemplate") - -[node name="EnemyMark" type="Node2D" parent="."] -position = Vector2(2, 26) -script = ExtResource("3_v71xh") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark4" type="Node2D" parent="."] -position = Vector2(-10, 226) -script = ExtResource("3_v71xh") -Weapon1Id = "0004(ResidueAmmo:10,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 2.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark2" type="Node2D" parent="."] -position = Vector2(267, 197) -script = ExtResource("3_v71xh") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 3.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark3" type="Node2D" parent="."] -position = Vector2(188, -13) -script = ExtResource("3_v71xh") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 4.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark5" type="Node2D" parent="."] -position = Vector2(23, 114) -script = ExtResource("3_v71xh") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 2.0 -BirthRect = Vector2i(30, 30) -Altitude = 0 - -[node name="EnemyMark6" type="Node2D" parent="."] -position = Vector2(123, 172) -script = ExtResource("3_v71xh") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 3.0 -BirthRect = Vector2i(150, 50) -Altitude = 0 - -[node name="EnemyMark7" type="Node2D" parent="."] -position = Vector2(284, 233) -script = ExtResource("3_v71xh") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 4.0 -BirthRect = Vector2i(150, 50) -Altitude = 0 - -[node name="EnemyMark8" type="Node2D" parent="."] -position = Vector2(175, -30) -script = ExtResource("3_v71xh") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 5.0 -BirthRect = Vector2i(150, 50) -Altitude = 0 - -[node name="EnemyMark9" type="Node2D" parent="."] -position = Vector2(91, 9) -script = ExtResource("3_v71xh") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(150, 50) -Altitude = 0 - -[node name="EnemyMark10" type="Node2D" parent="."] -position = Vector2(259, 153) -script = ExtResource("3_v71xh") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 2.0 -BirthRect = Vector2i(150, 50) -Altitude = 0 - -[node name="EnemyMark11" type="Node2D" parent="."] -position = Vector2(253, -12) -script = ExtResource("3_v71xh") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 3.0 -BirthRect = Vector2i(150, 50) -Altitude = 0 - -[node name="EnemyMark12" type="Node2D" parent="."] -position = Vector2(86, 176) -script = ExtResource("3_v71xh") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 4.0 -BirthRect = Vector2i(150, 50) -Altitude = 0 - -[node name="EnemyMark13" type="Node2D" parent="."] -position = Vector2(211, 79) -script = ExtResource("3_v71xh") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 5.0 -BirthRect = Vector2i(30, 50) -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room3.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room3.tscn deleted file mode 100644 index 5499714288f33e733cb4df802c0d7654924e198f..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room3.tscn +++ /dev/null @@ -1,220 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://wvv4lbvlarod"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_jjauj"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_u8a04"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room3" type="TileMap"] -tile_set = ExtResource("1_jjauj") -format = 2 -layer_0/tile_data = PackedInt32Array(786450, 0, 8, 720914, 0, 8, 655378, 0, 8, 589842, 0, 8, 524306, 0, 8, 458770, 0, 8, 393234, 0, 8, 327698, 0, 8, 262162, 0, 8, 196626, 0, 8, 131090, 0, 8, 65554, 0, 8, 18, 0, 8, 786449, 0, 8, 720913, 0, 8, 655377, 0, 8, 589841, 0, 8, 524305, 0, 8, 458769, 0, 8, 393233, 0, 8, 327697, 0, 8, 262161, 0, 8, 196625, 0, 8, 131089, 0, 8, 65553, 0, 8, 17, 0, 8, 786448, 0, 8, 720912, 0, 8, 655376, 0, 8, 589840, 0, 8, 524304, 0, 8, 458768, 0, 8, 393232, 0, 8, 327696, 0, 8, 262160, 0, 8, 196624, 0, 8, 131088, 0, 8, 65552, 0, 8, 16, 0, 8, 786447, 0, 8, 720911, 0, 8, 655375, 0, 8, 589839, 0, 8, 524303, 0, 8, 458767, 0, 8, 393231, 0, 8, 327695, 0, 8, 262159, 0, 8, 196623, 0, 8, 131087, 0, 8, 65551, 0, 8, 15, 0, 8, 786446, 0, 8, 720910, 0, 8, 655374, 0, 8, 589838, 0, 8, 524302, 0, 8, 458766, 0, 8, 393230, 0, 8, 327694, 0, 8, 262158, 0, 8, 196622, 0, 8, 131086, 0, 8, 65550, 0, 8, 14, 0, 8, 786445, 0, 8, 720909, 0, 8, 655373, 0, 8, 589837, 0, 8, 524301, 0, 8, 458765, 0, 8, 393229, 0, 8, 327693, 0, 8, 262157, 0, 8, 196621, 0, 8, 131085, 0, 8, 65549, 0, 8, 13, 0, 8, 786444, 0, 8, 720908, 0, 8, 655372, 0, 8, 589836, 0, 8, 524300, 0, 8, 786443, 0, 8, 720907, 0, 8, 655371, 0, 8, 589835, 0, 8, 524299, 0, 8, 786442, 0, 8, 720906, 0, 8, 655370, 0, 8, 589834, 0, 8, 524298, 0, 8, 786441, 0, 8, 720905, 0, 8, 655369, 0, 8, 589833, 0, 8, 524297, 0, 8, 786440, 0, 8, 720904, 0, 8, 655368, 0, 8, 589832, 0, 8, 786439, 0, 8, 720903, 0, 8, 655367, 0, 8, 589831, 0, 8, 786438, 0, 8, 720902, 0, 8, 655366, 0, 8, 589830, 0, 8, 786437, 0, 8, 720901, 0, 8, 655365, 0, 8, 589829, 0, 8, 786436, 0, 8, 720900, 0, 8, 655364, 0, 8, 589828, 0, 8, 786435, 0, 8, 720899, 0, 8, 655363, 0, 8, 589827, 0, 8, 524291, 0, 8, 458755, 0, 8, 393219, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 65539, 0, 8, 3, 0, 8, 786434, 0, 8, 720898, 0, 8, 655362, 0, 8, 589826, 0, 8, 524290, 0, 8, 458754, 0, 8, 393218, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 65538, 0, 8, 2, 0, 8, 786433, 0, 8, 720897, 0, 8, 655361, 0, 8, 589825, 0, 8, 524289, 0, 8, 458753, 0, 8, 393217, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, 786432, 0, 8, 720896, 0, 8, 655360, 0, 8, 589824, 0, 8, 524288, 0, 8, 458752, 0, 8, 393216, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, 131071, 196608, 3, 65535, 196608, 3, -1, 196608, 4, -65536, 131072, 7, -65535, 131072, 7, 196607, 196608, 3, 262143, 196608, 3, 327679, 196608, 3, 393215, 196608, 3, 458751, 196608, 3, 524287, 196608, 3, 589823, 196608, 3, 655359, 196608, 3, 720895, 196608, 3, 786431, 196608, 3, 851967, 196608, 3, 851969, 131072, 2, 851968, 131072, 2, 917503, 720896, 2, -65534, 131072, 7, 851970, 131072, 2, -65533, 131072, 7, 851971, 131072, 2, 851972, 196608, 2, 851973, 0, 8, 851974, 0, 8, 851975, 0, 8, 851976, 0, 8, 851977, 0, 8, 851978, 0, 8, -65523, 131072, 7, -65522, 131072, 7, -65521, 131072, 7, -65520, 131072, 7, -65519, 131072, 7, -65518, 131072, 7, 19, 65536, 3, 65555, 65536, 3, -65517, 65536, 4, 131091, 65536, 3, 196627, 65536, 3, 262163, 65536, 7, 327699, 0, 8, 393235, 0, 8, 458771, 0, 8, 524307, 0, 8, 589843, 0, 8, 655379, 0, 8, 720915, 0, 8, 786451, 0, 8, 851987, 0, 8, 1114135, 0, 8, 1048599, 0, 8, 983063, 0, 8, 917527, 0, 8, 851991, 0, 8, 786455, 0, 8, 720919, 0, 8, 655383, 0, 8, 589847, 0, 8, 524311, 0, 8, 458775, 0, 8, 393239, 0, 8, 327703, 0, 8, 1114134, 0, 8, 1048598, 0, 8, 983062, 0, 8, 917526, 0, 8, 851990, 0, 8, 786454, 0, 8, 720918, 0, 8, 655382, 0, 8, 589846, 0, 8, 524310, 0, 8, 458774, 0, 8, 393238, 0, 8, 327702, 0, 8, 1114133, 0, 8, 1048597, 0, 8, 983061, 0, 8, 917525, 0, 8, 851989, 0, 8, 786453, 0, 8, 720917, 0, 8, 655381, 0, 8, 589845, 0, 8, 524309, 0, 8, 458773, 0, 8, 393237, 0, 8, 327701, 0, 8, 1114132, 0, 8, 1048596, 0, 8, 983060, 0, 8, 917524, 0, 8, 851988, 0, 8, 786452, 0, 8, 720916, 0, 8, 655380, 0, 8, 589844, 0, 8, 524308, 0, 8, 458772, 0, 8, 393236, 0, 8, 327700, 0, 8, 1114122, 0, 8, 1048586, 0, 8, 983050, 0, 8, 917514, 0, 8, 1114121, 0, 8, 1048585, 0, 8, 983049, 0, 8, 917513, 0, 8, 1114120, 0, 8, 1048584, 0, 8, 983048, 0, 8, 917512, 0, 8, 1114119, 0, 8, 1048583, 0, 8, 983047, 0, 8, 917511, 0, 8, 1114118, 0, 8, 1048582, 0, 8, 983046, 0, 8, 917510, 0, 8, 1114117, 0, 8, 1048581, 0, 8, 983045, 0, 8, 917509, 0, 8, 917508, 196608, 3, 983044, 196608, 3, 1048580, 196608, 3, 1114116, 196608, 3, 1179654, 131072, 2, 1179653, 131072, 2, 1179652, 720896, 2, 1179655, 131072, 2, 1179656, 131072, 2, 1179657, 131072, 2, 1179658, 131072, 2, 262164, 131072, 7, 1179668, 131072, 2, 262165, 131072, 7, 1179669, 131072, 2, 262166, 131072, 7, 1179670, 131072, 2, 262167, 131072, 7, 1179671, 131072, 2, 327704, 65536, 3, 393240, 65536, 3, 262168, 65536, 4, 458776, 65536, 3, 524312, 65536, 3, 589848, 65536, 3, 655384, 65536, 3, 720920, 65536, 3, 786456, 65536, 3, 851992, 65536, 3, 917528, 65536, 3, 983064, 65536, 3, 1048600, 65536, 3, 1114136, 65536, 3, 1179672, 851968, 2, 458764, 0, 8, 393228, 0, 8, 327692, 0, 8, 262156, 0, 8, 196620, 0, 8, 131084, 0, 8, 65548, 0, 8, 12, 0, 8, -65524, 131072, 7, 458763, 0, 8, 393227, 0, 8, 327691, 0, 8, 458762, 0, 8, 393226, 0, 8, 327690, 0, 8, 458761, 0, 8, 393225, 0, 8, 327689, 0, 8, 524296, 0, 8, 458760, 0, 8, 393224, 0, 8, 327688, 0, 8, 524295, 0, 8, 458759, 0, 8, 393223, 0, 8, 327687, 0, 8, 524294, 0, 8, 458758, 0, 8, 393222, 0, 8, 327686, 0, 8, 262150, 0, 8, 196614, 0, 8, 131078, 0, 8, 65542, 0, 8, 6, 0, 8, -65530, 131072, 7, 524293, 0, 8, 458757, 0, 8, 393221, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 131077, 0, 8, 65541, 0, 8, 5, 0, 8, -65531, 131072, 7, 524292, 0, 8, 458756, 0, 8, 393220, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, 65540, 0, 8, 4, 0, 8, -65532, 131072, 7, 1179667, 131072, 2, 1114131, 0, 8, 1048595, 0, 8, 983059, 0, 8, 917523, 0, 8, 1179666, 131072, 2, 1114130, 0, 8, 1048594, 0, 8, 983058, 0, 8, 917522, 0, 8, 851986, 0, 8, 1179665, 131072, 2, 1114129, 0, 8, 1048593, 0, 8, 983057, 0, 8, 917521, 0, 8, 851985, 0, 8, 7, 65536, 3, 65543, 65536, 3, -65529, 65536, 4, 131079, 65536, 3, 196615, 65536, 3, 262151, 65536, 7, 262152, 131072, 7, 262153, 131072, 7, 262154, 131072, 7, 262155, 196608, 7, 65547, 196608, 3, 11, 196608, 3, -65525, 196608, 4, 131083, 196608, 3, 196619, 196608, 3, 851979, 65536, 2, 917515, 65536, 3, 983051, 65536, 3, 1048587, 65536, 3, 1114123, 65536, 3, 1179659, 851968, 2, 851980, 131072, 2, 851981, 131072, 2, 851982, 131072, 2, 851983, 131072, 2, 851984, 196608, 2, 917520, 196608, 3, 983056, 196608, 3, 1048592, 196608, 3, 1114128, 196608, 3, 1179664, 720896, 2) -script = ExtResource("dungeonRoomTemplate") - -[node name="EnemyMark" type="Node2D" parent="."] -position = Vector2(192, 146) -script = ExtResource("3_u8a04") -Weapon1Id = "0004(ResidueAmmo:10,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark2" type="Node2D" parent="."] -position = Vector2(111, 146) -script = ExtResource("3_u8a04") -Weapon1Id = "0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 2.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark3" type="Node2D" parent="."] -position = Vector2(274, 148) -script = ExtResource("3_u8a04") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 3.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark4" type="Node2D" parent="."] -position = Vector2(328, 241) -script = ExtResource("3_u8a04") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark5" type="Node2D" parent="."] -position = Vector2(129, 251) -script = ExtResource("3_u8a04") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 2.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark6" type="Node2D" parent="."] -position = Vector2(56, 56) -script = ExtResource("3_u8a04") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 3.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark7" type="Node2D" parent="."] -position = Vector2(248, 55) -script = ExtResource("3_u8a04") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 4.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark8" type="Node2D" parent="."] -position = Vector2(324, 151) -script = ExtResource("3_u8a04") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 2.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark12" type="Node2D" parent="."] -position = Vector2(80, 151) -script = ExtResource("3_u8a04") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark9" type="Node2D" parent="."] -position = Vector2(56, 67) -script = ExtResource("3_u8a04") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 3.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark10" type="Node2D" parent="."] -position = Vector2(248, 71) -script = ExtResource("3_u8a04") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 4.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark11" type="Node2D" parent="."] -position = Vector2(64, 160) -script = ExtResource("3_u8a04") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark13" type="Node2D" parent="."] -position = Vector2(307, 138) -script = ExtResource("3_u8a04") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 2.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark14" type="Node2D" parent="."] -position = Vector2(156, 139) -script = ExtResource("3_u8a04") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:20)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 3.0 -BirthRect = Vector2i(80, 80) -Altitude = 0 - -[node name="EnemyMark15" type="Node2D" parent="."] -position = Vector2(43, 43) -script = ExtResource("3_u8a04") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 5.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark16" type="Node2D" parent="."] -position = Vector2(239, 44) -script = ExtResource("3_u8a04") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 6.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark17" type="Node2D" parent="."] -position = Vector2(122, 237) -script = ExtResource("3_u8a04") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 7.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark18" type="Node2D" parent="."] -position = Vector2(326, 219) -script = ExtResource("3_u8a04") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 8.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room4.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room4.tscn deleted file mode 100644 index aa32fb9043dff3511be51da97198121f3d9e718d..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room4.tscn +++ /dev/null @@ -1,188 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://bunl6nluxu3qn"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_k1pu4"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_tkueb"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room4" type="TileMap"] -tile_set = ExtResource("1_k1pu4") -format = 2 -layer_0/tile_data = PackedInt32Array(1179669, 0, 8, 1114133, 0, 8, 1048597, 0, 8, 983061, 0, 8, 917525, 0, 8, 851989, 0, 8, 786453, 0, 8, 720917, 0, 8, 655381, 0, 8, 589845, 0, 8, 524309, 0, 8, 458773, 0, 8, 393237, 0, 8, 327701, 0, 8, 262165, 0, 8, 196629, 0, 8, 131093, 0, 8, 65557, 0, 8, 21, 0, 8, 1179668, 0, 8, 1114132, 0, 8, 1048596, 0, 8, 983060, 0, 8, 917524, 0, 8, 851988, 0, 8, 786452, 0, 8, 720916, 0, 8, 655380, 0, 8, 589844, 0, 8, 524308, 0, 8, 458772, 0, 8, 393236, 0, 8, 327700, 0, 8, 262164, 0, 8, 196628, 0, 8, 131092, 0, 8, 65556, 0, 8, 20, 0, 8, 1179667, 0, 8, 1114131, 0, 8, 65555, 0, 8, 19, 0, 8, 1179666, 0, 8, 1114130, 0, 8, 65554, 0, 8, 18, 0, 8, 1179665, 0, 8, 1114129, 0, 8, 65553, 0, 8, 17, 0, 8, 1179664, 0, 8, 1114128, 0, 8, 65552, 0, 8, 16, 0, 8, 1179663, 0, 8, 1114127, 0, 8, 65551, 0, 8, 15, 0, 8, 1179662, 0, 8, 1114126, 0, 8, 65550, 0, 8, 14, 0, 8, 1179661, 0, 8, 1114125, 0, 8, 65549, 0, 8, 13, 0, 8, 1179660, 0, 8, 1114124, 0, 8, 65548, 0, 8, 12, 0, 8, 1179659, 0, 8, 1114123, 0, 8, 65547, 0, 8, 11, 0, 8, 1179658, 0, 8, 1114122, 0, 8, 65546, 0, 8, 10, 0, 8, 1179657, 0, 8, 1114121, 0, 8, 65545, 0, 8, 9, 0, 8, 1179656, 0, 8, 1114120, 0, 8, 65544, 0, 8, 8, 0, 8, 1179655, 0, 8, 1114119, 0, 8, 65543, 0, 8, 7, 0, 8, 1179654, 0, 8, 1114118, 0, 8, 65542, 0, 8, 6, 0, 8, 1179653, 0, 8, 1114117, 0, 8, 65541, 0, 8, 5, 0, 8, 1179652, 0, 8, 1114116, 0, 8, 65540, 0, 8, 4, 0, 8, 1179651, 0, 8, 1114115, 0, 8, 65539, 0, 8, 3, 0, 8, 1179650, 0, 8, 1114114, 0, 8, 65538, 0, 8, 2, 0, 8, 1179649, 0, 8, 1114113, 0, 8, 1048577, 0, 8, 983041, 0, 8, 917505, 0, 8, 851969, 0, 8, 786433, 0, 8, 720897, 0, 8, 655361, 0, 8, 589825, 0, 8, 524289, 0, 8, 458753, 0, 8, 393217, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, 1179648, 0, 8, 1114112, 0, 8, 1048576, 0, 8, 983040, 0, 8, 917504, 0, 8, 851968, 0, 8, 786432, 0, 8, 720896, 0, 8, 655360, 0, 8, 589824, 0, 8, 524288, 0, 8, 458752, 0, 8, 393216, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, 131071, 0, 8, 65535, 0, 8, -1, 0, 8, -65536, 0, 8, -65535, 0, 8, 196607, 0, 8, 262143, 0, 8, 327679, 0, 8, 393215, 0, 8, 458751, 196608, 2, 524287, 196608, 3, 589823, 196608, 3, 655359, 196608, 3, 720895, 196608, 3, 786431, 196608, 3, 851967, 196608, 3, 917503, 196608, 7, 983039, 0, 8, 1048575, 0, 8, 1114111, 0, 8, 1179647, 0, 8, 1245183, 0, 8, 1245185, 0, 8, 1245184, 0, 8, 1310719, 0, 8, -65534, 0, 8, 1245186, 0, 8, -65533, 0, 8, 1245187, 0, 8, -65532, 0, 8, 1245188, 0, 8, -65531, 0, 8, 1245189, 0, 8, -65530, 65536, 7, 1245190, 65536, 2, -65529, 131072, 7, 1245191, 131072, 2, -65528, 131072, 7, 1245192, 131072, 2, -65527, 131072, 7, 1245193, 131072, 2, -65526, 131072, 7, 1245194, 131072, 2, -65525, 131072, 7, 1245195, 131072, 2, -65524, 131072, 7, 1245196, 131072, 2, -65523, 131072, 7, 1245197, 131072, 2, -65522, 131072, 7, 1245198, 131072, 2, -65521, 196608, 7, 1245199, 196608, 2, -65520, 0, 8, 1245200, 0, 8, -65519, 0, 8, 1245201, 0, 8, -65518, 0, 8, 1245202, 0, 8, -65517, 0, 8, 1245203, 0, 8, -65516, 0, 8, 1245204, 0, 8, -65515, 0, 8, 1245205, 0, 8, 22, 0, 8, 65558, 0, 8, -65514, 0, 8, 131094, 0, 8, 196630, 0, 8, 262166, 0, 8, 327702, 0, 8, 393238, 65536, 2, 458774, 65536, 3, 524310, 65536, 3, 589846, 65536, 3, 655382, 65536, 3, 720918, 65536, 3, 786454, 65536, 3, 851990, 65536, 7, 917526, 0, 8, 983062, 0, 8, 1048598, 0, 8, 1114134, 0, 8, 1179670, 0, 8, 1245206, 0, 8, -131067, 0, 8, -196603, 0, 8, -262139, 0, 8, -131068, 0, 8, -196604, 0, 8, -262140, 0, 8, -131069, 0, 8, -196605, 0, 8, -262141, 0, 8, -131070, 0, 8, -196606, 0, 8, -262142, 0, 8, -131071, 0, 8, -196607, 0, 8, -262143, 0, 8, -131072, 0, 8, -196608, 0, 8, -262144, 0, 8, -65537, 0, 8, -131073, 0, 8, -196609, 0, 8, 393214, 0, 8, 327678, 0, 8, 262142, 0, 8, 196606, 0, 8, 131070, 0, 8, 65534, 0, 8, -2, 0, 8, -65538, 0, 8, -131074, 0, 8, -196610, 0, 8, 393213, 0, 8, 327677, 0, 8, 262141, 0, 8, 196605, 0, 8, 131069, 0, 8, 65533, 0, 8, -3, 0, 8, -65539, 0, 8, -131075, 0, 8, -196611, 0, 8, 393212, 0, 8, 327676, 0, 8, 262140, 0, 8, 196604, 0, 8, 131068, 0, 8, 65532, 0, 8, -4, 0, 8, -65540, 0, 8, -131076, 0, 8, -196612, 0, 8, -131077, 196608, 3, -196613, 196608, 3, -262149, 196608, 4, -262148, 131072, 7, -262147, 131072, 7, -65541, 196608, 3, -5, 196608, 3, 65531, 196608, 3, 131067, 196608, 3, 196603, 196608, 3, 262139, 196608, 3, 327675, 196608, 3, 393211, 196608, 3, 458749, 131072, 2, 458748, 131072, 2, 458747, 720896, 2, -262146, 131072, 7, 458750, 131072, 2, -262145, 131072, 7, -327680, 131072, 7, -327679, 131072, 7, -327678, 131072, 7, -327677, 131072, 7, -327676, 131072, 7, -327675, 131072, 7, -262138, 65536, 3, -196602, 65536, 3, -327674, 65536, 4, -131066, 65536, 3, 262169, 0, 8, 196633, 0, 8, 131097, 0, 8, 65561, 0, 8, 25, 0, 8, -65511, 0, 8, -131047, 0, 8, -196583, 0, 8, -262119, 0, 8, 262168, 0, 8, 196632, 0, 8, 131096, 0, 8, 65560, 0, 8, 24, 0, 8, -65512, 0, 8, -131048, 0, 8, -196584, 0, 8, -262120, 0, 8, 262167, 0, 8, 196631, 0, 8, 131095, 0, 8, 65559, 0, 8, 23, 0, 8, -65513, 0, 8, -131049, 0, 8, -196585, 0, 8, -262121, 0, 8, -131050, 0, 8, -196586, 0, 8, -262122, 0, 8, -131051, 0, 8, -196587, 0, 8, -262123, 0, 8, -131052, 0, 8, -196588, 0, 8, -262124, 0, 8, -131053, 0, 8, -196589, 0, 8, -262125, 0, 8, -131054, 0, 8, -196590, 0, 8, -262126, 0, 8, -131055, 0, 8, -196591, 0, 8, -262127, 0, 8, -196592, 0, 8, -262128, 0, 8, -327664, 131072, 7, -327663, 131072, 7, -327662, 131072, 7, -131056, 0, 8, -327661, 131072, 7, -327660, 131072, 7, -327659, 131072, 7, -327658, 131072, 7, -327657, 131072, 7, 327703, 0, 8, -327656, 131072, 7, 327704, 0, 8, -327655, 131072, 7, 327705, 0, 8, -262118, 65536, 3, -196582, 65536, 3, -327654, 65536, 4, -131046, 65536, 3, -65510, 65536, 3, 26, 65536, 3, 65562, 65536, 3, 131098, 65536, 3, 196634, 65536, 3, 262170, 65536, 3, 327706, 65536, 3, 393239, 131072, 2, 393240, 131072, 2, 393241, 131072, 2, 393242, 851968, 2, -196593, 196608, 3, -262129, 196608, 3, -327665, 196608, 4, -131057, 196608, 3, 1441796, 0, 8, 1376260, 0, 8, 1310724, 0, 8, 1441795, 0, 8, 1376259, 0, 8, 1310723, 0, 8, 1441794, 0, 8, 1376258, 0, 8, 1310722, 0, 8, 1441793, 0, 8, 1376257, 0, 8, 1310721, 0, 8, 1441792, 0, 8, 1376256, 0, 8, 1310720, 0, 8, 1507327, 0, 8, 1441791, 0, 8, 1376255, 0, 8, 1507326, 0, 8, 1441790, 0, 8, 1376254, 0, 8, 1310718, 0, 8, 1245182, 0, 8, 1179646, 0, 8, 1114110, 0, 8, 1048574, 0, 8, 983038, 0, 8, 1507325, 0, 8, 1441789, 0, 8, 1376253, 0, 8, 1310717, 0, 8, 1245181, 0, 8, 1179645, 0, 8, 1114109, 0, 8, 1048573, 0, 8, 983037, 0, 8, 1507324, 0, 8, 1441788, 0, 8, 1376252, 0, 8, 1310716, 0, 8, 1245180, 0, 8, 1179644, 0, 8, 1114108, 0, 8, 1048572, 0, 8, 983036, 0, 8, 1048571, 196608, 3, 983035, 196608, 3, 917499, 196608, 4, 917500, 131072, 7, 917501, 131072, 7, 1114107, 196608, 3, 1179643, 196608, 3, 1245179, 196608, 3, 1310715, 196608, 3, 1376251, 196608, 3, 1441787, 196608, 3, 1507323, 196608, 3, 1572861, 131072, 2, 1572860, 131072, 2, 1572859, 720896, 2, 917502, 131072, 7, 1572862, 131072, 2, 1572863, 131072, 2, 1507328, 131072, 2, 1507329, 131072, 2, 1507330, 131072, 2, 1507331, 131072, 2, 1507332, 131072, 2, 1310725, 0, 8, 1376261, 0, 8, 1441797, 0, 8, 1507333, 131072, 2, 1441817, 0, 8, 1376281, 0, 8, 1310745, 0, 8, 1245209, 0, 8, 1179673, 0, 8, 1114137, 0, 8, 1048601, 0, 8, 983065, 0, 8, 917529, 0, 8, 1441816, 0, 8, 1376280, 0, 8, 1310744, 0, 8, 1245208, 0, 8, 1179672, 0, 8, 1114136, 0, 8, 1048600, 0, 8, 983064, 0, 8, 917528, 0, 8, 1441815, 0, 8, 1376279, 0, 8, 1310743, 0, 8, 1245207, 0, 8, 1179671, 0, 8, 1114135, 0, 8, 1048599, 0, 8, 983063, 0, 8, 917527, 0, 8, 1441814, 0, 8, 1376278, 0, 8, 1310742, 0, 8, 1441813, 0, 8, 1376277, 0, 8, 1310741, 0, 8, 1441812, 0, 8, 1376276, 0, 8, 1310740, 0, 8, 1441811, 0, 8, 1376275, 0, 8, 1310739, 0, 8, 1441810, 0, 8, 1376274, 0, 8, 1310738, 0, 8, 1441809, 0, 8, 1376273, 0, 8, 1310737, 0, 8, 1310736, 0, 8, 1376272, 0, 8, 1441808, 0, 8, 1507346, 131072, 2, 1507345, 131072, 2, 1507344, 131072, 2, 1507347, 131072, 2, 1507348, 131072, 2, 1507349, 131072, 2, 1507350, 131072, 2, 851991, 131072, 7, 1507351, 131072, 2, 851992, 131072, 7, 1507352, 131072, 2, 851993, 131072, 7, 1507353, 131072, 2, 917530, 65536, 3, 983066, 65536, 3, 851994, 65536, 4, 1048602, 65536, 3, 1114138, 65536, 3, 1179674, 65536, 3, 1245210, 65536, 3, 1310746, 65536, 3, 1376282, 65536, 3, 1441818, 65536, 3, 1507354, 851968, 2, 458754, 65536, 7, 131088, 0, 8, 851970, 65536, 7, 131075, 0, 8, 131074, 0, 8, 131076, 0, 8, 131077, 0, 8, 131078, 65536, 2, 131079, 196608, 2, 131080, 0, 8, 131081, 0, 8, 131082, 0, 8, 131083, 0, 8, 131084, 0, 8, 131085, 0, 8, 131086, 65536, 2, 131087, 196608, 2, 131089, 0, 8, 131090, 0, 8, 131091, 0, 8, 196627, 0, 8, 262163, 0, 8, 327699, 0, 8, 393235, 196608, 2, 458771, 196608, 7, 524307, 0, 8, 589843, 0, 8, 655379, 0, 8, 720915, 0, 8, 786451, 196608, 2, 851987, 196608, 7, 917523, 0, 8, 983059, 0, 8, 1048595, 0, 8, 1048578, 0, 8, 1048579, 0, 8, 1048580, 0, 8, 1048581, 0, 8, 1048582, 65536, 7, 1048583, 196608, 7, 1048584, 0, 8, 1048585, 0, 8, 1048586, 0, 8, 1048587, 0, 8, 1048588, 0, 8, 1048589, 0, 8, 1048590, 65536, 7, 1048591, 196608, 7, 1048592, 0, 8, 1048593, 0, 8, 1048594, 0, 8, 196610, 0, 8, 262146, 0, 8, 327682, 0, 8, 393218, 65536, 2, 524290, 0, 8, 589826, 0, 8, 655362, 0, 8, 720898, 0, 8, 786434, 65536, 2, 917506, 0, 8, 983042, 0, 8, 983045, 0, 8, 917509, 0, 8, 983044, 0, 8, 917508, 0, 8, 983043, 0, 8, 917507, 0, 8, 851971, 131072, 7, 851972, 131072, 7, 851973, 131072, 7, 917510, 65536, 3, 983046, 65536, 3, 851974, 65536, 4, 1310726, 65536, 3, 1376262, 65536, 3, 1441798, 65536, 3, 1507334, 851968, 2, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 393219, 131072, 2, 393220, 131072, 2, 393221, 131072, 2, 196614, 65536, 3, 262150, 65536, 3, 327686, 65536, 3, 393222, 851968, 2, 327698, 0, 8, 262162, 0, 8, 196626, 0, 8, 327697, 0, 8, 262161, 0, 8, 196625, 0, 8, 327696, 0, 8, 262160, 0, 8, 196624, 0, 8, 196623, 196608, 3, 262159, 196608, 3, 327695, 196608, 3, 393233, 131072, 2, 393232, 131072, 2, 393231, 720896, 2, 393234, 131072, 2, 983058, 0, 8, 917522, 0, 8, 983057, 0, 8, 917521, 0, 8, 983056, 0, 8, 917520, 0, 8, 983055, 196608, 3, 917519, 196608, 3, 851983, 196608, 4, 851984, 131072, 7, 851985, 131072, 7, 1310735, 196608, 3, 851986, 131072, 7, 1376271, 196608, 3, 1441807, 196608, 3, 1507343, 720896, 2, 983053, 0, 8, 917517, 0, 8, 851981, 0, 8, 786445, 0, 8, 720909, 0, 8, 655373, 0, 8, 589837, 0, 8, 524301, 0, 8, 458765, 0, 8, 393229, 0, 8, 327693, 0, 8, 262157, 0, 8, 196621, 0, 8, 983052, 0, 8, 917516, 0, 8, 851980, 0, 8, 786444, 0, 8, 720908, 0, 8, 655372, 0, 8, 589836, 0, 8, 524300, 0, 8, 458764, 0, 8, 393228, 0, 8, 327692, 0, 8, 262156, 0, 8, 196620, 0, 8, 983051, 0, 8, 917515, 0, 8, 851979, 0, 8, 786443, 0, 8, 720907, 0, 8, 655371, 0, 8, 589835, 0, 8, 524299, 0, 8, 458763, 0, 8, 393227, 0, 8, 327691, 0, 8, 262155, 0, 8, 196619, 0, 8, 983050, 0, 8, 917514, 0, 8, 851978, 0, 8, 786442, 0, 8, 720906, 0, 8, 655370, 0, 8, 589834, 0, 8, 524298, 0, 8, 458762, 0, 8, 393226, 0, 8, 327690, 0, 8, 262154, 0, 8, 196618, 0, 8, 983049, 0, 8, 917513, 0, 8, 851977, 0, 8, 786441, 0, 8, 720905, 0, 8, 655369, 0, 8, 589833, 0, 8, 524297, 0, 8, 458761, 0, 8, 393225, 0, 8, 327689, 0, 8, 262153, 0, 8, 196617, 0, 8, 983048, 0, 8, 917512, 0, 8, 851976, 0, 8, 786440, 0, 8, 720904, 0, 8, 655368, 0, 8, 589832, 0, 8, 524296, 0, 8, 458760, 0, 8, 393224, 0, 8, 327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 196615, 196608, 3, 262151, 196608, 3, 327687, 196608, 3, 393223, 196608, 3, 458759, 196608, 7, 524295, 0, 8, 589831, 0, 8, 655367, 0, 8, 720903, 0, 8, 786439, 196608, 2, 851975, 196608, 3, 917511, 196608, 3, 983047, 196608, 3, 196622, 65536, 3, 262158, 65536, 3, 327694, 65536, 3, 393230, 65536, 3, 458766, 65536, 7, 524302, 0, 8, 589838, 0, 8, 655374, 0, 8, 720910, 0, 8, 786446, 65536, 2, 851982, 65536, 3, 917518, 65536, 3, 983054, 65536, 3, 720914, 0, 8, 655378, 0, 8, 589842, 0, 8, 524306, 0, 8, 720913, 0, 8, 655377, 0, 8, 589841, 0, 8, 524305, 0, 8, 720912, 0, 8, 655376, 0, 8, 589840, 0, 8, 524304, 0, 8, 720911, 0, 8, 655375, 0, 8, 589839, 0, 8, 524303, 0, 8, 720902, 0, 8, 655366, 0, 8, 589830, 0, 8, 524294, 0, 8, 720901, 0, 8, 655365, 0, 8, 589829, 0, 8, 524293, 0, 8, 720900, 0, 8, 655364, 0, 8, 589828, 0, 8, 524292, 0, 8, 720899, 0, 8, 655363, 0, 8, 589827, 0, 8, 524291, 0, 8, 458755, 131072, 7, 786435, 131072, 2, 458756, 131072, 7, 786436, 131072, 2, 458757, 131072, 7, 786437, 131072, 2, 458758, 131072, 7, 786438, 131072, 2, 458767, 131072, 7, 786447, 131072, 2, 458768, 131072, 7, 786448, 131072, 2, 458769, 131072, 7, 786449, 131072, 2, 458770, 131072, 7, 786450, 131072, 2) -script = ExtResource("dungeonRoomTemplate") - -[node name="EnemyMark5" type="Node2D" parent="."] -script = ExtResource("3_tkueb") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark6" type="Node2D" parent="."] -position = Vector2(346, -8) -script = ExtResource("3_tkueb") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark7" type="Node2D" parent="."] -position = Vector2(359, 312) -script = ExtResource("3_tkueb") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark8" type="Node2D" parent="."] -position = Vector2(-8, 311) -script = ExtResource("3_tkueb") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark17" type="Node2D" parent="."] -position = Vector2(176, 165) -script = ExtResource("3_tkueb") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark9" type="Node2D" parent="."] -script = ExtResource("3_tkueb") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark10" type="Node2D" parent="."] -position = Vector2(346, -8) -script = ExtResource("3_tkueb") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark11" type="Node2D" parent="."] -position = Vector2(359, 312) -script = ExtResource("3_tkueb") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark12" type="Node2D" parent="."] -position = Vector2(-8, 311) -script = ExtResource("3_tkueb") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark18" type="Node2D" parent="."] -position = Vector2(175, 166) -script = ExtResource("3_tkueb") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark13" type="Node2D" parent="."] -script = ExtResource("3_tkueb") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark14" type="Node2D" parent="."] -position = Vector2(346, -8) -script = ExtResource("3_tkueb") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark15" type="Node2D" parent="."] -position = Vector2(359, 312) -script = ExtResource("3_tkueb") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark16" type="Node2D" parent="."] -position = Vector2(-8, 311) -script = ExtResource("3_tkueb") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark19" type="Node2D" parent="."] -position = Vector2(175, 164) -script = ExtResource("3_tkueb") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room5.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room5.tscn deleted file mode 100644 index 001a2111d107e924dea180cd5c98c73208e89d1e..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room5.tscn +++ /dev/null @@ -1,124 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://cllr044e4g3cg"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_657ry"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_epa54"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room5" type="TileMap"] -tile_set = ExtResource("1_657ry") -format = 2 -layer_0/tile_data = PackedInt32Array(65538, 0, 8, 2, 0, 8, -65534, 0, 8, -65535, 0, 8, -65536, 0, 8, 131071, 0, 8, 65535, 0, 8, -1, 0, 8, 65534, 0, 8, -2, 0, 8, -65538, 0, 8, -65537, 0, 8, -131072, 0, 8, 131070, 0, 8, 196607, 0, 8, 196606, 0, 8, -131071, 0, 8, -131070, 0, 8, -65533, 0, 8, 3, 0, 8, -131069, 0, 8, 65539, 0, 8, 327696, 0, 8, 262160, 0, 8, 196624, 0, 8, 131088, 0, 8, 65552, 0, 8, 16, 0, 8, -65520, 0, 8, 327695, 0, 8, 262159, 0, 8, 196623, 0, 8, 131087, 0, 8, 65551, 0, 8, 15, 0, 8, -65521, 0, 8, 327694, 0, 8, 262158, 0, 8, 196622, 0, 8, 131086, 0, 8, 65550, 0, 8, 14, 0, 8, -65522, 0, 8, 327693, 0, 8, 262157, 0, 8, 196621, 0, 8, 131085, 0, 8, 65549, 0, 8, 13, 0, 8, -65523, 0, 8, 589835, 0, 8, 524299, 0, 8, 458763, 0, 8, 393227, 0, 8, 589834, 0, 8, 524298, 0, 8, 458762, 0, 8, 393226, 0, 8, 589833, 0, 8, 524297, 0, 8, 458761, 0, 8, 393225, 0, 8, 589832, 0, 8, 524296, 0, 8, 458760, 0, 8, 393224, 0, 8, 589831, 0, 8, 524295, 0, 8, 458759, 0, 8, 393223, 0, 8, 589830, 0, 8, 524294, 0, 8, 458758, 0, 8, 393222, 0, 8, 589829, 0, 8, 524293, 0, 8, 458757, 0, 8, 393221, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 589828, 0, 8, 524292, 0, 8, 458756, 0, 8, 393220, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 589827, 0, 8, 524291, 0, 8, 458755, 0, 8, 393219, 0, 8, 327683, 0, 8, 327682, 0, 8, 393215, 0, 8, 327679, 0, 8, 262143, 0, 8, 262142, 0, 8, 327678, 0, 8, 393214, 0, 8, 655363, 0, 8, -131068, 0, 8, 655364, 0, 8, 655365, 0, 8, 655366, 0, 8, 655367, 0, 8, 655368, 0, 8, 655369, 0, 8, 655370, 0, 8, 655371, 0, 8, -131060, 0, 8, -131059, 0, 8, -131058, 0, 8, -131057, 0, 8, -131056, 0, 8, -65519, 65536, 3, 17, 65536, 3, -131055, 65536, 3, 65553, 65536, 3, 131089, 65536, 3, 196625, 65536, 3, 262161, 65536, 3, 327697, 65536, 3, 524302, 0, 8, 458766, 0, 8, 393230, 0, 8, 524301, 0, 8, 458765, 0, 8, 393229, 0, 8, 524300, 0, 8, 458764, 0, 8, 393228, 0, 8, 589837, 131072, 2, 589836, 65536, 2, 589838, 131072, 2, 393231, 65536, 2, 458767, 65536, 3, 524303, 65536, 3, 589839, 851968, 2, 524290, 0, 8, 458754, 0, 8, 393218, 0, 8, 524289, 0, 8, 458753, 0, 8, 524288, 0, 8, 458752, 0, 8, 589823, 0, 8, 524287, 0, 8, 458751, 0, 8, 524286, 0, 8, 458750, 0, 8, 589822, 0, 8, 589824, 131072, 2, 655359, 131072, 2, 655358, 131072, 2, 589825, 131072, 2, 589826, 196608, 2, -196592, 0, 8, -262128, 0, 8, -327664, 0, 8, -196593, 0, 8, -262129, 0, 8, -327665, 0, 8, -196594, 0, 8, -262130, 0, 8, -327666, 0, 8, -196595, 0, 8, -262131, 0, 8, -327667, 0, 8, -196596, 0, 8, -262132, 0, 8, -327668, 0, 8, -262133, 0, 8, -327669, 0, 8, -262134, 0, 8, -327670, 0, 8, -262135, 0, 8, -327671, 0, 8, -262136, 0, 8, -327672, 0, 8, -262137, 0, 8, -327673, 0, 8, -262138, 0, 8, -327674, 0, 8, -262139, 0, 8, -327675, 0, 8, -196604, 0, 8, -262140, 0, 8, -327676, 0, 8, -196605, 0, 8, -262141, 0, 8, -327677, 0, 8, -196606, 0, 8, -262142, 0, 8, -327678, 0, 8, -65539, 196608, 3, -3, 196608, 3, -393214, 131072, 7, -393213, 131072, 7, -393212, 131072, 7, -393211, 131072, 7, -393210, 131072, 7, -393209, 131072, 7, -393208, 131072, 7, -393207, 131072, 7, -393206, 131072, 7, -393205, 131072, 7, -393204, 131072, 7, -393203, 131072, 7, -393202, 131072, 7, -393201, 131072, 7, -393200, 131072, 7, -327663, 65536, 3, -262127, 65536, 3, -393199, 65536, 4, -196591, 65536, 3, 131084, 0, 8, 65548, 0, 8, 12, 0, 8, -65524, 0, 8, 131083, 0, 8, 65547, 0, 8, 11, 0, 8, 131082, 0, 8, 65546, 0, 8, 10, 0, 8, 9, 0, 8, 8, 0, 8, 7, 0, 8, 6, 0, 8, 131077, 0, 8, 65541, 0, 8, 5, 0, 8, 131076, 0, 8, 65540, 0, 8, 4, 0, 8, -65532, 0, 8, 131081, 0, 8, 65545, 0, 8, 131080, 0, 8, 65544, 0, 8, 131079, 0, 8, 65543, 0, 8, 131078, 0, 8, 65542, 0, 8, 196614, 0, 8, 196615, 0, 8, -196603, 65536, 2, -196602, 131072, 2, -196601, 131072, 2, -196600, 131072, 2, -196599, 131072, 2, -196598, 131072, 2, -196597, 196608, 2, -131061, 196608, 3, -65525, 196608, 7, -65531, 65536, 7, -65530, 131072, 7, -65529, 131072, 7, -65528, 131072, 7, -65527, 131072, 7, -65526, 131072, 7, -131067, 65536, 3, 327686, 0, 8, 327687, 0, 8, 262150, 0, 8, 393232, 131072, 2, 393233, 851968, 2, 655372, 65536, 3, 655362, 196608, 3, 65533, 196608, 3, 131069, 196608, 3, 196605, 196608, 3, 262141, 196608, 3, 327677, 196608, 3, 393213, 196608, 3, 458749, 196608, 3, 524285, 196608, 3, 589821, 196608, 3, 327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 262151, 0, 8, 196617, 65536, 2, 262153, 65536, 3, 327689, 65536, 7, 196618, 131072, 2, 196619, 131072, 2, 196620, 196608, 2, 262156, 196608, 3, 327692, 196608, 7, 327690, 131072, 7, 327691, 131072, 7, 393217, 0, 8, 327681, 0, 8, 65537, 0, 8, 1, 0, 8, 393216, 0, 8, 327680, 0, 8, 65536, 0, 8, 0, 0, 8, 131072, 65536, 2, 131073, 131072, 2, 131074, 131072, 2, 131075, 196608, 2, 196611, 196608, 3, 262147, 196608, 7, 262144, 65536, 7, 262145, 131072, 7, 262146, 131072, 7, 196608, 65536, 3, 655357, 720896, 2, -262143, 196608, 3, -327679, 196608, 3, -393215, 196608, 4, -196607, 196608, 7, -131075, 196608, 4, -131074, 131072, 7, -131073, 131072, 7, -196608, 131072, 7, 720900, 131072, 2, 720899, 131072, 2, 720898, 720896, 2, 720901, 131072, 2, 720902, 131072, 2, 720903, 131072, 2, 720904, 131072, 2, 720905, 131072, 2, 720906, 131072, 2, 720907, 131072, 2, 720908, 851968, 2) -script = ExtResource("dungeonRoomTemplate") - -[node name="EnemyMark" type="Node2D" parent="."] -position = Vector2(105, 107) -script = ExtResource("3_epa54") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -BirthRect = Vector2i(50, 100) -Altitude = 0 - -[node name="EnemyMark2" type="Node2D" parent="."] -position = Vector2(232, -12) -script = ExtResource("3_epa54") -Weapon1Id = "0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 1.0 -BirthRect = Vector2i(50, 100) -Altitude = 0 - -[node name="EnemyMark3" type="Node2D" parent="."] -position = Vector2(17, 3) -script = ExtResource("3_epa54") -Weapon1Id = "0006(ResidueAmmo:20,CurrAmmon:0)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 2.0 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark4" type="Node2D" parent="."] -position = Vector2(100, 48) -script = ExtResource("3_epa54") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -BirthRect = Vector2i(50, 50) -Altitude = 0 - -[node name="EnemyMark5" type="Node2D" parent="."] -position = Vector2(33, 116) -script = ExtResource("3_epa54") -Weapon1Id = "0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(100, 50) -Altitude = 0 - -[node name="EnemyMark6" type="Node2D" parent="."] -position = Vector2(123, 143) -script = ExtResource("3_epa54") -Weapon1Id = "0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 2.0 -BirthRect = Vector2i(100, 50) -Altitude = 0 - -[node name="EnemyMark7" type="Node2D" parent="."] -position = Vector2(189, 28) -script = ExtResource("3_epa54") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -BirthRect = Vector2i(100, 30) -Altitude = 0 - -[node name="EnemyMark8" type="Node2D" parent="."] -position = Vector2(189, 28) -script = ExtResource("3_epa54") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -BirthRect = Vector2i(100, 30) -Altitude = 0 - -[node name="EnemyMark9" type="Node2D" parent="."] -position = Vector2(25, -3) -script = ExtResource("3_epa54") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(70, 30) -Altitude = 0 - -[node name="EnemyMark10" type="Node2D" parent="."] -position = Vector2(155, -61) -script = ExtResource("3_epa54") -Weapon1Id = "0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 2.0 -BirthRect = Vector2i(200, 15) -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room6.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room6.tscn deleted file mode 100644 index 31f9ee96a71824cdeaf305550bc2d932d9a2961a..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room6.tscn +++ /dev/null @@ -1,130 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://d1os2i60rnd0i"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_83m2u"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_g5jtq"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room6" type="TileMap"] -tile_set = ExtResource("1_83m2u") -format = 2 -layer_0/tile_data = PackedInt32Array(393226, 0, 8, 327690, 0, 8, 10, 0, 8, 393225, 0, 8, 327689, 0, 8, 65545, 0, 8, 9, 0, 8, 393224, 0, 8, 327688, 0, 8, 262152, 0, 8, 65544, 0, 8, 8, 0, 8, 393223, 0, 8, 327687, 0, 8, 262151, 0, 8, 393222, 0, 8, 327686, 0, 8, 262150, 0, 8, 196614, 0, 8, 131078, 0, 8, 393221, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 131077, 0, 8, 393220, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, 393219, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 393218, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 393217, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, -65535, 0, 8, 393216, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, -65536, 0, 8, 458751, 0, 8, 393215, 0, 8, 327679, 0, 8, 262143, 0, 8, 196607, 0, 8, 131071, 0, 8, 65535, 0, 8, -1, 0, 8, 65534, 0, 8, -2, 0, 8, -65538, 0, 8, -65537, 0, 8, -131072, 0, 8, 131070, 0, 8, 196606, 196608, 2, 262142, 196608, 3, 327678, 196608, 3, 393214, 196608, 3, 458750, 196608, 3, 458752, 131072, 2, 524287, 131072, 2, 524286, 720896, 2, -131071, 0, 8, 458753, 131072, 2, 458754, 131072, 2, 458755, 131072, 2, 458756, 131072, 2, 458757, 131072, 2, 458758, 131072, 2, 458759, 131072, 2, 458760, 131072, 2, 458761, 131072, 2, 458762, 131072, 2, -65525, 0, 8, 11, 0, 8, 327691, 0, 8, 393227, 0, 8, 458763, 131072, 2, 65555, 0, 8, 19, 0, 8, -65517, 0, 8, -131053, 0, 8, -196589, 0, 8, -262125, 0, 8, -327661, 0, 8, 65554, 0, 8, 18, 0, 8, -65518, 0, 8, -131054, 0, 8, -196590, 0, 8, -262126, 0, 8, -327662, 0, 8, 65553, 0, 8, 17, 0, 8, -65519, 0, 8, -131055, 0, 8, -196591, 0, 8, -262127, 0, 8, -327663, 0, 8, 65552, 0, 8, 16, 0, 8, -327664, 0, 8, 65551, 0, 8, 15, 0, 8, -327665, 0, 8, 14, 0, 8, -327666, 0, 8, 13, 0, 8, -65523, 0, 8, -131059, 0, 8, -196595, 0, 8, -262131, 0, 8, -327667, 0, 8, 12, 0, 8, -65524, 0, 8, -131060, 0, 8, -196596, 0, 8, -262132, 0, 8, -327668, 0, 8, -262133, 0, 8, -327669, 0, 8, -262134, 0, 8, -327670, 0, 8, -262135, 0, 8, -327671, 0, 8, -262136, 0, 8, -327672, 0, 8, -262137, 0, 8, -327673, 0, 8, -262138, 0, 8, -327674, 0, 8, -262139, 0, 8, -327675, 0, 8, -262140, 0, 8, -327676, 0, 8, -262141, 0, 8, -327677, 0, 8, -262142, 0, 8, -327678, 0, 8, -196607, 0, 8, -262143, 0, 8, -327679, 0, 8, -196608, 0, 8, -262144, 0, 8, -327680, 0, 8, -131073, 0, 8, -196609, 0, 8, -262145, 0, 8, -131074, 0, 8, -196610, 0, 8, -262146, 0, 8, -196611, 196608, 3, -262147, 196608, 3, -327683, 196608, 4, -327682, 131072, 7, -327681, 131072, 7, -131075, 196608, 3, -65539, 196608, 3, -3, 196608, 3, 65533, 196608, 3, 131069, 196608, 3, 196605, 720896, 2, -393216, 131072, 7, -393215, 131072, 7, -393214, 131072, 7, -393213, 131072, 7, -393212, 131072, 7, -393211, 131072, 7, -393210, 131072, 7, -393209, 131072, 7, -393208, 131072, 7, -393207, 131072, 7, -393206, 131072, 7, -393205, 131072, 7, -393204, 131072, 7, -393203, 131072, 7, -393202, 131072, 7, -393201, 131072, 7, 131087, 0, 8, -393200, 131072, 7, 131088, 0, 8, -393199, 131072, 7, 131089, 0, 8, -393198, 131072, 7, 131090, 65536, 2, -393197, 131072, 7, 131091, 131072, 2, -327660, 65536, 3, -262124, 65536, 3, -393196, 65536, 4, -196588, 65536, 3, -131052, 65536, 3, -65516, 65536, 3, 20, 65536, 3, 65556, 65536, 3, 131092, 851968, 2, 65543, 0, 8, 7, 0, 8, 65542, 0, 8, 6, 0, 8, -131061, 0, 8, -196597, 0, 8, -196598, 0, 8, -196599, 0, 8, -196600, 0, 8, -196605, 0, 8, -196606, 0, 8, -131070, 65536, 2, 131086, 0, 8, 65550, 0, 8, 131085, 0, 8, 65549, 0, 8, 65548, 0, 8, 262155, 0, 8, 65547, 0, 8, 65546, 0, 8, 196623, 0, 8, 196622, 0, 8, 196621, 0, 8, 262156, 0, 8, 327692, 0, 8, 196624, 0, 8, -65530, 131072, 7, -65529, 131072, 7, 131079, 65536, 2, -65528, 131072, 7, -65527, 131072, 7, 196615, 65536, 7, 65539, 131072, 7, -65526, 196608, 7, -131062, 196608, 2, -131069, 131072, 2, -131064, 131072, 2, -131063, 131072, 2, -65534, 65536, 3, 2, 65536, 3, 65538, 65536, 7, 131080, 131072, 2, 131081, 131072, 2, 196616, 131072, 7, 393228, 0, 8, 458764, 131072, 2, 458765, 131072, 2, -262128, 0, 8, -262129, 0, 8, -262130, 0, 8, -196594, 65536, 2, -131058, 65536, 3, -65522, 65536, 7, -196593, 131072, 2, -196592, 196608, 2, -131056, 196608, 3, -65520, 196608, 7, -65521, 131072, 7, 196625, 0, 8, 196626, 65536, 3, 262162, 65536, 3, 262153, 65536, 7, 196617, 65536, 4, 262154, 196608, 7, 196618, 196608, 4, 196619, 131072, 7, 196620, 196608, 7, 131084, 196608, 2, 131082, 131072, 2, 131083, 131072, 2, -196603, 131072, 2, -196602, 131072, 2, -196601, 196608, 2, -131065, 720896, 2, -196604, 65536, 2, -131068, 851968, 2, 65540, 196608, 7, 65541, 0, 8, 5, 0, 8, -65531, 131072, 7, 4, 196608, 3, -65532, 196608, 4, 262161, 0, 8, 262160, 0, 8, 393231, 0, 8, 327695, 0, 8, 262159, 0, 8, 393230, 0, 8, 327694, 0, 8, 262158, 0, 8, 393229, 0, 8, 327693, 0, 8, 262157, 0, 8, 458766, 131072, 2, 458767, 131072, 2, 458768, 851968, 2, 327698, 851968, 2, 327696, 65536, 2, 327697, 131072, 2, 393232, 65536, 3) -script = ExtResource("dungeonRoomTemplate") -EnableEdit = true - -[node name="EnemyMark" type="Node2D" parent="."] -position = Vector2(51, 77) -script = ExtResource("3_g5jtq") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15); -0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -BirthRect = Vector2i(100, 60) -Altitude = 0 - -[node name="EnemyMark2" type="Node2D" parent="."] -position = Vector2(-1, -23) -script = ExtResource("3_g5jtq") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15); -0002(ResidueAmmo:7,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 1.0 -BirthRect = Vector2i(30, 60) -Altitude = 0 - -[node name="EnemyMark3" type="Node2D" parent="."] -position = Vector2(200, -27) -script = ExtResource("3_g5jtq") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15); -0002(ResidueAmmo:7,CurrAmmon:7); -0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 3.0 -BirthRect = Vector2i(20, 60) -Altitude = 0 - -[node name="EnemyMark4" type="Node2D" parent="."] -position = Vector2(261, 43) -script = ExtResource("3_g5jtq") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15); -0002(ResidueAmmo:7,CurrAmmon:7); -0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 3.0 -BirthRect = Vector2i(20, 60) -Altitude = 0 - -[node name="EnemyMark5" type="Node2D" parent="."] -position = Vector2(233, 61) -script = ExtResource("3_g5jtq") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5); -0006(ResidueAmmo:20,CurrAmmon:20); -0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -BirthRect = Vector2i(20, 90) -Altitude = 0 - -[node name="EnemyMark6" type="Node2D" parent="."] -position = Vector2(155, 19) -script = ExtResource("3_g5jtq") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5); -0006(ResidueAmmo:20,CurrAmmon:20); -0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(100, 10) -Altitude = 0 - -[node name="EnemyMark7" type="Node2D" parent="."] -position = Vector2(75, -61) -script = ExtResource("3_g5jtq") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5); -0006(ResidueAmmo:20,CurrAmmon:20); -0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 2.0 -BirthRect = Vector2i(100, 10) -Altitude = 0 - -[node name="EnemyMark8" type="Node2D" parent="."] -position = Vector2(47, 69) -script = ExtResource("3_g5jtq") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5); -0006(ResidueAmmo:20,CurrAmmon:20); -0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 3.0 -BirthRect = Vector2i(100, 50) -Altitude = 0 - -[node name="EnemyMark9" type="Node2D" parent="."] -position = Vector2(178, -54) -script = ExtResource("3_g5jtq") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5); -0006(ResidueAmmo:20,CurrAmmon:20); -0007(ResidueAmmo:30,CurrAmmon:30)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 2 -DelayTime = 4.0 -BirthRect = Vector2i(70, 20) -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn deleted file mode 100644 index fecb878a0f05e8d0763cb82936515cb0b1212857..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn +++ /dev/null @@ -1,215 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://da8uytgy0hroo"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_n27nn"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_y6it6"] -[ext_resource type="Script" path="res://src/framework/map/mark/ActivityMark.cs" id="4_5ha7k"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room8" type="TileMap"] -tile_set = ExtResource("1_n27nn") -format = 2 -layer_0/tile_data = PackedInt32Array(720914, 0, 8, 655378, 0, 8, 589842, 0, 8, 524306, 0, 8, 458770, 0, 8, 393234, 0, 8, 327698, 0, 8, 262162, 0, 8, 196626, 0, 8, 131090, 0, 8, 65554, 0, 8, 18, 0, 8, -65518, 0, 8, -131054, 0, 8, 720913, 0, 8, 655377, 0, 8, 589841, 0, 8, 524305, 0, 8, 458769, 0, 8, 393233, 0, 8, 327697, 0, 8, 262161, 0, 8, 196625, 0, 8, 131089, 0, 8, 65553, 0, 8, 17, 0, 8, -65519, 0, 8, -131055, 0, 8, 720912, 0, 8, 655376, 0, 8, 589840, 0, 8, 524304, 0, 8, 458768, 0, 8, 393232, 0, 8, 327696, 0, 8, 262160, 0, 8, 196624, 0, 8, 131088, 0, 8, 65552, 0, 8, 16, 0, 8, -65520, 0, 8, -131056, 0, 8, 720911, 0, 8, 655375, 0, 8, 589839, 0, 8, 524303, 0, 8, 458767, 0, 8, 393231, 0, 8, 327695, 0, 8, 262159, 0, 8, 196623, 0, 8, 131087, 0, 8, 65551, 0, 8, 15, 0, 8, -65521, 0, 8, -131057, 0, 8, 720910, 0, 8, 655374, 0, 8, 589838, 0, 8, 524302, 0, 8, 458766, 0, 8, 393230, 0, 8, 327694, 0, 8, 262158, 0, 8, 196622, 0, 8, 131086, 0, 8, 65550, 0, 8, 14, 0, 8, -65522, 0, 8, -131058, 0, 8, 720909, 0, 8, 655373, 0, 8, 589837, 0, 8, 524301, 0, 8, 458765, 0, 8, 393229, 0, 8, 327693, 0, 8, 262157, 0, 8, 196621, 0, 8, 131085, 0, 8, 65549, 0, 8, 13, 0, 8, -65523, 0, 8, -131059, 0, 8, 720908, 0, 8, 655372, 0, 8, 589836, 0, 8, 524300, 0, 8, 458764, 0, 8, 393228, 0, 8, 327692, 0, 8, 262156, 0, 8, 196620, 0, 8, 131084, 0, 8, 65548, 0, 8, 12, 0, 8, -65524, 0, 8, -131060, 0, 8, 720907, 0, 8, 655371, 0, 8, 589835, 0, 8, 524299, 0, 8, 458763, 0, 8, 393227, 0, 8, 327691, 0, 8, 262155, 0, 8, 196619, 0, 8, 131083, 0, 8, 65547, 0, 8, 11, 0, 8, -65525, 0, 8, -131061, 0, 8, 720906, 0, 8, 655370, 0, 8, 589834, 0, 8, 524298, 0, 8, 458762, 0, 8, 393226, 0, 8, 327690, 0, 8, 262154, 0, 8, 196618, 0, 8, 131082, 0, 8, 65546, 0, 8, 10, 0, 8, -65526, 0, 8, -131062, 0, 8, 720905, 0, 8, 655369, 0, 8, 589833, 0, 8, 524297, 0, 8, 458761, 0, 8, 393225, 0, 8, 327689, 0, 8, 262153, 0, 8, 196617, 0, 8, 131081, 0, 8, 65545, 0, 8, 9, 0, 8, -65527, 0, 8, -131063, 0, 8, 720904, 0, 8, 655368, 0, 8, 589832, 0, 8, 524296, 0, 8, 458760, 0, 8, 393224, 0, 8, 327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 131080, 0, 8, 65544, 0, 8, 8, 0, 8, -65528, 0, 8, -131064, 0, 8, 720903, 0, 8, 655367, 0, 8, 589831, 0, 8, 524295, 0, 8, 458759, 0, 8, 393223, 0, 8, 327687, 0, 8, 262151, 0, 8, 196615, 0, 8, 131079, 0, 8, 65543, 0, 8, 7, 0, 8, -65529, 0, 8, -131065, 0, 8, 720902, 0, 8, 655366, 0, 8, 589830, 0, 8, 524294, 0, 8, 458758, 0, 8, 393222, 0, 8, 327686, 0, 8, 262150, 0, 8, 196614, 0, 8, 131078, 0, 8, 65542, 0, 8, 6, 0, 8, -65530, 0, 8, -131066, 0, 8, 720901, 0, 8, 655365, 0, 8, 589829, 0, 8, 524293, 0, 8, 458757, 0, 8, 393221, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 131077, 0, 8, 65541, 0, 8, 5, 0, 8, -65531, 0, 8, -131067, 0, 8, 720900, 0, 8, 655364, 0, 8, 589828, 0, 8, 524292, 0, 8, 458756, 0, 8, 393220, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, 65540, 0, 8, 4, 0, 8, -65532, 0, 8, -131068, 0, 8, 720899, 0, 8, 655363, 0, 8, 589827, 0, 8, 524291, 0, 8, 458755, 0, 8, 393219, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 65539, 0, 8, 3, 0, 8, -65533, 0, 8, -131069, 0, 8, 720898, 0, 8, 655362, 0, 8, 589826, 0, 8, 524290, 0, 8, 458754, 0, 8, 393218, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 65538, 0, 8, 2, 0, 8, -65534, 0, 8, -131070, 0, 8, 720897, 0, 8, 655361, 0, 8, 589825, 0, 8, 524289, 0, 8, 458753, 0, 8, 393217, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, -65535, 0, 8, -131071, 0, 8, 720896, 0, 8, 655360, 0, 8, 589824, 0, 8, 524288, 0, 8, 458752, 0, 8, 393216, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, -65536, 0, 8, -131072, 0, 8, 786431, 0, 8, 720895, 0, 8, 655359, 0, 8, 589823, 0, 8, 524287, 0, 8, 458751, 0, 8, 393215, 0, 8, 327679, 0, 8, 262143, 0, 8, 196607, 0, 8, 131071, 0, 8, 65535, 0, 8, -1, 0, 8, -65537, 0, 8, 786430, 0, 8, 720894, 0, 8, 655358, 0, 8, 589822, 0, 8, 524286, 0, 8, 458750, 0, 8, 393214, 0, 8, 327678, 0, 8, 262142, 0, 8, 196606, 0, 8, 131070, 0, 8, 65534, 0, 8, -2, 0, 8, -65538, 0, 8, 786429, 0, 8, 720893, 0, 8, 655357, 0, 8, 589821, 0, 8, 524285, 0, 8, 458749, 0, 8, 393213, 0, 8, 327677, 0, 8, 262141, 0, 8, 196605, 0, 8, 131069, 0, 8, 65533, 0, 8, -3, 0, 8, -65539, 0, 8, 786428, 0, 8, 720892, 0, 8, 655356, 0, 8, 589820, 0, 8, 524284, 0, 8, 458748, 0, 8, 393212, 0, 8, 327676, 0, 8, 262140, 0, 8, 196604, 0, 8, 131068, 0, 8, 65532, 0, 8, -4, 0, 8, -65540, 0, 8, -5, 196608, 3, -65541, 196608, 3, -131077, 196608, 4, -131076, 131072, 7, -131075, 131072, 7, 65531, 196608, 3, 131067, 196608, 3, 196603, 196608, 3, 262139, 196608, 3, 327675, 196608, 3, 393211, 196608, 3, 458747, 196608, 3, 524283, 196608, 3, 589819, 196608, 3, 655355, 196608, 3, 720891, 196608, 3, 786427, 196608, 3, 851965, 131072, 2, 851964, 131072, 2, 851963, 720896, 2, -131074, 131072, 7, 851966, 131072, 2, -131073, 131072, 7, 851967, 131072, 2, -196608, 131072, 7, 786432, 131072, 2, -196607, 131072, 7, 786433, 131072, 2, -196606, 131072, 7, 786434, 131072, 2, -196605, 131072, 7, 786435, 131072, 2, -196604, 131072, 7, 786436, 131072, 2, -196603, 131072, 7, 786437, 131072, 2, -196602, 131072, 7, 786438, 131072, 2, -196601, 131072, 7, 786439, 131072, 2, -196600, 131072, 7, 786440, 131072, 2, -196599, 131072, 7, 786441, 131072, 2, -196598, 131072, 7, 786442, 131072, 2, -196597, 131072, 7, 786443, 131072, 2, -196596, 131072, 7, 786444, 131072, 2, -196595, 131072, 7, 786445, 131072, 2, -196594, 131072, 7, 786446, 131072, 2, -196593, 131072, 7, 786447, 131072, 2, -196592, 131072, 7, 786448, 131072, 2, -196591, 131072, 7, 786449, 131072, 2, -196590, 131072, 7, 786450, 131072, 2, -131053, 65536, 3, -65517, 65536, 3, -196589, 65536, 4, 19, 65536, 3, 65555, 65536, 3, 131091, 65536, 3, 196627, 65536, 3, 262163, 65536, 3, 327699, 65536, 3, 393235, 65536, 3, 458771, 65536, 3, 524307, 65536, 3, 589843, 65536, 3, 655379, 65536, 3, 720915, 65536, 3, 786451, 851968, 2) -script = ExtResource("dungeonRoomTemplate") - -[node name="EnemyMark" type="Node2D" parent="."] -position = Vector2(17, 38) -script = ExtResource("3_y6it6") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -DelayTime = 1.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark3" type="Node2D" parent="."] -position = Vector2(198, 129) -script = ExtResource("3_y6it6") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="ActivityMark" type="Node2D" parent="."] -position = Vector2(116, 80) -script = ExtResource("4_5ha7k") -Type = 5 -ItemExpression = "0002(ResidueAmmo:7,CurrAmmon:7)" -WaveNumber = 2 -DelayTime = 1.0 -BirthRect = Vector2i(150, 150) - -[node name="ActivityMark2" type="Node2D" parent="."] -position = Vector2(208, 101) -script = ExtResource("4_5ha7k") -Type = 5 -ItemExpression = "0001(ResidueAmmo:15,CurrAmmon:15)" -WaveNumber = 2 -DelayTime = 1.5 -BirthRect = Vector2i(150, 150) - -[node name="ActivityMark3" type="Node2D" parent="."] -position = Vector2(115, 64) -script = ExtResource("4_5ha7k") -Type = 5 -ItemExpression = "0003(ResidueAmmo:12,CurrAmmon:12)" -WaveNumber = 2 -DelayTime = 2.0 -BirthRect = Vector2i(150, 150) - -[node name="EnemyMark2" type="Node2D" parent="."] -position = Vector2(52, 123) -script = ExtResource("3_y6it6") -Weapon1Id = "0003(ResidueAmmo:12,CurrAmmon:7)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark13" type="Node2D" parent="."] -position = Vector2(69, 35) -script = ExtResource("3_y6it6") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 1.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark14" type="Node2D" parent="."] -position = Vector2(224, 41) -script = ExtResource("3_y6it6") -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 2.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark15" type="Node2D" parent="."] -position = Vector2(218, 114) -script = ExtResource("3_y6it6") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 3 -DelayTime = 4.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark4" type="Node2D" parent="."] -position = Vector2(138, 89) -script = ExtResource("3_y6it6") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark5" type="Node2D" parent="."] -position = Vector2(27, 108) -script = ExtResource("3_y6it6") -Weapon1Id = "0005(ResidueAmmo:5,CurrAmmon:5)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 1.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark6" type="Node2D" parent="."] -position = Vector2(175, 110) -script = ExtResource("3_y6it6") -Weapon1Id = " -" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 2.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark7" type="Node2D" parent="."] -position = Vector2(35, 47) -script = ExtResource("3_y6it6") -Weapon1Id = "0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 3.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark8" type="Node2D" parent="."] -position = Vector2(157, 38) -script = ExtResource("3_y6it6") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 4 -DelayTime = 5.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark9" type="Node2D" parent="."] -position = Vector2(5, 79) -script = ExtResource("3_y6it6") -Weapon1Id = "0001(ResidueAmmo:15,CurrAmmon:15)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 5 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark10" type="Node2D" parent="."] -position = Vector2(66, 125) -script = ExtResource("3_y6it6") -Weapon1Id = "0005(ResidueAmmo:0,CurrAmmon:10)" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 5 -DelayTime = 2.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark11" type="Node2D" parent="."] -position = Vector2(190, 104) -script = ExtResource("3_y6it6") -Weapon1Id = " -" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 5 -DelayTime = 3.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 - -[node name="EnemyMark12" type="Node2D" parent="."] -position = Vector2(145, 43) -script = ExtResource("3_y6it6") -Weapon1Id = " -" -Type = 4 -ItemExpression = "0001" -Layer = 1 -WaveNumber = 5 -DelayTime = 4.0 -BirthRect = Vector2i(100, 100) -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/boss/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/boss/Room1.tscn deleted file mode 100644 index 3ce462876d71269e4c78194dbafd4f1921726c3a..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/boss/Room1.tscn +++ /dev/null @@ -1,59 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://bm1820vfwqf52"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_k0vyv"] -[ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_enrje"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room1" type="TileMap"] -tile_set = ExtResource("1_k0vyv") -format = 2 -layer_0/tile_data = PackedInt32Array(1114144, 0, 8, 1048608, 0, 8, 983072, 0, 8, 917536, 0, 8, 852000, 0, 8, 786464, 0, 8, 720928, 0, 8, 655392, 0, 8, 589856, 0, 8, 524320, 0, 8, 458784, 0, 8, 393248, 0, 8, 327712, 0, 8, 262176, 0, 8, 196640, 0, 8, 131104, 0, 8, 65568, 0, 8, 32, 0, 8, -65504, 0, 8, -131040, 0, 8, -196576, 0, 8, -262112, 0, 8, -327648, 0, 8, 1114143, 0, 8, 1048607, 0, 8, 983071, 0, 8, 917535, 0, 8, 851999, 0, 8, 786463, 0, 8, 720927, 0, 8, 655391, 0, 8, 589855, 0, 8, 524319, 0, 8, 458783, 0, 8, 393247, 0, 8, 327711, 0, 8, 262175, 0, 8, 196639, 0, 8, 131103, 0, 8, 65567, 0, 8, 31, 0, 8, -65505, 0, 8, -131041, 0, 8, -196577, 0, 8, -262113, 0, 8, -327649, 0, 8, 1114142, 0, 8, 1048606, 0, 8, 983070, 0, 8, 917534, 0, 8, 851998, 0, 8, 786462, 0, 8, 720926, 0, 8, 655390, 0, 8, 589854, 0, 8, 524318, 0, 8, 458782, 0, 8, 393246, 0, 8, 327710, 0, 8, 262174, 0, 8, 196638, 0, 8, 131102, 0, 8, 65566, 0, 8, 30, 0, 8, -65506, 0, 8, -131042, 0, 8, -196578, 0, 8, -262114, 0, 8, -327650, 0, 8, 1114141, 0, 8, 1048605, 0, 8, 983069, 0, 8, 917533, 0, 8, 851997, 0, 8, 786461, 0, 8, 720925, 0, 8, 655389, 0, 8, 589853, 0, 8, 524317, 0, 8, 458781, 0, 8, 393245, 0, 8, 327709, 0, 8, 262173, 0, 8, 196637, 0, 8, 131101, 0, 8, 65565, 0, 8, 29, 0, 8, -65507, 0, 8, -131043, 0, 8, -196579, 0, 8, -262115, 0, 8, -327651, 0, 8, 1114140, 0, 8, 1048604, 0, 8, 983068, 0, 8, 917532, 0, 8, 851996, 0, 8, 786460, 0, 8, 720924, 0, 8, 655388, 0, 8, 589852, 0, 8, 524316, 0, 8, 458780, 0, 8, 393244, 0, 8, 327708, 0, 8, 262172, 0, 8, 196636, 0, 8, 131100, 0, 8, 65564, 0, 8, 28, 0, 8, -65508, 0, 8, -131044, 0, 8, -196580, 0, 8, -262116, 0, 8, -327652, 0, 8, 1114139, 0, 8, 1048603, 0, 8, 983067, 0, 8, 917531, 0, 8, 851995, 0, 8, 786459, 0, 8, 720923, 0, 8, 655387, 0, 8, 589851, 0, 8, 524315, 0, 8, 458779, 0, 8, 393243, 0, 8, 327707, 0, 8, 262171, 0, 8, 196635, 0, 8, 131099, 0, 8, 65563, 0, 8, 27, 0, 8, -65509, 0, 8, -131045, 0, 8, -196581, 0, 8, -262117, 0, 8, -327653, 0, 8, 1114138, 0, 8, 1048602, 0, 8, 983066, 0, 8, 917530, 0, 8, 851994, 0, 8, 786458, 0, 8, 720922, 0, 8, 655386, 0, 8, 589850, 0, 8, 524314, 0, 8, 458778, 0, 8, 393242, 0, 8, 327706, 0, 8, 262170, 0, 8, 196634, 0, 8, 131098, 0, 8, 65562, 0, 8, 26, 0, 8, -65510, 0, 8, -131046, 0, 8, -196582, 0, 8, -262118, 0, 8, -327654, 0, 8, 1114137, 0, 8, 1048601, 0, 8, 983065, 0, 8, 917529, 0, 8, 851993, 0, 8, 786457, 0, 8, 720921, 0, 8, 655385, 0, 8, 589849, 0, 8, 524313, 0, 8, 458777, 0, 8, 393241, 0, 8, 327705, 0, 8, 262169, 0, 8, 196633, 0, 8, 131097, 0, 8, 65561, 0, 8, 25, 0, 8, -65511, 0, 8, -131047, 0, 8, -196583, 0, 8, -262119, 0, 8, -327655, 0, 8, 1114136, 0, 8, 1048600, 0, 8, 983064, 0, 8, 917528, 0, 8, 851992, 0, 8, 786456, 0, 8, 720920, 0, 8, 655384, 0, 8, 589848, 0, 8, 524312, 0, 8, 458776, 0, 8, 393240, 0, 8, 327704, 0, 8, 262168, 0, 8, 196632, 0, 8, 131096, 0, 8, 65560, 0, 8, 24, 0, 8, -65512, 0, 8, -131048, 0, 8, -196584, 0, 8, -262120, 0, 8, -327656, 0, 8, 1114135, 0, 8, 1048599, 0, 8, 983063, 0, 8, 917527, 0, 8, 851991, 0, 8, 786455, 0, 8, 720919, 0, 8, 655383, 0, 8, 589847, 0, 8, 524311, 0, 8, 458775, 0, 8, 393239, 0, 8, 327703, 0, 8, 262167, 0, 8, 196631, 0, 8, 131095, 0, 8, 65559, 0, 8, 23, 0, 8, -65513, 0, 8, -131049, 0, 8, -196585, 0, 8, -262121, 0, 8, -327657, 0, 8, 1114134, 0, 8, 1048598, 0, 8, 983062, 0, 8, 917526, 0, 8, 851990, 0, 8, 786454, 0, 8, 720918, 0, 8, 655382, 0, 8, 589846, 0, 8, 524310, 0, 8, 458774, 0, 8, 393238, 0, 8, 327702, 0, 8, 262166, 0, 8, 196630, 0, 8, 131094, 0, 8, 65558, 0, 8, 22, 0, 8, -65514, 0, 8, -131050, 0, 8, -196586, 0, 8, -262122, 0, 8, -327658, 0, 8, 1114133, 0, 8, 1048597, 0, 8, 983061, 0, 8, 917525, 0, 8, 851989, 0, 8, 786453, 0, 8, 720917, 0, 8, 655381, 0, 8, 589845, 0, 8, 524309, 0, 8, 458773, 0, 8, 393237, 0, 8, 327701, 0, 8, 262165, 0, 8, 196629, 0, 8, 131093, 0, 8, 65557, 0, 8, 21, 0, 8, -65515, 0, 8, -131051, 0, 8, -196587, 0, 8, -262123, 0, 8, -327659, 0, 8, 1114132, 0, 8, 1048596, 0, 8, 983060, 0, 8, 917524, 0, 8, 851988, 0, 8, 786452, 0, 8, 720916, 0, 8, 655380, 0, 8, 589844, 0, 8, 524308, 0, 8, 196628, 0, 8, 131092, 0, 8, 65556, 0, 8, 20, 0, 8, -65516, 0, 8, -131052, 0, 8, -196588, 0, 8, -262124, 0, 8, -327660, 0, 8, 1114131, 0, 8, 1048595, 0, 8, 983059, 0, 8, 917523, 0, 8, 851987, 0, 8, 786451, 0, 8, 720915, 0, 8, 655379, 0, 8, 589843, 0, 8, 524307, 0, 8, 196627, 0, 8, 131091, 0, 8, 65555, 0, 8, 19, 0, 8, -65517, 0, 8, -131053, 0, 8, -196589, 0, 8, -262125, 0, 8, -327661, 0, 8, 1114130, 0, 8, 1048594, 0, 8, 983058, 0, 8, 917522, 0, 8, 851986, 0, 8, 786450, 0, 8, 720914, 0, 8, 655378, 0, 8, 589842, 0, 8, 524306, 0, 8, 196626, 0, 8, 131090, 0, 8, 65554, 0, 8, 18, 0, 8, -65518, 0, 8, -131054, 0, 8, -196590, 0, 8, -262126, 0, 8, -327662, 0, 8, 1114129, 0, 8, 1048593, 0, 8, 983057, 0, 8, 917521, 0, 8, 851985, 0, 8, 786449, 0, 8, 720913, 0, 8, 655377, 0, 8, 589841, 0, 8, 524305, 0, 8, 196625, 0, 8, 131089, 0, 8, 65553, 0, 8, 17, 0, 8, -65519, 0, 8, -131055, 0, 8, -196591, 0, 8, -262127, 0, 8, -327663, 0, 8, 1114128, 0, 8, 1048592, 0, 8, 983056, 0, 8, 917520, 0, 8, 851984, 0, 8, 786448, 0, 8, -65520, 0, 8, -131056, 0, 8, -196592, 0, 8, -262128, 0, 8, -327664, 0, 8, 1114127, 0, 8, 1048591, 0, 8, 983055, 0, 8, 917519, 0, 8, 851983, 0, 8, 786447, 0, 8, -65521, 0, 8, -131057, 0, 8, -196593, 0, 8, -262129, 0, 8, -327665, 0, 8, 1114126, 0, 8, 1048590, 0, 8, 983054, 0, 8, 917518, 0, 8, 851982, 0, 8, 786446, 0, 8, -65522, 0, 8, -131058, 0, 8, -196594, 0, 8, -262130, 0, 8, -327666, 0, 8, 1114125, 0, 8, 1048589, 0, 8, 983053, 0, 8, 917517, 0, 8, 851981, 0, 8, 786445, 0, 8, -65523, 0, 8, -131059, 0, 8, -196595, 0, 8, -262131, 0, 8, -327667, 0, 8, 1114124, 0, 8, 1048588, 0, 8, 983052, 0, 8, 917516, 0, 8, 851980, 0, 8, 786444, 0, 8, 720908, 0, 8, 655372, 0, 8, 589836, 0, 8, 524300, 0, 8, 196620, 0, 8, 131084, 0, 8, 65548, 0, 8, 12, 0, 8, -65524, 0, 8, -131060, 0, 8, -196596, 0, 8, -262132, 0, 8, -327668, 0, 8, 1114123, 0, 8, 1048587, 0, 8, 983051, 0, 8, 917515, 0, 8, 851979, 0, 8, 786443, 0, 8, 720907, 0, 8, 655371, 0, 8, 589835, 0, 8, 524299, 0, 8, 196619, 0, 8, 131083, 0, 8, 65547, 0, 8, 11, 0, 8, -65525, 0, 8, -131061, 0, 8, -196597, 0, 8, -262133, 0, 8, -327669, 0, 8, 1114122, 0, 8, 1048586, 0, 8, 983050, 0, 8, 917514, 0, 8, 851978, 0, 8, 786442, 0, 8, 720906, 0, 8, 655370, 0, 8, 589834, 0, 8, 524298, 0, 8, 196618, 0, 8, 131082, 0, 8, 65546, 0, 8, 10, 0, 8, -65526, 0, 8, -131062, 0, 8, -196598, 0, 8, -262134, 0, 8, -327670, 0, 8, 1114121, 0, 8, 1048585, 0, 8, 983049, 0, 8, 917513, 0, 8, 851977, 0, 8, 786441, 0, 8, 720905, 0, 8, 655369, 0, 8, 589833, 0, 8, 524297, 0, 8, 196617, 0, 8, 131081, 0, 8, 65545, 0, 8, 9, 0, 8, -65527, 0, 8, -131063, 0, 8, -196599, 0, 8, -262135, 0, 8, -327671, 0, 8, 1114120, 0, 8, 1048584, 0, 8, 983048, 0, 8, 917512, 0, 8, 851976, 0, 8, 786440, 0, 8, 720904, 0, 8, 655368, 0, 8, 589832, 0, 8, 524296, 0, 8, 458760, 0, 8, 393224, 0, 8, 327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 131080, 0, 8, 65544, 0, 8, 8, 0, 8, -65528, 0, 8, -131064, 0, 8, -196600, 0, 8, -262136, 0, 8, -327672, 0, 8, 1114119, 0, 8, 1048583, 0, 8, 983047, 0, 8, 917511, 0, 8, 851975, 0, 8, 786439, 0, 8, 720903, 0, 8, 655367, 0, 8, 589831, 0, 8, 524295, 0, 8, 458759, 0, 8, 393223, 0, 8, 327687, 0, 8, 262151, 0, 8, 196615, 0, 8, 131079, 0, 8, 65543, 0, 8, 7, 0, 8, -65529, 0, 8, -131065, 0, 8, -196601, 0, 8, -262137, 0, 8, -327673, 0, 8, 1114118, 0, 8, 1048582, 0, 8, 983046, 0, 8, 917510, 0, 8, 851974, 0, 8, 786438, 0, 8, 720902, 0, 8, 655366, 0, 8, 589830, 0, 8, 524294, 0, 8, 458758, 0, 8, 393222, 0, 8, 327686, 0, 8, 262150, 0, 8, 196614, 0, 8, 131078, 0, 8, 65542, 0, 8, 6, 0, 8, -65530, 0, 8, -131066, 0, 8, -196602, 0, 8, -262138, 0, 8, -327674, 0, 8, 1114117, 0, 8, 1048581, 0, 8, 983045, 0, 8, 917509, 0, 8, 851973, 0, 8, 786437, 0, 8, 720901, 0, 8, 655365, 0, 8, 589829, 0, 8, 524293, 0, 8, 458757, 0, 8, 393221, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 131077, 0, 8, 65541, 0, 8, 5, 0, 8, -65531, 0, 8, -131067, 0, 8, -196603, 0, 8, -262139, 0, 8, -327675, 0, 8, 1114116, 0, 8, 1048580, 0, 8, 983044, 0, 8, 917508, 0, 8, 851972, 0, 8, 786436, 0, 8, 720900, 0, 8, 655364, 0, 8, 589828, 0, 8, 524292, 0, 8, 458756, 0, 8, 393220, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, 65540, 0, 8, 4, 0, 8, -65532, 0, 8, -131068, 0, 8, -196604, 0, 8, -262140, 0, 8, -327676, 0, 8, 1114115, 0, 8, 1048579, 0, 8, 983043, 0, 8, 917507, 0, 8, 851971, 0, 8, 786435, 0, 8, 720899, 0, 8, 655363, 0, 8, 589827, 0, 8, 524291, 0, 8, 458755, 0, 8, 393219, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 65539, 0, 8, 3, 0, 8, -65533, 0, 8, -131069, 0, 8, -196605, 0, 8, -262141, 0, 8, -327677, 0, 8, 1114114, 0, 8, 1048578, 0, 8, 983042, 0, 8, 917506, 0, 8, 851970, 0, 8, 786434, 0, 8, 720898, 0, 8, 655362, 0, 8, 589826, 0, 8, 524290, 0, 8, 458754, 0, 8, 393218, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 65538, 0, 8, 2, 0, 8, -65534, 0, 8, -131070, 0, 8, -196606, 0, 8, -262142, 0, 8, -327678, 0, 8, 1114113, 0, 8, 1048577, 0, 8, 983041, 0, 8, 917505, 0, 8, 851969, 0, 8, 786433, 0, 8, 720897, 0, 8, 655361, 0, 8, 589825, 0, 8, 524289, 0, 8, 458753, 0, 8, 393217, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, -65535, 0, 8, -131071, 0, 8, -196607, 0, 8, -262143, 0, 8, -327679, 0, 8, 1114112, 0, 8, 1048576, 0, 8, 983040, 0, 8, 917504, 0, 8, 851968, 0, 8, 786432, 0, 8, 720896, 0, 8, 655360, 0, 8, 589824, 0, 8, 524288, 0, 8, 458752, 0, 8, 393216, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, -65536, 0, 8, -131072, 0, 8, -196608, 0, 8, -262144, 0, 8, -327680, 0, 8, 1179647, 0, 8, 1114111, 0, 8, 1048575, 0, 8, 983039, 0, 8, 917503, 0, 8, 851967, 0, 8, 786431, 0, 8, 720895, 0, 8, 655359, 0, 8, 589823, 0, 8, 524287, 0, 8, 458751, 0, 8, 393215, 0, 8, 327679, 0, 8, 262143, 0, 8, 196607, 0, 8, 131071, 0, 8, 65535, 0, 8, -1, 0, 8, -65537, 0, 8, -131073, 0, 8, -196609, 0, 8, -262145, 0, 8, 1179646, 0, 8, 1114110, 0, 8, 1048574, 0, 8, 983038, 0, 8, 917502, 0, 8, 851966, 0, 8, 786430, 0, 8, 720894, 0, 8, 655358, 0, 8, 589822, 0, 8, 524286, 0, 8, 458750, 0, 8, 393214, 0, 8, 327678, 0, 8, 262142, 0, 8, 196606, 0, 8, 131070, 0, 8, 65534, 0, 8, -2, 0, 8, -65538, 0, 8, -131074, 0, 8, -196610, 0, 8, -262146, 0, 8, 1179645, 0, 8, 1114109, 0, 8, 1048573, 0, 8, 983037, 0, 8, 917501, 0, 8, 851965, 0, 8, 786429, 0, 8, 720893, 0, 8, 655357, 0, 8, 589821, 0, 8, 524285, 0, 8, 458749, 0, 8, 393213, 0, 8, 327677, 0, 8, 262141, 0, 8, 196605, 0, 8, 131069, 0, 8, 65533, 0, 8, -3, 0, 8, -65539, 0, 8, -131075, 0, 8, -196611, 0, 8, -262147, 0, 8, 1179644, 0, 8, 1114108, 0, 8, 1048572, 0, 8, 983036, 0, 8, 917500, 0, 8, 851964, 0, 8, 786428, 0, 8, 720892, 0, 8, 655356, 0, 8, 589820, 0, 8, 524284, 0, 8, 458748, 0, 8, 393212, 0, 8, 327676, 0, 8, 262140, 0, 8, 196604, 0, 8, 131068, 0, 8, 65532, 0, 8, -4, 0, 8, -65540, 0, 8, -131076, 0, 8, -196612, 0, 8, -262148, 0, 8, -196613, 196608, 3, -262149, 196608, 3, -327685, 196608, 4, -327684, 131072, 7, -327683, 131072, 7, -131077, 196608, 3, -65541, 196608, 3, -5, 196608, 3, 65531, 196608, 3, 131067, 196608, 3, 196603, 196608, 3, 262139, 196608, 3, 327675, 196608, 3, 393211, 196608, 3, 458747, 196608, 3, 524283, 196608, 3, 589819, 196608, 3, 655355, 196608, 3, 720891, 196608, 3, 786427, 196608, 3, 851963, 196608, 3, 917499, 196608, 3, 983035, 196608, 3, 1048571, 196608, 3, 1114107, 196608, 3, 1179643, 196608, 3, 1245181, 131072, 2, 1245180, 131072, 2, 1245179, 720896, 2, -327682, 131072, 7, 1245182, 131072, 2, -327681, 131072, 7, 1245183, 131072, 2, -393216, 131072, 7, 1179648, 131072, 2, -393215, 131072, 7, 1179649, 131072, 2, -393214, 131072, 7, 1179650, 131072, 2, -393213, 131072, 7, 1179651, 131072, 2, -393212, 131072, 7, 1179652, 131072, 2, -393211, 131072, 7, 1179653, 131072, 2, -393210, 131072, 7, 1179654, 131072, 2, -393209, 131072, 7, 1179655, 131072, 2, -393208, 131072, 7, 1179656, 131072, 2, -393207, 131072, 7, 1179657, 131072, 2, -393206, 131072, 7, 1179658, 131072, 2, -393205, 131072, 7, 1179659, 131072, 2, -393204, 131072, 7, 1179660, 131072, 2, -393203, 131072, 7, 1179661, 131072, 2, -393202, 131072, 7, 1179662, 131072, 2, -393201, 131072, 7, 1179663, 131072, 2, -393200, 131072, 7, 1179664, 131072, 2, -393199, 131072, 7, 1179665, 131072, 2, -393198, 131072, 7, 1179666, 131072, 2, -393197, 131072, 7, 1179667, 131072, 2, -393196, 131072, 7, 1179668, 131072, 2, -393195, 131072, 7, 1179669, 131072, 2, -393194, 131072, 7, 1179670, 131072, 2, -393193, 131072, 7, 1179671, 131072, 2, -393192, 131072, 7, 1179672, 131072, 2, -393191, 131072, 7, 1179673, 131072, 2, -393190, 131072, 7, 1179674, 131072, 2, -393189, 131072, 7, 1179675, 131072, 2, -393188, 131072, 7, 1179676, 131072, 2, -393187, 131072, 7, 1179677, 131072, 2, -393186, 131072, 7, 1179678, 131072, 2, -393185, 131072, 7, 1179679, 131072, 2, -393184, 131072, 7, 1179680, 131072, 2, -327647, 65536, 3, -262111, 65536, 3, -393183, 65536, 4, -196575, 65536, 3, -131039, 65536, 3, -65503, 65536, 3, 33, 65536, 3, 65569, 65536, 3, 131105, 65536, 3, 196641, 65536, 3, 262177, 65536, 3, 327713, 65536, 3, 393249, 65536, 3, 458785, 65536, 3, 524321, 65536, 3, 589857, 65536, 3, 655393, 65536, 3, 720929, 65536, 3, 786465, 65536, 3, 852001, 65536, 3, 917537, 65536, 3, 983073, 65536, 3, 1048609, 65536, 3, 1114145, 65536, 3, 1179681, 851968, 2, 196621, 65536, 3, 524301, 65536, 3, 262155, 131072, 2, 458763, 131072, 7, 262162, 131072, 2, 65552, 196608, 3, 16, 196608, 2, 131088, 196608, 3, 196624, 196608, 3, 262161, 131072, 2, 262160, 720896, 2, 262163, 131072, 2, 262164, 196608, 2, 13, 65536, 2, 14, 131072, 2, 15, 131072, 2, 262153, 65536, 2, 262154, 131072, 2, 262156, 131072, 2, 65549, 65536, 3, 131085, 65536, 3, 262157, 851968, 2, 327689, 65536, 3, 393225, 65536, 3, 458761, 65536, 7, 458762, 131072, 7, 458764, 131072, 7, 589837, 65536, 3, 458765, 65536, 4, 655373, 65536, 3, 720909, 65536, 7, 720910, 131072, 7, 720911, 131072, 7, 720912, 196608, 7, 589840, 196608, 3, 524304, 196608, 3, 458768, 196608, 4, 458769, 131072, 7, 458770, 131072, 7, 655376, 196608, 3, 458771, 131072, 7, 458772, 196608, 7, 327700, 196608, 3, 393236, 196608, 3) -script = ExtResource("dungeonRoomTemplate") - -[node name="EnemyMark" type="Node2D" parent="."] -position = Vector2(152, 15) -script = ExtResource("3_enrje") -Weapon1Id = "0001(ResidueAmmo:30,CurrAmmon:10)" -Weapon2Id = "null; -0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001; -null" -Layer = 1 -Altitude = 0 - -[node name="EnemyMark2" type="Node2D" parent="."] -position = Vector2(148, 175) -script = ExtResource("3_enrje") -Weapon1Id = "0001(ResidueAmmo:30,CurrAmmon:10)" -Weapon2Id = "null; -0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001; -null" -Layer = 1 -Altitude = 0 - -[node name="EnemyMark3" type="Node2D" parent="."] -position = Vector2(317, 171) -script = ExtResource("3_enrje") -Weapon1Id = "0001(ResidueAmmo:30,CurrAmmon:10)" -Weapon2Id = "null; -0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001; -null" -Layer = 1 -Altitude = 0 - -[node name="EnemyMark4" type="Node2D" parent="."] -position = Vector2(321, 22) -script = ExtResource("3_enrje") -Weapon1Id = "0001(ResidueAmmo:30,CurrAmmon:10)" -Weapon2Id = "null; -0003(ResidueAmmo:12,CurrAmmon:12)" -Type = 4 -ItemExpression = "0001; -null" -Layer = 1 -Altitude = 0 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn deleted file mode 100644 index 381e5d57bcbee4b6d78258793a1c6f2796917964..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn +++ /dev/null @@ -1,122 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://dmeb88jotqro6"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_osa3n"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="2_erhdx"] -[ext_resource type="Script" path="res://src/framework/map/mark/ActivityMark.cs" id="3_m4jrh"] - -[node name="Room1" type="TileMap"] -tile_set = ExtResource("1_osa3n") -format = 2 -layer_0/tile_data = PackedInt32Array(327689, 0, 8, 262153, 0, 8, 196617, 0, 8, 131081, 0, 8, 65545, 0, 8, 9, 0, 8, 327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 131080, 0, 8, 65544, 0, 8, 8, 0, 8, 327687, 0, 8, 262151, 0, 8, 196615, 0, 8, 131079, 0, 8, 65543, 0, 8, 7, 0, 8, 327686, 0, 8, 262150, 0, 8, 196614, 0, 8, 131078, 0, 8, 65542, 0, 8, 6, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 131077, 0, 8, 65541, 0, 8, 5, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, 65540, 0, 8, 4, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 65539, 0, 8, 3, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 65538, 0, 8, 2, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, 131071, 196608, 3, 65535, 196608, 3, -1, 196608, 4, -65536, 131072, 7, -65535, 131072, 7, 196607, 196608, 3, 262143, 196608, 3, 327679, 196608, 3, 393215, 196608, 3, 393217, 131072, 2, 393216, 131072, 2, 458751, 720896, 2, -65534, 131072, 7, 393218, 131072, 2, -65533, 131072, 7, 393219, 131072, 2, -65532, 131072, 7, 393220, 131072, 2, -65531, 131072, 7, 393221, 131072, 2, -65530, 131072, 7, 393222, 131072, 2, -65529, 131072, 7, 393223, 131072, 2, -65528, 131072, 7, 393224, 131072, 2, -65527, 131072, 7, 393225, 131072, 2, 10, 65536, 3, 65546, 65536, 3, -65526, 65536, 4, 131082, 65536, 3, 196618, 65536, 3, 262154, 65536, 3, 327690, 65536, 3, 393226, 851968, 2) -script = ExtResource("2_erhdx") - -[node name="Player" type="Node2D" parent="."] -position = Vector2(80, 47) -script = ExtResource("3_m4jrh") -Type = 1 -Altitude = 0 - -[node name="ActivityMark7" type="Node2D" parent="."] -position = Vector2(79, 76) -script = ExtResource("3_m4jrh") -Type = 5 -ItemExpression = "0003" -WaveNumber = 2 - -[node name="ActivityMark8" type="Node2D" parent="."] -position = Vector2(126, 41) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0001" -WaveNumber = 2 - -[node name="ActivityMark9" type="Node2D" parent="."] -position = Vector2(125, 68) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0002" -WaveNumber = 2 - -[node name="ActivityMark10" type="Node2D" parent="."] -position = Vector2(124, 18) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0003" -WaveNumber = 2 - -[node name="ActivityMark11" type="Node2D" parent="."] -position = Vector2(34, 19) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0004" -WaveNumber = 2 - -[node name="ActivityMark12" type="Node2D" parent="."] -position = Vector2(64, 21) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0005" -WaveNumber = 2 - -[node name="ActivityMark13" type="Node2D" parent="."] -position = Vector2(93, 22) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0006" -WaveNumber = 2 - -[node name="ActivityMark14" type="Node2D" parent="."] -position = Vector2(32, 46) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0007" -WaveNumber = 2 - -[node name="ActivityMark15" type="Node2D" parent="."] -position = Vector2(56, 55) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0008" -WaveNumber = 2 - -[node name="ActivityMark16" type="Node2D" parent="."] -position = Vector2(27, 76) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0009" -WaveNumber = 2 - -[node name="ActivityMark17" type="Node2D" parent="."] -position = Vector2(49, 79) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "0010" -WaveNumber = 2 - -[node name="ActivityMark18" type="Node2D" parent="."] -position = Vector2(103, 65) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "5000" -WaveNumber = 3 - -[node name="ActivityMark19" type="Node2D" parent="."] -position = Vector2(106, 31) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "5000" -WaveNumber = 3 - -[node name="ActivityMark20" type="Node2D" parent="."] -position = Vector2(139, 26) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "5001" -WaveNumber = 3 - -[node name="ActivityMark21" type="Node2D" parent="."] -position = Vector2(140, 50) -script = ExtResource("3_m4jrh") -Type = 9 -ItemExpression = "5001" -WaveNumber = 3 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/outlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/outlet/Room1.tscn deleted file mode 100644 index ee242746a9c43138ed20e0d3885b62413c8888db..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/outlet/Room1.tscn +++ /dev/null @@ -1,10 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://d0klitsroayqh"] - -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_fhl21"] -[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] - -[node name="Room1" type="TileMap"] -tile_set = ExtResource("1_fhl21") -format = 2 -layer_0/tile_data = PackedInt32Array(327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 131080, 0, 8, 65544, 0, 8, 8, 0, 8, -65528, 0, 8, -131064, 0, 8, -196600, 0, 8, 327687, 0, 8, 262151, 0, 8, 196615, 0, 8, 131079, 0, 8, 65543, 0, 8, 7, 0, 8, -65529, 0, 8, -131065, 0, 8, -196601, 0, 8, 327686, 0, 8, 262150, 0, 8, -65530, 0, 8, -131066, 0, 8, -196602, 0, 8, 327685, 0, 8, 262149, 0, 8, -65531, 0, 8, -131067, 0, 8, -196603, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, -65532, 0, 8, -131068, 0, 8, -196604, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, -131069, 0, 8, -196605, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, -131070, 0, 8, -196606, 0, 8, 327681, 0, 8, 262145, 0, 8, -131071, 0, 8, -196607, 0, 8, 327680, 0, 8, 262144, 0, 8, -131072, 0, 8, -196608, 0, 8, 393215, 0, 8, 327679, 0, 8, 131071, 0, 8, 65535, 0, 8, -1, 0, 8, -65537, 0, 8, -131073, 0, 8, 393214, 0, 8, 327678, 0, 8, 262142, 0, 8, 196606, 0, 8, 131070, 0, 8, 65534, 0, 8, -2, 0, 8, -65538, 0, 8, -131074, 0, 8, 393213, 0, 8, 327677, 0, 8, 262141, 0, 8, 196605, 0, 8, 131069, 0, 8, 65533, 0, 8, -3, 0, 8, -65539, 0, 8, -131075, 0, 8, -65540, 196608, 3, -131076, 196608, 3, -196612, 196608, 4, -196611, 131072, 7, -196610, 131072, 7, -4, 196608, 3, 65532, 196608, 3, 131068, 196608, 3, 196604, 196608, 3, 262140, 196608, 3, 327676, 196608, 3, 393212, 196608, 3, 458750, 0, 8, 458749, 0, 8, 458748, 196608, 3, -196609, 131072, 7, 458751, 0, 8, -262144, 131072, 7, 393216, 0, 8, -262143, 131072, 7, 393217, 0, 8, -262142, 131072, 7, 393218, 0, 8, -262141, 131072, 7, 393219, 0, 8, -262140, 131072, 7, 393220, 0, 8, -262139, 131072, 7, 393221, 0, 8, -262138, 131072, 7, 393222, 0, 8, -262137, 131072, 7, 393223, 0, 8, -262136, 131072, 7, 393224, 0, 8, -196599, 0, 8, -131063, 0, 8, -262135, 131072, 7, -65527, 0, 8, 9, 0, 8, 65545, 0, 8, 131081, 0, 8, 196617, 0, 8, 262153, 0, 8, 327689, 0, 8, 393225, 0, 8, -65533, 0, 8, -65534, 0, 8, -65535, 0, 8, -65536, 0, 8, 1, 131072, 2, 4, 131072, 2, 262143, 0, 8, 196607, 0, 8, 65536, 65536, 3, 131072, 65536, 3, 0, 65536, 2, 196608, 65536, 7, 196609, 196608, 7, 196613, 65536, 7, 196614, 196608, 7, 131073, 196608, 3, 65537, 196608, 4, 65538, 131072, 7, 65539, 131072, 7, 65540, 131072, 7, 131077, 65536, 3, 65541, 65536, 4, 2, 131072, 2, 3, 131072, 2, 5, 131072, 2, 6, 196608, 2, 65542, 196608, 3, 131078, 196608, 3, -196598, 65536, 3, -131062, 65536, 3, -262134, 65536, 4, -65526, 65536, 3, 10, 65536, 3, 65546, 65536, 3, 131082, 65536, 3, 196618, 65536, 3, 262154, 65536, 3, 327690, 65536, 3, 393226, 65536, 3, 524286, 131072, 2, 524285, 131072, 2, 524284, 720896, 2, 524287, 131072, 2, 458752, 131072, 2, 458753, 131072, 2, 458754, 131072, 2, 458755, 131072, 2, 458756, 131072, 2, 458757, 131072, 2, 458758, 131072, 2, 458759, 131072, 2, 458760, 131072, 2, 458761, 131072, 2, 458762, 851968, 2) -script = ExtResource("dungeonRoomTemplate") diff --git a/DungeonShooting_Godot/resource/map/tileset/TileSet1.tres b/DungeonShooting_Godot/resource/map/tileSet/TileSet1.tres similarity index 100% rename from DungeonShooting_Godot/resource/map/tileset/TileSet1.tres rename to DungeonShooting_Godot/resource/map/tileSet/TileSet1.tres diff --git a/DungeonShooting_Godot/resource/map/tileset/TileSet_old.tres b/DungeonShooting_Godot/resource/map/tileSet/TileSet_old.tres similarity index 100% rename from DungeonShooting_Godot/resource/map/tileset/TileSet_old.tres rename to DungeonShooting_Godot/resource/map/tileSet/TileSet_old.tres diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room1.json deleted file mode 100644 index 1b6dd1735033f67473202da703a1d4ac59810653..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room1.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -6 - }, - "Size": { - "X": 24, - "Y": 15 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -72 - }, - { - "X": 280, - "Y": -72 - }, - { - "X": 280, - "Y": 128 - }, - { - "X": -56, - "Y": 128 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": -24, - "Y": -32 - }, - { - "X": 56, - "Y": -32 - }, - { - "X": 56, - "Y": 8 - }, - { - "X": 24, - "Y": 8 - }, - { - "X": 24, - "Y": 24 - }, - { - "X": -24, - "Y": 24 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 200, - "Y": 32 - }, - { - "X": 248, - "Y": 32 - }, - { - "X": 248, - "Y": 88 - }, - { - "X": 168, - "Y": 88 - }, - { - "X": 168, - "Y": 48 - }, - { - "X": 200, - "Y": 48 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room2.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room2.json deleted file mode 100644 index ea48daf29b957cfd4636e3f2f30f7524e53d025c..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room2.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -6 - }, - "Size": { - "X": 31, - "Y": 24 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 144, - "End": 432 - }, - { - "Direction": 1, - "Start": 48, - "End": 176 - }, - { - "Direction": 1, - "Start": 256, - "End": 368 - }, - { - "Direction": 2, - "Start": 16, - "End": 128 - }, - { - "Direction": 2, - "Start": 256, - "End": 480 - }, - { - "Direction": 0, - "Start": 272, - "End": 368 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 72, - "Y": -72 - }, - { - "X": 344, - "Y": -72 - }, - { - "X": 344, - "Y": 32 - }, - { - "X": 248, - "Y": 32 - }, - { - "X": 248, - "Y": 120 - }, - { - "X": 344, - "Y": 120 - }, - { - "X": 344, - "Y": 200 - }, - { - "X": 392, - "Y": 200 - }, - { - "X": 392, - "Y": 272 - }, - { - "X": 184, - "Y": 272 - }, - { - "X": 184, - "Y": 208 - }, - { - "X": 40, - "Y": 208 - }, - { - "X": 40, - "Y": 272 - }, - { - "X": -56, - "Y": 272 - }, - { - "X": -56, - "Y": 184 - }, - { - "X": -8, - "Y": 184 - }, - { - "X": -8, - "Y": 80 - }, - { - "X": -56, - "Y": 80 - }, - { - "X": -56, - "Y": -24 - }, - { - "X": 72, - "Y": -24 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 56, - "Y": 48 - }, - { - "X": 168, - "Y": 48 - }, - { - "X": 168, - "Y": 136 - }, - { - "X": 56, - "Y": 136 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room2", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room3.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room3.json deleted file mode 100644 index c8f009114617a236619e8520b9388f8516fc6edb..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room3.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "Position": { - "X": -1, - "Y": -1 - }, - "Size": { - "X": 26, - "Y": 20 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 16, - "End": 128 - }, - { - "Direction": 3, - "Start": 208, - "End": 320 - }, - { - "Direction": 1, - "Start": 16, - "End": 224 - }, - { - "Direction": 2, - "Start": 96, - "End": 192 - }, - { - "Direction": 2, - "Start": 288, - "End": 400 - }, - { - "Direction": 0, - "Start": 96, - "End": 304 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 8, - "Y": 8 - }, - { - "X": 104, - "Y": 8 - }, - { - "X": 104, - "Y": 88 - }, - { - "X": 200, - "Y": 88 - }, - { - "X": 200, - "Y": 8 - }, - { - "X": 296, - "Y": 8 - }, - { - "X": 296, - "Y": 88 - }, - { - "X": 376, - "Y": 88 - }, - { - "X": 376, - "Y": 288 - }, - { - "X": 280, - "Y": 288 - }, - { - "X": 280, - "Y": 208 - }, - { - "X": 168, - "Y": 208 - }, - { - "X": 168, - "Y": 288 - }, - { - "X": 88, - "Y": 288 - }, - { - "X": 88, - "Y": 208 - }, - { - "X": 8, - "Y": 208 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room3", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room4.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room4.json deleted file mode 100644 index 464869fc50cd61aae8b44351a2187e7d8c790393..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room4.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -5 - }, - "Size": { - "X": 32, - "Y": 29 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 16, - "End": 176 - }, - { - "Direction": 1, - "Start": 16, - "End": 176 - }, - { - "Direction": 1, - "Start": 304, - "End": 448 - }, - { - "Direction": 2, - "Start": 16, - "End": 144 - }, - { - "Direction": 2, - "Start": 352, - "End": 496 - }, - { - "Direction": 0, - "Start": 304, - "End": 448 - }, - { - "Direction": 0, - "Start": 16, - "End": 176 - }, - { - "Direction": 3, - "Start": 336, - "End": 496 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -56 - }, - { - "X": 88, - "Y": -56 - }, - { - "X": 88, - "Y": 8 - }, - { - "X": 264, - "Y": 8 - }, - { - "X": 264, - "Y": -56 - }, - { - "X": 408, - "Y": -56 - }, - { - "X": 408, - "Y": 96 - }, - { - "X": 344, - "Y": 96 - }, - { - "X": 344, - "Y": 232 - }, - { - "X": 408, - "Y": 232 - }, - { - "X": 408, - "Y": 368 - }, - { - "X": 264, - "Y": 368 - }, - { - "X": 264, - "Y": 304 - }, - { - "X": 88, - "Y": 304 - }, - { - "X": 88, - "Y": 368 - }, - { - "X": -56, - "Y": 368 - }, - { - "X": -56, - "Y": 232 - }, - { - "X": 8, - "Y": 232 - }, - { - "X": 8, - "Y": 96 - }, - { - "X": -56, - "Y": 96 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 88, - "Y": 32 - }, - { - "X": 136, - "Y": 32 - }, - { - "X": 136, - "Y": 136 - }, - { - "X": 24, - "Y": 136 - }, - { - "X": 24, - "Y": 96 - }, - { - "X": 88, - "Y": 96 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 216, - "Y": 32 - }, - { - "X": 264, - "Y": 32 - }, - { - "X": 264, - "Y": 96 - }, - { - "X": 328, - "Y": 96 - }, - { - "X": 328, - "Y": 136 - }, - { - "X": 216, - "Y": 136 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 24, - "Y": 192 - }, - { - "X": 136, - "Y": 192 - }, - { - "X": 136, - "Y": 280 - }, - { - "X": 88, - "Y": 280 - }, - { - "X": 88, - "Y": 232 - }, - { - "X": 24, - "Y": 232 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 216, - "Y": 192 - }, - { - "X": 328, - "Y": 192 - }, - { - "X": 328, - "Y": 232 - }, - { - "X": 264, - "Y": 232 - }, - { - "X": 264, - "Y": 280 - }, - { - "X": 216, - "Y": 280 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room4", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room5.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room5.json deleted file mode 100644 index 5e6371cf6be217d3ab507eae93b847e03b3ca7c5..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room5.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "Position": { - "X": -3, - "Y": -6 - }, - "Size": { - "X": 21, - "Y": 18 - }, - "DoorAreaInfos": [ - { - "Direction": 0, - "Start": 16, - "End": 192 - }, - { - "Direction": 3, - "Start": 80, - "End": 320 - }, - { - "Direction": 1, - "Start": 64, - "End": 240 - }, - { - "Direction": 2, - "Start": 96, - "End": 240 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 40, - "Y": -72 - }, - { - "X": 264, - "Y": -72 - }, - { - "X": 264, - "Y": 96 - }, - { - "X": 232, - "Y": 96 - }, - { - "X": 232, - "Y": 144 - }, - { - "X": 184, - "Y": 144 - }, - { - "X": 184, - "Y": 176 - }, - { - "X": 56, - "Y": 176 - }, - { - "X": 56, - "Y": 144 - }, - { - "X": -24, - "Y": 144 - }, - { - "X": -24, - "Y": -24 - }, - { - "X": 40, - "Y": -24 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 72, - "Y": -48 - }, - { - "X": 200, - "Y": -48 - }, - { - "X": 200, - "Y": 8 - }, - { - "X": 72, - "Y": 8 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": -8, - "Y": 32 - }, - { - "X": 72, - "Y": 32 - }, - { - "X": 72, - "Y": 88 - }, - { - "X": -8, - "Y": 88 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 136, - "Y": 48 - }, - { - "X": 216, - "Y": 48 - }, - { - "X": 216, - "Y": 104 - }, - { - "X": 136, - "Y": 104 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room5", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room6.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room6.json deleted file mode 100644 index 7d833884518a73d70476911d283286cebcc09b72..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room6.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "Position": { - "X": -3, - "Y": -6 - }, - "Size": { - "X": 24, - "Y": 14 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 16, - "End": 368 - }, - { - "Direction": 0, - "Start": 16, - "End": 128 - }, - { - "Direction": 2, - "Start": 32, - "End": 272 - }, - { - "Direction": 1, - "Start": 16, - "End": 128 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -24, - "Y": -72 - }, - { - "X": 312, - "Y": -72 - }, - { - "X": 312, - "Y": 32 - }, - { - "X": 280, - "Y": 32 - }, - { - "X": 280, - "Y": 80 - }, - { - "X": 248, - "Y": 80 - }, - { - "X": 248, - "Y": 112 - }, - { - "X": -8, - "Y": 112 - }, - { - "X": -8, - "Y": 32 - }, - { - "X": -24, - "Y": 32 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 56, - "Y": -48 - }, - { - "X": 136, - "Y": -48 - }, - { - "X": 136, - "Y": -32 - }, - { - "X": 184, - "Y": -32 - }, - { - "X": 184, - "Y": 8 - }, - { - "X": 88, - "Y": 8 - }, - { - "X": 88, - "Y": 40 - }, - { - "X": 24, - "Y": 40 - }, - { - "X": 24, - "Y": -32 - }, - { - "X": 56, - "Y": -32 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 216, - "Y": -48 - }, - { - "X": 280, - "Y": -48 - }, - { - "X": 280, - "Y": 8 - }, - { - "X": 216, - "Y": 8 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 104, - "Y": 32 - }, - { - "X": 216, - "Y": 32 - }, - { - "X": 216, - "Y": 72 - }, - { - "X": 184, - "Y": 72 - }, - { - "X": 184, - "Y": 88 - }, - { - "X": 136, - "Y": 88 - }, - { - "X": 136, - "Y": 72 - }, - { - "X": 104, - "Y": 72 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room6", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room8.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room8.json deleted file mode 100644 index 6cd97e796dac9d682223f54422afec992a474b8a..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room8.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -3 - }, - "Size": { - "X": 25, - "Y": 16 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -24 - }, - { - "X": 296, - "Y": -24 - }, - { - "X": 296, - "Y": 192 - }, - { - "X": -56, - "Y": 192 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room8", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/boss/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/boss/Room1.json deleted file mode 100644 index d2d0c0eb271809dc91b81501c7f7b186fea71113..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/boss/Room1.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -6 - }, - "Size": { - "X": 39, - "Y": 25 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -72 - }, - { - "X": 520, - "Y": -72 - }, - { - "X": 520, - "Y": 288 - }, - { - "X": -56, - "Y": 288 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 200, - "Y": 0 - }, - { - "X": 280, - "Y": 0 - }, - { - "X": 280, - "Y": 64 - }, - { - "X": 344, - "Y": 64 - }, - { - "X": 344, - "Y": 136 - }, - { - "X": 280, - "Y": 136 - }, - { - "X": 280, - "Y": 200 - }, - { - "X": 200, - "Y": 200 - }, - { - "X": 200, - "Y": 136 - }, - { - "X": 136, - "Y": 136 - }, - { - "X": 136, - "Y": 64 - }, - { - "X": 200, - "Y": 64 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 3, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json deleted file mode 100644 index 6c3fba1a11ec78ea4af20c572d9fafe7295edb4f..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "Position": { - "X": -1, - "Y": -1 - }, - "Size": { - "X": 12, - "Y": 8 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 8, - "Y": 8 - }, - { - "X": 152, - "Y": 8 - }, - { - "X": 152, - "Y": 96 - }, - { - "X": 8, - "Y": 96 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 1, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/outlet/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/outlet/Room1.json deleted file mode 100644 index d69b1f8b5a9fc711fa5057a24c2e2e21f25169ae..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/outlet/Room1.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "Position": { - "X": -4, - "Y": -4 - }, - "Size": { - "X": 15, - "Y": 12 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -40, - "Y": -40 - }, - { - "X": 152, - "Y": -40 - }, - { - "X": 152, - "Y": 112 - }, - { - "X": -40, - "Y": 112 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": -8, - "Y": 0 - }, - { - "X": 120, - "Y": 0 - }, - { - "X": 120, - "Y": 72 - }, - { - "X": 72, - "Y": 72 - }, - { - "X": 72, - "Y": 40 - }, - { - "X": 40, - "Y": 40 - }, - { - "X": 40, - "Y": 72 - }, - { - "X": -8, - "Y": 72 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 2, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/material/BleB865.tmp b/DungeonShooting_Godot/resource/material/BleB865.tmp new file mode 100644 index 0000000000000000000000000000000000000000..a40db2f0a67d107d88d47c175b488e9acaee22c4 --- /dev/null +++ b/DungeonShooting_Godot/resource/material/BleB865.tmp @@ -0,0 +1,51 @@ +shader_type canvas_item; + +//混合颜色 +uniform vec4 blend : source_color = vec4(1.0, 1.0, 1.0, 1.0); +//混合度 +uniform float schedule : hint_range(0.0, 1.0) = 0.0; +//透明度 +//uniform float alpha : hint_range(0.0, 1.0) = 1.0; +uniform vec4 modulate : source_color = vec4(1.0, 1.0, 1.0, 1.0); + +//------------------ 轮廓相关 -------------- +uniform bool show_outline = true; +//轮廓颜色 +uniform vec4 outline_color : source_color = vec4(0.0, 0.0, 0.0, 1.0); +//是否是彩虹轮廓 +uniform bool outline_rainbow = false; +//彩虹轮廓变化周期 +const float frequency = 0.25; +const float light_offset = 0.5; + +void fragment() { + //显示轮廓 + if (show_outline) { + vec2 size = TEXTURE_PIXEL_SIZE; + float outline; + outline = texture(TEXTURE, UV + vec2(-size.x, 0)).a; + outline += texture(TEXTURE, UV + vec2(0, size.y)).a; + outline += texture(TEXTURE, UV + vec2(size.x, 0)).a; + outline += texture(TEXTURE, UV + vec2(0, -size.y)).a; + outline = min(outline, 1.0); + + vec4 animated_line_color = vec4( + light_offset + sin(2.0 * 3.14 * frequency * TIME), + light_offset + sin(2.0 * 3.14 * frequency * TIME + radians(120.0)), + light_offset + sin(2.0 * 3.14 * frequency * TIME + radians(240.0)), + 1.0 + ); + + vec4 color = texture(TEXTURE, UV); + if (outline_rainbow){ + COLOR = mix(color, animated_line_color, outline - color.a); + } else { + COLOR = mix(color, outline_color , outline - color.a); + } + } + + vec4 col = mix(COLOR, blend, schedule); + col = mix(vec4(0.0, 0.0, 0.0, 0.0), col, COLOR.a); + col *= modulate; + COLOR = col; +} diff --git a/DungeonShooting_Godot/resource/material/BleFA6E.tmp b/DungeonShooting_Godot/resource/material/BleFA6E.tmp new file mode 100644 index 0000000000000000000000000000000000000000..a40db2f0a67d107d88d47c175b488e9acaee22c4 --- /dev/null +++ b/DungeonShooting_Godot/resource/material/BleFA6E.tmp @@ -0,0 +1,51 @@ +shader_type canvas_item; + +//混合颜色 +uniform vec4 blend : source_color = vec4(1.0, 1.0, 1.0, 1.0); +//混合度 +uniform float schedule : hint_range(0.0, 1.0) = 0.0; +//透明度 +//uniform float alpha : hint_range(0.0, 1.0) = 1.0; +uniform vec4 modulate : source_color = vec4(1.0, 1.0, 1.0, 1.0); + +//------------------ 轮廓相关 -------------- +uniform bool show_outline = true; +//轮廓颜色 +uniform vec4 outline_color : source_color = vec4(0.0, 0.0, 0.0, 1.0); +//是否是彩虹轮廓 +uniform bool outline_rainbow = false; +//彩虹轮廓变化周期 +const float frequency = 0.25; +const float light_offset = 0.5; + +void fragment() { + //显示轮廓 + if (show_outline) { + vec2 size = TEXTURE_PIXEL_SIZE; + float outline; + outline = texture(TEXTURE, UV + vec2(-size.x, 0)).a; + outline += texture(TEXTURE, UV + vec2(0, size.y)).a; + outline += texture(TEXTURE, UV + vec2(size.x, 0)).a; + outline += texture(TEXTURE, UV + vec2(0, -size.y)).a; + outline = min(outline, 1.0); + + vec4 animated_line_color = vec4( + light_offset + sin(2.0 * 3.14 * frequency * TIME), + light_offset + sin(2.0 * 3.14 * frequency * TIME + radians(120.0)), + light_offset + sin(2.0 * 3.14 * frequency * TIME + radians(240.0)), + 1.0 + ); + + vec4 color = texture(TEXTURE, UV); + if (outline_rainbow){ + COLOR = mix(color, animated_line_color, outline - color.a); + } else { + COLOR = mix(color, outline_color , outline - color.a); + } + } + + vec4 col = mix(COLOR, blend, schedule); + col = mix(vec4(0.0, 0.0, 0.0, 0.0), col, COLOR.a); + col *= modulate; + COLOR = col; +} diff --git a/DungeonShooting_Godot/resource/material/Blend.tres b/DungeonShooting_Godot/resource/material/Blend.tres index dbd0411b1a3616d4d8ac9179d25f6c75a3364c16..8d6f5b32eaeb5d1b529edbbb53327c7ad6d7c287 100644 --- a/DungeonShooting_Godot/resource/material/Blend.tres +++ b/DungeonShooting_Godot/resource/material/Blend.tres @@ -5,9 +5,9 @@ [resource] resource_local_to_scene = true shader = ExtResource("1") -shader_parameter/blend = Color(0, 0, 0, 1) +shader_parameter/blend = Color(1, 1, 1, 1) shader_parameter/schedule = 0.0 -shader_parameter/alpha = 1.0 +shader_parameter/modulate = Color(1, 1, 1, 1) shader_parameter/show_outline = true shader_parameter/outline_color = Color(0.941176, 0.941176, 0.941176, 1) shader_parameter/outline_rainbow = false diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png deleted file mode 100644 index f9e597228836ebf3bb32cbe579498ec3c4e4191e..0000000000000000000000000000000000000000 Binary files a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png and /dev/null differ diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png b/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png deleted file mode 100644 index 95928a5e632a1e8a0b5ae58da13ebe650c8ae42f..0000000000000000000000000000000000000000 Binary files a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png and /dev/null differ diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import index c36be9484617b1259ab7fea7ca13340172dec5d7..5dc61b5079adcbc65220609e9d7673bba0f0afbd 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://chd2vtesap5cf" -path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex" +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-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 d563acf8298fac558420cfa65646c0e5e7e7101a..2f4c4505419da750125fa4d5f9ce962905300f3a 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://d2f55lu60x64i" -path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex" +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-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/resource/sprite/role/enemy0001/enemy0001_Icon.png b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1276ee6a94c475e4d43b2a361d9585a013bc6db2 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Icon.png differ 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 0000000000000000000000000000000000000000..bb343be07a9b2e5584e5e4df2b34b9ee581cf233 --- /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-f933f4ead421c794f7d87c43c52736b4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/enemy0001/enemy0001_Icon.png" +dest_files=["res://.godot/imported/enemy0001_Icon.png-f933f4ead421c794f7d87c43c52736b4.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/role2.png b/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001.png similarity index 100% rename from DungeonShooting_Godot/resource/sprite/role/role2.png rename to DungeonShooting_Godot/resource/sprite/role/role0001/Role0001.png diff --git a/DungeonShooting_Godot/resource/sprite/role/role2.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001.png.import similarity index 70% rename from DungeonShooting_Godot/resource/sprite/role/role2.png.import rename to DungeonShooting_Godot/resource/sprite/role/role0001/Role0001.png.import index 8c0e537ebf34cea458ca06b3205db9cb89e59ad5..eec1f3f4a87d94364fb25ea61181420fb15e5169 100644 --- a/DungeonShooting_Godot/resource/sprite/role/role2.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bhwhhg2dfsr26" -path="res://.godot/imported/role2.png-2684720cd846f0db30590472914d73a4.ctex" +path="res://.godot/imported/Role0001.png-6999fc593f104cd54766f96578820516.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/role2.png" -dest_files=["res://.godot/imported/role2.png-2684720cd846f0db30590472914d73a4.ctex"] +source_file="res://resource/sprite/role/role0001/Role0001.png" +dest_files=["res://.godot/imported/Role0001.png-6999fc593f104cd54766f96578820516.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001_Icon.png b/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..2ae1072d5f02487bb0d6fa969113fdb806f4d9ef Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001_Icon.png differ diff --git a/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001_Icon.png.import b/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001_Icon.png.import new file mode 100644 index 0000000000000000000000000000000000000000..9f21658e203d56ce5dc5c180521211960eb04a7c --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/role/role0001/Role0001_Icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://xo2xd4057wpa" +path="res://.godot/imported/Role0001_Icon.png-f31dfd180821eef50ddc4827aa6658ec.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/role/role0001/Role0001_Icon.png" +dest_files=["res://.godot/imported/Role0001_Icon.png-f31dfd180821eef50ddc4827aa6658ec.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/ui/commonIcon/Add.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Add.png new file mode 100644 index 0000000000000000000000000000000000000000..280a25d66f229ebe4d1cbd6f03308236fd2b66b3 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Add.png differ diff --git a/DungeonShooting_Godot/prefab/prop/buff/Weapon0005.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Add.png.import similarity index 67% rename from DungeonShooting_Godot/prefab/prop/buff/Weapon0005.png.import rename to DungeonShooting_Godot/resource/sprite/ui/commonIcon/Add.png.import index 3bc8abffa389e18cb9f9a25c7cf49d99c04cffea..204a74ad6d087394318cf6b1c681da6c8d7be810 100644 --- a/DungeonShooting_Godot/prefab/prop/buff/Weapon0005.png.import +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Add.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dl5kik1ejdb61" -path="res://.godot/imported/Weapon0005.png-441b09525093d086af82f4b42835379e.ctex" +uid="uid://n4atvj5fkcpg" +path="res://.godot/imported/Add.png-8e6b3c843ee8b2c6e57d2915f8263c65.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://prefab/prop/buff/Weapon0005.png" -dest_files=["res://.godot/imported/Weapon0005.png-441b09525093d086af82f4b42835379e.ctex"] +source_file="res://resource/sprite/ui/commonIcon/Add.png" +dest_files=["res://.godot/imported/Add.png-8e6b3c843ee8b2c6e57d2915f8263c65.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/AreaTool.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/AreaTool.png new file mode 100644 index 0000000000000000000000000000000000000000..b80b4ba21a39d85f4b9e6e3bbffb0a37d9a38a45 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/AreaTool.png differ diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/AreaTool.png.import similarity index 67% rename from DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import rename to DungeonShooting_Godot/resource/sprite/ui/commonIcon/AreaTool.png.import index c36be9484617b1259ab7fea7ca13340172dec5d7..676160aa9534c4dc2412526dca92f50798c18cc5 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001.png.import +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/AreaTool.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://chd2vtesap5cf" -path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex" +uid="uid://b7w6pbk7aucee" +path="res://.godot/imported/AreaTool.png-e5beed3b808469bfedf759308db4e539.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/ui/commonIcon/AreaTool.png" +dest_files=["res://.godot/imported/AreaTool.png-e5beed3b808469bfedf759308db4e539.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Back.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Back.png new file mode 100644 index 0000000000000000000000000000000000000000..cd55ec24ef2e5273e865b165694e42ae6640194a Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Back.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Back.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Back.png.import new file mode 100644 index 0000000000000000000000000000000000000000..0dab2e8626fb46fb62e3ae5b6b0992b0e54206a9 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Back.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cajcnlimvoxk" +path="res://.godot/imported/Back.png-4f6c04af710e74226c20bed5c5343f81.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Back.png" +dest_files=["res://.godot/imported/Back.png-4f6c04af710e74226c20bed5c5343f81.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/ui/commonIcon/CenterTool.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/CenterTool.png new file mode 100644 index 0000000000000000000000000000000000000000..d980ce286fde25a7b07b1d54e6b0641bf6b1140e Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/CenterTool.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/CenterTool.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/CenterTool.png.import new file mode 100644 index 0000000000000000000000000000000000000000..33c643f52a26f119578410082be98dbbf428d279 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/CenterTool.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2wslibovwv7w" +path="res://.godot/imported/CenterTool.png-4576df0e7b33592ac2d1166b7a6dda09.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/CenterTool.png" +dest_files=["res://.godot/imported/CenterTool.png-4576df0e7b33592ac2d1166b7a6dda09.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/ui/commonIcon/Delete.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Delete.png new file mode 100644 index 0000000000000000000000000000000000000000..76da1c105338def6ddb7066d2f484f35dbdfe646 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Delete.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Delete.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Delete.png.import new file mode 100644 index 0000000000000000000000000000000000000000..05d379fba38429be1386b16c7c3f570727c0b609 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Delete.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5778ntk2rdon" +path="res://.godot/imported/Delete.png-f48bfe3683bb202cd13fbd26db67c28c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Delete.png" +dest_files=["res://.godot/imported/Delete.png-f48bfe3683bb202cd13fbd26db67c28c.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/ui/commonIcon/DoorTool.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DoorTool.png new file mode 100644 index 0000000000000000000000000000000000000000..65fb7930a34895d01a76b690f55092c41e172b01 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DoorTool.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DoorTool.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DoorTool.png.import new file mode 100644 index 0000000000000000000000000000000000000000..96b582496467959110dade7667eaff47ed96e0c4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DoorTool.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dxpdjj1abmejh" +path="res://.godot/imported/DoorTool.png-3f0fe4eba16e8f6c3cc329b330e301f8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/DoorTool.png" +dest_files=["res://.godot/imported/DoorTool.png-3f0fe4eba16e8f6c3cc329b330e301f8.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/ui/commonIcon/Down.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Down.png new file mode 100644 index 0000000000000000000000000000000000000000..8091007c6338c207fc7cf00d708683d13e38d25e Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Down.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Down.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Down.png.import new file mode 100644 index 0000000000000000000000000000000000000000..a3a4279ea2cb9397ae21060f56a8372a30cae7f6 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Down.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d4gduco55dqpk" +path="res://.godot/imported/Down.png-6e9f5947e59825e2421fd7267b950df8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Down.png" +dest_files=["res://.godot/imported/Down.png-6e9f5947e59825e2421fd7267b950df8.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/ui/commonIcon/DragTool.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DragTool.png new file mode 100644 index 0000000000000000000000000000000000000000..7d3f566f930282f937a5143160a242675ebdecd6 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DragTool.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DragTool.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DragTool.png.import new file mode 100644 index 0000000000000000000000000000000000000000..349723ac918ee177ca78e6a003f8d700c2b44eea --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/DragTool.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cf5jw35388hto" +path="res://.godot/imported/DragTool.png-2f2a7cc185c6c4cb1014bbd422748bb0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/DragTool.png" +dest_files=["res://.godot/imported/DragTool.png-2f2a7cc185c6c4cb1014bbd422748bb0.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/ui/commonIcon/Edit.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Edit.png new file mode 100644 index 0000000000000000000000000000000000000000..8384af3e8dbebf1beb6e17ce730e136ce4e3b5cf Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Edit.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Edit.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Edit.png.import new file mode 100644 index 0000000000000000000000000000000000000000..2f56e27ba41a529e2fd6cd0edb63c8d49e50735a --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Edit.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dggb6p4sdmfry" +path="res://.godot/imported/Edit.png-e197be1526d051ddb37fe0759e8310cb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Edit.png" +dest_files=["res://.godot/imported/Edit.png-e197be1526d051ddb37fe0759e8310cb.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/ui/commonIcon/Error_mini.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Error_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..5d5d09bb2fdd06d648b2c74032abb0e7930fdbf9 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Error_mini.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Error_mini.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Error_mini.png.import new file mode 100644 index 0000000000000000000000000000000000000000..93b0024fc680b8b3f50eb15f2ebf5926e5e45c23 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Error_mini.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c4ltpf5a3egu1" +path="res://.godot/imported/Error_mini.png-f9c9827e6f9ebf786012cbb167be2487.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Error_mini.png" +dest_files=["res://.godot/imported/Error_mini.png-f9c9827e6f9ebf786012cbb167be2487.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/ui/commonIcon/Hide.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Hide.png new file mode 100644 index 0000000000000000000000000000000000000000..19253057e3d40f3f795a60cf70686ce393ea4f79 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Hide.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Hide.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Hide.png.import new file mode 100644 index 0000000000000000000000000000000000000000..887aed6f105fca979b9cc5c0546c762292fd1aa4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Hide.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://tx8ynskqa5ad" +path="res://.godot/imported/Hide.png-cb345239a5a127cc3d7560e6ace35a17.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Hide.png" +dest_files=["res://.godot/imported/Hide.png-cb345239a5a127cc3d7560e6ace35a17.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/ui/commonIcon/Lock.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Lock.png new file mode 100644 index 0000000000000000000000000000000000000000..40f033fdaf8f6cfd451d00780b076d02798fe81e Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Lock.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Lock.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Lock.png.import new file mode 100644 index 0000000000000000000000000000000000000000..c1adc8e2f762c5a2b3332192223181b2441fced3 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Lock.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dmm8jw06bhffh" +path="res://.godot/imported/Lock.png-c8b444111d719776b02720e1b6dd7fc2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Lock.png" +dest_files=["res://.godot/imported/Lock.png-c8b444111d719776b02720e1b6dd7fc2.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/ui/commonIcon/Mark.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Mark.png new file mode 100644 index 0000000000000000000000000000000000000000..a908b07d6847b5b94e6efe412d9a8cd7dc10c8bf Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Mark.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Mark.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Mark.png.import new file mode 100644 index 0000000000000000000000000000000000000000..3670dfbf10e56307b10a0152b7268eefd0d57cb2 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Mark.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dnty1a2tcawos" +path="res://.godot/imported/Mark.png-5890a71756442a021ebbbbe4f9041844.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Mark.png" +dest_files=["res://.godot/imported/Mark.png-5890a71756442a021ebbbbe4f9041844.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/ui/commonIcon/MarkCell.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/MarkCell.png new file mode 100644 index 0000000000000000000000000000000000000000..659e91505910f7a51c5521cc3110d7c5d22c468a Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/MarkCell.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/MarkCell.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/MarkCell.png.import new file mode 100644 index 0000000000000000000000000000000000000000..fc492df2008bea8c1416540c2b602e96331a57b4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/MarkCell.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bylf0kxccwgdw" +path="res://.godot/imported/MarkCell.png-ab0d15ace59a4d983e80be2394fc73d8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/MarkCell.png" +dest_files=["res://.godot/imported/MarkCell.png-ab0d15ace59a4d983e80be2394fc73d8.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/ui/commonIcon/PenTool.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/PenTool.png new file mode 100644 index 0000000000000000000000000000000000000000..d3bca0b0e732d8f16a30b95e26ad9fe9f72565fc Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/PenTool.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/PenTool.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/PenTool.png.import new file mode 100644 index 0000000000000000000000000000000000000000..082cc1f6041a8e4e5701c45535ff032fa0563e0d --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/PenTool.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8yxnnif4j2ov" +path="res://.godot/imported/PenTool.png-326aa47d1e7e4494c4775d687f19907d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/PenTool.png" +dest_files=["res://.godot/imported/PenTool.png-326aa47d1e7e4494c4775d687f19907d.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/ui/commonIcon/Play.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Play.png new file mode 100644 index 0000000000000000000000000000000000000000..4d38dcb225446122964ed2fefc68d2bfc25eb6fa Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Play.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Play.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Play.png.import new file mode 100644 index 0000000000000000000000000000000000000000..f1e57204aad0fa0f731a6af90f2dfbc2d806a21b --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Play.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7l7aqhsaexoh" +path="res://.godot/imported/Play.png-c41306005c6cbbe7b8ce33cef0264a2e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Play.png" +dest_files=["res://.godot/imported/Play.png-c41306005c6cbbe7b8ce33cef0264a2e.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/ui/commonIcon/Right.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Right.png new file mode 100644 index 0000000000000000000000000000000000000000..da0ce735a3d4752c65a31b475646a2a329d2f500 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Right.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Right.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Right.png.import new file mode 100644 index 0000000000000000000000000000000000000000..5fb9488b63a9c0567b6371316a981ea7f58a1fd4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Right.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dligpyhp72sg7" +path="res://.godot/imported/Right.png-22242f6b1f2c41dacc2876dc0a629574.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Right.png" +dest_files=["res://.godot/imported/Right.png-22242f6b1f2c41dacc2876dc0a629574.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/ui/commonIcon/Save.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Save.png new file mode 100644 index 0000000000000000000000000000000000000000..aa66dc9ab6706cb820979f744f1003beab778f37 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Save.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Save.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Save.png.import new file mode 100644 index 0000000000000000000000000000000000000000..52dac1a5ccf6126154a1931b21343b212ee1bff1 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Save.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cat35d7ueu7gu" +path="res://.godot/imported/Save.png-7a9e9cb711135f7b76ecf0a63087d524.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Save.png" +dest_files=["res://.godot/imported/Save.png-7a9e9cb711135f7b76ecf0a63087d524.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/ui/commonIcon/Search.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Search.png new file mode 100644 index 0000000000000000000000000000000000000000..cda76852e7f758787207fa06c5801327c8a9984a Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Search.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Search.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Search.png.import new file mode 100644 index 0000000000000000000000000000000000000000..1eacfedd4b0499f63e2b3879dfe93396f795c802 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Search.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://blfvsup876agh" +path="res://.godot/imported/Search.png-22f8bee474045856c03cc0954c4df134.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Search.png" +dest_files=["res://.godot/imported/Search.png-22f8bee474045856c03cc0954c4df134.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/ui/commonIcon/Select.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select.png new file mode 100644 index 0000000000000000000000000000000000000000..18fb748c1d6e62aea92e983c6eacf11c2b33b013 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select.png.import new file mode 100644 index 0000000000000000000000000000000000000000..af796862df1417021ed4d1fa90861a562fb6d7c4 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cuntr7hec044f" +path="res://.godot/imported/Select.png-b7c80c0f382b99689eb2b14ec6358a05.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Select.png" +dest_files=["res://.godot/imported/Select.png-b7c80c0f382b99689eb2b14ec6358a05.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/ui/commonIcon/Select2.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select2.png new file mode 100644 index 0000000000000000000000000000000000000000..b38861f40c11439b2f5c3953fa380ba604994a1f Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select2.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select2.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select2.png.import new file mode 100644 index 0000000000000000000000000000000000000000..e26052ec2305d090dbc22b23aad3a7c14a80fb66 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Select2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bn47bmilcw4x0" +path="res://.godot/imported/Select2.png-a8daa3355fe22187f4edfdf2c1de4504.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Select2.png" +dest_files=["res://.godot/imported/Select2.png-a8daa3355fe22187f4edfdf2c1de4504.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/ui/commonIcon/Setting.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Setting.png new file mode 100644 index 0000000000000000000000000000000000000000..b5ef408b031be60115a54b1221d61cb70fb17f12 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Setting.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Setting.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Setting.png.import new file mode 100644 index 0000000000000000000000000000000000000000..537caf69b3713b6ab38f20711cce17804be5e832 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Setting.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpbfjyj6258da" +path="res://.godot/imported/Setting.png-c6a170d14d8c06a87c462b6063f7e3fd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Setting.png" +dest_files=["res://.godot/imported/Setting.png-c6a170d14d8c06a87c462b6063f7e3fd.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/ui/commonIcon/Unlock.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Unlock.png new file mode 100644 index 0000000000000000000000000000000000000000..7244b37f5c785d78eee7767f9a4aa6bef3263b07 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Unlock.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Unlock.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Unlock.png.import new file mode 100644 index 0000000000000000000000000000000000000000..5af6d90829dbe42cfaa9a3aecc69d1fcf8d3cb36 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Unlock.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://jvcvtpvt2fid" +path="res://.godot/imported/Unlock.png-a409c96a8ca571f75a60a5f09be5720c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Unlock.png" +dest_files=["res://.godot/imported/Unlock.png-a409c96a8ca571f75a60a5f09be5720c.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/ui/commonIcon/Visible.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Visible.png new file mode 100644 index 0000000000000000000000000000000000000000..9bbd5cbf1dfc8eb922a9bc627a0f94cd0d14c79f Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Visible.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Visible.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Visible.png.import new file mode 100644 index 0000000000000000000000000000000000000000..6618b5ace5948bb0ba9b1916fae2c4e9e72900c0 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Visible.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dqvg18aacx6db" +path="res://.godot/imported/Visible.png-4c1ece1a99e6985ec91c751931e614c1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Visible.png" +dest_files=["res://.godot/imported/Visible.png-4c1ece1a99e6985ec91c751931e614c1.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/ui/commonIcon/Warn_mini.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Warn_mini.png.import new file mode 100644 index 0000000000000000000000000000000000000000..2233ccc0a09b2b9009ae2770d88baba2835f4ec8 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/Warn_mini.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dh8dsquou6doa" +path="res://.godot/imported/Warn_mini.png-37d2877856269536edc8440b8b18144b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/Warn_mini.png" +dest_files=["res://.godot/imported/Warn_mini.png-37d2877856269536edc8440b8b18144b.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/ui/commonIcon/WaveCell.png b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/WaveCell.png new file mode 100644 index 0000000000000000000000000000000000000000..514f0458ef69508d9ca8ebd1dc20c9fac6e30572 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/WaveCell.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/commonIcon/WaveCell.png.import b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/WaveCell.png.import new file mode 100644 index 0000000000000000000000000000000000000000..f7b4f3692c8a41ff86a5baf7676c7d90ffde94df --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/commonIcon/WaveCell.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cgtmjuiks7mot" +path="res://.godot/imported/WaveCell.png-9b14701b6e40a6505bb357db2699b41e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/commonIcon/WaveCell.png" +dest_files=["res://.godot/imported/WaveCell.png-9b14701b6e40a6505bb357db2699b41e.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/ui/cursors.png b/DungeonShooting_Godot/resource/sprite/ui/cursors.png deleted file mode 100644 index b40cfe5f9d1b1ad678c8debaae711005f7750a72..0000000000000000000000000000000000000000 Binary files a/DungeonShooting_Godot/resource/sprite/ui/cursors.png and /dev/null differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png new file mode 100644 index 0000000000000000000000000000000000000000..e8b825eae04d68ecdc8bc6003f5880024eb09320 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png.import new file mode 100644 index 0000000000000000000000000000000000000000..a2f26be8ceac95d3e0a6b113f8e72f417a72ce00 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditor/ErrorCell.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0878uloew5jo" +path="res://.godot/imported/ErrorCell.png-adb91a4f9cc859a7b631f14ff0f58d18.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/mapEditor/ErrorCell.png" +dest_files=["res://.godot/imported/ErrorCell.png-adb91a4f9cc859a7b631f14ff0f58d18.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/ui/mapEditorProject/CellBg.png b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png new file mode 100644 index 0000000000000000000000000000000000000000..1445214fc42fe8ef4ba0c0fe9c2db061e7811df3 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png.import new file mode 100644 index 0000000000000000000000000000000000000000..c97f18396d00ef74229e28809fb3aedc8b48a285 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chd1r5artktp" +path="res://.godot/imported/CellBg.png-fd013af36fe871178b0c4d9d0b2ecb6f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/mapEditorProject/CellBg.png" +dest_files=["res://.godot/imported/CellBg.png-fd013af36fe871178b0c4d9d0b2ecb6f.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/ui/mapEditorTools/DoorDragButton.png b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton.png new file mode 100644 index 0000000000000000000000000000000000000000..b2efd1037542ce61914c639ce048ef53647975e7 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton.png.import new file mode 100644 index 0000000000000000000000000000000000000000..05889939c7b3aee20473bb580fa7c30b4daefbae --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4wupcp53rrpi" +path="res://.godot/imported/DoorDragButton.png-4094a4aa3ca627538a0de7f7993208bd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/mapEditorTools/DoorDragButton.png" +dest_files=["res://.godot/imported/DoorDragButton.png-4094a4aa3ca627538a0de7f7993208bd.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/ui/mapEditorTools/DoorDragButton_down.png b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_down.png new file mode 100644 index 0000000000000000000000000000000000000000..f5413cebda3f423e3746b79be8aa3c081a393b26 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_down.png differ diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_down.png.import similarity index 64% rename from DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png.import rename to DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_down.png.import index d563acf8298fac558420cfa65646c0e5e7e7101a..43fa59c97036c2e3abf1e9be49eeb9a6a70bb495 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/Enemy0001_Debris.png.import +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_down.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://d2f55lu60x64i" -path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex" +uid="uid://dcq8xinoyvo85" +path="res://.godot/imported/DoorDragButton_down.png-34213115cda413530ae9d1c4111ca91a.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/ui/mapEditorTools/DoorDragButton_down.png" +dest_files=["res://.godot/imported/DoorDragButton_down.png-34213115cda413530ae9d1c4111ca91a.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png new file mode 100644 index 0000000000000000000000000000000000000000..5723ea883168af96897106d91cc72175ed28e946 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png.import new file mode 100644 index 0000000000000000000000000000000000000000..bbd2937acf01ea09f91ee94a1ab5159e793ae38a --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cc6nakbhepy2" +path="res://.godot/imported/DoorDragButton_hover.png-ad7c38cb89f44b039fe7fcca449c978b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png" +dest_files=["res://.godot/imported/DoorDragButton_hover.png-ad7c38cb89f44b039fe7fcca449c978b.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/ui/mapEditorTools/Drag.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/Drag.png.import new file mode 100644 index 0000000000000000000000000000000000000000..2a71a9ac3e167eeadaf2a83901e7824852198d6f --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditorTools/Drag.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dnmjw2kwhcglk" +path="res://.godot/imported/Drag.png-409587e9ceac82665e6dd81c87944b46.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/mapEditorTools/Drag.png" +dest_files=["res://.godot/imported/Drag.png-409587e9ceac82665e6dd81c87944b46.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/ui/CursorCenter.png b/DungeonShooting_Godot/resource/sprite/ui/sursors/CursorCenter.png similarity index 100% rename from DungeonShooting_Godot/resource/sprite/ui/CursorCenter.png rename to DungeonShooting_Godot/resource/sprite/ui/sursors/CursorCenter.png diff --git a/DungeonShooting_Godot/resource/sprite/ui/CursorCenter.png.import b/DungeonShooting_Godot/resource/sprite/ui/sursors/CursorCenter.png.import similarity index 69% rename from DungeonShooting_Godot/resource/sprite/ui/CursorCenter.png.import rename to DungeonShooting_Godot/resource/sprite/ui/sursors/CursorCenter.png.import index 93da5e508292d139431cfcc058b5fce9f00f3b90..52f2c65424d73a936ff6da84c1a1df52dc880637 100644 --- a/DungeonShooting_Godot/resource/sprite/ui/CursorCenter.png.import +++ b/DungeonShooting_Godot/resource/sprite/ui/sursors/CursorCenter.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cjiiu86a42mnj" -path="res://.godot/imported/CursorCenter.png-221387e3be72196967aca25a86f368aa.ctex" +path="res://.godot/imported/CursorCenter.png-e4db9151a43d8d98ea8e964dcd7aa856.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/ui/CursorCenter.png" -dest_files=["res://.godot/imported/CursorCenter.png-221387e3be72196967aca25a86f368aa.ctex"] +source_file="res://resource/sprite/ui/sursors/CursorCenter.png" +dest_files=["res://.godot/imported/CursorCenter.png-e4db9151a43d8d98ea8e964dcd7aa856.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors.png b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors.png new file mode 100644 index 0000000000000000000000000000000000000000..30567ac51490c625984f55c02751756ee825622f Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/cursors.png.import b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors.png.import similarity index 71% rename from DungeonShooting_Godot/resource/sprite/ui/cursors.png.import rename to DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors.png.import index 2460561242c20917c97d70f5bf1e7ed2fed3c18d..b76c2acfeb6ccb5ce34af2c8b3528c6264a47c71 100644 --- a/DungeonShooting_Godot/resource/sprite/ui/cursors.png.import +++ b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dta28v3fgkfru" -path="res://.godot/imported/cursors.png-39228cc5284ece278357dbc1a5b6c668.ctex" +path="res://.godot/imported/Cursors.png-c127006a2ffd52e18c1a029a32603b59.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/ui/cursors.png" -dest_files=["res://.godot/imported/cursors.png-39228cc5284ece278357dbc1a5b6c668.ctex"] +source_file="res://resource/sprite/ui/sursors/Cursors.png" +dest_files=["res://.godot/imported/Cursors.png-c127006a2ffd52e18c1a029a32603b59.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors_Ui.png b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors_Ui.png new file mode 100644 index 0000000000000000000000000000000000000000..91755a6f46061301125242f8a35cbd3a05fa1eb1 Binary files /dev/null and b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors_Ui.png differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors_Ui.png.import b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors_Ui.png.import new file mode 100644 index 0000000000000000000000000000000000000000..e77bd4bb6dfa204e1afb17637e4f2b9280dcf60e --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/sursors/Cursors_Ui.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cal3ce13lly" +path="res://.godot/imported/Cursors_Ui.png-8a8c8b418cc772c9f1867e0a4cb1729d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/sursors/Cursors_Ui.png" +dest_files=["res://.godot/imported/Cursors_Ui.png-8a8c8b418cc772c9f1867e0a4cb1729d.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/spriteFrames/role/Role0001.tres b/DungeonShooting_Godot/resource/spriteFrames/role/Role0001.tres index c813ce376801192d6fa854400dd816aa0a25f540..51d0ef04ed5bab069fcee6651339964106e2996d 100644 --- a/DungeonShooting_Godot/resource/spriteFrames/role/Role0001.tres +++ b/DungeonShooting_Godot/resource/spriteFrames/role/Role0001.tres @@ -1,57 +1,57 @@ [gd_resource type="SpriteFrames" load_steps=15 format=3 uid="uid://n11thtali6es"] -[ext_resource type="Texture2D" uid="uid://bhwhhg2dfsr26" path="res://resource/sprite/role/role2.png" id="1_n8j7s"] +[ext_resource type="Texture2D" uid="uid://bhwhhg2dfsr26" path="res://resource/sprite/role/role0001/Role0001.png" id="1_frpf2"] [sub_resource type="AtlasTexture" id="AtlasTexture_tmewn"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(0, 0, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_dvg4a"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(0, 24, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_kvuct"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(16, 24, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_5op76"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(32, 24, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_helyc"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(48, 24, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_67mn8"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(48, 48, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_jeywq"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(32, 48, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_oycx8"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(16, 48, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_tjg1t"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(0, 48, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_2ltxw"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(0, 48, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_x1va1"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(16, 48, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_ic2p5"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(32, 48, 16, 24) [sub_resource type="AtlasTexture" id="AtlasTexture_j3hdu"] -atlas = ExtResource("1_n8j7s") +atlas = ExtResource("1_frpf2") region = Rect2(48, 48, 16, 24) [resource] diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index 895ea5dbe089a1b8358f16150cb1fbce2e450b34..591d33ff658ce815c492ed5a86e726ae305fa6fd 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -1,61 +1,45 @@ -[gd_resource type="Theme" load_steps=78 format=3 uid="uid://ds668te2rph30"] +[gd_resource type="Theme" load_steps=61 format=3 uid="uid://ds668te2rph30"] [ext_resource type="FontFile" uid="uid://cad0in7dtweo5" path="res://resource/font/VonwaonBitmap-16px.ttf" id="1_1e6k7"] -[sub_resource type="StyleBoxFlat" id="1"] -content_margin_left = 6.0 -content_margin_top = 4.0 -content_margin_right = 6.0 -content_margin_bottom = 4.0 -bg_color = Color(0.109412, 0.109412, 0.109412, 1) -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -border_color = Color(0.0850983, 0.0850983, 0.0850983, 1) - [sub_resource type="StyleBoxFlat" id="2"] content_margin_left = 6.0 content_margin_top = 4.0 content_margin_right = 6.0 content_margin_bottom = 4.0 -bg_color = Color(0.0911767, 0.0911767, 0.0911767, 1) +bg_color = Color(0.0431373, 0.0431373, 0.0431373, 1) border_width_left = 1 border_width_top = 1 border_width_right = 1 border_width_bottom = 1 border_color = Color(0.117647, 0.431373, 0.905882, 1) +corner_radius_bottom_left = 4 [sub_resource type="StyleBoxFlat" id="3"] content_margin_left = 6.0 content_margin_top = 4.0 content_margin_right = 6.0 content_margin_bottom = 4.0 -bg_color = Color(0.0911767, 0.0911767, 0.0911767, 1) +bg_color = Color(0.0431373, 0.0431373, 0.0431373, 1) border_width_left = 1 border_width_top = 1 border_width_right = 1 border_width_bottom = 1 -border_color = Color(0.341177, 0.341177, 0.341177, 1) +border_color = Color(0.0666667, 0.243137, 0.509804, 1) [sub_resource type="StyleBoxFlat" id="4"] content_margin_left = 6.0 content_margin_top = 4.0 content_margin_right = 6.0 content_margin_bottom = 4.0 -bg_color = Color(0, 0, 0, 1) -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -border_color = Color(0.0759806, 0.0759806, 0.0759806, 1) +bg_color = Color(0.0431373, 0.0431373, 0.0431373, 1) [sub_resource type="StyleBoxFlat" id="5"] content_margin_left = 6.0 content_margin_top = 4.0 content_margin_right = 6.0 content_margin_bottom = 4.0 -bg_color = Color(0.0911767, 0.0911767, 0.0911767, 1) +bg_color = Color(0.0431373, 0.0431373, 0.0431373, 1) border_width_left = 1 border_width_top = 1 border_width_right = 1 @@ -350,160 +334,73 @@ bg_color = Color(0.0941176, 0.345098, 0.724706, 0.8) [sub_resource type="StyleBoxFlat" id="53"] bg_color = Color(0.260588, 0.156863, 0.724706, 0.8) -[sub_resource type="ImageTexture" id="58"] - -[sub_resource type="Image" id="Image_wuwj5"] -data = { -"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), -"format": "RGBA8", -"height": 12, -"mipmaps": false, -"width": 12 -} - -[sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_wuwj5") - -[sub_resource type="StyleBoxTexture" id="61"] -content_margin_left = 2.0 -content_margin_top = 2.0 -content_margin_right = 2.0 -content_margin_bottom = 2.0 -texture = SubResource("60") -region_rect = Rect2(0, 0, 12, 12) - -[sub_resource type="Image" id="Image_nrr6i"] -data = { -"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), -"format": "RGBA8", -"height": 12, -"mipmaps": false, -"width": 12 -} - -[sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_nrr6i") - -[sub_resource type="StyleBoxTexture" id="64"] -content_margin_left = 2.0 -content_margin_top = 2.0 -content_margin_right = 2.0 -content_margin_bottom = 2.0 -texture = SubResource("63") -region_rect = Rect2(0, 0, 12, 12) - -[sub_resource type="Image" id="Image_qxe4e"] -data = { -"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), -"format": "RGBA8", -"height": 12, -"mipmaps": false, -"width": 12 -} - -[sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_qxe4e") - -[sub_resource type="StyleBoxTexture" id="67"] -content_margin_left = 2.0 -content_margin_top = 2.0 -content_margin_right = 2.0 -content_margin_bottom = 2.0 -texture = SubResource("66") -region_rect = Rect2(0, 0, 12, 12) - -[sub_resource type="Image" id="Image_iplm4"] -data = { -"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), -"format": "RGBA8", -"height": 12, -"mipmaps": false, -"width": 12 -} - -[sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_iplm4") - -[sub_resource type="StyleBoxTexture" id="70"] -content_margin_left = 0.0 -content_margin_top = 0.0 -content_margin_right = 0.0 -content_margin_bottom = 0.0 -texture = SubResource("69") -region_rect = Rect2(0, 0, 12, 12) - -[sub_resource type="StyleBoxTexture" id="71"] -content_margin_left = 0.0 -content_margin_top = 0.0 -content_margin_right = 0.0 -content_margin_bottom = 0.0 -texture = SubResource("69") -region_rect = Rect2(0, 0, 12, 12) - [sub_resource type="StyleBoxEmpty" id="54"] content_margin_left = 4.0 content_margin_top = 4.0 content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_trdur"] -data = { -"data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), -"format": "RGBA8", -"height": 16, -"mipmaps": false, -"width": 16 -} - -[sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_trdur") +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_em2wh"] +content_margin_left = 5.0 +content_margin_right = 5.0 +bg_color = Color(0.0901961, 0.0901961, 0.0901961, 1) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.117647, 0.431373, 0.905882, 1) +shadow_size = 2 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0jpwx"] +content_margin_left = 5.0 +content_margin_right = 5.0 +bg_color = Color(0.0901961, 0.0901961, 0.0901961, 1) +shadow_size = 2 +anti_aliasing = false + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c3u8l"] +content_margin_left = 5.0 +content_margin_right = 5.0 +bg_color = Color(0.0901961, 0.0901961, 0.0901961, 1) +shadow_size = 2 +anti_aliasing = false [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 content_margin_top = 4.0 content_margin_right = 6.0 content_margin_bottom = 4.0 -bg_color = Color(0.0705882, 0.0705882, 0.0705882, 1) - -[sub_resource type="StyleBoxTexture" id="73"] -content_margin_left = 2.0 -content_margin_top = 2.0 -content_margin_right = 2.0 -content_margin_bottom = 2.0 -texture = SubResource("60") -region_rect = Rect2(0, 0, 12, 12) - -[sub_resource type="StyleBoxTexture" id="74"] -content_margin_left = 2.0 -content_margin_top = 2.0 -content_margin_right = 2.0 -content_margin_bottom = 2.0 -texture = SubResource("63") -region_rect = Rect2(0, 0, 12, 12) - -[sub_resource type="StyleBoxTexture" id="75"] -content_margin_left = 2.0 -content_margin_top = 2.0 -content_margin_right = 2.0 -content_margin_bottom = 2.0 -texture = SubResource("66") -region_rect = Rect2(0, 0, 12, 12) - -[sub_resource type="StyleBoxTexture" id="76"] -content_margin_left = 0.0 -content_margin_top = 0.0 -content_margin_right = 0.0 -content_margin_bottom = 0.0 -texture = SubResource("69") -region_rect = Rect2(0, 0, 12, 12) +bg_color = Color(0.0745098, 0.0745098, 0.0745098, 1) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(0.188235, 0.188235, 0.188235, 1) -[sub_resource type="StyleBoxTexture" id="77"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yeu07"] content_margin_left = 0.0 content_margin_top = 0.0 content_margin_right = 0.0 content_margin_bottom = 0.0 -texture = SubResource("69") -region_rect = Rect2(0, 0, 12, 12) +bg_color = Color(0.1, 0.1, 0.1, 0.6) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kt3n1"] +content_margin_left = 4.0 +content_margin_top = 4.0 +content_margin_right = 4.0 +content_margin_bottom = 4.0 +bg_color = Color(1, 1, 1, 0.75) +draw_center = false +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +corner_detail = 5 +expand_margin_left = 2.0 +expand_margin_top = 2.0 +expand_margin_right = 2.0 +expand_margin_bottom = 2.0 [resource] default_font = ExtResource("1_1e6k7") @@ -517,7 +414,6 @@ Button/colors/icon_color_hover = Color(1.15, 1.15, 1.15, 1) Button/colors/icon_color_pressed = Color(0.135294, 0.496079, 1.04176, 1) Button/constants/hseparation = 2 Button/fonts/font = ExtResource("1_1e6k7") -Button/styles/disabled = SubResource("1") Button/styles/focus = SubResource("2") Button/styles/hover = SubResource("3") Button/styles/normal = SubResource("4") @@ -600,17 +496,6 @@ Editor/styles/sub_inspector_property_bg_selected6 = SubResource("50") Editor/styles/sub_inspector_property_bg_selected7 = SubResource("51") Editor/styles/sub_inspector_property_bg_selected8 = SubResource("52") Editor/styles/sub_inspector_property_bg_selected9 = SubResource("53") -HScrollBar/icons/decrement = SubResource("58") -HScrollBar/icons/decrement_highlight = SubResource("58") -HScrollBar/icons/decrement_pressed = SubResource("58") -HScrollBar/icons/increment = SubResource("58") -HScrollBar/icons/increment_highlight = SubResource("58") -HScrollBar/icons/increment_pressed = SubResource("58") -HScrollBar/styles/grabber = SubResource("61") -HScrollBar/styles/grabber_highlight = SubResource("64") -HScrollBar/styles/grabber_pressed = SubResource("67") -HScrollBar/styles/scroll = SubResource("70") -HScrollBar/styles/scroll_focus = SubResource("71") Label/colors/font_color = Color(0.780392, 0.780392, 0.780392, 1) Label/colors/font_color_shadow = Color(0, 0, 0, 0) Label/colors/font_outline_modulate = Color(1, 1, 1, 1) @@ -620,29 +505,13 @@ Label/constants/shadow_offset_x = 1 Label/constants/shadow_offset_y = 1 Label/fonts/font = ExtResource("1_1e6k7") Label/styles/normal = SubResource("54") -LineEdit/colors/clear_button_color = Color(0.780392, 0.780392, 0.780392, 1) -LineEdit/colors/clear_button_color_pressed = Color(0.117647, 0.431373, 0.905882, 1) -LineEdit/colors/cursor_color = Color(0.780392, 0.780392, 0.780392, 1) -LineEdit/colors/font_color = Color(0.780392, 0.780392, 0.780392, 1) -LineEdit/colors/font_color_selected = Color(1, 1, 1, 1) -LineEdit/colors/font_color_uneditable = Color(1, 1, 1, 0.65) -LineEdit/colors/read_only = Color(1, 1, 1, 0.3) -LineEdit/colors/selection_color = Color(0.117647, 0.431373, 0.905882, 0.4) -LineEdit/constants/minimum_spaces = 12 -LineEdit/fonts/font = ExtResource("1_1e6k7") -LineEdit/icons/clear = SubResource("56") -LineEdit/styles/focus = SubResource("2") -LineEdit/styles/normal = SubResource("4") -LineEdit/styles/read_only = SubResource("1") +LineEdit/styles/focus = SubResource("StyleBoxFlat_em2wh") +LineEdit/styles/normal = SubResource("StyleBoxFlat_0jpwx") +LineEdit/styles/read_only = SubResource("StyleBoxFlat_c3u8l") Panel/styles/panel = SubResource("57") -VScrollBar/icons/decrement = SubResource("58") -VScrollBar/icons/decrement_highlight = SubResource("58") -VScrollBar/icons/decrement_pressed = SubResource("58") -VScrollBar/icons/increment = SubResource("58") -VScrollBar/icons/increment_highlight = SubResource("58") -VScrollBar/icons/increment_pressed = SubResource("58") -VScrollBar/styles/grabber = SubResource("73") -VScrollBar/styles/grabber_highlight = SubResource("74") -VScrollBar/styles/grabber_pressed = SubResource("75") -VScrollBar/styles/scroll = SubResource("76") -VScrollBar/styles/scroll_focus = SubResource("77") +PanelContainer/styles/panel = SubResource("StyleBoxFlat_yeu07") +TextEdit/styles/focus = SubResource("StyleBoxFlat_em2wh") +TextEdit/styles/normal = SubResource("StyleBoxFlat_0jpwx") +TextEdit/styles/read_only = SubResource("StyleBoxFlat_c3u8l") +TooltipLabel/font_sizes/font_size = 32 +Tree/styles/focus = SubResource("StyleBoxFlat_kt3n1") diff --git a/DungeonShooting_Godot/scene/EditorDemo.tscn b/DungeonShooting_Godot/scene/EditorDemo.tscn deleted file mode 100644 index 50a19273a68fc3078c648d34848e696db6a7023b..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/scene/EditorDemo.tscn +++ /dev/null @@ -1,9 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://editor/prefabs/Editor.tscn" type="PackedScene" id=1] - -[node name="EditorDemo" type="Node2D"] - -[node name="CanvasLayer" type="CanvasLayer" parent="."] - -[node name="Editor" parent="CanvasLayer" instance=ExtResource( 1 )] diff --git a/DungeonShooting_Godot/scene/Main.tscn b/DungeonShooting_Godot/scene/Main.tscn index e9ab17e24c30bf548b88e2531890ad72c4eb2a15..b034a254595e03c6cece73e7d1dfdfb82ba42219 100644 --- a/DungeonShooting_Godot/scene/Main.tscn +++ b/DungeonShooting_Godot/scene/Main.tscn @@ -46,7 +46,6 @@ render_target_update_mode = 4 [node name="SceneRoot" type="Node2D" parent="ViewCanvas/SubViewportContainer/SubViewport"] [node name="Camera2D" type="Camera2D" parent="ViewCanvas/SubViewportContainer/SubViewport"] -position = Vector2(253, 219) process_callback = 0 limit_smoothed = true editor_draw_drag_margin = true diff --git a/DungeonShooting_Godot/scene/World.tscn b/DungeonShooting_Godot/scene/World.tscn index 2be89e780848babc662e138b30936ba8213336a5..23a0ef2392d7b02a569304252b2c0be088ba966f 100644 --- a/DungeonShooting_Godot/scene/World.tscn +++ b/DungeonShooting_Godot/scene/World.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bqf2vks5ggnsp"] [ext_resource type="Script" path="res://src/game/room/World.cs" id="1_kt3mm"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_p6iui"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="2_p6iui"] [node name="World" type="Node2D" node_paths=PackedStringArray("NormalLayer", "YSortLayer", "TileRoot", "StaticSpriteRoot", "AffiliationAreaRoot")] script = ExtResource("1_kt3mm") diff --git a/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn b/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn index 00086dea2e17ac863a9503b2d973b0f059ce4853..357fb1833b4b8197204d587fa5bda5a3be882732 100644 --- a/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn +++ b/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn @@ -1,6 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://dr72ij0rwlafo"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_oisp3"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_oisp3"] + [sub_resource type="CircleShape2D" id="CircleShape2D_wsquq"] diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_ActivityObject.cs b/DungeonShooting_Godot/src/config/ExcelConfig_ActivityObject.cs index 9234b196019a386eccb9f07696c1dedb1f5612f6..1d3dbe44a3ef2e245222c196190d84f31e8fd826 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_ActivityObject.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_ActivityObject.cs @@ -35,10 +35,18 @@ public static partial class ExcelConfig public string Name; /// - /// 物体备注 + /// 物体简介
+ /// 一句对物体简短的介绍, 比如拾起物体时弹出的描述 ///
[JsonInclude] - public string Remark; + public string Intro; + + /// + /// 物体详情
+ /// 在图鉴中的描述 + ///
+ [JsonInclude] + public string Details; /// /// 物体预制场景路径, 场景根节点必须是ActivityObject子类 @@ -46,6 +54,19 @@ public static partial class ExcelConfig [JsonInclude] public string Prefab; + /// + /// 物体图标
+ /// 如果不需要在图鉴或者地图编辑器中显示该物体, 则可以不用设置 + ///
+ [JsonInclude] + public string Icon; + + /// + /// 是否在地图编辑器中显示该物体 + /// + [JsonInclude] + public bool ShowInMapEditor; + /// /// 返回浅拷贝出的新对象 /// @@ -55,8 +76,11 @@ public static partial class ExcelConfig inst.Id = Id; inst.Type = Type; inst.Name = Name; - inst.Remark = Remark; + inst.Intro = Intro; + inst.Details = Details; inst.Prefab = Prefab; + inst.Icon = Icon; + inst.ShowInMapEditor = ShowInMapEditor; return inst; } } diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs index 22bf39092008dcb3a589e24f75b9e691fd628d03..7c87cefd76b7d8b287ab37d195c79e7cec186beb 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs @@ -25,12 +25,6 @@ public static partial class ExcelConfig [JsonInclude] public string Remark; - /// - /// 武器的图标 - /// - [JsonInclude] - public string Icon; - /// /// 重量 /// @@ -428,7 +422,6 @@ public static partial class ExcelConfig inst.Id = Id; inst.WeaponId = WeaponId; inst.Remark = Remark; - inst.Icon = Icon; inst.Weight = Weight; inst.WeightType = WeightType; inst.ContinuousShoot = ContinuousShoot; diff --git a/DungeonShooting_Godot/src/framework/Grid.cs b/DungeonShooting_Godot/src/framework/Grid.cs index 2647d346b775b274d951a607c98c980dd073d4a5..ec37b93688a7a927445dc2824a7e7dd5eb0e7f23 100644 --- a/DungeonShooting_Godot/src/framework/Grid.cs +++ b/DungeonShooting_Godot/src/framework/Grid.cs @@ -1,5 +1,4 @@ -using System; using System.Collections.Generic; using Godot; @@ -27,6 +26,14 @@ public class Grid return false; } + + /// + /// 返回指定xy位置是否有数据 + /// + public bool Contains(Vector2I pos) + { + return Contains(pos.X, pos.Y); + } /// /// 设置指定xy位置的数据 @@ -45,6 +52,14 @@ public class Grid } } + /// + /// 设置指定坐标的数据 + /// + public void Set(Vector2I pos, T data) + { + Set(pos.X, pos.Y, data); + } + /// /// 获取指定xy位置的数据 /// @@ -52,11 +67,35 @@ public class Grid { if (_map.TryGetValue(x, out var value)) { - return value[y]; + if (value.TryGetValue(y, out var v)) + { + return v; + } } return default; } + + /// + /// 获取指定坐标的数据 + /// + public T Get(Vector2I pos) + { + return Get(pos.X, pos.Y); + } + + /// + /// 移除指定xy位置存储的数据 + /// + public bool Remove(int x, int y) + { + if (_map.TryGetValue(x, out var value)) + { + return value.Remove(y); + } + + return false; + } /// /// 往一个区域中填充指定的数据 @@ -64,10 +103,10 @@ public class Grid /// 起点位置 /// 区域大小 /// 数据 - public void AddRect(Vector2 pos, Vector2 size, T data) + public void SetRect(Vector2I pos, Vector2I size, T data) { - var x = (int)pos.X; - var y = (int)pos.Y; + var x = pos.X; + var y = pos.Y; for (var i = 0; i < size.X; i++) { for (var j = 0; j < size.Y; j++) @@ -91,10 +130,10 @@ public class Grid /// /// 起点位置 /// 区域大小 - public void RemoveRect(Vector2 pos, Vector2 size) + public void RemoveRect(Vector2I pos, Vector2I size) { - var x = (int)pos.X; - var y = (int)pos.Y; + var x = pos.X; + var y = pos.Y; for (var i = 0; i < size.X; i++) { for (var j = 0; j < size.Y; j++) @@ -124,12 +163,12 @@ public class Grid /// /// 起点位置 /// 区域大小 - public bool RectCollision(Vector2 pos, Vector2 size) + public bool RectCollision(Vector2I pos, Vector2I size) { - var x = (int)pos.X; - var y = (int)pos.Y; - var w = (int)size.X; - var h = (int)size.Y; + var x = pos.X; + var y = pos.Y; + var w = size.X; + var h = size.Y; //先判断四个角 if (Contains(x, y) || Contains(x + w - 1, y) || Contains(x, y + h - 1) || Contains(x + w - 1, y + h - 1)) { diff --git a/DungeonShooting_Godot/src/framework/IData.cs b/DungeonShooting_Godot/src/framework/IData.cs new file mode 100644 index 0000000000000000000000000000000000000000..b74f0c9c45a59220ad5e4587cf441c4375dacfa3 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/IData.cs @@ -0,0 +1,8 @@ + +/// +/// 数据接口 +/// +public interface IData +{ + T Data { get; } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/ActivityIdPrefix.cs b/DungeonShooting_Godot/src/framework/activity/ActivityId.cs similarity index 42% rename from DungeonShooting_Godot/src/game/manager/ActivityIdPrefix.cs rename to DungeonShooting_Godot/src/framework/activity/ActivityId.cs index 6c3d9498570e0a1b8f525e7b3217aad54300a7aa..f4232b567a995ace95934b252b295ec7a3761d41 100644 --- a/DungeonShooting_Godot/src/game/manager/ActivityIdPrefix.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityId.cs @@ -1,55 +1,9 @@  -//Activity注册类id前缀 -public static class ActivityIdPrefix +/// +/// Activity注册类id前缀 +/// +public static class ActivityId { - public enum ActivityPrefixType - { - /// - /// 无前缀 - /// - NonePrefix, - /// - /// 玩家 - /// - Player, - /// - /// 测试对象 - /// - Test, - /// - /// 角色 - /// - Role, - /// - /// 敌人 - /// - Enemy, - /// - /// 武器 - /// - Weapon, - /// - /// 子弹 - /// - Bullet, - /// - /// 弹壳 - /// - Shell, - /// - /// 特效 - /// - Effect, - /// - /// 道具 - /// - Prop, - /// - /// 其它类型 - /// - Other = 99, - } - /// /// 测试单位 /// @@ -88,35 +42,65 @@ public static class ActivityIdPrefix public const string Other = "other"; /// - /// 根据 ActivityPrefixType 中的枚举类型获取类型名称的字符串 + /// 根据 ActivityType 中的枚举类型获取类型名称的字符串 /// - public static string GetNameByPrefixType(ActivityPrefixType prefixType) + public static string GetIdPrefix(ActivityType activityType) { - switch (prefixType) + switch (activityType) { - case ActivityPrefixType.NonePrefix: + case ActivityType.None: return ""; - case ActivityPrefixType.Test: + case ActivityType.Test: return Test; - case ActivityPrefixType.Role: - case ActivityPrefixType.Player: + case ActivityType.Role: + case ActivityType.Player: return Role; - case ActivityPrefixType.Enemy: + case ActivityType.Enemy: return Enemy; - case ActivityPrefixType.Weapon: + case ActivityType.Weapon: return Weapon; - case ActivityPrefixType.Bullet: + case ActivityType.Bullet: return Bullet; - case ActivityPrefixType.Shell: + case ActivityType.Shell: return Shell; - case ActivityPrefixType.Effect: + case ActivityType.Effect: return Effect; - case ActivityPrefixType.Prop: + case ActivityType.Prop: return Prop; - case ActivityPrefixType.Other: + case ActivityType.Other: return Other; } return ""; } + + public static string GetTypeName(ActivityType activityType) + { + switch (activityType) + { + case ActivityType.None: + return ""; + case ActivityType.Test: + return "测试"; + case ActivityType.Role: + case ActivityType.Player: + return "角色"; + case ActivityType.Enemy: + return "敌人"; + case ActivityType.Weapon: + return "武器"; + case ActivityType.Bullet: + return "子弹"; + case ActivityType.Shell: + return "弹壳"; + case ActivityType.Effect: + return "特效"; + case ActivityType.Prop: + return "道具"; + case ActivityType.Other: + return "其他"; + } + + return ""; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs index e638ed1f6b86260941624729bf18a13df2754a21..5bfbc5c2924c954ccccbbf4b24474095484317c5 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs @@ -7,10 +7,10 @@ using Godot; /// /// 房间内活动物体基类, 所有物体都必须继承该类,
-/// ActivityObject 使用的时候代码和场景分离的设计模式, 所以创建时必须指定模板场景路径, 这样做的好处是一个模板场景可以用在多个代码类上, 同样一个代码类也可以指定不同的目模板场景,
+/// 该类提供基础物体运动模拟, 互动接口, 自定义组件, 协程等功能
/// ActivityObject 子类实例化请不要直接使用 new, 而用该在类上标上 [Tool], 并在 ActivityObject.xlsx 配置文件中注册物体, 导出配置表后使用 ActivityObject.Create(id) 来创建实例.
///
-public abstract partial class ActivityObject : CharacterBody2D, IDestroy +public abstract partial class ActivityObject : CharacterBody2D, IDestroy, ICoroutine { /// /// 是否是调试模式 @@ -28,6 +28,11 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy [Export] public bool IsStatic { get; set; } + /// + /// 是否显示阴影 + /// + public bool IsShowShadow { get; private set; } + /// /// 当前物体显示的阴影图像, 节点名称必须叫 "ShadowSprite", 类型为 Sprite2D /// @@ -94,10 +99,11 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy { if (value != _affiliationArea) { + var prev = _affiliationArea; _affiliationArea = value; if (!IsDestroyed) { - OnAffiliationChange(); + OnAffiliationChange(prev); } } } @@ -398,7 +404,7 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy } /// - /// 显示阴影 + /// 显示并更新阴影 /// public void ShowShadowSprite() { @@ -418,6 +424,7 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy _prevAnimation = anim; _prevAnimationFrame = frame; + IsShowShadow = true; CalcShadow(); ShadowSprite.Visible = true; } @@ -428,6 +435,7 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy public void HideShadowSprite() { ShadowSprite.Visible = false; + IsShowShadow = false; } /// @@ -591,7 +599,8 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy /// /// 归属区域发生改变 /// - protected virtual void OnAffiliationChange() + /// 上一个区域, 注意可能为空 + protected virtual void OnAffiliationChange(AffiliationArea prevArea) { } @@ -1172,15 +1181,10 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy OnDestroy(); var arr = _components.ToArray(); - for (int i = 0; i < arr.Length; i++) + for (var i = 0; i < arr.Length; i++) { arr[i].Value?.Destroy(); } - - if (AffiliationArea != null) - { - AffiliationArea.RemoveItem(this); - } } /// @@ -1194,6 +1198,8 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy /// /// 继承指定物体的运动速率 /// + /// 目标对象 + /// 继承的速率缩放 public void InheritVelocity(ActivityObject other, float scale = 0.5f) { MoveController.AddVelocity(other.Velocity * scale); @@ -1403,85 +1409,25 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy _playHit = true; _playHitSchedule = 0; } - - /// - /// 开启一个协程, 返回协程 id, 协程是在普通帧执行的, 支持: 协程嵌套, WaitForSeconds, WaitForFixedProcess, Task, SignalAwaiter - /// + public long StartCoroutine(IEnumerator able) { return ProxyCoroutineHandler.ProxyStartCoroutine(ref _coroutineList, able); } - - /// - /// 根据协程 id 停止协程 - /// + public void StopCoroutine(long coroutineId) { ProxyCoroutineHandler.ProxyStopCoroutine(ref _coroutineList, coroutineId); } - - /// - /// 停止所有协程 - /// - public void StopAllCoroutine() - { - ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); - } - /// - /// 延时指定时间调用一个回调函数 - /// - public void CallDelay(float delayTime, Action cb) + public bool IsCoroutineOver(long coroutineId) { - StartCoroutine(_CallDelay(delayTime, cb)); - } - - /// - /// 延时指定时间调用一个回调函数 - /// - public void CallDelay(float delayTime, Action cb, T1 arg1) - { - StartCoroutine(_CallDelay(delayTime, cb, arg1)); - } - - /// - /// 延时指定时间调用一个回调函数 - /// - public void CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2) - { - StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2)); - } - - /// - /// 延时指定时间调用一个回调函数 - /// - public void CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2, T3 arg3) - { - StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2, arg3)); + return ProxyCoroutineHandler.ProxyIsCoroutineOver(ref _coroutineList, coroutineId); } - private IEnumerator _CallDelay(float delayTime, Action cb) - { - yield return new WaitForSeconds(delayTime); - cb(); - } - - private IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1) - { - yield return new WaitForSeconds(delayTime); - cb(arg1); - } - - private IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2) - { - yield return new WaitForSeconds(delayTime); - cb(arg1, arg2); - } - - private IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2, T3 arg3) + public void StopAllCoroutine() { - yield return new WaitForSeconds(delayTime); - cb(arg1,arg2, arg3); + ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); } /// @@ -1490,23 +1436,23 @@ public abstract partial class ActivityObject : CharacterBody2D, IDestroy /// public void BecomesStaticImage() { - if (AffiliationArea == null) + if (_processingBecomesStaticImage) { - GD.PrintErr($"调用函数: BecomesStaticImage() 失败, 物体{Name}没有归属区域, 无法确定绘制到哪个ImageCanvas上, 直接执行销毁"); - Destroy(); return; } - - if (_processingBecomesStaticImage) + + if (AffiliationArea == null) { + GD.PrintErr($"调用函数: BecomesStaticImage() 失败, 物体{Name}没有归属区域, 无法确定绘制到哪个ImageCanvas上, 直接执行销毁"); + Destroy(); return; } _processingBecomesStaticImage = true; EnableBehavior = false; var staticImageCanvas = AffiliationArea.RoomInfo.StaticImageCanvas; - var (x, y) = staticImageCanvas.ToImageCanvasPosition(GlobalPosition); - staticImageCanvas.CanvasSprite.DrawActivityObjectInCanvas(this, x, y, () => + var position = staticImageCanvas.ToImageCanvasPosition(GlobalPosition); + staticImageCanvas.CanvasSprite.DrawActivityObjectInCanvas(this, position.X, position.Y, () => { Destroy(); }); diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs index 72e6d35c5be8c8f5a8e98309b4656a92c7dd710c..a94b1459d7a93ebc92340f046cd2c6da111dad5b 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject_Init.cs @@ -11,163 +11,163 @@ public partial class ActivityObject public static class Ids { /// - /// 名称:
- /// 备注: 玩家 + /// 名称: 玩家
+ /// 简介: 玩家 ///
public const string Id_role0001 = "role0001"; /// - /// 名称:
- /// 备注: 敌人 + /// 名称: 敌人
+ /// 简介: 敌人 ///
public const string Id_enemy0001 = "enemy0001"; /// /// 名称: 步枪
- /// 备注: + /// 简介: ///
public const string Id_weapon0001 = "weapon0001"; /// /// 名称: 霰弹枪
- /// 备注: + /// 简介: ///
public const string Id_weapon0002 = "weapon0002"; /// /// 名称: 手枪
- /// 备注: + /// 简介: ///
public const string Id_weapon0003 = "weapon0003"; /// /// 名称: 刀
- /// 备注: + /// 简介: ///
public const string Id_weapon0004 = "weapon0004"; /// /// 名称: 狙击枪
- /// 备注: + /// 简介: ///
public const string Id_weapon0005 = "weapon0005"; /// /// 名称: 冲锋枪
- /// 备注: + /// 简介: ///
public const string Id_weapon0006 = "weapon0006"; /// /// 名称: 汤姆逊冲锋枪
- /// 备注: + /// 简介: ///
public const string Id_weapon0007 = "weapon0007"; /// /// 名称:
- /// 备注: + /// 简介: ///
public const string Id_bullet0001 = "bullet0001"; /// /// 名称:
- /// 备注: + /// 简介: ///
public const string Id_bullet0002 = "bullet0002"; /// /// 名称:
- /// 备注: + /// 简介: ///
public const string Id_bullet0003 = "bullet0003"; /// /// 名称:
- /// 备注: + /// 简介: ///
public const string Id_shell0001 = "shell0001"; /// /// 名称:
- /// 备注: + /// 简介: ///
public const string Id_shell0002 = "shell0002"; /// /// 名称:
- /// 备注: + /// 简介: ///
public const string Id_shell0003 = "shell0003"; /// /// 名称:
- /// 备注: 敌人死亡碎片 + /// 简介: 敌人死亡碎片 ///
public const string Id_effect0001 = "effect0001"; /// /// 名称: 鞋子
- /// 备注: 提高移动速度 + /// 简介: 提高移动速度 ///
public const string Id_prop0001 = "prop0001"; /// /// 名称: 心之容器
- /// 备注: 提高血量上限 + /// 简介: 提高血量上限 ///
public const string Id_prop0002 = "prop0002"; /// /// 名称: 护盾
- /// 备注: 可以抵挡子弹,随时间推移自动恢复 + /// 简介: 可以抵挡子弹,随时间推移自动恢复 ///
public const string Id_prop0003 = "prop0003"; /// /// 名称: 护盾计时器
- /// 备注: 提高护盾恢复速度 + /// 简介: 提高护盾恢复速度 ///
public const string Id_prop0004 = "prop0004"; /// /// 名称: 杀伤弹
- /// 备注: 提高子弹伤害 + /// 简介: 提高子弹伤害 ///
public const string Id_prop0005 = "prop0005"; /// /// 名称: 红宝石戒指
- /// 备注: 受伤后延长无敌时间 + /// 简介: 受伤后延长无敌时间 ///
public const string Id_prop0006 = "prop0006"; /// /// 名称: 备用护盾
- /// 备注: 受伤时有一定概率抵消伤害 + /// 简介: 受伤时有一定概率抵消伤害 ///
public const string Id_prop0007 = "prop0007"; /// /// 名称: 眼镜
- /// 备注: 提高武器精准度 + /// 简介: 提高武器精准度 ///
public const string Id_prop0008 = "prop0008"; /// /// 名称: 高速子弹
- /// 备注: 提高子弹速度和射程 + /// 简介: 提高子弹速度和射程 ///
public const string Id_prop0009 = "prop0009"; /// /// 名称: 分裂子弹
- /// 备注: 子弹数量翻倍, 但是精准度和伤害降低 + /// 简介: 子弹数量翻倍, 但是精准度和伤害降低 ///
public const string Id_prop0010 = "prop0010"; /// /// 名称: 医药箱
- /// 备注: 使用后回复一颗红心 + /// 简介: 使用后回复一颗红心 ///
public const string Id_prop5000 = "prop5000"; /// /// 名称: 弹药箱
- /// 备注: 使用后补充当前武器备用弹药 + /// 简介: 使用后补充当前武器备用弹药 ///
public const string Id_prop5001 = "prop5001"; /// /// 名称:
- /// 备注: 地牢房间的门(东侧) + /// 简介: 地牢房间的门(东侧) ///
public const string Id_other_door_e = "other_door_e"; /// /// 名称:
- /// 备注: 地牢房间的门(西侧) + /// 简介: 地牢房间的门(西侧) ///
public const string Id_other_door_w = "other_door_w"; /// /// 名称:
- /// 备注: 地牢房间的门(南侧) + /// 简介: 地牢房间的门(南侧) ///
public const string Id_other_door_s = "other_door_s"; /// /// 名称:
- /// 备注: 地牢房间的门(北侧) + /// 简介: 地牢房间的门(北侧) ///
public const string Id_other_door_n = "other_door_n"; } diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityType.cs b/DungeonShooting_Godot/src/framework/activity/ActivityType.cs new file mode 100644 index 0000000000000000000000000000000000000000..3a821498a57df022096bdfceb3f69cd4088689c3 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/activity/ActivityType.cs @@ -0,0 +1,51 @@ + +/// +/// 物体类型 +/// +public enum ActivityType +{ + /// + /// 无类型 + /// + None, + /// + /// 玩家 + /// + Player, + /// + /// 测试对象 + /// + Test, + /// + /// 角色 + /// + Role, + /// + /// 敌人 + /// + Enemy, + /// + /// 武器 + /// + Weapon, + /// + /// 子弹 + /// + Bullet, + /// + /// 弹壳 + /// + Shell, + /// + /// 特效 + /// + Effect, + /// + /// 道具 + /// + Prop, + /// + /// 其它类型 + /// + Other = 99, +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/common/NodeExtend.cs b/DungeonShooting_Godot/src/framework/common/NodeExtend.cs index f9bea2df8d952f7b05a688a6942dde5b46f15118..ebc149fa964b6a60b39a9bfd2c16d7efa21095f5 100644 --- a/DungeonShooting_Godot/src/framework/common/NodeExtend.cs +++ b/DungeonShooting_Godot/src/framework/common/NodeExtend.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using Godot; /// @@ -49,4 +50,117 @@ public static class NodeExtend { GameApplication.Instance.World.GetRoomLayer(layer).AddChild(node); } + + /// + /// 设置Ui布局方式是否横向扩展, 如果为 true, 则 GridContainer 的宽度会撑满父物体 + /// + public static void SetHorizontalExpand(this Control control, bool flag) + { + if (flag) + { + control.SizeFlagsHorizontal |= Control.SizeFlags.Expand; + } + else if ((control.SizeFlagsHorizontal & Control.SizeFlags.Expand) != 0) + { + control.SizeFlagsHorizontal ^= Control.SizeFlags.Expand; + } + } + + /// + /// 获取Ui布局方式是否横向扩展 + /// + public static bool GetHorizontalExpand(this Control control) + { + return (control.SizeFlagsHorizontal & Control.SizeFlags.Expand) != 0; + } + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelay(this ICoroutine coroutine, float delayTime, Action cb) + { + coroutine.StartCoroutine(_CallDelay(delayTime, cb)); + } + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelay(this ICoroutine coroutine, float delayTime, Action cb, T1 arg1) + { + coroutine.StartCoroutine(_CallDelay(delayTime, cb, arg1)); + } + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelay(this ICoroutine coroutine, float delayTime, Action cb, T1 arg1, T2 arg2) + { + coroutine.StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2)); + } + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelay(this ICoroutine coroutine, float delayTime, Action cb, T1 arg1, T2 arg2, T3 arg3) + { + coroutine.StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2, arg3)); + } + + //--------------------------- + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelayInNode(this Node node, float delayTime, Action cb) + { + GameApplication.Instance.StartCoroutine(_CallDelay(delayTime, cb)); + } + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelayInNode(this Node node, float delayTime, Action cb, T1 arg1) + { + GameApplication.Instance.StartCoroutine(_CallDelay(delayTime, cb, arg1)); + } + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelayInNode(this Node node, float delayTime, Action cb, T1 arg1, T2 arg2) + { + GameApplication.Instance.StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2)); + } + + /// + /// 延时指定时间调用一个回调函数 + /// + public static void CallDelayInNode(this Node node, float delayTime, Action cb, T1 arg1, T2 arg2, T3 arg3) + { + GameApplication.Instance.StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2, arg3)); + } + + private static IEnumerator _CallDelay(float delayTime, Action cb) + { + yield return new WaitForSeconds(delayTime); + cb(); + } + + private static IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1) + { + yield return new WaitForSeconds(delayTime); + cb(arg1); + } + + private static IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2) + { + yield return new WaitForSeconds(delayTime); + cb(arg1, arg2); + } + + private static IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2, T3 arg3) + { + yield return new WaitForSeconds(delayTime); + cb(arg1,arg2, arg3); + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/common/SeedRandom.cs b/DungeonShooting_Godot/src/framework/common/SeedRandom.cs new file mode 100644 index 0000000000000000000000000000000000000000..35da3365779c92a344a57a16465e12197fbc6077 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/common/SeedRandom.cs @@ -0,0 +1,175 @@ + +using System; +using System.Collections.Generic; +using Godot; + +/// +/// 随机数类 +/// +public class SeedRandom +{ + /// + /// 种子值 + /// + public int Seed { get; } + + private Random _random; + private static int _staticSeed = 0; + + public SeedRandom(int seed) + { + Seed = seed; + _random = new Random(seed); + } + + public SeedRandom() + { + var dateTime = DateTime.Now; + var num = dateTime.Year * 100000 + dateTime.Month * 100000 + dateTime.Day * 100000 + dateTime.Hour * 10000 + dateTime.Minute * 100 + dateTime.Second; + num += _staticSeed; + _staticSeed += 11111; + Seed = num; + _random = new Random(num); + } + + /// + /// 返回一个随机的double值 + /// + public double RandomDouble() + { + return _random.NextDouble(); + } + + /// + /// 返回随机 boolean 值 + /// + public bool RandomBoolean() + { + return _random.NextSingle() >= 0.5f; + } + /// + /// 指定概率会返回 true, probability 范围 0 - 1 + /// + public bool RandomBoolean(float probability) + { + return _random.NextSingle() <= probability; + } + + /// + /// 返回一个区间内的随机小数 + /// + public float RandomRangeFloat(float min, float max) + { + if (min == max) return min; + if (min > max) + return _random.NextSingle() * (min - max) + max; + return _random.NextSingle() * (max - min) + min; + } + + /// + /// 返回一个区间内的随机整数 + /// + public int RandomRangeInt(int min, int max) + { + if (min == max) return min; + if (min > max) + return Mathf.FloorToInt(_random.NextSingle() * (min - max + 1) + max); + return Mathf.FloorToInt(_random.NextSingle() * (max - min + 1) + min); + } + + /// + /// 随机返回其中一个参数 + /// + public T RandomChoose(params T[] list) + { + if (list.Length == 0) + { + return default; + } + + return list[RandomRangeInt(0, list.Length - 1)]; + } + + /// + /// 随机返回集合中的一个元素 + /// + public T RandomChoose(List list) + { + if (list.Count == 0) + { + return default; + } + + return list[RandomRangeInt(0, list.Count - 1)]; + } + + /// + /// 随机返回集合中的一个元素, 并将其从集合中移除 + /// + public T RandomChooseAndRemove(List list) + { + if (list.Count == 0) + { + return default; + } + + var index = RandomRangeInt(0, list.Count - 1); + var result = list[index]; + list.RemoveAt(index); + return result; + } + + /// + /// 从权重列表中随机抽取下标值 + /// + public int RandomWeight(List weightList) + { + // 计算总权重 + var totalWeight = 0; + foreach (var weight in weightList) + { + totalWeight += weight; + } + + var randomNumber = _random.Next(totalWeight); + var currentWeight = 0; + for (var i = 0; i < weightList.Count; i++) + { + var value = weightList[i]; + currentWeight += value; + if (randomNumber < currentWeight) + { + return i; + } + } + + return RandomRangeInt(0, weightList.Count - 1); + } + + /// + /// 从权重列表中随机抽取下标值 + /// + public int RandomWeight(int[] weightList) + { + // 计算总权重 + var totalWeight = 0; + foreach (var weight in weightList) + { + totalWeight += weight; + } + + var randomNumber = _random.Next(totalWeight); + var currentWeight = 0; + for (var i = 0; i < weightList.Length; i++) + { + var value = weightList[i]; + currentWeight += value; + if (randomNumber < currentWeight) + { + return i; + } + } + + return RandomRangeInt(0, weightList.Length - 1); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/common/Utils.cs b/DungeonShooting_Godot/src/framework/common/Utils.cs index c35931db1031331dc6d0cf930ee4b289ccc2a9ae..ea77986e89a585f9b5032d09180fdae78fd80de7 100644 --- a/DungeonShooting_Godot/src/framework/common/Utils.cs +++ b/DungeonShooting_Godot/src/framework/common/Utils.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Godot; /// @@ -8,132 +7,17 @@ using Godot; /// public static class Utils { - - private static readonly Random _random; - - static Utils() - { - var dateTime = DateTime.Now; - var num = dateTime.Year * 100000 + dateTime.Month * 100000 + dateTime.Day * 100000 + dateTime.Hour * 10000 + dateTime.Minute * 100 + dateTime.Second; - //_random = new Random(204313957); - _random = new Random(num); - GD.Print("随机种子为: ", num); - } - /// - /// 返回一个随机的double值 + /// 默认随机数对象 /// - public static double RandomDouble() - { - return _random.NextDouble(); - } + public static SeedRandom Random { get; } - /// - /// 返回随机 boolean 值 - /// - public static bool RandomBoolean() - { - return _random.NextSingle() >= 0.5f; - } - /// - /// 指定概率会返回 true, probability 范围 0 - 1 - /// - public static bool RandomBoolean(float probability) - { - return _random.NextSingle() <= probability; - } - - /// - /// 返回一个区间内的随机小数 - /// - public static float RandomRangeFloat(float min, float max) - { - if (min == max) return min; - if (min > max) - return _random.NextSingle() * (min - max) + max; - return _random.NextSingle() * (max - min) + min; - } - - /// - /// 返回一个区间内的随机整数 - /// - public static int RandomRangeInt(int min, int max) - { - if (min == max) return min; - if (min > max) - return Mathf.FloorToInt(_random.NextSingle() * (min - max + 1) + max); - return Mathf.FloorToInt(_random.NextSingle() * (max - min + 1) + min); - } - - /// - /// 随机返回其中一个参数 - /// - public static T RandomChoose(params T[] list) - { - if (list.Length == 0) - { - return default; - } - - return list[RandomRangeInt(0, list.Length - 1)]; - } - - /// - /// 随机返回集合中的一个元素 - /// - public static T RandomChoose(List list) - { - if (list.Count == 0) - { - return default; - } - - return list[RandomRangeInt(0, list.Count - 1)]; - } - - /// - /// 随机返回集合中的一个元素, 并将其从集合中移除 - /// - public static T RandomChooseAndRemove(List list) + static Utils() { - if (list.Count == 0) - { - return default; - } - - var index = RandomRangeInt(0, list.Count - 1); - var result = list[index]; - list.RemoveAt(index); - return result; + Random = new SeedRandom(); + GD.Print("随机种子为: ", Random.Seed); } - /// - /// 从权重列表中随机抽取下标值 - /// - public static int RandomWeight(List weightList) - { - // 计算总权重 - var totalWeight = 0; - foreach (var weight in weightList) - { - totalWeight += weight; - } - - var randomNumber = _random.Next(totalWeight); - var currentWeight = 0; - for (var i = 0; i < weightList.Count; i++) - { - var value = weightList[i]; - currentWeight += value; - if (randomNumber < currentWeight) - { - return i; - } - } - - return RandomRangeInt(0, weightList.Count - 1); - } - /// /// 根据四个点计算出矩形 /// @@ -156,22 +40,28 @@ public static class Utils /// /// 使用定的 canvasItem 绘制导航区域, 注意, 该函数只能在 draw 函数中调用 /// - public static void DrawNavigationPolygon(CanvasItem canvasItem, NavigationPolygonData[] polygonData, int width = 1) + public static void DrawNavigationPolygon(CanvasItem canvasItem, NavigationPolygonData[] polygonData, float width = 1) { for (var i = 0; i < polygonData.Length; i++) { var item = polygonData[i]; - if (item.Points.Count >= 2) + var points = item.GetPoints(); + if (points.Length>= 2) { - var array = item.ConvertPointsToVector2Array().ToList(); - array.Add(array[0]); + var array = new Vector2[points.Length + 1]; + for (var j = 0; j < points.Length; j++) + { + array[j] = points[j]; + } + + array[array.Length - 1] = points[0]; if (item.Type == NavigationPolygonType.In) { - canvasItem.DrawPolyline(array.ToArray(), Colors.Yellow, width); + canvasItem.DrawPolyline(array, Colors.Orange, width); } else { - canvasItem.DrawPolyline(array.ToArray(), Colors.Red, width); + canvasItem.DrawPolyline(array, Colors.Orange, width); } } } @@ -191,6 +81,52 @@ public static class Utils return angle; } + + /// + /// 根据步长吸附值 + /// + /// 原数值 + /// 吸附步长 + public static float Adsorption(float value, float step) + { + var f = Mathf.Round(value / step); + return f * step; + } + + /// + /// 根据步长吸附值 + /// + /// 原数值 + /// 吸附步长 + public static int Adsorption(float value, int step) + { + var f = Mathf.RoundToInt(value / step); + return f * step; + } + + /// + /// 根据步长吸附值 + /// + /// 原数值 + /// 吸附步长 + public static Vector2 Adsorption(Vector2 value, Vector2 step) + { + var x = Mathf.Round(value.X / step.X); + var y = Mathf.Round(value.Y / step.Y); + return new Vector2(x * step.X, y * step.Y); + } + + /// + /// 根据步长吸附值 + /// + /// 原数值 + /// 吸附步长 + public static Vector2I Adsorption(Vector2 value, Vector2I step) + { + var x = Mathf.RoundToInt(value.X / step.X); + var y = Mathf.RoundToInt(value.Y / step.Y); + return new Vector2I(x * step.X, y * step.Y); + } /// /// 字符串首字母小写 @@ -207,4 +143,32 @@ public static class Utils { return str.Substring(0, 1).ToUpper() + str.Substring(1); } + + /// + /// 将 Vector2 类型转为 Vector2I 类型 + /// + public static Vector2I AsVector2I(this Vector2 vector2) + { + return new Vector2I((int)vector2.X, (int)vector2.Y); + } + + /// + /// 返回指定坐标是否在UI节范围点内 + /// + public static bool IsPositionOver(this Control control, Vector2 position) + { + var globalPosition = control.GlobalPosition; + var size = control.Size * control.Scale; + return position.X >= globalPosition.X && position.X <= (globalPosition.X + size.X) && + position.Y >= globalPosition.Y && position.Y <= (globalPosition.Y + size.Y); + } + + /// + /// 判断点是否在区域内 + /// + public static bool IsPositionInRect(Vector2 pos, Rect2 rect2) + { + return pos.X >= rect2.Position.X && pos.X <= rect2.Position.X + rect2.Size.X && + pos.Y >= rect2.Position.Y && pos.Y <= rect2.Position.Y + rect2.Size.Y; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/common/WeightRandom.cs b/DungeonShooting_Godot/src/framework/common/WeightRandom.cs index f0c7511f53bc33a4dbced119dbeb85056f2a216f..2c432cc50e6a19dc192b64162fc74f055b0058dd 100644 --- a/DungeonShooting_Godot/src/framework/common/WeightRandom.cs +++ b/DungeonShooting_Godot/src/framework/common/WeightRandom.cs @@ -8,7 +8,13 @@ using System.Linq; public class WeightRandom { private (float, int)[] _prepareAdRewardWeight; + private SeedRandom _random; + public WeightRandom(SeedRandom random) + { + _random = random; + } + /// /// 初始化权重列表 /// @@ -59,7 +65,7 @@ public class WeightRandom /// public int GetRandomIndex() { - var randomNum = Utils.RandomDouble() * _prepareAdRewardWeight.Length; + var randomNum = _random.RandomDouble() * _prepareAdRewardWeight.Length; var intRan = (int)Math.Floor(randomNum); var p = _prepareAdRewardWeight[intRan]; if (p.Item1 > randomNum - intRan) diff --git a/DungeonShooting_Godot/src/framework/coroutine/ICoroutine.cs b/DungeonShooting_Godot/src/framework/coroutine/ICoroutine.cs new file mode 100644 index 0000000000000000000000000000000000000000..d5fe7725c8e14cd02d8545a10741bf703410c986 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/coroutine/ICoroutine.cs @@ -0,0 +1,28 @@ + +using System.Collections; + +/// +/// 协程基础功能接口 +/// +public interface ICoroutine +{ + /// + /// 开启一个协程, 返回协程 id, 协程是在普通帧执行的, 支持: 协程嵌套, WaitForSeconds, WaitForFixedProcess, Task, SignalAwaiter + /// + public long StartCoroutine(IEnumerator able); + + /// + /// 根据协程 id 停止协程 + /// + public void StopCoroutine(long coroutineId); + + /// + /// 根据协程 id 判断该协程是否结束 + /// + public bool IsCoroutineOver(long coroutineId); + + /// + /// 停止所有协程 + /// + public void StopAllCoroutine(); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs b/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs index 1e1c6b7517ff639311b652a5027ea8682cc7f789..5592d761a543347aa306eff3d1b05018faf8e1bd 100644 --- a/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs +++ b/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs @@ -1,4 +1,5 @@  +using System; using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; @@ -18,111 +19,119 @@ public static class ProxyCoroutineHandler for (var i = 0; i < pairs.Length; i++) { var item = pairs[i]; - var canNext = true; - - if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForSeconds) //等待秒数 - { - if (!item.WaitForSeconds.NextStep(delta)) - { - canNext = false; - } - else - { - item.WaitState = CoroutineData.WaitTypeEnum.None; - item.WaitForSeconds = null; - } - } - else if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForFixedProcess) //等待帧数 - { - if (!item.WaitForFixedProcess.NextStep()) - { - canNext = false; - } - else - { - item.WaitState = CoroutineData.WaitTypeEnum.None; - item.WaitForFixedProcess = null; - } - } - else if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForTask) //等待Task - { - if (!item.WaitTask.IsCompleted) - { - canNext = false; - } - else - { - item.WaitState = CoroutineData.WaitTypeEnum.None; - item.WaitTask = null; - } - } - else if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForSignalAwaiter) //等待信号 + try { - if (!item.WaitSignalAwaiter.IsCompleted) - { - canNext = false; - } - else + var canNext = true; + + if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForSeconds) //等待秒数 { - item.WaitState = CoroutineData.WaitTypeEnum.None; - item.WaitSignalAwaiter = null; + if (!item.WaitForSeconds.NextStep(delta)) + { + canNext = false; + } + else + { + item.WaitState = CoroutineData.WaitTypeEnum.None; + item.WaitForSeconds = null; + } } - } - - if (canNext) - { - if (item.Enumerator.MoveNext()) //嵌套协程 + else if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForFixedProcess) //等待帧数 { - var next = item.Enumerator.Current; - if (next is IEnumerable enumerable) + if (!item.WaitForFixedProcess.NextStep()) { - if (item.EnumeratorStack == null) - { - item.EnumeratorStack = new Stack(); - } - - item.EnumeratorStack.Push(item.Enumerator); - item.Enumerator = enumerable.GetEnumerator(); + canNext = false; } - else if (next is IEnumerator enumerator) + else { - if (item.EnumeratorStack == null) - { - item.EnumeratorStack = new Stack(); - } - - item.EnumeratorStack.Push(item.Enumerator); - item.Enumerator = enumerator; + item.WaitState = CoroutineData.WaitTypeEnum.None; + item.WaitForFixedProcess = null; } - else if (next is WaitForSeconds seconds) //等待秒数 + } + else if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForTask) //等待Task + { + if (!item.WaitTask.IsCompleted) { - item.WaitFor(seconds); + canNext = false; } - else if (next is WaitForFixedProcess process) //等待帧数 + else { - item.WaitFor(process); + item.WaitState = CoroutineData.WaitTypeEnum.None; + item.WaitTask = null; } - else if (next is Task task) //Task对象 + } + else if (item.WaitState == CoroutineData.WaitTypeEnum.WaitForSignalAwaiter) //等待信号 + { + if (!item.WaitSignalAwaiter.IsCompleted) { - item.WaitFor(task); + canNext = false; } - else if (next is SignalAwaiter awaiter) //等待信号 + else { - item.WaitFor(awaiter); + item.WaitState = CoroutineData.WaitTypeEnum.None; + item.WaitSignalAwaiter = null; } } - else + + if (canNext) { - if (item.EnumeratorStack == null || item.EnumeratorStack.Count == 0) + if (item.Enumerator.MoveNext()) { - ProxyStopCoroutine(ref coroutineList, item.Id); + var next = item.Enumerator.Current; + if (next is IEnumerable enumerable) //嵌套协程 + { + if (item.EnumeratorStack == null) + { + item.EnumeratorStack = new Stack(); + } + + item.EnumeratorStack.Push(item.Enumerator); + item.Enumerator = enumerable.GetEnumerator(); + } + else if (next is IEnumerator enumerator) //嵌套协程 + { + if (item.EnumeratorStack == null) + { + item.EnumeratorStack = new Stack(); + } + + item.EnumeratorStack.Push(item.Enumerator); + item.Enumerator = enumerator; + } + else if (next is WaitForSeconds seconds) //等待秒数 + { + item.WaitFor(seconds); + } + else if (next is WaitForFixedProcess process) //等待帧数 + { + item.WaitFor(process); + } + else if (next is Task task) //Task对象 + { + item.WaitFor(task); + } + else if (next is SignalAwaiter awaiter) //等待信号 + { + item.WaitFor(awaiter); + } } else { - item.Enumerator = item.EnumeratorStack.Pop(); + if (item.EnumeratorStack == null || item.EnumeratorStack.Count == 0) + { + ProxyStopCoroutine(ref coroutineList, item.Id); + } + else + { + item.Enumerator = item.EnumeratorStack.Pop(); + } } } } + catch (Exception e) + { + GD.PrintErr("执行协程发生异常: \n" + e); + ProxyStopCoroutine(ref coroutineList, item.Id); + } } } @@ -159,6 +168,26 @@ public static class ProxyCoroutineHandler } } } + + /// + /// 代理协程, 根据 id 返回指定协程是否结束 + /// + public static bool ProxyIsCoroutineOver(ref List coroutineList, long coroutineId) + { + if (coroutineList != null) + { + for (var i = 0; i < coroutineList.Count; i++) + { + var item = coroutineList[i]; + if (item.Id == coroutineId) + { + return false; + } + } + } + + return true; + } /// /// 代理协程, 停止所有协程 diff --git a/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs b/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs index 73409c4bbfb9dc137575e13a13e65323b6c4c772..e7d8da2deff5fa7a96883424c830cbcf284d94e5 100644 --- a/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs +++ b/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs @@ -86,145 +86,145 @@ public static class DungeonRoomGenerator /// public static bool GenerateRoomConfig() { - try - { - //地图路径 - var tileDir = GameConfig.RoomTileDir; - //地图描述数据路径 - var tileDataDir = GameConfig.RoomTileDataDir; - - var tileGroup = new DirectoryInfo(tileDir).GetDirectories(); - var tileDataGroup = new DirectoryInfo(tileDataDir).GetDirectories(); - - //所有地图列表 - var map = new Dictionary(); - - //地图场景 - foreach (var groupDir in tileGroup) - { - var groupName = groupDir.Name; - var typeDirArray = groupDir.GetDirectories(); - //遍历枚举, 获取指定路径文件 - foreach (DungeonRoomType roomType in Enum.GetValues(typeof(DungeonRoomType))) - { - var typeName = DungeonRoomTemplate.DungeonRoomTypeToString(roomType); - - //收集所有文件名称 - var tempFileDataInfos = typeDirArray.FirstOrDefault(dirInfo => dirInfo.Name == typeName); - if (tempFileDataInfos != null) - { - foreach (var fileInfo in tempFileDataInfos.GetFiles()) - { - if (fileInfo.Extension == ".tscn") - { - var pathInfo = new FileInfo(groupName, roomType, typeName, RemoveExtension(fileInfo.Name)); - map.TryAdd(pathInfo.GetPath(), pathInfo); - } - } - } - } - } - - //地图配置数据 - foreach (var groupDir in tileDataGroup) - { - var groupName = groupDir.Name; - var typeDirArray = groupDir.GetDirectories(); - //遍历枚举, 获取指定路径文件 - foreach (DungeonRoomType roomType in Enum.GetValues(typeof(DungeonRoomType))) - { - var typeName = DungeonRoomTemplate.DungeonRoomTypeToString(roomType); - - //收集所有文件名称 - var tempFileDataInfos = typeDirArray.FirstOrDefault(dirInfo => dirInfo.Name == typeName); - if (tempFileDataInfos != null) - { - foreach (var fileInfo in tempFileDataInfos.GetFiles()) - { - if (fileInfo.Extension == ".json") - { - var pathInfo = new FileInfo(groupName, roomType, typeName, RemoveExtension(fileInfo.Name)); - map.TryAdd(pathInfo.GetPath(), pathInfo); - } - } - } - } - } - - //剔除多余的 tile.json - foreach (var item in map) - { - var path = item.Key; - if (!File.Exists(tileDir + path + ".tscn")) - { - map.Remove(path); - var filePath = tileDataDir + path + ".json"; - if (File.Exists(filePath)) - { - GD.Print($"未找到'{tileDir + path}.tscn', 删除配置文件: {filePath}"); - File.Delete(filePath); - } - } - } - - //手动生成缺失的 tile.json - foreach (var item in map) - { - if (!File.Exists(tileDataDir + item.Key + ".json")) - { - var tscnName = tileDir + item.Key + ".tscn"; - var packedScene = ResourceManager.Load(tscnName, false); - if (packedScene != null) - { - var dungeonRoomTemplate = packedScene.Instantiate(); - var usedRect = dungeonRoomTemplate.GetUsedRect(); - var dungeonTile = new DungeonTile(dungeonRoomTemplate); - dungeonTile.SetFloorAtlasCoords(new List() { new Vector2I(0, 8) }); - //计算导航网格 - dungeonTile.GenerateNavigationPolygon(0); - var polygonData = dungeonTile.GetPolygonData(); - - DungeonRoomTemplate.SaveConfig(new List(), usedRect.Position, usedRect.Size, polygonData.ToList(), - item.Value.GroupName, item.Value.RoomType, item.Value.FileName, dungeonRoomTemplate.Weight); - dungeonRoomTemplate.QueueFree(); - } - } - } - - var roomGroupMap = new Dictionary(); - //var list = new List(); - //整合操作 - foreach (var item in map) - { - var path = item.Key; - var configPath = tileDataDir + path + ".json"; - var split = new DungeonRoomSplit(); - split.ScenePath = ToResPath(tileDir + path + ".tscn"); - split.ConfigPath = ToResPath(configPath); - - if (!roomGroupMap.TryGetValue(item.Value.GroupName, out var group)) - { - group = new DungeonRoomGroup(); - group.GroupName = item.Value.GroupName; - roomGroupMap.Add(group.GroupName, group); - } - - group.GetRoomList(item.Value.RoomType).Add(split); - } - - //写出配置 - var config = new JsonSerializerOptions(); - config.WriteIndented = true; - var text = JsonSerializer.Serialize(roomGroupMap, config); - File.WriteAllText(GameConfig.RoomTileConfigFile, text); - - GD.Print("地牢房间配置, 重新打包完成!"); - } - catch (Exception e) - { - GD.PrintErr(e.ToString()); - return false; - } + GD.Print("生成RoomConfig.json流程得改"); + // try + // { + // //地图路径 + // var tileDir = GameConfig.RoomTileDir; + // //地图描述数据路径 + // var tileDataDir = GameConfig.RoomTileDataDir; + // + // var tileGroup = new DirectoryInfo(tileDir).GetDirectories(); + // var tileDataGroup = new DirectoryInfo(tileDataDir).GetDirectories(); + // + // //所有地图列表 + // var map = new Dictionary(); + // + // //地图场景 + // foreach (var groupDir in tileGroup) + // { + // var groupName = groupDir.Name; + // var typeDirArray = groupDir.GetDirectories(); + // //遍历枚举, 获取指定路径文件 + // foreach (DungeonRoomType roomType in Enum.GetValues(typeof(DungeonRoomType))) + // { + // var typeName = DungeonManager.DungeonRoomTypeToString(roomType); + // + // //收集所有文件名称 + // var tempFileDataInfos = typeDirArray.FirstOrDefault(dirInfo => dirInfo.Name == typeName); + // if (tempFileDataInfos != null) + // { + // foreach (var fileInfo in tempFileDataInfos.GetFiles()) + // { + // if (fileInfo.Extension == ".tscn") + // { + // var pathInfo = new FileInfo(groupName, roomType, typeName, ResourceManager.RemoveExtension(fileInfo.Name)); + // map.TryAdd(pathInfo.GetPath(), pathInfo); + // } + // } + // } + // } + // } + // + // //地图配置数据 + // foreach (var groupDir in tileDataGroup) + // { + // var groupName = groupDir.Name; + // var typeDirArray = groupDir.GetDirectories(); + // //遍历枚举, 获取指定路径文件 + // foreach (DungeonRoomType roomType in Enum.GetValues(typeof(DungeonRoomType))) + // { + // var typeName = DungeonManager.DungeonRoomTypeToString(roomType); + // + // //收集所有文件名称 + // var tempFileDataInfos = typeDirArray.FirstOrDefault(dirInfo => dirInfo.Name == typeName); + // if (tempFileDataInfos != null) + // { + // foreach (var fileInfo in tempFileDataInfos.GetFiles()) + // { + // if (fileInfo.Extension == ".json") + // { + // var pathInfo = new FileInfo(groupName, roomType, typeName, ResourceManager.RemoveExtension(fileInfo.Name)); + // map.TryAdd(pathInfo.GetPath(), pathInfo); + // } + // } + // } + // } + // } + // + // //剔除多余的 tile.json + // foreach (var item in map) + // { + // var path = item.Key; + // if (!File.Exists(tileDir + path + ".tscn")) + // { + // map.Remove(path); + // var filePath = tileDataDir + path + ".json"; + // if (File.Exists(filePath)) + // { + // GD.Print($"未找到'{tileDir + path}.tscn', 删除配置文件: {filePath}"); + // File.Delete(filePath); + // } + // } + // } + // + // //手动生成缺失的 tile.json + // foreach (var item in map) + // { + // if (!File.Exists(tileDataDir + item.Key + ".json")) + // { + // var tscnName = tileDir + item.Key + ".tscn"; + // var packedScene = ResourceManager.Load(tscnName, false); + // if (packedScene != null) + // { + // var dungeonRoomTemplate = packedScene.Instantiate(); + // var usedRect = dungeonRoomTemplate.GetUsedRect(); + // var dungeonTile = new DungeonTileMap(dungeonRoomTemplate); + // dungeonTile.SetFloorAtlasCoords(new List() { new Vector2I(0, 8) }); + // //计算导航网格 + // dungeonTile.GenerateNavigationPolygon(0); + // + // DungeonRoomInfo.SaveConfig(new List(), usedRect.Position, usedRect.Size, + // item.Value.GroupName, item.Value.RoomType, item.Value.FileName, dungeonRoomTemplate.Weight); + // dungeonRoomTemplate.QueueFree(); + // } + // } + // } + // + // var roomGroupMap = new Dictionary(); + // //var list = new List(); + // //整合操作 + // foreach (var item in map) + // { + // var path = item.Key; + // var configPath = tileDataDir + path + ".json"; + // var split = new DungeonRoomSplit(); + // split.ScenePath = ResourceManager.ToResPath(tileDir + path + ".tscn"); + // split.RoomPath = ResourceManager.ToResPath(configPath); + // + // if (!roomGroupMap.TryGetValue(item.Value.GroupName, out var group)) + // { + // group = new DungeonRoomGroup(); + // group.GroupName = item.Value.GroupName; + // roomGroupMap.Add(group.GroupName, group); + // } + // + // group.GetRoomList(item.Value.RoomType).Add(split); + // } + // + // //写出配置 + // var config = new JsonSerializerOptions(); + // config.WriteIndented = true; + // var text = JsonSerializer.Serialize(roomGroupMap, config); + // File.WriteAllText(GameConfig.RoomTileConfigFile, text); + // + // GD.Print("地牢房间配置, 重新打包完成!"); + // } + // catch (Exception e) + // { + // GD.PrintErr(e.ToString()); + // return false; + // } return true; } @@ -249,23 +249,6 @@ public static class DungeonRoomGenerator return GroupName + "/" + TypeName + "/" + FileName; } } - - private static string ToResPath(string path) - { - var field = path.Replace("\\", "/"); - return "res://" + field; - } - - private static string RemoveExtension(string name) - { - var index = name.LastIndexOf(".", StringComparison.Ordinal); - if (index >= 0) - { - return name.Substring(0, index); - } - - return name; - } } diff --git a/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs b/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs index b03896fdd80a77faf947a994fcfa11c1c926f59a..13e21ce2fc703c7931844118232dc6db5de9e33f 100644 --- a/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs +++ b/DungeonShooting_Godot/src/framework/generator/ExcelGenerator.cs @@ -46,10 +46,10 @@ public static class ExcelGenerator { var id = item["Id"]; var name = item["Name"] + ""; - var remark = item["Remark"] + ""; + var intro = item["Intro"] + ""; code1 += $" /// \n"; code1 += $" /// 名称: {name}
\n"; - code1 += $" /// 备注: {remark.Replace("\n", "
\n /// ")}\n"; + code1 += $" /// 简介: {intro.Replace("\n", "
\n /// ")}\n"; code1 += $" ///
\n"; code1 += $" public const string Id_{id} = \"{id}\";\n"; code2 += $" _activityRegisterMap.Add(\"{id}\", new RegisterActivityData(\"{item["Prefab"]}\", ExcelConfig.ActivityObject_Map[\"{id}\"]));\n"; diff --git a/DungeonShooting_Godot/src/framework/generator/UiGenerator.cs b/DungeonShooting_Godot/src/framework/generator/UiGenerator.cs index 5b806ca2aee6ba049e5573a5b02d20afccfd9ee9..98dfa86e39bf7597899fe04b107c894621ea0274 100644 --- a/DungeonShooting_Godot/src/framework/generator/UiGenerator.cs +++ b/DungeonShooting_Godot/src/framework/generator/UiGenerator.cs @@ -14,6 +14,7 @@ namespace Generator; public static class UiGenerator { private static Dictionary _nodeNameMap = new Dictionary(); + private static int _nestedIndex = 1; /// /// 根据名称在编辑器中创建Ui, open 表示创建完成后是否在编辑器中打开这个ui @@ -32,12 +33,12 @@ public static class UiGenerator $"public partial class {uiName}Panel : {uiName}\n" + $"{{\n" + $"\n" + - $" public override void OnShowUi()\n" + + $" public override void OnCreateUi()\n" + $" {{\n" + $" \n" + $" }}\n" + $"\n" + - $" public override void OnHideUi()\n" + + $" public override void OnDestroyUi()\n" + $" {{\n" + $" \n" + $" }}\n" + @@ -98,7 +99,8 @@ public static class UiGenerator public static void GenerateUiCode(Node control, string path) { _nodeNameMap.Clear(); - var uiNode = EachNode(control); + _nestedIndex = 1; + var uiNode = EachNodeFromEditor(control.Name, control); var code = GenerateClassCode(uiNode); File.WriteAllText(path, code); } @@ -111,13 +113,23 @@ public static class UiGenerator try { _nodeNameMap.Clear(); - + _nestedIndex = 1; + var uiName = control.Name.ToString(); var path = GameConfig.UiCodeDir + uiName.FirstToLower() + "/" + uiName + ".cs"; GD.Print("重新生成ui代码: " + path); - var uiNode = EachNodeFromEditor(control); + var uiNode = EachNodeFromEditor(control.Name, control); var code = GenerateClassCode(uiNode); + + foreach (var pair in _nodeNameMap) + { + if (pair.Value > 1) + { + GD.Print($"检测到同名节点: '{pair.Key}', 使用该名称的节点将无法生成唯一节点属性!"); + } + } + File.WriteAllText(path, code); } catch (Exception e) @@ -131,22 +143,98 @@ public static class UiGenerator private static string GenerateClassCode(UiNodeInfo uiNodeInfo) { + var retraction = " "; return $"namespace UI.{uiNodeInfo.OriginName};\n\n" + - $"/// \n" + - $"/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失\n" + - $"/// \n" + + $"/// \n" + + $"/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失\n" + + $"/// \n" + $"public abstract partial class {uiNodeInfo.OriginName} : UiBase\n" + $"{{\n" + - GeneratePropertyListClassCode("", uiNodeInfo.OriginName + ".", uiNodeInfo, " ") + + GeneratePropertyListClassCode("", uiNodeInfo.OriginName + ".", uiNodeInfo, retraction) + $"\n" + $" public {uiNodeInfo.OriginName}() : base(nameof({uiNodeInfo.OriginName}))\n" + $" {{\n" + $" }}\n" + $"\n" + - GenerateAllChildrenClassCode(uiNodeInfo.OriginName + ".", uiNodeInfo, " ") + + $" public sealed override void OnInitNestedUi()\n" + + $" {{\n" + + GenerateUiScriptCode("", uiNodeInfo, retraction) + + $"\n" + + GenerateInitNestedUi("", uiNodeInfo, retraction) + + $" }}\n" + + $"\n" + + GenerateAllChildrenClassCode(uiNodeInfo.OriginName + ".", uiNodeInfo, retraction) + + $"\n" + + GenerateSoleLayerCode(uiNodeInfo, "", uiNodeInfo.OriginName, retraction) + $"}}\n"; } + private static string GenerateUiScriptCode(string parent, UiNodeInfo uiNodeInfo, string retraction) + { + var str = ""; + var node = parent + (string.IsNullOrEmpty(parent) ? "" : ".") + uiNodeInfo.Name; + if (uiNodeInfo.IsNodeScript) + { + str += retraction + $" _ = {node};\n"; + } + else + { + if (uiNodeInfo.Children != null) + { + for (var i = 0; i < uiNodeInfo.Children.Count; i++) + { + var item = uiNodeInfo.Children[i]; + if (uiNodeInfo.OriginName == uiNodeInfo.UiRootName) + { + str += GenerateUiScriptCode("", item, retraction); + } + else + { + str += GenerateUiScriptCode(node, item, retraction); + } + } + } + } + + return str; + } + + private static string GenerateInitNestedUi(string parent, UiNodeInfo uiNodeInfo, string retraction) + { + var str = ""; + if (uiNodeInfo.IsRefUi) + { + var parentUi = "inst" + _nestedIndex++; + var uiNode = $"{parentUi}.{uiNodeInfo.Name}.Instance"; + var parentNode = string.IsNullOrEmpty(parent) ? "this" : parent; + var parentNode2 = string.IsNullOrEmpty(parent) ? "null" : parentUi; + str += retraction + $" var {parentUi} = {parentNode};\n"; + str += retraction + $" RecordNestedUi({uiNode}, {parentNode2}, UiManager.RecordType.Open);\n"; + str += retraction + $" {uiNode}.OnCreateUi();\n"; + str += retraction + $" {uiNode}.OnInitNestedUi();\n\n"; + } + else + { + if (uiNodeInfo.Children != null) + { + for (var i = 0; i < uiNodeInfo.Children.Count; i++) + { + var item = uiNodeInfo.Children[i]; + if (uiNodeInfo.OriginName == uiNodeInfo.UiRootName) + { + str += GenerateInitNestedUi("", item, retraction); + } + else + { + str += GenerateInitNestedUi(parent + (string.IsNullOrEmpty(parent)? "" : ".") + uiNodeInfo.Name, item, retraction); + } + } + } + } + + return str; + } + private static string GenerateAllChildrenClassCode(string parent, UiNodeInfo uiNodeInfo, string retraction) { var str = ""; @@ -165,14 +253,32 @@ public static class UiGenerator private static string GenerateChildrenClassCode(string parent, UiNodeInfo uiNodeInfo, string retraction) { + string cloneCode; + + if (uiNodeInfo.IsRefUi) + { + cloneCode = retraction + $" public override {uiNodeInfo.ClassName} Clone()\n"; + cloneCode += retraction + $" {{\n"; + cloneCode += retraction + $" var uiNode = new {uiNodeInfo.ClassName}(UiPanel, ({uiNodeInfo.NodeTypeName})Instance.Duplicate());\n"; + cloneCode += retraction + $" UiPanel.RecordNestedUi(uiNode.Instance, this, UiManager.RecordType.Open);\n"; + cloneCode += retraction + $" uiNode.Instance.OnCreateUi();\n"; + cloneCode += retraction + $" uiNode.Instance.OnInitNestedUi();\n"; + cloneCode += retraction + $" return uiNode;\n"; + cloneCode += retraction + $" }}\n"; + } + else + { + cloneCode = retraction + $" public override {uiNodeInfo.ClassName} Clone() => new (UiPanel, ({uiNodeInfo.NodeTypeName})Instance.Duplicate());\n"; + } + return retraction + $"/// \n" + - retraction + $"/// 类型: , 路径: {parent}{uiNodeInfo.OriginName}\n" + + retraction + $"/// 类型: , 路径: {parent}{uiNodeInfo.OriginName}\n" + retraction + $"/// \n" + - retraction + $"public class {uiNodeInfo.ClassName} : IUiNode<{uiNodeInfo.TypeName}, {uiNodeInfo.ClassName}>\n" + + retraction + $"public class {uiNodeInfo.ClassName} : UiNode<{uiNodeInfo.UiRootName}Panel, {uiNodeInfo.NodeTypeName}, {uiNodeInfo.ClassName}>\n" + retraction + $"{{\n" + GeneratePropertyListClassCode("Instance.", parent, uiNodeInfo, retraction + " ") + - retraction + $" public {uiNodeInfo.ClassName}({uiNodeInfo.TypeName} node) : base(node) {{ }}\n" + - retraction + $" public override {uiNodeInfo.ClassName} Clone() => new (({uiNodeInfo.TypeName})Instance.Duplicate());\n" + + retraction + $" public {uiNodeInfo.ClassName}({uiNodeInfo.UiRootName}Panel uiPanel, {uiNodeInfo.NodeTypeName} node) : base(uiPanel, node) {{ }}\n" + + cloneCode + retraction + $"}}\n\n"; } @@ -193,67 +299,72 @@ public static class UiGenerator private static string GeneratePropertyCode(string target, string parent, UiNodeInfo uiNodeInfo, string retraction) { + string uiPanel; + if (string.IsNullOrEmpty(target)) + { + uiPanel = $"({uiNodeInfo.UiRootName}Panel)this"; + } + else + { + uiPanel = "UiPanel"; + } return retraction + $"/// \n" + - retraction + $"/// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: {parent}{uiNodeInfo.OriginName}\n" + + retraction + $"/// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: {parent}{uiNodeInfo.OriginName}\n" + retraction + $"/// \n" + retraction + $"public {uiNodeInfo.ClassName} {uiNodeInfo.Name}\n" + retraction + $"{{\n" + retraction + $" get\n" + retraction + $" {{\n" + - retraction + $" if (_{uiNodeInfo.Name} == null) _{uiNodeInfo.Name} = new {uiNodeInfo.ClassName}({target}GetNodeOrNull<{uiNodeInfo.TypeName}>(\"{uiNodeInfo.OriginName}\"));\n" + + retraction + $" if (_{uiNodeInfo.Name} == null) _{uiNodeInfo.Name} = new {uiNodeInfo.ClassName}({uiPanel}, {target}GetNode<{uiNodeInfo.NodeTypeName}>(\"{uiNodeInfo.OriginName}\"));\n" + retraction + $" return _{uiNodeInfo.Name};\n" + retraction + $" }}\n" + retraction + $"}}\n" + retraction + $"private {uiNodeInfo.ClassName} _{uiNodeInfo.Name};\n\n"; } - - /// - /// 递归解析节点, 并生成 UiNodeInfo 数据 - /// - private static UiNodeInfo EachNode(Node node) - { - var originName = Regex.Replace(node.Name, "[^\\w]", ""); - //类定义该图层的类名 - string className; - if (_nodeNameMap.ContainsKey(originName)) //有同名图层, 为了防止类名冲突, 需要在 UiNode 后面加上索引 - { - var count = _nodeNameMap[originName]; - className = "UiNode" + (count) + "_" + originName; - _nodeNameMap[originName] = count + 1; - } - else - { - className = "UiNode" + "_" + originName; - _nodeNameMap.Add(originName, 1); - } - - var uiNode = new UiNodeInfo("L_" + originName, originName, className, node.GetType().FullName); - var childCount = node.GetChildCount(); - if (childCount > 0) + private static string GenerateSoleLayerCode(UiNodeInfo uiNodeInfo, string layerName, string parent, string retraction) + { + var str = ""; + if (uiNodeInfo.Children != null) { - for (var i = 0; i < childCount; i++) + foreach (var nodeInfo in uiNodeInfo.Children) { - var children = node.GetChild(i); - if (children != null) + var layer = layerName; + if (layerName.Length > 0) { - if (uiNode.Children == null) - { - uiNode.Children = new List(); - } + layer += "."; + } - uiNode.Children.Add(EachNode(children)); + layer += nodeInfo.Name; + var path = parent + "." + nodeInfo.OriginName; + str += GenerateSoleLayerCode(nodeInfo, layer, path, retraction); + if (IsSoleNameNode(nodeInfo)) + { + str += $"{retraction}/// \n"; + str += $"{retraction}/// 场景中唯一名称的节点, 节点类型: , 节点路径: {path}\n"; + str += $"{retraction}/// \n"; + str += $"{retraction}public {nodeInfo.ClassName} S_{nodeInfo.OriginName} => {layer};\n\n"; } } } + return str; + } - return uiNode; + //返回指定节点在当前场景中是否是唯一名称的节点 + private static bool IsSoleNameNode(UiNodeInfo uiNodeInfo) + { + if (!_nodeNameMap.TryGetValue(uiNodeInfo.OriginName, out var count)) + { + return true; + } + + return count <= 1; } /// /// 在编辑器下递归解析节点, 由于编辑器下绑定用户脚本的节点无法直接判断节点类型, 那么就只能获取节点的脚本然后解析名称和命名空间 /// - private static UiNodeInfo EachNodeFromEditor(Node node) + private static UiNodeInfo EachNodeFromEditor(string uiRootName, Node node) { UiNodeInfo uiNode; //原名称 @@ -265,19 +376,19 @@ public static class UiGenerator if (_nodeNameMap.ContainsKey(originName)) //有同名图层, 为了防止类名冲突, 需要在 UiNode 后面加上索引 { var count = _nodeNameMap[originName]; - className = "UiNode" + (count) + "_" + originName; + className = originName + "_" + count; _nodeNameMap[originName] = count + 1; } else { - className = "UiNode" + "_" + originName; + className = originName; _nodeNameMap.Add(originName, 1); } var script = node.GetScript().As(); if (script == null) //无脚本, 说明是内置节点 { - uiNode = new UiNodeInfo(fieldName, originName, className, node.GetType().FullName); + uiNode = new UiNodeInfo(uiRootName, fieldName, originName, className, node.GetType().FullName, false); } else //存在脚本 { @@ -286,16 +397,35 @@ public static class UiGenerator var fileName = script.ResourcePath.Substring(index + 1, script.ResourcePath.Length - index - 3 - 1); //在源代码中寻找命名空间 var match = Regex.Match(script.SourceCode, "(?<=namespace\\s+)[\\w\\.]+"); + bool isNodeScript; if (match.Success) //存在命名空间 { - uiNode = new UiNodeInfo(fieldName, originName, className, match.Value + "." + fileName); + isNodeScript = IsNodeScript(match.Value + "." + fileName); + uiNode = new UiNodeInfo(uiRootName, fieldName, originName, className, match.Value + "." + fileName, isNodeScript); } else //不存在命名空间 { - uiNode = new UiNodeInfo(fieldName, originName, className, fileName); + isNodeScript = IsNodeScript(fileName); + uiNode = new UiNodeInfo(uiRootName, fieldName, originName, className, fileName, isNodeScript); + } + //检测是否是引用Ui + if (fileName.EndsWith("Panel")) + { + var childUiName = fileName.Substring(0, fileName.Length - 5); + if (childUiName != uiRootName && File.Exists(GameConfig.UiPrefabDir + childUiName + ".tscn")) + { + //是引用Ui + uiNode.IsRefUi = true; + } } } + //如果是引用Ui, 就没有必要递归子节点了 + if (uiNode.IsRefUi) + { + return uiNode; + } + var childCount = node.GetChildCount(); if (childCount > 0) { @@ -309,7 +439,7 @@ public static class UiGenerator uiNode.Children = new List(); } - uiNode.Children.Add(EachNodeFromEditor(children)); + uiNode.Children.Add(EachNodeFromEditor(uiRootName, children)); } } } @@ -317,20 +447,60 @@ public static class UiGenerator return uiNode; } + private static bool IsNodeScript(string typeName) + { + var type = typeof(UiGenerator).Assembly.GetType(typeName); + if (type == null) + { + return false; + } + + return type.IsAssignableTo(typeof(IUiNodeScript)); + } + private class UiNodeInfo { + /// + /// 层级名称 + /// public string Name; + /// + /// 层级原名称 + /// public string OriginName; + /// + /// 层级类名 + /// public string ClassName; - public string TypeName; + /// + /// Godot节点类型名称 + /// + public string NodeTypeName; + /// + /// 子节点 + /// public List Children; - - public UiNodeInfo(string name, string originName, string className, string typeName) + /// + /// Ui根节点名称 + /// + public string UiRootName; + /// + /// 是否实现了 IUiNodeScript 接口 + /// + public bool IsNodeScript; + /// + /// 是否是引用Ui + /// + public bool IsRefUi; + + public UiNodeInfo(string uiRootName, string name, string originName, string className, string nodeTypeName, bool isNodeScript) { + UiRootName = uiRootName; Name = name; OriginName = originName; ClassName = className; - TypeName = typeName; + NodeTypeName = nodeTypeName; + IsNodeScript = isNodeScript; } } diff --git a/DungeonShooting_Godot/src/framework/generator/UiManagerMethodsGenerator.cs b/DungeonShooting_Godot/src/framework/generator/UiManagerMethodsGenerator.cs index e38b2865f7f9c87f711ac2c01f288ced1d528cd2..a13de3d672e604a0d719f33a3f4144f9b733d9ee 100644 --- a/DungeonShooting_Godot/src/framework/generator/UiManagerMethodsGenerator.cs +++ b/DungeonShooting_Godot/src/framework/generator/UiManagerMethodsGenerator.cs @@ -47,7 +47,16 @@ public static class UiManagerMethodsGenerator { var uiName = fileInfo.Name.Substring(0, fileInfo.Name.Length - 5); uiNameClass += $" public const string {uiName} = \"{uiName}\";\n"; + methodClass += $" /// \n" + + $" /// 创建 {uiName}, 并返回UI实例, 该函数不会打开 Ui\n" + + $" /// \n" + + $" public static UI.{uiName}.{uiName}Panel Create_{uiName}()\n" + + $" {{\n" + + $" return CreateUi(UiName.{uiName});\n" + + $" }}\n" + + $"\n" + + $" /// \n" + $" /// 打开 {uiName}, 并返回UI实例\n" + $" /// \n" + $" public static UI.{uiName}.{uiName}Panel Open_{uiName}()\n" + @@ -70,12 +79,12 @@ public static class UiManagerMethodsGenerator $" /// \n" + $" /// 销毁 {uiName} 的所有实例\n" + $" /// \n" + - $" public static void Dispose_{uiName}()\n" + + $" public static void Destroy_{uiName}()\n" + $" {{\n" + $" var uiInstance = Get_{uiName}_Instance();\n" + $" foreach (var uiPanel in uiInstance)\n" + $" {{\n" + - $" uiPanel.DisposeUi();\n" + + $" uiPanel.Destroy();\n" + $" }}\n" + $" }}\n" + $"\n" + diff --git a/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs b/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs index 337dab25f57547db8d160640c85c316452c3fb15..40c0c4aac0b0bffd3f13d74a632cc83d7928bdb9 100644 --- a/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs +++ b/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs @@ -6,17 +6,24 @@ using Godot; /// /// 归属区域 /// -public partial class AffiliationArea : Area2D +public partial class AffiliationArea : Area2D, IDestroy { + public bool IsDestroyed { get; private set; } + /// /// 当前实例所属房间 /// public RoomInfo RoomInfo; /// - /// 当前归属区域包含的所有物体对象 + /// 当前归属区域包含的所有物体对象, 物体进入另一个区域时才会从该集合中移除 /// private readonly HashSet _includeItems = new HashSet(); + + /// + /// 已经进入 AffiliationArea 所在范围内的物体, 物体一旦离开该区域就会立刻从该集合中删除 + /// + private readonly HashSet _enterItems = new HashSet(); /// /// 玩家是否是第一次进入 @@ -55,6 +62,7 @@ public partial class AffiliationArea : Area2D CollisionMask = PhysicsLayer.Prop | PhysicsLayer.Player | PhysicsLayer.Enemy | PhysicsLayer.Shell | PhysicsLayer.Throwing; BodyEntered += OnBodyEntered; + BodyExited += OnBodyExited; } /// @@ -69,7 +77,7 @@ public partial class AffiliationArea : Area2D if (activityObject.AffiliationArea != null) { - _includeItems.Remove(activityObject); + activityObject.AffiliationArea._includeItems.Remove(activityObject); } activityObject.AffiliationArea = this; _includeItems.Add(activityObject); @@ -111,7 +119,7 @@ public partial class AffiliationArea : Area2D var count = 0; foreach (var activityObject in _includeItems) { - if (handler(activityObject)) + if (!activityObject.IsDestroyed && handler(activityObject)) { count++; } @@ -128,7 +136,7 @@ public partial class AffiliationArea : Area2D var list = new List(); foreach (var activityObject in _includeItems) { - if (handler(activityObject)) + if (!activityObject.IsDestroyed && handler(activityObject)) { list.Add(activityObject); } @@ -144,7 +152,7 @@ public partial class AffiliationArea : Area2D { foreach (var activityObject in _includeItems) { - if (handler(activityObject)) + if (!activityObject.IsDestroyed && handler(activityObject)) { return true; } @@ -153,14 +161,90 @@ public partial class AffiliationArea : Area2D return false; } + /// + /// 获取进入该区域中物体的总数 + /// + public int GetEnterItemsCount() + { + return _enterItems.Count; + } + + /// + /// 统计进入该区域且符合条件的数量 + /// + /// 操作函数, 返回是否满足要求 + public int FindEnterItemsCount(Func handler) + { + var count = 0; + foreach (var activityObject in _enterItems) + { + if (!activityObject.IsDestroyed && handler(activityObject)) + { + count++; + } + } + return count; + } + + /// + /// 查询所有进入该区域且符合条件的对象并返回 + /// + /// 操作函数, 返回是否满足要求 + public ActivityObject[] FindEnterItems(Func handler) + { + var list = new List(); + foreach (var activityObject in _enterItems) + { + if (!activityObject.IsDestroyed && handler(activityObject)) + { + list.Add(activityObject); + } + } + return list.ToArray(); + } + + /// + /// 检查是否有进入该区域且符合条件的对象 + /// + /// 操作函数, 返回是否满足要求 + public bool ExistEnterItem(Func handler) + { + foreach (var activityObject in _enterItems) + { + if (!activityObject.IsDestroyed && handler(activityObject)) + { + return true; + } + } + + return false; + } + + /// + /// 返回物体是否进入了该区域 + /// + public bool IsEnter(ActivityObject activityObject) + { + return _enterItems.Contains(activityObject); + } + private void OnBodyEntered(Node2D body) { if (body is ActivityObject activityObject) { + _enterItems.Add(activityObject); //注意需要延时调用 CallDeferred(nameof(InsertItem), activityObject); } } + + private void OnBodyExited(Node2D body) + { + if (body is ActivityObject activityObject) + { + _enterItems.Remove(activityObject); + } + } //玩家进入房间 private void OnPlayerEnterRoom() @@ -172,4 +256,18 @@ public partial class AffiliationArea : Area2D } EventManager.EmitEvent(EventEnum.OnPlayerEnterRoom, RoomInfo); } + + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + IsDestroyed = true; + QueueFree(); + _includeItems.Clear(); + _enterItems.Clear(); + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonConfig.cs b/DungeonShooting_Godot/src/framework/map/DungeonConfig.cs index ea2682337887a5147cc5b94545c1f93145d42ea2..92e1b0da6da039c845e7f877b5dc6c25032d872a 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonConfig.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonConfig.cs @@ -1,4 +1,6 @@  +using System.Collections.Generic; + /// /// 生成地牢的配置 /// @@ -13,4 +15,19 @@ public class DungeonConfig /// 房间数量 /// public int RoomCount = 20; + + /// + /// 是否指定了房间 + /// + public bool HasDesignatedRoom => DesignatedRoom != null && DesignatedRoom.Count > 0; + + /// + /// 指定房间类型 + /// + public DungeonRoomType DesignatedType; + + /// + /// 指定房间列表 + /// + public List DesignatedRoom; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs index 1cc6cd9659f4b27eb7f32a9da81b9f0f100d0249..5c83e0b1539aa6f5dcbf147155290ffc959740a4 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs @@ -16,17 +16,22 @@ public class DungeonGenerator /// /// 起始房间 /// - public RoomInfo StartRoom { get; private set; } + public RoomInfo StartRoomInfo { get; private set; } /// /// 结束房间 /// - public RoomInfo EndRoom { get; private set; } + public RoomInfo EndRoomInfo { get; private set; } /// /// boss房间 /// public List BossRoom { get; } = new List(); + + /// + /// 随机数对象 + /// + public SeedRandom Random { get; } //用于标记地图上的坐标是否被占用 private Grid _roomGrid { get; } = new Grid(); @@ -39,29 +44,22 @@ public class DungeonGenerator //下一个房间类型 private DungeonRoomType _nextRoomType = DungeonRoomType.Battle; - //宽高 - // private int _roomMinWidth = 15; - // private int _roomMaxWidth = 35; - // private int _roomMinHeight = 15; - // private int _roomMaxHeight = 30; - //间隔 - private int _roomMinInterval = 6; - private int _roomMaxInterval = 10; + private int _roomMinInterval = 5; + private int _roomMaxInterval = 6; //房间横轴分散程度 - private float _roomHorizontalMinDispersion = 0f; - private float _roomHorizontalMaxDispersion = 0.7f; + private float _roomHorizontalMaxDispersion = 0.5f; //房间纵轴分散程度 private float _roomVerticalMinDispersion = 0f; - private float _roomVerticalMaxDispersion = 0.7f; + private float _roomVerticalMaxDispersion = 0.5f; //区域限制 private bool _enableLimitRange = true; - private int _rangeX = 110; - private int _rangeY = 110; + private int _rangeX = 200; + private int _rangeY = 200; //找房间失败次数, 过大则会关闭区域限制 private int _maxFailCount = 10; @@ -75,9 +73,6 @@ public class DungeonGenerator private DungeonConfig _config; private DungeonRoomGroup _roomGroup; - //指定只能生成的房间 - private static List _designatedRoom; - private enum GenerateRoomErrorCode { NoError, @@ -90,41 +85,22 @@ public class DungeonGenerator // //没有合适的门 // NoProperDoor, } - -#if TOOLS - /// - /// 用于调试, 设置生成器只能生成哪些房间 - /// - public static void SetDesignatedRoom(List list) - { - _designatedRoom = new List(list); - } -#endif - + public DungeonGenerator(DungeonConfig config) { _config = config; _roomGroup = GameApplication.Instance.RoomConfig[config.GroupName]; //验证该组是否满足生成地牢的条件 - if (_roomGroup.InletList.Count == 0) + var result = DungeonManager.CheckDungeon(config.GroupName); + if (result.HasError) { - throw new Exception("当前组'" + config.GroupName + "'中没有起始房间, 不能生成地牢!"); + throw new Exception("当前组'" + config.GroupName + "'" + result.ErrorMessage + ", 不能生成地牢!"); } - //没有指定房间 - if (_designatedRoom == null || _designatedRoom.Count == 0) - { - if (_roomGroup.OutletList.Count == 0) - { - throw new Exception("当前组'" + config.GroupName + "'中没有结束房间, 不能生成地牢!"); - } - else if (_roomGroup.BattleList.Count == 0) - { - throw new Exception("当前组'" + config.GroupName + "'中没有战斗房间, 不能生成地牢!"); - } - } - - _roomGroup.InitWeight(); + + Random = new SeedRandom(); + GD.Print("创建地牢生成器, 随机种子: " + Random.Seed); + _roomGroup.InitWeight(Random); } /// @@ -132,7 +108,7 @@ public class DungeonGenerator /// public void EachRoom(Action cb) { - EachRoom(StartRoom, cb); + EachRoom(StartRoomInfo, cb); } private void EachRoom(RoomInfo roomInfo, Action cb) @@ -154,68 +130,68 @@ public class DungeonGenerator /// public void Generate() { - if (StartRoom != null) return; + if (StartRoomInfo != null) return; CalcNextRoomType(null); //用于排除上一级房间 var excludePrevRoom = new List(); //上一个房间 - RoomInfo prevRoom = null; + RoomInfo prevRoomInfo = null; var chainTryCount = 0; var chainMaxTryCount = 3; //如果房间数量不够, 就一直生成 - while (_count < _config.RoomCount || EndRoom == null) + while (_count < _config.RoomCount || EndRoomInfo == null) { var nextRoomType = GetNextRoomType(); //上一个房间 - RoomInfo tempPrevRoom; + RoomInfo tempPrevRoomInfo; if (nextRoomType == DungeonRoomType.Inlet) { - tempPrevRoom = null; + tempPrevRoomInfo = null; } else if (nextRoomType == DungeonRoomType.Boss) { - tempPrevRoom = FindMaxLayerRoom(excludePrevRoom); + tempPrevRoomInfo = FindMaxLayerRoom(excludePrevRoom); } else if (nextRoomType == DungeonRoomType.Outlet) { - tempPrevRoom = prevRoom; + tempPrevRoomInfo = prevRoomInfo; } else if (nextRoomType == DungeonRoomType.Battle) { if (chainTryCount < chainMaxTryCount) { - if (prevRoom != null && prevRoom.Layer > 6) //层数太高, 下一个房间生成在低层级 + if (prevRoomInfo != null && prevRoomInfo.Layer > 6) //层数太高, 下一个房间生成在低层级 { - tempPrevRoom = RoundRoomLessThanLayer(3); + tempPrevRoomInfo = RoundRoomLessThanLayer(3); } else { - tempPrevRoom = prevRoom; + tempPrevRoomInfo = prevRoomInfo; } } else { - tempPrevRoom = Utils.RandomChoose(RoomInfos); + tempPrevRoomInfo = Random.RandomChoose(RoomInfos); } } else { - tempPrevRoom = Utils.RandomChoose(RoomInfos); + tempPrevRoomInfo = Random.RandomChoose(RoomInfos); } //生成下一个房间 - var errorCode = GenerateRoom(tempPrevRoom, nextRoomType, out var nextRoom); + var errorCode = GenerateRoom(tempPrevRoomInfo, nextRoomType, out var nextRoom); if (errorCode == GenerateRoomErrorCode.NoError) //生成成功 { _failCount = 0; RoomInfos.Add(nextRoom); if (nextRoomType == DungeonRoomType.Inlet) { - StartRoom = nextRoom; + StartRoomInfo = nextRoom; } else if (nextRoomType == DungeonRoomType.Boss) //boss房间 { @@ -224,22 +200,22 @@ public class DungeonGenerator } else if (nextRoomType == DungeonRoomType.Outlet) { - EndRoom = nextRoom; + EndRoomInfo = nextRoom; } else if (nextRoomType == DungeonRoomType.Battle) { chainTryCount = 0; - chainMaxTryCount = Utils.RandomRangeInt(1, 3); + chainMaxTryCount = Random.RandomRangeInt(1, 3); } - prevRoom = nextRoom; - CalcNextRoomType(prevRoom); + prevRoomInfo = nextRoom; + CalcNextRoomType(prevRoomInfo); } else //生成失败 { if (nextRoomType == DungeonRoomType.Boss) { //生成boss房间成功 - excludePrevRoom.Add(tempPrevRoom); + excludePrevRoom.Add(tempPrevRoomInfo); if (excludePrevRoom.Count >= RoomInfos.Count) { //全都没找到合适的, 那就再来一遍 @@ -249,13 +225,13 @@ public class DungeonGenerator else if (nextRoomType == DungeonRoomType.Outlet) { //生成结束房间失败, 那么只能回滚boss房间 - if (prevRoom != null) + if (prevRoomInfo != null) { - var bossPrev = prevRoom.Prev; - BossRoom.Remove(prevRoom); - RollbackRoom(prevRoom); + var bossPrev = prevRoomInfo.Prev; + BossRoom.Remove(prevRoomInfo); + RollbackRoom(prevRoomInfo); CalcNextRoomType(bossPrev); - prevRoom = null; + prevRoomInfo = null; } } else if (nextRoomType == DungeonRoomType.Battle) @@ -282,7 +258,7 @@ public class DungeonGenerator } //生成房间 - private GenerateRoomErrorCode GenerateRoom(RoomInfo prevRoomInfo, DungeonRoomType roomType, out RoomInfo resultRoom) + private GenerateRoomErrorCode GenerateRoom(RoomInfo prevRoomInfo, DungeonRoomType roomType, out RoomInfo resultRoomInfo) { // if (_count >= _config.RoomCount) // { @@ -291,8 +267,11 @@ public class DungeonGenerator // } DungeonRoomSplit roomSplit; - //没有指定房间 - if (roomType == DungeonRoomType.Inlet || _designatedRoom == null || _designatedRoom.Count == 0) + if (_config.HasDesignatedRoom && _config.DesignatedType == roomType) //执行指定了房间 + { + roomSplit = Random.RandomChoose(_config.DesignatedRoom); + } + else //没有指定房间 { //随机选择一个房间 var list = _roomGroup.GetRoomList(roomType); @@ -305,10 +284,6 @@ public class DungeonGenerator roomSplit = _roomGroup.GetRandomRoom(roomType); } } - else //指定了房间 - { - roomSplit = Utils.RandomChoose(_designatedRoom); - } var room = new RoomInfo(_id, roomType, roomSplit); @@ -335,19 +310,19 @@ public class DungeonGenerator } for (; tryCount < maxTryCount; tryCount++) { - var direction = Utils.RandomRangeInt(0, 3); + var direction = Random.RandomRangeInt(0, 3); //房间间隔 - var space = Utils.RandomRangeInt(_roomMinInterval, _roomMaxInterval); + var space = Random.RandomRangeInt(_roomMinInterval, _roomMaxInterval); //中心偏移 int offset; if (direction == 0 || direction == 2) { - offset = Utils.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), + offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), (int)(prevRoomInfo.Size.X * _roomVerticalMaxDispersion)); } else { - offset = Utils.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), + offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), (int)(prevRoomInfo.Size.Y * _roomHorizontalMaxDispersion)); } @@ -380,20 +355,20 @@ public class DungeonGenerator room.GetVerticalStart() < -_rangeY || room.GetVerticalEnd() > _rangeY) { //超出区域, 直接跳出尝试的循环, 返回 null - resultRoom = null; + resultRoomInfo = null; return GenerateRoomErrorCode.OutArea; } } //是否碰到其他房间或者过道 - if (_roomGrid.RectCollision(room.Position - new Vector2(GameConfig.RoomSpace, GameConfig.RoomSpace), room.Size + new Vector2(GameConfig.RoomSpace * 2, GameConfig.RoomSpace * 2))) + if (_roomGrid.RectCollision(room.Position - new Vector2I(GameConfig.RoomSpace, GameConfig.RoomSpace), room.Size + new Vector2I(GameConfig.RoomSpace * 2, GameConfig.RoomSpace * 2))) { //碰到其他墙壁, 再一次尝试 continue; //return GenerateRoomErrorCode.HasCollision; } - _roomGrid.AddRect(room.Position, room.Size, true); + _roomGrid.SetRect(room.Position, room.Size, true); //找门, 与上一个房间是否能连通 if (!ConnectDoor(prevRoomInfo, room)) @@ -409,14 +384,14 @@ public class DungeonGenerator //尝试次数用光了, 还没有找到合适的位置 if (tryCount >= maxTryCount) { - resultRoom = null; + resultRoomInfo = null; return GenerateRoomErrorCode.NoSuitableLocation; } } else //第一个房间 { room.Layer = 0; - _roomGrid.AddRect(room.Position, room.Size, true); + _roomGrid.SetRect(room.Position, room.Size, true); } if (IsParticipateCounting(room)) @@ -430,7 +405,7 @@ public class DungeonGenerator { prevRoomInfo.Next.Add(room); } - resultRoom = room; + resultRoomInfo = room; return GenerateRoomErrorCode.NoError; } @@ -546,30 +521,30 @@ public class DungeonGenerator } } - return Utils.RandomChoose(list); + return Random.RandomChoose(list); } /// /// 找两个房间的门 /// - private bool ConnectDoor(RoomInfo room, RoomInfo nextRoom) + private bool ConnectDoor(RoomInfo roomInfo, RoomInfo nextRoomInfo) { //门描述 var roomDoor = new RoomDoorInfo(); var nextRoomDoor = new RoomDoorInfo(); - roomDoor.RoomInfo = room; - nextRoomDoor.RoomInfo = nextRoom; - roomDoor.ConnectRoom = nextRoom; + roomDoor.RoomInfo = roomInfo; + nextRoomDoor.RoomInfo = nextRoomInfo; + roomDoor.ConnectRoom = nextRoomInfo; roomDoor.ConnectDoor = nextRoomDoor; - nextRoomDoor.ConnectRoom = room; + nextRoomDoor.ConnectRoom = roomInfo; nextRoomDoor.ConnectDoor = roomDoor; //先寻找直通门 - if (Utils.RandomBoolean()) + if (Random.RandomBoolean()) { //直行通道, 优先横轴 - if (TryConnectHorizontalDoor(room, roomDoor, nextRoom, nextRoomDoor) - || TryConnectVerticalDoor(room, roomDoor, nextRoom, nextRoomDoor)) + if (TryConnectHorizontalDoor(roomInfo, roomDoor, nextRoomInfo, nextRoomDoor) + || TryConnectVerticalDoor(roomInfo, roomDoor, nextRoomInfo, nextRoomDoor)) { return true; } @@ -577,50 +552,50 @@ public class DungeonGenerator else { //直行通道, 优先纵轴 - if (TryConnectVerticalDoor(room, roomDoor, nextRoom, nextRoomDoor) - || TryConnectHorizontalDoor(room, roomDoor, nextRoom, nextRoomDoor)) + if (TryConnectVerticalDoor(roomInfo, roomDoor, nextRoomInfo, nextRoomDoor) + || TryConnectHorizontalDoor(roomInfo, roomDoor, nextRoomInfo, nextRoomDoor)) { return true; } } //包含拐角的通道 - return TryConnectCrossDoor(room, roomDoor, nextRoom, nextRoomDoor); + return TryConnectCrossDoor(roomInfo, roomDoor, nextRoomInfo, nextRoomDoor); } /// /// 尝试寻找横轴方向上两个房间的连通的门, 只查找直线通道, 返回是否找到 /// - private bool TryConnectHorizontalDoor(RoomInfo room, RoomDoorInfo roomDoor, RoomInfo nextRoom, RoomDoorInfo nextRoomDoor) + private bool TryConnectHorizontalDoor(RoomInfo roomInfo, RoomDoorInfo roomDoor, RoomInfo nextRoomInfo, RoomDoorInfo nextRoomDoor) { - var overlapX = Mathf.Min(room.GetHorizontalEnd(), nextRoom.GetHorizontalEnd()) - - Mathf.Max(room.GetHorizontalStart(), nextRoom.GetHorizontalStart()); + var overlapX = Mathf.Min(roomInfo.GetHorizontalEnd(), nextRoomInfo.GetHorizontalEnd()) - + Mathf.Max(roomInfo.GetHorizontalStart(), nextRoomInfo.GetHorizontalStart()); //这种情况下x轴有重叠 if (overlapX >= 6) { //找到重叠区域 - var rangeList = FindPassage(room, nextRoom, - room.GetVerticalStart() < nextRoom.GetVerticalStart() ? DoorDirection.S : DoorDirection.N); + var rangeList = FindPassage(roomInfo, nextRoomInfo, + roomInfo.GetVerticalStart() < nextRoomInfo.GetVerticalStart() ? DoorDirection.S : DoorDirection.N); while (rangeList.Count > 0) { //找到重叠区域 - var range = Utils.RandomChooseAndRemove(rangeList); - var x = Utils.RandomRangeInt(range.X, range.Y); + var range = Random.RandomChooseAndRemove(rangeList); + var x = Random.RandomRangeInt(range.X, range.Y); - if (room.GetVerticalStart() < nextRoom.GetVerticalStart()) //room在上, nextRoom在下 + if (roomInfo.GetVerticalStart() < nextRoomInfo.GetVerticalStart()) //room在上, nextRoom在下 { roomDoor.Direction = DoorDirection.S; nextRoomDoor.Direction = DoorDirection.N; - roomDoor.OriginPosition = new Vector2I(x, room.GetVerticalEnd()); - nextRoomDoor.OriginPosition = new Vector2I(x, nextRoom.GetVerticalStart()); + roomDoor.OriginPosition = new Vector2I(x, roomInfo.GetVerticalEnd()); + nextRoomDoor.OriginPosition = new Vector2I(x, nextRoomInfo.GetVerticalStart()); } else //room在下, nextRoom在上 { roomDoor.Direction = DoorDirection.N; nextRoomDoor.Direction = DoorDirection.S; - roomDoor.OriginPosition = new Vector2I(x, room.GetVerticalStart()); - nextRoomDoor.OriginPosition = new Vector2I(x, nextRoom.GetVerticalEnd()); + roomDoor.OriginPosition = new Vector2I(x, roomInfo.GetVerticalStart()); + nextRoomDoor.OriginPosition = new Vector2I(x, nextRoomInfo.GetVerticalEnd()); } //判断门之间的通道是否有物体碰到 @@ -631,8 +606,8 @@ public class DungeonGenerator } //没有撞到物体 - room.Doors.Add(roomDoor); - nextRoom.Doors.Add(nextRoomDoor); + roomInfo.Doors.Add(roomDoor); + nextRoomInfo.Doors.Add(nextRoomDoor); return true; } } @@ -643,36 +618,36 @@ public class DungeonGenerator /// /// 尝试寻找纵轴方向上两个房间的连通的门, 只查找直线通道, 返回是否找到 /// - private bool TryConnectVerticalDoor(RoomInfo room, RoomDoorInfo roomDoor, RoomInfo nextRoom, RoomDoorInfo nextRoomDoor) + private bool TryConnectVerticalDoor(RoomInfo roomInfo, RoomDoorInfo roomDoor, RoomInfo nextRoomInfo, RoomDoorInfo nextRoomDoor) { - var overlapY = Mathf.Min(room.GetVerticalEnd(), nextRoom.GetVerticalEnd()) - - Mathf.Max(room.GetVerticalStart(), nextRoom.GetVerticalStart()); + var overlapY = Mathf.Min(roomInfo.GetVerticalEnd(), nextRoomInfo.GetVerticalEnd()) - + Mathf.Max(roomInfo.GetVerticalStart(), nextRoomInfo.GetVerticalStart()); //这种情况下y轴有重叠 if (overlapY >= 6) { //找到重叠区域 - var rangeList = FindPassage(room, nextRoom, - room.GetHorizontalStart() < nextRoom.GetHorizontalStart() ? DoorDirection.E : DoorDirection.W); + var rangeList = FindPassage(roomInfo, nextRoomInfo, + roomInfo.GetHorizontalStart() < nextRoomInfo.GetHorizontalStart() ? DoorDirection.E : DoorDirection.W); while (rangeList.Count > 0) { //找到重叠区域 - var range = Utils.RandomChooseAndRemove(rangeList); - var y = Utils.RandomRangeInt(range.X, range.Y); + var range = Random.RandomChooseAndRemove(rangeList); + var y = Random.RandomRangeInt(range.X, range.Y); - if (room.GetHorizontalStart() < nextRoom.GetHorizontalStart()) //room在左, nextRoom在右 + if (roomInfo.GetHorizontalStart() < nextRoomInfo.GetHorizontalStart()) //room在左, nextRoom在右 { roomDoor.Direction = DoorDirection.E; nextRoomDoor.Direction = DoorDirection.W; - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalEnd(), y); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalStart(), y); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalEnd(), y); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalStart(), y); } else //room在右, nextRoom在左 { roomDoor.Direction = DoorDirection.W; nextRoomDoor.Direction = DoorDirection.E; - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalStart(), y); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalEnd(), y); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalStart(), y); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalEnd(), y); } //判断门之间的通道是否有物体碰到 @@ -683,8 +658,8 @@ public class DungeonGenerator } //没有撞到物体 - room.Doors.Add(roomDoor); - nextRoom.Doors.Add(nextRoomDoor); + roomInfo.Doors.Add(roomDoor); + nextRoomInfo.Doors.Add(nextRoomDoor); return true; } } @@ -695,27 +670,27 @@ public class DungeonGenerator /// /// 尝试寻找包含拐角的两个房间的连通的门, 返回是否找到 /// - private bool TryConnectCrossDoor(RoomInfo room, RoomDoorInfo roomDoor, RoomInfo nextRoom, RoomDoorInfo nextRoomDoor) + private bool TryConnectCrossDoor(RoomInfo roomInfo, RoomDoorInfo roomDoor, RoomInfo nextRoomInfo, RoomDoorInfo nextRoomDoor) { //焦点 Vector2I cross = default; - if (room.GetHorizontalStart() > nextRoom.GetHorizontalStart()) + if (roomInfo.GetHorizontalStart() > nextRoomInfo.GetHorizontalStart()) { - if (room.GetVerticalStart() > nextRoom.GetVerticalStart()) + if (roomInfo.GetVerticalStart() > nextRoomInfo.GetVerticalStart()) { - if (Utils.RandomBoolean()) //↑ //→ + if (Random.RandomBoolean()) //↑ //→ { - if (!TryConnect_NE_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_WS_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_NE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_WS_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } } else //← //↓ { - if (!TryConnect_WS_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_NE_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_WS_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_NE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } @@ -723,18 +698,18 @@ public class DungeonGenerator } else { - if (Utils.RandomBoolean()) //↓ //→ + if (Random.RandomBoolean()) //↓ //→ { - if (!TryConnect_SE_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_WN_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_SE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_WN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } } else //← //↑ { - if (!TryConnect_WN_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_SE_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_WN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_SE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } @@ -743,20 +718,20 @@ public class DungeonGenerator } else { - if (room.GetVerticalStart() > nextRoom.GetVerticalStart()) //→ //↓ + if (roomInfo.GetVerticalStart() > nextRoomInfo.GetVerticalStart()) //→ //↓ { - if (Utils.RandomBoolean()) + if (Random.RandomBoolean()) { - if (!TryConnect_ES_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_NW_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_ES_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_NW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } } else //↑ //← { - if (!TryConnect_NW_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_ES_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_NW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_ES_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } @@ -764,18 +739,18 @@ public class DungeonGenerator } else { - if (Utils.RandomBoolean()) //→ //↑ + if (Random.RandomBoolean()) //→ //↑ { - if (!TryConnect_EN_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_SW_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_EN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_SW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } } else //↓ //← { - if (!TryConnect_SW_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross) && - !TryConnect_EN_Door(room, nextRoom, roomDoor, nextRoomDoor, ref cross)) + if (!TryConnect_SW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && + !TryConnect_EN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) { return false; } @@ -795,24 +770,24 @@ public class DungeonGenerator nextRoomDoor.HasCross = true; nextRoomDoor.Cross = cross; - room.Doors.Add(roomDoor); - nextRoom.Doors.Add(nextRoomDoor); + roomInfo.Doors.Add(roomDoor); + nextRoomInfo.Doors.Add(nextRoomDoor); return true; } - private bool FindCrossPassage(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor,ref int offset1, ref int offset2) + private bool FindCrossPassage(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor,ref int offset1, ref int offset2) { - var room1 = room.RoomSplit.RoomInfo; - var room2 = nextRoom.RoomSplit.RoomInfo; + var room1 = roomInfo.RoomSplit.RoomInfo; + var room2 = nextRoomInfo.RoomSplit.RoomInfo; int? temp1 = null; int? temp2 = null; - foreach (var areaInfo1 in room1.DoorAreaInfos) + foreach (var areaInfo1 in room1.GetCompletionDoorArea()) { if (areaInfo1.Direction == roomDoor.Direction) { - FindCrossPassage_Area(areaInfo1, room, nextRoom, ref temp1); + FindCrossPassage_Area(areaInfo1, roomInfo, nextRoomInfo, ref temp1); } } @@ -821,11 +796,11 @@ public class DungeonGenerator return false; } - foreach (var areaInfo2 in room2.DoorAreaInfos) + foreach (var areaInfo2 in room2.GetCompletionDoorArea()) { if (areaInfo2.Direction == nextRoomDoor.Direction) { - FindCrossPassage_Area(areaInfo2, nextRoom, room, ref temp2); + FindCrossPassage_Area(areaInfo2, nextRoomInfo, roomInfo, ref temp2); } } @@ -929,26 +904,26 @@ public class DungeonGenerator } } - private bool TryConnect_NE_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_NE_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { var offset1 = 0; var offset2 = 0; roomDoor.Direction = DoorDirection.N; //↑ nextRoomDoor.Direction = DoorDirection.E; //→ - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalStart() + offset1, room.GetVerticalStart()); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalEnd(), - nextRoom.GetVerticalStart() + offset2); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalStart() + offset1, roomInfo.GetVerticalStart()); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalEnd(), + nextRoomInfo.GetVerticalStart() + offset2); cross = new Vector2I(roomDoor.OriginPosition.X, nextRoomDoor.OriginPosition.Y); return true; } - private bool TryConnect_WS_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_WS_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { //ok var offset1 = 0; @@ -956,128 +931,128 @@ public class DungeonGenerator roomDoor.Direction = DoorDirection.W; //← nextRoomDoor.Direction = DoorDirection.S; //↓ - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalStart(), room.GetVerticalStart() + offset1); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalStart() + offset2, nextRoom.GetVerticalEnd()); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalStart(), roomInfo.GetVerticalStart() + offset1); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalStart() + offset2, nextRoomInfo.GetVerticalEnd()); cross = new Vector2I(nextRoomDoor.OriginPosition.X, roomDoor.OriginPosition.Y); return true; } - private bool TryConnect_SE_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_SE_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { var offset1 = 0; var offset2 = 0; roomDoor.Direction = DoorDirection.S; //↓ nextRoomDoor.Direction = DoorDirection.E; //→ - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalStart() + offset1, room.GetVerticalEnd()); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalEnd(), - nextRoom.GetVerticalStart() + offset2); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalStart() + offset1, roomInfo.GetVerticalEnd()); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalEnd(), + nextRoomInfo.GetVerticalStart() + offset2); cross = new Vector2I(roomDoor.OriginPosition.X, nextRoomDoor.OriginPosition.Y); return true; } - private bool TryConnect_WN_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_WN_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { var offset1 = 0; var offset2 = 0; roomDoor.Direction = DoorDirection.W; //← nextRoomDoor.Direction = DoorDirection.N; //↑ - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } roomDoor.OriginPosition = - new Vector2I(room.GetHorizontalStart(), room.GetVerticalStart() + offset1); // - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalStart() + offset2, - nextRoom.GetVerticalStart()); + new Vector2I(roomInfo.GetHorizontalStart(), roomInfo.GetVerticalStart() + offset1); // + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalStart() + offset2, + nextRoomInfo.GetVerticalStart()); cross = new Vector2I(nextRoomDoor.OriginPosition.X, roomDoor.OriginPosition.Y); return true; } - private bool TryConnect_ES_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_ES_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { var offset1 = 0; var offset2 = 0; roomDoor.Direction = DoorDirection.E; //→ nextRoomDoor.Direction = DoorDirection.S; //↓ - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalEnd(), room.GetVerticalStart() + offset1); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalStart() + offset2, - nextRoom.GetVerticalEnd()); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalEnd(), roomInfo.GetVerticalStart() + offset1); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalStart() + offset2, + nextRoomInfo.GetVerticalEnd()); cross = new Vector2I(nextRoomDoor.OriginPosition.X, roomDoor.OriginPosition.Y); return true; } - private bool TryConnect_NW_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_NW_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { var offset1 = 0; var offset2 = 0; roomDoor.Direction = DoorDirection.N; //↑ nextRoomDoor.Direction = DoorDirection.W; //← - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalStart() + offset1, room.GetVerticalStart()); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalStart(), - nextRoom.GetVerticalStart() + offset2); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalStart() + offset1, roomInfo.GetVerticalStart()); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalStart(), + nextRoomInfo.GetVerticalStart() + offset2); cross = new Vector2I(roomDoor.OriginPosition.X, nextRoomDoor.OriginPosition.Y); return true; } - private bool TryConnect_EN_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_EN_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { var offset1 = 0; var offset2 = 0; roomDoor.Direction = DoorDirection.E; //→ nextRoomDoor.Direction = DoorDirection.N; //↑ - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalEnd(), - room.GetVerticalStart() + offset1); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalStart() + offset2, nextRoom.GetVerticalStart()); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalEnd(), + roomInfo.GetVerticalStart() + offset1); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalStart() + offset2, nextRoomInfo.GetVerticalStart()); cross = new Vector2I(nextRoomDoor.OriginPosition.X, roomDoor.OriginPosition.Y); return true; } - private bool TryConnect_SW_Door(RoomInfo room, RoomInfo nextRoom, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) + private bool TryConnect_SW_Door(RoomInfo roomInfo, RoomInfo nextRoomInfo, RoomDoorInfo roomDoor, RoomDoorInfo nextRoomDoor, ref Vector2I cross) { var offset1 = 0; var offset2 = 0; roomDoor.Direction = DoorDirection.S; //↓ nextRoomDoor.Direction = DoorDirection.W; //← - if (!FindCrossPassage(room, nextRoom, roomDoor, nextRoomDoor, ref offset1, ref offset2)) + if (!FindCrossPassage(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref offset1, ref offset2)) { return false; } - roomDoor.OriginPosition = new Vector2I(room.GetHorizontalStart() + offset1, - room.GetVerticalEnd()); - nextRoomDoor.OriginPosition = new Vector2I(nextRoom.GetHorizontalStart(), nextRoom.GetVerticalStart() + offset2); + roomDoor.OriginPosition = new Vector2I(roomInfo.GetHorizontalStart() + offset1, + roomInfo.GetVerticalEnd()); + nextRoomDoor.OriginPosition = new Vector2I(nextRoomInfo.GetHorizontalStart(), nextRoomInfo.GetVerticalStart() + offset2); cross = new Vector2I(roomDoor.OriginPosition.X, nextRoomDoor.OriginPosition.Y); return true; } @@ -1085,25 +1060,25 @@ public class DungeonGenerator /// /// 查找房间的连接通道, 函数返回是否找到对应的门, 通过 result 返回 x/y 轴坐标 /// - /// 第一个房间 - /// 第二个房间 + /// 第一个房间 + /// 第二个房间 /// 第一个房间连接方向 - private List FindPassage(RoomInfo room, RoomInfo nextRoom, DoorDirection direction) + private List FindPassage(RoomInfo roomInfo, RoomInfo nextRoomInfo, DoorDirection direction) { - var room1 = room.RoomSplit.RoomInfo; - var room2 = nextRoom.RoomSplit.RoomInfo; + var room1 = roomInfo.RoomSplit.RoomInfo; + var room2 = nextRoomInfo.RoomSplit.RoomInfo; //用于存储符合生成条件的区域 var rangeList = new List(); - foreach (var doorAreaInfo1 in room1.DoorAreaInfos) + foreach (var doorAreaInfo1 in room1.GetCompletionDoorArea()) { if (doorAreaInfo1.Direction == direction) { //第二个门的方向 var direction2 = GetReverseDirection(direction); - foreach (var doorAreaInfo2 in room2.DoorAreaInfos) + foreach (var doorAreaInfo2 in room2.GetCompletionDoorArea()) { if (doorAreaInfo2.Direction == direction2) { @@ -1111,21 +1086,21 @@ public class DungeonGenerator if (direction == DoorDirection.E || direction == DoorDirection.W) //第二个门向← 或者 第二个门向→ { range = CalcOverlapRange( - room.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo1.Start, room.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo1.End, - nextRoom.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo2.Start, nextRoom.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo2.End + roomInfo.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo1.Start, roomInfo.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo1.End, + nextRoomInfo.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo2.Start, nextRoomInfo.GetVerticalStart() * GameConfig.TileCellSize + doorAreaInfo2.End ); } else //第二个门向↑ 或者 第二个门向↓ { range = CalcOverlapRange( - room.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo1.Start, room.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo1.End, - nextRoom.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo2.Start, nextRoom.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo2.End + roomInfo.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo1.Start, roomInfo.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo1.End, + nextRoomInfo.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo2.Start, nextRoomInfo.GetHorizontalStart() * GameConfig.TileCellSize + doorAreaInfo2.End ); } //交集范围够生成门 if (range.Y - range.X >= GameConfig.CorridorWidth * GameConfig.TileCellSize) { - rangeList.Add(new Vector2I((int)(range.X / 16), (int)(range.Y / 16) - GameConfig.CorridorWidth)); + rangeList.Add(new Vector2I((int)(range.X / GameConfig.TileCellSize), (int)(range.Y / GameConfig.TileCellSize) - GameConfig.CorridorWidth)); } } } @@ -1189,23 +1164,23 @@ public class DungeonGenerator { var point1 = door1.OriginPosition; var point2 = door2.OriginPosition; - var pos = new Vector2(Mathf.Min(point1.X, point2.X), Mathf.Min(point1.Y, point2.Y)); - var size = new Vector2( + var pos = new Vector2I(Mathf.Min(point1.X, point2.X), Mathf.Min(point1.Y, point2.Y)); + var size = new Vector2I( point1.X == point2.X ? GameConfig.CorridorWidth : Mathf.Abs(point1.X - point2.X), point1.Y == point2.Y ? GameConfig.CorridorWidth : Mathf.Abs(point1.Y - point2.Y) ); - Vector2 collPos; - Vector2 collSize; + Vector2I collPos; + Vector2I collSize; if (point1.X == point2.X) //纵向加宽, 防止贴到其它墙 { - collPos = new Vector2(pos.X - GameConfig.RoomSpace, pos.Y); - collSize = new Vector2(size.X + GameConfig.RoomSpace * 2, size.Y); + collPos = new Vector2I(pos.X - GameConfig.RoomSpace, pos.Y); + collSize = new Vector2I(size.X + GameConfig.RoomSpace * 2, size.Y); } else //横向加宽, 防止贴到其它墙 { - collPos = new Vector2(pos.X, pos.Y - GameConfig.RoomSpace); - collSize = new Vector2(size.X, size.Y + GameConfig.RoomSpace * 2); + collPos = new Vector2I(pos.X, pos.Y - GameConfig.RoomSpace); + collSize = new Vector2I(size.X, size.Y + GameConfig.RoomSpace * 2); } if (_roomGrid.RectCollision(collPos, collSize)) @@ -1213,38 +1188,38 @@ public class DungeonGenerator return false; } - door2.RoomInfo.AisleArea.Add(new Rect2(pos, size)); - _roomGrid.AddRect(pos, size, true); + door2.RoomInfo.AisleArea.Add(new Rect2I(pos, size)); + _roomGrid.SetRect(pos, size, true); return true; } //将两个门间的过道占用数据存入RoomGrid, 该重载加入拐角点 - private bool AddCorridorToGridRange(RoomDoorInfo door1, RoomDoorInfo door2, Vector2 cross) + private bool AddCorridorToGridRange(RoomDoorInfo door1, RoomDoorInfo door2, Vector2I cross) { var point1 = door1.OriginPosition; var point2 = door2.OriginPosition; - var pos1 = new Vector2(Mathf.Min(point1.X, cross.X), Mathf.Min(point1.Y, cross.Y)); - var size1 = new Vector2( + var pos1 = new Vector2I(Mathf.Min(point1.X, cross.X), Mathf.Min(point1.Y, cross.Y)); + var size1 = new Vector2I( point1.X == cross.X ? GameConfig.CorridorWidth : Mathf.Abs(point1.X - cross.X), point1.Y == cross.Y ? GameConfig.CorridorWidth : Mathf.Abs(point1.Y - cross.Y) ); - var pos2 = new Vector2(Mathf.Min(point2.X, cross.X), Mathf.Min(point2.Y, cross.Y)); - var size2 = new Vector2( + var pos2 = new Vector2I(Mathf.Min(point2.X, cross.X), Mathf.Min(point2.Y, cross.Y)); + var size2 = new Vector2I( point2.X == cross.X ? GameConfig.CorridorWidth : Mathf.Abs(point2.X - cross.X), point2.Y == cross.Y ? GameConfig.CorridorWidth : Mathf.Abs(point2.Y - cross.Y) ); - Vector2 collPos1; - Vector2 collSize1; + Vector2I collPos1; + Vector2I collSize1; if (point1.X == cross.X) //纵向加宽, 防止贴到其它墙 { - collPos1 = new Vector2(pos1.X - GameConfig.RoomSpace, pos1.Y); - collSize1 = new Vector2(size1.X + GameConfig.RoomSpace * 2, size1.Y); + collPos1 = new Vector2I(pos1.X - GameConfig.RoomSpace, pos1.Y); + collSize1 = new Vector2I(size1.X + GameConfig.RoomSpace * 2, size1.Y); } else //横向加宽, 防止贴到其它墙 { - collPos1 = new Vector2(pos1.X, pos1.Y - GameConfig.RoomSpace); - collSize1 = new Vector2(size1.X, size1.Y + GameConfig.RoomSpace * 2); + collPos1 = new Vector2I(pos1.X, pos1.Y - GameConfig.RoomSpace); + collSize1 = new Vector2I(size1.X, size1.Y + GameConfig.RoomSpace * 2); } if (_roomGrid.RectCollision(collPos1, collSize1)) @@ -1252,17 +1227,17 @@ public class DungeonGenerator return false; } - Vector2 collPos2; - Vector2 collSize2; + Vector2I collPos2; + Vector2I collSize2; if (point2.X == cross.X) //纵向加宽, 防止贴到其它墙 { - collPos2 = new Vector2(pos2.X - GameConfig.RoomSpace, pos2.Y); - collSize2 = new Vector2(size2.X + GameConfig.RoomSpace * 2, size2.Y); + collPos2 = new Vector2I(pos2.X - GameConfig.RoomSpace, pos2.Y); + collSize2 = new Vector2I(size2.X + GameConfig.RoomSpace * 2, size2.Y); } else //横向加宽, 防止贴到其它墙 { - collPos2 = new Vector2(pos2.X, pos2.Y - GameConfig.RoomSpace); - collSize2 = new Vector2(size2.X, size2.Y + GameConfig.RoomSpace * 2); + collPos2 = new Vector2I(pos2.X, pos2.Y - GameConfig.RoomSpace); + collSize2 = new Vector2I(size2.X, size2.Y + GameConfig.RoomSpace * 2); } if (_roomGrid.RectCollision(collPos2, collSize2)) @@ -1270,10 +1245,10 @@ public class DungeonGenerator return false; } - door2.RoomInfo.AisleArea.Add(new Rect2(pos1, size1)); - door2.RoomInfo.AisleArea.Add(new Rect2(pos2, size2)); - _roomGrid.AddRect(pos1, size1, true); - _roomGrid.AddRect(pos2, size2, true); + door2.RoomInfo.AisleArea.Add(new Rect2I(pos1, size1)); + door2.RoomInfo.AisleArea.Add(new Rect2I(pos2, size2)); + _roomGrid.SetRect(pos1, size1, true); + _roomGrid.SetRect(pos2, size2, true); return true; } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomSplit.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomSplit.cs deleted file mode 100644 index 32f00c74d70b19f2c11ae6bdff238e1cca55d6b7..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomSplit.cs +++ /dev/null @@ -1,54 +0,0 @@ - -using System.Text.Json; -using System.Text.Json.Serialization; -using FileAccess = Godot.FileAccess; - -/// -/// 房间配置文件相关信息, 将会在 RoomConfig.json 中汇总 -/// -public class DungeonRoomSplit -{ - /// - /// 房间场景路径 - /// - [JsonInclude] - public string ScenePath; - - /// - /// 房间配置路径 - /// - [JsonInclude] - public string ConfigPath; - - /// - /// 房间配置数据, 第一次获取会要在资源中加载数据 - /// - [JsonIgnore] - public DungeonRoomInfo RoomInfo - { - get - { - if (_roomInfo == null) - { - var file = FileAccess.Open(ConfigPath, FileAccess.ModeFlags.Read); - var asText = file.GetAsText(); - _roomInfo = JsonSerializer.Deserialize(asText); - file.Dispose(); - - //需要处理 DoorAreaInfos 长度为 0 的房间, 并为其配置默认值 - var areaInfos = _roomInfo.DoorAreaInfos; - if (areaInfos.Count == 0) - { - areaInfos.Add(new DoorAreaInfo(DoorDirection.N, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.S, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.W, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.E, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); - } - } - - return _roomInfo; - } - } - - private DungeonRoomInfo _roomInfo; -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs deleted file mode 100644 index 74a374898adbec8477c7386bf928d19075ed13f8..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs +++ /dev/null @@ -1,1039 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text.Json; -using Godot; - -[Tool] -public partial class DungeonRoomTemplate : TileMap -{ - /// - /// 默认权重值 - /// - public const int DefaultWeight = 100; - - /// - /// 是否启用编辑模式 - /// - [Export] - public bool EnableEdit = false; - - /// - /// 房间权重, 值越大, 生成地牢是越容易出现该房间 - /// - [Export(PropertyHint.Range, "1, 500")] - public int Weight - { - get => _weight; - set - { - _weight = value; - _changeWeight = true; - _changeWeightTimer = 0; - } - } - private int _weight = DefaultWeight; - private bool _changeWeight = false; - private float _changeWeightTimer = 0; - -#if TOOLS - //是否悬停在线上 - private bool _hover = false; - - //悬停点 - private Vector2 _hoverPoint1; - private Vector2 _hoverPoint2; - private DoorDirection _hoverDirection; - private bool _canPut = false; - - //选中点 - private bool _hasActivePoint = false; - //选中左/右点 - private byte _activePointType = 0; - private DoorAreaInfo _activeArea = null; - - //拖拽 - private bool _isDrag = false; - private float _startDragValue; - private Vector2 _startDragPositionValue; - private bool _dragHasCollision = false; - - private bool _mouseDown = false; - - //房间配置 - private DungeonRoomInfo _dungeonRoomInfo; - private Rect2 _prevRect; - - //是否能是否按下 - private bool _clickSave = false; - - private DungeonTile _dungeonTile; - private TileDrawHandler _tileDrawHandler; - - //计算导航的计时器 - private float _calcTileNavTimer = 0; - - private partial class TileDrawHandler : Node2D - { - public DungeonRoomTemplate RoomTemplate; - - public override void _Draw() - { - if (!Engine.IsEditorHint() || RoomTemplate == null) - { - return; - } - if (RoomTemplate.TileSet != null) - { - //绘制地图轮廓 - var mapRange = CalcTileRange(RoomTemplate); - mapRange.Position -= new Vector2(2, 2); - mapRange.Size += new Vector2(4, 4); - DrawRect(mapRange, RoomTemplate._hover ? Colors.Green : new Color(0.03137255F, 0.59607846F, 0.03137255F), false, 2); - - //绘制悬停 - if (RoomTemplate._hover && !RoomTemplate._isDrag) - { - if (!RoomTemplate._hasActivePoint) //这里判断是否悬停在拖动点上 - { - var color = RoomTemplate._canPut ? new Color(0, 1, 0, 0.2f) : new Color(1, 0, 0, 0.2f); - switch (RoomTemplate._hoverDirection) - { - case DoorDirection.E: - DrawRect( - new Rect2(new Vector2(RoomTemplate._hoverPoint1.X + 2, RoomTemplate._hoverPoint1.Y), 30, - RoomTemplate._hoverPoint2.Y - RoomTemplate._hoverPoint1.Y), color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint1.X + 2, RoomTemplate._hoverPoint1.Y), 5, color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint2.X + 2, RoomTemplate._hoverPoint2.Y), 5, color); - break; - case DoorDirection.W: - DrawRect( - new Rect2(new Vector2(RoomTemplate._hoverPoint1.X - 2 - 30, RoomTemplate._hoverPoint1.Y), 30, - RoomTemplate._hoverPoint2.Y - RoomTemplate._hoverPoint1.Y), color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint1.X - 2, RoomTemplate._hoverPoint1.Y), 5, color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint2.X - 2, RoomTemplate._hoverPoint2.Y), 5, color); - break; - case DoorDirection.S: - DrawRect( - new Rect2(new Vector2(RoomTemplate._hoverPoint1.X, RoomTemplate._hoverPoint1.Y + 2), - RoomTemplate._hoverPoint2.X - RoomTemplate._hoverPoint1.X, 30), color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint1.X, RoomTemplate._hoverPoint1.Y + 2), 5, color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint2.X, RoomTemplate._hoverPoint2.Y + 2), 5, color); - break; - case DoorDirection.N: - DrawRect( - new Rect2(new Vector2(RoomTemplate._hoverPoint1.X, RoomTemplate._hoverPoint1.Y - 30 - 2), - RoomTemplate._hoverPoint2.X - RoomTemplate._hoverPoint1.X, 30), color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint1.X, RoomTemplate._hoverPoint1.Y - 2), 5, color); - DrawCircle(new Vector2(RoomTemplate._hoverPoint2.X, RoomTemplate._hoverPoint2.Y - 2), 5, color); - break; - } - } - } - - //绘制区域 - if (RoomTemplate._dungeonRoomInfo != null && RoomTemplate._dungeonRoomInfo.DoorAreaInfos != null) - { - var color2 = new Color(0, 1, 0, 0.8f); - //绘制已经存在的 - foreach (var doorAreaInfo in RoomTemplate._dungeonRoomInfo.DoorAreaInfos) - { - var flag = RoomTemplate._hasActivePoint && RoomTemplate._activeArea == doorAreaInfo; - var color3 = (flag && RoomTemplate._activePointType == 0) - ? (RoomTemplate._isDrag - ? (RoomTemplate._dragHasCollision - ? new Color(1, 0, 0, 0.8f) - : new Color(0.2F, 0.4117647F, 0.8392157F, 0.8f)) - : new Color(1, 1, 1, 0.8f)) - : color2; - var color4 = (flag && RoomTemplate._activePointType == 1) - ? (RoomTemplate._isDrag - ? (RoomTemplate._dragHasCollision - ? new Color(1, 0, 0, 0.8f) - : new Color(0.2F, 0.4117647F, 0.8392157F, 0.8f)) - : new Color(1, 1, 1, 0.8f)) - : color2; - switch (doorAreaInfo.Direction) - { - case DoorDirection.E: - DrawRect( - new Rect2( - new Vector2(mapRange.Position.X + mapRange.Size.X, - mapRange.Position.Y + doorAreaInfo.Start + 2), 30, - doorAreaInfo.End - doorAreaInfo.Start), color2); - DrawCircle( - new Vector2(mapRange.Position.X + mapRange.Size.X, - mapRange.Position.Y + doorAreaInfo.Start + 2), 5, color3); - DrawCircle( - new Vector2(mapRange.Position.X + mapRange.Size.X, - mapRange.Position.Y + doorAreaInfo.End + 2), - 5, color4); - break; - case DoorDirection.W: - DrawRect( - new Rect2( - new Vector2(mapRange.Position.X - 30, mapRange.Position.Y + doorAreaInfo.Start + 2), - 30, doorAreaInfo.End - doorAreaInfo.Start), color2); - DrawCircle(new Vector2(mapRange.Position.X, mapRange.Position.Y + doorAreaInfo.Start + 2), - 5, - color3); - DrawCircle(new Vector2(mapRange.Position.X, mapRange.Position.Y + doorAreaInfo.End + 2), 5, - color4); - break; - case DoorDirection.S: - DrawRect( - new Rect2( - new Vector2(mapRange.Position.X + doorAreaInfo.Start + 2, - mapRange.Position.Y + mapRange.Size.Y), doorAreaInfo.End - doorAreaInfo.Start, - 30), - color2); - DrawCircle( - new Vector2(mapRange.Position.X + doorAreaInfo.Start + 2, - mapRange.Position.Y + mapRange.Size.Y), 5, color3); - DrawCircle( - new Vector2(mapRange.Position.X + doorAreaInfo.End + 2, - mapRange.Position.Y + mapRange.Size.Y), - 5, color4); - break; - case DoorDirection.N: - DrawRect( - new Rect2( - new Vector2(mapRange.Position.X + doorAreaInfo.Start + 2, mapRange.Position.Y - 30), - doorAreaInfo.End - doorAreaInfo.Start, 30), color2); - DrawCircle(new Vector2(mapRange.Position.X + doorAreaInfo.Start + 2, mapRange.Position.Y), - 5, - color3); - DrawCircle(new Vector2(mapRange.Position.X + doorAreaInfo.End + 2, mapRange.Position.Y), 5, - color4); - break; - } - } - } - - //绘制导航, 现在有点问题, 绘制的内容会被自身的 tile 所挡住 - if (RoomTemplate._dungeonTile != null) - { - var result = RoomTemplate._dungeonTile.GetGenerateNavigationResult(); - if (result != null) - { - if (result.Success) - { - var polygonData = RoomTemplate._dungeonTile.GetPolygonData(); - Utils.DrawNavigationPolygon(this, polygonData, 2); - } - else - { - var color = new Color(1, 0, 0, 0.5f); - var tileCellSize = GameConfig.TileCellSize; - var point = (result.Exception.Point + new Vector2(0.5f, 0.5f)) * tileCellSize; - DrawCircle(point, 4, color); - DrawLine(point + new Vector2(-tileCellSize / 2f, -tileCellSize / 2f), point + new Vector2(tileCellSize / 2f, tileCellSize / 2f), color, 2); - DrawLine(point + new Vector2(-tileCellSize / 2f, tileCellSize / 2f), point + new Vector2(tileCellSize / 2f, -tileCellSize / 2f), color, 2); - } - } - } - } - } - - } - - public override void _Ready() - { - if (!Engine.IsEditorHint()) - { - return; - } - EnableEdit = false; - } - - public override void _Process(double delta) - { - if (!Engine.IsEditorHint()) - { - return; - } - - if (TileSet == null) - { - return; - } - - if (_dungeonTile == null) - { - _dungeonTile = new DungeonTile(this); - _dungeonTile.SetFloorAtlasCoords(new List() { new Vector2I(0, 8) }); - OnTileChanged(); - var callable = new Callable(this, nameof(OnTileChanged)); - if (!IsConnected("changed", callable)) - { - Connect("changed", callable); - } - } - - if (_tileDrawHandler == null) - { - _tileDrawHandler = GetNodeOrNull("TileDrawHandler"); - if (_tileDrawHandler == null) - { - _tileDrawHandler = new TileDrawHandler(); - _tileDrawHandler.RoomTemplate = this; - _tileDrawHandler.Name = "TileDrawHandler"; - _tileDrawHandler.ZIndex = 100; - AddChild(_tileDrawHandler); - } - else - { - _tileDrawHandler.RoomTemplate = this; - } - } - - //导航计算 - if (_calcTileNavTimer > 0) - { - _calcTileNavTimer -= (float)delta; - //重新计算导航 - if (_calcTileNavTimer <= 0) - { - _dungeonTile.GenerateNavigationPolygon(0); - } - } - - //加载配置 - var initConfigs = false; - if (_dungeonRoomInfo == null) - { - initConfigs = true; - - var path = SceneFilePath; - if (!string.IsNullOrEmpty(path)) - { - var start = GameConfig.RoomTileDir.Length + 6; - var name = path.Substring(start, path.Length - start - 5); - ReadConfig(CalcTileRange(this), name); - } - - } - - //按键检测 - var isClick = false; - if (Input.IsMouseButtonPressed(MouseButton.Left)) - { - if (!_mouseDown) - { - _mouseDown = true; - isClick = true; - } - } - else if (_mouseDown) - { - _mouseDown = false; - isClick = false; - } - - if (Input.IsMouseButtonPressed(MouseButton.Middle)) //中键移除门 - { - if (EnableEdit && _activeArea != null) - { - RemoveDoorArea(_activeArea); - _hasActivePoint = false; - _activeArea = null; - } - } - else if (TileSet != null) //编辑操作 - { - var mapRect = CalcTileRange(this); - var mousePosition = GetLocalMousePosition(); - - if (mapRect != _prevRect) - { - if (!initConfigs) - { - OnMapRectChange(); - } - } - - _prevRect = mapRect; - - if (EnableEdit) - { - var tileSize = TileSet.TileSize; - if (_isDrag) //拖拽中 - { - if (_activeArea != null) - { - //拖拽节点操作 - if (_activeArea.Direction == DoorDirection.N || _activeArea.Direction == DoorDirection.S) - { - if (_activePointType == 0) - { - var mouseOffset = Approach(mousePosition.X, tileSize.X); - _activeArea.StartPosition = new Vector2(mouseOffset, _activeArea.StartPosition.Y); - _activeArea.Start = mouseOffset - mapRect.Position.X; - _dragHasCollision = _activeArea.StartPosition.X <= mapRect.Position.X || - _activeArea.StartPosition.X + 3 * tileSize.X >= - _activeArea.EndPosition.X || - CheckDoorCollision(_activeArea.Direction, _activeArea); - } - else - { - var mouseOffset = Approach(mousePosition.X, tileSize.X); - _activeArea.EndPosition = new Vector2(mouseOffset, _activeArea.EndPosition.Y); - _activeArea.End = mouseOffset - mapRect.Position.X; - _dragHasCollision = _activeArea.EndPosition.X >= mapRect.Position.X + mapRect.Size.X || - _activeArea.EndPosition.X - 3 * tileSize.X <= - _activeArea.StartPosition.X || - CheckDoorCollision(_activeArea.Direction, _activeArea); - } - } - else - { - if (_activePointType == 0) - { - var mouseOffset = Approach(mousePosition.Y, tileSize.Y); - _activeArea.StartPosition = new Vector2(_activeArea.StartPosition.X, mouseOffset); - _activeArea.Start = mouseOffset - mapRect.Position.Y; - _dragHasCollision = _activeArea.StartPosition.Y <= mapRect.Position.Y || - _activeArea.StartPosition.Y + 3 * tileSize.Y >= - _activeArea.EndPosition.Y || - CheckDoorCollision(_activeArea.Direction, _activeArea); - } - else - { - var mouseOffset = Approach(mousePosition.Y, tileSize.Y); - _activeArea.EndPosition = new Vector2(_activeArea.EndPosition.X, mouseOffset); - _activeArea.End = mouseOffset - mapRect.Position.Y; - _dragHasCollision = _activeArea.EndPosition.Y >= mapRect.Position.Y + mapRect.Size.Y || - _activeArea.EndPosition.Y - 3 * tileSize.Y <= - _activeArea.StartPosition.Y || - CheckDoorCollision(_activeArea.Direction, _activeArea); - } - } - } - } - else - { - if (Mathf.Abs(mousePosition.Y - mapRect.Position.Y) <= 8 && mousePosition.X >= mapRect.Position.X && - mousePosition.X <= mapRect.Position.X + mapRect.Size.X) //上 - { - _hover = true; - _hoverDirection = DoorDirection.N; - var mouseOffset = Approach(mousePosition.X, tileSize.X); - _hoverPoint1 = new Vector2(mouseOffset - tileSize.X * 2, mapRect.Position.Y); - _hoverPoint2 = new Vector2(_hoverPoint1.X + tileSize.X * 4, _hoverPoint1.Y); - - //判断是否能放下新的门 - if (_hoverPoint1.X <= mapRect.Position.X || - _hoverPoint2.X >= mapRect.Position.X + mapRect.Size.X || - CheckDoorCollision()) - { - _canPut = false; - FindHoverPoint(mouseOffset); - } - else - { - _canPut = true; - _hasActivePoint = false; - _activeArea = null; - } - } - else if (Mathf.Abs(mousePosition.X - mapRect.Position.X) <= 8 && - mousePosition.Y >= mapRect.Position.Y && - mousePosition.Y <= mapRect.Position.Y + mapRect.Size.Y) //左 - { - _hover = true; - _hoverDirection = DoorDirection.W; - var mouseOffset = Approach(mousePosition.Y, tileSize.Y); - _hoverPoint1 = new Vector2(mapRect.Position.X, mouseOffset - tileSize.Y * 2); - _hoverPoint2 = new Vector2(_hoverPoint1.X, _hoverPoint1.Y + tileSize.X * 4); - - //判断是否能放下新的门 - if (_hoverPoint1.Y <= mapRect.Position.Y || - _hoverPoint2.Y >= mapRect.Position.Y + mapRect.Size.Y || - CheckDoorCollision()) - { - _canPut = false; - FindHoverPoint(mouseOffset); - } - else - { - _canPut = true; - _hasActivePoint = false; - _activeArea = null; - } - } - else if (Mathf.Abs(mousePosition.Y - (mapRect.Position.Y + mapRect.Size.Y)) <= 8 && - mousePosition.X >= mapRect.Position.X && - mousePosition.X <= mapRect.Position.X + mapRect.Size.X) //下 - { - _hover = true; - _hoverDirection = DoorDirection.S; - var mouseOffset = Approach(mousePosition.X, tileSize.X); - _hoverPoint1 = new Vector2(mouseOffset - tileSize.X * 2, - mapRect.Position.Y + mapRect.Size.Y); - _hoverPoint2 = new Vector2(_hoverPoint1.X + tileSize.X * 4, _hoverPoint1.Y); - - //判断是否能放下新的门 - if (_hoverPoint1.X <= mapRect.Position.X || - _hoverPoint2.X >= mapRect.Position.X + mapRect.Size.X || - CheckDoorCollision()) - { - _canPut = false; - FindHoverPoint(mouseOffset); - } - else - { - _canPut = true; - _hasActivePoint = false; - _activeArea = null; - } - } - else if (Mathf.Abs(mousePosition.X - (mapRect.Position.X + mapRect.Size.X)) <= 8 && - mousePosition.Y >= mapRect.Position.Y && - mousePosition.Y <= mapRect.Position.Y + mapRect.Size.Y) //右 - { - _hover = true; - _hoverDirection = DoorDirection.E; - var mouseOffset = Approach(mousePosition.Y, tileSize.Y); - _hoverPoint1 = new Vector2(mapRect.Position.X + mapRect.Size.X, - mouseOffset - tileSize.Y * 2); - _hoverPoint2 = new Vector2(_hoverPoint1.X, _hoverPoint1.Y + tileSize.X * 4); - - //判断是否能放下新的门 - if (_hoverPoint1.Y <= mapRect.Position.Y || - _hoverPoint2.Y >= mapRect.Position.Y + mapRect.Size.Y || - CheckDoorCollision()) - { - _canPut = false; - FindHoverPoint(mouseOffset); - } - else - { - _canPut = true; - _hasActivePoint = false; - _activeArea = null; - } - } - else - { - ClearState(); - } - } - - if (isClick && _canPut) //判断是否可以创建新的点 - { - CreateDoorArea(mapRect); - } - else if (_mouseDown && !_isDrag) //拖拽节点 - { - _isDrag = true; - _dragHasCollision = false; - if (_activeArea != null) - { - if (_activePointType == 0) - { - _startDragValue = _activeArea.Start; - _startDragPositionValue = _activeArea.StartPosition; - } - else - { - _startDragValue = _activeArea.End; - _startDragPositionValue = _activeArea.EndPosition; - } - } - } - else if (!_mouseDown && _isDrag) //松开拖拽的点 - { - _isDrag = false; - if (_activeArea != null) //提交拖拽结果 - { - if (_dragHasCollision) - { - if (_activePointType == 0) - { - _activeArea.Start = _startDragValue; - _activeArea.StartPosition = _startDragPositionValue; - } - else - { - _activeArea.End = _startDragValue; - _activeArea.EndPosition = _startDragPositionValue; - } - } - - //OnDoorAreaChange(); - } - - _dragHasCollision = false; - } - } - else - { - ClearState(); - } - - _tileDrawHandler.QueueRedraw(); - } - else - { - ClearState(); - } - - //按下 ctrl + s 保存 - if (Input.IsKeyPressed(Key.Ctrl) && Input.IsKeyPressed(Key.S)) - { - if (!_clickSave) - { - TriggerSave(); - } - _clickSave = true; - - // if (_canSave) - // { - // _canSave = false; - // TriggerSave(); - // } - } - else - { - _clickSave = false; - } - - //权重发生改变 - if (_changeWeight) - { - _changeWeightTimer += (float)delta; - if (_changeWeightTimer > 1) - { - _changeWeightTimer = 0; - _changeWeight = false; - //权重改变, 保存数据 - TriggerSave(); - } - } - } - - private void ClearState() - { - _hover = false; - _canPut = false; - _hasActivePoint = false; - _activeArea = null; - } - - private void OnTileChanged() - { - _calcTileNavTimer = 1f; - } - - //创建门 - private void CreateDoorArea(Rect2 mapRect) - { - var doorAreaInfo = new DoorAreaInfo(); - doorAreaInfo.Direction = _hoverDirection; - doorAreaInfo.StartPosition = _hoverPoint1; - doorAreaInfo.EndPosition = _hoverPoint2; - switch (_hoverDirection) - { - case DoorDirection.E: - case DoorDirection.W: - doorAreaInfo.Start = _hoverPoint1.Y - mapRect.Position.Y; - doorAreaInfo.End = _hoverPoint2.Y - mapRect.Position.Y; - break; - case DoorDirection.N: - case DoorDirection.S: - doorAreaInfo.Start = _hoverPoint1.X - mapRect.Position.X; - doorAreaInfo.End = _hoverPoint2.X - mapRect.Position.X; - break; - } - - _dungeonRoomInfo.DoorAreaInfos.Add(doorAreaInfo); - //OnDoorAreaChange(); - } - - //移除门 - private void RemoveDoorArea(DoorAreaInfo doorAreaInfo) - { - _dungeonRoomInfo.DoorAreaInfos.Remove(doorAreaInfo); - //OnDoorAreaChange(); - } - - //检查门是否有碰撞 - private bool CheckDoorCollision() - { - foreach (var doorAreaInfo in _dungeonRoomInfo.DoorAreaInfos) - { - if (doorAreaInfo.Direction == _hoverDirection) - { - switch (_hoverDirection) - { - case DoorDirection.E: - case DoorDirection.W: - if (CheckValueCollision(doorAreaInfo.StartPosition.Y, doorAreaInfo.EndPosition.Y, _hoverPoint1.Y, _hoverPoint2.Y)) - { - return true; - } - break; - case DoorDirection.S: - case DoorDirection.N: - if (CheckValueCollision(doorAreaInfo.StartPosition.X, doorAreaInfo.EndPosition.X, _hoverPoint1.X, _hoverPoint2.X)) - { - return true; - } - break; - } - } - } - - return false; - } - - //检查门是否有碰撞 - private bool CheckDoorCollision(DoorDirection direction, DoorAreaInfo info) - { - foreach (var doorAreaInfo in _dungeonRoomInfo.DoorAreaInfos) - { - if (doorAreaInfo.Direction == direction && info != doorAreaInfo && - CheckValueCollision(doorAreaInfo.Start, doorAreaInfo.End, info.Start, info.End)) - { - return true; - } - } - - return false; - } - - private bool CheckValueCollision(float o1, float o2, float h1, float h2) - { - var size = TileSet.TileSize.X; - return !(h2 < o1 - 3 * size || o2 + 3 * size < h1); - } - - private void FindHoverPoint(float mouseOffset) - { - if (_isDrag) - { - return; - } - - //检测是否有碰撞的点 - var flag = false; - foreach (var doorAreaInfo in _dungeonRoomInfo.DoorAreaInfos) - { - if (doorAreaInfo.Direction == _hoverDirection) - { - if (_hoverDirection == DoorDirection.N || _hoverDirection == DoorDirection.S) - { - if (Math.Abs(doorAreaInfo.StartPosition.X - mouseOffset) < 0.0001f) - { - _hasActivePoint = true; - _activePointType = 0; - _activeArea = doorAreaInfo; - flag = true; - break; - } - else if (Math.Abs(doorAreaInfo.EndPosition.X - mouseOffset) < 0.0001f) - { - _hasActivePoint = true; - _activePointType = 1; - _activeArea = doorAreaInfo; - flag = true; - break; - } - } - else - { - if (Math.Abs(doorAreaInfo.StartPosition.Y - mouseOffset) < 0.0001f) - { - _hasActivePoint = true; - _activePointType = 0; - _activeArea = doorAreaInfo; - flag = true; - break; - } - else if (Math.Abs(doorAreaInfo.EndPosition.Y - mouseOffset) < 0.0001f) - { - _hasActivePoint = true; - _activePointType = 1; - _activeArea = doorAreaInfo; - flag = true; - break; - } - } - } - } - - if (!flag) - { - _hasActivePoint = false; - _activeArea = null; - } - } - - private float Approach(float value, float period) - { - var temp = value % period; - if (Mathf.Abs(temp) >= period / 2) - { - return ((int)(value / period) + (value >= 0 ? 1 : -1)) * period; - } - - return (int)(value / period) * period; - } - - //地图大小改变 - private void OnMapRectChange() - { - _dungeonRoomInfo.DoorAreaInfos.Clear(); - _canPut = false; - _hasActivePoint = false; - _activeArea = null; - //OnDoorAreaChange(); - } - - // //区域数据修改 - // private void OnDoorAreaChange() - // { - // _canSave = true; - // } - - //触发保存操作 - private void TriggerSave() - { - //如果没有找到对应的场景文件,则不保存 - var path = _dungeonRoomInfo.GroupName + "/" + DungeonRoomTypeToString(_dungeonRoomInfo.RoomType) + "/" + _dungeonRoomInfo.FileName; - if (!File.Exists(GameConfig.RoomTileDir + path + ".tscn")) - { - return; - } - //计算导航网格 - _dungeonTile.GenerateNavigationPolygon(0); - var polygonData = _dungeonTile.GetPolygonData(); - var rect = GetUsedRect(); - SaveConfig(_dungeonRoomInfo.DoorAreaInfos, rect.Position, rect.Size, polygonData.ToList(), - _dungeonRoomInfo.GroupName, _dungeonRoomInfo.RoomType, Name, Weight); - } - - /// - /// 计算tile所占区域 - /// - /// - public static Rect2 CalcTileRange(TileMap tileMap) - { - var usedRect = tileMap.GetUsedRect(); - var pos = usedRect.Position * tileMap.TileSet.TileSize; - var size = usedRect.Size * tileMap.TileSet.TileSize; - return new Rect2(tileMap.ToLocal(pos), size); - } - - /// - /// 保存房间配置 - /// - public static void SaveConfig(List doorConfigs, Vector2I position, Vector2I size, List polygonData, - string groupName, DungeonRoomType roomType, string fileName, int weight) - { - //存入本地 - var path = GameConfig.RoomTileDataDir + groupName + "/" + DungeonRoomTypeToString(roomType); - if (!Directory.Exists(path)) - { - Directory.CreateDirectory(path); - } - - var roomInfo = new DungeonRoomInfo(); - roomInfo.Position = new SerializeVector2(position); - roomInfo.Size = new SerializeVector2(size); - roomInfo.DoorAreaInfos = doorConfigs; - roomInfo.NavigationList = polygonData; - roomInfo.RoomType = roomType; - roomInfo.GroupName = groupName; - roomInfo.FileName = fileName; - roomInfo.Weight = weight; - - var config = new JsonSerializerOptions(); - config.WriteIndented = true; - - path += "/" + fileName + ".json"; - var jsonStr = JsonSerializer.Serialize(roomInfo, config); - File.WriteAllText(path, jsonStr); - GD.Print("保存房间配置成功!路径为:" + path); - } - - /// - /// 读取房间配置 - /// - private void ReadConfig(Rect2 mapRect, string name) - { - var path = GameConfig.RoomTileDataDir + name + ".json"; - - if (File.Exists(path)) - { - var text = File.ReadAllText(path); - try - { - _dungeonRoomInfo = DeserializeDungeonRoomInfo(text); - - //填充 StartPosition 和 EndPosition 数据 - foreach (var doorAreaInfo in _dungeonRoomInfo.DoorAreaInfos) - { - doorAreaInfo.CalcPosition(mapRect.Position, mapRect.Size); - } - - Weight = _dungeonRoomInfo.Weight; - } - catch (Exception e) - { - GD.PrintErr($"加载房间数据'{path}'发生异常: " + e); - } - } - } - - /// - /// 反序列化 DungeonRoomInfo - /// - public static DungeonRoomInfo DeserializeDungeonRoomInfo(string text) - { - // 下面这句代码在 Godot4.0_rc2的编辑器模式下, 重载脚本会导致编辑器一直报错!, 所以暂时先用下面的方法 - //var roomInfo = JsonSerializer.Deserialize(text); - - var obj = Json.ParseString(text).AsGodotDictionary(); - var roomInfo = new DungeonRoomInfo(); - if (obj.ContainsKey("Position")) - { - var position = obj["Position"].AsGodotDictionary(); - roomInfo.Position = new SerializeVector2(position["X"].AsInt32(), position["Y"].AsInt32()); - } - - if (obj.ContainsKey("Size")) - { - var size = obj["Size"].AsGodotDictionary(); - roomInfo.Size = new SerializeVector2(size["X"].AsInt32(), size["Y"].AsInt32()); - } - - if (obj.ContainsKey("RoomType")) - { - var roomType = obj["RoomType"].AsInt32(); - roomInfo.RoomType = (DungeonRoomType)roomType; - } - - if (obj.ContainsKey("GroupName")) - { - roomInfo.GroupName = obj["GroupName"].AsString(); - } - - if (obj.ContainsKey("FileName")) - { - roomInfo.FileName = obj["FileName"].AsString(); - } - - if (obj.ContainsKey("Weight")) - { - roomInfo.Weight = obj["Weight"].AsInt32(); - } - - if (obj.ContainsKey("DoorAreaInfos")) - { - var doorAreaInfos = obj["DoorAreaInfos"].AsGodotArray(); - roomInfo.DoorAreaInfos = new List(); - foreach (var item in doorAreaInfos) - { - var temp = item.AsGodotDictionary(); - var doorInfo = new DoorAreaInfo(); - doorInfo.Direction = (DoorDirection)temp["Direction"].AsInt32(); - doorInfo.Start = temp["Start"].AsInt32(); - doorInfo.End = temp["End"].AsInt32(); - roomInfo.DoorAreaInfos.Add(doorInfo); - } - } - - if (obj.ContainsKey("NavigationList")) - { - var navigationArray = obj["NavigationList"].AsGodotArray(); - roomInfo.NavigationList = new List(); - for (var i = 0; i < navigationArray.Count; i++) - { - var navigation = navigationArray[i].AsGodotDictionary(); - var polygonData = new NavigationPolygonData(); - - polygonData.Type = (NavigationPolygonType)navigation["Type"].AsInt32(); - polygonData.Points = new List(); - var pointArray = navigation["Points"].AsGodotArray(); - for (var j = 0; j < pointArray.Count; j++) - { - var point = pointArray[j].AsGodotDictionary(); - polygonData.Points.Add(new SerializeVector2(point["X"].AsInt32(), point["Y"].AsInt32())); - } - - roomInfo.NavigationList.Add(polygonData); - } - } - - return roomInfo; - } - - /// - /// 将房间类型枚举转为字符串 - /// - public static string DungeonRoomTypeToString(DungeonRoomType roomType) - { - switch (roomType) - { - case DungeonRoomType.Battle: return "battle"; - case DungeonRoomType.Inlet: return "inlet"; - case DungeonRoomType.Outlet: return "outlet"; - case DungeonRoomType.Boss: return "boss"; - case DungeonRoomType.Reward: return "reward"; - case DungeonRoomType.Shop: return "shop"; - case DungeonRoomType.Event: return "event"; - } - - return "battle"; - } - - - /// - /// 将房间类型枚举转为描述字符串 - /// - public static string DungeonRoomTypeToDescribeString(DungeonRoomType roomType) - { - switch (roomType) - { - case DungeonRoomType.Battle: return "战斗房间"; - case DungeonRoomType.Inlet: return "起始房间"; - case DungeonRoomType.Outlet: return "结束房间"; - case DungeonRoomType.Boss: return "boss战房间"; - case DungeonRoomType.Reward: return "奖励房间"; - case DungeonRoomType.Shop: return "商店房间"; - case DungeonRoomType.Event: return "事件房间"; - } - - return "战斗房间"; - } -#endif - - /// - /// 获取所有标记数据 - /// - public ActivityMark[] GetMarks() - { - var list = new List(); - foreach (var child in GetChildren()) - { - EachAndGetMarks(child, list); - } - - return list.ToArray(); - } - - private void EachAndGetMarks(Node node, List list) - { - if (node is ActivityMark mark) - { - list.Add(mark); - } - foreach (var child in node.GetChildren()) - { - EachAndGetMarks(child, list); - } - } -} diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs similarity index 68% rename from DungeonShooting_Godot/src/framework/map/DungeonTile.cs rename to DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index b1f513e7b5edd1efa9819cea143d24d95e5b3580..ffdb00d18527bcdba817be92df7cb8efae7cd63f 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -1,16 +1,17 @@ using System.Collections.Generic; +using System.Linq; using Godot; /// /// 地牢地砖管理类, 提供一些操作 TileMap 和计算导航的接口 /// -public class DungeonTile +public class DungeonTileMap { //--------------------- 导航 ------------------------- //已经标记过的点 - private readonly HashSet _usePoints = new HashSet(); + private readonly HashSet _usePoints = new HashSet(); //导航区域数据 private readonly List _polygonDataList = new List(); @@ -26,7 +27,7 @@ public class DungeonTile //生成导航的结果 private GenerateNavigationResult _generateNavigationResult; - public DungeonTile(TileMap tileRoot) + public DungeonTileMap(TileMap tileRoot) { _tileRoot = tileRoot; } @@ -34,17 +35,17 @@ public class DungeonTile /// /// 根据 startRoom 和 config 数据自动填充 tileMap 参数中的地图数据 /// - public void AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoom) + public void AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoomInfo, SeedRandom random) { _connectNavigationItemList.Clear(); - _AutoFillRoomTile(config, startRoom); + _AutoFillRoomTile(config, startRoomInfo, random); } - private void _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo) + private void _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo, SeedRandom random) { foreach (var info in roomInfo.Next) { - _AutoFillRoomTile(config, info); + _AutoFillRoomTile(config, info, random); } //铺房间 @@ -72,79 +73,133 @@ public class DungeonTile } else { - var rectSize = roomInfo.RoomSplit.RoomInfo.Size; - var rectPos = roomInfo.RoomSplit.RoomInfo.Position; - var template = ResourceManager.Load(roomInfo.RoomSplit.ScenePath); - var tileInstance = template.Instantiate(); - var offset = roomInfo.GetOffsetPosition(); + //var rectSize = roomInfo.RoomSplit.RoomInfo.Size; + var rectPos = roomInfo.RoomSplit.RoomInfo.Position.AsVector2I(); + //var offset = roomInfo.GetOffsetPosition() / GameConfig.TileCellSizeVector2I; - //其它物体 - var childCount = tileInstance.GetChildCount(); - for (var i = 0; i < childCount; i++) + //填充tile操作 + var tileInfo = roomInfo.RoomSplit.TileInfo; + for (var i = 0; i < tileInfo.Floor.Count; i += 5) { - var item = tileInstance.GetChild(i); - if (!(item is ActivityMark)) - { - item.GetParent().RemoveChild(item); - item.Owner = null; - _tileRoot.AddChild(item); - if (item is Node2D node) - { - node.Position = roomInfo.GetWorldPosition() + (node.GlobalPosition - offset); - } - - i--; - childCount--; - } + var posX = tileInfo.Floor[i]; + var posY = tileInfo.Floor[i + 1]; + var sourceId = tileInfo.Floor[i + 2]; + var atlasCoordsX = tileInfo.Floor[i + 3]; + var atlasCoordsY = tileInfo.Floor[i + 4]; + var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); + _tileRoot.SetCell(GameConfig.FloorMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } - - //物体标记 - var activityMarks = tileInstance.GetMarks(); - foreach (var activityMark in activityMarks) + for (var i = 0; i < tileInfo.Middle.Count; i += 5) { - var pos = activityMark.Position; - activityMark.GetParent().RemoveChild(activityMark); - activityMark.Owner = null; - //_tileRoot.AddChild(activityMark); - activityMark.Position = roomInfo.GetWorldPosition() + (pos - offset); - activityMark.TileRoot = _tileRoot; - //执行预处理操作 - activityMark.Pretreatment(); + var posX = tileInfo.Middle[i]; + var posY = tileInfo.Middle[i + 1]; + var sourceId = tileInfo.Middle[i + 2]; + var atlasCoordsX = tileInfo.Middle[i + 3]; + var atlasCoordsY = tileInfo.Middle[i + 4]; + var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); + _tileRoot.SetCell(GameConfig.MiddleMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } - roomInfo.ActivityMarks.AddRange(activityMarks); - - //填充tile操作 - for (int i = 0; i < rectSize.X; i++) + for (var i = 0; i < tileInfo.Top.Count; i += 5) + { + var posX = tileInfo.Top[i]; + var posY = tileInfo.Top[i + 1]; + var sourceId = tileInfo.Top[i + 2]; + var atlasCoordsX = tileInfo.Top[i + 3]; + var atlasCoordsY = tileInfo.Top[i + 4]; + var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); + _tileRoot.SetCell(GameConfig.TopMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); + } + //随机选择预设 + RoomPreinstallInfo preinstallInfo; + if (EditorPlayManager.IsPlay && roomInfo.RoomType == GameApplication.Instance.DungeonManager.CurrConfig.DesignatedType) //编辑器模式, 指定预设 { - for (int j = 0; j < rectSize.Y; j++) + preinstallInfo = EditorManager.SelectPreinstall; + } + else //普通模式 + { + if (roomInfo.RoomSplit.Preinstall.Count == 1) { - var coords = new Vector2I((int)(rectPos.X + i), (int)(rectPos.Y + j)); - var atlasCoords = tileInstance.GetCellAtlasCoords(0, coords); - if (atlasCoords.X != -1 && atlasCoords.Y != -1) - { - // 在 Godot 4.0 中使用以下这段代码区分层级, 会导致游戏关闭时有概率报错卡死, 目前尚不清楚原因 - //获取自定义层级 - // var customData = tileInstance.GetCellTileData(0, coords).GetCustomData(CustomTileLayerName); - // var layer = customData.AsInt32(); - // layer = Mathf.Clamp(layer, GameConfig.FloorMapLayer, GameConfig.TopMapLayer); - - var layer = GameConfig.FloorMapLayer; - if (config.MiddleLayerAtlasCoords.Contains(atlasCoords)) - { - layer = GameConfig.MiddleMapLayer; - } - else if (config.TopLayerAtlasCoords.Contains(atlasCoords)) - { - layer = GameConfig.TopMapLayer; - } - - _tileRoot.SetCell(layer, new Vector2I(roomInfo.Position.X + i, roomInfo.Position.Y + j), - 0, atlasCoords); - } + preinstallInfo = roomInfo.RoomSplit.Preinstall[0]; + } + else + { + var weights = roomInfo.RoomSplit.Preinstall.Select(info => info.Weight).ToArray(); + var index = random.RandomWeight(weights); + preinstallInfo = roomInfo.RoomSplit.Preinstall[index]; } } - tileInstance.CallDeferred(Node.MethodName.QueueFree); + + var roomPreinstall = new RoomPreinstall(roomInfo, preinstallInfo); + roomInfo.RoomPreinstall = roomPreinstall; + //执行预处理操作 + roomPreinstall.Pretreatment(random); + + //初始化标记 + //roomInfo.RoomSplit.Preinstall. + + //roomInfo.RoomSplit.TileInfo. + // var template = ResourceManager.Load(roomInfo.RoomSplit.ScenePath); + // var tileInstance = template.Instantiate(); + // + // //其它物体 + // var childCount = tileInstance.GetChildCount(); + // for (var i = 0; i < childCount; i++) + // { + // var item = tileInstance.GetChild(i); + // if (!(item is ActivityMark)) + // { + // item.GetParent().RemoveChild(item); + // item.Owner = null; + // _tileRoot.AddChild(item); + // if (item is Node2D node) + // { + // node.Position = roomInfo.GetWorldPosition() + (node.GlobalPosition - offset); + // } + // + // i--; + // childCount--; + // } + // } + // + // //物体标记 + // var activityMarks = tileInstance.GetMarks(); + // foreach (var activityMark in activityMarks) + // { + // var pos = activityMark.Position; + // activityMark.GetParent().RemoveChild(activityMark); + // activityMark.Owner = null; + // //_tileRoot.AddChild(activityMark); + // activityMark.Position = roomInfo.GetWorldPosition() + (pos - offset); + // activityMark.TileRoot = _tileRoot; + // //执行预处理操作 + // activityMark.Pretreatment(random); + // } + // roomInfo.ActivityMarks.AddRange(activityMarks); + // + // //填充tile操作 + // for (int i = 0; i < rectSize.X; i++) + // { + // for (int j = 0; j < rectSize.Y; j++) + // { + // var coords = new Vector2I((int)(rectPos.X + i), (int)(rectPos.Y + j)); + // var atlasCoords = tileInstance.GetCellAtlasCoords(0, coords); + // if (atlasCoords.X != -1 && atlasCoords.Y != -1) + // { + // // 在 Godot 4.0 中使用以下这段代码区分层级, 会导致游戏关闭时有概率报错卡死, 目前尚不清楚原因 + // //获取自定义层级 + // // var customData = tileInstance.GetCellTileData(0, coords).GetCustomData(CustomTileLayerName); + // // var layer = customData.AsInt32(); + // // layer = Mathf.Clamp(layer, GameConfig.FloorMapLayer, GameConfig.TopMapLayer); + // + // var layer = config.GetLayer(atlasCoords); + // _tileRoot.SetCell(layer, new Vector2I(roomInfo.Position.X + i, roomInfo.Position.Y + j), + // 0, atlasCoords); + // } + // } + // } + // + // tileInstance.CallDeferred(Node.MethodName.QueueFree); } //铺过道 @@ -419,7 +474,7 @@ public class DungeonTile { for (int j = 0; j < size.Y; j++) { - _tileRoot.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), 0, info.AutotileCoord); + _tileRoot.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), 0, info.AutoTileCoord); } } } @@ -473,16 +528,16 @@ public class DungeonTile var x = rect.Position.X * GameConfig.TileCellSize; var y = rect.Position.Y * GameConfig.TileCellSize; - var op1 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 1.5f); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 1.5f); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 3f); - var op4 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 3f); + var op1 = new Vector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 1.5f); + var op2 = new Vector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 1.5f); + var op3 = new Vector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 3f); + var op4 = new Vector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 3f); AddDoorNavigation( doorInfo, op1, op2, op3, op4, - new SerializeVector2(op1), - new SerializeVector2(op1.X + GameConfig.TileCellSize, op2.Y), - new SerializeVector2(op1.X + GameConfig.TileCellSize, op3.Y), - new SerializeVector2(op4) + op1, + new Vector2(op1.X + GameConfig.TileCellSize, op2.Y), + new Vector2(op1.X + GameConfig.TileCellSize, op3.Y), + op4 ); } } @@ -507,16 +562,16 @@ public class DungeonTile var x = rect.Position.X * GameConfig.TileCellSize; var y = rect.Position.Y * GameConfig.TileCellSize; - var op1 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); - var op4 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); + var op1 = new Vector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); + var op2 = new Vector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); + var op3 = new Vector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); + var op4 = new Vector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); AddDoorNavigation( doorInfo, op1, op2, op3, op4, - new SerializeVector2(op2.X - GameConfig.TileCellSize, op1.Y), - new SerializeVector2(op2), - new SerializeVector2(op3), - new SerializeVector2(op2.X - GameConfig.TileCellSize, op4.Y) + new Vector2(op2.X - GameConfig.TileCellSize, op1.Y), + op2, + op3, + new Vector2(op2.X - GameConfig.TileCellSize, op4.Y) ); } } @@ -541,16 +596,16 @@ public class DungeonTile var x = rect.Position.X * GameConfig.TileCellSize; var y = rect.Position.Y * GameConfig.TileCellSize; - var op1 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f); - var op4 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f); + var op1 = new Vector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f); + var op2 = new Vector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f); + var op3 = new Vector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f); + var op4 = new Vector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f); AddDoorNavigation( doorInfo, op1, op2, op3, op4, - new SerializeVector2(op1), - new SerializeVector2(op2), - new SerializeVector2(op3.X, op1.Y + GameConfig.TileCellSize), - new SerializeVector2(op4.X, op1.Y + GameConfig.TileCellSize) + op1, + op2, + new Vector2(op3.X, op1.Y + GameConfig.TileCellSize), + new Vector2(op4.X, op1.Y + GameConfig.TileCellSize) ); } } @@ -574,16 +629,16 @@ public class DungeonTile var x = rect.Position.X * GameConfig.TileCellSize; var y = rect.Position.Y * GameConfig.TileCellSize; - var op1 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); - var op4 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + var op1 = new Vector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + var op2 = new Vector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + var op3 = new Vector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + var op4 = new Vector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); AddDoorNavigation( doorInfo, op1, op2, op3, op4, - new SerializeVector2(op1.X, op3.Y - GameConfig.TileCellSize), - new SerializeVector2(op2.X, op3.Y - GameConfig.TileCellSize), - new SerializeVector2(op3), - new SerializeVector2(op4) + new Vector2(op1.X, op3.Y - GameConfig.TileCellSize), + new Vector2(op2.X, op3.Y - GameConfig.TileCellSize), + op3, + op4 ); } } @@ -592,36 +647,19 @@ public class DungeonTile /// 添加房间 /// private void AddDoorNavigation(RoomDoorInfo doorInfo, - SerializeVector2 op1, SerializeVector2 op2, SerializeVector2 op3, SerializeVector2 op4, - SerializeVector2 cp1, SerializeVector2 cp2, SerializeVector2 cp3, SerializeVector2 cp4) + Vector2 op1, Vector2 op2, Vector2 op3, Vector2 op4, + Vector2 cp1, Vector2 cp2, Vector2 cp3, Vector2 cp4) { var openPolygonData = new NavigationPolygonData(); openPolygonData.Type = NavigationPolygonType.Out; - openPolygonData.Points.Add(op1); - openPolygonData.Points.Add(op2); - openPolygonData.Points.Add(op3); - openPolygonData.Points.Add(op4); - + openPolygonData.SetPoints(new []{ op1, op2, op3, op4 }); + var closePolygonData = new NavigationPolygonData(); closePolygonData.Type = NavigationPolygonType.Out; - closePolygonData.Points.Add(cp1); - closePolygonData.Points.Add(cp2); - closePolygonData.Points.Add(cp3); - closePolygonData.Points.Add(cp4); - + closePolygonData.SetPoints(new []{ cp1, cp2, cp3, cp4 }); + _connectNavigationItemList.Add(new DoorNavigationInfo(doorInfo, openPolygonData, closePolygonData)); } - - //报错数据 - // private void TestData() - // { - // _polygonDataList.Clear(); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(-456, 712), new SerializeVector2(-440, 712), new SerializeVector2(-440, 792), new SerializeVector2(-456, 792) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.In, Points = new List(new []{ new SerializeVector2(-1048, 744), new SerializeVector2(-840, 744), new SerializeVector2(-840, 840), new SerializeVector2(-1048, 840) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(488, 920), new SerializeVector2(504, 920), new SerializeVector2(504, 1128), new SerializeVector2(488, 1128) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(1320, 984), new SerializeVector2(1352, 984), new SerializeVector2(1352, 1096), new SerializeVector2(1432, 1096), new SerializeVector2(1432, 984), new SerializeVector2(1576, 984), new SerializeVector2(1576, 1128), new SerializeVector2(1544, 1128), new SerializeVector2(1544, 1000), new SerializeVector2(1464, 1000), new SerializeVector2(1464, 1128), new SerializeVector2(1320, 1128) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(712, 1432), new SerializeVector2(984, 1432), new SerializeVector2(984, 1592), new SerializeVector2(712, 1592) })}); - // } /// /// 计算并动生成导航区域, layer 为需要计算的层级,如果没有设置 floorAtlasCoords,则该 layer 下不为空的地砖都将视为可行走区域 @@ -648,7 +686,7 @@ public class DungeonTile { if (IsWayTile(layer, i, j)) { - if (!_usePoints.Contains(new Vector2(i, j))) + if (!_usePoints.Contains(new Vector2I(i, j))) { NavigationPolygonData polygonData = null; @@ -672,7 +710,7 @@ public class DungeonTile _generateNavigationResult = new GenerateNavigationResult(true); } - catch (NavigationPointInterleavingException e) + catch (NavigationPointException e) { _usePoints.Clear(); _polygonDataList.Clear(); @@ -717,10 +755,11 @@ public class DungeonTile } } + //创建导航区域 private NavigationRegion2D CreateNavigationRegion(Node2D navigationRoot, NavigationPolygonData polygonData) { var polygon = new NavigationPolygon(); - polygon.AddOutline(polygonData.ConvertPointsToVector2Array()); + polygon.AddOutline(polygonData.GetPoints()); polygon.MakePolygonsFromOutlines(); var navigationPolygon = new NavigationRegion2D(); navigationPolygon.Name = "NavigationRegion" + (navigationRoot.GetChildCount() + 1); @@ -736,6 +775,26 @@ public class DungeonTile { return _polygonDataList.ToArray(); } + + /// + /// 设置导航网格数据 + /// + /// + public void SetPolygonData(List list) + { + _polygonDataList.Clear(); + _polygonDataList.AddRange(list); + _generateNavigationResult = new GenerateNavigationResult(true); + } + + /// + /// 清除生成的导航数据 + /// + public void ClearPolygonData() + { + _polygonDataList.Clear(); + _generateNavigationResult = null; + } /// /// 获取连接门导航数据, 必须要调用 AutoFillRoomTile() 函数才有数据 @@ -777,12 +836,12 @@ public class DungeonTile { var polygonData = new NavigationPolygonData(); polygonData.Type = NavigationPolygonType.Out; - var points = polygonData.Points; + var points = new List(); // 0:右, 1:下, 2:左, 3:上 var dir = 0; var offset = new Vector2(size.X * 0.5f, size.Y * 0.5f); //找到路, 向右开始找边界 - var startPos = new Vector2(i, j); + var startPos = new Vector2I(i, j); var tempI = i; var tempJ = j; @@ -797,13 +856,14 @@ public class DungeonTile { dir = 3; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempJ--; @@ -813,16 +873,17 @@ public class DungeonTile { if (points.Count == 0) { - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempI++; break; } @@ -830,20 +891,21 @@ public class DungeonTile { dir = 1; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempJ++; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } case 1: //下 { @@ -851,13 +913,14 @@ public class DungeonTile { dir = 0; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempI++; @@ -867,16 +930,17 @@ public class DungeonTile { if (points.Count == 0) { - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempJ++; break; } @@ -884,21 +948,22 @@ public class DungeonTile { dir = 2; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempI--; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } case 2: //左 { @@ -906,14 +971,15 @@ public class DungeonTile { dir = 1; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempJ++; @@ -923,17 +989,18 @@ public class DungeonTile { if (points.Count == 0) { - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempI--; break; } @@ -941,21 +1008,22 @@ public class DungeonTile { dir = 3; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempJ--; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } case 3: //上 { @@ -963,14 +1031,15 @@ public class DungeonTile { dir = 2; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempI--; @@ -980,16 +1049,17 @@ public class DungeonTile { if (points.Count == 0) { - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempJ--; break; } @@ -997,20 +1067,21 @@ public class DungeonTile { dir = 0; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempI++; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } } } @@ -1021,12 +1092,13 @@ public class DungeonTile { var polygonData = new NavigationPolygonData(); polygonData.Type = NavigationPolygonType.In; - var points = polygonData.Points; + var points = new List(); // 0:右, 1:下, 2:左, 3:上 var dir = 0; var offset = new Vector2(size.X * 0.5f, size.Y * 0.5f); //找到路, 向右开始找边界 - var startPos = new Vector2(i - 1, j); + var startPos = new Vector2I(i - 1, j); + PutUsePoint(startPos); var tempI = i; var tempJ = j; @@ -1041,14 +1113,15 @@ public class DungeonTile { dir = 1; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempJ++; @@ -1058,17 +1131,18 @@ public class DungeonTile { if (points.Count == 0) { - //points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempI++; break; } @@ -1076,21 +1150,22 @@ public class DungeonTile { dir = 3; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempJ--; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } case 1: //下 { @@ -1098,13 +1173,14 @@ public class DungeonTile { dir = 2; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempI--; @@ -1114,16 +1190,17 @@ public class DungeonTile { if (points.Count == 0) { - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempJ++; break; } @@ -1131,21 +1208,22 @@ public class DungeonTile { dir = 0; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempI++; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } case 2: //左 { @@ -1153,13 +1231,14 @@ public class DungeonTile { dir = 3; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempJ--; @@ -1169,16 +1248,17 @@ public class DungeonTile { if (points.Count == 0) { - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempI--; break; } @@ -1186,20 +1266,21 @@ public class DungeonTile { dir = 1; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempJ++; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } case 3: //上 { @@ -1207,14 +1288,15 @@ public class DungeonTile { dir = 0; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + //points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); PutUsePoint(pos); tempI++; @@ -1224,16 +1306,17 @@ public class DungeonTile { if (points.Count == 0) { - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); } - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - PutUsePoint(new Vector2(tempI, tempJ)); + PutUsePoint(new Vector2I(tempI, tempJ)); tempJ--; break; } @@ -1241,31 +1324,32 @@ public class DungeonTile { dir = 2; - var pos = new Vector2(tempI, tempJ); + var pos = new Vector2I(tempI, tempJ); if (points.Count > 1 && pos == startPos) { + polygonData.SetPoints(points.ToArray()); return polygonData; } - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new Vector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); PutUsePoint(pos); tempI--; break; } - throw new NavigationPointInterleavingException(new Vector2(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2(tempI, tempJ) + "发生交错!"); + throw new NavigationPointException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); } } } } //记录导航网格中已经使用过的坐标 - private void PutUsePoint(Vector2 pos) + private void PutUsePoint(Vector2I pos) { if (_usePoints.Contains(pos)) { - throw new NavigationPointInterleavingException(pos, "生成导航多边形发生错误! 点: " + pos + "发生交错!"); + throw new NavigationPointException(pos, "生成导航多边形发生错误! 点: " + pos + "发生交错!"); } _usePoints.Add(pos); diff --git a/DungeonShooting_Godot/src/framework/map/GenerateNavigationResult.cs b/DungeonShooting_Godot/src/framework/map/GenerateNavigationResult.cs index 9a6001c19a41275926c6f65b9ee797b74a491b45..1fb2a717cd2bf95b727fc2f13285803a792a96da 100644 --- a/DungeonShooting_Godot/src/framework/map/GenerateNavigationResult.cs +++ b/DungeonShooting_Godot/src/framework/map/GenerateNavigationResult.cs @@ -4,7 +4,7 @@ /// public class GenerateNavigationResult { - public GenerateNavigationResult(bool success, NavigationPointInterleavingException exception = null) + public GenerateNavigationResult(bool success, NavigationPointException exception = null) { Success = success; Exception = exception; @@ -18,5 +18,5 @@ public class GenerateNavigationResult /// /// 异常信息 /// - public NavigationPointInterleavingException Exception; + public NavigationPointException Exception; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/NavigationPointInterleavingException.cs b/DungeonShooting_Godot/src/framework/map/NavigationPointException.cs similarity index 49% rename from DungeonShooting_Godot/src/framework/map/NavigationPointInterleavingException.cs rename to DungeonShooting_Godot/src/framework/map/NavigationPointException.cs index 284683c8a0db33f8b77e9aca25af4c24809f40e3..d48bc69712712d49d8a6872194a1d6c58aa53367 100644 --- a/DungeonShooting_Godot/src/framework/map/NavigationPointInterleavingException.cs +++ b/DungeonShooting_Godot/src/framework/map/NavigationPointException.cs @@ -5,14 +5,14 @@ using Godot; /// /// 导航点交错异常 /// -public class NavigationPointInterleavingException : Exception +public class NavigationPointException : Exception { /// /// 交错点 /// - public Vector2 Point { get; } + public Vector2I Point { get; } - public NavigationPointInterleavingException(Vector2 point, string message): base(message) + public NavigationPointException(Vector2I point, string message): base(message) { Point = point; } diff --git a/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs b/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs index ad2fcb32b52ab694c3308e5e79c7d3b465b55a4a..b892d38db36b147db02331f0ddc6f7c82f146016 100644 --- a/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs @@ -6,10 +6,10 @@ using Godot; /// public class TileCellInfo { - public TileCellInfo(int id, Vector2I? autotileCoord) + public TileCellInfo(int id, Vector2I autoTileCoord) { Id = id; - AutotileCoord = autotileCoord; + AutoTileCoord = autoTileCoord; } /// @@ -20,5 +20,5 @@ public class TileCellInfo /// /// 如果是图块集, 该属性就表示在图块集的位置 /// - public Vector2I? AutotileCoord; + public Vector2I AutoTileCoord; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/image/ImageCanvas.cs b/DungeonShooting_Godot/src/framework/map/image/ImageCanvas.cs index 842349bc64822e5776094d6c40f530f429dddf9d..4373220f965b765bdbae65d061be497805871594 100644 --- a/DungeonShooting_Godot/src/framework/map/image/ImageCanvas.cs +++ b/DungeonShooting_Godot/src/framework/map/image/ImageCanvas.cs @@ -106,6 +106,7 @@ public partial class ImageCanvas : Sprite2D, IDestroy if (item.RenderWidth >= RenderViewportSize.X) { GD.PrintErr($"图像旋转后的宽度大于{RenderViewportSize.X}, 不支持绘制到 ImageCanvas 下!"); + item.SrcImage.Dispose(); return; } diff --git a/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs b/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs index 9f1e3ff669124b8153054d6dfeafa7e2cea0173c..ffd97ecfebb38063d650b6e5b17c4db6560c6c71 100644 --- a/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs +++ b/DungeonShooting_Godot/src/framework/map/image/ImageCanvas_Static.cs @@ -35,7 +35,7 @@ public partial class ImageCanvas /// public static Vector2I RenderViewportSize { get; private set; } - //预渲染队列, 这里不用 Queue 是因为大图尝试添加到渲染队列可能失败, 为了不影响 + //预渲染队列, 这里不用 Queue 是因为大图尝试添加到渲染队列可能失败, 为了不影响渲染顺序, 所以使用 List private static readonly List _queueItems = new List(); //渲染中的队列 private static readonly Queue _drawingQueueItems = new Queue(); @@ -179,7 +179,6 @@ public partial class ImageCanvas var startTime = DateTime.Now; //File.WriteAllBytes("d:/image.png", image.SavePngToBuffer()); //绘制完成需要调用回调的列表 - var index = 0; do { var item = _drawingQueueItems.Dequeue(); @@ -188,7 +187,6 @@ public partial class ImageCanvas redrawCanvas.Add(item.ImageCanvas); //处理绘图 HandleDrawing(image, item); - index++; if (item.OnDrawingComplete != null) { if (callDrawingCompleteList == null) @@ -245,7 +243,6 @@ public partial class ImageCanvas 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 @@ public partial class ImageCanvas { _queueItems.RemoveAt(i); i--; - index++; } else //进入渲染队列失败 { diff --git a/DungeonShooting_Godot/src/framework/map/image/ImageRenderData.cs b/DungeonShooting_Godot/src/framework/map/image/ImageRenderData.cs index c6a4f799841132d8f96573c34b4d5044d04977ac..3087bd9b150a5c89542465925a116cb9c708aec0 100644 --- a/DungeonShooting_Godot/src/framework/map/image/ImageRenderData.cs +++ b/DungeonShooting_Godot/src/framework/map/image/ImageRenderData.cs @@ -83,5 +83,8 @@ public class ImageRenderData /// 渲染在 viewport 上中心点y轴偏移量 ///
public int RenderOffsetY; + /// + /// 占用区域 + /// public ImageCanvas.AreaPlaceholder AreaPlaceholder; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/RoomStaticImageCanvas.cs b/DungeonShooting_Godot/src/framework/map/image/RoomStaticImageCanvas.cs similarity index 96% rename from DungeonShooting_Godot/src/framework/map/RoomStaticImageCanvas.cs rename to DungeonShooting_Godot/src/framework/map/image/RoomStaticImageCanvas.cs index a21a7c124d92af258d51fe8be3bb46c9e5080729..75b3da705d287f2dd5d1a0decbe7bd2d321c478a 100644 --- a/DungeonShooting_Godot/src/framework/map/RoomStaticImageCanvas.cs +++ b/DungeonShooting_Godot/src/framework/map/image/RoomStaticImageCanvas.cs @@ -37,5 +37,6 @@ public class RoomStaticImageCanvas : IDestroy } IsDestroyed = true; + CanvasSprite.Destroy(); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityExpressionAttribute.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityExpressionAttribute.cs deleted file mode 100644 index dc0ee12df3a3c46a27aed9b95f3c59398a427da6..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/mark/ActivityExpressionAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -/// -/// 用于 ActivityMark 字段上, 表示当前字段是一个表达式字段 -/// -[AttributeUsage(AttributeTargets.Field)] -public class ActivityExpressionAttribute : Attribute -{ - -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityExpressionData.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityExpressionData.cs deleted file mode 100644 index 9fc30b9a3a5b6e63050e9ed2b53d404364c803c5..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/mark/ActivityExpressionData.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; - -/// -/// -/// -public class ActivityExpressionData -{ - /// - /// 物体名称 - /// - public string Id; - - /// - /// 传入参数 - /// - public Dictionary Args = new Dictionary(); - - public ActivityExpressionData(string id) - { - Id = id; - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs deleted file mode 100644 index fa36fca858078712e442da0432d9d4133b77ff2d..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs +++ /dev/null @@ -1,409 +0,0 @@ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.Text.RegularExpressions; -using Godot; - -/// -/// 物体生成标记 -/// -[Tool, GlobalClass] -public partial class ActivityMark : Node2D -{ - /// - /// 物体类型 - /// - [Export] - public ActivityIdPrefix.ActivityPrefixType Type = ActivityIdPrefix.ActivityPrefixType.NonePrefix; - - /// - /// 创建物体的表达式, 该表达式计算出的id会自动加上 Type 前缀 - /// 例如: 0001(w:100,ca:15,ra:30);0002(w:120,ca:10,ra:20) - /// - [Export(PropertyHint.Expression), ActivityExpression] - public string ItemExpression; - - /// - /// 所在层级 - /// - [Export] - public RoomLayerEnum Layer = RoomLayerEnum.NormalLayer; - - /// - /// 该标记在第几波调用 BeReady, - /// 一个房间内所以敌人清完即可进入下一波 - /// - [Export] - public int WaveNumber = 1; - - /// - /// 延时执行时间,单位:秒 - /// - [Export] - public float DelayTime = 0; - - /// - /// 物体会在该矩形区域内随机位置生成 - /// - [Export] - public Vector2I BirthRect = Vector2I.Zero; - - /// - /// 绘制的颜色 - /// - [Export] - public Color DrawColor = new Color(1, 1, 1, 1); - - /// - /// 物体初始海拔高度 - /// - [ExportGroup("Vertical")] - [Export(PropertyHint.Range, "0, 128")] - public int Altitude = 8; - - /// - /// 物体初始纵轴速度 - /// - [Export(PropertyHint.Range, "-1000,1000,0.1")] - public float VerticalSpeed = 0; - - /// - /// 当前标记所在Tile节点 - /// - public TileMap TileRoot; - - //是否已经结束 - private bool _isOver = true; - private float _overTimer = 1; - private float _timer = 0; - private RoomInfo _tempRoom; - - //已经计算好要生成的物体 - private Dictionary _currentExpression = new Dictionary(); - - //存储所有 ActivityMark 和子类中被 [ActivityExpression] 标记的字段名称 - private static Dictionary> _activityExpressionMap = new Dictionary>(); - - /// - /// 对生成的物体执行后续操作 - /// - public virtual void Doing(ActivityObjectResult result, RoomInfo roomInfo) - { - } - - public ActivityMark() - { - //扫描所有 ActivityExpression - var type = GetType(); - if (!_activityExpressionMap.ContainsKey(type)) - { - // 获取类型信息 - var fieldInfos = new List(); - var tempList = type.GetFields(BindingFlags.Instance | BindingFlags.Public); - foreach (var s in tempList) - { - if (s.GetCustomAttribute() != null) - { - fieldInfos.Add(s.Name); - } - } - - _activityExpressionMap.Add(type, fieldInfos); - } - } - - public override void _Process(double delta) - { -#if TOOLS - if (Engine.IsEditorHint()) - { - QueueRedraw(); - return; - } -#endif - if (_isOver) - { - _overTimer += (float)delta; - if (_overTimer >= 1) - { - SetActive(false); - } - } - else - { - if (DelayTime > 0) - { - _timer += (float)delta; - if (_timer >= DelayTime) - { - Doing(_tempRoom); - _tempRoom = null; - _isOver = true; - } - } - } - } - - /// - /// 标记准备好了 - /// - public void BeReady(RoomInfo roomInfo) - { - if (_currentExpression == null || Type == ActivityIdPrefix.ActivityPrefixType.Player) - { - return; - } - _isOver = false; - _overTimer = 0; - SetActive(true); - if (DelayTime <= 0) - { - Doing(roomInfo); - _isOver = true; - } - else - { - _timer = 0; - _tempRoom = roomInfo; - } - } - - /// - /// 是否已经结束 - /// - public bool IsOver() - { - return _isOver && _overTimer >= 1; - } - - private void Doing(RoomInfo roomInfo) - { - var result = CreateActivityObjectFromExpression(Type, nameof(ItemExpression)); - - if (result == null || result.ActivityObject == null) - { - return; - } - - result.ActivityObject.VerticalSpeed = VerticalSpeed; - result.ActivityObject.Altitude = Altitude; - var pos = Position; - if (BirthRect != Vector2I.Zero) - { - result.ActivityObject.Position = new Vector2( - Utils.RandomRangeInt((int)pos.X - BirthRect.X / 2, (int)pos.X + BirthRect.X / 2), - Utils.RandomRangeInt((int)pos.Y - BirthRect.Y / 2, (int)pos.Y + BirthRect.Y / 2) - ); - } - else - { - result.ActivityObject.Position = pos; - } - - result.ActivityObject.StartCoroutine(OnActivityObjectBirth(result.ActivityObject)); - result.ActivityObject.PutDown(Layer); - - var effect1 = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_effect_Effect1_tscn); - effect1.Position = result.ActivityObject.Position + new Vector2(0, -Altitude); - effect1.AddToActivityRoot(RoomLayerEnum.NormalLayer); - - Doing(result, roomInfo); - } - - /// - /// 生成 ActivityObject 时调用, 用于出生时的动画效果 - /// - private IEnumerator OnActivityObjectBirth(ActivityObject instance) - { - var a = 1.0f; - instance.SetBlendColor(Colors.White); - //禁用自定义行为 - instance.EnableCustomBehavior = false; - //禁用下坠 - instance.EnableVerticalMotion = false; - - for (var i = 0; i < 10; i++) - { - instance.SetBlendSchedule(a); - yield return 0; - } - - while (a > 0) - { - instance.SetBlendSchedule(a); - a -= 0.05f; - yield return 0; - } - - //启用自定义行为 - instance.EnableCustomBehavior = true; - //启用下坠 - instance.EnableVerticalMotion = true; - } - -#if TOOLS - public override void _Draw() - { - if (Engine.IsEditorHint() || GameApplication.Instance.Debug) - { - var drawColor = DrawColor; - - //如果在编辑器中选中了该节点, 则绘更改绘制颜色的透明度 - var selectedNodes = Plugin.Plugin.Instance?.GetEditorInterface()?.GetSelection()?.GetSelectedNodes(); - if (selectedNodes != null && selectedNodes.Contains(this)) - { - drawColor.A = 1f; - } - else - { - drawColor.A = 0.5f; - } - - DrawLine(new Vector2(-2, -2), new Vector2(2, 2), drawColor, 1f); - DrawLine(new Vector2(-2, 2), new Vector2(2, -2), drawColor, 1f); - - if (BirthRect != Vector2.Zero) - { - DrawRect(new Rect2(-BirthRect / 2, BirthRect), drawColor, false, 0.5f); - } - - DrawString(ResourceManager.DefaultFont12Px, new Vector2(-14, 12), WaveNumber.ToString(), HorizontalAlignment.Center, 28, 12); - } - } -#endif - - /// - /// 设置当前节点是否是活动状态 - /// - private void SetActive(bool flag) - { - // SetProcess(flag); - // SetPhysicsProcess(flag); - // SetProcessInput(flag); - // Visible = flag; - - var parent = GetParent(); - if (flag) - { - if (parent == null) - { - TileRoot.AddChild(this); - } - else if (parent != TileRoot) - { - parent.RemoveChild(this); - TileRoot.AddChild(this); - } - Owner = TileRoot; - } - else - { - if (parent != null) - { - parent.RemoveChild(this); - Owner = null; - } - } - } - - //----------------------------------------------------------------------------------------------------- - - /// - /// 执行预处理操作 - /// - public void Pretreatment() - { - if (_activityExpressionMap.TryGetValue(GetType(), out var list)) - { - foreach (var field in list) - { - Pretreatment(field); - } - } - } - - private void Pretreatment(string field) - { - var expressionStr = GetType().GetField(field)?.GetValue(this) as string; - if (string.IsNullOrEmpty(expressionStr)) - { - _currentExpression.Add(field, new ActivityExpressionData("")); - return; - } - var activityExpression = Parse(expressionStr); - if (activityExpression.Count > 0) - { - //权重列表 - var list = new List(); - for (var i = 0; i < activityExpression.Count; i++) - { - var item = activityExpression[i]; - if (item.Args.TryGetValue("weight", out var weight)) //获取自定义权重值 - { - list.Add(int.Parse(weight)); - } - else //默认权重100 - { - item.Args.Add("weight", "100"); - list.Add(100); - } - } - //根据权重随机值 - var index = Utils.RandomWeight(list); - _currentExpression.Add(field, activityExpression[index]); - } - else - { - _currentExpression.Add(field, new ActivityExpressionData("")); - } - } - - private List Parse(string str) - { - var list = new List(); - var exps = str.Split(';'); - - for (var i = 0; i < exps.Length; i++) - { - var exp = exps[i]; - //去除空格 - exp = Regex.Replace(exp, "\\s", ""); - if (string.IsNullOrEmpty(exp)) - { - continue; - } - - //验证语法 - if (Regex.IsMatch(exp, "^\\w+(\\((\\w+:\\w+)*(,\\w+:\\w+)*\\))?$")) - { - if (!exp.Contains('(')) //没有参数 - { - list.Add(new ActivityExpressionData(exp)); - } - else - { - var name = Regex.Match(exp, "^\\w+").Value; - var activityExpression = new ActivityExpressionData(name); - var paramsResult = Regex.Matches(exp, "\\w+:\\w+"); - if (paramsResult.Count > 0) - { - foreach (Match result in paramsResult) - { - var valSplit = result.Value.Split(':'); - activityExpression.Args.Add(valSplit[0], valSplit[1]); - } - } - list.Add(activityExpression); - } - } - else //语法异常 - { - throw new Exception("表达式语法错误: " + exp); - } - } - - return list; - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark_HandlerExpression.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark_HandlerExpression.cs deleted file mode 100644 index d8d46626abdda327b696733c087f7a919457c3c6..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark_HandlerExpression.cs +++ /dev/null @@ -1,72 +0,0 @@ - -using System; -using Godot; - -public partial class ActivityMark -{ - /// - /// 根据预制表达式创建物体并返回 - /// - /// 物体类型 - /// 预制表达式字段名称, 注意是字段名称, 而不是内容 - public ActivityObjectResult CreateActivityObjectFromExpression(ActivityIdPrefix.ActivityPrefixType type, string expressionFieldName) where T : ActivityObject - { - if (_currentExpression.TryGetValue(expressionFieldName, out var expressionData)) - { - if (expressionData.Id == "null") - { - return null; - } - var id = ActivityIdPrefix.GetNameByPrefixType(type) + expressionData.Id; - var activityObject = ActivityObject.Create(id); - if (activityObject == null) - { - return null; - } - - HandlerExpressionArgs(type, activityObject, expressionData); - return new ActivityObjectResult(activityObject, expressionData); - } - - GD.PrintErr("未找到表达式字段: " + expressionFieldName + ", 请检查是否有该字段或者该字段加上了[ActivityExpression]标记"); - return null; - } - - private void HandlerExpressionArgs(ActivityIdPrefix.ActivityPrefixType type, ActivityObject instance, ActivityExpressionData expressionData) - { - switch (type) - { - case ActivityIdPrefix.ActivityPrefixType.NonePrefix: - break; - case ActivityIdPrefix.ActivityPrefixType.Player: - break; - case ActivityIdPrefix.ActivityPrefixType.Test: - break; - case ActivityIdPrefix.ActivityPrefixType.Role: - break; - case ActivityIdPrefix.ActivityPrefixType.Enemy: - break; - case ActivityIdPrefix.ActivityPrefixType.Weapon: - { - var weapon = (Weapon)instance; - //当前弹夹弹药量 - if (expressionData.Args.TryGetValue("CurrAmmon", out var currAmmon)) - { - weapon.SetCurrAmmo(int.Parse(currAmmon)); - } - //备用弹药量 - if (expressionData.Args.TryGetValue("ResidueAmmo", out var residueAmmo)) - { - weapon.SetResidueAmmo(int.Parse(residueAmmo)); - } - } - break; - case ActivityIdPrefix.ActivityPrefixType.Bullet: - break; - case ActivityIdPrefix.ActivityPrefixType.Shell: - break; - case ActivityIdPrefix.ActivityPrefixType.Other: - break; - } - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityObjectResult.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityObjectResult.cs deleted file mode 100644 index 212798178c9daafb5e15a564fb8a1cf43f0db8cd..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/mark/ActivityObjectResult.cs +++ /dev/null @@ -1,22 +0,0 @@ - -/// -/// 通过表达式创建的 ActivityObject 对象结果集 -/// -public class ActivityObjectResult where T : ActivityObject -{ - /// - /// 实例 - /// - public T ActivityObject; - - /// - /// 创建该对象使用的表达式数据 - /// - public ActivityExpressionData ExpressionData; - - public ActivityObjectResult(T activityObject, ActivityExpressionData expressionData) - { - ActivityObject = activityObject; - ExpressionData = expressionData; - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs b/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs deleted file mode 100644 index 33f0ddf45f02f189525b0e4c19687eb029fd7ced..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/framework/map/mark/EnemyMark.cs +++ /dev/null @@ -1,91 +0,0 @@ - -using Godot; - -/// -/// 针对敌人生成位置的标记 -/// -[Tool, GlobalClass] -public partial class EnemyMark : ActivityMark -{ - /// - /// 脸默认朝向 - /// - public enum FaceDirectionValueEnum - { - /// - /// 随机 - /// - Random, - /// - /// 左边 - /// - Left, - /// - /// 右边 - /// - Right - } - - /// - /// 武器1 id, id会自动加上武器前缀 - /// - [Export(PropertyHint.Expression), ActivityExpression] - public string Weapon1Id; - /// - /// 武器2 id, id会自动加上武器前缀 - /// - [Export(PropertyHint.Expression), ActivityExpression] - public string Weapon2Id; - /// - /// 脸默认的朝向 - /// - [Export] - public FaceDirectionValueEnum FaceDirection = FaceDirectionValueEnum.Random; - - public override void _Ready() - { - Type = ActivityIdPrefix.ActivityPrefixType.Enemy; - Layer = RoomLayerEnum.YSortLayer; - Altitude = 0; - } - - public override void Doing(ActivityObjectResult result, RoomInfo roomInfo) - { - //创建敌人 - var instance = (Enemy)result.ActivityObject; - var pos = instance.Position; - - //脸的朝向 - if (FaceDirection == FaceDirectionValueEnum.Random) - { - instance.Face = Utils.RandomBoolean() ? global::FaceDirection.Left : global::FaceDirection.Right; - } - else if (FaceDirection == FaceDirectionValueEnum.Left) - { - instance.Face = global::FaceDirection.Left; - } - else - { - instance.Face = global::FaceDirection.Right; - } - - if (!string.IsNullOrWhiteSpace(Weapon1Id)) - CreateWeapon(instance, pos, nameof(Weapon1Id)); - if (!string.IsNullOrWhiteSpace(Weapon2Id)) - CreateWeapon(instance, pos, nameof(Weapon2Id)); - } - - //生成武器 - private void CreateWeapon(Enemy enemy, Vector2 pos, string fieldName) - { - var result = CreateActivityObjectFromExpression(ActivityIdPrefix.ActivityPrefixType.Weapon, fieldName); - if (result != null) - { - //如果不能放下, 则直接扔地上 - if (!enemy.PickUpWeapon(result.ActivityObject)) - { - result.ActivityObject.PutDown(pos, RoomLayerEnum.NormalLayer); - } - } - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/preinstall/ActivityMark.cs b/DungeonShooting_Godot/src/framework/map/preinstall/ActivityMark.cs new file mode 100644 index 0000000000000000000000000000000000000000..9516eceee6a94a22162d6dc4dbc3b88c3bdd1935 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/preinstall/ActivityMark.cs @@ -0,0 +1,53 @@ + +using System.Collections.Generic; +using Godot; + +public class ActivityMark +{ + /// + /// 物体 Id + /// + public string Id { get; set; } + + /// + /// 刷新位置 + /// + public Vector2 Position { get; set; } + + /// + /// 额外属性, 不要自行修改字典内的属性数据, 要改的话请在 DerivedAttr 上改 + /// + public Dictionary Attr { get; set; } + + /// + /// 衍生属性, 可随意修改值 + /// + public Dictionary DerivedAttr { get; set; } + + /// + /// 特殊标记类型 + /// + public SpecialMarkType MarkType { get; set; } + + /// + /// 延时时间, 单位: 秒 + /// + public float DelayTime { get; set; } + + /// + /// 物体初始海拔高度 + /// + public int Altitude = 8; + + /// + /// 物体初始纵轴速度 + /// + public float VerticalSpeed = 0; + + /// + /// 物体类型 + /// + public ActivityType ActivityType { get; set; } + + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs b/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs new file mode 100644 index 0000000000000000000000000000000000000000..f5b5942cc628bff8d299d764376e5d9c3bb9e6c4 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs @@ -0,0 +1,458 @@ + +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Config; +using Godot; + +/// +/// 房间预设处理类 +/// +public class RoomPreinstall : IDestroy +{ + public bool IsDestroyed { get; private set; } + + /// + /// 所属房间对象 + /// + public RoomInfo RoomInfo { get; } + + /// + /// 绑定的预设数据 + /// + public RoomPreinstallInfo RoomPreinstallInfo { get; } + + /// + /// 总波数 + /// + public int WaveCount => RoomPreinstallInfo.WaveList.Count; + + /// + /// 波数和标记数据列表 + /// + public List> WaveList { get; } = new List>(); + + /// + /// 是否正在执行生成波数操作 + /// + public bool IsRunWave { get; private set; } + + /// + /// 是否执行到最后一波了 + /// + public bool IsLastWave => _currWaveIndex >= WaveList.Count; + + //是否运行过预处理 + private bool _runPretreatment = false; + //当前房间是否会刷新敌人 + private bool _hsaEnemy = false; + //当前波数索引 + private int _currWaveIndex = 0; + //执行生成标记的协程id + private long _coroutineId = -1; + //提前加载列表 + private List _readyList; + + private class PreloadData + { + /// + /// 实例对象 + /// + public ActivityObject ActivityObject; + /// + /// 所在层级 + /// + public RoomLayerEnum Layer; + + public PreloadData(ActivityObject activityObject, RoomLayerEnum layer) + { + ActivityObject = activityObject; + Layer = layer; + } + } + + public RoomPreinstall(RoomInfo roomInfo, RoomPreinstallInfo roomPreinstallInfo) + { + RoomInfo = roomInfo; + RoomPreinstallInfo = roomPreinstallInfo; + } + + /// + /// 预处理操作 + /// + public void Pretreatment(SeedRandom random) + { + if (_runPretreatment) + { + return; + } + + _runPretreatment = true; + + //确定房间内要生成写啥 + foreach (var markInfos in RoomPreinstallInfo.WaveList) + { + var wave = new List(); + WaveList.Add(wave); + foreach (var markInfo in markInfos) + { + var mark = new ActivityMark(); + if (markInfo.SpecialMarkType == SpecialMarkType.Normal) //普通标记 + { + MarkInfoItem markInfoItem; + if (markInfo.MarkList.Count == 0) + { + continue; + } + else if (markInfo.MarkList.Count == 1) + { + markInfoItem = markInfo.MarkList[0]; + } + else + { + var tempArray = markInfo.MarkList.Select(item => item.Weight).ToArray(); + var index = random.RandomWeight(tempArray); + markInfoItem = markInfo.MarkList[index]; + } + + mark.Id = markInfoItem.Id; + mark.Attr = markInfoItem.Attr; + mark.DerivedAttr = new Dictionary(); + mark.VerticalSpeed = markInfoItem.VerticalSpeed; + mark.Altitude = markInfoItem.Altitude; + mark.ActivityType = (ActivityType)ExcelConfig.ActivityObject_Map[markInfoItem.Id].Type; + + if (mark.ActivityType == ActivityType.Enemy) //敌人类型 + { + _hsaEnemy = true; + if (!mark.Attr.TryGetValue("Face", out var face) || face == "0") //随机方向 + { + mark.DerivedAttr.Add("Face", + random.RandomChoose( + ((int)FaceDirection.Left).ToString(), + ((int)FaceDirection.Right).ToString() + ) + ); + } + else //指定方向 + { + mark.DerivedAttr.Add("Face", face); + } + } + } + else if (markInfo.SpecialMarkType == SpecialMarkType.BirthPoint) //玩家出生标记 + { + + } + else + { + GD.PrintErr("暂未支持的类型: " + markInfo.SpecialMarkType); + continue; + } + + mark.DelayTime = markInfo.DelayTime; + mark.MarkType = markInfo.SpecialMarkType; + //随机刷新坐标 + var pos = markInfo.Position.AsVector2(); + var birthRect = markInfo.Size.AsVector2(); + var tempPos = new Vector2( + random.RandomRangeInt((int)(pos.X - birthRect.X / 2), (int)(pos.X + birthRect.X / 2)), + random.RandomRangeInt((int)(pos.Y - birthRect.Y / 2), (int)(pos.Y + birthRect.Y / 2)) + ); + var offset = RoomInfo.GetOffsetPosition(); + //var offset = RoomInfo.RoomSplit.RoomInfo.Position.AsVector2I(); + mark.Position = RoomInfo.GetWorldPosition() + (tempPos - offset); + wave.Add(mark); + } + + //排序操作 + wave.Sort((a, b) => (int)(a.DelayTime * 1000 - b.DelayTime * 1000)); + } + } + + /// + /// 预处理后才可以调用, 返回是否会生成敌人 + /// + public bool HasEnemy() + { + return _hsaEnemy; + } + + /// + /// 地牢房间加载完成 + /// + public void OnReady() + { + _currWaveIndex = 0; + //加载提前生成的物体 + if (WaveList.Count > 0) + { + var activityMarks = WaveList[0]; + foreach (var activityMark in activityMarks) + { + if (activityMark.MarkType == SpecialMarkType.Normal) + { + var activityObject = CreateItem(activityMark); + //初始化属性 + InitAttr(activityObject, activityMark); + if (_readyList == null) + { + _readyList = new List(); + } + _readyList.Add(new PreloadData(activityObject, GetDefaultLayer(activityMark))); + } + } + } + + _currWaveIndex++; + } + + /// + /// 玩家进入房间, 开始执行生成物体 + /// + public void StartWave() + { + if (IsRunWave) + { + return; + } + + IsRunWave = true; + + _currWaveIndex = 1; + //判断房间内是否已经有敌人了 + var hasEnemy = false; + if (_readyList != null && _readyList.Count > 0) + { + foreach (var preloadData in _readyList) + { + //有敌人 + if (!hasEnemy && preloadData.ActivityObject.CollisionWithMask(PhysicsLayer.Enemy)) + { + hasEnemy = true; + } + + preloadData.ActivityObject.PutDown(preloadData.Layer); + } + + _readyList.Clear(); + _readyList = null; + } + + if (!hasEnemy) + { + hasEnemy = RoomInfo.AffiliationArea.ExistIncludeItem( + activityObject => activityObject.CollisionWithMask(PhysicsLayer.Enemy) + ); + } + + if (!hasEnemy) //没有敌人才能执行第1波 + { + if (_currWaveIndex < WaveList.Count) + { + GD.Print($"执行第{_currWaveIndex}波"); + _coroutineId = GameApplication.Instance.StartCoroutine(RunMark(WaveList[_currWaveIndex])); + _currWaveIndex++; + } + } + } + + /// + /// 执行下一波 + /// + public void NextWave() + { + if (!IsRunWave) + { + return; + } + + GD.Print($"执行第{_currWaveIndex}波"); + _coroutineId = GameApplication.Instance.StartCoroutine(RunMark(WaveList[_currWaveIndex])); + _currWaveIndex++; + } + + /// + /// 结束生成标记 + /// + public void OverWave() + { + IsRunWave = false; + } + + //执行实例化标记物体 + private IEnumerator RunMark(List activityMarks) + { + var timer = 0d; + for (var i = 0; i < activityMarks.Count;) + { + var activityMark = activityMarks[i]; + if (timer >= activityMark.DelayTime) + { + if (activityMark.MarkType == SpecialMarkType.Normal) + { + var activityObject = CreateItem(activityMark); + activityObject.VerticalSpeed = activityMark.VerticalSpeed; + activityObject.Altitude = activityMark.Altitude; + //初始化属性 + InitAttr(activityObject, activityMark); + //播放出生动画 + activityObject.StartCoroutine(OnActivityObjectBirth(activityObject)); + activityObject.PutDown(GetDefaultLayer(activityMark)); + + var effect1 = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_effect_Effect1_tscn); + effect1.Position = activityObject.Position + new Vector2(0, -activityMark.Altitude); + effect1.AddToActivityRoot(RoomLayerEnum.YSortLayer); + } + + i++; + } + else + { + timer += GameApplication.Instance.GetProcessDeltaTime(); + yield return 0; + } + } + + _coroutineId = -1; + } + + //生成 ActivityObject 时调用, 用于出生时的动画效果 + private IEnumerator OnActivityObjectBirth(ActivityObject instance) + { + var a = 1.0f; + instance.SetBlendColor(Colors.White); + //禁用自定义行为 + instance.EnableCustomBehavior = false; + //禁用下坠 + instance.EnableVerticalMotion = false; + + for (var i = 0; i < 10; i++) + { + instance.SetBlendSchedule(a); + yield return 0; + } + + while (a > 0) + { + instance.SetBlendSchedule(a); + a -= 0.05f; + yield return 0; + } + + //启用自定义行为 + instance.EnableCustomBehavior = true; + //启用下坠 + instance.EnableVerticalMotion = true; + } + + /// + /// 当前这一波是否执行完成 + /// + public bool IsCurrWaveOver() + { + return _coroutineId < 0 || GameApplication.Instance.IsCoroutineOver(_coroutineId); + } + + //创建物体 + private ActivityObject CreateItem(ActivityMark activityMark) + { + var activityObject = ActivityObject.Create(activityMark.Id); + activityObject.Position = activityMark.Position; + return activityObject; + } + + //获取物体默认所在层级 + private RoomLayerEnum GetDefaultLayer(ActivityMark activityMark) + { + if (activityMark.ActivityType == ActivityType.Player || activityMark.ActivityType == ActivityType.Enemy) + { + return RoomLayerEnum.YSortLayer; + } + + return RoomLayerEnum.NormalLayer; + } + + /// + /// 获取房间内的玩家生成标记 + /// + public ActivityMark GetPlayerBirthMark() + { + if (WaveList.Count == 0) + { + return null; + } + + var activityMarks = WaveList[0]; + var activityMark = activityMarks.FirstOrDefault(mark => mark.MarkType == SpecialMarkType.BirthPoint); + return activityMark; + } + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + IsDestroyed = true; + if (_coroutineId >= 0) + { + GameApplication.Instance.StopCoroutine(_coroutineId); + } + + WaveList.Clear(); + if (_readyList != null) + { + foreach (var preloadData in _readyList) + { + preloadData.ActivityObject.Destroy(); + } + + _readyList.Clear(); + } + } + + //初始化物体属性 + private void InitAttr(ActivityObject activityObject, ActivityMark activityMark) + { + if (activityMark.ActivityType == ActivityType.Weapon) //武器类型 + { + var weapon = (Weapon)activityObject; + if (activityMark.Attr.TryGetValue("CurrAmmon", out var currAmmon)) //当前弹夹弹药 + { + weapon.SetCurrAmmo(int.Parse(currAmmon)); + } + if (activityMark.Attr.TryGetValue("ResidueAmmo", out var residueAmmo)) //剩余弹药 + { + weapon.SetResidueAmmo(int.Parse(residueAmmo)); + } + } + else if (activityMark.ActivityType == ActivityType.Enemy) //敌人类型 + { + var enemy = (Enemy)activityObject; + if (activityMark.Attr.TryGetValue("Weapon", out var weaponId)) //使用的武器 + { + if (!string.IsNullOrEmpty(weaponId)) + { + var weapon = ActivityObject.Create(weaponId); + enemy.PickUpWeapon(weapon); + if (activityMark.Attr.TryGetValue("CurrAmmon", out var currAmmon)) //当前弹夹弹药 + { + weapon.SetCurrAmmo(int.Parse(currAmmon)); + } + if (activityMark.Attr.TryGetValue("ResidueAmmo", out var residueAmmo)) //剩余弹药 + { + weapon.SetResidueAmmo(int.Parse(residueAmmo)); + } + } + } + + if (activityMark.DerivedAttr.TryGetValue("Face", out var face)) //脸朝向, 应该只有 -1 和 1 + { + var faceDir = int.Parse(face); + enemy.Face = (FaceDirection)faceDir; + } + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/UiMode.cs b/DungeonShooting_Godot/src/framework/map/preinstall/SpecialMarkType.cs similarity index 37% rename from DungeonShooting_Godot/src/framework/ui/UiMode.cs rename to DungeonShooting_Godot/src/framework/map/preinstall/SpecialMarkType.cs index d4d9ccb321ac202c8846201bf63e1a910b79f81c..9541c00d317cf590ef9c0ef4e9eb5c2124dc3052 100644 --- a/DungeonShooting_Godot/src/framework/ui/UiMode.cs +++ b/DungeonShooting_Godot/src/framework/map/preinstall/SpecialMarkType.cs @@ -1,12 +1,15 @@ - -public enum UiMode + +/// +/// 特殊标记类型 +/// +public enum SpecialMarkType { /// - /// 正常模式,可以开多个相同的 Ui + /// 正常类型 /// Normal, /// - /// 单例模式, 只能同时打开一个相同的 Ui + /// 玩家出生点 /// - Singleton, + BirthPoint, } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/RoomDoorInfo.cs b/DungeonShooting_Godot/src/framework/map/room/RoomDoorInfo.cs similarity index 100% rename from DungeonShooting_Godot/src/framework/map/RoomDoorInfo.cs rename to DungeonShooting_Godot/src/framework/map/room/RoomDoorInfo.cs diff --git a/DungeonShooting_Godot/src/framework/map/RoomInfo.cs b/DungeonShooting_Godot/src/framework/map/room/RoomInfo.cs similarity index 64% rename from DungeonShooting_Godot/src/framework/map/RoomInfo.cs rename to DungeonShooting_Godot/src/framework/map/room/RoomInfo.cs index 16e45b0fd20de4c5f6a1f443d3d2711f64f86c68..a37d67c50af18e49353a98e9e5e219294a46607a 100644 --- a/DungeonShooting_Godot/src/framework/map/RoomInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/room/RoomInfo.cs @@ -52,7 +52,7 @@ public class RoomInfo : IDestroy /// /// 连接该房间的过道占用区域信息 /// - public List AisleArea = new List(); + public List AisleArea = new List(); /// /// 下一个房间 @@ -65,9 +65,9 @@ public class RoomInfo : IDestroy public RoomInfo Prev; /// - /// 物体生成标记 + /// 当前房间使用的预设 /// - public List ActivityMarks = new List(); + public RoomPreinstall RoomPreinstall; /// /// 当前房间归属区域 @@ -86,11 +86,11 @@ public class RoomInfo : IDestroy public bool IsDestroyed { get; private set; } - private bool _beReady = false; - private bool _waveStart = false; - private int _currWaveIndex = 0; - private int _currWaveNumber = 0; - private List _currActivityMarks = new List(); + // private bool _beReady = false; + // private bool _waveStart = false; + // private int _currWaveIndex = 0; + // private int _currWaveNumber = 0; + //private List _currActivityMarks = new List(); /// /// 获取房间的全局坐标, 单位: 像素 @@ -174,56 +174,71 @@ public class RoomInfo : IDestroy nextRoom.Destroy(); } Next.Clear(); - foreach (var activityMark in ActivityMarks) + if (RoomPreinstall != null) { - activityMark.QueueFree(); + RoomPreinstall.Destroy(); + RoomPreinstall = null; } - ActivityMarks.Clear(); if (StaticImageCanvas != null) { StaticImageCanvas.Destroy(); } + + if (AffiliationArea != null) + { + AffiliationArea.Destroy(); + } + } + + /// + /// 加载地牢完成 + /// + public void OnReady() + { + //提前加载波 + RoomPreinstall.OnReady(); } /// - /// 房间准备好了, 准备刷敌人, 并且关闭所有门, + /// 玩家第一次进入房间, 房间准备好了, 准备刷敌人, 并且关闭所有
/// 当清完每一波刷新的敌人后即可开门 ///
- public void BeReady() + public void OnFirstEnter() { - //没有标记, 啥都不要做 - if (ActivityMarks.Count == 0) + if (RoomPreinstall.IsRunWave) { - _beReady = true; - IsSeclusion = false; return; } - IsSeclusion = true; - _waveStart = false; - - if (!_beReady) + + //房间内有敌人, 或者会刷新敌人才会关门 + var hasEnemy = false; + if (AffiliationArea.ExistEnterItem(activityObject => activityObject.CollisionWithMask(PhysicsLayer.Enemy))) //先判断房间里面是否有敌人 { - _beReady = true; - //按照 WaveNumber 排序 - ActivityMarks.Sort((x, y) => - { - return x.WaveNumber - y.WaveNumber; - }); + hasEnemy = true; + } + else if (RoomPreinstall.HasEnemy()) //在判断是否会刷出敌人 + { + hasEnemy = true; } - //不是初始房间才能关门 - if (RoomSplit.RoomInfo.RoomType != DungeonRoomType.Inlet) + if (!hasEnemy) //没有敌人, 不关门 { - //关门 - foreach (var doorInfo in Doors) - { - doorInfo.Door.CloseDoor(); - } + IsSeclusion = false; + //执行第一波生成 + RoomPreinstall.StartWave(); + return; } + //关门 + foreach (var doorInfo in Doors) + { + doorInfo.Door.CloseDoor(); + } + IsSeclusion = true; + //执行第一波生成 - NextWave(); + RoomPreinstall.StartWave(); } /// @@ -231,69 +246,23 @@ public class RoomInfo : IDestroy /// public void OnClearRoom() { - if (_currWaveIndex >= ActivityMarks.Count) //所有 mark 都走完了 + if (RoomPreinstall.IsLastWave) //所有 mark 都走完了 { IsSeclusion = false; - _currActivityMarks.Clear(); //开门 - if (RoomSplit.RoomInfo.RoomType != DungeonRoomType.Inlet) + if (RoomPreinstall.HasEnemy()) { foreach (var doorInfo in Doors) { doorInfo.Door.OpenDoor(); } } + //所有标记执行完成 + RoomPreinstall.OverWave(); } else //执行下一波 { - NextWave(); - } - } - - /// - /// 返回当前这一波所有的标记的 Doing 函数是否执行完成 - /// - public bool IsCurrWaveOver() - { - for (var i = 0; i < _currActivityMarks.Count; i++) - { - if (!_currActivityMarks[i].IsOver()) - { - return false; - } - } - - return true; - } - - /// - /// 执行下一轮标记 - /// - private void NextWave() - { - if (!_waveStart) - { - _waveStart = true; - _currWaveIndex = 0; - _currWaveNumber = ActivityMarks[0].WaveNumber; - } - GD.Print("执行下一波, 当前: " + _currWaveNumber); - - _currActivityMarks.Clear(); - //根据标记生成对象 - for (; _currWaveIndex < ActivityMarks.Count; _currWaveIndex++) - { - var mark = ActivityMarks[_currWaveIndex]; - if (mark.WaveNumber != _currWaveNumber) //当前这波已经执行完成了 - { - _currWaveNumber = mark.WaveNumber; - break; - } - else //生成操作 - { - mark.BeReady(this); - _currActivityMarks.Add(mark); - } + RoomPreinstall.NextWave(); } } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DoorAreaInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/DoorAreaInfo.cs similarity index 51% rename from DungeonShooting_Godot/src/framework/map/DoorAreaInfo.cs rename to DungeonShooting_Godot/src/framework/map/serialize/DoorAreaInfo.cs index 8d2263ca7ba7f9df1cddef58dc1d6ea216a2b7d5..fe428b0269cf32f531221db0d6255b0135513a23 100644 --- a/DungeonShooting_Godot/src/framework/map/DoorAreaInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/DoorAreaInfo.cs @@ -5,7 +5,7 @@ using Godot; /// /// 用于描述门生成区域 /// -public class DoorAreaInfo +public class DoorAreaInfo : IClone { /// /// 门方向 @@ -16,27 +16,27 @@ public class DoorAreaInfo /// 起始位置, 相对 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,26 +46,37 @@ public class DoorAreaInfo /// /// 自动计算 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; } } + + public DoorAreaInfo Clone() + { + var data = new DoorAreaInfo(); + data.Start = Start; + data.End = End; + data.Direction = Direction; + return data; + } + + } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs b/DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomGroup.cs similarity index 63% rename from DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs rename to DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomGroup.cs index 6ad860be564a139cd1f0ed944b34ef98d77905b6..003dee78ba96b46c29414b14f35789c144ffcb61 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomGroup.cs @@ -7,7 +7,7 @@ using Godot; /// /// 房间组数据 /// -public class DungeonRoomGroup +public class DungeonRoomGroup : IClone { /// /// 组名称 @@ -57,8 +57,31 @@ public class DungeonRoomGroup [JsonInclude] public List EventList = new List(); + /// + /// 组包住 + /// + [JsonInclude] + public string Remark; + private bool _init = false; private Dictionary _weightRandomMap; + private List _readyBattleList; + + /// + /// 获取所有房间数据 + /// + public List GetAllRoomList() + { + var list = new List(); + list.AddRange(BattleList); + list.AddRange(InletList); + list.AddRange(OutletList); + list.AddRange(BossList); + list.AddRange(ShopList); + list.AddRange(RewardList); + list.AddRange(EventList); + return list; + } /// /// 获取指定类型房间集合 @@ -79,10 +102,47 @@ public class DungeonRoomGroup return null; } + /// + /// 移除一个房间, 返回是否移除成功 + /// + public bool RemoveRoom(DungeonRoomSplit roomSplit) + { + if (BattleList.Remove(roomSplit)) + { + return true; + } + if (InletList.Remove(roomSplit)) + { + return true; + } + if (OutletList.Remove(roomSplit)) + { + return true; + } + if (BossList.Remove(roomSplit)) + { + return true; + } + if (RewardList.Remove(roomSplit)) + { + return true; + } + if (ShopList.Remove(roomSplit)) + { + return true; + } + if (EventList.Remove(roomSplit)) + { + return true; + } + + return false; + } + /// /// 初始化权重处理 /// - public void InitWeight() + public void InitWeight(SeedRandom random) { if (_init) { @@ -94,14 +154,14 @@ public class DungeonRoomGroup foreach (var roomType in Enum.GetValues()) { - InitAdRewardWeight(roomType); + InitAdRewardWeight(roomType, random); } } - private void InitAdRewardWeight(DungeonRoomType roomType) + private void InitAdRewardWeight(DungeonRoomType roomType, SeedRandom random) { var dungeonRoomSplits = GetRoomList(roomType); - var weightRandom = new WeightRandom(); + var weightRandom = new WeightRandom(random); _weightRandomMap.Add(roomType, weightRandom); var list = new List(); @@ -130,4 +190,18 @@ public class DungeonRoomGroup return null; } + + public DungeonRoomGroup Clone() + { + var inst = new DungeonRoomGroup(); + inst.GroupName = GroupName; + inst.BattleList.AddRange(BattleList); + inst.InletList.AddRange(InletList); + inst.OutletList.AddRange(OutletList); + inst.BossList.AddRange(BossList); + inst.ShopList.AddRange(ShopList); + inst.RewardList.AddRange(RewardList); + inst.EventList.AddRange(EventList); + return inst; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomInfo.cs similarity index 39% rename from DungeonShooting_Godot/src/framework/map/DungeonRoomInfo.cs rename to DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomInfo.cs index 72a8801a5ecf5f5ce518ece527b08335978b72a5..1a6dd9a79747bdaa8a0c8ec76c1ea37b89d36bb1 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomInfo.cs @@ -25,17 +25,11 @@ public class DungeonRoomInfo [JsonInclude] public List DoorAreaInfos; - /// - /// 导航数据 - /// - [JsonInclude] - public List NavigationList; - /// /// 当前房间所属分组的名称 /// [JsonInclude] - public string GroupName = "unclaimed"; + public string GroupName; /// /// 房间类型 @@ -44,14 +38,55 @@ public class DungeonRoomInfo public DungeonRoomType RoomType = DungeonRoomType.Battle; /// - /// 房间文件名称 + /// 房间名称 /// [JsonInclude] - public string FileName; + public string RoomName; /// /// 房间权重, 值越大, 生成地牢是越容易出现该房间 /// [JsonInclude] - public int Weight = DungeonRoomTemplate.DefaultWeight; + public int Weight = ResourceManager.DefaultWeight; + + /// + /// 房间备注 + /// + [JsonInclude] + public string Remark; + + private List _completionDoorArea; + + /// + /// 获取门区域配置数据, 如果该函数会自动填充未配置的数据 + /// + public List GetCompletionDoorArea() + { + if (_completionDoorArea == null) + { + //需要处理 DoorAreaInfos 长度为 0 的房间, 并为其配置默认值 + _completionDoorArea = new List(DoorAreaInfos); + if (_completionDoorArea.Count == 0) + { + _completionDoorArea.Add(new DoorAreaInfo(DoorDirection.N, GameConfig.TileCellSize, ((int)Size.X - 1) * GameConfig.TileCellSize)); + _completionDoorArea.Add(new DoorAreaInfo(DoorDirection.S, GameConfig.TileCellSize, ((int)Size.X - 1) * GameConfig.TileCellSize)); + _completionDoorArea.Add(new DoorAreaInfo(DoorDirection.W, GameConfig.TileCellSize, ((int)Size.Y - 1) * GameConfig.TileCellSize)); + _completionDoorArea.Add(new DoorAreaInfo(DoorDirection.E, GameConfig.TileCellSize, ((int)Size.Y - 1) * GameConfig.TileCellSize)); + } + } + + return _completionDoorArea; + } + + /// + /// 清除门区域配置数据, 再次调用 GetCompletionDoorArea() 会重新计算 DoorAreaInfo 数据 + /// + public void ClearCompletionDoorArea() + { + if (_completionDoorArea != null) + { + _completionDoorArea.Clear(); + _completionDoorArea = null; + } + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomSplit.cs b/DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomSplit.cs new file mode 100644 index 0000000000000000000000000000000000000000..239bc8eb253620e12a166a81330b9d91992cf3cb --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/serialize/DungeonRoomSplit.cs @@ -0,0 +1,203 @@ + +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Text.Json.Serialization; +using Godot; + +/// +/// 房间配置文件相关信息, 将会在 RoomConfig.json 中汇总 +/// +public class DungeonRoomSplit +{ + /// + /// 房间异常类型 + /// + [JsonInclude] + public RoomErrorType ErrorType; + + /// + /// 该房间的文件夹路径 + /// + [JsonInclude] + public string Path; + + /// + /// 房间配置路径 + /// + [JsonIgnore] + public string RoomPath => Path + "/RoomInfo.json"; + + /// + /// 房间地块配置数据 + /// + [JsonIgnore] + public string TilePath => Path + "/TileInfo.json"; + + /// + /// 房间预设配置数据 + /// + [JsonIgnore] + public string PreinstallPath => Path + "/Preinstall.json"; + + /// + /// 预览图路径 + /// + [JsonIgnore] + public string PreviewPath => Path + "/Preview.png"; + + /// + /// 房间配置数据, 第一次获取会在资源中加载数据 + /// + [JsonIgnore] + public DungeonRoomInfo RoomInfo + { + get + { + if (_roomInfo == null && RoomPath != null) + { + ReloadRoomInfo(); + } + + return _roomInfo; + } + set => _roomInfo = value; + } + + private DungeonRoomInfo _roomInfo; + + /// + /// 房间地块配置数据 + /// + [JsonIgnore] + public DungeonTileInfo TileInfo + { + get + { + if (_tileInfo == null && TilePath != null) + { + ReloadTileInfo(); + } + + return _tileInfo; + } + set => _tileInfo = value; + } + + private DungeonTileInfo _tileInfo; + + /// + /// 房间预设数据 + /// + [JsonIgnore] + public List Preinstall + { + get + { + if (_preinstall == null && PreinstallPath != null) + { + ReloadPreinstall(); + } + + return _preinstall; + } + set => _preinstall = value; + } + + private List _preinstall; + + /// + /// 预览图 + /// + [JsonIgnore] + public Texture2D PreviewImage + { + get + { + if (_previewImage == null) + { + ReloadPreviewImage(); + } + + return _previewImage; + } + set + { + if (_previewImage != null) + { + _previewImage.Dispose(); + } + + _previewImage = value; + } + } + + private Texture2D _previewImage; + + /// + /// 重新加载房间数据 + /// + public void ReloadRoomInfo() + { + var asText = ResourceManager.LoadText(RoomPath); + _roomInfo = JsonSerializer.Deserialize(asText); + } + + /// + /// 重新加载房间地块配置数据 + /// + public void ReloadTileInfo() + { + var asText = ResourceManager.LoadText(TilePath); + _tileInfo = JsonSerializer.Deserialize(asText); + } + + /// + /// 重新加载房间预设数据 + /// + public void ReloadPreinstall() + { + var asText = ResourceManager.LoadText(PreinstallPath); + _preinstall = JsonSerializer.Deserialize>(asText); + } + + /// + /// 重新加载预览图片 + /// + public void ReloadPreviewImage() + { + if (_previewImage != null) + { + _previewImage.Dispose(); + } + + if (File.Exists(PreviewPath)) + { + var bytes = File.ReadAllBytes(PreviewPath); + + var image = Image.Create(GameConfig.PreviewImageSize, GameConfig.PreviewImageSize, false, Image.Format.Rgb8); + image.LoadPngFromBuffer(bytes); + _previewImage = ImageTexture.CreateFromImage(image); + } + } + + public override bool Equals(object obj) + { + if (obj == null) + { + return false; + } + + if (obj is DungeonRoomSplit roomSplit) + { + return roomSplit.Path == Path; + } + + return this == obj; + } + + public override int GetHashCode() + { + return Path.GetHashCode(); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/DungeonTileInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/DungeonTileInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..c4003b457335b9d2fa18af415f74081988c93d9d --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/serialize/DungeonTileInfo.cs @@ -0,0 +1,30 @@ + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +public class DungeonTileInfo +{ + /// + /// 导航数据 + /// + [JsonInclude] + public List NavigationList; + + /// + /// 底层数据, 五个一组, 分别为: 地图x坐标, 地图y坐标, 资源id, 图集x坐标, 图集y坐标 + /// + [JsonInclude] + public List Floor; + + /// + /// 中层数据, 五个一组, 分别为: 地图x坐标, 地图y坐标, 资源id, 图集x坐标, 图集y坐标 + /// + [JsonInclude] + public List Middle; + + /// + /// 顶层数据, 五个一组, 分别为: 地图x坐标, 地图y坐标, 资源id, 图集x坐标, 图集y坐标 + /// + [JsonInclude] + public List Top; +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/MarkInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/MarkInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..41bdd08ecafc92da89098885d5fd0ff899044ac4 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/serialize/MarkInfo.cs @@ -0,0 +1,50 @@ + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +/// +/// 标记数据 +/// +public class MarkInfo +{ + /// + /// 所在坐标 + /// + [JsonInclude] + public SerializeVector2 Position; + + /// + /// 区域大小 + /// + [JsonInclude] + public SerializeVector2 Size; + + /// + /// 特殊标记类型 + /// + [JsonInclude] + public SpecialMarkType SpecialMarkType = SpecialMarkType.Normal; + + /// + /// 延时时间, 单位: 秒 + /// + [JsonInclude] + public float DelayTime; + + /// + /// 标记列表数据 + /// + [JsonInclude] + public List MarkList; + + /// + /// 从指定 MarkInfo 克隆数据, 浅拷贝 + /// + public void CloneFrom(MarkInfo mark) + { + Position = mark.Position; + Size = mark.Size; + DelayTime = mark.DelayTime; + MarkList = mark.MarkList; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/MarkInfoItem.cs b/DungeonShooting_Godot/src/framework/map/serialize/MarkInfoItem.cs new file mode 100644 index 0000000000000000000000000000000000000000..6e38c9330fda38044d0884e5011c92ff1dd21a84 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/serialize/MarkInfoItem.cs @@ -0,0 +1,45 @@ + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +/// +/// 标记项数据 +/// +public class MarkInfoItem +{ + /// + /// 物体Id + /// + [JsonInclude] + public string Id; + + /// + /// 权重 + /// + [JsonInclude] + public int Weight; + + /// + /// 额外属性 + /// + [JsonInclude] + public Dictionary Attr; + + /// + /// 物体初始海拔高度 + /// + [JsonInclude] + public int Altitude; + + /// + /// 物体初始纵轴速度 + /// + [JsonInclude] + public float VerticalSpeed; + + /// + /// 所属标记类型 + /// + [JsonIgnore] + public SpecialMarkType SpecialMarkType = SpecialMarkType.Normal; +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/NavigationPolygonData.cs b/DungeonShooting_Godot/src/framework/map/serialize/NavigationPolygonData.cs similarity index 39% rename from DungeonShooting_Godot/src/framework/map/NavigationPolygonData.cs rename to DungeonShooting_Godot/src/framework/map/serialize/NavigationPolygonData.cs index 5273a1e2524ef11b93505e454d7032a34202ed99..bc142daf7537ec5c2606266a4b3f08815acbe0c0 100644 --- a/DungeonShooting_Godot/src/framework/map/NavigationPolygonData.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/NavigationPolygonData.cs @@ -23,59 +23,59 @@ public class NavigationPolygonData /// /// 导航轮廓类型 /// - [JsonInclude] public NavigationPolygonType Type; + [JsonInclude] + public NavigationPolygonType Type; /// - /// 多边形的顶点, 单位: 像素 + /// 多边形的顶点, 两个为一组, 单位: 像素, 需要获取转为 Vector2[] 的值请调用 GetPoints() 函数 /// - [JsonInclude] public List Points = new List(); + [JsonInclude] + public List Points; + private Vector2[] _pointVector2Array; + public NavigationPolygonData() { } - public NavigationPolygonData(NavigationPolygonType type, List points) + public NavigationPolygonData(NavigationPolygonType type) { Type = type; - Points = points; } - + /// - /// 将 Points 字段转为 Vector2[] 类型数据并返回 + /// 读取所有的坐标点 /// - public Vector2[] ConvertPointsToVector2Array() + public Vector2[] GetPoints() { - if (Points == null) + if (_pointVector2Array == null) { - return null; - } + if (Points == null) + { + return null; + } - var array = new Vector2[Points.Count]; - for (var i = 0; i < Points.Count; i++) - { - array[i] = Points[i].AsVector2(); + _pointVector2Array = new Vector2[Points.Count / 2]; + for (var i = 0; i < Points.Count; i += 2) + { + _pointVector2Array[i / 2] = new Vector2(Points[i], Points[i + 1]); + } } - return array; + return _pointVector2Array; } /// - /// 将 Points 字段转为 Vector2I[] 类型数据并返回 + /// 设置所有的坐标点 /// - public Vector2I[] ConvertPointsToVector2IArray() + public void SetPoints(Vector2[] array) { - if (Points == null) + _pointVector2Array = array; + Points = new List(); + foreach (var pos in array) { - return null; + Points.Add(pos.X); + Points.Add(pos.Y); } - - var array = new Vector2I[Points.Count]; - for (var i = 0; i < Points.Count; i++) - { - array[i] = Points[i].AsVector2I(); - } - - return array; } - } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/RoomErrorType.cs b/DungeonShooting_Godot/src/framework/map/serialize/RoomErrorType.cs new file mode 100644 index 0000000000000000000000000000000000000000..510c27b69c0878d8856ef126b75711fa8d3c8e73 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/serialize/RoomErrorType.cs @@ -0,0 +1,27 @@ + +/// +/// 房间错误类型 +/// +public enum RoomErrorType +{ + /// + /// 没有错误 + /// + None = 0, + /// + /// 空房间 + /// + Empty = 1, + /// + /// 地图绘制错误 + /// + TileError = 2, + /// + /// 门区域绘制错误 + /// + DoorAreaError = 3, + /// + /// 没有预设 + /// + NoPreinstallError = 4 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/RoomPreinstallInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/RoomPreinstallInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..73713c61eb0da392d0e7e96f4ca63853d3773c34 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/serialize/RoomPreinstallInfo.cs @@ -0,0 +1,44 @@ + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +/// +/// 房间预设数据 +/// +public class RoomPreinstallInfo +{ + /// + /// 预设名称 + /// + [JsonInclude] + public string Name; + + /// + /// 预设权重 + /// + [JsonInclude] + public int Weight; + + /// + /// 预设备注 + /// + [JsonInclude] + public string Remark; + + /// + /// 波数数据 + /// + [JsonInclude] + public List> WaveList; + + /// + /// 初始化波数据 + /// + public void InitWaveList() + { + WaveList = new List> + { + new List() + }; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/IUiNode.cs b/DungeonShooting_Godot/src/framework/ui/IUiNode.cs index 7e20a1392bac3a18606098ce9cb8995c1bcbd031..5597e3c2b1040510fddd12f558e2315c2b877283 100644 --- a/DungeonShooting_Godot/src/framework/ui/IUiNode.cs +++ b/DungeonShooting_Godot/src/framework/ui/IUiNode.cs @@ -1,47 +1,73 @@ - + using Godot; /// -/// Ui节点代码接口 +/// Ui节点接口 /// -/// Godot中的节点类型 -/// 克隆该对象返回的类型 -public abstract class IUiNode : IClone where TNodeType : Node +public interface IUiNode { /// - /// Godot节点实例 + /// 嵌套打开子ui + /// + UiBase OpenNestedUi(string uiName, UiBase prevUi = null); + + /// + /// 嵌套打开子ui + /// + T OpenNestedUi(string uiName, UiBase prevUi = null) where T : UiBase; + + /// + /// 获取所属Ui面板 + /// + UiBase GetUiPanel(); + + /// + /// 获取Ui实例 /// - public TNodeType Instance { get; } + Node GetUiInstance(); + /// - /// 克隆当前对象, 并返回新的对象, - /// 注意: 如果子节点改名或者移动层级, 那么有可能对导致属性中的子节点无法访问 + /// 获取克隆的Ui实例 /// - public abstract TCloneType Clone(); + IUiCellNode CloneUiCell(); - public IUiNode(TNodeType node) - { - Instance = node; - } + /// + /// 添加子级Ui节点 + /// + void AddChild(IUiNode uiNode); /// - /// 嵌套打开子ui + /// 添加子级Ui节点 /// - public UiBase OpenNestedUi(string uiName) - { - var packedScene = ResourceManager.Load("res://" + GameConfig.UiPrefabDir + uiName + ".tscn"); - var uiBase = packedScene.Instantiate(); - Instance.AddChild(uiBase); - - uiBase.OnCreateUi(); - uiBase.ShowUi(); - return uiBase; - } + void AddChild(Node node); + + /// + /// 移除子级Ui节点 + /// + void RemoveChild(IUiNode uiNode); /// - /// 嵌套打开子ui + /// 移除子级Ui节点 + /// + void RemoveChild(Node node); + + /// + /// 销毁当前节点 + /// + void QueueFree(); + + /// + /// 更改父节点, 但是当前节点的父节点不能为空 + /// + void Reparent(IUiNode uiNode); + + /// + /// 更改父节点, 但是当前节点的父节点不能为空 + /// + void Reparent(Node node); + + /// + /// 获取父节点 /// - public T OpenNestedUi(string uiName) where T : UiBase - { - return (T)OpenNestedUi(uiName); - } -} \ No newline at end of file + Node GetParent(); +} diff --git a/DungeonShooting_Godot/src/framework/ui/IUiNodeScript.cs b/DungeonShooting_Godot/src/framework/ui/IUiNodeScript.cs new file mode 100644 index 0000000000000000000000000000000000000000..e64516b357d2a4f7af536f8d8898fadfc14f258b --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/IUiNodeScript.cs @@ -0,0 +1,17 @@ + +/// +/// Ui节点脚本接口, 用于脚本便捷获取所属Ui节点对象
+/// 注意: 由于 Godot 编辑器不会自动编译代码, 所以新创建的脚本如果实现该接口请先编译代码 +///
+public interface IUiNodeScript +{ + /// + /// 设置所属Ui节点对象, 该函数会在 _Ready() 之后调用 + /// + void SetUiNode(IUiNode uiNode); + + /// + /// 当前Ui被销毁时调用 + /// + void OnDestroy(); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/UiBase.cs b/DungeonShooting_Godot/src/framework/ui/UiBase.cs index 01bc2a889ab952eed898b1c0b0526d4a5a546d2a..8a16a0cd6efe3df566aa253fe89acebd904f50c5 100644 --- a/DungeonShooting_Godot/src/framework/ui/UiBase.cs +++ b/DungeonShooting_Godot/src/framework/ui/UiBase.cs @@ -1,4 +1,3 @@ -using System; using System.Collections; using System.Collections.Generic; using Godot; @@ -6,8 +5,7 @@ using Godot; /// /// Ui 基类 /// -[Tool] -public abstract partial class UiBase : Control +public abstract partial class UiBase : Control, IDestroy, ICoroutine { /// /// 当前 UI 所属层级 @@ -15,18 +13,6 @@ public abstract partial class UiBase : Control [Export] public UiLayer Layer = UiLayer.Middle; - /// - /// Ui 模式, 单例/正常模式 - /// - [Export] - public UiMode Mode = UiMode.Normal; - - /// - /// 阻止下层 Ui 点击 - /// - [Export] - public bool KeepOut = false; - /// /// ui名称 /// @@ -36,22 +22,40 @@ public abstract partial class UiBase : Control /// 是否已经打开ui /// public bool IsOpen { get; private set; } = false; + + public bool IsDestroyed { get; private set; } + + /// + /// 负责记录上一个Ui + /// + public UiBase PrevUi { get; set; } + + /// + /// 所属父级Ui, 仅当通过 UiNode.OpenNestedUi() 打开时才会赋值
+ /// 注意: 如果是在预制体中放置的子 Ui, 那么子 Ui 的该属性会在 父 Ui 的 OnCreateUi() 之后赋值 + ///
+ public UiBase ParentUi { get; private set; } /// - /// 是否已经销毁 + /// 所属父级节点, 仅当通过 UiNode.OpenNestedUi() 打开时才会赋值
+ /// 注意: 如果是在预制体中放置的子 Ui, 那么子 Ui 的该属性会在 父 Ui 的 OnCreateUi() 之后赋值 ///
- public bool IsDisposed { get; private set; } = false; + public IUiNode ParentNode { get; private set; } //开启的协程 private List _coroutineList; - + //嵌套打开的Ui列表 + private HashSet _nestedUiSet; + //当前Ui包含的 IUiNodeScript 接口, 关闭Ui是需要调用 IUiNodeScript.OnDestroy() + private HashSet _nodeScripts; + public UiBase(string uiName) { UiName = uiName; //记录ui打开 UiManager.RecordUi(this, UiManager.RecordType.Open); } - + /// /// 创建当前ui时调用 /// @@ -59,20 +63,31 @@ public abstract partial class UiBase : Control { } + /// + /// 用于初始化打开的子Ui, 在 OnCreateUi() 之后调用 + /// + public virtual void OnInitNestedUi() + { + } + /// /// 当前ui显示时调用 /// - public abstract void OnShowUi(); + public virtual void OnShowUi() + { + } /// /// 当前ui隐藏时调用 /// - public abstract void OnHideUi(); + public virtual void OnHideUi() + { + } /// /// 销毁当前ui时调用 /// - public virtual void OnDisposeUi() + public virtual void OnDestroyUi() { } @@ -88,6 +103,11 @@ public abstract partial class UiBase : Control ///
public void ShowUi() { + if (IsDestroyed) + { + GD.PrintErr($"当前Ui: {UiName}已经被销毁!"); + return; + } if (IsOpen) { return; @@ -96,6 +116,15 @@ public abstract partial class UiBase : Control IsOpen = true; Visible = true; OnShowUi(); + + //子Ui调用显示 + if (_nestedUiSet != null) + { + foreach (var uiBase in _nestedUiSet) + { + uiBase.ShowUi(); + } + } } /// @@ -103,6 +132,11 @@ public abstract partial class UiBase : Control /// public void HideUi() { + if (IsDestroyed) + { + GD.PrintErr($"当前Ui: {UiName}已经被销毁!"); + return; + } if (!IsOpen) { return; @@ -111,27 +145,67 @@ public abstract partial class UiBase : Control IsOpen = false; Visible = false; OnHideUi(); + + //子Ui调用隐藏 + if (_nestedUiSet != null) + { + foreach (var uiBase in _nestedUiSet) + { + uiBase.HideUi(); + } + } } /// /// 关闭并销毁ui /// - public void DisposeUi() + public void Destroy() { - if (IsDisposed) + if (IsDestroyed) { return; } //记录ui关闭 UiManager.RecordUi(this, UiManager.RecordType.Close); HideUi(); - IsDisposed = true; - OnDisposeUi(); + IsDestroyed = true; + OnDestroyUi(); + + //子Ui调用销毁 + if (_nestedUiSet != null) + { + foreach (var uiBase in _nestedUiSet) + { + uiBase.ParentUi = null; + uiBase.Destroy(); + } + _nestedUiSet.Clear(); + } + + //销毁 IUiNodeScript + if (_nodeScripts != null) + { + foreach (var uiNodeScript in _nodeScripts) + { + uiNodeScript.OnDestroy(); + } + } + + //在父Ui中移除当前Ui + if (ParentUi != null) + { + ParentUi.RecordNestedUi(this, null, UiManager.RecordType.Close); + } + QueueFree(); } public sealed override void _Process(double delta) { + if (!IsOpen) + { + return; + } var newDelta = (float)delta; Process(newDelta); @@ -143,82 +217,157 @@ public abstract partial class UiBase : Control } /// - /// 开启一个协程, 返回协程 id, 协程是在普通帧执行的, 支持: 协程嵌套, WaitForSeconds, WaitForFixedProcess, Task, SignalAwaiter + /// 嵌套打开子ui /// - public long StartCoroutine(IEnumerator able) + public UiBase OpenNestedUi(string uiName, UiBase prevUi = null) { - return ProxyCoroutineHandler.ProxyStartCoroutine(ref _coroutineList, able); + var packedScene = ResourceManager.Load("res://" + GameConfig.UiPrefabDir + uiName + ".tscn"); + var uiBase = packedScene.Instantiate(); + uiBase.PrevUi = prevUi; + AddChild(uiBase); + RecordNestedUi(uiBase, null, UiManager.RecordType.Open); + + uiBase.OnCreateUi(); + uiBase.OnInitNestedUi(); + if (IsOpen) + { + uiBase.ShowUi(); + } + + return uiBase; } /// - /// 根据协程 id 停止协程 + /// 嵌套打开子ui /// - public void StopCoroutine(long coroutineId) + public T OpenNestedUi(string uiName, UiBase prevUi = null) where T : UiBase { - ProxyCoroutineHandler.ProxyStopCoroutine(ref _coroutineList, coroutineId); + return (T)OpenNestedUi(uiName, prevUi); } - + /// - /// 停止所有协程 + /// 记录嵌套打开/关闭的UI /// - public void StopAllCoroutine() + public void RecordNestedUi(UiBase uiBase, IUiNode node, UiManager.RecordType type) { - ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); + if (type == UiManager.RecordType.Open) + { + if (uiBase.ParentUi != null && uiBase.ParentUi != this) + { + GD.PrintErr($"子Ui:'{uiBase.UiName}'已经被其他Ui:'{uiBase.ParentUi.UiName}'嵌套打开!"); + uiBase.ParentUi.RecordNestedUi(uiBase, node, UiManager.RecordType.Close); + } + if (_nestedUiSet == null) + { + _nestedUiSet = new HashSet(); + } + + uiBase.ParentUi = this; + uiBase.ParentNode = node; + _nestedUiSet.Add(uiBase); + } + else + { + if (uiBase.ParentUi == this) + { + uiBase.ParentUi = null; + uiBase.ParentNode = null; + } + else + { + GD.PrintErr($"当前Ui:'{UiName}'没有嵌套打开子Ui:'{uiBase.UiName}'!"); + return; + } + + if (_nestedUiSet == null) + { + return; + } + _nestedUiSet.Remove(uiBase); + } } - + /// - /// 延时指定时间调用一个回调函数 + /// 记录当前Ui包含的 IUiNodeScript 接口 /// - public void CallDelay(float delayTime, Action cb) + public void RecordUiNodeScript(IUiNodeScript nodeScript) { - StartCoroutine(_CallDelay(delayTime, cb)); + if (_nodeScripts == null) + { + _nodeScripts = new HashSet(); + } + _nodeScripts.Add(nodeScript); } - + /// - /// 延时指定时间调用一个回调函数 + /// 打开下一级Ui, 当前Ui会被隐藏 /// - public void CallDelay(float delayTime, Action cb, T1 arg1) + /// 下一级Ui的名称 + public UiBase OpenNextUi(string uiName) { - StartCoroutine(_CallDelay(delayTime, cb, arg1)); + UiBase uiBase; + if (ParentUi != null) //说明当前Ui是嵌套Ui + { + if (ParentNode != null) //子层级打开 + { + uiBase = ParentNode.OpenNestedUi(uiName, this); + } + else + { + uiBase = ParentUi.OpenNestedUi(uiName, this); + } + } + else //正常打开 + { + uiBase = UiManager.OpenUi(uiName, this); + } + HideUi(); + return uiBase; } + /// - /// 延时指定时间调用一个回调函数 + /// 打开下一级Ui, 当前Ui会被隐藏 /// - public void CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2) + /// 下一级Ui的名称 + public T OpenNextUi(string uiName) where T : UiBase { - StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2)); + return (T)OpenNextUi(uiName); } - + /// - /// 延时指定时间调用一个回调函数 + /// 返回上一级Ui, 当前Ui会被销毁 /// - public void CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2, T3 arg3) + public void OpenPrevUi() { - StartCoroutine(_CallDelay(delayTime, cb, arg1, arg2, arg3)); + Destroy(); + if (PrevUi == null) + { + GD.PrintErr($"Ui: {UiName} 没有记录上一级Ui!"); + } + else + { + PrevUi.ShowUi(); + } } - private IEnumerator _CallDelay(float delayTime, Action cb) + public long StartCoroutine(IEnumerator able) { - yield return new WaitForSeconds(delayTime); - cb(); + return ProxyCoroutineHandler.ProxyStartCoroutine(ref _coroutineList, able); } - private IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1) + public void StopCoroutine(long coroutineId) { - yield return new WaitForSeconds(delayTime); - cb(arg1); + ProxyCoroutineHandler.ProxyStopCoroutine(ref _coroutineList, coroutineId); } - private IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2) + public bool IsCoroutineOver(long coroutineId) { - yield return new WaitForSeconds(delayTime); - cb(arg1, arg2); + return ProxyCoroutineHandler.ProxyIsCoroutineOver(ref _coroutineList, coroutineId); } - private IEnumerator _CallDelay(float delayTime, Action cb, T1 arg1, T2 arg2, T3 arg3) + public void StopAllCoroutine() { - yield return new WaitForSeconds(delayTime); - cb(arg1,arg2, arg3); + ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/UiGridContainer.cs b/DungeonShooting_Godot/src/framework/ui/UiGridContainer.cs new file mode 100644 index 0000000000000000000000000000000000000000..891fe3303d425852b582016658d25290ce4ce607 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/UiGridContainer.cs @@ -0,0 +1,27 @@ +using System; +using Godot; + +/// +/// 用于 UiGrid 类 +/// +public partial class UiGridContainer : GridContainer +{ + private Action _onReady; + private Action _onProcess; + + public UiGridContainer(Action onReady, Action onProcess) + { + _onReady = onReady; + _onProcess = onProcess; + } + + public override void _Ready() + { + _onReady(); + } + + public override void _Process(double delta) + { + _onProcess((float)delta); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/UiManager.cs b/DungeonShooting_Godot/src/framework/ui/UiManager.cs index a9b5a61ce59087bfc86fcafd41daf015c5234e1f..0ec00a61eb912c5301bc332572c39e157fd14545 100644 --- a/DungeonShooting_Godot/src/framework/ui/UiManager.cs +++ b/DungeonShooting_Godot/src/framework/ui/UiManager.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Godot; @@ -21,6 +22,9 @@ public static partial class UiManager private static Dictionary> _recordUiMap = new Dictionary>(); + /// + /// 初始化Ui管理器 + /// public static void Init() { if (_init) @@ -78,7 +82,7 @@ public static partial class UiManager } /// - /// 记录ui的创建或者销毁 + /// 记录ui的创建或者销毁, 子 ui 通过 UiBase.RecordNestedUi() 来记录 /// public static void RecordUi(UiBase uiBase, RecordType type) { @@ -109,15 +113,47 @@ public static partial class UiManager } /// - /// 根据Ui资源路径打开Ui, 并返回Ui实例, 该Ui资源的场景根节点必须继承 + /// 根据Ui资源路径创建Ui, 并返回Ui实例, 该Ui资源的场景根节点必须继承
+ /// 该函数不会自动打开Ui, 需要手动调用 ShowUi() 函数来显示Ui ///
- public static UiBase OpenUi(string uiName) + /// Ui名称 + /// 上一级Ui, 用于UIBase.OpenPrevUi()函数返回上一级Ui + public static UiBase CreateUi(string uiName, UiBase prevUi = null) { - var packedScene = ResourceManager.Load("res://" + GameConfig.UiPrefabDir + uiName + ".tscn"); + if (!_init) + { + throw new Exception("未初始化 UiManager!, 请先调用 UiManager.Init() 函数!"); + } + var packedScene = ResourceLoader.Load("res://" + GameConfig.UiPrefabDir + uiName + ".tscn"); var uiBase = packedScene.Instantiate(); + uiBase.Visible = false; + uiBase.PrevUi = prevUi; var canvasLayer = GetUiLayer(uiBase.Layer); canvasLayer.AddChild(uiBase); uiBase.OnCreateUi(); + uiBase.OnInitNestedUi(); + return uiBase; + } + + /// + /// 根据Ui资源路径创建Ui, 并返回Ui实例, 该Ui资源的场景根节点必须继承
+ /// 该函数不会自动打开Ui, 需要手动调用 ShowUi() 函数来显示Ui + ///
+ /// Ui名称 + /// 上一级Ui, 用于UIBase.OpenPrevUi()函数返回上一级Ui + public static T CreateUi(string uiName, UiBase prevUi = null) where T : UiBase + { + return (T)CreateUi(uiName, prevUi); + } + + /// + /// 根据Ui资源路径打开Ui, 并返回Ui实例, 该Ui资源的场景根节点必须继承 + /// + /// Ui名称 + /// 上一级Ui, 用于UIBase.OpenPrevUi()函数返回上一级Ui + public static UiBase OpenUi(string uiName, UiBase prevUi = null) + { + var uiBase = CreateUi(uiName, prevUi); uiBase.ShowUi(); return uiBase; } @@ -125,17 +161,20 @@ public static partial class UiManager /// /// 根据Ui资源路径打开Ui, 并返回Ui实例, 该Ui资源的场景根节点必须继承 /// - public static T OpenUi(string uiName) where T : UiBase + /// Ui名称 + /// 上一级Ui, 用于UIBase.OpenPrevUi()函数返回上一级Ui + public static T OpenUi(string uiName, UiBase prevUi = null) where T : UiBase { - return (T)OpenUi(uiName); + return (T)OpenUi(uiName, prevUi); } + /// /// 销毁指定Ui /// - public static void DisposeUi(UiBase uiBase) + public static void DestroyUi(UiBase uiBase) { - uiBase.DisposeUi(); + uiBase.Destroy(); } /// @@ -149,7 +188,7 @@ public static partial class UiManager /// /// 销毁所有Ui /// - public static void DisposeAllUi() + public static void DestroyAllUi() { var map = new Dictionary>(); foreach (var item in _recordUiMap) @@ -161,7 +200,7 @@ public static partial class UiManager { foreach (var uiBase in item.Value) { - uiBase.DisposeUi(); + uiBase.Destroy(); } } } @@ -203,4 +242,17 @@ public static partial class UiManager return new T[0]; } + + /// + /// 获取Ui实例数量 + /// + public static int GetUiInstanceCount(string uiName) + { + if (_recordUiMap.TryGetValue(uiName, out var list)) + { + return list.Count; + } + + return 0; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/UiNode.cs b/DungeonShooting_Godot/src/framework/ui/UiNode.cs new file mode 100644 index 0000000000000000000000000000000000000000..f6e49c0d2cef332e6dec39beeda201905bd3fa15 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/UiNode.cs @@ -0,0 +1,129 @@ + +using Godot; + +/// +/// Ui节点父类 +/// +/// 所属Ui面板类型 +/// Godot中的节点类型 +/// 克隆该对象返回的类型 +public abstract class UiNode + : IUiNode, IUiCellNode, IClone + where TUi : UiBase + where TNodeType : Node + where TCloneType : IUiCellNode +{ + /// + /// 当前Ui节点所属的Ui面板对象 + /// + public TUi UiPanel { get; } + /// + /// Godot节点实例 + /// + public TNodeType Instance { get; } + /// + /// 克隆当前对象, 并返回新的对象, + /// 注意: 如果子节点改名或者移动层级, 那么有可能对导致属性中的子节点无法访问 + /// + public abstract TCloneType Clone(); + + public UiNode(TUi uiPanel, TNodeType node) + { + UiPanel = uiPanel; + Instance = node; + if (node is IUiNodeScript uiNodeScript) + { + uiPanel.RecordUiNodeScript(uiNodeScript); + uiNodeScript.SetUiNode(this); + } + } + + //已知问题: 通过 OpenNestedUi() 打开子Ui, 然后再克隆当前节点, 被克隆出来的节点的子Ui不会被调用生命周期函数, 也就是没有被记录 + public UiBase OpenNestedUi(string uiName, UiBase prevUi = null) + { + var packedScene = ResourceManager.Load("res://" + GameConfig.UiPrefabDir + uiName + ".tscn"); + var uiBase = packedScene.Instantiate(); + uiBase.PrevUi = prevUi; + Instance.AddChild(uiBase); + UiPanel.RecordNestedUi(uiBase, this, UiManager.RecordType.Open); + + uiBase.OnCreateUi(); + uiBase.OnInitNestedUi(); + if (UiPanel.IsOpen) + { + uiBase.ShowUi(); + } + + return uiBase; + } + + public T OpenNestedUi(string uiName, UiBase prevUi = null) where T : UiBase + { + return (T)OpenNestedUi(uiName, prevUi); + } + + /// + /// 克隆当前节点, 并放到同父节点下 + /// + public TCloneType CloneAndPut() + { + var inst = Clone(); + Instance.GetParent().AddChild(inst.GetUiInstance()); + return inst; + } + + public UiBase GetUiPanel() + { + return UiPanel; + } + + public Node GetUiInstance() + { + return Instance; + } + + public IUiCellNode CloneUiCell() + { + return Clone(); + } + + public void AddChild(IUiNode uiNode) + { + Instance.AddChild(uiNode.GetUiInstance()); + } + + public void AddChild(Node node) + { + Instance.AddChild(node); + } + + public void RemoveChild(IUiNode uiNode) + { + Instance.RemoveChild(uiNode.GetUiInstance()); + } + + public void RemoveChild(Node node) + { + Instance.RemoveChild(node); + } + + public void QueueFree() + { + Instance.QueueFree(); + } + + public void Reparent(IUiNode uiNode) + { + Instance.Reparent(uiNode.GetUiInstance()); + } + + public void Reparent(Node node) + { + Instance.Reparent(node); + } + + public Node GetParent() + { + return Instance.GetParent(); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/grid/IUiCell.cs b/DungeonShooting_Godot/src/framework/ui/grid/IUiCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..df0d81268b1288a82c43d0dbe3155b2fce64b7b4 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/grid/IUiCell.cs @@ -0,0 +1,85 @@ + +/// +/// 网格组件中单个格子的数据处理类接口, 无泛型 +/// +public interface IUiCell : IDestroy +{ + /// + /// 是否启用了当前 Cell + /// + bool Enable { get; } + + /// + /// 当前 Cell 在 UiGrid 组件中的索引位置 + /// + int Index { get; } + + /// + /// 获取所在网格组件 + /// + IUiGrid GetGrid(); + + /// + /// 当前 Cell 初始化时调用 + /// + void OnInit(); + + /// + /// 如果启用了当前 Cell, 则每帧调用 + /// + void Process(float delta); + + /// + /// 触发当前 Cell 的点击 + /// + void Click(); + + /// + /// 当前Ui被点击时调用
+ /// 如果 Cell 的模板为 BaseButton 类型, 则 UiCell 会自动绑定点击事件
+ /// 如果需要自己绑定点击事件, 请绑定 UiCell.Click() 函数
+ /// 如果当前 Cell 未被选中, 则 OnSelect() 会比 OnClick() 先调用 + ///
+ void OnClick(); + + /// + /// 双击当前 Cell 调用 + /// + void OnDoubleClick(); + + /// + /// 当启用当前 Cell 时调用 + /// + void OnEnable(); + + /// + /// 当禁用当前 Cell 时调用, 也就是被回收时调用 + /// + void OnDisable(); + + /// + /// 当检测当前 Cell 是否可以被选中时调用 + /// + bool CanSelect(); + + /// + /// 当前 Cell 选中时调用, 设置 UiGrid.SelectIndex 时触发 + /// + void OnSelect(); + + /// + /// 当前 Cell 取消选中时调用, 设置 UiGrid.SelectIndex 时触发 + /// + void OnUnSelect(); + + /// + /// 当 Cell 索引发生改变时调用, 在 UiGrid 中调用 Insert(), Remove() 等函数时被动触发当前 Cell 索引值改变, Cell 业务逻辑需要用到索引值时, 那么就可以重写该函数
+ /// 注意: 该函数第一次调用会在 OnSetData() 之前调用 + ///
+ void OnRefreshIndex(); + + /// + /// 销毁当前cell时调用 + /// + void OnDestroy(); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/grid/IUiCellNode.cs b/DungeonShooting_Godot/src/framework/ui/grid/IUiCellNode.cs new file mode 100644 index 0000000000000000000000000000000000000000..6f00dfd49891fd6a4c216ccddef192d2fe116d01 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/grid/IUiCellNode.cs @@ -0,0 +1,23 @@ + +using Godot; + +/// +/// 用于网格中的cell对象 +/// +public interface IUiCellNode +{ + /// + /// 获取节点实例 + /// + Node GetUiInstance(); + + /// + /// 克隆并返回新的节点实例 + /// + IUiCellNode CloneUiCell(); + + /// + /// 获取所属 Ui 面板 + /// + UiBase GetUiPanel(); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/grid/IUiGrid.cs b/DungeonShooting_Godot/src/framework/ui/grid/IUiGrid.cs new file mode 100644 index 0000000000000000000000000000000000000000..0fad5c114489f991a6ca4116bb6877227c5265d7 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/grid/IUiGrid.cs @@ -0,0 +1,27 @@ + + +/// +/// Ui网格组件基础接口, 无泛型 +/// +public interface IUiGrid : IDestroy +{ + /// + /// 当前选中的 Cell 索引 + /// + int SelectIndex { get; set; } + + /// + /// 设置网格组件是否可见 + /// + bool Visible { get; set; } + + /// + /// 当前网格组件数据大小 + /// + int Count { get; } + + /// + /// 触发点击 Cell + /// + void Click(int index); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/grid/UiCell.cs b/DungeonShooting_Godot/src/framework/ui/grid/UiCell.cs index 2870ffa94f1bcac044eccdd628f431475782d3fa..31b88a3f8844917d2c2e9ef89b047ddad9354d53 100644 --- a/DungeonShooting_Godot/src/framework/ui/grid/UiCell.cs +++ b/DungeonShooting_Godot/src/framework/ui/grid/UiCell.cs @@ -1,22 +1,192 @@  +using System; using Godot; -public abstract class UiCell : IDestroy where TNodeType : Node where TUiNodeType : IUiNode +/// +/// 网格组件中单个格子的数据处理类 +/// +/// ui节点类型 +/// 数据类型 +public abstract class UiCell : IUiCell, IData where TUiCellNode : IUiCellNode { public bool IsDestroyed { get; private set; } - public UiGrid Grid { get; set; } - public TUiNodeType CellNode { get; set; } - public T Data { get; set; } + public bool Enable { get; private set; } + + public int Index { get; private set; } = -1; + + /// + /// 所在的网格对象 + /// + public UiGrid Grid { get; private set; } + + /// + /// 当前cell使用的Ui节点对象 + /// + public TUiCellNode CellNode { get; private set; } + + /// + /// 当前cell分配的数据 + /// + public T Data { get; private set; } + + private bool _init = false; + //上一次点击的时间 + private long _prevClickTime = -1; + + public IUiGrid GetGrid() + { + return Grid; + } public virtual void OnInit() { } + /// + /// 当前cell被分配值时调用 + /// public virtual void OnSetData(T data) { } + + public virtual void Process(float delta) + { + } + + public virtual void OnClick() + { + } + + public virtual void OnDoubleClick() + { + } + + public virtual void OnEnable() + { + } + + public virtual void OnDisable() + { + } + + public virtual bool CanSelect() + { + return true; + } + + public virtual void OnSelect() + { + } + + public virtual void OnUnSelect() + { + } + + public virtual void OnRefreshIndex() + { + } + + public virtual void OnDestroy() + { + } + + /// + /// 当 Cell 参与排序时调用, 参数 other 为需要对比的另一个 Cell 对象
+ /// 函数返回 -1 表示当前 Cell 在 other 之前
+ /// 函数返回 0 表示当前 Cell 和 other 位置相同
+ /// 函数返回 1 表示当前 Cell 和 other 之后
+ ///
+ public virtual int OnSort(UiCell other) + { + return 0; + } + + /// + /// 初始化数据 + /// + public void Init(UiGrid grid, TUiCellNode cellNode, int index) + { + if (_init) + { + return; + } + + _init = true; + Grid = grid; + CellNode = cellNode; + //绑定点击事件 + if (cellNode.GetUiInstance() is BaseButton button) + { + button.Pressed += Click; + } + OnInit(); + SetIndex(index); + } + + /// + /// 设置当前 Cell 的值, 该函数由 UiGrid 调用 + /// + public void SetData(T data) + { + Data = data; + OnSetData(data); + } + + /// + /// 设置当前 Cell 的索引, 该函数由 UiGrid 对象调用 + /// + public void SetIndex(int index) + { + if (Index != index) + { + Index = index; + OnRefreshIndex(); + } + } + + /// + /// 设置是否启用该 Cell, 该函数由 UiGrid 对象调用 + /// + public void SetEnable(bool value) + { + Enable = value; + if (value) + { + OnEnable(); + } + else + { + OnDisable(); + } + } + + /// + /// 触发点击当前Ui, 如果 Cell 的模板为 BaseButton 类型, 则 UiCell 会自动绑定点击事件 + /// + public void Click() + { + Grid.SelectIndex = Index; + OnClick(); + + //双击判定 + if (_prevClickTime >= 0) + { + var now = DateTime.Now.Ticks / 10000; + if (now <= _prevClickTime + 500) + { + OnDoubleClick(); + } + + _prevClickTime = now; + } + else + { + _prevClickTime = DateTime.Now.Ticks / 10000; + } + } + public void Destroy() { if (IsDestroyed) @@ -24,6 +194,7 @@ public abstract class UiCell : IDestroy where TNodeTy return; } + OnDestroy(); IsDestroyed = true; } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs b/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs index 925b4e25f2b0fc4c3015ae13adcbb57fa14a02bf..23afa6b8e29c7398c7148119daee4a5ca05afcd2 100644 --- a/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs +++ b/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs @@ -7,50 +7,243 @@ using Godot; /// /// Ui网格组件 /// -/// 原生Godot类型 -/// Ui节点类型 +/// Ui节点类型 /// 传给Cell的数据类型 -public partial class UiGrid : GridContainer, IDestroy where TNodeType : Node where TUiNodeType : IUiNode +public class UiGrid : IUiGrid where TUiCellNode : IUiCellNode { public bool IsDestroyed { get; private set; } - private TUiNodeType _template; - private Node _parent; + + public int SelectIndex + { + get => _selectIndex; + set + { + var newIndex = Mathf.Clamp(value, -1, _cellList.Count - 1); + if (_selectIndex != newIndex) + { + //检测新的 Cell 是否可以被选中 + if (newIndex >= 0) + { + var uiCell = _cellList[newIndex]; + //不能被选中, 直接跳出 + if (!uiCell.CanSelect()) + { + return; + } + } + var prevIndex = _selectIndex; + _selectIndex = newIndex; + + //取消选中上一个 + if (prevIndex >= 0 && prevIndex < _cellList.Count) + { + var uiCell = _cellList[prevIndex]; + uiCell.OnUnSelect(); + } + + //选中新的 + if (newIndex >= 0) + { + var uiCell = _cellList[newIndex]; + uiCell.OnSelect(); + } + } + } + } + + /// + /// 选中的 Cell 包含的数据 + /// + public TData SelectData => _selectIndex >= 0 ? _cellList[_selectIndex].Data : default; + + public bool Visible + { + get => _gridContainer.Visible; + set => _gridContainer.Visible = value; + } + + public int Count => _cellList.Count; + + //模板对象 + private TUiCellNode _template; + //模板大小 + private Vector2 _size = Vector2.Zero; + //cell逻辑处理类 private Type _cellType; - private Stack> _cellPool = new Stack>(); - private List> _cellList = new List>(); + //当前活动的cell池 + private List> _cellList = new List>(); + //当前已被回收的cell池 + private Stack> _cellPool = new Stack>(); + //godot原生网格组件 + private UiGridContainer _gridContainer; + //单个cell偏移 + private Vector2I _cellOffset; + //列数 + private int _columns; + //是否自动扩展列数 + private bool _autoColumns; + //选中的cell索引 + private int _selectIndex = -1; - public UiGrid(TUiNodeType template, Type cellType, int columns, int offsetX, int offsetY) + public UiGrid(TUiCellNode template, Type cellType) { + _gridContainer = new UiGridContainer(OnReady, OnProcess); + _gridContainer.Ready += OnReady; _template = template; _cellType = cellType; - _parent = _template.Instance.GetParent(); - _parent.RemoveChild(_template.Instance); - _parent.AddChild(this); - Columns = columns; - AddThemeConstantOverride("h_separation", offsetX); - AddThemeConstantOverride("v_separation", offsetY); + var uiInstance = _template.GetUiInstance(); + uiInstance.AddSibling(_gridContainer); + uiInstance.GetParent().RemoveChild(uiInstance); + if (uiInstance is Control control) + { + _size = control.Size; + } + } + + /// + /// 设置每个 Cell 之间的偏移量 + /// + public void SetCellOffset(Vector2I offset) + { + _cellOffset = offset; + _gridContainer.AddThemeConstantOverride("h_separation", offset.X); + _gridContainer.AddThemeConstantOverride("v_separation", offset.Y); + } + + /// + /// 获取每个 Cell 之间的偏移量 + /// + public Vector2I GetCellOffset() + { + return _cellOffset; + } + + /// + /// 设置列数 + /// + public void SetColumns(int columns) + { + _columns = columns; + _gridContainer.Columns = columns; + } + + /// + /// 获取列数 + /// + public int GetColumns() + { + return _gridContainer.Columns; + } + + /// + /// 设置是否开启自动扩展列, 如果开启, 则组件会根据 GridContainer 组件所占用的宽度自动设置列数 + /// + public void SetAutoColumns(bool flag) + { + if (flag != _autoColumns) + { + _autoColumns = flag; + if (_autoColumns) + { + _gridContainer.Resized += OnGridResized; + OnGridResized(); + } + else + { + _gridContainer.Columns = _columns; + _gridContainer.Resized -= OnGridResized; + } + } + } + + /// + /// 获取是否开启自动扩展列 + /// + public bool GetAutoColumns() + { + return _autoColumns; + } + + /// + /// 设置当前组件布局方式是否横向扩展, 如果为 true, 则 GridContainer 的宽度会撑满父物体 + /// + public void SetHorizontalExpand(bool flag) + { + _gridContainer.SetHorizontalExpand(flag); + } + + /// + /// 获取当前组件布局方式是否横向扩展 + /// + public bool GetHorizontalExpand() + { + return _gridContainer.GetHorizontalExpand(); + } + + /// + /// 获取所有数据 + /// + public TData[] GetAllData() + { + var array = new TData[_cellList.Count]; + for (var i = 0; i < _cellList.Count; i++) + { + array[i] = _cellList[i].Data; + } + + return array; } - public override void _Ready() + /// + /// 获取所有 Cell 对象 + /// + public UiCell[] GetAllCell() { - if (_template.Instance is Control control) + return _cellList.ToArray(); + } + + /// + /// 根据指定索引获取数据 + /// + public TData GetData(int index) + { + if (index < 0 || index >= _cellList.Count) { - Position = control.Position; + return default; } + + return _cellList[index].Data; } + /// + /// 根据指定索引获取 Cell 对象 + /// + public UiCell GetCell(int index) + { + if (index < 0 || index >= _cellList.Count) + { + return default; + } + + return _cellList[index]; + } + + /// + /// 设置当前网格组件中的所有 Cell 数据, 性能较低 + /// public void SetDataList(TData[] array) { + //取消选中 + SelectIndex = -1; if (array.Length > _cellList.Count) { do { var cell = GetCellInstance(); - _cellList.Add(cell); - AddChild(cell.CellNode.Instance); + _gridContainer.AddChild(cell.CellNode.GetUiInstance()); } while (array.Length > _cellList.Count); } - else if(array.Length < _cellList.Count) + else if (array.Length < _cellList.Count) { do { @@ -63,18 +256,131 @@ public partial class UiGrid : GridContainer, IDes for (var i = 0; i < _cellList.Count; i++) { var data = array[i]; - _cellList[i].OnSetData(data); + _cellList[i].SetData(data); } } + /// + /// 添加单条 Cell 数据 + /// public void Add(TData data) { + //取消选中 + SelectIndex = -1; var cell = GetCellInstance(); - _cellList.Add(cell); - AddChild(cell.CellNode.Instance); - cell.OnSetData(data); + _gridContainer.AddChild(cell.CellNode.GetUiInstance()); + cell.SetData(data); + } + + /// + /// 修改指定索引的位置的 Cell 数据 + /// + public void UpdateByIndex(int index, TData data) + { + var uiCell = GetCell(index); + if (uiCell != null) + { + uiCell.SetData(data); + } + } + + /// + /// 移除指定索引的 Cell + /// + /// + public void RemoveByIndex(int index) + { + if (index < 0 || index >= _cellList.Count) + { + return; + } + + if (index >= _selectIndex) + { + //取消选中 + SelectIndex = -1; + } + var uiCell = _cellList[index]; + _cellList.RemoveAt(index); + ReclaimCellInstance(uiCell); + //更新后面的索引 + for (var i = index; i < _cellList.Count; i++) + { + var tempCell = _cellList[i]; + tempCell.SetIndex(i); + } + } + + /// + /// 移除所有 Cell + /// + public void RemoveAll() + { + //取消选中 + SelectIndex = -1; + var uiCells = _cellList.ToArray(); + _cellList.Clear(); + foreach (var uiCell in uiCells) + { + ReclaimCellInstance(uiCell); + } } + public void Click(int index) + { + if (index < 0 || index >= _cellList.Count) + { + return; + } + + _cellList[index].Click(); + } + + /// + /// 对所有已经启用的 Cell 进行排序操作, 排序时会调用 Cell 的 OnSort() 函数用于处理排序逻辑
+ /// 注意: 排序会影响 Cell 的 Index + ///
+ public void Sort() + { + if (_cellList.Count <= 0) + { + return; + } + //这里记录 SelectIndex 是让排序后 SelectIndex 指向的 Cell 不变 + var selectIndex = SelectIndex; + var selectCell = GetCell(selectIndex); + //执行排序操作 + _cellList.Sort((a, b) => a.OnSort(b)); + if (selectIndex >= 0) + { + selectIndex = _cellList.FindIndex(cell => cell == selectCell); + } + //先移除所有节点 + for (var i = 0; i < _cellList.Count; i++) + { + _gridContainer.RemoveChild(_cellList[i].CellNode.GetUiInstance()); + } + + if (selectIndex >= 0) + { + _selectIndex = selectIndex; + } + //以新的顺序加入GridContainer + for (var i = 0; i < _cellList.Count; i++) + { + _gridContainer.AddChild(_cellList[i].CellNode.GetUiInstance()); + } + //刷新Index + for (var i = 0; i < _cellList.Count; i++) + { + var cell = _cellList[i]; + cell.SetIndex(i); + } + } + + /// + /// 销毁当前网格组件 + /// public void Destroy() { if (IsDestroyed) @@ -83,40 +389,93 @@ public partial class UiGrid : GridContainer, IDes } IsDestroyed = true; - + for (var i = 0; i < _cellList.Count; i++) { _cellList[i].Destroy(); } + foreach (var uiCell in _cellPool) { uiCell.Destroy(); } + _cellList = null; _cellPool = null; + _gridContainer.QueueFree(); + } + + private void OnReady() + { + if (_template.GetUiInstance() is Control control) + { + _gridContainer.Position = control.Position; + } + } + + private void OnProcess(float delta) + { + if (IsDestroyed || !_template.GetUiPanel().IsOpen) + { + return; + } + //调用 cell 更新 + var uiCells = _cellPool.ToArray(); + for (var i = 0; i < uiCells.Length; i++) + { + var item = uiCells[i]; + if (item.Enable) + { + item.Process(delta); + } + } } - private UiCell GetCellInstance() + //获取 cell 实例 + private UiCell GetCellInstance() { if (_cellPool.Count > 0) { - return _cellPool.Pop(); + var cell = _cellPool.Pop(); + cell.SetIndex(_cellList.Count); + cell.SetEnable(true); + _cellList.Add(cell); + return cell; } - var uiCell = Activator.CreateInstance(_cellType) as UiCell; + var uiCell = Activator.CreateInstance(_cellType) as UiCell; if (uiCell is null) { - throw new Exception($"cellType 无法转为'{typeof(UiCell).FullName}'类型!"); + throw new Exception($"cellType 无法转为'{typeof(UiCell).FullName}'类型!"); } - uiCell.CellNode = _template.Clone(); - uiCell.Grid = this; - uiCell.OnInit(); + + _cellList.Add(uiCell); + uiCell.Init(this, (TUiCellNode)_template.CloneUiCell(), _cellList.Count - 1); + uiCell.SetEnable(true); return uiCell; } - private void ReclaimCellInstance(UiCell cell) + //回收 cell + private void ReclaimCellInstance(UiCell cell) { - RemoveChild(cell.CellNode.Instance); + cell.SetEnable(false); + _gridContainer.RemoveChild(cell.CellNode.GetUiInstance()); _cellPool.Push(cell); } + + private void OnGridResized() + { + if (_autoColumns && _gridContainer != null) + { + var width = _gridContainer.Size.X; + if (width <= _size.X + _cellOffset.X) + { + _gridContainer.Columns = 1; + } + else + { + _gridContainer.Columns = Mathf.FloorToInt(width / (_size.X + _cellOffset.X)); + } + } + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/AnimatorNames.cs b/DungeonShooting_Godot/src/game/AnimatorNames.cs index bbe65d1026b9b9d8f41f454f277c09072803f1f9..8ba547d7e1c16dbd55d3a830b0e209f1afc089c4 100644 --- a/DungeonShooting_Godot/src/game/AnimatorNames.cs +++ b/DungeonShooting_Godot/src/game/AnimatorNames.cs @@ -56,4 +56,8 @@ public static class AnimatorNames /// ui出场 ///
public const string Out = "out"; + /// + /// 显示动画 + /// + public const string Show = "show"; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/Cursor.cs b/DungeonShooting_Godot/src/game/Cursor.cs index 7927549cf7c4c849e9e8df7843ff0ad09806205d..aca4d114b4b43ef64873ec63f3cd20da9cc19850 100644 --- a/DungeonShooting_Godot/src/game/Cursor.cs +++ b/DungeonShooting_Godot/src/game/Cursor.cs @@ -20,16 +20,19 @@ public partial class Cursor : Node2D private Sprite2D lb; private Sprite2D rt; private Sprite2D rb; - private Sprite2D finger; - + + private Texture2D _cursorUi; + public override void _Ready() { + _cursorUi = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_sursors_Cursors_Ui_png); + //Input.SetCustomMouseCursor(_cursorUi, Input.CursorShape.Arrow, new Vector2(6, 6)); + center = GetNode("Center"); lt = GetNode("LT"); lb = GetNode("LB"); rt = GetNode("RT"); rb = GetNode("RB"); - finger = GetNode("Finger"); SetGuiMode(true); } @@ -46,9 +49,8 @@ public partial class Cursor : Node2D { SetScope(0, null); } + SetCursorPos(); } - - SetCursorPos(); } /// @@ -63,7 +65,7 @@ public partial class Cursor : Node2D lb.Visible = false; rt.Visible = false; rb.Visible = false; - finger.Visible = true; + Input.MouseMode = Input.MouseModeEnum.Visible; } else //准心 { @@ -71,7 +73,7 @@ public partial class Cursor : Node2D lb.Visible = true; rt.Visible = true; rb.Visible = true; - finger.Visible = false; + Input.MouseMode = Input.MouseModeEnum.Hidden; } } diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 517953cb46b8400f0989d30baf5736c7df829382..9a8e2c40870b1c20ebec204b1f581dd8ab7295ae 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -2,12 +2,13 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Text.Json; using Config; using Godot; using UI.BottomTips; -public partial class GameApplication : Node2D +public partial class GameApplication : Node2D, ICoroutine { public static GameApplication Instance { get; private set; } @@ -37,12 +38,6 @@ public partial class GameApplication : Node2D [ExportGroup("Debug")] [Export] public bool Debug = false; - /// - /// 测试用, 指定生成的房间 - /// - [Export] - public PackedScene[] DesignatedRoom; - /// /// 鼠标指针 /// @@ -63,10 +58,10 @@ public partial class GameApplication : Node2D /// public Dictionary RoomConfig { get; private set; } - /// - /// 房间配置数据, key: 模板房间资源路径 - /// - public Dictionary RoomConfigMap { get; private set; } + // /// + // /// 房间配置数据, key: 模板房间资源路径 + // /// + // public Dictionary RoomConfigMap { get; private set; } /// /// 游戏视图大小 @@ -100,7 +95,7 @@ public partial class GameApplication : Node2D Weapon.InitWeaponAttribute(); DungeonConfig = new DungeonConfig(); - DungeonConfig.GroupName = "testGroup"; + DungeonConfig.GroupName = RoomConfig.FirstOrDefault().Key; DungeonConfig.RoomCount = 20; } @@ -119,10 +114,7 @@ public partial class GameApplication : Node2D //窗体大小改变 GetWindow().SizeChanged += OnWindowSizeChanged; RefreshSubViewportSize(); - -#if TOOLS - InitDesignatedRoom(); -#endif + //初始化ui UiManager.Init(); // 初始化鼠标 @@ -132,9 +124,11 @@ public partial class GameApplication : Node2D DungeonManager.Name = "DungeonManager"; SceneRoot.AddChild(DungeonManager); + MapProjectManager.Init(); BottomTipsPanel.Init(); //打开主菜单Ui UiManager.Open_Main(); + //UiManager.Open_MapEditorProject(); } public override void _Process(double delta) @@ -198,49 +192,66 @@ public partial class GameApplication : Node2D return (viewPos - (GameCamera.Main.GlobalPosition + GameCamera.Main.Offset) + (ViewportSize / 2)) * PixelScale; } - /// - /// 开启一个协程, 返回协程 id, 协程是在普通帧执行的, 支持: 协程嵌套, WaitForSeconds, WaitForFixedProcess, Task, SignalAwaiter - /// public long StartCoroutine(IEnumerator able) { return ProxyCoroutineHandler.ProxyStartCoroutine(ref _coroutineList, able); } - - /// - /// 根据协程 id 停止协程 - /// + public void StopCoroutine(long coroutineId) { ProxyCoroutineHandler.ProxyStopCoroutine(ref _coroutineList, coroutineId); } - - /// - /// 停止所有协程 - /// + + public bool IsCoroutineOver(long coroutineId) + { + return ProxyCoroutineHandler.ProxyIsCoroutineOver(ref _coroutineList, coroutineId); + } + public void StopAllCoroutine() { ProxyCoroutineHandler.ProxyStopAllCoroutine(ref _coroutineList); } + public void SetRoomConfig(Dictionary roomConfig) + { + RoomConfig = roomConfig; + InitReadyRoom(); + } + //初始化房间配置 private void InitRoomConfig() { //加载房间配置信息 - var file = FileAccess.Open(ResourcePath.resource_map_RoomConfig_json, FileAccess.ModeFlags.Read); - var asText = file.GetAsText(); + var asText = ResourceManager.LoadText("res://resource/map/tileMaps/" + GameConfig.RoomGroupConfigFile); RoomConfig = JsonSerializer.Deserialize>(asText); - file.Dispose(); - //初始化RoomConfigMap - RoomConfigMap = new Dictionary(); + InitReadyRoom(); + } + + //初始化房间数据 + private void InitReadyRoom() + { foreach (var dungeonRoomGroup in RoomConfig) { - foreach (var dungeonRoomType in Enum.GetValues()) + RemoveUnreadyRooms(dungeonRoomGroup.Value.BattleList); + RemoveUnreadyRooms(dungeonRoomGroup.Value.InletList); + RemoveUnreadyRooms(dungeonRoomGroup.Value.OutletList); + RemoveUnreadyRooms(dungeonRoomGroup.Value.BossList); + RemoveUnreadyRooms(dungeonRoomGroup.Value.ShopList); + RemoveUnreadyRooms(dungeonRoomGroup.Value.RewardList); + RemoveUnreadyRooms(dungeonRoomGroup.Value.EventList); + } + } + + //移除未准备好的房间 + private void RemoveUnreadyRooms(List roomInfos) + { + for (var i = 0; i < roomInfos.Count; i++) + { + if (roomInfos[i].ErrorType != RoomErrorType.None) //存在错误 { - foreach (var dungeonRoomSplit in dungeonRoomGroup.Value.GetRoomList(dungeonRoomType)) - { - RoomConfigMap.Add(dungeonRoomSplit.ScenePath, dungeonRoomSplit); - } + roomInfos.RemoveAt(i); + i--; } } } @@ -267,7 +278,6 @@ public partial class GameApplication : Node2D //初始化鼠标 private void InitCursor() { - Input.MouseMode = Input.MouseModeEnum.Hidden; Cursor = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_Cursor_tscn); var cursorLayer = new CanvasLayer(); cursorLayer.Name = "CursorLayer"; @@ -299,24 +309,4 @@ public partial class GameApplication : Node2D } } } - -#if TOOLS - //调试模式下, 指定生成哪些房间 - private void InitDesignatedRoom() - { - if (DesignatedRoom != null && DesignatedRoom.Length > 0) - { - var list = new List(); - foreach (var packedScene in DesignatedRoom) - { - if (RoomConfigMap.TryGetValue(packedScene.ResourcePath, out var dungeonRoomSplit)) - { - list.Add(dungeonRoomSplit); - } - } - DungeonGenerator.SetDesignatedRoom(list); - } - } -#endif - } diff --git a/DungeonShooting_Godot/src/game/GameConfig.cs b/DungeonShooting_Godot/src/game/GameConfig.cs index 0591a7d116a66610222caba842db4d6bb582639b..e6e1cd2bf302f95e844acaf6bfe0c3b1b252b5cc 100644 --- a/DungeonShooting_Godot/src/game/GameConfig.cs +++ b/DungeonShooting_Godot/src/game/GameConfig.cs @@ -26,22 +26,22 @@ public static class GameConfig /// public const int TileCellSize = 16; /// + /// 游戏地图网格大小, 向量表示 + /// + public static readonly Vector2I TileCellSizeVector2I = new Vector2I(TileCellSize, TileCellSize); + /// /// 房间最小间距 /// public const int RoomSpace = 4; - + /// - /// 地图场景路径 + /// 地图配置路径 /// public const string RoomTileDir = "resource/map/tileMaps/"; /// - /// 地图描述数据路径 + /// 房间组配置文件名称 /// - public const string RoomTileDataDir = "resource/map/tiledata/"; - /// - /// 房间配置汇总数据路径 - /// - public const string RoomTileConfigFile = "resource/map/RoomConfig.json"; + public const string RoomGroupConfigFile = "GroupConfig.json"; /// /// ui预制体路径 /// @@ -72,4 +72,9 @@ public static class GameConfig /// 配置层级的自定义数据名称 ///
public const string CustomTileLayerName = "TileLayer"; + + /// + /// 预览图大小 + /// + public const int PreviewImageSize = 196; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs index c97f512c27240d0f2ad75fe4189f94711121e2b7..28d9bfa8d5fbfbf8fd8eb48d63740059406f4cb8 100644 --- a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs +++ b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs @@ -106,7 +106,7 @@ public partial class Bullet : ActivityObject node.AddToActivityRoot(RoomLayerEnum.YSortLayer); //计算子弹造成的伤害 - var damage = Utils.RandomRangeInt(MinHarm, MaxHarm); + var damage = Utils.Random.RandomRangeInt(MinHarm, MaxHarm); if (Role != null) { var d = damage; diff --git a/DungeonShooting_Godot/src/game/activity/package/Package.cs b/DungeonShooting_Godot/src/game/activity/package/Package.cs index 059ce2b36a31de7786110051e102048fbb56a84c..98b5582840dffe29a1bb18823bec58d7bdbfb528 100644 --- a/DungeonShooting_Godot/src/game/activity/package/Package.cs +++ b/DungeonShooting_Godot/src/game/activity/package/Package.cs @@ -261,7 +261,7 @@ public class Package : IDestroy where T : ActivityObject, IPackageItem if (index == ActiveIndex) { //没有其他物体了 - if (ExchangePrev() == index) + if (ExchangePrev(true) == index) { ActiveIndex = 0; ActiveItem = null; @@ -288,6 +288,11 @@ public class Package : IDestroy where T : ActivityObject, IPackageItem /// 切换到上一个物体 ///
public int ExchangePrev() + { + return ExchangePrev(false); + } + + private int ExchangePrev(bool removeFlag) { var index = ActiveIndex - 1; do @@ -296,7 +301,7 @@ public class Package : IDestroy where T : ActivityObject, IPackageItem { index = ItemSlot.Length - 1; } - if (ExchangeByIndex(index)) + if (ExchangeByIndex(index, removeFlag)) { return index; } @@ -328,6 +333,11 @@ public class Package : IDestroy where T : ActivityObject, IPackageItem /// 切换到指定索引的物体 ///
public bool ExchangeByIndex(int index) + { + return ExchangeByIndex(index, false); + } + + private bool ExchangeByIndex(int index, bool removeFlag) { if (index == ActiveIndex && ActiveItem != null) return true; if (index < 0 || index > ItemSlot.Length) return false; @@ -335,7 +345,7 @@ public class Package : IDestroy where T : ActivityObject, IPackageItem if (item == null) return false; //将上一个物体放到背后 - if (ActiveItem != null) + if (!removeFlag && ActiveItem != null) { //收起物体 ActiveItem.OnConcealItem(); diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs index 14133e09ffd11d5c4a107feca5f0a4ac61eb8c3d..7c39b5ccd03327ea3cbea984c7869918f7ea53a8 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0007.cs @@ -19,7 +19,7 @@ public partial class BuffPropProp0007 : BuffProp private void CalcHurtDamageEvent(int originDamage, RefValue refValue) { - if (refValue.Value > 0 && Utils.RandomBoolean(0.15f)) + if (refValue.Value > 0 && Utils.Random.RandomBoolean(0.15f)) { refValue.Value = 0; } diff --git a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs index 787107a9698f41537a335eda380020dd51dbc170..b359f4844e6e175fada842b3d741ae808cd48956 100644 --- a/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs +++ b/DungeonShooting_Godot/src/game/activity/prop/buff/BuffPropProp0010.cs @@ -30,7 +30,7 @@ public partial class BuffPropProp0010 : BuffProp private void CalcBulletDeviationAngleEvent(Weapon weapon, float originAngle, RefValue refValue) { - refValue.Value += Utils.RandomRangeFloat(-8, 8); + refValue.Value += Utils.Random.RandomRangeFloat(-8, 8); } private void CalcDamageEvent(int originDamage, RefValue refValue) @@ -45,6 +45,6 @@ public partial class BuffPropProp0010 : BuffProp private void CalcBulletSpeedEvent(Weapon weapon, float originSpeed, RefValue speed) { - speed.Value += originSpeed * Utils.RandomRangeFloat(-0.05f, 0.05f); + speed.Value += originSpeed * Utils.Random.RandomRangeFloat(-0.05f, 0.05f); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/role/Player.cs b/DungeonShooting_Godot/src/game/activity/role/Player.cs index 27c79bd261d88fa641d94089aa6741fb9155c7b6..ad22cfbe19da6eefb99602fcfd6aef7758ee8979 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Player.cs @@ -30,25 +30,19 @@ public partial class Player : Role AttackLayer = PhysicsLayer.Wall | PhysicsLayer.Prop | PhysicsLayer.Enemy; Camp = CampEnum.Camp1; - //让相机跟随玩家 - // var remoteTransform = new RemoteTransform2D(); - // AddChild(remoteTransform); - // MainCamera.Main.GlobalPosition = GlobalPosition; - // MainCamera.Main.ResetSmoothing(); - // remoteTransform.RemotePath = remoteTransform.GetPathTo(MainCamera.Main); - MaxHp = 6; Hp = 6; MaxShield = 0; Shield = 0; // debug用 - // Acceleration = 3000; - // Friction = 3000; - // MoveSpeed = 500; + // RoleState.Acceleration = 3000; + // RoleState.Friction = 3000; + // RoleState.MoveSpeed = 500; // CollisionLayer = 0; // CollisionMask = 0; - // GameCamera.Main.Zoom = new Vector2(0.5f, 0.5f); + // GameCamera.Main.Zoom = new Vector2(0.2f, 0.2f); + // //GameCamera.Main.Zoom = new Vector2(0.5f, 0.5f); } protected override void Process(float delta) @@ -124,6 +118,8 @@ public partial class Player : Role if (Input.IsKeyPressed(Key.P)) { + //Hurt(1000, 0); + Hp = 0; Hurt(1000, 0); } } diff --git a/DungeonShooting_Godot/src/game/activity/role/Role.cs b/DungeonShooting_Godot/src/game/activity/role/Role.cs index 7782cee970d68e9cec9515bc3ec6caffb0a7ad32..23604aa08e730f3015e2f6292af47c97a25260b2 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Role.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Role.cs @@ -522,7 +522,7 @@ public abstract partial class Role : ActivityObject } } - protected override void OnAffiliationChange() + protected override void OnAffiliationChange(AffiliationArea prevArea) { //身上的武器的所属区域也得跟着变 WeaponPack.ForEach((weapon, i) => diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs index 8979979444b74abef91d18ffd1f8bc77b4cfb7ff..3c327ddc588ca801a278c68a10f936a28d3bcad9 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs @@ -124,7 +124,7 @@ public partial class Enemy : Role blood.AddToActivityRoot(RoomLayerEnum.NormalLayer); //创建敌人碎片 - var count = Utils.RandomRangeInt(3, 6); + var count = Utils.Random.RandomRangeInt(3, 6); for (var i = 0; i < count; i++) { var debris = Create(Ids.Id_effect0001); diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs index 20cad5808ccaa65d6b2bd8918735cd619d8c5093..b0a208cd82b657c134bbdc956b241c7a6fe6c324 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiNormalState.cs @@ -90,7 +90,7 @@ public class AiNormalState : StateBase } else if (Master.NavigationAgent2D.IsNavigationFinished()) //到达终点 { - _pauseTimer = Utils.RandomRangeFloat(0.3f, 2f); + _pauseTimer = Utils.Random.RandomRangeFloat(0.3f, 2f); _isMoveOver = true; _moveFlag = false; Master.BasisVelocity = Vector2.Zero; @@ -112,7 +112,7 @@ public class AiNormalState : StateBase var lastSlideCollision = Master.GetLastSlideCollision(); if (lastSlideCollision != null && lastSlideCollision.GetCollider() is Role) //碰到其他角色 { - _pauseTimer = Utils.RandomRangeFloat(0.1f, 0.5f); + _pauseTimer = Utils.Random.RandomRangeFloat(0.1f, 0.5f); _isMoveOver = true; _moveFlag = false; Master.BasisVelocity = Vector2.Zero; @@ -148,15 +148,15 @@ public class AiNormalState : StateBase float angle; if (_againstWall) { - angle = Utils.RandomRangeFloat(_againstWallNormalAngle - Mathf.Pi * 0.5f, + angle = Utils.Random.RandomRangeFloat(_againstWallNormalAngle - Mathf.Pi * 0.5f, _againstWallNormalAngle + Mathf.Pi * 0.5f); } else { - angle = Utils.RandomRangeFloat(0, Mathf.Pi * 2f); + angle = Utils.Random.RandomRangeFloat(0, Mathf.Pi * 2f); } - var len = Utils.RandomRangeInt(30, 200); + var len = Utils.Random.RandomRangeInt(30, 200); _nextPos = new Vector2(len, 0).Rotated(angle) + Master.GlobalPosition; //获取射线碰到的坐标 if (Master.TestViewRayCast(_nextPos)) //碰到墙壁 diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs index c4a9b392ca7d78e791cec9d929a0afda5ee33fa3..e8c0827b19a809c44acd86cc40507117b33267cd 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs @@ -92,7 +92,7 @@ public class AiSurroundState : StateBase } else if (Master.NavigationAgent2D.IsNavigationFinished()) //到达终点 { - _pauseTimer = Utils.RandomRangeFloat(0f, 0.5f); + _pauseTimer = Utils.Random.RandomRangeFloat(0f, 0.5f); _isMoveOver = true; _moveFlag = false; Master.BasisVelocity = Vector2.Zero; @@ -113,7 +113,7 @@ public class AiSurroundState : StateBase var lastSlideCollision = Master.GetLastSlideCollision(); if (lastSlideCollision != null && lastSlideCollision.GetCollider() is Role) //碰到其他角色 { - _pauseTimer = Utils.RandomRangeFloat(0f, 0.3f); + _pauseTimer = Utils.Random.RandomRangeFloat(0f, 0.3f); _isMoveOver = true; _moveFlag = false; Master.BasisVelocity = Vector2.Zero; @@ -163,8 +163,8 @@ public class AiSurroundState : StateBase var weapon = Master.WeaponPack.ActiveItem; var distance = (int)(weapon == null ? 150 : (weapon.Attribute.BulletMinDistance * 0.7f)); _nextPosition = new Vector2( - targetPos.X + Utils.RandomRangeInt(-distance, distance), - targetPos.Y + Utils.RandomRangeInt(-distance, distance) + targetPos.X + Utils.Random.RandomRangeInt(-distance, distance), + targetPos.Y + Utils.Random.RandomRangeInt(-distance, distance) ); Master.NavigationAgent2D.TargetPosition = _nextPosition; } diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs index f6f1045a24461468ee5cb1c8ed5ad14927b2f276..8428a0fe78e00fac40097d4939ac35f6b6db5d0f 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -753,7 +753,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem if (!Attribute.ContinuousShoot) { _continuousCount = - Utils.RandomRangeInt(Attribute.MinContinuousCount, Attribute.MaxContinuousCount); + Utils.Random.RandomRangeInt(Attribute.MinContinuousCount, Attribute.MaxContinuousCount); } } @@ -873,7 +873,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem //减子弹数量 if (_playerWeaponAttribute != _weaponAttribute) //Ai使用该武器, 有一定概率不消耗弹药 { - if (Utils.RandomRangeFloat(0, 1) < _weaponAttribute.AiAmmoConsumptionProbability) //触发消耗弹药 + if (Utils.Random.RandomRangeFloat(0, 1) < _weaponAttribute.AiAmmoConsumptionProbability) //触发消耗弹药 { CurrAmmo -= UseAmmoCount(); } @@ -920,14 +920,14 @@ public abstract partial class Weapon : ActivityObject, IPackageItem var angle = new Vector2(GameConfig.ScatteringDistance, CurrScatteringRange).Angle(); //先算武器口方向 - var tempRotation = Utils.RandomRangeFloat(-angle, angle); + var tempRotation = Utils.Random.RandomRangeFloat(-angle, angle); var tempAngle = Mathf.RadToDeg(tempRotation); //开火时枪口角度 var fireRotation = tempRotation; //开火发射的子弹数量 - var bulletCount = Utils.RandomRangeInt(Attribute.MaxFireBulletCount, Attribute.MinFireBulletCount); + var bulletCount = Utils.Random.RandomRangeInt(Attribute.MaxFireBulletCount, Attribute.MinFireBulletCount); if (Master != null) { bulletCount = Master.RoleState.CallCalcBulletCountEvent(this, bulletCount); @@ -952,7 +952,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem //武器身位置 var max = Mathf.Abs(Mathf.Max(Attribute.MaxBacklash, Attribute.MinBacklash)); _currBacklashLength = Mathf.Clamp( - _currBacklashLength - Utils.RandomRangeFloat(Attribute.MinBacklash, Attribute.MaxBacklash), + _currBacklashLength - Utils.Random.RandomRangeFloat(Attribute.MinBacklash, Attribute.MaxBacklash), -max, max ); Position = new Vector2(_currBacklashLength, 0).Rotated(Rotation); @@ -1276,7 +1276,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem } else { - CallDelay(Attribute.BeLoadedSoundDelayTime, PlaySpriteAnimation, AnimatorNames.BeLoaded); + this.CallDelay(Attribute.BeLoadedSoundDelayTime, PlaySpriteAnimation, AnimatorNames.BeLoaded); } } @@ -1294,7 +1294,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem //创建一个弹壳 if (Attribute.ThrowShellDelayTime > 0) { - CallDelay(Attribute.ThrowShellDelayTime, () => ThrowShell(Attribute.ShellId, speedScale)); + this.CallDelay(Attribute.ThrowShellDelayTime, () => ThrowShell(Attribute.ShellId, speedScale)); } else if (Attribute.ThrowShellDelayTime == 0) { @@ -1521,7 +1521,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem //播放互动效果 if (flag) { - Throw(GlobalPosition, 0, Utils.RandomRangeInt(20, 50), Vector2.Zero, Utils.RandomRangeInt(-180, 180)); + Throw(GlobalPosition, 0, Utils.Random.RandomRangeInt(20, 50), Vector2.Zero, Utils.Random.RandomRangeInt(-180, 180)); //没有子弹了, 停止播放泛白效果 if (IsTotalAmmoEmpty()) { @@ -1582,7 +1582,7 @@ public abstract partial class Weapon : ActivityObject, IPackageItem startPosition -= GripPoint.Position.Rotated(rotation); var startHeight = -master.MountPoint.Position.Y; var velocity = new Vector2(20, 0).Rotated(rotation); - var yf = Utils.RandomRangeInt(50, 70); + var yf = Utils.Random.RandomRangeInt(50, 70); Throw(startPosition, startHeight, yf, velocity, 0); //继承role的移动速度 @@ -1613,7 +1613,8 @@ public abstract partial class Weapon : ActivityObject, IPackageItem private void Active() { //调整阴影 - ShadowOffset = new Vector2(0, Master.GlobalPosition.Y - GlobalPosition.Y); + //ShadowOffset = new Vector2(0, Master.GlobalPosition.Y - GlobalPosition.Y); + ShadowOffset = new Vector2(0, -Master.MountPoint.Position.Y); //枪口默认抬起角度 RotationDegrees = -Attribute.DefaultAngle; ShowShadowSprite(); @@ -1719,10 +1720,10 @@ public abstract partial class Weapon : ActivityObject, IPackageItem var startPos = ShellPoint.GlobalPosition; var startHeight = -shellPosition.Y; startPos.Y += startHeight; - var direction = GlobalRotationDegrees + Utils.RandomRangeInt(-30, 30) + 180; - var verticalSpeed = Utils.RandomRangeInt((int)(60 * speedScale), (int)(120 * speedScale)); - var velocity = new Vector2(Utils.RandomRangeInt((int)(20 * speedScale), (int)(60 * speedScale)), 0).Rotated(direction * Mathf.Pi / 180); - var rotate = Utils.RandomRangeInt((int)(-720 * speedScale), (int)(720 * speedScale)); + var direction = GlobalRotationDegrees + Utils.Random.RandomRangeInt(-30, 30) + 180; + var verticalSpeed = Utils.Random.RandomRangeInt((int)(60 * speedScale), (int)(120 * speedScale)); + var velocity = new Vector2(Utils.Random.RandomRangeInt((int)(20 * speedScale), (int)(60 * speedScale)), 0).Rotated(direction * Mathf.Pi / 180); + var rotate = Utils.Random.RandomRangeInt((int)(-720 * speedScale), (int)(720 * speedScale)); var shell = Create(shellId); shell.Rotation = (Master != null ? Master.MountPoint.RealRotation : Rotation); shell.Throw(startPos, startHeight, verticalSpeed, velocity, rotate); @@ -1744,10 +1745,10 @@ public abstract partial class Weapon : ActivityObject, IPackageItem ///
protected Bullet ShootBullet(float fireRotation, string bulletId) { - var speed = Utils.RandomRangeFloat(Attribute.BulletMinSpeed, Attribute.BulletMaxSpeed); - var distance = Utils.RandomRangeFloat(Attribute.BulletMinDistance, Attribute.BulletMaxDistance); + var speed = Utils.Random.RandomRangeFloat(Attribute.BulletMinSpeed, Attribute.BulletMaxSpeed); + var distance = Utils.Random.RandomRangeFloat(Attribute.BulletMinDistance, Attribute.BulletMaxDistance); var deviationAngle = - Utils.RandomRangeFloat(Attribute.BulletMinDeviationAngle, Attribute.BulletMaxDeviationAngle); + Utils.Random.RandomRangeFloat(Attribute.BulletMinDeviationAngle, Attribute.BulletMaxDeviationAngle); if (Master != null) { speed = Master.RoleState.CallCalcBulletSpeedEvent(this, speed); diff --git a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs index 6fbaf8060f47415c39e2b5f69751af3d77777972..c754fa0bc12c0187d614e922946c961cccd4f555 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs @@ -93,7 +93,7 @@ public partial class Knife : Weapon if (activityObject is Role role) { role.CallDeferred(nameof(Role.Hurt), - Utils.RandomRangeInt(Attribute.BulletMinHarm, Attribute.BulletMaxHarm), (role.GetCenterPosition() - GlobalPosition).Angle()); + Utils.Random.RandomRangeInt(Attribute.BulletMinHarm, Attribute.BulletMaxHarm), (role.GetCenterPosition() - GlobalPosition).Angle()); } } } diff --git a/DungeonShooting_Godot/src/game/data/DragState.cs b/DungeonShooting_Godot/src/game/data/DragState.cs new file mode 100644 index 0000000000000000000000000000000000000000..04f4fb05a98cd43323e1f03d5d03d78966c032cf --- /dev/null +++ b/DungeonShooting_Godot/src/game/data/DragState.cs @@ -0,0 +1,19 @@ + +/// +/// 拖拽状态 +/// +public enum DragState +{ + /// + /// 拖拽开始 + /// + DragStart, + /// + /// 拖拽中 + /// + DragMove, + /// + /// 拖拽结束 + /// + DragEnd +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/effects/Effect1.cs b/DungeonShooting_Godot/src/game/effects/Effect1.cs index 5f4329783712b050769001ea625012fadd94db29..7905f9984d354d0462db68085e9f6577f3ebaa4a 100644 --- a/DungeonShooting_Godot/src/game/effects/Effect1.cs +++ b/DungeonShooting_Godot/src/game/effects/Effect1.cs @@ -5,7 +5,7 @@ public partial class Effect1 : AutoDestroyEffect public override void _Ready() { var c = GetNode("GPUParticles2D"); - c.Amount = Utils.RandomRangeInt(2, 6); + c.Amount = Utils.Random.RandomRangeInt(2, 6); c.Emitting = true; base._Ready(); diff --git a/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs b/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs index 075e8d5fde2e3ea0e006db9c682b0dfac65e336d..4e975ee948434fc012476bcacfecf39aa28ef4d0 100644 --- a/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs +++ b/DungeonShooting_Godot/src/game/effects/EnemyDebris.cs @@ -11,13 +11,13 @@ public partial class EnemyDebris : ActivityObject public override void OnInit() { var frameCount = AnimatedSprite.SpriteFrames.GetFrameCount(AnimatorNames.Default); - AnimatedSprite.Frame = Utils.RandomRangeInt(0, frameCount - 1); + AnimatedSprite.Frame = Utils.Random.RandomRangeInt(0, frameCount - 1); Throw( - Utils.RandomRangeInt(0, 16), - Utils.RandomRangeInt(10, 60), - new Vector2(Utils.RandomRangeInt(-25, 25), Utils.RandomRangeInt(-25, 25)), - Utils.RandomRangeInt(-360, 360) + Utils.Random.RandomRangeInt(0, 16), + Utils.Random.RandomRangeInt(10, 60), + new Vector2(Utils.Random.RandomRangeInt(-25, 25), Utils.Random.RandomRangeInt(-25, 25)), + Utils.Random.RandomRangeInt(-360, 360) ); StartCoroutine(EmitParticles()); @@ -27,7 +27,7 @@ public partial class EnemyDebris : ActivityObject { var gpuParticles2D = GetNode("GPUParticles2D"); gpuParticles2D.Emitting = true; - yield return new WaitForSeconds(Utils.RandomRangeFloat(1f, 2.5f)); + yield return new WaitForSeconds(Utils.Random.RandomRangeFloat(1f, 2.5f)); gpuParticles2D.Emitting = false; yield return new WaitForSeconds(1); BecomesStaticImage(); diff --git a/DungeonShooting_Godot/src/game/event/EventEnum.cs b/DungeonShooting_Godot/src/game/event/EventEnum.cs index 839aa4fb084a2536245380125d7050971d2c67b5..632b0cb437e0790432365575632d8a3d5d1d12b1 100644 --- a/DungeonShooting_Godot/src/game/event/EventEnum.cs +++ b/DungeonShooting_Godot/src/game/event/EventEnum.cs @@ -1,4 +1,6 @@ +using System.Collections.Generic; + /// /// 事件类型枚举 /// @@ -61,4 +63,76 @@ public enum EventEnum /// 当玩家退出地牢时调用, 没有参数 ///
OnExitDungeon, + + + //------------------------- 编辑器相关 -------------------------- + + /// + /// 创建地牢组完成时调用, 参数为 + /// + OnCreateGroupFinish, + /// + /// 创建地牢房间完成时调用, 参数为 + /// + OnCreateRoomFinish, + /// + /// 标记房间数据脏了, 也就是数据有修改 + /// + OnEditorDirty, + /// + /// 编辑器触发保存, 参数为> + /// + OnEditorSave, + /// + /// 选中拖拽工具 + /// + OnSelectDragTool, + /// + /// 选中绘制工具 + /// + OnSelectPenTool, + /// + /// 选中绘制区域工具 + /// + OnSelectRectTool, + /// + /// 选中编辑门区域工具 + /// + OnSelectEditTool, + /// + /// 点击跳转到地图中心点 + /// + OnClickCenterTool, + /// + /// 选中地牢组, 参数 + /// + OnSelectGroup, + /// + /// 选中房间, 参数 + /// + OnSelectRoom, + /// + /// 选中预设, 参数 + /// + OnSelectPreinstall, + /// + /// 选中波数, 参数 , T 为 + /// + OnSelectWave, + /// + /// 创建标记, 参数 + /// + OnCreateMark, + /// + /// 修改标记, 参数 + /// + OnEditMark, + /// + /// 选中标记, 参数或者null + /// + OnSelectMark, + /// + /// 删除标记, 参数 + /// + OnDeleteMark, } diff --git a/DungeonShooting_Godot/src/game/manager/EditorManager.cs b/DungeonShooting_Godot/src/game/manager/EditorManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..2e4e2a260fcd4dc7a814857dd9650d774d450664 --- /dev/null +++ b/DungeonShooting_Godot/src/game/manager/EditorManager.cs @@ -0,0 +1,173 @@ + +using System.Collections.Generic; + +public static class EditorManager +{ + /// + /// 当前使用的地牢组 + /// + public static DungeonRoomGroup SelectDungeonGroup { get; private set; } + + /// + /// 当使用的地牢房间 + /// + public static DungeonRoomSplit SelectRoom { get; private set; } + + /// + /// 当前使用的预设索引 + /// + public static int SelectPreinstallIndex { get; private set; } = -1; + + /// + /// 当前使用的预设 + /// + public static RoomPreinstallInfo SelectPreinstall + { + get + { + if (SelectPreinstallIndex < 0 || SelectPreinstallIndex >= SelectRoom.Preinstall.Count) + { + return null; + } + + return SelectRoom.Preinstall[SelectPreinstallIndex]; + } + } + + /// + /// 当前选中的波索引 + /// + public static int SelectWaveIndex { get; private set; } = -1; + + /// + /// 当前选中的波 + /// + public static List SelectWave + { + get + { + var preinstall = SelectPreinstall; + if (preinstall == null) + { + return null; + } + + if (SelectWaveIndex < 0 || SelectWaveIndex > preinstall.WaveList.Count) + { + return null; + } + + return preinstall.WaveList[SelectWaveIndex]; + } + } + + /// + /// 当前选中的标记 + /// + public static MarkInfo SelectMark { get; private set; } + + public static void SetSelectDungeonGroup(DungeonRoomGroup roomGroup) + { + if (SelectDungeonGroup != roomGroup) + { + SelectDungeonGroup = roomGroup; + EventManager.EmitEvent(EventEnum.OnSelectGroup, SelectDungeonGroup); + } + } + + public static void SetSelectRoom(DungeonRoomSplit roomSplit) + { + if (!ReferenceEquals(SelectRoom, roomSplit)) + { + SelectRoom = roomSplit; + EventManager.EmitEvent(EventEnum.OnSelectRoom, SelectRoom); + } + } + + public static void SetSelectPreinstallIndex(int index) + { + if (SelectRoom == null) + { + if (SelectPreinstallIndex != -1) + { + SelectPreinstallIndex = -1; + EventManager.EmitEvent(EventEnum.OnSelectPreinstall, SelectPreinstall); + } + } + else if (index < 0 || SelectRoom.Preinstall == null || index >= SelectRoom.Preinstall.Count) + { + if (SelectPreinstallIndex != -1) + { + SelectPreinstallIndex = -1; + EventManager.EmitEvent(EventEnum.OnSelectPreinstall, SelectPreinstall); + } + } + else if (SelectPreinstallIndex != index) + { + SelectPreinstallIndex = index; + EventManager.EmitEvent(EventEnum.OnSelectPreinstall, SelectPreinstall); + } + } + + public static void SetSelectWaveIndex(int index) + { + if (SelectPreinstall == null) + { + if (SelectWaveIndex != -1) + { + SelectWaveIndex = -1; + EventManager.EmitEvent(EventEnum.OnSelectWave, SelectWave); + } + } + else if (SelectWaveIndex != index) + { + if (index < 0 || SelectPreinstall.WaveList == null || index >= SelectPreinstall.WaveList.Count) + { + if (SelectWaveIndex != -1) + { + SelectWaveIndex = -1; + EventManager.EmitEvent(EventEnum.OnSelectWave, SelectWave); + } + } + else + { + if (SelectWaveIndex != index) + { + SelectWaveIndex = index; + EventManager.EmitEvent(EventEnum.OnSelectWave, SelectWave); + } + } + } + } + + public static void SetSelectMark(MarkInfo markInfo) + { + if (SelectMark != markInfo) + { + SelectMark = markInfo; + EventManager.EmitEvent(EventEnum.OnSelectMark, markInfo); + } + } + + /// + /// 根据 RoomErrorType 枚举获取房间错误信息 + /// + public static string GetRoomErrorTypeMessage(RoomErrorType errorType) + { + switch (errorType) + { + case RoomErrorType.None: + return ""; + case RoomErrorType.Empty: + return "房间没有绘制地块"; + case RoomErrorType.TileError: + return "房间地块存在绘制错误"; + case RoomErrorType.DoorAreaError: + return "房间至少要有两个不同方向的门区域"; + case RoomErrorType.NoPreinstallError: + return "房间没有预设"; + } + + return null; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/EditorPlayManager.cs b/DungeonShooting_Godot/src/game/manager/EditorPlayManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..e9d908896588d1486f6bbe8df1bcf6aad7405f45 --- /dev/null +++ b/DungeonShooting_Godot/src/game/manager/EditorPlayManager.cs @@ -0,0 +1,52 @@ + +using System.Collections.Generic; + +public static class EditorPlayManager +{ + /// + /// 是否正在播放 + /// + public static bool IsPlay { get; private set; } + + private static DungeonConfig _config; + + public static void Play(UiBase prevUi) + { + if (IsPlay) + { + return; + } + + IsPlay = true; + _config = new DungeonConfig(); + _config.GroupName = EditorManager.SelectDungeonGroup.GroupName; + _config.DesignatedType = EditorManager.SelectRoom.RoomInfo.RoomType; + _config.DesignatedRoom = new List(); + _config.DesignatedRoom.Add(EditorManager.SelectRoom); + GameApplication.Instance.DungeonManager.EditorPlayDungeon(prevUi, _config); + } + + public static void Exit() + { + if (!IsPlay) + { + return; + } + + IsPlay = false; + GameApplication.Instance.DungeonManager.EditorExitDungeon(); + } + + public static void Restart() + { + if (!IsPlay) + { + return; + } + + GameApplication.Instance.DungeonManager.ExitDungeon(() => + { + GameApplication.Instance.DungeonManager.EditorPlayDungeon(_config); + }); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs b/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..878db9c1054bcbc6a20dbfebb99b4c31dea8fe4f --- /dev/null +++ b/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs @@ -0,0 +1,379 @@ + +using System; +using System.Collections.Generic; +using Config; +using Godot; +using UI.EditorTips; +using UI.EditorWindow; +using UI.MapEditorCreateGroup; +using UI.MapEditorCreateMark; +using UI.MapEditorCreatePreinstall; +using UI.MapEditorCreateRoom; +using UI.MapEditorSelectObject; + +public static class EditorWindowManager +{ + /// + /// 弹出通用提示面板 + /// + /// 标题 + /// 显示内容 + /// 关闭时的回调 + /// 所属父级Ui + public static void ShowTips(string title, string message, Action onClose = null, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle(title); + if (onClose != null) + { + window.CloseEvent += onClose; + } + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + window.CloseWindow(); + }) + ); + var body = window.OpenBody(UiManager.UiName.EditorTips); + body.SetMessage(message); + } + + /// + /// 弹出询问窗口 + /// + /// 标题 + /// 显示内容 + /// 关闭时的回调, 参数如果为 true 表示点击了确定 + /// 所属父级Ui + public static void ShowConfirm(string title, string message, Action onClose, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle(title); + window.CloseEvent += () => + { + onClose(false); + }; + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + window.CloseWindow(false); + onClose(true); + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + var body = window.OpenBody(UiManager.UiName.EditorTips); + body.SetMessage(message); + } + + /// + /// 弹出询问窗口, 包含3个按钮 + /// + /// 标题 + /// 显示内容 + /// 按钮1文本 + /// 按钮2文本 + /// 按钮3文本 + /// 关闭时的回调, 参数如果为点击按钮的索引表示点击了确定, -1表示点击了x + /// 所属父级Ui + public static void ShowConfirm(string title, string message, string btn1, string btn2, string btn3, Action onClose, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle(title); + window.CloseEvent += () => + { + onClose(-1); + }; + window.SetButtonList( + new EditorWindowPanel.ButtonData(btn1, () => + { + window.CloseWindow(false); + onClose(0); + }), + new EditorWindowPanel.ButtonData(btn2, () => + { + window.CloseWindow(false); + onClose(1); + }), + new EditorWindowPanel.ButtonData(btn3, () => + { + window.CloseWindow(false); + onClose(2); + }) + ); + var body = window.OpenBody(UiManager.UiName.EditorTips); + body.SetMessage(message); + } + + /// + /// 打开创建地牢组弹窗 + /// + /// 创建成功时回调 + /// 所属父级Ui + public static void ShowCreateGroup(Action onCreateGroup, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle("创建地牢组"); + window.SetWindowSize(new Vector2I(700, 500)); + var body = window.OpenBody(UiManager.UiName.MapEditorCreateGroup); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + //获取填写的数据, 并创建ui + var groupInfo = body.GetGroupInfo(); + if (groupInfo != null) + { + window.CloseWindow(); + onCreateGroup(groupInfo); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 打开创建地牢房间弹窗 + /// + /// 选择的组名称, 如果不需要有选择的项, 则传 null + /// 选择的房间类型 + /// 创建成功时回调 + public static void ShowCreateRoom(string groupName, int roomType, Action onCreateRoom) + { + var window = UiManager.Open_EditorWindow(); + window.SetWindowTitle("创建地牢房间"); + window.SetWindowSize(new Vector2I(700, 600)); + var body = window.OpenBody(UiManager.UiName.MapEditorCreateRoom); + if (groupName != null) + { + body.SetSelectGroup(groupName); + } + body.SetSelectType(roomType); + + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + //获取填写的数据, 并创建ui + var roomSplit = body.GetRoomInfo(); + if (roomSplit != null) + { + window.CloseWindow(); + onCreateRoom(roomSplit); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 编辑地牢房间 + /// + /// 原数据 + /// 保存时回调 + public static void ShowEditRoom(DungeonRoomSplit roomSplit, Action onSave) + { + var window = UiManager.Open_EditorWindow(); + window.SetWindowTitle("编辑地牢房间"); + window.SetWindowSize(new Vector2I(700, 600)); + var body = window.OpenBody(UiManager.UiName.MapEditorCreateRoom); + body.InitEditData(roomSplit); + + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + //获取填写的数据, 并创建ui + var saveData = body.GetRoomInfo(); + if (saveData != null) + { + window.CloseWindow(); + onSave(saveData); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 打开创建房间预设弹窗 + /// + /// 当前房间的类型 + /// 当前房间已经包含的所有预设列表 + /// 创建成功时的回调 + public static void ShowCreatePreinstall(DungeonRoomType roomType, List list, Action onCreatePreinstall) + { + var window = UiManager.Open_EditorWindow(); + window.SetWindowTitle("创建房间预设"); + window.SetWindowSize(new Vector2I(700, 600)); + var body = window.OpenBody(UiManager.UiName.MapEditorCreatePreinstall); + body.InitData(roomType); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + var roomPreinstall = body.GetRoomPreinstall(list); + if (roomPreinstall != null) + { + window.CloseWindow(); + onCreatePreinstall(roomPreinstall); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 打开编辑房间预设弹窗 + /// + /// 当前房间的类型 + /// 当前房间已经包含的所有预设列表 + /// 需要编辑的预设数据 + /// 保存时的回调 + public static void ShowEditPreinstall(DungeonRoomType roomType, List list, RoomPreinstallInfo preinstallInfo, Action onSavePreinstall) + { + var window = UiManager.Open_EditorWindow(); + window.SetWindowTitle("创建房间预设"); + window.SetWindowSize(new Vector2I(700, 600)); + var body = window.OpenBody(UiManager.UiName.MapEditorCreatePreinstall); + body.InitData(roomType, preinstallInfo); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + var roomPreinstall = body.GetRoomPreinstall(list); + if (roomPreinstall != null) + { + window.CloseWindow(); + onSavePreinstall(roomPreinstall); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 打开创建标记页面 + /// + /// 初始坐标 + /// 是否提前加载 + /// 创建标记回调 + /// 所属父级Ui + public static void ShowCreateMark(Vector2I position, bool preloading, Action onCreateMarkInfo , UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle("创建标记"); + window.SetWindowSize(new Vector2I(1400, 900)); + var body = window.OpenBody(UiManager.UiName.MapEditorCreateMark); + body.InitData(position, preloading); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + var markInfo = body.GetMarkInfo(); + if (markInfo != null) + { + window.CloseWindow(); + onCreateMarkInfo(markInfo); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 打开编辑标记页面 + /// + /// 标记数据对象 + /// 是否提前加载 + /// 保存时回调 + /// 所属父级Ui + public static void ShowEditMark(MarkInfo data, bool preloading, Action onSaveMarkInfo, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle("编辑标记"); + window.SetWindowSize(new Vector2I(1400, 900)); + var body = window.OpenBody(UiManager.UiName.MapEditorCreateMark); + body.InitData(data, preloading); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + var markInfo = body.GetMarkInfo(); + if (markInfo != null) + { + window.CloseWindow(); + onSaveMarkInfo(markInfo); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 打开选中的物体 + /// + /// 查找的类型, 如果为 none, 则查找所有类型数据 + /// 选中物体时回调 + /// 所属父级Ui + public static void ShowSelectObject(ActivityType findType, Action onSelectObject, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.S_Window.Instance.Size = new Vector2I(1000, 700); + window.SetWindowTitle("选择物体"); + var body = window.OpenBody(UiManager.UiName.MapEditorSelectObject); + //设置显示的物体类型 + body.SetShowType(findType); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + var selectObject = body.GetSelectData(); + if (selectObject == null) + { + ShowTips("提示", "您未选择任何物体"); + } + else + { + window.CloseWindow(); + onSelectObject(selectObject); + } + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + //绑定双击选中物体事件 + body.SelectObjectEvent += selectObject => + { + window.CloseWindow(); + onSelectObject(selectObject); + }; + } + + private static EditorWindowPanel CreateWindowInstance(UiBase parentUi) + { + if (parentUi != null) + { + return parentUi.OpenNestedUi(UiManager.UiName.EditorWindow); + } + + return UiManager.Open_EditorWindow(); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/MapProjectManager.cs b/DungeonShooting_Godot/src/game/manager/MapProjectManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..77ae4125dd36080c43c6edeb46ff8d09f03ec359 --- /dev/null +++ b/DungeonShooting_Godot/src/game/manager/MapProjectManager.cs @@ -0,0 +1,265 @@ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Godot; + +public static class MapProjectManager +{ + /// + /// 扫描路径 + /// + public static string CustomMapPath { get; private set; } + + /// + /// 地牢组数据, key: 组名称 + /// + public static Dictionary GroupMap { get; private set; } + + private static bool _init; + + public static void Init() + { + if (_init) + { + return; + } + + _init = true; +#if TOOLS + CustomMapPath = GameConfig.RoomTileDir; +#else + CustomMapPath = ""; +#endif + EventManager.AddEventListener(EventEnum.OnEditorSave, OnRoomSave); + } + + //房间保存时回调 + private static void OnRoomSave(object obj) + { + SaveGroupMap(); + } + + /// + /// 刷新组数据 + /// + public static void RefreshMapGroup() + { + var configFile = CustomMapPath + GameConfig.RoomGroupConfigFile; + if (File.Exists(configFile)) + { + var configText = File.ReadAllText(configFile); + GroupMap = JsonSerializer.Deserialize>(configText); + foreach (var item in GroupMap) + { + var config = item.Value; + foreach (var roomSplit in config.BattleList) + { + _ = roomSplit.RoomInfo; + } + + foreach (var roomSplit in config.BossList) + { + _ = roomSplit.RoomInfo; + } + + foreach (var roomSplit in config.InletList) + { + _ = roomSplit.RoomInfo; + } + + foreach (var roomSplit in config.OutletList) + { + _ = roomSplit.RoomInfo; + } + + foreach (var roomSplit in config.EventList) + { + _ = roomSplit.RoomInfo; + } + + foreach (var roomSplit in config.RewardList) + { + _ = roomSplit.RoomInfo; + } + + foreach (var roomSplit in config.ShopList) + { + _ = roomSplit.RoomInfo; + } + } + } + else + { + GD.Print("刷新地图组时未找到配置文件: " + configFile + ", 执行创建文件"); + GroupMap = new Dictionary(); + File.WriteAllText(configFile, "{}"); + } + } + + /// + /// 获取地牢房间配置文件加载路径 + /// + /// 组名 + /// 房间类型 + /// 房间名称 + public static string GetConfigPath(string groupName, DungeonRoomType roomType, string roomName) + { + return CustomMapPath + groupName + "/" + DungeonManager.DungeonRoomTypeToString(roomType) + "/" + roomName; + } + + /// + /// 创建地牢组 + /// + public static void CreateGroup(DungeonRoomGroup group) + { + if (GroupMap.ContainsKey(group.GroupName)) + { + GD.PrintErr($"已经存在相同的地牢组: {group.GroupName}"); + return; + } + GroupMap.Add(group.GroupName, group); + //将组数据保存为json + SaveGroupMap(); + //创建完成事件 + EventManager.EmitEvent(EventEnum.OnCreateGroupFinish, group); + } + + /// + /// 创建地牢房间 + /// + public static void CreateRoom(DungeonRoomSplit roomSplit) + { + var groupName = roomSplit.RoomInfo.GroupName; + if (GroupMap.TryGetValue(groupName, out var group)) + { + var configFile = CustomMapPath + GameConfig.RoomGroupConfigFile; + var roomList = group.GetRoomList(roomSplit.RoomInfo.RoomType); + roomList.Add(roomSplit); + + var configPath = GetConfigPath(roomSplit.RoomInfo.GroupName, roomSplit.RoomInfo.RoomType, roomSplit.RoomInfo.RoomName); + if (!Directory.Exists(configPath)) + { + Directory.CreateDirectory(configPath); + } + + //将组数据保存为json + var options = new JsonSerializerOptions(); + options.WriteIndented = true; + var jsonText = JsonSerializer.Serialize(GroupMap, options); + File.WriteAllText(configFile, jsonText); + //将房间数据保存为json + SaveRoomInfo(roomSplit); + //将房间地块保存为json + SaveRoomTileInfo(roomSplit); + //将预设保存为json + SaveRoomPreinstall(roomSplit); + //创建完成事件 + EventManager.EmitEvent(EventEnum.OnCreateRoomFinish, roomSplit); + } + else + { + GD.PrintErr($"未找到地牢组: {groupName}"); + } + } + + /// + /// 保存所有组数据 + /// + public static void SaveGroupMap() + { + var configFile = CustomMapPath + GameConfig.RoomGroupConfigFile; + var options = new JsonSerializerOptions(); + options.WriteIndented = true; + var jsonText = JsonSerializer.Serialize(GroupMap, options); + File.WriteAllText(configFile, jsonText); + + //更新GameApplication中的房间数据 + var dic = new Dictionary(); + foreach (var dungeonRoomGroup in GroupMap) + { + dic.Add(dungeonRoomGroup.Key, dungeonRoomGroup.Value.Clone()); + } + GameApplication.Instance.SetRoomConfig(dic); + } + + /// + /// 保存房间数据 + /// + public static void SaveRoomInfo(DungeonRoomSplit roomSplit) + { + var roomInfo = roomSplit.RoomInfo; + var path = GetConfigPath(roomInfo.GroupName,roomInfo.RoomType, roomInfo.RoomName); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + var jsonText = JsonSerializer.Serialize(roomInfo); + File.WriteAllText(roomSplit.RoomPath, jsonText); + } + + /// + /// 保存房间地块数据 + /// + public static void SaveRoomTileInfo(DungeonRoomSplit roomSplit) + { + var roomInfo = roomSplit.RoomInfo; + var path = GetConfigPath(roomInfo.GroupName,roomInfo.RoomType, roomInfo.RoomName); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + var jsonText = JsonSerializer.Serialize(roomSplit.TileInfo); + File.WriteAllText(roomSplit.TilePath, jsonText); + } + + /// + /// 保存房间预设数据 + /// + public static void SaveRoomPreinstall(DungeonRoomSplit roomSplit) + { + var roomInfo = roomSplit.RoomInfo; + var path = GetConfigPath(roomInfo.GroupName,roomInfo.RoomType, roomInfo.RoomName); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + var jsonText = JsonSerializer.Serialize(roomSplit.Preinstall); + File.WriteAllText(roomSplit.PreinstallPath, jsonText); + } + + /// + /// 保存预览图 + /// + public static void SaveRoomPreviewImage(DungeonRoomSplit roomSplit, Image image) + { + var roomInfo = roomSplit.RoomInfo; + var path = GetConfigPath(roomInfo.GroupName,roomInfo.RoomType, roomInfo.RoomName); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + + image.SavePng(roomSplit.PreviewPath); + } + + /// + /// 从指定组中删除房间, 返回是否删除成功 + /// + public static bool DeleteRoom(DungeonRoomGroup group, DungeonRoomSplit roomSplit) + { + if (group.RemoveRoom(roomSplit)) + { + var path = GetConfigPath(group.GroupName, roomSplit.RoomInfo.RoomType, roomSplit.RoomInfo.RoomName); + if (Directory.Exists(path)) + { + Directory.Delete(path, true); + } + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/NameManager.cs b/DungeonShooting_Godot/src/game/manager/NameManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..e823f5b52360de7900955a6c4c51ae981048c2a7 --- /dev/null +++ b/DungeonShooting_Godot/src/game/manager/NameManager.cs @@ -0,0 +1,36 @@ + +public class NameManager +{ + /// + /// 获取物体属性名称字符串 + /// + public static string GetActivityTypeName(int type) + { + switch ((ActivityType)type) + { + case ActivityType.None: + return ""; + case ActivityType.Test: + return "测试"; + case ActivityType.Role: + case ActivityType.Player: + return "角色"; + case ActivityType.Enemy: + return "敌人"; + case ActivityType.Weapon: + return "武器"; + case ActivityType.Bullet: + return "子弹"; + case ActivityType.Shell: + return "弹壳"; + case ActivityType.Effect: + return "特效"; + case ActivityType.Prop: + return "道具"; + case ActivityType.Other: + return "其他"; + } + + return ""; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/ResourceManager.cs b/DungeonShooting_Godot/src/game/manager/ResourceManager.cs index 6352e1c55727ede8cba8699193710887d002cd7f..6d235842f6c5d5b73b3e18e28ca56ddae208cd72 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourceManager.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourceManager.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Godot; @@ -6,6 +7,11 @@ using Godot; ///
public static class ResourceManager { + /// + /// 默认权重值 + /// + public const int DefaultWeight = 100; + /// /// 颜色混合材质 /// @@ -121,9 +127,56 @@ public static class ResourceManager /// 加载并且实例化场景, 并返回 ///
/// 场景路径 - public static T LoadAndInstantiate(string path) where T : Node + /// 是否使用缓存中的资源 + public static T LoadAndInstantiate(string path, bool useCache = true) where T : Node { - var packedScene = Load(path); + var packedScene = Load(path, useCache); return packedScene.Instantiate(); } + + /// + /// 读取文本资源 + /// + public static string LoadText(string path) + { + string text; + using (var fileAccess = FileAccess.Open(path, FileAccess.ModeFlags.Read)) + { + text = fileAccess.GetAsText(); + } + return text; + } + + /// + /// 加载2d纹理资源 + /// + /// 资源路径 + /// 是否使用缓存中的资源 + public static Texture2D LoadTexture2D(string path, bool useCache = true) + { + return Load(path, useCache); + } + + /// + /// 将普通路径转化为 Godot 资源路径 + /// + public static string ToResPath(string path) + { + var field = path.Replace("\\", "/"); + return "res://" + field; + } + + /// + /// 移除资源后缀名 + /// + public static string RemoveExtension(string name) + { + var index = name.LastIndexOf(".", StringComparison.Ordinal); + if (index >= 0) + { + return name.Substring(0, index); + } + + return name; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index ebc986e90ea27a004122c092e3f37cb80605eb50..3796f084011c312afb2a02b2dc4bf2d0775bd80f 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -12,6 +12,7 @@ public class ResourcePath public const string prefab_FanCollisionShape_tscn = "res://prefab/FanCollisionShape.tscn"; public const string prefab_bullet_Bullet0001_tscn = "res://prefab/bullet/Bullet0001.tscn"; public const string prefab_bullet_Bullet0002_tscn = "res://prefab/bullet/Bullet0002.tscn"; + public const string prefab_bullet_Bullet0003_tscn = "res://prefab/bullet/Bullet0003.tscn"; public const string prefab_effect_Blood_tscn = "res://prefab/effect/Blood.tscn"; public const string prefab_effect_BulletDisappear_tscn = "res://prefab/effect/BulletDisappear.tscn"; public const string prefab_effect_BulletSmoke_tscn = "res://prefab/effect/BulletSmoke.tscn"; @@ -37,7 +38,6 @@ public class ResourcePath public const string prefab_prop_buff_BuffProp0008_tscn = "res://prefab/prop/buff/BuffProp0008.tscn"; public const string prefab_prop_buff_BuffProp0009_tscn = "res://prefab/prop/buff/BuffProp0009.tscn"; public const string prefab_prop_buff_BuffProp0010_tscn = "res://prefab/prop/buff/BuffProp0010.tscn"; - public const string prefab_prop_buff_Weapon0005_png = "res://prefab/prop/buff/Weapon0005.png"; public const string prefab_role_Enemy0001_tscn = "res://prefab/role/Enemy0001.tscn"; public const string prefab_role_Role0001_tscn = "res://prefab/role/Role0001.tscn"; public const string prefab_role_RoleTemplate_tscn = "res://prefab/role/RoleTemplate.tscn"; @@ -47,9 +47,21 @@ public class ResourcePath public const string prefab_test_MoveComponent_tscn = "res://prefab/test/MoveComponent.tscn"; public const string prefab_test_TestActivity_tscn = "res://prefab/test/TestActivity.tscn"; public const string prefab_ui_BottomTips_tscn = "res://prefab/ui/BottomTips.tscn"; + public const string prefab_ui_EditorTips_tscn = "res://prefab/ui/EditorTips.tscn"; public const string prefab_ui_EditorTools_tscn = "res://prefab/ui/EditorTools.tscn"; + public const string prefab_ui_EditorWindow_tscn = "res://prefab/ui/EditorWindow.tscn"; public const string prefab_ui_Loading_tscn = "res://prefab/ui/Loading.tscn"; public const string prefab_ui_Main_tscn = "res://prefab/ui/Main.tscn"; + public const string prefab_ui_MapEditor_tscn = "res://prefab/ui/MapEditor.tscn"; + public const string prefab_ui_MapEditorCreateGroup_tscn = "res://prefab/ui/MapEditorCreateGroup.tscn"; + public const string prefab_ui_MapEditorCreateMark_tscn = "res://prefab/ui/MapEditorCreateMark.tscn"; + public const string prefab_ui_MapEditorCreatePreinstall_tscn = "res://prefab/ui/MapEditorCreatePreinstall.tscn"; + public const string prefab_ui_MapEditorCreateRoom_tscn = "res://prefab/ui/MapEditorCreateRoom.tscn"; + public const string prefab_ui_MapEditorMapLayer_tscn = "res://prefab/ui/MapEditorMapLayer.tscn"; + public const string prefab_ui_MapEditorMapMark_tscn = "res://prefab/ui/MapEditorMapMark.tscn"; + public const string prefab_ui_MapEditorProject_tscn = "res://prefab/ui/MapEditorProject.tscn"; + public const string prefab_ui_MapEditorSelectObject_tscn = "res://prefab/ui/MapEditorSelectObject.tscn"; + public const string prefab_ui_MapEditorTools_tscn = "res://prefab/ui/MapEditorTools.tscn"; public const string prefab_ui_RoomUI_tscn = "res://prefab/ui/RoomUI.tscn"; public const string prefab_ui_Settlement_tscn = "res://prefab/ui/Settlement.tscn"; public const string prefab_weapon_Weapon0001_tscn = "res://prefab/weapon/Weapon0001.tscn"; @@ -58,6 +70,7 @@ public class ResourcePath public const string prefab_weapon_Weapon0004_tscn = "res://prefab/weapon/Weapon0004.tscn"; public const string prefab_weapon_Weapon0005_tscn = "res://prefab/weapon/Weapon0005.tscn"; public const string prefab_weapon_Weapon0006_tscn = "res://prefab/weapon/Weapon0006.tscn"; + public const string prefab_weapon_Weapon0007_tscn = "res://prefab/weapon/Weapon0007.tscn"; public const string prefab_weapon_WeaponTemplate_tscn = "res://prefab/weapon/WeaponTemplate.tscn"; public const string resource_Enviromenent_tres = "res://resource/Enviromenent.tres"; public const string resource_config_ActivityObject_json = "res://resource/config/ActivityObject.json"; @@ -69,9 +82,8 @@ public class ResourcePath public const string resource_font_DinkieBitmap9pxItalicDemo_ttf = "res://resource/font/DinkieBitmap-9pxItalicDemo.ttf"; public const string resource_font_VonwaonBitmap12px_ttf = "res://resource/font/VonwaonBitmap-12px.ttf"; public const string resource_font_VonwaonBitmap16px_ttf = "res://resource/font/VonwaonBitmap-16px.ttf"; - public const string resource_map_RoomConfig_json = "res://resource/map/RoomConfig.json"; - public const string resource_map_tileset_TileSet1_tres = "res://resource/map/tileset/TileSet1.tres"; - public const string resource_map_tileset_TileSet_old_tres = "res://resource/map/tileset/TileSet_old.tres"; + public const string resource_map_tileSet_TileSet1_tres = "res://resource/map/tileSet/TileSet1.tres"; + public const string resource_map_tileSet_TileSet_old_tres = "res://resource/map/tileSet/TileSet_old.tres"; public const string resource_material_Blend_gdshader = "res://resource/material/Blend.gdshader"; public const string resource_material_Blend_tres = "res://resource/material/Blend.tres"; public const string resource_material_SmokeParticleMaterial_tres = "res://resource/material/SmokeParticleMaterial.tres"; @@ -92,6 +104,7 @@ public class ResourcePath public const string resource_sound_sfx_beLoaded_BeLoaded0014_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0014.ogg"; public const string resource_sound_sfx_beLoaded_BeLoaded0015_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0015.ogg"; public const string resource_sound_sfx_beLoaded_BeLoaded0016_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0016.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0017_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0017.ogg"; public const string resource_sound_sfx_explosion_Explosion0001_ogg = "res://resource/sound/sfx/explosion/Explosion0001.ogg"; public const string resource_sound_sfx_explosion_Explosion0002_ogg = "res://resource/sound/sfx/explosion/Explosion0002.ogg"; public const string resource_sound_sfx_explosion_Explosion0003_ogg = "res://resource/sound/sfx/explosion/Explosion0003.ogg"; @@ -106,6 +119,7 @@ public class ResourcePath public const string resource_sound_sfx_reloading_Reloading_begin0007_ogg = "res://resource/sound/sfx/reloading/Reloading_begin0007.ogg"; public const string resource_sound_sfx_reloading_Reloading_begin0008_ogg = "res://resource/sound/sfx/reloading/Reloading_begin0008.ogg"; public const string resource_sound_sfx_reloading_Reloading_begin0009_ogg = "res://resource/sound/sfx/reloading/Reloading_begin0009.ogg"; + public const string resource_sound_sfx_reloading_Reloading_begin0010_ogg = "res://resource/sound/sfx/reloading/Reloading_begin0010.ogg"; public const string resource_sound_sfx_reloading_Reloading_finish0001_ogg = "res://resource/sound/sfx/reloading/Reloading_finish0001.ogg"; public const string resource_sound_sfx_reloading_Reloading_finish0002_ogg = "res://resource/sound/sfx/reloading/Reloading_finish0002.ogg"; public const string resource_sound_sfx_shooting_Shooting0001_ogg = "res://resource/sound/sfx/shooting/Shooting0001.ogg"; @@ -117,9 +131,10 @@ public class ResourcePath public const string resource_sound_sfx_shooting_Shooting0007_ogg = "res://resource/sound/sfx/shooting/Shooting0007.ogg"; public const string resource_sound_sfx_shooting_Shooting0008_ogg = "res://resource/sound/sfx/shooting/Shooting0008.ogg"; public const string resource_sprite_bullet_arrow_png = "res://resource/sprite/bullet/arrow.png"; - public const string resource_sprite_bullet_bullet_png = "res://resource/sprite/bullet/bullet.png"; + public const string resource_sprite_bullet_bullet0001_png = "res://resource/sprite/bullet/bullet0001.png"; + public const string resource_sprite_bullet_bullet0002_png = "res://resource/sprite/bullet/bullet0002.png"; + public const string resource_sprite_bullet_bullet0003_png = "res://resource/sprite/bullet/bullet0003.png"; public const string resource_sprite_bullet_bullet2_png = "res://resource/sprite/bullet/bullet2.png"; - public const string resource_sprite_bullet_bullet3_png = "res://resource/sprite/bullet/bullet3.png"; public const string resource_sprite_effects_Circle_png = "res://resource/sprite/effects/Circle.png"; public const string resource_sprite_effects_Collision_png = "res://resource/sprite/effects/Collision.png"; public const string resource_sprite_effects_debug_arrows_png = "res://resource/sprite/effects/debug_arrows.png"; @@ -144,7 +159,6 @@ public class ResourcePath public const string resource_sprite_prop_buff_BuffProp0009_png = "res://resource/sprite/prop/buff/BuffProp0009.png"; public const string resource_sprite_prop_buff_BuffProp0010_png = "res://resource/sprite/prop/buff/BuffProp0010.png"; public const string resource_sprite_role_role10_png = "res://resource/sprite/role/role10.png"; - public const string resource_sprite_role_role2_png = "res://resource/sprite/role/role2.png"; public const string resource_sprite_role_role3_png = "res://resource/sprite/role/role3.png"; public const string resource_sprite_role_role4_png = "res://resource/sprite/role/role4.png"; public const string resource_sprite_role_role5_png = "res://resource/sprite/role/role5.png"; @@ -152,16 +166,47 @@ public class ResourcePath public const string resource_sprite_role_role7_png = "res://resource/sprite/role/role7.png"; public const string resource_sprite_role_role8_png = "res://resource/sprite/role/role8.png"; public const string resource_sprite_role_role9_png = "res://resource/sprite/role/role9.png"; - public const string resource_sprite_role_enemy0001_Enemy0001_png = "res://resource/sprite/role/enemy0001/Enemy0001.png"; - public const string resource_sprite_role_enemy0001_Enemy0001_Debris_png = "res://resource/sprite/role/enemy0001/Enemy0001_Debris.png"; + public const string resource_sprite_role_enemy0001_enemy0001_png = "res://resource/sprite/role/enemy0001/enemy0001.png"; + public const string resource_sprite_role_enemy0001_enemy0001_Debris_png = "res://resource/sprite/role/enemy0001/enemy0001_Debris.png"; + public const string resource_sprite_role_enemy0001_enemy0001_Icon_png = "res://resource/sprite/role/enemy0001/enemy0001_Icon.png"; + public const string resource_sprite_role_role0001_Role0001_png = "res://resource/sprite/role/role0001/Role0001.png"; + public const string resource_sprite_role_role0001_Role0001_Icon_png = "res://resource/sprite/role/role0001/Role0001_Icon.png"; public const string resource_sprite_shell_Shell0001_png = "res://resource/sprite/shell/Shell0001.png"; public const string resource_sprite_shell_Shell0002_png = "res://resource/sprite/shell/Shell0002.png"; public const string resource_sprite_shell_Shell0003_png = "res://resource/sprite/shell/Shell0003.png"; - public const string resource_sprite_ui_CursorCenter_png = "res://resource/sprite/ui/CursorCenter.png"; - public const string resource_sprite_ui_cursors_png = "res://resource/sprite/ui/cursors.png"; public const string resource_sprite_ui_font_bg_png = "res://resource/sprite/ui/font_bg.png"; public const string resource_sprite_ui_GUI_png = "res://resource/sprite/ui/GUI.png"; + public const string resource_sprite_ui_commonIcon_Add_png = "res://resource/sprite/ui/commonIcon/Add.png"; + public const string resource_sprite_ui_commonIcon_AreaTool_png = "res://resource/sprite/ui/commonIcon/AreaTool.png"; + public const string resource_sprite_ui_commonIcon_Back_png = "res://resource/sprite/ui/commonIcon/Back.png"; + public const string resource_sprite_ui_commonIcon_CenterTool_png = "res://resource/sprite/ui/commonIcon/CenterTool.png"; + public const string resource_sprite_ui_commonIcon_Delete_png = "res://resource/sprite/ui/commonIcon/Delete.png"; + public const string resource_sprite_ui_commonIcon_DoorTool_png = "res://resource/sprite/ui/commonIcon/DoorTool.png"; + public const string resource_sprite_ui_commonIcon_Down_png = "res://resource/sprite/ui/commonIcon/Down.png"; + public const string resource_sprite_ui_commonIcon_DragTool_png = "res://resource/sprite/ui/commonIcon/DragTool.png"; + public const string resource_sprite_ui_commonIcon_Edit_png = "res://resource/sprite/ui/commonIcon/Edit.png"; + public const string resource_sprite_ui_commonIcon_Error_mini_png = "res://resource/sprite/ui/commonIcon/Error_mini.png"; + public const string resource_sprite_ui_commonIcon_Hide_png = "res://resource/sprite/ui/commonIcon/Hide.png"; + public const string resource_sprite_ui_commonIcon_Lock_png = "res://resource/sprite/ui/commonIcon/Lock.png"; + public const string resource_sprite_ui_commonIcon_Mark_png = "res://resource/sprite/ui/commonIcon/Mark.png"; + public const string resource_sprite_ui_commonIcon_MarkCell_png = "res://resource/sprite/ui/commonIcon/MarkCell.png"; + public const string resource_sprite_ui_commonIcon_PenTool_png = "res://resource/sprite/ui/commonIcon/PenTool.png"; + public const string resource_sprite_ui_commonIcon_Play_png = "res://resource/sprite/ui/commonIcon/Play.png"; + public const string resource_sprite_ui_commonIcon_Right_png = "res://resource/sprite/ui/commonIcon/Right.png"; + public const string resource_sprite_ui_commonIcon_Save_png = "res://resource/sprite/ui/commonIcon/Save.png"; + public const string resource_sprite_ui_commonIcon_Search_png = "res://resource/sprite/ui/commonIcon/Search.png"; + public const string resource_sprite_ui_commonIcon_Select_png = "res://resource/sprite/ui/commonIcon/Select.png"; + public const string resource_sprite_ui_commonIcon_Select2_png = "res://resource/sprite/ui/commonIcon/Select2.png"; + public const string resource_sprite_ui_commonIcon_Setting_png = "res://resource/sprite/ui/commonIcon/Setting.png"; + public const string resource_sprite_ui_commonIcon_Unlock_png = "res://resource/sprite/ui/commonIcon/Unlock.png"; + public const string resource_sprite_ui_commonIcon_Visible_png = "res://resource/sprite/ui/commonIcon/Visible.png"; + public const string resource_sprite_ui_commonIcon_WaveCell_png = "res://resource/sprite/ui/commonIcon/WaveCell.png"; public const string resource_sprite_ui_keyboard_e_png = "res://resource/sprite/ui/keyboard/e.png"; + public const string resource_sprite_ui_mapEditor_ErrorCell_png = "res://resource/sprite/ui/mapEditor/ErrorCell.png"; + public const string resource_sprite_ui_mapEditorProject_CellBg_png = "res://resource/sprite/ui/mapEditorProject/CellBg.png"; + public const string resource_sprite_ui_mapEditorTools_DoorDragButton_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton.png"; + public const string resource_sprite_ui_mapEditorTools_DoorDragButton_down_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton_down.png"; + public const string resource_sprite_ui_mapEditorTools_DoorDragButton_hover_png = "res://resource/sprite/ui/mapEditorTools/DoorDragButton_hover.png"; public const string resource_sprite_ui_roomUI_ChargeProgress_png = "res://resource/sprite/ui/roomUI/ChargeProgress.png"; public const string resource_sprite_ui_roomUI_ChargeProgressBar_png = "res://resource/sprite/ui/roomUI/ChargeProgressBar.png"; public const string resource_sprite_ui_roomUI_Cooldown_png = "res://resource/sprite/ui/roomUI/Cooldown.png"; @@ -178,6 +223,9 @@ public class ResourcePath public const string resource_sprite_ui_roomUI_ReloadBarBlock_png = "res://resource/sprite/ui/roomUI/ReloadBarBlock.png"; public const string resource_sprite_ui_roomUI_Shield_empty_png = "res://resource/sprite/ui/roomUI/Shield_empty.png"; public const string resource_sprite_ui_roomUI_Shield_full_png = "res://resource/sprite/ui/roomUI/Shield_full.png"; + public const string resource_sprite_ui_sursors_CursorCenter_png = "res://resource/sprite/ui/sursors/CursorCenter.png"; + public const string resource_sprite_ui_sursors_Cursors_png = "res://resource/sprite/ui/sursors/Cursors.png"; + public const string resource_sprite_ui_sursors_Cursors_Ui_png = "res://resource/sprite/ui/sursors/Cursors_Ui.png"; public const string resource_sprite_weapon_bow_png = "res://resource/sprite/weapon/bow.png"; public const string resource_sprite_weapon_gun1_png = "res://resource/sprite/weapon/gun1.png"; public const string resource_sprite_weapon_gun2_png = "res://resource/sprite/weapon/gun2.png"; @@ -194,8 +242,10 @@ public class ResourcePath public const string resource_sprite_weapon_weapon0003_Weapon0003_png = "res://resource/sprite/weapon/weapon0003/Weapon0003.png"; public const string resource_sprite_weapon_weapon0005_Weapon0005_png = "res://resource/sprite/weapon/weapon0005/Weapon0005.png"; public const string resource_sprite_weapon_weapon0006_Weapon0006_png = "res://resource/sprite/weapon/weapon0006/Weapon0006.png"; + public const string resource_sprite_weapon_weapon0007_Weapon0007_png = "res://resource/sprite/weapon/weapon0007/Weapon0007.png"; public const string resource_spriteFrames_bullet_Bullet0001_tres = "res://resource/spriteFrames/bullet/Bullet0001.tres"; public const string resource_spriteFrames_bullet_Bullet0002_tres = "res://resource/spriteFrames/bullet/Bullet0002.tres"; + public const string resource_spriteFrames_bullet_Bullet0003_tres = "res://resource/spriteFrames/bullet/Bullet0003.tres"; public const string resource_spriteFrames_effect_KnifeHit1_tres = "res://resource/spriteFrames/effect/KnifeHit1.tres"; public const string resource_spriteFrames_other_RoomDoor_EW_tres = "res://resource/spriteFrames/other/RoomDoor_EW.tres"; public const string resource_spriteFrames_other_RoomDoor_NS_tres = "res://resource/spriteFrames/other/RoomDoor_NS.tres"; @@ -222,9 +272,9 @@ public class ResourcePath public const string resource_spriteFrames_weapon_Weapon0004_tres = "res://resource/spriteFrames/weapon/Weapon0004.tres"; public const string resource_spriteFrames_weapon_Weapon0005_tres = "res://resource/spriteFrames/weapon/Weapon0005.tres"; public const string resource_spriteFrames_weapon_Weapon0006_tres = "res://resource/spriteFrames/weapon/Weapon0006.tres"; + public const string resource_spriteFrames_weapon_Weapon0007_tres = "res://resource/spriteFrames/weapon/Weapon0007.tres"; public const string resource_theme_mainTheme_tres = "res://resource/theme/mainTheme.tres"; public const string resource_theme_theme1_tres = "res://resource/theme/theme1.tres"; - public const string scene_EditorDemo_tscn = "res://scene/EditorDemo.tscn"; public const string scene_Main_tscn = "res://scene/Main.tscn"; public const string scene_World_tscn = "res://scene/World.tscn"; public const string scene_test_TestCommpont_tscn = "res://scene/test/TestCommpont.tscn"; diff --git a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs index 2576d6a92ac2e9f86912de8c521443bfcf918461..738391c23ea67bb06685e52c4b11c2eb74197627 100644 --- a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs +++ b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs @@ -7,13 +7,33 @@ public static partial class UiManager public static class UiName { public const string BottomTips = "BottomTips"; + public const string EditorTips = "EditorTips"; public const string EditorTools = "EditorTools"; + public const string EditorWindow = "EditorWindow"; public const string Loading = "Loading"; public const string Main = "Main"; + public const string MapEditor = "MapEditor"; + public const string MapEditorCreateGroup = "MapEditorCreateGroup"; + public const string MapEditorCreateMark = "MapEditorCreateMark"; + public const string MapEditorCreatePreinstall = "MapEditorCreatePreinstall"; + public const string MapEditorCreateRoom = "MapEditorCreateRoom"; + public const string MapEditorMapLayer = "MapEditorMapLayer"; + public const string MapEditorMapMark = "MapEditorMapMark"; + public const string MapEditorProject = "MapEditorProject"; + public const string MapEditorSelectObject = "MapEditorSelectObject"; + public const string MapEditorTools = "MapEditorTools"; public const string RoomUI = "RoomUI"; public const string Settlement = "Settlement"; } + /// + /// 创建 BottomTips, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.BottomTips.BottomTipsPanel Create_BottomTips() + { + return CreateUi(UiName.BottomTips); + } + /// /// 打开 BottomTips, 并返回UI实例 /// @@ -37,12 +57,12 @@ public static partial class UiManager /// /// 销毁 BottomTips 的所有实例 /// - public static void Dispose_BottomTips() + public static void Destroy_BottomTips() { var uiInstance = Get_BottomTips_Instance(); foreach (var uiPanel in uiInstance) { - uiPanel.DisposeUi(); + uiPanel.Destroy(); } } @@ -54,6 +74,62 @@ public static partial class UiManager return GetUiInstance(nameof(UI.BottomTips.BottomTips)); } + /// + /// 创建 EditorTips, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.EditorTips.EditorTipsPanel Create_EditorTips() + { + return CreateUi(UiName.EditorTips); + } + + /// + /// 打开 EditorTips, 并返回UI实例 + /// + public static UI.EditorTips.EditorTipsPanel Open_EditorTips() + { + return OpenUi(UiName.EditorTips); + } + + /// + /// 隐藏 EditorTips 的所有实例 + /// + public static void Hide_EditorTips() + { + var uiInstance = Get_EditorTips_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 EditorTips 的所有实例 + /// + public static void Destroy_EditorTips() + { + var uiInstance = Get_EditorTips_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 EditorTips 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.EditorTips.EditorTipsPanel[] Get_EditorTips_Instance() + { + return GetUiInstance(nameof(UI.EditorTips.EditorTips)); + } + + /// + /// 创建 EditorTools, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.EditorTools.EditorToolsPanel Create_EditorTools() + { + return CreateUi(UiName.EditorTools); + } + /// /// 打开 EditorTools, 并返回UI实例 /// @@ -77,12 +153,12 @@ public static partial class UiManager /// /// 销毁 EditorTools 的所有实例 /// - public static void Dispose_EditorTools() + public static void Destroy_EditorTools() { var uiInstance = Get_EditorTools_Instance(); foreach (var uiPanel in uiInstance) { - uiPanel.DisposeUi(); + uiPanel.Destroy(); } } @@ -94,6 +170,62 @@ public static partial class UiManager return GetUiInstance(nameof(UI.EditorTools.EditorTools)); } + /// + /// 创建 EditorWindow, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.EditorWindow.EditorWindowPanel Create_EditorWindow() + { + return CreateUi(UiName.EditorWindow); + } + + /// + /// 打开 EditorWindow, 并返回UI实例 + /// + public static UI.EditorWindow.EditorWindowPanel Open_EditorWindow() + { + return OpenUi(UiName.EditorWindow); + } + + /// + /// 隐藏 EditorWindow 的所有实例 + /// + public static void Hide_EditorWindow() + { + var uiInstance = Get_EditorWindow_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 EditorWindow 的所有实例 + /// + public static void Destroy_EditorWindow() + { + var uiInstance = Get_EditorWindow_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 EditorWindow 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.EditorWindow.EditorWindowPanel[] Get_EditorWindow_Instance() + { + return GetUiInstance(nameof(UI.EditorWindow.EditorWindow)); + } + + /// + /// 创建 Loading, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.Loading.LoadingPanel Create_Loading() + { + return CreateUi(UiName.Loading); + } + /// /// 打开 Loading, 并返回UI实例 /// @@ -117,12 +249,12 @@ public static partial class UiManager /// /// 销毁 Loading 的所有实例 /// - public static void Dispose_Loading() + public static void Destroy_Loading() { var uiInstance = Get_Loading_Instance(); foreach (var uiPanel in uiInstance) { - uiPanel.DisposeUi(); + uiPanel.Destroy(); } } @@ -134,6 +266,14 @@ public static partial class UiManager return GetUiInstance(nameof(UI.Loading.Loading)); } + /// + /// 创建 Main, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.Main.MainPanel Create_Main() + { + return CreateUi(UiName.Main); + } + /// /// 打开 Main, 并返回UI实例 /// @@ -157,12 +297,12 @@ public static partial class UiManager /// /// 销毁 Main 的所有实例 /// - public static void Dispose_Main() + public static void Destroy_Main() { var uiInstance = Get_Main_Instance(); foreach (var uiPanel in uiInstance) { - uiPanel.DisposeUi(); + uiPanel.Destroy(); } } @@ -174,6 +314,494 @@ public static partial class UiManager return GetUiInstance(nameof(UI.Main.Main)); } + /// + /// 创建 MapEditor, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditor.MapEditorPanel Create_MapEditor() + { + return CreateUi(UiName.MapEditor); + } + + /// + /// 打开 MapEditor, 并返回UI实例 + /// + public static UI.MapEditor.MapEditorPanel Open_MapEditor() + { + return OpenUi(UiName.MapEditor); + } + + /// + /// 隐藏 MapEditor 的所有实例 + /// + public static void Hide_MapEditor() + { + var uiInstance = Get_MapEditor_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditor 的所有实例 + /// + public static void Destroy_MapEditor() + { + var uiInstance = Get_MapEditor_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditor 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditor.MapEditorPanel[] Get_MapEditor_Instance() + { + return GetUiInstance(nameof(UI.MapEditor.MapEditor)); + } + + /// + /// 创建 MapEditorCreateGroup, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorCreateGroup.MapEditorCreateGroupPanel Create_MapEditorCreateGroup() + { + return CreateUi(UiName.MapEditorCreateGroup); + } + + /// + /// 打开 MapEditorCreateGroup, 并返回UI实例 + /// + public static UI.MapEditorCreateGroup.MapEditorCreateGroupPanel Open_MapEditorCreateGroup() + { + return OpenUi(UiName.MapEditorCreateGroup); + } + + /// + /// 隐藏 MapEditorCreateGroup 的所有实例 + /// + public static void Hide_MapEditorCreateGroup() + { + var uiInstance = Get_MapEditorCreateGroup_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorCreateGroup 的所有实例 + /// + public static void Destroy_MapEditorCreateGroup() + { + var uiInstance = Get_MapEditorCreateGroup_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorCreateGroup 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorCreateGroup.MapEditorCreateGroupPanel[] Get_MapEditorCreateGroup_Instance() + { + return GetUiInstance(nameof(UI.MapEditorCreateGroup.MapEditorCreateGroup)); + } + + /// + /// 创建 MapEditorCreateMark, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorCreateMark.MapEditorCreateMarkPanel Create_MapEditorCreateMark() + { + return CreateUi(UiName.MapEditorCreateMark); + } + + /// + /// 打开 MapEditorCreateMark, 并返回UI实例 + /// + public static UI.MapEditorCreateMark.MapEditorCreateMarkPanel Open_MapEditorCreateMark() + { + return OpenUi(UiName.MapEditorCreateMark); + } + + /// + /// 隐藏 MapEditorCreateMark 的所有实例 + /// + public static void Hide_MapEditorCreateMark() + { + var uiInstance = Get_MapEditorCreateMark_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorCreateMark 的所有实例 + /// + public static void Destroy_MapEditorCreateMark() + { + var uiInstance = Get_MapEditorCreateMark_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorCreateMark 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorCreateMark.MapEditorCreateMarkPanel[] Get_MapEditorCreateMark_Instance() + { + return GetUiInstance(nameof(UI.MapEditorCreateMark.MapEditorCreateMark)); + } + + /// + /// 创建 MapEditorCreatePreinstall, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorCreatePreinstall.MapEditorCreatePreinstallPanel Create_MapEditorCreatePreinstall() + { + return CreateUi(UiName.MapEditorCreatePreinstall); + } + + /// + /// 打开 MapEditorCreatePreinstall, 并返回UI实例 + /// + public static UI.MapEditorCreatePreinstall.MapEditorCreatePreinstallPanel Open_MapEditorCreatePreinstall() + { + return OpenUi(UiName.MapEditorCreatePreinstall); + } + + /// + /// 隐藏 MapEditorCreatePreinstall 的所有实例 + /// + public static void Hide_MapEditorCreatePreinstall() + { + var uiInstance = Get_MapEditorCreatePreinstall_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorCreatePreinstall 的所有实例 + /// + public static void Destroy_MapEditorCreatePreinstall() + { + var uiInstance = Get_MapEditorCreatePreinstall_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorCreatePreinstall 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorCreatePreinstall.MapEditorCreatePreinstallPanel[] Get_MapEditorCreatePreinstall_Instance() + { + return GetUiInstance(nameof(UI.MapEditorCreatePreinstall.MapEditorCreatePreinstall)); + } + + /// + /// 创建 MapEditorCreateRoom, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorCreateRoom.MapEditorCreateRoomPanel Create_MapEditorCreateRoom() + { + return CreateUi(UiName.MapEditorCreateRoom); + } + + /// + /// 打开 MapEditorCreateRoom, 并返回UI实例 + /// + public static UI.MapEditorCreateRoom.MapEditorCreateRoomPanel Open_MapEditorCreateRoom() + { + return OpenUi(UiName.MapEditorCreateRoom); + } + + /// + /// 隐藏 MapEditorCreateRoom 的所有实例 + /// + public static void Hide_MapEditorCreateRoom() + { + var uiInstance = Get_MapEditorCreateRoom_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorCreateRoom 的所有实例 + /// + public static void Destroy_MapEditorCreateRoom() + { + var uiInstance = Get_MapEditorCreateRoom_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorCreateRoom 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorCreateRoom.MapEditorCreateRoomPanel[] Get_MapEditorCreateRoom_Instance() + { + return GetUiInstance(nameof(UI.MapEditorCreateRoom.MapEditorCreateRoom)); + } + + /// + /// 创建 MapEditorMapLayer, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorMapLayer.MapEditorMapLayerPanel Create_MapEditorMapLayer() + { + return CreateUi(UiName.MapEditorMapLayer); + } + + /// + /// 打开 MapEditorMapLayer, 并返回UI实例 + /// + public static UI.MapEditorMapLayer.MapEditorMapLayerPanel Open_MapEditorMapLayer() + { + return OpenUi(UiName.MapEditorMapLayer); + } + + /// + /// 隐藏 MapEditorMapLayer 的所有实例 + /// + public static void Hide_MapEditorMapLayer() + { + var uiInstance = Get_MapEditorMapLayer_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorMapLayer 的所有实例 + /// + public static void Destroy_MapEditorMapLayer() + { + var uiInstance = Get_MapEditorMapLayer_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorMapLayer 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorMapLayer.MapEditorMapLayerPanel[] Get_MapEditorMapLayer_Instance() + { + return GetUiInstance(nameof(UI.MapEditorMapLayer.MapEditorMapLayer)); + } + + /// + /// 创建 MapEditorMapMark, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorMapMark.MapEditorMapMarkPanel Create_MapEditorMapMark() + { + return CreateUi(UiName.MapEditorMapMark); + } + + /// + /// 打开 MapEditorMapMark, 并返回UI实例 + /// + public static UI.MapEditorMapMark.MapEditorMapMarkPanel Open_MapEditorMapMark() + { + return OpenUi(UiName.MapEditorMapMark); + } + + /// + /// 隐藏 MapEditorMapMark 的所有实例 + /// + public static void Hide_MapEditorMapMark() + { + var uiInstance = Get_MapEditorMapMark_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorMapMark 的所有实例 + /// + public static void Destroy_MapEditorMapMark() + { + var uiInstance = Get_MapEditorMapMark_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorMapMark 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorMapMark.MapEditorMapMarkPanel[] Get_MapEditorMapMark_Instance() + { + return GetUiInstance(nameof(UI.MapEditorMapMark.MapEditorMapMark)); + } + + /// + /// 创建 MapEditorProject, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorProject.MapEditorProjectPanel Create_MapEditorProject() + { + return CreateUi(UiName.MapEditorProject); + } + + /// + /// 打开 MapEditorProject, 并返回UI实例 + /// + public static UI.MapEditorProject.MapEditorProjectPanel Open_MapEditorProject() + { + return OpenUi(UiName.MapEditorProject); + } + + /// + /// 隐藏 MapEditorProject 的所有实例 + /// + public static void Hide_MapEditorProject() + { + var uiInstance = Get_MapEditorProject_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorProject 的所有实例 + /// + public static void Destroy_MapEditorProject() + { + var uiInstance = Get_MapEditorProject_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorProject 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorProject.MapEditorProjectPanel[] Get_MapEditorProject_Instance() + { + return GetUiInstance(nameof(UI.MapEditorProject.MapEditorProject)); + } + + /// + /// 创建 MapEditorSelectObject, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorSelectObject.MapEditorSelectObjectPanel Create_MapEditorSelectObject() + { + return CreateUi(UiName.MapEditorSelectObject); + } + + /// + /// 打开 MapEditorSelectObject, 并返回UI实例 + /// + public static UI.MapEditorSelectObject.MapEditorSelectObjectPanel Open_MapEditorSelectObject() + { + return OpenUi(UiName.MapEditorSelectObject); + } + + /// + /// 隐藏 MapEditorSelectObject 的所有实例 + /// + public static void Hide_MapEditorSelectObject() + { + var uiInstance = Get_MapEditorSelectObject_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorSelectObject 的所有实例 + /// + public static void Destroy_MapEditorSelectObject() + { + var uiInstance = Get_MapEditorSelectObject_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorSelectObject 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorSelectObject.MapEditorSelectObjectPanel[] Get_MapEditorSelectObject_Instance() + { + return GetUiInstance(nameof(UI.MapEditorSelectObject.MapEditorSelectObject)); + } + + /// + /// 创建 MapEditorTools, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.MapEditorTools.MapEditorToolsPanel Create_MapEditorTools() + { + return CreateUi(UiName.MapEditorTools); + } + + /// + /// 打开 MapEditorTools, 并返回UI实例 + /// + public static UI.MapEditorTools.MapEditorToolsPanel Open_MapEditorTools() + { + return OpenUi(UiName.MapEditorTools); + } + + /// + /// 隐藏 MapEditorTools 的所有实例 + /// + public static void Hide_MapEditorTools() + { + var uiInstance = Get_MapEditorTools_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 MapEditorTools 的所有实例 + /// + public static void Destroy_MapEditorTools() + { + var uiInstance = Get_MapEditorTools_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 MapEditorTools 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.MapEditorTools.MapEditorToolsPanel[] Get_MapEditorTools_Instance() + { + return GetUiInstance(nameof(UI.MapEditorTools.MapEditorTools)); + } + + /// + /// 创建 RoomUI, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.RoomUI.RoomUIPanel Create_RoomUI() + { + return CreateUi(UiName.RoomUI); + } + /// /// 打开 RoomUI, 并返回UI实例 /// @@ -197,12 +825,12 @@ public static partial class UiManager /// /// 销毁 RoomUI 的所有实例 /// - public static void Dispose_RoomUI() + public static void Destroy_RoomUI() { var uiInstance = Get_RoomUI_Instance(); foreach (var uiPanel in uiInstance) { - uiPanel.DisposeUi(); + uiPanel.Destroy(); } } @@ -214,6 +842,14 @@ public static partial class UiManager return GetUiInstance(nameof(UI.RoomUI.RoomUI)); } + /// + /// 创建 Settlement, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.Settlement.SettlementPanel Create_Settlement() + { + return CreateUi(UiName.Settlement); + } + /// /// 打开 Settlement, 并返回UI实例 /// @@ -237,12 +873,12 @@ public static partial class UiManager /// /// 销毁 Settlement 的所有实例 /// - public static void Dispose_Settlement() + public static void Destroy_Settlement() { var uiInstance = Get_Settlement_Instance(); foreach (var uiPanel in uiInstance) { - uiPanel.DisposeUi(); + uiPanel.Destroy(); } } diff --git a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs index 98cd72d9a3e3e7a8e56be27c82a7ef1b72ee9a1c..07bcf9d61fbe662ed2e1506e140690679f68cb37 100644 --- a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs +++ b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs @@ -7,7 +7,22 @@ using Godot; ///
public class AutoTileConfig { - public List MiddleLayerAtlasCoords = new List() + public TileCellInfo IN_LT = new TileCellInfo(0, new Vector2I(3, 3)); + public TileCellInfo IN_LB = new TileCellInfo(0, new Vector2I(11, 2)); + public TileCellInfo IN_RT = new TileCellInfo(0, new Vector2I(1, 3)); + public TileCellInfo IN_RB = new TileCellInfo(0, new Vector2I(13, 2)); + public TileCellInfo R = new TileCellInfo(0, new Vector2I(1, 3)); + public TileCellInfo L = new TileCellInfo(0, new Vector2I(3, 3)); + public TileCellInfo T = new TileCellInfo(0, new Vector2I(2, 7)); + public TileCellInfo B = new TileCellInfo(0, new Vector2I(2, 2)); + public TileCellInfo Floor = new TileCellInfo(0, new Vector2I(0, 8)); + + public TileCellInfo OUT_LT = new TileCellInfo(0, new Vector2I(1, 2)); + public TileCellInfo OUT_LB = new TileCellInfo(0, new Vector2I(1, 7)); + public TileCellInfo OUT_RT = new TileCellInfo(0, new Vector2I(3, 2)); + public TileCellInfo OUT_RB = new TileCellInfo(0, new Vector2I(3, 7)); + + private List _middleLayerAtlasCoords = new List() { new Vector2I(1, 6), new Vector2I(2, 6), @@ -17,7 +32,7 @@ public class AutoTileConfig new Vector2I(3, 7), }; - public List TopLayerAtlasCoords = new List() + private List _topLayerAtlasCoords = new List() { new Vector2I(1, 4), new Vector2I(1, 3), @@ -30,18 +45,18 @@ public class AutoTileConfig new Vector2I(13, 2), }; - public TileCellInfo IN_LT = new TileCellInfo(0, new Vector2I(3, 3)); - public TileCellInfo IN_LB = new TileCellInfo(0, new Vector2I(11, 2)); - public TileCellInfo IN_RT = new TileCellInfo(0, new Vector2I(1, 3)); - public TileCellInfo IN_RB = new TileCellInfo(0, new Vector2I(13, 2)); - public TileCellInfo R = new TileCellInfo(0, new Vector2I(1, 3)); - public TileCellInfo L = new TileCellInfo(0, new Vector2I(3, 3)); - public TileCellInfo T = new TileCellInfo(0, new Vector2I(2, 7)); - public TileCellInfo B = new TileCellInfo(0, new Vector2I(2, 2)); - public TileCellInfo Floor = new TileCellInfo(0, new Vector2I(0, 8)); - - public TileCellInfo OUT_LT = new TileCellInfo(0, new Vector2I(1, 2)); - public TileCellInfo OUT_LB = new TileCellInfo(0, new Vector2I(1, 7)); - public TileCellInfo OUT_RT = new TileCellInfo(0, new Vector2I(3, 2)); - public TileCellInfo OUT_RB = new TileCellInfo(0, new Vector2I(3, 7)); + public int GetLayer(Vector2I atlasCoords) + { + var layer = GameConfig.FloorMapLayer; + if (_middleLayerAtlasCoords.Contains(atlasCoords)) + { + layer = GameConfig.MiddleMapLayer; + } + else if (_topLayerAtlasCoords.Contains(atlasCoords)) + { + layer = GameConfig.TopMapLayer; + } + + return layer; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/DungeonCheckState.cs b/DungeonShooting_Godot/src/game/room/DungeonCheckState.cs new file mode 100644 index 0000000000000000000000000000000000000000..00647ad33065a70b3f5676eb28fca2f53051c4c1 --- /dev/null +++ b/DungeonShooting_Godot/src/game/room/DungeonCheckState.cs @@ -0,0 +1,21 @@ + +/// +/// 地牢房间检查结果 +/// +public class DungeonCheckState +{ + /// + /// 是否存在异常 + /// + public bool HasError; + /// + /// 异常消息 + /// + public string ErrorMessage; + + public DungeonCheckState(bool hasError, string errorMessage) + { + HasError = hasError; + ErrorMessage = errorMessage; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index 0f3d80149c815a20fe592591242d0047bbc8cba2..76556815a3ce4a1a229350e648e9e0a653c369df 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -2,8 +2,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; -using Config; using Godot; /// @@ -14,12 +12,12 @@ public partial class DungeonManager : Node2D /// /// 起始房间 /// - public RoomInfo StartRoom => _dungeonGenerator?.StartRoom; + public RoomInfo StartRoomInfo => _dungeonGenerator?.StartRoomInfo; /// /// 当前玩家所在的房间 /// - public RoomInfo ActiveRoom => Player.Current?.AffiliationArea?.RoomInfo; + public RoomInfo ActiveRoomInfo => Player.Current?.AffiliationArea?.RoomInfo; /// /// 当前玩家所在的区域 @@ -31,13 +29,27 @@ public partial class DungeonManager : Node2D /// public bool IsInDungeon { get; private set; } - private DungeonConfig _config; - private DungeonTile _dungeonTile; + /// + /// 是否是编辑器模式 + /// + public bool IsEditorMode { get; private set; } + + /// + /// 当前使用的配置 + /// + public DungeonConfig CurrConfig { get; private set; } + + /// + /// 当前使用的世界对象 + /// + public World World { get; private set; } + + private UiBase _prevUi; + private DungeonTileMap _dungeonTileMap; private AutoTileConfig _autoTileConfig; private DungeonGenerator _dungeonGenerator; //房间内所有静态导航网格数据 private List _roomStaticNavigationList; - private World _world; //用于检查房间敌人的计时器 private float _checkEnemyTimer = 0; @@ -55,9 +67,24 @@ public partial class DungeonManager : Node2D /// public void LoadDungeon(DungeonConfig config, Action finish = null) { - _config = config; + IsEditorMode = false; + CurrConfig = config; GameApplication.Instance.StartCoroutine(RunLoadDungeonCoroutine(finish)); } + + + /// + /// 重启地牢 + /// + public void RestartDungeon(DungeonConfig config) + { + IsEditorMode = false; + CurrConfig = config; + ExitDungeon(() => + { + LoadDungeon(CurrConfig); + }); + } /// /// 退出地牢 @@ -67,25 +94,73 @@ public partial class DungeonManager : Node2D IsInDungeon = false; GameApplication.Instance.StartCoroutine(RunExitDungeonCoroutine(finish)); } + + //------------------------------------------------------------------------------------- - public override void _PhysicsProcess(double delta) + /// + /// 在编辑器模式下进入地牢 + /// + /// 地牢配置 + public void EditorPlayDungeon(DungeonConfig config) { - if (IsInDungeon) + IsEditorMode = true; + CurrConfig = config; + if (_prevUi != null) { - _checkEnemyTimer += (float)delta; - if (_checkEnemyTimer >= 1) + _prevUi.HideUi(); + } + GameApplication.Instance.StartCoroutine(RunLoadDungeonCoroutine(null)); + } + + /// + /// 在编辑器模式下进入地牢 + /// + /// 记录上一个Ui + /// 地牢配置 + public void EditorPlayDungeon(UiBase prevUi, DungeonConfig config) + { + IsEditorMode = true; + CurrConfig = config; + _prevUi = prevUi; + if (_prevUi != null) + { + _prevUi.HideUi(); + } + GameApplication.Instance.StartCoroutine(RunLoadDungeonCoroutine(null)); + } + + /// + /// 在编辑器模式下退出地牢, 并且打开上一个Ui + /// + public void EditorExitDungeon() + { + IsInDungeon = false; + GameApplication.Instance.StartCoroutine(RunExitDungeonCoroutine(() => + { + IsEditorMode = false; + //显示上一个Ui + if (_prevUi != null) { - _checkEnemyTimer %= 1; - //检查房间内的敌人存活状况 - OnCheckEnemy(); + _prevUi.ShowUi(); } - } + })); } + + //------------------------------------------------------------------------------------- public override void _Process(double delta) { if (IsInDungeon) { + _checkEnemyTimer += (float)delta; + if (_checkEnemyTimer >= 1) + { + _checkEnemyTimer %= 1; + //检查房间内的敌人存活状况 + OnCheckEnemy(); + } + + //更新敌人视野 UpdateEnemiesView(); if (GameApplication.Instance.Debug) { @@ -101,31 +176,31 @@ public partial class DungeonManager : Node2D UiManager.Open_Loading(); yield return 0; //创建世界场景 - _world = GameApplication.Instance.CreateNewWorld(); + World = GameApplication.Instance.CreateNewWorld(); yield return new WaitForFixedProcess(10); //生成地牢房间 - _dungeonGenerator = new DungeonGenerator(_config); + _dungeonGenerator = new DungeonGenerator(CurrConfig); _dungeonGenerator.Generate(); yield return 0; //填充地牢 _autoTileConfig = new AutoTileConfig(); - _dungeonTile = new DungeonTile(_world.TileRoot); - _dungeonTile.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoom); + _dungeonTileMap = new DungeonTileMap(World.TileRoot); + _dungeonTileMap.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoomInfo, _dungeonGenerator.Random); yield return 0; //生成寻路网格, 这一步操作只生成过道的导航 - _dungeonTile.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); + _dungeonTileMap.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); yield return 0; //挂载过道导航区域 - _dungeonTile.MountNavigationPolygon(_world.TileRoot); + _dungeonTileMap.MountNavigationPolygon(World.TileRoot); yield return 0; //过道导航区域数据 _roomStaticNavigationList = new List(); - _roomStaticNavigationList.AddRange(_dungeonTile.GetPolygonData()); + _roomStaticNavigationList.AddRange(_dungeonTileMap.GetPolygonData()); yield return 0; //门导航区域数据 - _roomStaticNavigationList.AddRange(_dungeonTile.GetConnectDoorPolygonData()); + _roomStaticNavigationList.AddRange(_dungeonTileMap.GetConnectDoorPolygonData()); yield return new WaitForFixedProcess(10); //初始化所有房间 _dungeonGenerator.EachRoom(InitRoom); @@ -135,7 +210,7 @@ public partial class DungeonManager : Node2D //SoundManager.PlayMusic(ResourcePath.resource_sound_bgm_Intro_ogg, -17f); //初始房间创建玩家标记 - var playerBirthMark = StartRoom.ActivityMarks.FirstOrDefault(mark => mark.Type == ActivityIdPrefix.ActivityPrefixType.Player); + var playerBirthMark = StartRoomInfo.RoomPreinstall.GetPlayerBirthMark(); //创建玩家 var player = ActivityObject.Create(ActivityObject.Ids.Id_role0001); if (playerBirthMark != null) @@ -146,6 +221,9 @@ public partial class DungeonManager : Node2D player.Name = "Player"; player.PutDown(RoomLayerEnum.YSortLayer); Player.SetCurrentPlayer(player); + + //地牢加载即将完成 + _dungeonGenerator.EachRoom(info => info.OnReady()); //玩家手上添加武器 //player.PickUpWeapon(ActivityObject.Create(ActivityObject.Ids.Id_weapon0001)); @@ -167,9 +245,10 @@ public partial class DungeonManager : Node2D EventManager.EmitEvent(EventEnum.OnEnterDungeon); IsInDungeon = true; + QueueRedraw(); yield return 0; //关闭 loading UI - UiManager.Dispose_Loading(); + UiManager.Destroy_Loading(); if (finish != null) { finish(); @@ -181,11 +260,11 @@ public partial class DungeonManager : Node2D //打开 loading UI UiManager.Open_Loading(); yield return 0; - _world.Pause = true; + World.Pause = true; yield return 0; _dungeonGenerator.EachRoom(DisposeRoomInfo); yield return 0; - _dungeonTile = null; + _dungeonTileMap = null; _autoTileConfig = null; _dungeonGenerator = null; _roomStaticNavigationList.Clear(); @@ -194,16 +273,17 @@ public partial class DungeonManager : Node2D UiManager.Hide_RoomUI(); yield return new WaitForFixedProcess(10); Player.SetCurrentPlayer(null); - _world = null; + World = null; GameApplication.Instance.DestroyWorld(); yield return new WaitForFixedProcess(10); + QueueRedraw(); //鼠标还原 - GameApplication.Instance.Cursor.SetGuiMode(false); + GameApplication.Instance.Cursor.SetGuiMode(true); //派发退出地牢事件 EventManager.EmitEvent(EventEnum.OnExitDungeon); yield return 0; //关闭 loading UI - UiManager.Dispose_Loading(); + UiManager.Destroy_Loading(); if (finish != null) { finish(); @@ -226,34 +306,31 @@ public partial class DungeonManager : Node2D //挂载房间导航区域 private void MountNavFromRoomInfo(RoomInfo roomInfo) { - var polygonArray = roomInfo.RoomSplit.RoomInfo.NavigationList.ToArray(); + var polygonArray = roomInfo.RoomSplit.TileInfo.NavigationList; var polygon = new NavigationPolygon(); var offset = roomInfo.GetOffsetPosition(); - for (var i = 0; i < polygonArray.Length; i++) + for (var i = 0; i < polygonArray.Count; i++) { var navigationPolygonData = polygonArray[i]; - var polygonPointArray = navigationPolygonData.ConvertPointsToVector2Array(); + var tempPosArray = navigationPolygonData.GetPoints(); + var polygonPointArray = new Vector2[tempPosArray.Length]; //这里的位置需要加上房间位置 - for (var j = 0; j < polygonPointArray.Length; j++) + for (var j = 0; j < tempPosArray.Length; j++) { - polygonPointArray[j] = polygonPointArray[j] + roomInfo.GetWorldPosition() - offset; + polygonPointArray[j] = tempPosArray[j] + roomInfo.GetWorldPosition() - offset; } polygon.AddOutline(polygonPointArray); - - var points = new List(); - for (var j = 0; j < polygonPointArray.Length; j++) - { - points.Add(new SerializeVector2(polygonPointArray[j])); - } - + //存入汇总列表 - _roomStaticNavigationList.Add(new NavigationPolygonData(navigationPolygonData.Type, points)); + var polygonData = new NavigationPolygonData(navigationPolygonData.Type); + polygonData.SetPoints(polygonPointArray); + _roomStaticNavigationList.Add(polygonData); } polygon.MakePolygonsFromOutlines(); var navigationPolygon = new NavigationRegion2D(); navigationPolygon.Name = "NavigationRegion" + (GetChildCount() + 1); navigationPolygon.NavigationPolygon = polygon; - _world.TileRoot.AddChild(navigationPolygon); + World.TileRoot.AddChild(navigationPolygon); } //创建门 @@ -303,7 +380,7 @@ public partial class DungeonManager : Node2D (roomInfo.Size - new Vector2I(2, 2)) * GameConfig.TileCellSize)); roomInfo.AffiliationArea = affiliation; - _world.AffiliationAreaRoot.AddChild(affiliation); + World.AffiliationAreaRoot.AddChild(affiliation); } //创建静态精灵画布 @@ -397,7 +474,7 @@ public partial class DungeonManager : Node2D maxX += GameConfig.TileCellSize; maxY += GameConfig.TileCellSize; var staticSpriteCanvas = new RoomStaticImageCanvas( - _world.StaticSpriteRoot, + World.StaticSpriteRoot, new Vector2I(minX, minY), maxX - minX, maxY - minY ); @@ -411,12 +488,12 @@ public partial class DungeonManager : Node2D private void OnPlayerFirstEnterRoom(object o) { var room = (RoomInfo)o; - room.BeReady(); + room.OnFirstEnter(); //如果关门了, 那么房间外的敌人就会丢失目标 if (room.IsSeclusion) { var playerAffiliationArea = Player.Current.AffiliationArea; - foreach (var enemy in _world.Enemy_InstanceList) + foreach (var enemy in World.Enemy_InstanceList) { //不与玩家处于同一个房间 if (enemy.AffiliationArea != playerAffiliationArea) @@ -442,15 +519,15 @@ public partial class DungeonManager : Node2D /// private void OnCheckEnemy() { - var activeRoom = ActiveRoom; - if (activeRoom != null)// && //activeRoom.IsSeclusion) + var activeRoom = ActiveRoomInfo; + if (activeRoom != null) { - if (activeRoom.IsSeclusion) //房间处于关上状态 + if (activeRoom.RoomPreinstall.IsRunWave) //正在生成标记 { - if (activeRoom.IsCurrWaveOver()) //所有标记执行完成 + if (activeRoom.RoomPreinstall.IsCurrWaveOver()) //所有标记执行完成 { - //是否有存活的敌人 - var flag = ActiveAffiliationArea.ExistIncludeItem( + //房间内是否有存活的敌人 + var flag = ActiveAffiliationArea.ExistEnterItem( activityObject => activityObject.CollisionWithMask(PhysicsLayer.Enemy) ); //GD.Print("当前房间存活数量: " + count); @@ -468,21 +545,21 @@ public partial class DungeonManager : Node2D ///
private void UpdateEnemiesView() { - _world.Enemy_IsFindTarget = false; - _world.Enemy_FindTargetAffiliationSet.Clear(); - for (var i = 0; i < _world.Enemy_InstanceList.Count; i++) + World.Enemy_IsFindTarget = false; + World.Enemy_FindTargetAffiliationSet.Clear(); + for (var i = 0; i < World.Enemy_InstanceList.Count; i++) { - var enemy = _world.Enemy_InstanceList[i]; + var enemy = World.Enemy_InstanceList[i]; var state = enemy.StateController.CurrState; if (state == AiStateEnum.AiFollowUp || state == AiStateEnum.AiSurround) //目标在视野内 { - if (!_world.Enemy_IsFindTarget) + if (!World.Enemy_IsFindTarget) { - _world.Enemy_IsFindTarget = true; - _world.Enemy_FindTargetPosition = Player.Current.GetCenterPosition(); - _world.Enemy_FindTargetAffiliationSet.Add(Player.Current.AffiliationArea); + World.Enemy_IsFindTarget = true; + World.Enemy_FindTargetPosition = Player.Current.GetCenterPosition(); + World.Enemy_FindTargetAffiliationSet.Add(Player.Current.AffiliationArea); } - _world.Enemy_FindTargetAffiliationSet.Add(enemy.AffiliationArea); + World.Enemy_FindTargetAffiliationSet.Add(enemy.AffiliationArea); } } } @@ -496,7 +573,7 @@ public partial class DungeonManager : Node2D { if (GameApplication.Instance.Debug) { - if (_dungeonTile != null) + if (_dungeonTileMap != null) { //绘制ai寻路区域 Utils.DrawNavigationPolygon(this, _roomStaticNavigationList.ToArray()); @@ -512,24 +589,24 @@ public partial class DungeonManager : Node2D } //绘制房间区域, debug 用 - private void DrawRoomInfo(RoomInfo room) + private void DrawRoomInfo(RoomInfo roomInfo) { - var cellSize = _world.TileRoot.CellQuadrantSize; - var pos1 = (room.Position + room.Size / 2) * cellSize; + var cellSize = World.TileRoot.CellQuadrantSize; + var pos1 = (roomInfo.Position + roomInfo.Size / 2) * cellSize; //绘制下一个房间 - foreach (var nextRoom in room.Next) + foreach (var nextRoom in roomInfo.Next) { var pos2 = (nextRoom.Position + nextRoom.Size / 2) * cellSize; DrawLine(pos1, pos2, Colors.Red); DrawRoomInfo(nextRoom); } - DrawString(ResourceManager.DefaultFont16Px, pos1 - new Vector2I(0, 10), "Id: " + room.Id.ToString()); - DrawString(ResourceManager.DefaultFont16Px, pos1 + new Vector2I(0, 10), "Layer: " + room.Layer.ToString()); + DrawString(ResourceManager.DefaultFont16Px, pos1 - new Vector2I(0, 10), "Id: " + roomInfo.Id.ToString()); + DrawString(ResourceManager.DefaultFont16Px, pos1 + new Vector2I(0, 10), "Layer: " + roomInfo.Layer.ToString()); //绘制门 - foreach (var roomDoor in room.Doors) + foreach (var roomDoor in roomInfo.Doors) { var originPos = roomDoor.OriginPosition * cellSize; switch (roomDoor.Direction) @@ -557,7 +634,7 @@ public partial class DungeonManager : Node2D } //绘制房间区域 - DrawRect(new Rect2(room.Position * cellSize, room.Size * cellSize), Colors.Blue, false); + DrawRect(new Rect2(roomInfo.Position * cellSize, roomInfo.Size * cellSize), Colors.Blue, false); if (roomDoor.HasCross && roomDoor.RoomInfo.Id < roomDoor.ConnectRoom.Id) { @@ -565,4 +642,71 @@ public partial class DungeonManager : Node2D } } } + + /// + /// 将房间类型枚举转为字符串 + /// + public static string DungeonRoomTypeToString(DungeonRoomType roomType) + { + switch (roomType) + { + case DungeonRoomType.Battle: return "battle"; + case DungeonRoomType.Inlet: return "inlet"; + case DungeonRoomType.Outlet: return "outlet"; + case DungeonRoomType.Boss: return "boss"; + case DungeonRoomType.Reward: return "reward"; + case DungeonRoomType.Shop: return "shop"; + case DungeonRoomType.Event: return "event"; + } + + return "battle"; + } + + + /// + /// 将房间类型枚举转为描述字符串 + /// + public static string DungeonRoomTypeToDescribeString(DungeonRoomType roomType) + { + switch (roomType) + { + case DungeonRoomType.Battle: return "战斗房间"; + case DungeonRoomType.Inlet: return "起始房间"; + case DungeonRoomType.Outlet: return "结束房间"; + case DungeonRoomType.Boss: return "Boss房间"; + case DungeonRoomType.Reward: return "奖励房间"; + case DungeonRoomType.Shop: return "商店房间"; + case DungeonRoomType.Event: return "事件房间"; + } + + return "战斗房间"; + } + + /// + /// 检测地牢是否可以执行生成 + /// + /// 组名称 + public static DungeonCheckState CheckDungeon(string groupName) + { + if (GameApplication.Instance.RoomConfig.TryGetValue(groupName, out var group)) + { + //验证该组是否满足生成地牢的条件 + if (group.InletList.Count == 0) + { + return new DungeonCheckState(true, "当没有可用的起始房间!"); + } + else if (group.OutletList.Count == 0) + { + return new DungeonCheckState(true, "没有可用的结束房间!"); + } + else if (group.BattleList.Count == 0) + { + return new DungeonCheckState(true, "没有可用的战斗房间!"); + } + + return new DungeonCheckState(false, null); + } + + return new DungeonCheckState(true, "未找到地牢组"); + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTips.cs b/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTips.cs index f406a8c31e754fecfdf5885c9e75729e8f140341..752e6afa12e990338644f7a9f2cd87f20aba314c 100644 --- a/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTips.cs +++ b/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTips.cs @@ -8,15 +8,15 @@ public abstract partial class BottomTips : UiBase /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: BottomTips.Panel /// - public UiNode_Panel L_Panel + public BottomTips_Panel L_Panel { get { - if (_L_Panel == null) _L_Panel = new UiNode_Panel(GetNodeOrNull("Panel")); + if (_L_Panel == null) _L_Panel = new BottomTips_Panel(this, GetNodeOrNull("Panel")); return _L_Panel; } } - private UiNode_Panel _L_Panel; + private BottomTips_Panel _L_Panel; public BottomTips() : base(nameof(BottomTips)) @@ -26,142 +26,178 @@ public abstract partial class BottomTips : UiBase /// /// 类型: , 路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer.AspectRatioContainer.TextureRect /// - public class UiNode_TextureRect : IUiNode + public class BottomTips_TextureRect : UiNode { - public UiNode_TextureRect(Godot.TextureRect node) : base(node) { } - public override UiNode_TextureRect Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public BottomTips_TextureRect(BottomTips uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override BottomTips_TextureRect Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer.AspectRatioContainer /// - public class UiNode_AspectRatioContainer : IUiNode + public class BottomTips_AspectRatioContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer.TextureRect /// - public UiNode_TextureRect L_TextureRect + public BottomTips_TextureRect L_TextureRect { get { - if (_L_TextureRect == null) _L_TextureRect = new UiNode_TextureRect(Instance.GetNodeOrNull("TextureRect")); + if (_L_TextureRect == null) _L_TextureRect = new BottomTips_TextureRect(UiPanel, Instance.GetNodeOrNull("TextureRect")); return _L_TextureRect; } } - private UiNode_TextureRect _L_TextureRect; + private BottomTips_TextureRect _L_TextureRect; - public UiNode_AspectRatioContainer(Godot.AspectRatioContainer node) : base(node) { } - public override UiNode_AspectRatioContainer Clone() => new ((Godot.AspectRatioContainer)Instance.Duplicate()); + public BottomTips_AspectRatioContainer(BottomTips uiPanel, Godot.AspectRatioContainer node) : base(uiPanel, node) { } + public override BottomTips_AspectRatioContainer Clone() => new (UiPanel, (Godot.AspectRatioContainer)Instance.Duplicate()); } /// /// 类型: , 路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer.Label /// - public class UiNode_Label : IUiNode + public class BottomTips_Label : UiNode { - public UiNode_Label(Godot.Label node) : base(node) { } - public override UiNode_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public BottomTips_Label(BottomTips uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override BottomTips_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer /// - public class UiNode_HBoxContainer : IUiNode + public class BottomTips_HBoxContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer.AspectRatioContainer /// - public UiNode_AspectRatioContainer L_AspectRatioContainer + public BottomTips_AspectRatioContainer L_AspectRatioContainer { get { - if (_L_AspectRatioContainer == null) _L_AspectRatioContainer = new UiNode_AspectRatioContainer(Instance.GetNodeOrNull("AspectRatioContainer")); + if (_L_AspectRatioContainer == null) _L_AspectRatioContainer = new BottomTips_AspectRatioContainer(UiPanel, Instance.GetNodeOrNull("AspectRatioContainer")); return _L_AspectRatioContainer; } } - private UiNode_AspectRatioContainer _L_AspectRatioContainer; + private BottomTips_AspectRatioContainer _L_AspectRatioContainer; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer.Label /// - public UiNode_Label L_Label + public BottomTips_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new BottomTips_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode_Label _L_Label; + private BottomTips_Label _L_Label; - public UiNode_HBoxContainer(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public BottomTips_HBoxContainer(BottomTips uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override BottomTips_HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: BottomTips.Panel.MarginContainer.CenterContainer /// - public class UiNode_CenterContainer : IUiNode + public class BottomTips_CenterContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.HBoxContainer /// - public UiNode_HBoxContainer L_HBoxContainer + public BottomTips_HBoxContainer L_HBoxContainer { get { - if (_L_HBoxContainer == null) _L_HBoxContainer = new UiNode_HBoxContainer(Instance.GetNodeOrNull("HBoxContainer")); + if (_L_HBoxContainer == null) _L_HBoxContainer = new BottomTips_HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); return _L_HBoxContainer; } } - private UiNode_HBoxContainer _L_HBoxContainer; + private BottomTips_HBoxContainer _L_HBoxContainer; - public UiNode_CenterContainer(Godot.CenterContainer node) : base(node) { } - public override UiNode_CenterContainer Clone() => new ((Godot.CenterContainer)Instance.Duplicate()); + public BottomTips_CenterContainer(BottomTips uiPanel, Godot.CenterContainer node) : base(uiPanel, node) { } + public override BottomTips_CenterContainer Clone() => new (UiPanel, (Godot.CenterContainer)Instance.Duplicate()); } /// /// 类型: , 路径: BottomTips.Panel.MarginContainer /// - public class UiNode_MarginContainer : IUiNode + public class BottomTips_MarginContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: BottomTips.Panel.CenterContainer /// - public UiNode_CenterContainer L_CenterContainer + public BottomTips_CenterContainer L_CenterContainer { get { - if (_L_CenterContainer == null) _L_CenterContainer = new UiNode_CenterContainer(Instance.GetNodeOrNull("CenterContainer")); + if (_L_CenterContainer == null) _L_CenterContainer = new BottomTips_CenterContainer(UiPanel, Instance.GetNodeOrNull("CenterContainer")); return _L_CenterContainer; } } - private UiNode_CenterContainer _L_CenterContainer; + private BottomTips_CenterContainer _L_CenterContainer; - public UiNode_MarginContainer(Godot.MarginContainer node) : base(node) { } - public override UiNode_MarginContainer Clone() => new ((Godot.MarginContainer)Instance.Duplicate()); + public BottomTips_MarginContainer(BottomTips uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override BottomTips_MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); } /// /// 类型: , 路径: BottomTips.Panel /// - public class UiNode_Panel : IUiNode + public class BottomTips_Panel : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: BottomTips.MarginContainer /// - public UiNode_MarginContainer L_MarginContainer + public BottomTips_MarginContainer L_MarginContainer { get { - if (_L_MarginContainer == null) _L_MarginContainer = new UiNode_MarginContainer(Instance.GetNodeOrNull("MarginContainer")); + if (_L_MarginContainer == null) _L_MarginContainer = new BottomTips_MarginContainer(UiPanel, Instance.GetNodeOrNull("MarginContainer")); return _L_MarginContainer; } } - private UiNode_MarginContainer _L_MarginContainer; + private BottomTips_MarginContainer _L_MarginContainer; - public UiNode_Panel(Godot.PanelContainer node) : base(node) { } - public override UiNode_Panel Clone() => new ((Godot.PanelContainer)Instance.Duplicate()); + public BottomTips_Panel(BottomTips uiPanel, Godot.PanelContainer node) : base(uiPanel, node) { } + public override BottomTips_Panel Clone() => new (UiPanel, (Godot.PanelContainer)Instance.Duplicate()); } + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer.AspectRatioContainer.TextureRect + /// + public BottomTips_TextureRect S_TextureRect => L_Panel.L_MarginContainer.L_CenterContainer.L_HBoxContainer.L_AspectRatioContainer.L_TextureRect; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer.AspectRatioContainer + /// + public BottomTips_AspectRatioContainer S_AspectRatioContainer => L_Panel.L_MarginContainer.L_CenterContainer.L_HBoxContainer.L_AspectRatioContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer.Label + /// + public BottomTips_Label S_Label => L_Panel.L_MarginContainer.L_CenterContainer.L_HBoxContainer.L_Label; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer.HBoxContainer + /// + public BottomTips_HBoxContainer S_HBoxContainer => L_Panel.L_MarginContainer.L_CenterContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer.CenterContainer + /// + public BottomTips_CenterContainer S_CenterContainer => L_Panel.L_MarginContainer.L_CenterContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: BottomTips.Panel.MarginContainer + /// + public BottomTips_MarginContainer S_MarginContainer => L_Panel.L_MarginContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: BottomTips.Panel + /// + public BottomTips_Panel S_Panel => L_Panel; + } diff --git a/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTipsPanel.cs b/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTipsPanel.cs index 7eb02fc33c25c577c06d1c941d7cfe1a6865afd9..d615eeec0e96a1b6f2d1ac2e3c207ddeda2d07da 100644 --- a/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTipsPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/bottomTips/BottomTipsPanel.cs @@ -49,8 +49,7 @@ public partial class BottomTipsPanel : BottomTips /// public void SetIcon(Texture2D icon) { - L_Panel.L_MarginContainer.L_CenterContainer.L_HBoxContainer.L_AspectRatioContainer.L_TextureRect.Instance - .Texture = icon; + S_TextureRect.Instance.Texture = icon; } /// @@ -58,7 +57,7 @@ public partial class BottomTipsPanel : BottomTips /// public void SetMessage(string message) { - L_Panel.L_MarginContainer.L_CenterContainer.L_HBoxContainer.L_Label.Instance.Text = message; + S_Label.Instance.Text = message; } private IEnumerator RunAnimation(Texture2D icon, string message) @@ -109,8 +108,7 @@ public partial class BottomTipsPanel : BottomTips private static BottomTipsPanel _instance; public static void Init() { - _instance = UiManager.Open_BottomTips(); - _instance.HideUi(); + _instance = UiManager.CreateUi(UiManager.UiName.BottomTips); } /// diff --git a/DungeonShooting_Godot/src/game/ui/editorTips/EditorTips.cs b/DungeonShooting_Godot/src/game/ui/editorTips/EditorTips.cs new file mode 100644 index 0000000000000000000000000000000000000000..47121bb9d0aa3ccc13af7a96318195d555ab4b20 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/editorTips/EditorTips.cs @@ -0,0 +1,45 @@ +namespace UI.EditorTips; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class EditorTips : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTips.Label + /// + public Label L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label(this, GetNodeOrNull("Label")); + return _L_Label; + } + } + private Label _L_Label; + + + public EditorTips() : base(nameof(EditorTips)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: EditorTips.Label + /// + public class Label : UiNode + { + public Label(EditorTips uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTips.Label + /// + public Label S_Label => L_Label; + +} diff --git a/DungeonShooting_Godot/src/game/ui/editorTips/EditorTipsPanel.cs b/DungeonShooting_Godot/src/game/ui/editorTips/EditorTipsPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..b594ec533882a34182c16bce0a16fdda7f66e62a --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/editorTips/EditorTipsPanel.cs @@ -0,0 +1,14 @@ +using Godot; + +namespace UI.EditorTips; + +public partial class EditorTipsPanel : EditorTips +{ + /// + /// 设置显示的文本 + /// + public void SetMessage(string message) + { + S_Label.Instance.Text = message; + } +} diff --git a/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs b/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs index 99124ab7115dc6087afdc673f3efd3e1d7420ad7..bf3436df749d8eb8a0ea8daf70127a6e168bf96b 100644 --- a/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs +++ b/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs @@ -8,41 +8,41 @@ public abstract partial class EditorTools : UiBase /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer /// - public UiNode_ScrollContainer L_ScrollContainer + public EditorTools_ScrollContainer L_ScrollContainer { get { - if (_L_ScrollContainer == null) _L_ScrollContainer = new UiNode_ScrollContainer(GetNodeOrNull("ScrollContainer")); + if (_L_ScrollContainer == null) _L_ScrollContainer = new EditorTools_ScrollContainer(this, GetNodeOrNull("ScrollContainer")); return _L_ScrollContainer; } } - private UiNode_ScrollContainer _L_ScrollContainer; + private EditorTools_ScrollContainer _L_ScrollContainer; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.Confirm /// - public UiNode_Confirm L_Confirm + public EditorTools_Confirm L_Confirm { get { - if (_L_Confirm == null) _L_Confirm = new UiNode_Confirm(GetNodeOrNull("Confirm")); + if (_L_Confirm == null) _L_Confirm = new EditorTools_Confirm(this, GetNodeOrNull("Confirm")); return _L_Confirm; } } - private UiNode_Confirm _L_Confirm; + private EditorTools_Confirm _L_Confirm; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.Tips /// - public UiNode_Tips L_Tips + public EditorTools_Tips L_Tips { get { - if (_L_Tips == null) _L_Tips = new UiNode_Tips(GetNodeOrNull("Tips")); + if (_L_Tips == null) _L_Tips = new EditorTools_Tips(this, GetNodeOrNull("Tips")); return _L_Tips; } } - private UiNode_Tips _L_Tips; + private EditorTools_Tips _L_Tips; public EditorTools() : base(nameof(EditorTools)) @@ -52,666 +52,757 @@ public abstract partial class EditorTools : UiBase /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer.Label /// - public class UiNode_Label : IUiNode + public class EditorTools_Label : UiNode { - public UiNode_Label(Godot.Label node) : base(node) { } - public override UiNode_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools_Label(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer.Button /// - public class UiNode_Button : IUiNode + public class EditorTools_Button : UiNode { - public UiNode_Button(Godot.Button node) : base(node) { } - public override UiNode_Button Clone() => new ((Godot.Button)Instance.Duplicate()); + public EditorTools_Button(EditorTools uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditorTools_Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer /// - public class UiNode_HBoxContainer : IUiNode + public class EditorTools_HBoxContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label /// - public UiNode_Label L_Label + public EditorTools_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new EditorTools_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode_Label _L_Label; + private EditorTools_Label _L_Label; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button /// - public UiNode_Button L_Button + public EditorTools_Button L_Button { get { - if (_L_Button == null) _L_Button = new UiNode_Button(Instance.GetNodeOrNull("Button")); + if (_L_Button == null) _L_Button = new EditorTools_Button(UiPanel, Instance.GetNodeOrNull("Button")); return _L_Button; } } - private UiNode_Button _L_Button; + private EditorTools_Button _L_Button; - public UiNode_HBoxContainer(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public EditorTools_HBoxContainer(EditorTools uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer3.Label /// - public class UiNode1_Label : IUiNode + public class EditorTools1_Label : UiNode { - public UiNode1_Label(Godot.Label node) : base(node) { } - public override UiNode1_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools1_Label(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools1_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer3.LineEdit /// - public class UiNode_LineEdit : IUiNode + public class EditorTools_LineEdit : UiNode { - public UiNode_LineEdit(Godot.LineEdit node) : base(node) { } - public override UiNode_LineEdit Clone() => new ((Godot.LineEdit)Instance.Duplicate()); + public EditorTools_LineEdit(EditorTools uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override EditorTools_LineEdit Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer3.Button /// - public class UiNode1_Button : IUiNode + public class EditorTools1_Button : UiNode { - public UiNode1_Button(Godot.Button node) : base(node) { } - public override UiNode1_Button Clone() => new ((Godot.Button)Instance.Duplicate()); + public EditorTools1_Button(EditorTools uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditorTools1_Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer3 /// - public class UiNode_HBoxContainer3 : IUiNode + public class EditorTools_HBoxContainer3 : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label /// - public UiNode1_Label L_Label + public EditorTools1_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode1_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new EditorTools1_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode1_Label _L_Label; + private EditorTools1_Label _L_Label; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.LineEdit /// - public UiNode_LineEdit L_LineEdit + public EditorTools_LineEdit L_LineEdit { get { - if (_L_LineEdit == null) _L_LineEdit = new UiNode_LineEdit(Instance.GetNodeOrNull("LineEdit")); + if (_L_LineEdit == null) _L_LineEdit = new EditorTools_LineEdit(UiPanel, Instance.GetNodeOrNull("LineEdit")); return _L_LineEdit; } } - private UiNode_LineEdit _L_LineEdit; + private EditorTools_LineEdit _L_LineEdit; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button /// - public UiNode1_Button L_Button + public EditorTools1_Button L_Button { get { - if (_L_Button == null) _L_Button = new UiNode1_Button(Instance.GetNodeOrNull("Button")); + if (_L_Button == null) _L_Button = new EditorTools1_Button(UiPanel, Instance.GetNodeOrNull("Button")); return _L_Button; } } - private UiNode1_Button _L_Button; + private EditorTools1_Button _L_Button; - public UiNode_HBoxContainer3(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer3 Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public EditorTools_HBoxContainer3(EditorTools uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_HBoxContainer3 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer4.Label /// - public class UiNode2_Label : IUiNode + public class EditorTools2_Label : UiNode { - public UiNode2_Label(Godot.Label node) : base(node) { } - public override UiNode2_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools2_Label(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools2_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer4.Button /// - public class UiNode2_Button : IUiNode + public class EditorTools2_Button : UiNode { - public UiNode2_Button(Godot.Button node) : base(node) { } - public override UiNode2_Button Clone() => new ((Godot.Button)Instance.Duplicate()); + public EditorTools2_Button(EditorTools uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditorTools2_Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer4 /// - public class UiNode_HBoxContainer4 : IUiNode + public class EditorTools_HBoxContainer4 : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label /// - public UiNode2_Label L_Label + public EditorTools2_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode2_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new EditorTools2_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode2_Label _L_Label; + private EditorTools2_Label _L_Label; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button /// - public UiNode2_Button L_Button + public EditorTools2_Button L_Button { get { - if (_L_Button == null) _L_Button = new UiNode2_Button(Instance.GetNodeOrNull("Button")); + if (_L_Button == null) _L_Button = new EditorTools2_Button(UiPanel, Instance.GetNodeOrNull("Button")); return _L_Button; } } - private UiNode2_Button _L_Button; + private EditorTools2_Button _L_Button; - public UiNode_HBoxContainer4(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer4 Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public EditorTools_HBoxContainer4(EditorTools uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_HBoxContainer4 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer5.Label /// - public class UiNode3_Label : IUiNode + public class EditorTools3_Label : UiNode { - public UiNode3_Label(Godot.Label node) : base(node) { } - public override UiNode3_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools3_Label(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools3_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer5.Button /// - public class UiNode3_Button : IUiNode + public class EditorTools3_Button : UiNode { - public UiNode3_Button(Godot.Button node) : base(node) { } - public override UiNode3_Button Clone() => new ((Godot.Button)Instance.Duplicate()); + public EditorTools3_Button(EditorTools uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditorTools3_Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer5 /// - public class UiNode_HBoxContainer5 : IUiNode + public class EditorTools_HBoxContainer5 : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label /// - public UiNode3_Label L_Label + public EditorTools3_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode3_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new EditorTools3_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode3_Label _L_Label; + private EditorTools3_Label _L_Label; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button /// - public UiNode3_Button L_Button + public EditorTools3_Button L_Button { get { - if (_L_Button == null) _L_Button = new UiNode3_Button(Instance.GetNodeOrNull("Button")); + if (_L_Button == null) _L_Button = new EditorTools3_Button(UiPanel, Instance.GetNodeOrNull("Button")); return _L_Button; } } - private UiNode3_Button _L_Button; + private EditorTools3_Button _L_Button; - public UiNode_HBoxContainer5(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer5 Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public EditorTools_HBoxContainer5(EditorTools uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_HBoxContainer5 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Label /// - public class UiNode4_Label : IUiNode + public class EditorTools4_Label : UiNode { - public UiNode4_Label(Godot.Label node) : base(node) { } - public override UiNode4_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools4_Label(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools4_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomNameInput /// - public class UiNode_RoomNameInput : IUiNode + public class EditorTools_RoomNameInput : UiNode { - public UiNode_RoomNameInput(Godot.LineEdit node) : base(node) { } - public override UiNode_RoomNameInput Clone() => new ((Godot.LineEdit)Instance.Duplicate()); + public EditorTools_RoomNameInput(EditorTools uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override EditorTools_RoomNameInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Label2 /// - public class UiNode_Label2 : IUiNode + public class EditorTools_Label2 : UiNode { - public UiNode_Label2(Godot.Label node) : base(node) { } - public override UiNode_Label2 Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools_Label2(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools_Label2 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomGroupSelect /// - public class UiNode_RoomGroupSelect : IUiNode + public class EditorTools_RoomGroupSelect : UiNode { - public UiNode_RoomGroupSelect(Godot.OptionButton node) : base(node) { } - public override UiNode_RoomGroupSelect Clone() => new ((Godot.OptionButton)Instance.Duplicate()); + public EditorTools_RoomGroupSelect(EditorTools uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } + public override EditorTools_RoomGroupSelect Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Label3 /// - public class UiNode_Label3 : IUiNode + public class EditorTools_Label3 : UiNode { - public UiNode_Label3(Godot.Label node) : base(node) { } - public override UiNode_Label3 Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools_Label3(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools_Label3 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomTypeSelect /// - public class UiNode_RoomTypeSelect : IUiNode + public class EditorTools_RoomTypeSelect : UiNode { - public UiNode_RoomTypeSelect(Godot.OptionButton node) : base(node) { } - public override UiNode_RoomTypeSelect Clone() => new ((Godot.OptionButton)Instance.Duplicate()); + public EditorTools_RoomTypeSelect(EditorTools uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } + public override EditorTools_RoomTypeSelect Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Button /// - public class UiNode4_Button : IUiNode + public class EditorTools4_Button : UiNode { - public UiNode4_Button(Godot.Button node) : base(node) { } - public override UiNode4_Button Clone() => new ((Godot.Button)Instance.Duplicate()); + public EditorTools4_Button(EditorTools uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditorTools4_Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6 /// - public class UiNode_HBoxContainer6 : IUiNode + public class EditorTools_HBoxContainer6 : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label /// - public UiNode4_Label L_Label + public EditorTools4_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode4_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new EditorTools4_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode4_Label _L_Label; + private EditorTools4_Label _L_Label; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.RoomNameInput /// - public UiNode_RoomNameInput L_RoomNameInput + public EditorTools_RoomNameInput L_RoomNameInput { get { - if (_L_RoomNameInput == null) _L_RoomNameInput = new UiNode_RoomNameInput(Instance.GetNodeOrNull("RoomNameInput")); + if (_L_RoomNameInput == null) _L_RoomNameInput = new EditorTools_RoomNameInput(UiPanel, Instance.GetNodeOrNull("RoomNameInput")); return _L_RoomNameInput; } } - private UiNode_RoomNameInput _L_RoomNameInput; + private EditorTools_RoomNameInput _L_RoomNameInput; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label2 /// - public UiNode_Label2 L_Label2 + public EditorTools_Label2 L_Label2 { get { - if (_L_Label2 == null) _L_Label2 = new UiNode_Label2(Instance.GetNodeOrNull("Label2")); + if (_L_Label2 == null) _L_Label2 = new EditorTools_Label2(UiPanel, Instance.GetNodeOrNull("Label2")); return _L_Label2; } } - private UiNode_Label2 _L_Label2; + private EditorTools_Label2 _L_Label2; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.RoomGroupSelect /// - public UiNode_RoomGroupSelect L_RoomGroupSelect + public EditorTools_RoomGroupSelect L_RoomGroupSelect { get { - if (_L_RoomGroupSelect == null) _L_RoomGroupSelect = new UiNode_RoomGroupSelect(Instance.GetNodeOrNull("RoomGroupSelect")); + if (_L_RoomGroupSelect == null) _L_RoomGroupSelect = new EditorTools_RoomGroupSelect(UiPanel, Instance.GetNodeOrNull("RoomGroupSelect")); return _L_RoomGroupSelect; } } - private UiNode_RoomGroupSelect _L_RoomGroupSelect; + private EditorTools_RoomGroupSelect _L_RoomGroupSelect; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label3 /// - public UiNode_Label3 L_Label3 + public EditorTools_Label3 L_Label3 { get { - if (_L_Label3 == null) _L_Label3 = new UiNode_Label3(Instance.GetNodeOrNull("Label3")); + if (_L_Label3 == null) _L_Label3 = new EditorTools_Label3(UiPanel, Instance.GetNodeOrNull("Label3")); return _L_Label3; } } - private UiNode_Label3 _L_Label3; + private EditorTools_Label3 _L_Label3; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.RoomTypeSelect /// - public UiNode_RoomTypeSelect L_RoomTypeSelect + public EditorTools_RoomTypeSelect L_RoomTypeSelect { get { - if (_L_RoomTypeSelect == null) _L_RoomTypeSelect = new UiNode_RoomTypeSelect(Instance.GetNodeOrNull("RoomTypeSelect")); + if (_L_RoomTypeSelect == null) _L_RoomTypeSelect = new EditorTools_RoomTypeSelect(UiPanel, Instance.GetNodeOrNull("RoomTypeSelect")); return _L_RoomTypeSelect; } } - private UiNode_RoomTypeSelect _L_RoomTypeSelect; + private EditorTools_RoomTypeSelect _L_RoomTypeSelect; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button /// - public UiNode4_Button L_Button + public EditorTools4_Button L_Button { get { - if (_L_Button == null) _L_Button = new UiNode4_Button(Instance.GetNodeOrNull("Button")); + if (_L_Button == null) _L_Button = new EditorTools4_Button(UiPanel, Instance.GetNodeOrNull("Button")); return _L_Button; } } - private UiNode4_Button _L_Button; + private EditorTools4_Button _L_Button; - public UiNode_HBoxContainer6(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer6 Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public EditorTools_HBoxContainer6(EditorTools uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_HBoxContainer6 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer2.Label /// - public class UiNode5_Label : IUiNode + public class EditorTools5_Label : UiNode { - public UiNode5_Label(Godot.Label node) : base(node) { } - public override UiNode5_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools5_Label(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools5_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer2.Button /// - public class UiNode5_Button : IUiNode + public class EditorTools5_Button : UiNode { - public UiNode5_Button(Godot.Button node) : base(node) { } - public override UiNode5_Button Clone() => new ((Godot.Button)Instance.Duplicate()); + public EditorTools5_Button(EditorTools uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditorTools5_Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer2 /// - public class UiNode_HBoxContainer2 : IUiNode + public class EditorTools_HBoxContainer2 : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label /// - public UiNode5_Label L_Label + public EditorTools5_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode5_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new EditorTools5_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode5_Label _L_Label; + private EditorTools5_Label _L_Label; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button /// - public UiNode5_Button L_Button + public EditorTools5_Button L_Button { get { - if (_L_Button == null) _L_Button = new UiNode5_Button(Instance.GetNodeOrNull("Button")); + if (_L_Button == null) _L_Button = new EditorTools5_Button(UiPanel, Instance.GetNodeOrNull("Button")); return _L_Button; } } - private UiNode5_Button _L_Button; + private EditorTools5_Button _L_Button; - public UiNode_HBoxContainer2(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer2 Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public EditorTools_HBoxContainer2(EditorTools uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_HBoxContainer2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer7.Label /// - public class UiNode6_Label : IUiNode + public class EditorTools6_Label : UiNode { - public UiNode6_Label(Godot.Label node) : base(node) { } - public override UiNode6_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public EditorTools6_Label(EditorTools uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override EditorTools6_Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer7.Button /// - public class UiNode6_Button : IUiNode + public class EditorTools6_Button : UiNode { - public UiNode6_Button(Godot.Button node) : base(node) { } - public override UiNode6_Button Clone() => new ((Godot.Button)Instance.Duplicate()); + public EditorTools6_Button(EditorTools uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditorTools6_Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer7 /// - public class UiNode_HBoxContainer7 : IUiNode + public class EditorTools_HBoxContainer7 : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label /// - public UiNode6_Label L_Label + public EditorTools6_Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode6_Label(Instance.GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new EditorTools6_Label(UiPanel, Instance.GetNodeOrNull("Label")); return _L_Label; } } - private UiNode6_Label _L_Label; + private EditorTools6_Label _L_Label; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button /// - public UiNode6_Button L_Button + public EditorTools6_Button L_Button { get { - if (_L_Button == null) _L_Button = new UiNode6_Button(Instance.GetNodeOrNull("Button")); + if (_L_Button == null) _L_Button = new EditorTools6_Button(UiPanel, Instance.GetNodeOrNull("Button")); return _L_Button; } } - private UiNode6_Button _L_Button; + private EditorTools6_Button _L_Button; - public UiNode_HBoxContainer7(Godot.HBoxContainer node) : base(node) { } - public override UiNode_HBoxContainer7 Clone() => new ((Godot.HBoxContainer)Instance.Duplicate()); + public EditorTools_HBoxContainer7(EditorTools uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_HBoxContainer7 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer /// - public class UiNode_VBoxContainer : IUiNode + public class EditorTools_VBoxContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.HBoxContainer /// - public UiNode_HBoxContainer L_HBoxContainer + public EditorTools_HBoxContainer L_HBoxContainer { get { - if (_L_HBoxContainer == null) _L_HBoxContainer = new UiNode_HBoxContainer(Instance.GetNodeOrNull("HBoxContainer")); + if (_L_HBoxContainer == null) _L_HBoxContainer = new EditorTools_HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); return _L_HBoxContainer; } } - private UiNode_HBoxContainer _L_HBoxContainer; + private EditorTools_HBoxContainer _L_HBoxContainer; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.HBoxContainer3 /// - public UiNode_HBoxContainer3 L_HBoxContainer3 + public EditorTools_HBoxContainer3 L_HBoxContainer3 { get { - if (_L_HBoxContainer3 == null) _L_HBoxContainer3 = new UiNode_HBoxContainer3(Instance.GetNodeOrNull("HBoxContainer3")); + if (_L_HBoxContainer3 == null) _L_HBoxContainer3 = new EditorTools_HBoxContainer3(UiPanel, Instance.GetNodeOrNull("HBoxContainer3")); return _L_HBoxContainer3; } } - private UiNode_HBoxContainer3 _L_HBoxContainer3; + private EditorTools_HBoxContainer3 _L_HBoxContainer3; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.HBoxContainer4 /// - public UiNode_HBoxContainer4 L_HBoxContainer4 + public EditorTools_HBoxContainer4 L_HBoxContainer4 { get { - if (_L_HBoxContainer4 == null) _L_HBoxContainer4 = new UiNode_HBoxContainer4(Instance.GetNodeOrNull("HBoxContainer4")); + if (_L_HBoxContainer4 == null) _L_HBoxContainer4 = new EditorTools_HBoxContainer4(UiPanel, Instance.GetNodeOrNull("HBoxContainer4")); return _L_HBoxContainer4; } } - private UiNode_HBoxContainer4 _L_HBoxContainer4; + private EditorTools_HBoxContainer4 _L_HBoxContainer4; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.HBoxContainer5 /// - public UiNode_HBoxContainer5 L_HBoxContainer5 + public EditorTools_HBoxContainer5 L_HBoxContainer5 { get { - if (_L_HBoxContainer5 == null) _L_HBoxContainer5 = new UiNode_HBoxContainer5(Instance.GetNodeOrNull("HBoxContainer5")); + if (_L_HBoxContainer5 == null) _L_HBoxContainer5 = new EditorTools_HBoxContainer5(UiPanel, Instance.GetNodeOrNull("HBoxContainer5")); return _L_HBoxContainer5; } } - private UiNode_HBoxContainer5 _L_HBoxContainer5; + private EditorTools_HBoxContainer5 _L_HBoxContainer5; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.HBoxContainer6 /// - public UiNode_HBoxContainer6 L_HBoxContainer6 + public EditorTools_HBoxContainer6 L_HBoxContainer6 { get { - if (_L_HBoxContainer6 == null) _L_HBoxContainer6 = new UiNode_HBoxContainer6(Instance.GetNodeOrNull("HBoxContainer6")); + if (_L_HBoxContainer6 == null) _L_HBoxContainer6 = new EditorTools_HBoxContainer6(UiPanel, Instance.GetNodeOrNull("HBoxContainer6")); return _L_HBoxContainer6; } } - private UiNode_HBoxContainer6 _L_HBoxContainer6; + private EditorTools_HBoxContainer6 _L_HBoxContainer6; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.HBoxContainer2 /// - public UiNode_HBoxContainer2 L_HBoxContainer2 + public EditorTools_HBoxContainer2 L_HBoxContainer2 { get { - if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new UiNode_HBoxContainer2(Instance.GetNodeOrNull("HBoxContainer2")); + if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new EditorTools_HBoxContainer2(UiPanel, Instance.GetNodeOrNull("HBoxContainer2")); return _L_HBoxContainer2; } } - private UiNode_HBoxContainer2 _L_HBoxContainer2; + private EditorTools_HBoxContainer2 _L_HBoxContainer2; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.HBoxContainer7 /// - public UiNode_HBoxContainer7 L_HBoxContainer7 + public EditorTools_HBoxContainer7 L_HBoxContainer7 { get { - if (_L_HBoxContainer7 == null) _L_HBoxContainer7 = new UiNode_HBoxContainer7(Instance.GetNodeOrNull("HBoxContainer7")); + if (_L_HBoxContainer7 == null) _L_HBoxContainer7 = new EditorTools_HBoxContainer7(UiPanel, Instance.GetNodeOrNull("HBoxContainer7")); return _L_HBoxContainer7; } } - private UiNode_HBoxContainer7 _L_HBoxContainer7; + private EditorTools_HBoxContainer7 _L_HBoxContainer7; - public UiNode_VBoxContainer(Godot.VBoxContainer node) : base(node) { } - public override UiNode_VBoxContainer Clone() => new ((Godot.VBoxContainer)Instance.Duplicate()); + public EditorTools_VBoxContainer(EditorTools uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override EditorTools_VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer /// - public class UiNode_MarginContainer : IUiNode + public class EditorTools_MarginContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.VBoxContainer /// - public UiNode_VBoxContainer L_VBoxContainer + public EditorTools_VBoxContainer L_VBoxContainer { get { - if (_L_VBoxContainer == null) _L_VBoxContainer = new UiNode_VBoxContainer(Instance.GetNodeOrNull("VBoxContainer")); + if (_L_VBoxContainer == null) _L_VBoxContainer = new EditorTools_VBoxContainer(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); return _L_VBoxContainer; } } - private UiNode_VBoxContainer _L_VBoxContainer; + private EditorTools_VBoxContainer _L_VBoxContainer; - public UiNode_MarginContainer(Godot.MarginContainer node) : base(node) { } - public override UiNode_MarginContainer Clone() => new ((Godot.MarginContainer)Instance.Duplicate()); + public EditorTools_MarginContainer(EditorTools uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override EditorTools_MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.ScrollContainer /// - public class UiNode_ScrollContainer : IUiNode + public class EditorTools_ScrollContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.MarginContainer /// - public UiNode_MarginContainer L_MarginContainer + public EditorTools_MarginContainer L_MarginContainer { get { - if (_L_MarginContainer == null) _L_MarginContainer = new UiNode_MarginContainer(Instance.GetNodeOrNull("MarginContainer")); + if (_L_MarginContainer == null) _L_MarginContainer = new EditorTools_MarginContainer(UiPanel, Instance.GetNodeOrNull("MarginContainer")); return _L_MarginContainer; } } - private UiNode_MarginContainer _L_MarginContainer; + private EditorTools_MarginContainer _L_MarginContainer; - public UiNode_ScrollContainer(Godot.ScrollContainer node) : base(node) { } - public override UiNode_ScrollContainer Clone() => new ((Godot.ScrollContainer)Instance.Duplicate()); + public EditorTools_ScrollContainer(EditorTools uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override EditorTools_ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.Confirm /// - public class UiNode_Confirm : IUiNode + public class EditorTools_Confirm : UiNode { - public UiNode_Confirm(Godot.ConfirmationDialog node) : base(node) { } - public override UiNode_Confirm Clone() => new ((Godot.ConfirmationDialog)Instance.Duplicate()); + public EditorTools_Confirm(EditorTools uiPanel, Godot.ConfirmationDialog node) : base(uiPanel, node) { } + public override EditorTools_Confirm Clone() => new (UiPanel, (Godot.ConfirmationDialog)Instance.Duplicate()); } /// /// 类型: , 路径: EditorTools.Tips /// - public class UiNode_Tips : IUiNode + public class EditorTools_Tips : UiNode { - public UiNode_Tips(Godot.AcceptDialog node) : base(node) { } - public override UiNode_Tips Clone() => new ((Godot.AcceptDialog)Instance.Duplicate()); + public EditorTools_Tips(EditorTools uiPanel, Godot.AcceptDialog node) : base(uiPanel, node) { } + public override EditorTools_Tips Clone() => new (UiPanel, (Godot.AcceptDialog)Instance.Duplicate()); } + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer + /// + public EditorTools_HBoxContainer S_HBoxContainer => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer3.LineEdit + /// + public EditorTools_LineEdit S_LineEdit => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_LineEdit; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer3 + /// + public EditorTools_HBoxContainer3 S_HBoxContainer3 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer3; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer4 + /// + public EditorTools_HBoxContainer4 S_HBoxContainer4 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer4; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public EditorTools_HBoxContainer5 S_HBoxContainer5 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer5; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomNameInput + /// + public EditorTools_RoomNameInput S_RoomNameInput => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6.L_RoomNameInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Label2 + /// + public EditorTools_Label2 S_Label2 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6.L_Label2; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomGroupSelect + /// + public EditorTools_RoomGroupSelect S_RoomGroupSelect => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6.L_RoomGroupSelect; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Label3 + /// + public EditorTools_Label3 S_Label3 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6.L_Label3; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomTypeSelect + /// + public EditorTools_RoomTypeSelect S_RoomTypeSelect => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6.L_RoomTypeSelect; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6 + /// + public EditorTools_HBoxContainer6 S_HBoxContainer6 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer2 + /// + public EditorTools_HBoxContainer2 S_HBoxContainer2 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer2; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer7 + /// + public EditorTools_HBoxContainer7 S_HBoxContainer7 => L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer7; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer + /// + public EditorTools_VBoxContainer S_VBoxContainer => L_ScrollContainer.L_MarginContainer.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer + /// + public EditorTools_MarginContainer S_MarginContainer => L_ScrollContainer.L_MarginContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.ScrollContainer + /// + public EditorTools_ScrollContainer S_ScrollContainer => L_ScrollContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.Confirm + /// + public EditorTools_Confirm S_Confirm => L_Confirm; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorTools.Tips + /// + public EditorTools_Tips S_Tips => L_Tips; + } diff --git a/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs b/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs index 314c6a959bb7fc42a457dd85861a0fee04e92e4b..7e9eaf82831e76ecb311aeb8b155d99cd431024f 100644 --- a/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs @@ -116,9 +116,9 @@ public partial class EditorToolsPanel : EditorTools var dungeonRoomTypes = Enum.GetValues(); for (var i = 0; i < dungeonRoomTypes.Length; i++) { - var typeName = DungeonRoomTemplate.DungeonRoomTypeToString(dungeonRoomTypes[i]); + var typeName = DungeonManager.DungeonRoomTypeToString(dungeonRoomTypes[i]); var text = typeName + " (" + - DungeonRoomTemplate.DungeonRoomTypeToDescribeString(dungeonRoomTypes[i]) + ")"; + DungeonManager.DungeonRoomTypeToDescribeString(dungeonRoomTypes[i]) + ")"; select2.AddItem(text, i); _createRoomTypeValueMap.Add(i, typeName); } @@ -186,7 +186,7 @@ public partial class EditorToolsPanel : EditorTools /// 当窗口关闭时的回调 public void ShowTips(string title, string message, Action onClose = null) { - ShowTips(title, message, 200, 124, onClose); + ShowTips(title, message, 350, 200, onClose); } /// @@ -224,7 +224,7 @@ public partial class EditorToolsPanel : EditorTools /// 当窗口关闭时的回调, 参数如果为 true 表示点击了确定按钮 public void ShowConfirm(string title, string message, Action onClose = null) { - ShowConfirm(title, message, 200, 124, onClose); + ShowConfirm(title, message, 350, 200, onClose); } /// diff --git a/DungeonShooting_Godot/src/game/ui/editorWindow/CustomButtonCell.cs b/DungeonShooting_Godot/src/game/ui/editorWindow/CustomButtonCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..a03439e33e271aa554f0f3f2fad78369a4c44caa --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/editorWindow/CustomButtonCell.cs @@ -0,0 +1,27 @@ +namespace UI.EditorWindow; + +public class CustomButtonCell : UiCell +{ + public override void OnInit() + { + CellNode.L_Button.Instance.Pressed += Click; + } + + public override void OnSetData(EditorWindowPanel.ButtonData data) + { + CellNode.L_Button.Instance.Text = data.Text; + } + + public override void OnDestroy() + { + CellNode.L_Button.Instance.Pressed -= OnClick; + } + + public override void OnClick() + { + if (Data.Callback != null) + { + Data.Callback(); + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindow.cs b/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindow.cs new file mode 100644 index 0000000000000000000000000000000000000000..5a6f77f6e8705b052e5b5b76b8c9479d29bd96f7 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindow.cs @@ -0,0 +1,234 @@ +namespace UI.EditorWindow; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class EditorWindow : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Bg + /// + public Bg L_Bg + { + get + { + if (_L_Bg == null) _L_Bg = new Bg(this, GetNodeOrNull("Bg")); + return _L_Bg; + } + } + private Bg _L_Bg; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Window + /// + public Window L_Window + { + get + { + if (_L_Window == null) _L_Window = new Window(this, GetNodeOrNull("Window")); + return _L_Window; + } + } + private Window _L_Window; + + + public EditorWindow() : base(nameof(EditorWindow)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: EditorWindow.Bg + /// + public class Bg : UiNode + { + public Bg(EditorWindow uiPanel, Godot.ColorRect node) : base(uiPanel, node) { } + public override Bg Clone() => new (UiPanel, (Godot.ColorRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorWindow.Window.Panel.VBoxContainer.Body + /// + public class Body : UiNode + { + public Body(EditorWindow uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override Body Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorWindow.Window.Panel.VBoxContainer.HBoxContainer.CustomButton.Button + /// + public class Button : UiNode + { + public Button(EditorWindow uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorWindow.Window.Panel.VBoxContainer.HBoxContainer.CustomButton + /// + public class CustomButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Window.Panel.VBoxContainer.HBoxContainer.Button + /// + public Button L_Button + { + get + { + if (_L_Button == null) _L_Button = new Button(UiPanel, Instance.GetNodeOrNull("Button")); + return _L_Button; + } + } + private Button _L_Button; + + public CustomButton(EditorWindow uiPanel, Godot.CenterContainer node) : base(uiPanel, node) { } + public override CustomButton Clone() => new (UiPanel, (Godot.CenterContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorWindow.Window.Panel.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Window.Panel.VBoxContainer.CustomButton + /// + public CustomButton L_CustomButton + { + get + { + if (_L_CustomButton == null) _L_CustomButton = new CustomButton(UiPanel, Instance.GetNodeOrNull("CustomButton")); + return _L_CustomButton; + } + } + private CustomButton _L_CustomButton; + + public HBoxContainer(EditorWindow uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorWindow.Window.Panel.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Window.Panel.Body + /// + public Body L_Body + { + get + { + if (_L_Body == null) _L_Body = new Body(UiPanel, Instance.GetNodeOrNull("Body")); + return _L_Body; + } + } + private Body _L_Body; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Window.Panel.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + public VBoxContainer(EditorWindow uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorWindow.Window.Panel + /// + public class Panel : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Window.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public Panel(EditorWindow uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Panel Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorWindow.Window + /// + public class Window : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorWindow.Panel + /// + public Panel L_Panel + { + get + { + if (_L_Panel == null) _L_Panel = new Panel(UiPanel, Instance.GetNodeOrNull("Panel")); + return _L_Panel; + } + } + private Panel _L_Panel; + + public Window(EditorWindow uiPanel, Godot.Window node) : base(uiPanel, node) { } + public override Window Clone() => new (UiPanel, (Godot.Window)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Bg + /// + public Bg S_Bg => L_Bg; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Window.Panel.VBoxContainer.Body + /// + public Body S_Body => L_Window.L_Panel.L_VBoxContainer.L_Body; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Window.Panel.VBoxContainer.HBoxContainer.CustomButton.Button + /// + public Button S_Button => L_Window.L_Panel.L_VBoxContainer.L_HBoxContainer.L_CustomButton.L_Button; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Window.Panel.VBoxContainer.HBoxContainer.CustomButton + /// + public CustomButton S_CustomButton => L_Window.L_Panel.L_VBoxContainer.L_HBoxContainer.L_CustomButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Window.Panel.VBoxContainer.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_Window.L_Panel.L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Window.Panel.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_Window.L_Panel.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Window.Panel + /// + public Panel S_Panel => L_Window.L_Panel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorWindow.Window + /// + public Window S_Window => L_Window; + +} diff --git a/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindowPanel.cs b/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindowPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..6e1761b358dc8f296e09287190bf6e26f7fa37af --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/editorWindow/EditorWindowPanel.cs @@ -0,0 +1,116 @@ +using System; +using Godot; + +namespace UI.EditorWindow; + +public partial class EditorWindowPanel : EditorWindow +{ + + public class ButtonData + { + /// + /// 显示文本 + /// + public string Text; + /// + /// 点击的回调 + /// + public Action Callback; + + public ButtonData(string text, Action callback) + { + Text = text; + Callback = callback; + } + } + + /// + /// 关闭窗口时回调 + /// + public event Action CloseEvent; + + private UiGrid _uiGrid; + + public override void OnCreateUi() + { + S_CustomButton.Instance.Visible = false; + S_Window.Instance.CloseRequested += OnCloseWindow; + } + + /// + /// 设置自定义按钮 + /// + public void SetButtonList(params ButtonData[] buttons) + { + if (_uiGrid == null) + { + S_CustomButton.Instance.Visible = true; + _uiGrid = new UiGrid(S_CustomButton, typeof(CustomButtonCell)); + _uiGrid.SetHorizontalExpand(true); + } + _uiGrid.SetColumns(buttons.Length); + _uiGrid.SetDataList(buttons); + } + + /// + /// 打开子Ui并放入 Body 节点中 + /// + /// Ui名称 + public UiBase OpenBody(string uiName) + { + var nestedUi = S_Body.OpenNestedUi(uiName); + S_Window.Instance.Popup(); + return nestedUi; + } + + /// + /// 打开子Ui并放入 Body 节点中 + /// + /// Ui名称 + public T OpenBody(string uiName) where T : UiBase + { + return (T)OpenBody(uiName); + } + + /// + /// 设置标题 + /// + public void SetWindowTitle(string title) + { + S_Window.Instance.Title = title; + } + + /// + /// 设置窗体大小 + /// + public void SetWindowSize(Vector2I size) + { + S_Window.Instance.Size = size; + } + + /// + /// 设置窗体最小大小 + /// + public void SetWindowMinSize(Vector2I size) + { + S_Window.Instance.MinSize = size; + } + + /// + /// 关闭窗口 + /// + /// 是否派发关闭窗口的事件 + public void CloseWindow(bool triggerEvent = true) + { + if (triggerEvent && CloseEvent != null) + { + CloseEvent(); + } + Destroy(); + } + + private void OnCloseWindow() + { + CloseWindow(); + } +} diff --git a/DungeonShooting_Godot/src/game/ui/loading/Loading.cs b/DungeonShooting_Godot/src/game/ui/loading/Loading.cs index 22bfc38e090ca806e3708d4b274f2baba2b9906e..7f2fe7a53bd117d9defe79d55654d372adabda63 100644 --- a/DungeonShooting_Godot/src/game/ui/loading/Loading.cs +++ b/DungeonShooting_Godot/src/game/ui/loading/Loading.cs @@ -8,50 +8,65 @@ public abstract partial class Loading : UiBase /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Loading.ColorRect /// - public UiNode_ColorRect L_ColorRect + public ColorRect L_ColorRect { get { - if (_L_ColorRect == null) _L_ColorRect = new UiNode_ColorRect(GetNodeOrNull("ColorRect")); + if (_L_ColorRect == null) _L_ColorRect = new ColorRect(this, GetNodeOrNull("ColorRect")); return _L_ColorRect; } } - private UiNode_ColorRect _L_ColorRect; + private ColorRect _L_ColorRect; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Loading.Label /// - public UiNode_Label L_Label + public Label L_Label { get { - if (_L_Label == null) _L_Label = new UiNode_Label(GetNodeOrNull("Label")); + if (_L_Label == null) _L_Label = new Label(this, GetNodeOrNull("Label")); return _L_Label; } } - private UiNode_Label _L_Label; + private Label _L_Label; public Loading() : base(nameof(Loading)) { } + public sealed override void OnInitNestedUi() + { + } + /// /// 类型: , 路径: Loading.ColorRect /// - public class UiNode_ColorRect : IUiNode + public class ColorRect : UiNode { - public UiNode_ColorRect(Godot.ColorRect node) : base(node) { } - public override UiNode_ColorRect Clone() => new ((Godot.ColorRect)Instance.Duplicate()); + public ColorRect(Loading uiPanel, Godot.ColorRect node) : base(uiPanel, node) { } + public override ColorRect Clone() => new (UiPanel, (Godot.ColorRect)Instance.Duplicate()); } /// /// 类型: , 路径: Loading.Label /// - public class UiNode_Label : IUiNode + public class Label : UiNode { - public UiNode_Label(Godot.Label node) : base(node) { } - public override UiNode_Label Clone() => new ((Godot.Label)Instance.Duplicate()); + public Label(Loading uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Loading.ColorRect + /// + public ColorRect S_ColorRect => L_ColorRect; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Loading.Label + /// + public Label S_Label => L_Label; + } diff --git a/DungeonShooting_Godot/src/game/ui/loading/LoadingPanel.cs b/DungeonShooting_Godot/src/game/ui/loading/LoadingPanel.cs index 50d070e34928c4fe3dbaaeaabda282485d7e34b2..872e5c04d0cf37156be9afc8303327b82263fe54 100644 --- a/DungeonShooting_Godot/src/game/ui/loading/LoadingPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/loading/LoadingPanel.cs @@ -8,14 +8,4 @@ namespace UI.Loading; public partial class LoadingPanel : Loading { - public override void OnShowUi() - { - - } - - public override void OnHideUi() - { - - } - } diff --git a/DungeonShooting_Godot/src/game/ui/main/Main.cs b/DungeonShooting_Godot/src/game/ui/main/Main.cs index 0c77b81c96904d81508b51ff407cd2179a9f8bec..fe49dfb2c1348fdf8e8faddc4b1dcec01fa09709 100644 --- a/DungeonShooting_Godot/src/game/ui/main/Main.cs +++ b/DungeonShooting_Godot/src/game/ui/main/Main.cs @@ -8,41 +8,41 @@ public abstract partial class Main : UiBase /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Title /// - public UiNode_Title L_Title + public Main_Title L_Title { get { - if (_L_Title == null) _L_Title = new UiNode_Title(GetNodeOrNull("Title")); + if (_L_Title == null) _L_Title = new Main_Title(this, GetNodeOrNull("Title")); return _L_Title; } } - private UiNode_Title _L_Title; + private Main_Title _L_Title; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.ButtonList /// - public UiNode_ButtonList L_ButtonList + public Main_ButtonList L_ButtonList { get { - if (_L_ButtonList == null) _L_ButtonList = new UiNode_ButtonList(GetNodeOrNull("ButtonList")); + if (_L_ButtonList == null) _L_ButtonList = new Main_ButtonList(this, GetNodeOrNull("ButtonList")); return _L_ButtonList; } } - private UiNode_ButtonList _L_ButtonList; + private Main_ButtonList _L_ButtonList; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Version /// - public UiNode_Version L_Version + public Main_Version L_Version { get { - if (_L_Version == null) _L_Version = new UiNode_Version(GetNodeOrNull("Version")); + if (_L_Version == null) _L_Version = new Main_Version(this, GetNodeOrNull("Version")); return _L_Version; } } - private UiNode_Version _L_Version; + private Main_Version _L_Version; public Main() : base(nameof(Main)) @@ -52,94 +52,152 @@ public abstract partial class Main : UiBase /// /// 类型: , 路径: Main.Title /// - public class UiNode_Title : IUiNode + public class Main_Title : UiNode { - public UiNode_Title(Godot.Label node) : base(node) { } - public override UiNode_Title Clone() => new ((Godot.Label)Instance.Duplicate()); + public Main_Title(Main uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Main_Title Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList.Start /// - public class UiNode_Start : IUiNode + public class Main_Start : UiNode { - public UiNode_Start(Godot.Button node) : base(node) { } - public override UiNode_Start Clone() => new ((Godot.Button)Instance.Duplicate()); + public Main_Start(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Main_Start Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: Main.ButtonList.Tools + /// + public class Main_Tools : UiNode + { + public Main_Tools(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Main_Tools Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList.Setting /// - public class UiNode_Setting : IUiNode + public class Main_Setting : UiNode { - public UiNode_Setting(Godot.Button node) : base(node) { } - public override UiNode_Setting Clone() => new ((Godot.Button)Instance.Duplicate()); + public Main_Setting(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Main_Setting Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList.Exit /// - public class UiNode_Exit : IUiNode + public class Main_Exit : UiNode { - public UiNode_Exit(Godot.Button node) : base(node) { } - public override UiNode_Exit Clone() => new ((Godot.Button)Instance.Duplicate()); + public Main_Exit(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Main_Exit Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList /// - public class UiNode_ButtonList : IUiNode + public class Main_ButtonList : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Start /// - public UiNode_Start L_Start + public Main_Start L_Start { get { - if (_L_Start == null) _L_Start = new UiNode_Start(Instance.GetNodeOrNull("Start")); + if (_L_Start == null) _L_Start = new Main_Start(UiPanel, Instance.GetNodeOrNull("Start")); return _L_Start; } } - private UiNode_Start _L_Start; + private Main_Start _L_Start; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Tools + /// + public Main_Tools L_Tools + { + get + { + if (_L_Tools == null) _L_Tools = new Main_Tools(UiPanel, Instance.GetNodeOrNull("Tools")); + return _L_Tools; + } + } + private Main_Tools _L_Tools; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Setting /// - public UiNode_Setting L_Setting + public Main_Setting L_Setting { get { - if (_L_Setting == null) _L_Setting = new UiNode_Setting(Instance.GetNodeOrNull("Setting")); + if (_L_Setting == null) _L_Setting = new Main_Setting(UiPanel, Instance.GetNode("Setting")); return _L_Setting; } } - private UiNode_Setting _L_Setting; + private Main_Setting _L_Setting; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Exit /// - public UiNode_Exit L_Exit + public Main_Exit L_Exit { get { - if (_L_Exit == null) _L_Exit = new UiNode_Exit(Instance.GetNodeOrNull("Exit")); + if (_L_Exit == null) _L_Exit = new Main_Exit(UiPanel, Instance.GetNodeOrNull("Exit")); return _L_Exit; } } - private UiNode_Exit _L_Exit; + private Main_Exit _L_Exit; - public UiNode_ButtonList(Godot.VBoxContainer node) : base(node) { } - public override UiNode_ButtonList Clone() => new ((Godot.VBoxContainer)Instance.Duplicate()); + public Main_ButtonList(Main uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override Main_ButtonList Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: Main.Version /// - public class UiNode_Version : IUiNode + public class Main_Version : UiNode { - public UiNode_Version(Godot.Label node) : base(node) { } - public override UiNode_Version Clone() => new ((Godot.Label)Instance.Duplicate()); + public Main_Version(Main uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Main_Version Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.Title + /// + public Main_Title S_Title => L_Title; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Start + /// + public Main_Start S_Start => L_ButtonList.L_Start; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Tools + /// + public Main_Tools S_Tools => L_ButtonList.L_Tools; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Setting + /// + public Main_Setting S_Setting => L_ButtonList.L_Setting; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Exit + /// + public Main_Exit S_Exit => L_ButtonList.L_Exit; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList + /// + public Main_ButtonList S_ButtonList => L_ButtonList; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.Version + /// + public Main_Version S_Version => L_Version; + } diff --git a/DungeonShooting_Godot/src/game/ui/main/MainPanel.cs b/DungeonShooting_Godot/src/game/ui/main/MainPanel.cs index fd5222f39bed6c373ac2e15980fea8d325ed3b69..7435ea47793563240f79195976dc5042ac750fa2 100644 --- a/DungeonShooting_Godot/src/game/ui/main/MainPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/main/MainPanel.cs @@ -8,24 +8,28 @@ namespace UI.Main; public partial class MainPanel : Main { - public override void OnShowUi() + public override void OnCreateUi() { - L_ButtonList.L_Start.Instance.Pressed += OnStartGameClick; - L_ButtonList.L_Exit.Instance.Pressed += OnExitClick; + S_Start.Instance.Pressed += OnStartGameClick; + S_Exit.Instance.Pressed += OnExitClick; + S_Tools.Instance.Pressed += OnToolsClick; } - - public override void OnHideUi() - { - L_ButtonList.L_Start.Instance.Pressed -= OnStartGameClick; - L_ButtonList.L_Exit.Instance.Pressed -= OnExitClick; - } - - + //点击开始游戏 private void OnStartGameClick() { - GameApplication.Instance.DungeonManager.LoadDungeon(GameApplication.Instance.DungeonConfig); - HideUi(); + //验证该组是否满足生成地牢的条件 + var config = GameApplication.Instance.DungeonConfig; + var result = DungeonManager.CheckDungeon(config.GroupName); + if (result.HasError) + { + EditorWindowManager.ShowTips("警告", "当前组'" + config.GroupName + "'" + result.ErrorMessage + ", 不能生成地牢!"); + } + else + { + GameApplication.Instance.DungeonManager.LoadDungeon(config); + HideUi(); + } } //退出游戏 @@ -33,4 +37,10 @@ public partial class MainPanel : Main { GetTree().Quit(); } + + //点击开发者工具 + private void OnToolsClick() + { + OpenNextUi(UiManager.UiName.MapEditorProject); + } } diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs new file mode 100644 index 0000000000000000000000000000000000000000..01274adbc2bb968c13ac489fd42eb9887d04fce1 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs @@ -0,0 +1,775 @@ +namespace UI.MapEditor; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditor : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg + /// + public Bg L_Bg + { + get + { + if (_L_Bg == null) _L_Bg = new Bg((MapEditorPanel)this, GetNode("Bg")); + return _L_Bg; + } + } + private Bg _L_Bg; + + + public MapEditor() : base(nameof(MapEditor)) + { + } + + public sealed override void OnInitNestedUi() + { + _ = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_TileMap; + + var inst1 = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_CanvasLayer; + RecordNestedUi(inst1.L_MapEditorTools.Instance, inst1, UiManager.RecordType.Open); + inst1.L_MapEditorTools.Instance.OnCreateUi(); + inst1.L_MapEditorTools.Instance.OnInitNestedUi(); + + var inst2 = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer; + RecordNestedUi(inst2.L_MapEditorMapLayer.Instance, inst2, UiManager.RecordType.Open); + inst2.L_MapEditorMapLayer.Instance.OnCreateUi(); + inst2.L_MapEditorMapLayer.Instance.OnInitNestedUi(); + + var inst3 = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark; + RecordNestedUi(inst3.L_MapEditorMapMark.Instance, inst3, UiManager.RecordType.Open); + inst3.L_MapEditorMapMark.Instance.OnCreateUi(); + inst3.L_MapEditorMapMark.Instance.OnInitNestedUi(); + + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.Head.Back + /// + public class Back : UiNode + { + public Back(MapEditorPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Back Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.Head.Save + /// + public class Save : UiNode + { + public Save(MapEditorPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Save Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.Head.Title + /// + public class Title : UiNode + { + public Title(MapEditorPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Title Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.Head.Play + /// + public class Play : UiNode + { + public Play(MapEditorPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Play Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.Head.PlaySetting + /// + public class PlaySetting : UiNode + { + public PlaySetting(MapEditorPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override PlaySetting Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.Head + /// + public class Head : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Back + /// + public Back L_Back + { + get + { + if (_L_Back == null) _L_Back = new Back(UiPanel, Instance.GetNode("Back")); + return _L_Back; + } + } + private Back _L_Back; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Save + /// + public Save L_Save + { + get + { + if (_L_Save == null) _L_Save = new Save(UiPanel, Instance.GetNode("Save")); + return _L_Save; + } + } + private Save _L_Save; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Title + /// + public Title L_Title + { + get + { + if (_L_Title == null) _L_Title = new Title(UiPanel, Instance.GetNode("Title")); + return _L_Title; + } + } + private Title _L_Title; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Play + /// + public Play L_Play + { + get + { + if (_L_Play == null) _L_Play = new Play(UiPanel, Instance.GetNode("Play")); + return _L_Play; + } + } + private Play _L_Play; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.PlaySetting + /// + public PlaySetting L_PlaySetting + { + get + { + if (_L_PlaySetting == null) _L_PlaySetting = new PlaySetting(UiPanel, Instance.GetNode("PlaySetting")); + return _L_PlaySetting; + } + } + private PlaySetting _L_PlaySetting; + + public Head(MapEditorPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Head Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap.ErrorCell.ErrorCellAnimationPlayer + /// + public class ErrorCellAnimationPlayer : UiNode + { + public ErrorCellAnimationPlayer(MapEditorPanel uiPanel, Godot.AnimationPlayer node) : base(uiPanel, node) { } + public override ErrorCellAnimationPlayer Clone() => new (UiPanel, (Godot.AnimationPlayer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap.ErrorCell + /// + public class ErrorCell : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap.ErrorCellAnimationPlayer + /// + public ErrorCellAnimationPlayer L_ErrorCellAnimationPlayer + { + get + { + if (_L_ErrorCellAnimationPlayer == null) _L_ErrorCellAnimationPlayer = new ErrorCellAnimationPlayer(UiPanel, Instance.GetNode("ErrorCellAnimationPlayer")); + return _L_ErrorCellAnimationPlayer; + } + } + private ErrorCellAnimationPlayer _L_ErrorCellAnimationPlayer; + + public ErrorCell(MapEditorPanel uiPanel, Godot.Sprite2D node) : base(uiPanel, node) { } + public override ErrorCell Clone() => new (UiPanel, (Godot.Sprite2D)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap.Brush + /// + public class Brush : UiNode + { + public Brush(MapEditorPanel uiPanel, Godot.Node2D node) : base(uiPanel, node) { } + public override Brush Clone() => new (UiPanel, (Godot.Node2D)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap + /// + public class TileMap : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.ErrorCell + /// + public ErrorCell L_ErrorCell + { + get + { + if (_L_ErrorCell == null) _L_ErrorCell = new ErrorCell(UiPanel, Instance.GetNode("ErrorCell")); + return _L_ErrorCell; + } + } + private ErrorCell _L_ErrorCell; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.Brush + /// + public Brush L_Brush + { + get + { + if (_L_Brush == null) _L_Brush = new Brush(UiPanel, Instance.GetNode("Brush")); + return _L_Brush; + } + } + private Brush _L_Brush; + + public TileMap(MapEditorPanel uiPanel, UI.MapEditor.EditorTileMap node) : base(uiPanel, node) { } + public override TileMap Clone() => new (UiPanel, (UI.MapEditor.EditorTileMap)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.CanvasLayer.MapEditorTools + /// + public class MapEditorTools : UiNode + { + public MapEditorTools(MapEditorPanel uiPanel, UI.MapEditorTools.MapEditorToolsPanel node) : base(uiPanel, node) { } + public override MapEditorTools Clone() + { + var uiNode = new MapEditorTools(UiPanel, (UI.MapEditorTools.MapEditorToolsPanel)Instance.Duplicate()); + UiPanel.RecordNestedUi(uiNode.Instance, this, UiManager.RecordType.Open); + uiNode.Instance.OnCreateUi(); + uiNode.Instance.OnInitNestedUi(); + return uiNode; + } + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.CanvasLayer + /// + public class CanvasLayer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.MapEditorTools + /// + public MapEditorTools L_MapEditorTools + { + get + { + if (_L_MapEditorTools == null) _L_MapEditorTools = new MapEditorTools(UiPanel, Instance.GetNode("MapEditorTools")); + return _L_MapEditorTools; + } + } + private MapEditorTools _L_MapEditorTools; + + public CanvasLayer(MapEditorPanel uiPanel, Godot.CanvasLayer node) : base(uiPanel, node) { } + public override CanvasLayer Clone() => new (UiPanel, (Godot.CanvasLayer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport + /// + public class SubViewport : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.TileMap + /// + public TileMap L_TileMap + { + get + { + if (_L_TileMap == null) _L_TileMap = new TileMap(UiPanel, Instance.GetNode("TileMap")); + return _L_TileMap; + } + } + private TileMap _L_TileMap; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.CanvasLayer + /// + public CanvasLayer L_CanvasLayer + { + get + { + if (_L_CanvasLayer == null) _L_CanvasLayer = new CanvasLayer(UiPanel, Instance.GetNode("CanvasLayer")); + return _L_CanvasLayer; + } + } + private CanvasLayer _L_CanvasLayer; + + public SubViewport(MapEditorPanel uiPanel, Godot.SubViewport node) : base(uiPanel, node) { } + public override SubViewport Clone() => new (UiPanel, (Godot.SubViewport)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView + /// + public class MapView : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.SubViewport + /// + public SubViewport L_SubViewport + { + get + { + if (_L_SubViewport == null) _L_SubViewport = new SubViewport(UiPanel, Instance.GetNode("SubViewport")); + return _L_SubViewport; + } + } + private SubViewport _L_SubViewport; + + public MapView(MapEditorPanel uiPanel, Godot.SubViewportContainer node) : base(uiPanel, node) { } + public override MapView Clone() => new (UiPanel, (Godot.SubViewportContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: 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 + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MapView + /// + public MapView L_MapView + { + get + { + if (_L_MapView == null) _L_MapView = new MapView(UiPanel, Instance.GetNode("MapView")); + return _L_MapView; + } + } + 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()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left + /// + public class Left : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(UiPanel, Instance.GetNode("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + public Left(MapEditorPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Left Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.MapEditorMapLayer + /// + public class MapEditorMapLayer : UiNode + { + public MapEditorMapLayer(MapEditorPanel uiPanel, UI.MapEditorMapLayer.MapEditorMapLayerPanel node) : base(uiPanel, node) { } + public override MapEditorMapLayer Clone() + { + var uiNode = new MapEditorMapLayer(UiPanel, (UI.MapEditorMapLayer.MapEditorMapLayerPanel)Instance.Duplicate()); + UiPanel.RecordNestedUi(uiNode.Instance, this, UiManager.RecordType.Open); + uiNode.Instance.OnCreateUi(); + uiNode.Instance.OnInitNestedUi(); + return uiNode; + } + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer + /// + public class MapLayer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapEditorMapLayer + /// + public MapEditorMapLayer L_MapEditorMapLayer + { + get + { + if (_L_MapEditorMapLayer == null) _L_MapEditorMapLayer = new MapEditorMapLayer(UiPanel, Instance.GetNode("MapEditorMapLayer")); + return _L_MapEditorMapLayer; + } + } + private MapEditorMapLayer _L_MapEditorMapLayer; + + public MapLayer(MapEditorPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MapLayer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark.MapEditorMapMark + /// + public class MapEditorMapMark : UiNode + { + public MapEditorMapMark(MapEditorPanel uiPanel, UI.MapEditorMapMark.MapEditorMapMarkPanel node) : base(uiPanel, node) { } + public override MapEditorMapMark Clone() + { + var uiNode = new MapEditorMapMark(UiPanel, (UI.MapEditorMapMark.MapEditorMapMarkPanel)Instance.Duplicate()); + UiPanel.RecordNestedUi(uiNode.Instance, this, UiManager.RecordType.Open); + uiNode.Instance.OnCreateUi(); + uiNode.Instance.OnInitNestedUi(); + return uiNode; + } + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark + /// + public class MapMark : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapEditorMapMark + /// + public MapEditorMapMark L_MapEditorMapMark + { + get + { + if (_L_MapEditorMapMark == null) _L_MapEditorMapMark = new MapEditorMapMark(UiPanel, Instance.GetNode("MapEditorMapMark")); + return _L_MapEditorMapMark; + } + } + private MapEditorMapMark _L_MapEditorMapMark; + + public MapMark(MapEditorPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MapMark Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer + /// + public class TabContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.MapLayer + /// + public MapLayer L_MapLayer + { + get + { + if (_L_MapLayer == null) _L_MapLayer = new MapLayer(UiPanel, Instance.GetNode("MapLayer")); + return _L_MapLayer; + } + } + private MapLayer _L_MapLayer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.MapMark + /// + public MapMark L_MapMark + { + get + { + if (_L_MapMark == null) _L_MapMark = new MapMark(UiPanel, Instance.GetNode("MapMark")); + return _L_MapMark; + } + } + private MapMark _L_MapMark; + + public TabContainer(MapEditorPanel uiPanel, Godot.TabContainer node) : base(uiPanel, node) { } + public override TabContainer Clone() => new (UiPanel, (Godot.TabContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer + /// + public class MarginContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.TabContainer + /// + public TabContainer L_TabContainer + { + get + { + if (_L_TabContainer == null) _L_TabContainer = new TabContainer(UiPanel, Instance.GetNode("TabContainer")); + return _L_TabContainer; + } + } + private TabContainer _L_TabContainer; + + public MarginContainer_1(MapEditorPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer_1 Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right + /// + public class Right : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.MarginContainer + /// + public MarginContainer_1 L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer_1(UiPanel, Instance.GetNode("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer_1 _L_MarginContainer; + + public Right(MapEditorPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Right Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer + /// + public class HSplitContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Left + /// + public Left L_Left + { + get + { + if (_L_Left == null) _L_Left = new Left(UiPanel, Instance.GetNode("Left")); + return _L_Left; + } + } + private Left _L_Left; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Right + /// + public Right L_Right + { + get + { + if (_L_Right == null) _L_Right = new Right(UiPanel, Instance.GetNode("Right")); + return _L_Right; + } + } + private Right _L_Right; + + public HSplitContainer(MapEditorPanel uiPanel, Godot.HSplitContainer node) : base(uiPanel, node) { } + public override HSplitContainer Clone() => new (UiPanel, (Godot.HSplitContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.Head + /// + public Head L_Head + { + get + { + if (_L_Head == null) _L_Head = new Head(UiPanel, Instance.GetNode("Head")); + return _L_Head; + } + } + private Head _L_Head; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.HSplitContainer + /// + public HSplitContainer L_HSplitContainer + { + get + { + if (_L_HSplitContainer == null) _L_HSplitContainer = new HSplitContainer(UiPanel, Instance.GetNode("HSplitContainer")); + return _L_HSplitContainer; + } + } + private HSplitContainer _L_HSplitContainer; + + public VBoxContainer(MapEditorPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg + /// + public class Bg : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public Bg(MapEditorPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Bg Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Head.Back + /// + public Back S_Back => L_Bg.L_VBoxContainer.L_Head.L_Back; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Head.Save + /// + public Save S_Save => L_Bg.L_VBoxContainer.L_Head.L_Save; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Head.Title + /// + public Title S_Title => L_Bg.L_VBoxContainer.L_Head.L_Title; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Head.Play + /// + public Play S_Play => L_Bg.L_VBoxContainer.L_Head.L_Play; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Head.PlaySetting + /// + public PlaySetting S_PlaySetting => L_Bg.L_VBoxContainer.L_Head.L_PlaySetting; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.Head + /// + public Head S_Head => L_Bg.L_VBoxContainer.L_Head; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap.ErrorCell.ErrorCellAnimationPlayer + /// + public ErrorCellAnimationPlayer S_ErrorCellAnimationPlayer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_TileMap.L_ErrorCell.L_ErrorCellAnimationPlayer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap.ErrorCell + /// + public ErrorCell S_ErrorCell => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_TileMap.L_ErrorCell; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap.Brush + /// + public Brush S_Brush => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_TileMap.L_Brush; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.TileMap + /// + public TileMap S_TileMap => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_TileMap; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.CanvasLayer.MapEditorTools + /// + public MapEditorTools S_MapEditorTools => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_CanvasLayer.L_MapEditorTools; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport.CanvasLayer + /// + public CanvasLayer S_CanvasLayer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport.L_CanvasLayer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView.SubViewport + /// + public SubViewport S_SubViewport => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left.L_MarginContainer.L_MapView.L_SubViewport; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Left.MarginContainer.MapView + /// + 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; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.MapEditorMapLayer + /// + public MapEditorMapLayer S_MapEditorMapLayer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_MapEditorMapLayer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer + /// + public MapLayer S_MapLayer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark.MapEditorMapMark + /// + public MapEditorMapMark S_MapEditorMapMark => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark.L_MapEditorMapMark; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark + /// + public MapMark S_MapMark => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer + /// + public TabContainer S_TabContainer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right + /// + public Right S_Right => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer + /// + public HSplitContainer S_HSplitContainer => L_Bg.L_VBoxContainer.L_HSplitContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_Bg.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg + /// + public Bg S_Bg => L_Bg; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..c5bc77916ce9632f2ddca9886ffa34511b0f4a70 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs @@ -0,0 +1,248 @@ +using Godot; + +namespace UI.MapEditor; + +public partial class MapEditorPanel : MapEditor +{ + private class CheckResult + { + /// + /// 是否存在错误 + /// + public bool HasError; + /// + /// 房间异常类型 + /// + public RoomErrorType ErrorType; + + public CheckResult(bool hasError, RoomErrorType errorType) + { + HasError = hasError; + ErrorType = errorType; + } + } + + private string _title; + + public override void OnCreateUi() + { + S_TabContainer.Instance.SetTabTitle(0, "地图"); + S_TabContainer.Instance.SetTabTitle(1, "对象"); + //S_MapLayer.Instance.Init(S_MapLayer); + S_Left.Instance.Resized += OnMapViewResized; + S_Back.Instance.Pressed += OnBackClick; + S_Save.Instance.Pressed += OnSave; + S_Play.Instance.Pressed += OnPlay; + } + + public override void OnShowUi() + { + OnMapViewResized(); + } + + public override void OnDestroyUi() + { + //清除选中的标记 + EditorManager.SetSelectMark(null); + //清除选中的波 + EditorManager.SetSelectWaveIndex(-1); + //清除选中的预设 + EditorManager.SetSelectPreinstallIndex(-1); + } + + //点击播放按钮 + private void OnPlay() + { + S_TileMap.Instance.TryRunCheckHandler(); + var check = CheckError(); + //有错误数据 + if (check.HasError) + { + EditorWindowManager.ShowTips("提示", EditorManager.GetRoomErrorTypeMessage(check.ErrorType) + ",不能运行房间!"); + return; + } + //保存数据 + S_TileMap.Instance.TriggerSave(RoomErrorType.None, () => + { + var groupName = EditorManager.SelectDungeonGroup.GroupName; + var result = DungeonManager.CheckDungeon(groupName); + if (result.HasError) + { + EditorWindowManager.ShowTips("警告", "当前组'" + groupName + "'" + result.ErrorMessage + ", 不能生成地牢!"); + } + else + { + //执行运行 + EditorPlayManager.Play(this); + } + }); + } + + /// + /// 加载地牢, 返回是否加载成功 + /// + public bool LoadMap(DungeonRoomSplit roomSplit) + { + _title = "正在编辑:" + roomSplit.RoomInfo.RoomName; + S_Title.Instance.Text = _title; + var loadMap = S_TileMap.Instance.Load(roomSplit); + S_MapEditorMapMark.Instance.RefreshPreinstallSelect(); + return loadMap; + } + + /// + /// 设置标题是否带 * + /// + public void SetTitleDirty(bool value) + { + if (value) + { + S_Title.Instance.Text = _title + "*"; + } + else + { + S_Title.Instance.Text = _title; + } + } + + //调整地图显示区域大小 + private void OnMapViewResized() + { + S_SubViewport.Instance.Size = S_Left.Instance.Size.AsVector2I() - new Vector2I(4, 4); + } + + //保存地图数据 + private void OnSave() + { + S_TileMap.Instance.TryRunCheckHandler(); + var check = CheckError(); + //有错误的数据 + if (check.HasError) + { + EditorWindowManager.ShowConfirm("提示", EditorManager.GetRoomErrorTypeMessage(check.ErrorType) + ",如果现在保存并退出,运行游戏将不会刷出该房间!\n是否仍要保存?", (v) => + { + if (v) + { + S_TileMap.Instance.TriggerSave(check.ErrorType, null); + } + }); + } + else + { + S_TileMap.Instance.TriggerSave(check.ErrorType, null); + } + } + + //点击返回 + private void OnBackClick() + { + S_TileMap.Instance.TryRunCheckHandler(); + if (S_TileMap.Instance.IsDirty) //有修改的数据, 不能直接退出, 需要询问用户是否保存 + { + EditorWindowManager.ShowConfirm("提示", "当前房间修改的数据还未保存,是否退出编辑房间?", + "保存并退出", "直接退出", "取消" + , index => + { + if (index == 0) //保存并退出 + { + var check = CheckError(); + if (check.HasError) //有错误 + { + EditorWindowManager.ShowConfirm("提示", EditorManager.GetRoomErrorTypeMessage(check.ErrorType) + ",如果现在保存并退出,运行游戏将不会刷出该房间!\n是否仍要保存?", (v) => + { + if (v) + { + S_TileMap.Instance.TriggerSave(check.ErrorType, () => + { + //返回上一个Ui + OpenPrevUi(); + }); + } + else + { + //返回上一个Ui + OpenPrevUi(); + } + }); + } + else //没有错误 + { + S_TileMap.Instance.TriggerSave(check.ErrorType, () => + { + //返回上一个Ui + OpenPrevUi(); + }); + } + } + else if (index == 1) + { + //返回上一个Ui + OpenPrevUi(); + } + }); + } + else //没有修改数据 + { + var check = CheckError(); + if (check.HasError) //有错误 + { + EditorWindowManager.ShowConfirm("提示", EditorManager.GetRoomErrorTypeMessage(check.ErrorType) + ",如果不解决错误就退出,运行游戏将不会刷出该房间!\n是否仍要退出?", (v) => + { + if (v) + { + //返回上一个Ui + OpenPrevUi(); + } + }); + } + else //没有错误 + { + //返回上一个Ui + OpenPrevUi(); + } + } + } + + private CheckResult CheckError() + { + var editorTileMap = S_TileMap.Instance; + if (editorTileMap.CurrRoomSize == Vector2I.Zero) + { + return new CheckResult(true, RoomErrorType.Empty); + } + else if (editorTileMap.HasTerrainError) //地图绘制错误 + { + return new CheckResult(true, RoomErrorType.TileError); + } + + if (editorTileMap.CurrDoorConfigs.Count > 0) + { + var flag = false; + var dir = -1; + foreach (var roomInfoDoorAreaInfo in editorTileMap.CurrDoorConfigs) + { + if (dir == -1) + { + dir = (int)roomInfoDoorAreaInfo.Direction; + } + else if (dir != (int)roomInfoDoorAreaInfo.Direction) + { + flag = true; + break; + } + } + + if (!flag) + { + return new CheckResult(true, RoomErrorType.DoorAreaError); + } + } + + if (EditorManager.SelectRoom.Preinstall == null || EditorManager.SelectRoom.Preinstall.Count == 0) + { + return new CheckResult(true, RoomErrorType.NoPreinstallError); + } + + return new CheckResult(false, RoomErrorType.None); + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs new file mode 100644 index 0000000000000000000000000000000000000000..e44a0b61a5005e49be7cfa458427467193552621 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -0,0 +1,1164 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Godot; +using Godot.Collections; +using UI.MapEditorTools; + +namespace UI.MapEditor; + +public partial class EditorTileMap : TileMap, IUiNodeScript +{ + + public enum MouseButtonType + { + /// + /// 无状态 + /// + None, + /// + /// 拖拽模式 + /// + Drag, + /// + /// 笔 + /// + Pen, + /// + /// 绘制区域模式 + /// + Area, + /// + /// 编辑工具模式 + /// + Edit, + } + + /// + /// 自动图块地板层 + /// + public const int AutoFloorLayer = 0; + /// + /// 自定义图块地板层 + /// + public const int CustomFloorLayer = 1; + /// + /// 自动图块中间层 + /// + public const int AutoMiddleLayer = 2; + /// + /// 自定义图块中间层 + /// + public const int CustomMiddleLayer = 3; + /// + /// 自动图块顶层 + /// + public const int AutoTopLayer = 4; + /// + /// 自定义图块顶层 + /// + public const int CustomTopLayer = 5; + /// + /// 标记数据层 + /// + public const int MarkLayer = 10; + + /// + /// 所属地图编辑器UI + /// + public MapEditorPanel MapEditorPanel { get; private set; } + + /// + /// 编辑器工具UI + /// + public MapEditorToolsPanel MapEditorToolsPanel { get; set; } + + /// + /// 左键功能 + /// + public MouseButtonType MouseType { get; private set; } = MouseButtonType.Pen; + + //鼠标坐标 + private Vector2 _mousePosition; + //鼠标所在的cell坐标 + private Vector2I _mouseCellPosition; + //上一帧鼠标所在的cell坐标 + private Vector2I _prevMouseCellPosition = new Vector2I(-99999, -99999); + //单次绘制是否改变过tile数据 + private bool _changeFlag = false; + //左键开始按下时鼠标所在的坐标 + private Vector2I _mouseStartCellPosition; + //鼠标中建是否按下 + private bool _isMiddlePressed = false; + private Vector2 _moveOffset; + //左键是否按下 + private bool _isLeftPressed = false; + //右键是否按下 + private bool _isRightPressed = false; + //绘制填充区域 + private bool _drawFullRect = false; + //负责存储自动图块数据 + private Grid _autoCellLayerGrid = new Grid(); + //用于生成导航网格 + private DungeonTileMap _dungeonTileMap; + //停止绘制多久后开始执行生成操作 + private float _generateInterval = 3f; + //生成自动图块和导航网格的计时器 + private float _generateTimer = -1; + //检测地形结果 + private bool _checkTerrainFlag = true; + //错误地形位置 + private Vector2I _checkTerrainErrorPosition = Vector2I.Zero; + //是否执行生成地形成功 + private bool _isGenerateTerrain = true; + private bool _initLayer = false; + + //--------- 配置数据 ------------- + private int _sourceId = 0; + private int _terrainSet = 0; + private int _terrain = 0; + private AutoTileConfig _autoTileConfig = new AutoTileConfig(); + + /// + /// 正在编辑的房间数据 + /// + public DungeonRoomSplit CurrRoomSplit; + + /// + /// 数据是否脏了, 也就是是否有修改 + /// + public bool IsDirty { get; private set; } + + /// + /// 地图是否有绘制错误 + /// + public bool HasTerrainError => !_isGenerateTerrain; + + //变动过的数据 + + /// + /// 地图位置, 单位: 格 + /// + public Vector2I CurrRoomPosition { get; private set; } + /// + /// 当前地图大小, 单位: 格 + /// + public Vector2I CurrRoomSize { get; private set; } + /// + /// 当前编辑的门数据 + /// + public List CurrDoorConfigs { get; } = new List(); + //------------------------------- + private MapEditor.TileMap _editorTileMap; + private EventFactory _eventFactory; + + public void SetUiNode(IUiNode uiNode) + { + _editorTileMap = (MapEditor.TileMap)uiNode; + MapEditorPanel = _editorTileMap.UiPanel; + MapEditorToolsPanel = _editorTileMap.UiPanel.S_MapEditorTools.Instance; + + _editorTileMap.L_Brush.Instance.Draw += DrawGuides; + _eventFactory = EventManager.CreateEventFactory(); + _eventFactory.AddEventListener(EventEnum.OnSelectDragTool, OnSelectHandTool); + _eventFactory.AddEventListener(EventEnum.OnSelectPenTool, OnSelectPenTool); + _eventFactory.AddEventListener(EventEnum.OnSelectRectTool, OnSelectRectTool); + _eventFactory.AddEventListener(EventEnum.OnSelectEditTool, OnSelectEditTool); + _eventFactory.AddEventListener(EventEnum.OnClickCenterTool, OnClickCenterTool); + _eventFactory.AddEventListener(EventEnum.OnEditorDirty, OnEditorDirty); + + RenderingServer.FramePostDraw += OnFramePostDraw; + } + + public void OnDestroy() + { + _eventFactory.RemoveAllEventListener(); + RenderingServer.FramePostDraw -= OnFramePostDraw; + } + + public override void _Ready() + { + InitLayer(); + } + + public override void _Process(double delta) + { + //触发绘制辅助线 + _editorTileMap.L_Brush.Instance.QueueRedraw(); + + var newDelta = (float)delta; + _drawFullRect = false; + var position = GetLocalMousePosition(); + _mouseCellPosition = LocalToMap(position); + _mousePosition = new Vector2( + _mouseCellPosition.X * GameConfig.TileCellSize, + _mouseCellPosition.Y * GameConfig.TileCellSize + ); + + if (!MapEditorToolsPanel.S_HBoxContainer.Instance.IsPositionOver(GetGlobalMousePosition())) //不在Ui节点上 + { + //左键绘制 + if (_isLeftPressed) + { + if (MouseType == MouseButtonType.Pen) //绘制单格 + { + if (_prevMouseCellPosition != _mouseCellPosition || !_changeFlag) //鼠标位置变过 + { + _changeFlag = true; + _prevMouseCellPosition = _mouseCellPosition; + //绘制自动图块 + SetSingleAutoCell(_mouseCellPosition); + } + } + else if (MouseType == MouseButtonType.Area) //绘制区域 + { + _drawFullRect = true; + } + else if (MouseType == MouseButtonType.Drag) //拖拽 + { + SetMapPosition(GetGlobalMousePosition() + _moveOffset); + } + } + else if (_isRightPressed) //右键擦除 + { + if (MouseType == MouseButtonType.Pen) //绘制单格 + { + if (_prevMouseCellPosition != _mouseCellPosition || !_changeFlag) //鼠标位置变过 + { + _changeFlag = true; + _prevMouseCellPosition = _mouseCellPosition; + EraseSingleAutoCell(_mouseCellPosition); + } + } + else if (MouseType == MouseButtonType.Area) //绘制区域 + { + _drawFullRect = true; + } + else if (MouseType == MouseButtonType.Drag) //拖拽 + { + SetMapPosition(GetGlobalMousePosition() + _moveOffset); + } + } + else if (_isMiddlePressed) //中键移动 + { + SetMapPosition(GetGlobalMousePosition() + _moveOffset); + } + } + + //绘制停止指定时间后, 生成导航网格 + if (_generateTimer > 0) + { + _generateTimer -= newDelta; + if (_generateTimer <= 0) + { + //检测地形 + RunCheckHandler(); + } + } + } + + /// + /// 绘制辅助线 + /// + public void DrawGuides() + { + if (_hasPreviewImage) + { + return; + } + CanvasItem canvasItem = _editorTileMap.L_Brush.Instance; + //轴线 + canvasItem.DrawLine(new Vector2(0, 2000), new Vector2(0, -2000), Colors.Green); + canvasItem.DrawLine(new Vector2(2000, 0), new Vector2( -2000, 0), Colors.Red); + + //绘制房间区域 + if (CurrRoomSize.X != 0 && CurrRoomSize.Y != 0) + { + var size = TileSet.TileSize; + canvasItem.DrawRect(new Rect2(CurrRoomPosition * size, CurrRoomSize * size), + Colors.Aqua, false, 5f / Scale.X); + } + + if (_checkTerrainFlag) //已经通过地形检测 + { + //绘制导航网格 + var result = _dungeonTileMap.GetGenerateNavigationResult(); + if (result != null && result.Success) + { + var polygonData = _dungeonTileMap.GetPolygonData(); + Utils.DrawNavigationPolygon(canvasItem, polygonData, 3f / Scale.X); + } + } + + if (MouseType == MouseButtonType.Pen || MouseType == MouseButtonType.Area) + { + if (_drawFullRect) //绘制填充矩形 + { + var size = TileSet.TileSize; + var cellPos = _mouseStartCellPosition; + var temp = size; + if (_mouseStartCellPosition.X > _mouseCellPosition.X) + { + cellPos.X += 1; + temp.X -= size.X; + } + if (_mouseStartCellPosition.Y > _mouseCellPosition.Y) + { + cellPos.Y += 1; + temp.Y -= size.Y; + } + + var pos = cellPos * size; + canvasItem.DrawRect(new Rect2(pos, _mousePosition - pos + temp), Colors.White, false, 2f / Scale.X); + } + else //绘制单格 + { + canvasItem.DrawRect(new Rect2(_mousePosition, TileSet.TileSize), Colors.White, false, 2f / Scale.X); + } + } + } + + public override void _Input(InputEvent @event) + { + if (@event is InputEventMouseButton mouseButton) + { + if (mouseButton.ButtonIndex == MouseButton.Left) //左键 + { + if (mouseButton.Pressed) //按下 + { + _moveOffset = Position - GetGlobalMousePosition(); + _mouseStartCellPosition = LocalToMap(GetLocalMousePosition()); + } + else + { + _changeFlag = false; + if (_drawFullRect) //松开, 提交绘制的矩形区域 + { + SetRectAutoCell(_mouseStartCellPosition, _mouseCellPosition); + _drawFullRect = false; + } + } + + _isLeftPressed = mouseButton.Pressed; + } + else if (mouseButton.ButtonIndex == MouseButton.Right) //右键 + { + if (mouseButton.Pressed) //按下 + { + _moveOffset = Position - GetGlobalMousePosition(); + _mouseStartCellPosition = LocalToMap(GetLocalMousePosition()); + } + else + { + _changeFlag = false; + if (_drawFullRect) //松开, 提交擦除的矩形区域 + { + EraseRectAutoCell(_mouseStartCellPosition, _mouseCellPosition); + _drawFullRect = false; + } + } + + _isRightPressed = mouseButton.Pressed; + } + else if (mouseButton.ButtonIndex == MouseButton.WheelDown) + { + //缩小 + Shrink(); + } + else if (mouseButton.ButtonIndex == MouseButton.WheelUp) + { + //放大 + Magnify(); + } + else if (mouseButton.ButtonIndex == MouseButton.Middle) + { + _isMiddlePressed = mouseButton.Pressed; + if (_isMiddlePressed) + { + _moveOffset = Position - GetGlobalMousePosition(); + } + } + } + } + + /// + /// 尝试运行检查, 如果已经运行过了, 则没有效果 + /// + public void TryRunCheckHandler() + { + if (_generateTimer > 0) + { + _generateTimer = -1; + RunCheckHandler(); + } + } + + //执行检测地形操作 + private void RunCheckHandler() + { + _isGenerateTerrain = false; + //计算区域 + CalcTileRect(false); + GD.Print("开始检测是否可以生成地形..."); + if (CheckTerrain()) + { + GD.Print("开始绘制导航网格..."); + if (GenerateNavigation()) + { + GD.Print("开始绘制自动贴图..."); + GenerateTerrain(); + _isGenerateTerrain = true; + } + } + else + { + SetErrorCell(_checkTerrainErrorPosition); + } + } + + //将指定层数据存入list中 + private void PushLayerDataToList(int layer, int sourceId, List list) + { + var layerArray = GetUsedCellsById(layer, sourceId); + foreach (var pos in layerArray) + { + var atlasCoords = GetCellAtlasCoords(layer, pos); + list.Add(pos.X); + list.Add(pos.Y); + list.Add(_sourceId); + list.Add(atlasCoords.X); + list.Add(atlasCoords.Y); + } + } + + private void SetLayerDataFromList(int layer, List list) + { + for (var i = 0; i < list.Count; i += 5) + { + var pos = new Vector2I(list[i], list[i + 1]); + var sourceId = list[i + 2]; + var atlasCoords = new Vector2I(list[i + 3], list[i + 4]); + SetCell(layer, pos, sourceId, atlasCoords); + if (layer == AutoFloorLayer) + { + _autoCellLayerGrid.Set(pos, true); + } + } + } + + /// + /// 触发保存地图数据 + /// + public void TriggerSave(RoomErrorType errorType, Action finish) + { + GD.Print("保存地牢房间数据..."); + //执行创建预览图流程 + RunSavePreviewImage(() => + { + //执行保存数据流程 + CurrRoomSplit.ErrorType = errorType; + SaveRoomInfoConfig(); + SaveTileInfoConfig(); + SavePreinstallConfig(); + IsDirty = false; + MapEditorPanel.SetTitleDirty(false); + //派发保存事件 + EventManager.EmitEvent(EventEnum.OnEditorSave); + if (finish != null) + { + finish(); + } + }); + } + + /// + /// 加载地牢, 返回是否加载成功 + /// + public bool Load(DungeonRoomSplit roomSplit) + { + //重新加载数据 + roomSplit.ReloadRoomInfo(); + roomSplit.ReloadTileInfo(); + roomSplit.ReloadPreinstall(); + + CurrRoomSplit = roomSplit; + var roomInfo = roomSplit.RoomInfo; + var tileInfo = roomSplit.TileInfo; + + CurrRoomPosition = roomInfo.Position.AsVector2I(); + SetMapSize(roomInfo.Size.AsVector2I(), true); + CurrDoorConfigs.Clear(); + foreach (var doorAreaInfo in roomInfo.DoorAreaInfos) + { + CurrDoorConfigs.Add(doorAreaInfo.Clone()); + } + + //初始化层级数据 + InitLayer(); + + //地块数据 + SetLayerDataFromList(AutoFloorLayer, tileInfo.Floor); + SetLayerDataFromList(AutoMiddleLayer, tileInfo.Middle); + SetLayerDataFromList(AutoTopLayer, tileInfo.Top); + + //导航网格数据 + _dungeonTileMap.SetPolygonData(tileInfo.NavigationList); + + //如果有图块错误, 则找出错误的点位 + if (roomSplit.ErrorType == RoomErrorType.TileError) + { + RunCheckHandler(); + } + //聚焦 + //MapEditorPanel.CallDelay(0.1f, OnClickCenterTool); + //CallDeferred(nameof(OnClickCenterTool), null); + + //加载门编辑区域 + foreach (var doorAreaInfo in CurrDoorConfigs) + { + MapEditorToolsPanel.CreateDoorTool(doorAreaInfo); + } + + //聚焦 + OnClickCenterTool(null); + return true; + } + + private void InitLayer() + { + if (_initLayer) + { + return; + } + + _initLayer = true; + //初始化层级数据 + AddLayer(CustomFloorLayer); + SetLayerZIndex(CustomFloorLayer, CustomFloorLayer); + AddLayer(AutoMiddleLayer); + SetLayerZIndex(AutoMiddleLayer, AutoMiddleLayer); + AddLayer(CustomMiddleLayer); + SetLayerZIndex(CustomMiddleLayer, CustomMiddleLayer); + AddLayer(AutoTopLayer); + SetLayerZIndex(AutoTopLayer, AutoTopLayer); + AddLayer(CustomTopLayer); + SetLayerZIndex(CustomTopLayer, CustomTopLayer); + + _dungeonTileMap = new DungeonTileMap(this); + _dungeonTileMap.SetFloorAtlasCoords(new List(new []{ _autoTileConfig.Floor.AutoTileCoord })); + } + + //缩小 + private void Shrink() + { + var pos = GetLocalMousePosition(); + var scale = Scale / 1.1f; + if (scale.LengthSquared() >= 0.5f) + { + Scale = scale; + SetMapPosition(Position + pos * 0.1f * scale); + } + } + //放大 + private void Magnify() + { + var pos = GetLocalMousePosition(); + var prevScale = Scale; + var scale = prevScale * 1.1f; + if (scale.LengthSquared() <= 2000) + { + Scale = scale; + SetMapPosition(Position - pos * 0.1f * prevScale); + } + } + + //绘制单个自动贴图 + private void SetSingleAutoCell(Vector2I position) + { + SetCell(GetFloorLayer(), position, _sourceId, _autoTileConfig.Floor.AutoTileCoord); + if (!_autoCellLayerGrid.Contains(position.X, position.Y)) + { + ResetGenerateTimer(); + _autoCellLayerGrid.Set(position.X, position.Y, true); + } + } + + //绘制区域自动贴图 + private void SetRectAutoCell(Vector2I start, Vector2I end) + { + ResetGenerateTimer(); + + if (start.X > end.X) + { + var temp = end.X; + end.X = start.X; + start.X = temp; + } + if (start.Y > end.Y) + { + var temp = end.Y; + end.Y = start.Y; + start.Y = temp; + } + + var width = end.X - start.X + 1; + var height = end.Y - start.Y + 1; + for (var i = 0; i < width; i++) + { + for (var j = 0; j < height; j++) + { + SetCell(GetFloorLayer(), new Vector2I(start.X + i, start.Y + j), _sourceId, _autoTileConfig.Floor.AutoTileCoord); + } + } + + _autoCellLayerGrid.SetRect(start, new Vector2I(width, height), true); + } + + //擦除单个自动图块 + private void EraseSingleAutoCell(Vector2I position) + { + EraseCell(GetFloorLayer(), position); + if (_autoCellLayerGrid.Remove(position.X, position.Y)) + { + ResetGenerateTimer(); + } + } + + //擦除一个区域内的自动贴图 + private void EraseRectAutoCell(Vector2I start, Vector2I end) + { + ResetGenerateTimer(); + + if (start.X > end.X) + { + var temp = end.X; + end.X = start.X; + start.X = temp; + } + if (start.Y > end.Y) + { + var temp = end.Y; + end.Y = start.Y; + start.Y = temp; + } + + var width = end.X - start.X + 1; + var height = end.Y - start.Y + 1; + for (var i = 0; i < width; i++) + { + for (var j = 0; j < height; j++) + { + EraseCell(GetFloorLayer(), new Vector2I(start.X + i, start.Y + j)); + } + } + _autoCellLayerGrid.RemoveRect(start, new Vector2I(width, height)); + } + + //重置计时器 + private void ResetGenerateTimer() + { + _generateTimer = _generateInterval; + _isGenerateTerrain = false; + _dungeonTileMap.ClearPolygonData(); + ClearLayer(AutoTopLayer); + ClearLayer(AutoMiddleLayer); + //标记有修改数据 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + + //重新计算房间区域 + private void CalcTileRect(bool refreshDoorTrans) + { + var rect = GetUsedRect(); + CurrRoomPosition = rect.Position; + SetMapSize(rect.Size, refreshDoorTrans); + } + + //检测是否有不合规的图块, 返回true表示图块正常 + private bool CheckTerrain() + { + var x = CurrRoomPosition.X; + var y = CurrRoomPosition.Y; + var w = CurrRoomSize.X; + var h = CurrRoomSize.Y; + + for (var i = 0; i < w; i++) + { + for (var j = 0; j < h; j++) + { + var pos = new Vector2I(x + i, y + j); + if (GetCellSourceId(AutoFloorLayer, pos) == -1) + { + //先检测对边是否有地板 + if ((_autoCellLayerGrid.Get(pos.X - 1, pos.Y) && _autoCellLayerGrid.Get(pos.X + 1, pos.Y)) //left & right + || (_autoCellLayerGrid.Get(pos.X, pos.Y + 1) && _autoCellLayerGrid.Get(pos.X, pos.Y - 1))) //top & down + { + _checkTerrainFlag = false; + _checkTerrainErrorPosition = pos; + return false; + } + + //再检测对角是否有地板 + var topLeft = _autoCellLayerGrid.Get(pos.X - 1, pos.Y + 1); //top-left + var downRight = _autoCellLayerGrid.Get(pos.X + 1, pos.Y - 1); //down-right + var downLeft = _autoCellLayerGrid.Get(pos.X - 1, pos.Y - 1); //down-left + var topRight = _autoCellLayerGrid.Get(pos.X + 1, pos.Y + 1); //top-right + if ((topLeft && downRight && !downLeft && !topRight) || (!topLeft && !downRight && downLeft && topRight)) + { + _checkTerrainFlag = false; + _checkTerrainErrorPosition = pos; + return false; + } + } + } + } + + _checkTerrainFlag = true; + return true; + } + + //生成自动图块 (地形) + private void GenerateTerrain() + { + ClearLayer(AutoFloorLayer); + + var list = new List(); + _autoCellLayerGrid.ForEach((x, y, data) => + { + if (data) + { + list.Add(new Vector2I(x, y)); + } + }); + var arr = new Array(list); + //绘制自动图块 + SetCellsTerrainConnect(AutoFloorLayer, arr, _terrainSet, _terrain, false); + //计算区域 + CalcTileRect(true); + //将墙壁移动到指定层 + MoveTerrainCell(); + } + + //将自动生成的图块从 AutoFloorLayer 移动到指定图层中 + private void MoveTerrainCell() + { + ClearLayer(AutoTopLayer); + ClearLayer(AutoMiddleLayer); + + var x = CurrRoomPosition.X; + var y = CurrRoomPosition.Y; + var w = CurrRoomSize.X; + var h = CurrRoomSize.Y; + + for (var i = 0; i < w; i++) + { + for (var j = 0; j < h; j++) + { + var pos = new Vector2I(x + i, y + j); + if (!_autoCellLayerGrid.Contains(pos) && GetCellSourceId(AutoFloorLayer, pos) != -1) + { + var atlasCoords = GetCellAtlasCoords(AutoFloorLayer, pos); + var layer = _autoTileConfig.GetLayer(atlasCoords); + if (layer == GameConfig.MiddleMapLayer) + { + layer = AutoMiddleLayer; + } + else if (layer == GameConfig.TopMapLayer) + { + layer = AutoTopLayer; + } + else + { + GD.PrintErr($"异常图块: {pos}, 这个图块的图集坐标'{atlasCoords}'不属于'MiddleMapLayer'和'TopMapLayer'!"); + continue; + } + EraseCell(AutoFloorLayer, pos); + SetCell(layer, pos, _sourceId, atlasCoords); + } + } + } + } + + //生成导航网格 + private bool GenerateNavigation() + { + _dungeonTileMap.GenerateNavigationPolygon(AutoFloorLayer); + var result = _dungeonTileMap.GetGenerateNavigationResult(); + if (result.Success) + { + CloseErrorCell(); + } + else + { + SetErrorCell(result.Exception.Point); + } + + return result.Success; + } + + //设置显示的错误cell, 会标记上红色的闪烁动画 + private void SetErrorCell(Vector2I pos) + { + MapEditorPanel.S_ErrorCell.Instance.Position = pos * CellQuadrantSize; + MapEditorPanel.S_ErrorCellAnimationPlayer.Instance.Play(AnimatorNames.Show); + } + + //关闭显示的错误cell + private void CloseErrorCell() + { + MapEditorPanel.S_ErrorCellAnimationPlayer.Instance.Stop(); + } + + private int GetFloorLayer() + { + return AutoFloorLayer; + } + + private int GetMiddleLayer() + { + return AutoMiddleLayer; + } + + private int GetTopLayer() + { + return AutoTopLayer; + } + + /// + /// 选中拖拽功能 + /// + private void OnSelectHandTool(object arg) + { + MouseType = MouseButtonType.Drag; + } + + /// + /// 选中画笔攻击 + /// + private void OnSelectPenTool(object arg) + { + MouseType = MouseButtonType.Pen; + } + + /// + /// 选中绘制区域功能 + /// + private void OnSelectRectTool(object arg) + { + MouseType = MouseButtonType.Area; + } + + /// + /// 选择编辑门区域 + /// + private void OnSelectEditTool(object arg) + { + MouseType = MouseButtonType.Edit; + } + + /// + /// 聚焦 + /// + private void OnClickCenterTool(object arg) + { + var pos = MapEditorPanel.S_SubViewport.Instance.Size / 2; + if (CurrRoomSize.X == 0 && CurrRoomSize.Y == 0) //聚焦原点 + { + SetMapPosition(pos); + } + else //聚焦地图中心点 + { + SetMapPosition(pos - (CurrRoomPosition + CurrRoomSize / 2) * TileSet.TileSize * Scale); + } + } + + //房间数据有修改 + private void OnEditorDirty(object obj) + { + IsDirty = true; + MapEditorPanel.SetTitleDirty(true); + } + + /// + /// 创建地牢房间门区域 + /// + /// 门方向 + /// 起始坐标, 单位: 像素 + /// 结束坐标, 单位: 像素 + public DoorAreaInfo CreateDoorArea(DoorDirection direction, int start, int end) + { + var doorAreaInfo = new DoorAreaInfo(); + doorAreaInfo.Direction = direction; + doorAreaInfo.Start = start; + doorAreaInfo.End = end; + //doorAreaInfo.CalcPosition(_roomPosition, _roomSize); + CurrDoorConfigs.Add(doorAreaInfo); + return doorAreaInfo; + } + + /// + /// 检测门区域数据是否可以提交 + /// + /// 门方向 + /// 起始坐标, 单位: 像素 + /// 结束坐标, 单位: 像素 + /// + public bool CheckDoorArea(DoorDirection direction, int start, int end) + { + foreach (var item in CurrDoorConfigs) + { + if (item.Direction == direction) + { + if (CheckValueCollision(item.Start, item.End, start, end)) + { + return false; + } + } + } + + return true; + } + + /// + /// 检测门区域数据是否可以提交 + /// + /// 需要检测的门 + /// 起始坐标, 单位: 像素 + /// 结束坐标, 单位: 像素 + public bool CheckDoorArea(DoorAreaInfo target, int start, int end) + { + foreach (var item in CurrDoorConfigs) + { + if (item.Direction == target.Direction && item != target) + { + if (CheckValueCollision(item.Start, item.End, start, end)) + { + return false; + } + } + } + + return true; + } + + private bool CheckValueCollision(float o1, float o2, float h1, float h2) + { + var size = GameConfig.TileCellSize; + return !(h2 < o1 - 3 * size || o2 + 3 * size < h1); + } + + /// + /// 移除门区域数据 + /// + public void RemoveDoorArea(DoorAreaInfo doorAreaInfo) + { + CurrDoorConfigs.Remove(doorAreaInfo); + } + + //保存房间配置 + private void SaveRoomInfoConfig() + { + //存入本地 + var roomInfo = CurrRoomSplit.RoomInfo; + + if (!HasTerrainError) //没有绘制错误 + { + roomInfo.Size = new SerializeVector2(CurrRoomSize); + roomInfo.Position = new SerializeVector2(CurrRoomPosition); + } + else + { + roomInfo.Position = new SerializeVector2(CurrRoomPosition - Vector2I.One); + roomInfo.Size = new SerializeVector2(CurrRoomSize + new Vector2I(2, 2)); + } + + roomInfo.DoorAreaInfos.Clear(); + roomInfo.DoorAreaInfos.AddRange(CurrDoorConfigs); + roomInfo.ClearCompletionDoorArea(); + MapProjectManager.SaveRoomInfo(CurrRoomSplit); + } + + //保存地块数据 + public void SaveTileInfoConfig() + { + //存入本地 + var tileInfo = CurrRoomSplit.TileInfo; + tileInfo.NavigationList.Clear(); + tileInfo.NavigationList.AddRange(_dungeonTileMap.GetPolygonData()); + tileInfo.Floor.Clear(); + tileInfo.Middle.Clear(); + tileInfo.Top.Clear(); + + PushLayerDataToList(AutoFloorLayer, _sourceId, tileInfo.Floor); + PushLayerDataToList(AutoMiddleLayer, _sourceId, tileInfo.Middle); + PushLayerDataToList(AutoTopLayer, _sourceId, tileInfo.Top); + MapProjectManager.SaveRoomTileInfo(CurrRoomSplit); + } + + /// + /// 保存预设数据 + /// + public void SavePreinstallConfig() + { + //存入本地 + MapProjectManager.SaveRoomPreinstall(CurrRoomSplit); + } + + /// + /// 获取相机中心点坐标 + /// + public Vector2I GetCenterPosition() + { + var pos = ToLocal(MapEditorPanel.S_SubViewport.Instance.Size / 2); + return new Vector2I((int)pos.X, (int)pos.Y); + } + + /// + /// 设置相机看向的点 + /// + public void SetLookPosition(Vector2 pos) + { + SetMapPosition(-pos * Scale + MapEditorPanel.S_SubViewport.Instance.Size / 2); + //SetMapPosition(pos * Scale); + //SetMapPosition(pos + MapEditorPanel.S_SubViewport.Instance.Size / 2); + } + + /// + /// 设置地图坐标 + /// + public void SetMapPosition(Vector2 pos) + { + Position = pos; + MapEditorToolsPanel.SetToolTransform(pos, Scale); + } + + //设置地图大小 + private void SetMapSize(Vector2I size, bool refreshDoorTrans) + { + if (CurrRoomSize != size) + { + CurrRoomSize = size; + + if (refreshDoorTrans) + { + MapEditorToolsPanel.SetDoorHoverToolTransform(CurrRoomPosition, CurrRoomSize); + } + } + } + + private bool _hasPreviewImage = false; + private Action _previewFinish; + private int _previewIndex = 0; + private Vector2I _tempViewportSize; + private Vector2 _tempMapPos; + private Vector2 _tempMapScale; + private bool _tempAutoFloorLayer; + private bool _tempCustomFloorLayer; + private bool _tempAutoMiddleLayer; + private bool _tempCustomMiddleLayer; + private bool _tempAutoTopLayer; + private bool _tempCustomTopLayer; + + private void RunSavePreviewImage(Action action) + { + if (_hasPreviewImage) + { + return; + } + + _previewIndex = 0; + _previewFinish = action; + _hasPreviewImage = true; + //先截图, 将图像数据放置到 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; + //调整绘制视图大小 + _tempViewportSize = subViewport.Size; + subViewport.Size = new Vector2I(GameConfig.PreviewImageSize, GameConfig.PreviewImageSize); + //调整tileMap + _tempMapPos = Position; + _tempMapScale = Scale; + + //中心点 + var pos = new Vector2(GameConfig.PreviewImageSize / 2f, GameConfig.PreviewImageSize / 2f); + if (CurrRoomSize.X == 0 && CurrRoomSize.Y == 0) //聚焦原点 + { + Position = pos; + } + else //聚焦地图中心点 + { + var tempPos = new Vector2(CurrRoomSize.X + 2, CurrRoomSize.Y + 2); + var mapSize = tempPos * TileSet.TileSize; + var axis = Mathf.Max(mapSize.X, mapSize.Y); + var targetScale = GameConfig.PreviewImageSize / axis; + Scale = new Vector2(targetScale, targetScale); + Position = pos - (CurrRoomPosition + tempPos / 2f - Vector2.One) * TileSet.TileSize * targetScale; + } + + //隐藏工具栏 + MapEditorToolsPanel.Visible = false; + //显示所有层级 + _tempAutoFloorLayer = IsLayerEnabled(AutoFloorLayer); + _tempCustomFloorLayer = IsLayerEnabled(CustomFloorLayer); + _tempAutoMiddleLayer = IsLayerEnabled(AutoMiddleLayer); + _tempCustomMiddleLayer = IsLayerEnabled(CustomMiddleLayer); + _tempAutoTopLayer = IsLayerEnabled(AutoTopLayer); + _tempCustomTopLayer = IsLayerEnabled(CustomTopLayer); + + SetLayerEnabled(AutoFloorLayer, true); + SetLayerEnabled(CustomFloorLayer, true); + SetLayerEnabled(AutoMiddleLayer, true); + SetLayerEnabled(CustomMiddleLayer, true); + SetLayerEnabled(AutoTopLayer, true); + SetLayerEnabled(CustomTopLayer, true); + } + + private void OnFramePostDraw() + { + if (_hasPreviewImage) + { + _previewIndex++; + if (_previewIndex == 2) + { + var textureRect = MapEditorPanel.S_MapView2.Instance; + var texture = textureRect.Texture; + textureRect.Texture = null; + texture.Dispose(); + textureRect.Visible = false; + + //还原工具栏 + MapEditorToolsPanel.Visible = true; + //还原层级显示 + SetLayerEnabled(AutoFloorLayer, _tempAutoFloorLayer); + SetLayerEnabled(CustomFloorLayer, _tempCustomFloorLayer); + SetLayerEnabled(AutoMiddleLayer, _tempAutoMiddleLayer); + SetLayerEnabled(CustomMiddleLayer, _tempCustomMiddleLayer); + SetLayerEnabled(AutoTopLayer, _tempAutoTopLayer); + SetLayerEnabled(CustomTopLayer, _tempCustomTopLayer); + + //保存预览图 + var subViewport = MapEditorPanel.S_SubViewport.Instance; + var viewportTexture = subViewport.GetTexture(); + var image = viewportTexture.GetImage(); + image.Resize(GameConfig.PreviewImageSize, GameConfig.PreviewImageSize, Image.Interpolation.Nearest); + CurrRoomSplit.PreviewImage = ImageTexture.CreateFromImage(image); + MapProjectManager.SaveRoomPreviewImage(CurrRoomSplit, image); + + //还原tileMap + Position = _tempMapPos; + Scale = _tempMapScale; + + //还原绘制视图 + subViewport.Size = _tempViewportSize; + + _previewFinish(); + _hasPreviewImage = false; + } + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroup.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroup.cs new file mode 100644 index 0000000000000000000000000000000000000000..18be6a516a8d03ca21d6472a24641ca7ed25b9dd --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroup.cs @@ -0,0 +1,234 @@ +namespace UI.MapEditorCreateGroup; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorCreateGroup : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(this, GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + + public MapEditorCreateGroup() : base(nameof(MapEditorCreateGroup)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameLabel + /// + public class GroupNameLabel : UiNode + { + public GroupNameLabel(MapEditorCreateGroup uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override GroupNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameInput + /// + public class GroupNameInput : UiNode + { + public GroupNameInput(MapEditorCreateGroup uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override GroupNameInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.GroupNameLabel + /// + public GroupNameLabel L_GroupNameLabel + { + get + { + if (_L_GroupNameLabel == null) _L_GroupNameLabel = new GroupNameLabel(UiPanel, Instance.GetNodeOrNull("GroupNameLabel")); + return _L_GroupNameLabel; + } + } + private GroupNameLabel _L_GroupNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.GroupNameInput + /// + public GroupNameInput L_GroupNameInput + { + get + { + if (_L_GroupNameInput == null) _L_GroupNameInput = new GroupNameInput(UiPanel, Instance.GetNodeOrNull("GroupNameInput")); + return _L_GroupNameInput; + } + } + private GroupNameInput _L_GroupNameInput; + + public HBoxContainer(MapEditorCreateGroup uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public class RemarkNameLabel : UiNode + { + public RemarkNameLabel(MapEditorCreateGroup uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RemarkNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public class RemarkInput : UiNode + { + public RemarkInput(MapEditorCreateGroup uiPanel, Godot.TextEdit node) : base(uiPanel, node) { } + public override RemarkInput Clone() => new (UiPanel, (Godot.TextEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public class HBoxContainer5 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.RemarkNameLabel + /// + public RemarkNameLabel L_RemarkNameLabel + { + get + { + if (_L_RemarkNameLabel == null) _L_RemarkNameLabel = new RemarkNameLabel(UiPanel, Instance.GetNodeOrNull("RemarkNameLabel")); + return _L_RemarkNameLabel; + } + } + private RemarkNameLabel _L_RemarkNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.RemarkInput + /// + public RemarkInput L_RemarkInput + { + get + { + if (_L_RemarkInput == null) _L_RemarkInput = new RemarkInput(UiPanel, Instance.GetNodeOrNull("RemarkInput")); + return _L_RemarkInput; + } + } + private RemarkInput _L_RemarkInput; + + public HBoxContainer5(MapEditorCreateGroup uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer5 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.HBoxContainer5 + /// + public HBoxContainer5 L_HBoxContainer5 + { + get + { + if (_L_HBoxContainer5 == null) _L_HBoxContainer5 = new HBoxContainer5(UiPanel, Instance.GetNodeOrNull("HBoxContainer5")); + return _L_HBoxContainer5; + } + } + private HBoxContainer5 _L_HBoxContainer5; + + public VBoxContainer(MapEditorCreateGroup uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateGroup.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public MarginContainer(MapEditorCreateGroup uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameLabel + /// + public GroupNameLabel S_GroupNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_GroupNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameInput + /// + public GroupNameInput S_GroupNameInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_GroupNameInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_MarginContainer.L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public RemarkNameLabel S_RemarkNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public RemarkInput S_RemarkInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public HBoxContainer5 S_HBoxContainer5 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_MarginContainer.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer + /// + public MarginContainer S_MarginContainer => L_MarginContainer; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..cbc213d6723210753aab36be5a091ebfd868d4da --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs @@ -0,0 +1,39 @@ +using System.IO; +using System.Text.RegularExpressions; +using Godot; + +namespace UI.MapEditorCreateGroup; + +public partial class MapEditorCreateGroupPanel : MapEditorCreateGroup +{ + + /// + /// 填完数据后获取数据对象, 并进行验证, 如果验证失败, 则返回 null + /// + public DungeonRoomGroup GetGroupInfo() + { + //组名 + var groupName = S_GroupNameInput.Instance.Text; + + //检查名称是否合规 + if (string.IsNullOrEmpty(groupName)) + { + EditorWindowManager.ShowTips("错误", "组名称不能为空!"); + return null; + } + + //验证是否有同名组 + var path = MapProjectManager.CustomMapPath + groupName; + var dir = new DirectoryInfo(path); + if (dir.Exists && dir.GetDirectories().Length > 0) + { + EditorWindowManager.ShowTips("错误", $"已经有相同路径的房间了!"); + return null; + } + + var group = new DungeonRoomGroup(); + group.GroupName = groupName; + group.Remark = S_RemarkInput.Instance.Text; + return group; + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMark.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMark.cs new file mode 100644 index 0000000000000000000000000000000000000000..551100688fc41f456ab3316b5113491b942f3b98 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMark.cs @@ -0,0 +1,1593 @@ +namespace UI.MapEditorCreateMark; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorCreateMark : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer((MapEditorCreateMarkPanel)this, GetNode("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.ExpandPanel + /// + public ExpandPanel L_ExpandPanel + { + get + { + if (_L_ExpandPanel == null) _L_ExpandPanel = new ExpandPanel((MapEditorCreateMarkPanel)this, GetNode("ExpandPanel")); + return _L_ExpandPanel; + } + } + private ExpandPanel _L_ExpandPanel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.NumberBar + /// + public NumberBar L_NumberBar + { + get + { + if (_L_NumberBar == null) _L_NumberBar = new NumberBar((MapEditorCreateMarkPanel)this, GetNode("NumberBar")); + return _L_NumberBar; + } + } + private NumberBar _L_NumberBar; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.OptionBar + /// + public OptionBar L_OptionBar + { + get + { + if (_L_OptionBar == null) _L_OptionBar = new OptionBar((MapEditorCreateMarkPanel)this, GetNode("OptionBar")); + return _L_OptionBar; + } + } + private OptionBar _L_OptionBar; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar + /// + public ObjectBar L_ObjectBar + { + get + { + if (_L_ObjectBar == null) _L_ObjectBar = new ObjectBar((MapEditorCreateMarkPanel)this, GetNode("ObjectBar")); + return _L_ObjectBar; + } + } + private ObjectBar _L_ObjectBar; + + + public MapEditorCreateMark() : base(nameof(MapEditorCreateMark)) + { + } + + public sealed override void OnInitNestedUi() + { + _ = L_NumberBar; + _ = L_OptionBar; + _ = L_ObjectBar; + + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.PosLabel + /// + public class PosLabel : UiNode + { + public PosLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override PosLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer.Label + /// + public class Label : UiNode + { + public Label(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer.PosX + /// + public class PosX : UiNode + { + public PosX(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override PosX Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.Label + /// + public Label L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label(UiPanel, Instance.GetNode("Label")); + return _L_Label; + } + } + private Label _L_Label; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.PosX + /// + public PosX L_PosX + { + get + { + if (_L_PosX == null) _L_PosX = new PosX(UiPanel, Instance.GetNode("PosX")); + return _L_PosX; + } + } + private PosX _L_PosX; + + public HBoxContainer(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2.Label + /// + public class Label_1 : UiNode + { + public Label_1(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label_1 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2.PosY + /// + public class PosY : UiNode + { + public PosY(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override PosY Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2 + /// + public class HBoxContainer2_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.Label + /// + public Label_1 L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label_1(UiPanel, Instance.GetNode("Label")); + return _L_Label; + } + } + private Label_1 _L_Label; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.PosY + /// + public PosY L_PosY + { + get + { + if (_L_PosY == null) _L_PosY = new PosY(UiPanel, Instance.GetNode("PosY")); + return _L_PosY; + } + } + private PosY _L_PosY; + + public HBoxContainer2_1(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer2_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer + /// + public class VBoxContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.HBoxContainer2 + /// + public HBoxContainer2_1 L_HBoxContainer2 + { + get + { + if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new HBoxContainer2_1(UiPanel, Instance.GetNode("HBoxContainer2")); + return _L_HBoxContainer2; + } + } + private HBoxContainer2_1 _L_HBoxContainer2; + + public VBoxContainer_1(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_1 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2 + /// + public class HBoxContainer2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.PosLabel + /// + public PosLabel L_PosLabel + { + get + { + if (_L_PosLabel == null) _L_PosLabel = new PosLabel(UiPanel, Instance.GetNode("PosLabel")); + return _L_PosLabel; + } + } + private PosLabel _L_PosLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.VBoxContainer + /// + public VBoxContainer_1 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_1(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_1 _L_VBoxContainer; + + public HBoxContainer2(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.SizeLabel + /// + public class SizeLabel : UiNode + { + public SizeLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override SizeLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer.Label + /// + public class Label_2 : UiNode + { + public Label_2(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label_2 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer.SizeX + /// + public class SizeX : UiNode + { + public SizeX(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override SizeX Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer + /// + public class HBoxContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.Label + /// + public Label_2 L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label_2(UiPanel, Instance.GetNode("Label")); + return _L_Label; + } + } + private Label_2 _L_Label; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.SizeX + /// + public SizeX L_SizeX + { + get + { + if (_L_SizeX == null) _L_SizeX = new SizeX(UiPanel, Instance.GetNode("SizeX")); + return _L_SizeX; + } + } + private SizeX _L_SizeX; + + public HBoxContainer_1(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2.Label + /// + public class Label_3 : UiNode + { + public Label_3(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label_3 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2.SizeY + /// + public class SizeY : UiNode + { + public SizeY(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override SizeY Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2 + /// + public class HBoxContainer2_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.Label + /// + public Label_3 L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label_3(UiPanel, Instance.GetNode("Label")); + return _L_Label; + } + } + private Label_3 _L_Label; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.SizeY + /// + public SizeY L_SizeY + { + get + { + if (_L_SizeY == null) _L_SizeY = new SizeY(UiPanel, Instance.GetNode("SizeY")); + return _L_SizeY; + } + } + private SizeY _L_SizeY; + + public HBoxContainer2_2(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer2_2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer + /// + public class VBoxContainer_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.HBoxContainer + /// + public HBoxContainer_1 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_1(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_1 _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.HBoxContainer2 + /// + public HBoxContainer2_2 L_HBoxContainer2 + { + get + { + if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new HBoxContainer2_2(UiPanel, Instance.GetNode("HBoxContainer2")); + return _L_HBoxContainer2; + } + } + private HBoxContainer2_2 _L_HBoxContainer2; + + public VBoxContainer_2(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_2 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3 + /// + public class HBoxContainer3_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.SizeLabel + /// + public SizeLabel L_SizeLabel + { + get + { + if (_L_SizeLabel == null) _L_SizeLabel = new SizeLabel(UiPanel, Instance.GetNode("SizeLabel")); + return _L_SizeLabel; + } + } + private SizeLabel _L_SizeLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.VBoxContainer + /// + public VBoxContainer_2 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_2(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_2 _L_VBoxContainer; + + public HBoxContainer3_1(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer3_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayContainer.DelayNameLabel + /// + public class DelayNameLabel : UiNode + { + public DelayNameLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override DelayNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayContainer.DelayInput + /// + public class DelayInput : UiNode + { + public DelayInput(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override DelayInput Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayContainer + /// + public class DelayContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayNameLabel + /// + public DelayNameLabel L_DelayNameLabel + { + get + { + if (_L_DelayNameLabel == null) _L_DelayNameLabel = new DelayNameLabel(UiPanel, Instance.GetNode("DelayNameLabel")); + return _L_DelayNameLabel; + } + } + private DelayNameLabel _L_DelayNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayInput + /// + public DelayInput L_DelayInput + { + get + { + if (_L_DelayInput == null) _L_DelayInput = new DelayInput(UiPanel, Instance.GetNode("DelayInput")); + return _L_DelayInput; + } + } + private DelayInput _L_DelayInput; + + public DelayContainer(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override DelayContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3 + /// + public class HBoxContainer3 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer2 + /// + public HBoxContainer2 L_HBoxContainer2 + { + get + { + if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new HBoxContainer2(UiPanel, Instance.GetNode("HBoxContainer2")); + return _L_HBoxContainer2; + } + } + private HBoxContainer2 _L_HBoxContainer2; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3 + /// + public HBoxContainer3_1 L_HBoxContainer3 + { + get + { + if (_L_HBoxContainer3 == null) _L_HBoxContainer3 = new HBoxContainer3_1(UiPanel, Instance.GetNode("HBoxContainer3")); + return _L_HBoxContainer3; + } + } + private HBoxContainer3_1 _L_HBoxContainer3; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.DelayContainer + /// + public DelayContainer L_DelayContainer + { + get + { + if (_L_DelayContainer == null) _L_DelayContainer = new DelayContainer(UiPanel, Instance.GetNode("DelayContainer")); + return _L_DelayContainer; + } + } + private DelayContainer _L_DelayContainer; + + public HBoxContainer3(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer3 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.AddMark + /// + public class AddMark : UiNode + { + public AddMark(MapEditorCreateMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override AddMark Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.Control + /// + public class Control : UiNode + { + public Control(MapEditorCreateMarkPanel uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override Control Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.IconTitle + /// + public class IconTitle : UiNode + { + public IconTitle(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override IconTitle Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.IdTitle + /// + public class IdTitle : UiNode + { + public IdTitle(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override IdTitle Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.NameTitle + /// + public class NameTitle : UiNode + { + public NameTitle(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override NameTitle Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.TypeTitle + /// + public class TypeTitle : UiNode + { + public TypeTitle(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override TypeTitle Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.WeightTitle + /// + public class WeightTitle : UiNode + { + public WeightTitle(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override WeightTitle Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.ExtraTitle + /// + public class ExtraTitle : UiNode + { + public ExtraTitle(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override ExtraTitle Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.Control + /// + public Control L_Control + { + get + { + if (_L_Control == null) _L_Control = new Control(UiPanel, Instance.GetNode("Control")); + return _L_Control; + } + } + private Control _L_Control; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.IconTitle + /// + public IconTitle L_IconTitle + { + get + { + if (_L_IconTitle == null) _L_IconTitle = new IconTitle(UiPanel, Instance.GetNode("IconTitle")); + return _L_IconTitle; + } + } + private IconTitle _L_IconTitle; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.IdTitle + /// + public IdTitle L_IdTitle + { + get + { + if (_L_IdTitle == null) _L_IdTitle = new IdTitle(UiPanel, Instance.GetNode("IdTitle")); + return _L_IdTitle; + } + } + private IdTitle _L_IdTitle; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.NameTitle + /// + public NameTitle L_NameTitle + { + get + { + if (_L_NameTitle == null) _L_NameTitle = new NameTitle(UiPanel, Instance.GetNode("NameTitle")); + return _L_NameTitle; + } + } + private NameTitle _L_NameTitle; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.TypeTitle + /// + public TypeTitle L_TypeTitle + { + get + { + if (_L_TypeTitle == null) _L_TypeTitle = new TypeTitle(UiPanel, Instance.GetNode("TypeTitle")); + return _L_TypeTitle; + } + } + private TypeTitle _L_TypeTitle; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.WeightTitle + /// + public WeightTitle L_WeightTitle + { + get + { + if (_L_WeightTitle == null) _L_WeightTitle = new WeightTitle(UiPanel, Instance.GetNode("WeightTitle")); + return _L_WeightTitle; + } + } + private WeightTitle _L_WeightTitle; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ExtraTitle + /// + public ExtraTitle L_ExtraTitle + { + get + { + if (_L_ExtraTitle == null) _L_ExtraTitle = new ExtraTitle(UiPanel, Instance.GetNode("ExtraTitle")); + return _L_ExtraTitle; + } + } + private ExtraTitle _L_ExtraTitle; + + public HBoxContainer_2(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.ExpandButton + /// + public class ExpandButton : UiNode + { + public ExpandButton(MapEditorCreateMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override ExpandButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.Icon + /// + public class Icon : UiNode + { + public Icon(MapEditorCreateMarkPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override Icon Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.IdLabel + /// + public class IdLabel : UiNode + { + public IdLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override IdLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.NameLabel + /// + public class NameLabel : UiNode + { + public NameLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override NameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.TypeLabel + /// + public class TypeLabel : UiNode + { + public TypeLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override TypeLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.WeightEdit + /// + public class WeightEdit : UiNode + { + public WeightEdit(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override WeightEdit Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.CenterContainer.DeleteButton + /// + public class DeleteButton : UiNode + { + public DeleteButton(MapEditorCreateMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override DeleteButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.CenterContainer + /// + public class CenterContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.DeleteButton + /// + public DeleteButton L_DeleteButton + { + get + { + if (_L_DeleteButton == null) _L_DeleteButton = new DeleteButton(UiPanel, Instance.GetNode("DeleteButton")); + return _L_DeleteButton; + } + } + private DeleteButton _L_DeleteButton; + + public CenterContainer(MapEditorCreateMarkPanel uiPanel, Godot.CenterContainer node) : base(uiPanel, node) { } + public override CenterContainer Clone() => new (UiPanel, (Godot.CenterContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer + /// + public class HBoxContainer_3 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.ExpandButton + /// + public ExpandButton L_ExpandButton + { + get + { + if (_L_ExpandButton == null) _L_ExpandButton = new ExpandButton(UiPanel, Instance.GetNode("ExpandButton")); + return _L_ExpandButton; + } + } + private ExpandButton _L_ExpandButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.Icon + /// + public Icon L_Icon + { + get + { + if (_L_Icon == null) _L_Icon = new Icon(UiPanel, Instance.GetNode("Icon")); + return _L_Icon; + } + } + private Icon _L_Icon; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.IdLabel + /// + public IdLabel L_IdLabel + { + get + { + if (_L_IdLabel == null) _L_IdLabel = new IdLabel(UiPanel, Instance.GetNode("IdLabel")); + return _L_IdLabel; + } + } + private IdLabel _L_IdLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.NameLabel + /// + public NameLabel L_NameLabel + { + get + { + if (_L_NameLabel == null) _L_NameLabel = new NameLabel(UiPanel, Instance.GetNode("NameLabel")); + return _L_NameLabel; + } + } + private NameLabel _L_NameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.TypeLabel + /// + public TypeLabel L_TypeLabel + { + get + { + if (_L_TypeLabel == null) _L_TypeLabel = new TypeLabel(UiPanel, Instance.GetNode("TypeLabel")); + return _L_TypeLabel; + } + } + private TypeLabel _L_TypeLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.WeightEdit + /// + public WeightEdit L_WeightEdit + { + get + { + if (_L_WeightEdit == null) _L_WeightEdit = new WeightEdit(UiPanel, Instance.GetNode("WeightEdit")); + return _L_WeightEdit; + } + } + private WeightEdit _L_WeightEdit; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.CenterContainer + /// + public CenterContainer L_CenterContainer + { + get + { + if (_L_CenterContainer == null) _L_CenterContainer = new CenterContainer(UiPanel, Instance.GetNode("CenterContainer")); + return _L_CenterContainer; + } + } + private CenterContainer _L_CenterContainer; + + public HBoxContainer_3(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_3 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer + /// + public class VBoxContainer_4 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.HBoxContainer + /// + public HBoxContainer_3 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_3(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_3 _L_HBoxContainer; + + public VBoxContainer_4(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_4 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject + /// + public class MarkObject : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.VBoxContainer + /// + public VBoxContainer_4 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_4(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_4 _L_VBoxContainer; + + public MarkObject(MapEditorCreateMarkPanel uiPanel, Godot.PanelContainer node) : base(uiPanel, node) { } + public override MarkObject Clone() => new (UiPanel, (Godot.PanelContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer + /// + public class ScrollContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.MarkObject + /// + public MarkObject L_MarkObject + { + get + { + if (_L_MarkObject == null) _L_MarkObject = new MarkObject(UiPanel, Instance.GetNode("MarkObject")); + return _L_MarkObject; + } + } + private MarkObject _L_MarkObject; + + public ScrollContainer(MapEditorCreateMarkPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer + /// + public class VBoxContainer_3 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.HBoxContainer + /// + public HBoxContainer_2 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_2(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_2 _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.ScrollContainer + /// + public ScrollContainer L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNode("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer _L_ScrollContainer; + + public VBoxContainer_3(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_3 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer + /// + public class MarginContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.VBoxContainer + /// + public VBoxContainer_3 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_3(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_3 _L_VBoxContainer; + + public MarginContainer_1(MapEditorCreateMarkPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer_1 Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel + /// + public class Panel : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.MarginContainer + /// + public MarginContainer_1 L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer_1(UiPanel, Instance.GetNode("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer_1 _L_MarginContainer; + + public Panel(MapEditorCreateMarkPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Panel Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.HBoxContainer3 + /// + public HBoxContainer3 L_HBoxContainer3 + { + get + { + if (_L_HBoxContainer3 == null) _L_HBoxContainer3 = new HBoxContainer3(UiPanel, Instance.GetNode("HBoxContainer3")); + return _L_HBoxContainer3; + } + } + private HBoxContainer3 _L_HBoxContainer3; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.AddMark + /// + public AddMark L_AddMark + { + get + { + if (_L_AddMark == null) _L_AddMark = new AddMark(UiPanel, Instance.GetNode("AddMark")); + return _L_AddMark; + } + } + private AddMark _L_AddMark; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.Panel + /// + public Panel L_Panel + { + get + { + if (_L_Panel == null) _L_Panel = new Panel(UiPanel, Instance.GetNode("Panel")); + return _L_Panel; + } + } + private Panel _L_Panel; + + public VBoxContainer(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public MarginContainer(MapEditorCreateMarkPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ExpandPanel.ExpandGrid + /// + public class ExpandGrid : UiNode + { + public ExpandGrid(MapEditorCreateMarkPanel uiPanel, Godot.GridContainer node) : base(uiPanel, node) { } + public override ExpandGrid Clone() => new (UiPanel, (Godot.GridContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ExpandPanel + /// + public class ExpandPanel : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.ExpandGrid + /// + public ExpandGrid L_ExpandGrid + { + get + { + if (_L_ExpandGrid == null) _L_ExpandGrid = new ExpandGrid(UiPanel, Instance.GetNode("ExpandGrid")); + return _L_ExpandGrid; + } + } + private ExpandGrid _L_ExpandGrid; + + public ExpandPanel(MapEditorCreateMarkPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override ExpandPanel Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.NumberBar.AttrName + /// + public class AttrName : UiNode + { + public AttrName(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override AttrName Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.NumberBar.NumInput + /// + public class NumInput : UiNode + { + public NumInput(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override NumInput Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.NumberBar + /// + public class NumberBar : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.AttrName + /// + public AttrName L_AttrName + { + get + { + if (_L_AttrName == null) _L_AttrName = new AttrName(UiPanel, Instance.GetNode("AttrName")); + return _L_AttrName; + } + } + private AttrName _L_AttrName; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.NumInput + /// + public NumInput L_NumInput + { + get + { + if (_L_NumInput == null) _L_NumInput = new NumInput(UiPanel, Instance.GetNode("NumInput")); + return _L_NumInput; + } + } + private NumInput _L_NumInput; + + public NumberBar(MapEditorCreateMarkPanel uiPanel, UI.MapEditorCreateMark.NumberAttribute node) : base(uiPanel, node) { } + public override NumberBar Clone() => new (UiPanel, (UI.MapEditorCreateMark.NumberAttribute)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.OptionBar.AttrName + /// + public class AttrName_1 : UiNode + { + public AttrName_1(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override AttrName_1 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.OptionBar.OptionInput + /// + public class OptionInput : UiNode + { + public OptionInput(MapEditorCreateMarkPanel uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } + public override OptionInput Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.OptionBar + /// + public class OptionBar : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.AttrName + /// + public AttrName_1 L_AttrName + { + get + { + if (_L_AttrName == null) _L_AttrName = new AttrName_1(UiPanel, Instance.GetNode("AttrName")); + return _L_AttrName; + } + } + private AttrName_1 _L_AttrName; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.OptionInput + /// + public OptionInput L_OptionInput + { + get + { + if (_L_OptionInput == null) _L_OptionInput = new OptionInput(UiPanel, Instance.GetNode("OptionInput")); + return _L_OptionInput; + } + } + private OptionInput _L_OptionInput; + + public OptionBar(MapEditorCreateMarkPanel uiPanel, UI.MapEditorCreateMark.OptionAttribute node) : base(uiPanel, node) { } + public override OptionBar Clone() => new (UiPanel, (UI.MapEditorCreateMark.OptionAttribute)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ObjectBar.AttrName + /// + public class AttrName_2 : UiNode + { + public AttrName_2(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override AttrName_2 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ObjectBar.HBoxContainer.SelectButton + /// + public class SelectButton : UiNode + { + public SelectButton(MapEditorCreateMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override SelectButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ObjectBar.HBoxContainer.ObjectIcon + /// + public class ObjectIcon : UiNode + { + public ObjectIcon(MapEditorCreateMarkPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override ObjectIcon Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ObjectBar.HBoxContainer.ObjectName + /// + public class ObjectName : UiNode + { + public ObjectName(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override ObjectName Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ObjectBar.HBoxContainer.DeleteButton + /// + public class DeleteButton_1 : UiNode + { + public DeleteButton_1(MapEditorCreateMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override DeleteButton_1 Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ObjectBar.HBoxContainer + /// + public class HBoxContainer_4 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar.SelectButton + /// + public SelectButton L_SelectButton + { + get + { + if (_L_SelectButton == null) _L_SelectButton = new SelectButton(UiPanel, Instance.GetNode("SelectButton")); + return _L_SelectButton; + } + } + private SelectButton _L_SelectButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar.ObjectIcon + /// + public ObjectIcon L_ObjectIcon + { + get + { + if (_L_ObjectIcon == null) _L_ObjectIcon = new ObjectIcon(UiPanel, Instance.GetNode("ObjectIcon")); + return _L_ObjectIcon; + } + } + private ObjectIcon _L_ObjectIcon; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar.ObjectName + /// + public ObjectName L_ObjectName + { + get + { + if (_L_ObjectName == null) _L_ObjectName = new ObjectName(UiPanel, Instance.GetNode("ObjectName")); + return _L_ObjectName; + } + } + private ObjectName _L_ObjectName; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar.DeleteButton + /// + public DeleteButton_1 L_DeleteButton + { + get + { + if (_L_DeleteButton == null) _L_DeleteButton = new DeleteButton_1(UiPanel, Instance.GetNode("DeleteButton")); + return _L_DeleteButton; + } + } + private DeleteButton_1 _L_DeleteButton; + + public HBoxContainer_4(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_4 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateMark.ObjectBar + /// + public class ObjectBar : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.AttrName + /// + public AttrName_2 L_AttrName + { + get + { + if (_L_AttrName == null) _L_AttrName = new AttrName_2(UiPanel, Instance.GetNode("AttrName")); + return _L_AttrName; + } + } + private AttrName_2 _L_AttrName; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateMark.HBoxContainer + /// + public HBoxContainer_4 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_4(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_4 _L_HBoxContainer; + + public ObjectBar(MapEditorCreateMarkPanel uiPanel, UI.MapEditorCreateMark.ObjectAttribute node) : base(uiPanel, node) { } + public override ObjectBar Clone() => new (UiPanel, (UI.MapEditorCreateMark.ObjectAttribute)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.PosLabel + /// + public PosLabel S_PosLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_PosLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer.PosX + /// + public PosX S_PosX => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_VBoxContainer.L_HBoxContainer.L_PosX; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2.PosY + /// + public PosY S_PosY => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_VBoxContainer.L_HBoxContainer2.L_PosY; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.SizeLabel + /// + public SizeLabel S_SizeLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer3.L_SizeLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer.SizeX + /// + public SizeX S_SizeX => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer3.L_VBoxContainer.L_HBoxContainer.L_SizeX; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2.SizeY + /// + public SizeY S_SizeY => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer3.L_VBoxContainer.L_HBoxContainer2.L_SizeY; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayContainer.DelayNameLabel + /// + public DelayNameLabel S_DelayNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_DelayContainer.L_DelayNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayContainer.DelayInput + /// + public DelayInput S_DelayInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_DelayContainer.L_DelayInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayContainer + /// + public DelayContainer S_DelayContainer => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_DelayContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.AddMark + /// + public AddMark S_AddMark => L_MarginContainer.L_VBoxContainer.L_AddMark; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.Control + /// + public Control S_Control => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_Control; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.IconTitle + /// + public IconTitle S_IconTitle => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_IconTitle; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.IdTitle + /// + public IdTitle S_IdTitle => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_IdTitle; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.NameTitle + /// + public NameTitle S_NameTitle => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_NameTitle; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.TypeTitle + /// + public TypeTitle S_TypeTitle => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_TypeTitle; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.WeightTitle + /// + public WeightTitle S_WeightTitle => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_WeightTitle; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.ExtraTitle + /// + public ExtraTitle S_ExtraTitle => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_ExtraTitle; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.ExpandButton + /// + public ExpandButton S_ExpandButton => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject.L_VBoxContainer.L_HBoxContainer.L_ExpandButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.Icon + /// + public Icon S_Icon => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject.L_VBoxContainer.L_HBoxContainer.L_Icon; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.IdLabel + /// + public IdLabel S_IdLabel => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject.L_VBoxContainer.L_HBoxContainer.L_IdLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.NameLabel + /// + public NameLabel S_NameLabel => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject.L_VBoxContainer.L_HBoxContainer.L_NameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.TypeLabel + /// + public TypeLabel S_TypeLabel => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject.L_VBoxContainer.L_HBoxContainer.L_TypeLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.WeightEdit + /// + public WeightEdit S_WeightEdit => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject.L_VBoxContainer.L_HBoxContainer.L_WeightEdit; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject.VBoxContainer.HBoxContainer.CenterContainer + /// + public CenterContainer S_CenterContainer => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject.L_VBoxContainer.L_HBoxContainer.L_CenterContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.MarkObject + /// + public MarkObject S_MarkObject => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_MarkObject; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer + /// + public ScrollContainer S_ScrollContainer => L_MarginContainer.L_VBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel + /// + public Panel S_Panel => L_MarginContainer.L_VBoxContainer.L_Panel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.ExpandPanel.ExpandGrid + /// + public ExpandGrid S_ExpandGrid => L_ExpandPanel.L_ExpandGrid; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.ExpandPanel + /// + public ExpandPanel S_ExpandPanel => L_ExpandPanel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.NumberBar.NumInput + /// + public NumInput S_NumInput => L_NumberBar.L_NumInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.NumberBar + /// + public NumberBar S_NumberBar => L_NumberBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.OptionBar.OptionInput + /// + public OptionInput S_OptionInput => L_OptionBar.L_OptionInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.OptionBar + /// + public OptionBar S_OptionBar => L_OptionBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar.HBoxContainer.SelectButton + /// + public SelectButton S_SelectButton => L_ObjectBar.L_HBoxContainer.L_SelectButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar.HBoxContainer.ObjectIcon + /// + public ObjectIcon S_ObjectIcon => L_ObjectBar.L_HBoxContainer.L_ObjectIcon; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar.HBoxContainer.ObjectName + /// + public ObjectName S_ObjectName => L_ObjectBar.L_HBoxContainer.L_ObjectName; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateMark.ObjectBar + /// + public ObjectBar S_ObjectBar => L_ObjectBar; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..ca9769032e5f0de3a9176caddea700f232376e2e --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs @@ -0,0 +1,212 @@ +using System.Collections.Generic; +using Config; +using Godot; + +namespace UI.MapEditorCreateMark; + +public partial class MapEditorCreateMarkPanel : MapEditorCreateMark +{ + + private UiGrid _grid; + private MarkInfo _markInfo; + private bool _preloading; + + public override void OnCreateUi() + { + //隐藏模板对象 + S_ExpandPanel.Instance.Visible = false; + S_NumberBar.Instance.Visible = false; + S_ObjectBar.Instance.Visible = false; + S_OptionBar.Instance.Visible = false; + + //添加标记按钮 + S_AddMark.Instance.Pressed += OnAddMark; + + _grid = new UiGrid(S_MarkObject, typeof(MarkObjectCell)); + _grid.SetColumns(1); + _grid.SetHorizontalExpand(true); + _grid.SetCellOffset(new Vector2I(0, 8)); + + } + + public override void OnDestroyUi() + { + _grid.Destroy(); + } + + /// + /// 初始化面板数据, 用于创建数据 + /// + /// 初始坐标 + /// 是否提前加载 + public void InitData(Vector2I position, bool preloading) + { + _preloading = preloading; + if (preloading) + { + S_DelayContainer.Instance.Visible = false; + } + else + { + S_DelayContainer.Instance.Visible = true; + } + + S_PosX.Instance.Value = position.X; + S_PosY.Instance.Value = position.Y; + } + + /// + /// 初始化面板数据, 用于编辑数据 + /// + /// 标记数据 + /// 是否提前加载 + public void InitData(MarkInfo data, bool preloading) + { + _markInfo = data; + _preloading = preloading; + S_SizeX.Instance.Value = data.Size.X; + S_SizeY.Instance.Value = data.Size.Y; + S_PosX.Instance.Value = data.Position.X; + S_PosY.Instance.Value = data.Position.Y; + if (preloading) + { + S_DelayContainer.Instance.Visible = false; + } + else + { + S_DelayContainer.Instance.Visible = true; + S_DelayInput.Instance.Value = data.DelayTime; + } + + if (_markInfo.SpecialMarkType == SpecialMarkType.BirthPoint) //出生标记 + { + var markInfoItem = new MarkInfoItem(); + markInfoItem.Id = ActivityObject.Ids.Id_role0001; + markInfoItem.SpecialMarkType = _markInfo.SpecialMarkType; + _grid.Add(markInfoItem); + //隐藏选项 + S_AddMark.Instance.Visible = false; + S_DelayContainer.Instance.Visible = false; + } + else //普通标记 + { + _grid.SetDataList(data.MarkList.ToArray()); + S_AddMark.Instance.Visible = true; + S_DelayContainer.Instance.Visible = true; + } + } + + /// + /// 获取填写的标记数据 + /// + public MarkInfo GetMarkInfo() + { + if (_grid.Count == 0) + { + EditorWindowManager.ShowTips("警告", "必须添加一个物体!"); + return null; + } + + var data = new MarkInfo(); + data.Position = new SerializeVector2(); + data.MarkList = new List(); + if (!_preloading) + { + data.DelayTime = (float)S_DelayInput.Instance.Value; + } + else + { + data.DelayTime = 0; + } + data.Position = new SerializeVector2((float)S_PosX.Instance.Value, (float)S_PosY.Instance.Value); + data.Size = new SerializeVector2((float)S_SizeX.Instance.Value, (float)S_SizeY.Instance.Value); + + if (_markInfo != null) + { + data.SpecialMarkType = _markInfo.SpecialMarkType; + } + else + { + data.SpecialMarkType = SpecialMarkType.Normal; + } + + //标记物体数据 + if (data.SpecialMarkType == SpecialMarkType.BirthPoint) //出生标记 + { + + } + else //普通标记 + { + var gridCount = _grid.Count; + for (var i = 0; i < gridCount; i++) + { + var uiCell = (MarkObjectCell)_grid.GetCell(i); + var markInfoItem = uiCell.GetMarkInfoItem(); + data.MarkList.Add(markInfoItem); + } + } + + return data; + } + + /// + /// 创建数值属性数据 + /// + /// 属性字符串名称 + /// 属性显示名称 + public NumberBar CreateNumberBar(string attrName, string attrLabel) + { + var numberBar = S_NumberBar.Clone(); + numberBar.Instance.AttrName = attrName; + numberBar.L_AttrName.Instance.Text = attrLabel; + numberBar.Instance.Visible = true; + return numberBar; + } + + /// + /// 创建选择物体属性数据 + /// + /// 属性字符串名称 + /// 属性显示名称 + /// 可选择的物体类型 + public ObjectBar CreateObjectBar(string attrName, string attrLabel, ActivityType activityType) + { + var objectBar = S_ObjectBar.Clone(); + objectBar.Instance.AttrName = attrName; + objectBar.Instance.ActivityType = activityType; + objectBar.L_AttrName.Instance.Text = attrLabel; + objectBar.Instance.Visible = true; + return objectBar; + } + + /// + /// 创建选项属性数据 + /// + /// 属性字符串名称 + /// 属性显示名称 + /// + public OptionBar CreateOptionBar(string attrName, string attrLabel) + { + var optionBar = S_OptionBar.Clone(); + optionBar.Instance.AttrName = attrName; + optionBar.L_AttrName.Instance.Text = attrLabel; + optionBar.Instance.Visible = true; + return optionBar; + } + + //点击添加标记按钮 + private void OnAddMark() + { + EditorWindowManager.ShowSelectObject(ActivityType.None, OnSelectObject, this); + } + + //选中物体回调, 创建标记数据 + private void OnSelectObject(ExcelConfig.ActivityObject activityObject) + { + _grid.Add(new MarkInfoItem() + { + Id = activityObject.Id, + Weight = 100, + }); + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MarkObjectCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MarkObjectCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..aefa59ccfa50252b9fc97de4376a6c2127c7cb7b --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MarkObjectCell.cs @@ -0,0 +1,299 @@ +using System; +using System.Collections.Generic; +using Config; + +namespace UI.MapEditorCreateMark; + +public class MarkObjectCell : UiCell +{ + //是否展开 + private bool _isExpand = false; + private MapEditorCreateMark.ExpandPanel _expandPanel; + //自定义额外属性 + private List _attributeBases; + private ExcelConfig.ActivityObject _activityObject; + + private MapEditorCreateMark.NumberBar _altitude; + private MapEditorCreateMark.NumberBar _vSpeed; + + public override void OnInit() + { + CellNode.L_VBoxContainer.L_HBoxContainer.L_ExpandButton.Instance.Pressed += OnExpandClick; + CellNode.L_VBoxContainer.L_HBoxContainer.L_CenterContainer.L_DeleteButton.Instance.Pressed += OnDeleteClick; + } + + public override void OnSetData(MarkInfoItem data) + { + //记得判断随机对象, 后面再做 + _activityObject = ExcelConfig.ActivityObject_Map[data.Id]; + //图标 + if (string.IsNullOrEmpty(_activityObject.Icon)) + { + CellNode.L_VBoxContainer.L_HBoxContainer.L_Icon.Instance.Visible = false; + } + else + { + CellNode.L_VBoxContainer.L_HBoxContainer.L_Icon.Instance.Visible = true; + CellNode.L_VBoxContainer.L_HBoxContainer.L_Icon.Instance.Texture = ResourceManager.LoadTexture2D(_activityObject.Icon); + } + //物体Id + CellNode.L_VBoxContainer.L_HBoxContainer.L_IdLabel.Instance.Text = data.Id; + //物体名称 + CellNode.L_VBoxContainer.L_HBoxContainer.L_NameLabel.Instance.Text = _activityObject.Name; + //物体类型 + CellNode.L_VBoxContainer.L_HBoxContainer.L_TypeLabel.Instance.Text = NameManager.GetActivityTypeName(_activityObject.Type); + //权重 + CellNode.L_VBoxContainer.L_HBoxContainer.L_WeightEdit.Instance.Value = data.Weight; + + if (data.SpecialMarkType == SpecialMarkType.BirthPoint) //出生标记 + { + CellNode.L_VBoxContainer.L_HBoxContainer.L_CenterContainer.L_DeleteButton.Instance.Visible = false; + CellNode.L_VBoxContainer.L_HBoxContainer.L_WeightEdit.Instance.Visible = false; + } + else //普通标记 + { + // 包含额外属性 + if (_expandPanel == null) + { + CreateExpandPanel(_activityObject, data); + } + CellNode.L_VBoxContainer.L_HBoxContainer.L_CenterContainer.L_DeleteButton.Instance.Visible = true; + CellNode.L_VBoxContainer.L_HBoxContainer.L_WeightEdit.Instance.Visible = true; + } + } + + public override void OnDisable() + { + if (_expandPanel != null) + { + _attributeBases.Clear(); + _attributeBases = null; + _expandPanel.QueueFree(); + _expandPanel = null; + _altitude = null; + _vSpeed = null; + } + + SetExpandState(false); + } + + /// + /// 获取标记数据对象 + /// + public MarkInfoItem GetMarkInfoItem() + { + var markInfoItem = Data; + + //额外属性 + if (_attributeBases != null) + { + markInfoItem.Attr = null; + foreach (var attributeBase in _attributeBases) + { + if (attributeBase.Visible) + { + if (attributeBase.AttrName == "VSpeed" || attributeBase.AttrName == "Altitude") //不能是公共属性 + { + continue; + } + + if (markInfoItem.Attr == null) + { + markInfoItem.Attr = new Dictionary(); + } + markInfoItem.Attr.Add(attributeBase.AttrName, attributeBase.GetAttributeValue()); + } + } + } + + + if (Data.SpecialMarkType == SpecialMarkType.Normal) + { + //权重 + markInfoItem.Weight = (int)CellNode.L_VBoxContainer.L_HBoxContainer.L_WeightEdit.Instance.Value; + } + + //海拔高度 + if (_altitude != null && _altitude.Instance.Visible) + { + markInfoItem.Altitude = (int)_altitude.L_NumInput.Instance.Value; + } + //纵轴速度 + if (_vSpeed != null && _vSpeed.Instance.Visible)//海拔高度 + { + markInfoItem.VerticalSpeed = (float)_vSpeed.L_NumInput.Instance.Value; + } + + return markInfoItem; + } + + //点击删除按钮 + private void OnDeleteClick() + { + Grid.RemoveByIndex(Index); + } + + //点击展开按钮 + private void OnExpandClick() + { + //展开图标 + SetExpandState(!_isExpand); + } + + //设置展开状态 + private void SetExpandState(bool flag) + { + _isExpand = flag; + if (_isExpand) + { + CellNode.L_VBoxContainer.L_HBoxContainer.L_ExpandButton.Instance.Icon = + ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Down_png); + } + else + { + CellNode.L_VBoxContainer.L_HBoxContainer.L_ExpandButton.Instance.Icon = + ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Right_png); + } + + if (_expandPanel != null) + { + _expandPanel.Instance.Visible = _isExpand; + } + } + + private void CreateExpandPanel(ExcelConfig.ActivityObject activityObject, MarkInfoItem markInfoItem) + { + if (_expandPanel != null) + { + throw new Exception("已经创建过ExpandPanel, 不能重复创建!"); + } + + _expandPanel = CellNode.UiPanel.S_ExpandPanel.Clone(); + _expandPanel.Instance.Visible = _isExpand; + CellNode.L_VBoxContainer.AddChild(_expandPanel); + + //公有类型 + _altitude = CellNode.UiPanel.CreateNumberBar("Altitude", "初始纵轴高度:"); + _vSpeed = CellNode.UiPanel.CreateNumberBar("VSpeed", "初始纵轴速度:"); + _altitude.L_NumInput.Instance.MaxValue = 128; + _altitude.L_NumInput.Instance.MinValue = 0; + _altitude.L_NumInput.Instance.Step = 1; + _vSpeed.L_NumInput.Instance.MaxValue = 1000; + _vSpeed.L_NumInput.Instance.MinValue = -1000; + _vSpeed.L_NumInput.Instance.Step = 0.1; + _expandPanel.L_ExpandGrid.AddChild(_altitude); + _expandPanel.L_ExpandGrid.AddChild(_vSpeed); + + if (markInfoItem != null) + { + if (markInfoItem.Attr == null) + { + //初始高度 + if (activityObject.Type == (int)ActivityType.Weapon || activityObject.Type == (int)ActivityType.Prop) + { + _altitude.L_NumInput.Instance.Value = 8; + } + } + else + { + //海拔高度 + _altitude.L_NumInput.Instance.Value = markInfoItem.Altitude; + //纵轴速度 + _vSpeed.L_NumInput.Instance.Value = markInfoItem.VerticalSpeed; + } + } + + if (activityObject.Type == (int)ActivityType.Weapon) //武器类型 + { + var numberBar = CellNode.UiPanel.CreateNumberBar("CurrAmmon", "弹夹弹药量:"); + var numberBar2 = CellNode.UiPanel.CreateNumberBar("ResidueAmmo", "剩余弹药量:"); + _expandPanel.L_ExpandGrid.AddChild(numberBar); + _expandPanel.L_ExpandGrid.AddChild(numberBar2); + _attributeBases = new List(); + _attributeBases.Add(numberBar.Instance); + _attributeBases.Add(numberBar2.Instance); + + if (markInfoItem != null) //初始化数据 + { + numberBar.L_NumInput.Instance.MinValue = 0; + numberBar2.L_NumInput.Instance.MinValue = 0; + //武器配置数据 + var weapon = ExcelConfig.Weapon_List.Find(weapon => weapon.WeaponId == activityObject.Id); + if (weapon != null) + { + numberBar.L_NumInput.Instance.MaxValue = weapon.AmmoCapacity; //弹夹上限 + numberBar2.L_NumInput.Instance.MaxValue = weapon.MaxAmmoCapacity; //容量上限 + } + + if (markInfoItem.Attr != null) + { + if (markInfoItem.Attr.TryGetValue("CurrAmmon", out var currAmmon)) //弹夹弹药量 + { + numberBar.L_NumInput.Instance.Value = float.Parse(currAmmon); + } + if (markInfoItem.Attr.TryGetValue("ResidueAmmo", out var residueAmmo)) //剩余弹药量 + { + numberBar2.L_NumInput.Instance.Value = float.Parse(residueAmmo); + } + } + else + { + numberBar.L_NumInput.Instance.Value = numberBar.L_NumInput.Instance.MaxValue; + numberBar2.L_NumInput.Instance.Value = (int)(numberBar2.L_NumInput.Instance.MaxValue / 2); + } + } + } + else if (activityObject.Type == (int)ActivityType.Enemy) //敌人 + { + var faceBar = CellNode.UiPanel.CreateOptionBar("Face", "脸朝向:"); + faceBar.Instance.AddItem("随机", 0); + faceBar.Instance.AddItem("左", (int)FaceDirection.Left); + faceBar.Instance.AddItem("右", (int)FaceDirection.Right); + var weaponBar = CellNode.UiPanel.CreateObjectBar("Weapon", "携带武器:", ActivityType.Weapon); + var numberBar2 = CellNode.UiPanel.CreateNumberBar("CurrAmmon", "弹夹弹药量:"); + var numberBar3 = CellNode.UiPanel.CreateNumberBar("ResidueAmmo", "剩余弹药量:"); + weaponBar.Instance.SetRelevancyAttr(numberBar2, numberBar3); + _expandPanel.L_ExpandGrid.AddChild(faceBar); + _expandPanel.L_ExpandGrid.AddChild(weaponBar); + _expandPanel.L_ExpandGrid.AddChild(numberBar2); + _expandPanel.L_ExpandGrid.AddChild(numberBar3); + _attributeBases = new List(); + _attributeBases.Add(faceBar.Instance); + _attributeBases.Add(weaponBar.Instance); + _attributeBases.Add(numberBar2.Instance); + _attributeBases.Add(numberBar3.Instance); + + if (markInfoItem != null) //初始化数据 + { + numberBar2.L_NumInput.Instance.MinValue = 0; + numberBar3.L_NumInput.Instance.MinValue = 0; + + if (markInfoItem.Attr != null) + { + if (markInfoItem.Attr.TryGetValue("Face", out var face)) //朝向 + { + faceBar.Instance.SetSelectItem(int.Parse(face)); + } + if (markInfoItem.Attr.TryGetValue("Weapon", out var weaponId)) //武器 + { + weaponBar.Instance.SelectWeapon(ExcelConfig.Weapon_List.Find(w => w.WeaponId == weaponId)); + } + if (markInfoItem.Attr.TryGetValue("CurrAmmon", out var currAmmon)) //弹夹弹药量 + { + numberBar2.L_NumInput.Instance.Value = float.Parse(currAmmon); + } + if (markInfoItem.Attr.TryGetValue("ResidueAmmo", out var residueAmmo)) //剩余弹药量 + { + numberBar3.L_NumInput.Instance.Value = float.Parse(residueAmmo); + } + } + else + { + faceBar.Instance.SetSelectItem(0); + numberBar2.L_NumInput.Instance.Value = numberBar2.L_NumInput.Instance.MaxValue; + numberBar3.L_NumInput.Instance.Value = (int)(numberBar3.L_NumInput.Instance.MaxValue / 2); + } + } + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/AttributeBase.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/AttributeBase.cs new file mode 100644 index 0000000000000000000000000000000000000000..e031006389d058775fccac0c96e332809820acd3 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/AttributeBase.cs @@ -0,0 +1,19 @@ +using Godot; + +namespace UI.MapEditorCreateMark; + +public abstract partial class AttributeBase : Control, IUiNodeScript +{ + /// + /// 属性名称 + /// + public string AttrName { get; set; } + + public abstract void SetUiNode(IUiNode uiNode); + public abstract void OnDestroy(); + + /// + /// 获取属性值 + /// + public abstract string GetAttributeValue(); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/NumberAttribute.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/NumberAttribute.cs new file mode 100644 index 0000000000000000000000000000000000000000..c6aa845ddb8c00456e6babc66867c1cb57c4784e --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/NumberAttribute.cs @@ -0,0 +1,24 @@ +using System.Globalization; +using Godot; + +namespace UI.MapEditorCreateMark; + +public partial class NumberAttribute : AttributeBase +{ + private MapEditorCreateMark.NumberBar _numberBar; + + public override void SetUiNode(IUiNode uiNode) + { + _numberBar = (MapEditorCreateMark.NumberBar)uiNode; + } + + public override void OnDestroy() + { + + } + + public override string GetAttributeValue() + { + return _numberBar.L_NumInput.Instance.Value.ToString(CultureInfo.InvariantCulture); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs new file mode 100644 index 0000000000000000000000000000000000000000..0761a9ac917e6db2d85a6ff818691f672002ed0e --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/ObjectAttribute.cs @@ -0,0 +1,105 @@ +using Config; + +namespace UI.MapEditorCreateMark; + +public partial class ObjectAttribute : AttributeBase +{ + /// + /// 可选择的物体类型 + /// + public ActivityType ActivityType { get; set; } + private MapEditorCreateMark.ObjectBar _objectBar; + //选择的武器数据 + private ExcelConfig.Weapon _selectWeapon; + //关联属性 + private MapEditorCreateMark.NumberBar _currAmmonAttr; + private MapEditorCreateMark.NumberBar _residueAmmoAttr; + + public override void SetUiNode(IUiNode uiNode) + { + _objectBar = (MapEditorCreateMark.ObjectBar)uiNode; + _objectBar.L_HBoxContainer.L_SelectButton.Instance.Pressed += OnClickEdit; + _objectBar.L_HBoxContainer.L_DeleteButton.Instance.Pressed += OnClickDelete; + } + + public override void OnDestroy() + { + + } + + public override string GetAttributeValue() + { + if (_selectWeapon == null) + { + return null; + } + return _selectWeapon.WeaponId; + } + + //点击编辑按钮 + private void OnClickEdit() + { + EditorWindowManager.ShowSelectObject(ActivityType.Weapon, OnSelectObject, _objectBar.UiPanel); + } + + //点击删除按钮 + private void OnClickDelete() + { + SelectWeapon(null); + } + + private void OnSelectObject(ExcelConfig.ActivityObject activityObject) + { + var weapon = ExcelConfig.Weapon_List.Find(weapon => weapon.WeaponId == activityObject.Id); + if (weapon != null) + { + SelectWeapon(weapon); + } + } + + /// + /// 设置选择的武器物体 + /// + public void SelectWeapon(ExcelConfig.Weapon weapon) + { + if (weapon == null) + { + _objectBar.L_HBoxContainer.L_DeleteButton.Instance.Visible = false; + _selectWeapon = null; + //隐藏关联属性 + _currAmmonAttr.Instance.Visible = false; + _residueAmmoAttr.Instance.Visible = false; + _objectBar.L_HBoxContainer.L_ObjectIcon.Instance.Visible = false; + _objectBar.L_HBoxContainer.L_ObjectName.Instance.Text = "<未选择>"; + } + else + { + _objectBar.L_HBoxContainer.L_DeleteButton.Instance.Visible = true; + _selectWeapon = weapon; + var o = ExcelConfig.ActivityObject_Map[weapon.WeaponId]; + //显示关联属性 + _currAmmonAttr.Instance.Visible = true; + _residueAmmoAttr.Instance.Visible = true; + //显示数据 + _objectBar.L_HBoxContainer.L_ObjectName.Instance.Text = o.Name; + _objectBar.L_HBoxContainer.L_ObjectIcon.Instance.Visible = true; + _objectBar.L_HBoxContainer.L_ObjectIcon.Instance.Texture = ResourceManager.LoadTexture2D(o.Icon); + //弹药 + _currAmmonAttr.L_NumInput.Instance.MaxValue = weapon.AmmoCapacity; + _currAmmonAttr.L_NumInput.Instance.Value = weapon.AmmoCapacity; + _residueAmmoAttr.L_NumInput.Instance.MaxValue = weapon.MaxAmmoCapacity; + _residueAmmoAttr.L_NumInput.Instance.Value = weapon.AmmoCapacity; + } + } + + /// + /// 设置关联的属性 + /// + public void SetRelevancyAttr(MapEditorCreateMark.NumberBar currAmmonAttr, MapEditorCreateMark.NumberBar residueAmmoAttr) + { + _currAmmonAttr = currAmmonAttr; + _residueAmmoAttr = residueAmmoAttr; + currAmmonAttr.Instance.Visible = false; + residueAmmoAttr.Instance.Visible = false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/OptionAttribute.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/OptionAttribute.cs new file mode 100644 index 0000000000000000000000000000000000000000..14818294f2f988a933a72d58a0dc215cecb8ae57 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/attribute/OptionAttribute.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; + +namespace UI.MapEditorCreateMark; + +public partial class OptionAttribute : AttributeBase +{ + private MapEditorCreateMark.OptionBar _optionBar; + private int _index = 0; + private Dictionary _map = new Dictionary(); + + public override void SetUiNode(IUiNode uiNode) + { + _optionBar = (MapEditorCreateMark.OptionBar)uiNode; + } + + public override void OnDestroy() + { + + } + + public override string GetAttributeValue() + { + return _map[_optionBar.L_OptionInput.Instance.Selected].ToString(); + } + + /// + /// 根据值选中选项 + /// + public void SetSelectItem(int value) + { + foreach (var keyValuePair in _map) + { + if (keyValuePair.Value == value) + { + _optionBar.L_OptionInput.Instance.Select(keyValuePair.Key); + return; + } + } + _optionBar.L_OptionInput.Instance.Select(-1); + } + + /// + /// 添加选项 + /// + /// 选项显示文本 + /// 选项值 + public void AddItem(string label, int value) + { + var index = _index++; + _map.Add(index, value); + _optionBar.L_OptionInput.Instance.AddItem(label, index); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreatePreinstall/MapEditorCreatePreinstall.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreatePreinstall/MapEditorCreatePreinstall.cs new file mode 100644 index 0000000000000000000000000000000000000000..21b973f6e56c051f79bb2e7dfd60292f2a23fe6c --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreatePreinstall/MapEditorCreatePreinstall.cs @@ -0,0 +1,315 @@ +namespace UI.MapEditorCreatePreinstall; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorCreatePreinstall : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer((MapEditorCreatePreinstallPanel)this, GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + + public MapEditorCreatePreinstall() : base(nameof(MapEditorCreatePreinstall)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer.PreinstallNameLabel + /// + public class PreinstallNameLabel : UiNode + { + public PreinstallNameLabel(MapEditorCreatePreinstallPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override PreinstallNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer.PreinstallNameInput + /// + public class PreinstallNameInput : UiNode + { + public PreinstallNameInput(MapEditorCreatePreinstallPanel uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override PreinstallNameInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.PreinstallNameLabel + /// + public PreinstallNameLabel L_PreinstallNameLabel + { + get + { + if (_L_PreinstallNameLabel == null) _L_PreinstallNameLabel = new PreinstallNameLabel(UiPanel, Instance.GetNodeOrNull("PreinstallNameLabel")); + return _L_PreinstallNameLabel; + } + } + private PreinstallNameLabel _L_PreinstallNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.PreinstallNameInput + /// + public PreinstallNameInput L_PreinstallNameInput + { + get + { + if (_L_PreinstallNameInput == null) _L_PreinstallNameInput = new PreinstallNameInput(UiPanel, Instance.GetNodeOrNull("PreinstallNameInput")); + return _L_PreinstallNameInput; + } + } + private PreinstallNameInput _L_PreinstallNameInput; + + public HBoxContainer(MapEditorCreatePreinstallPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer4.WeightNameLabel + /// + public class WeightNameLabel : UiNode + { + public WeightNameLabel(MapEditorCreatePreinstallPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override WeightNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer4.WeightInput + /// + public class WeightInput : UiNode + { + public WeightInput(MapEditorCreatePreinstallPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override WeightInput Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer4 + /// + public class HBoxContainer4 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.WeightNameLabel + /// + public WeightNameLabel L_WeightNameLabel + { + get + { + if (_L_WeightNameLabel == null) _L_WeightNameLabel = new WeightNameLabel(UiPanel, Instance.GetNodeOrNull("WeightNameLabel")); + return _L_WeightNameLabel; + } + } + private WeightNameLabel _L_WeightNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.WeightInput + /// + public WeightInput L_WeightInput + { + get + { + if (_L_WeightInput == null) _L_WeightInput = new WeightInput(UiPanel, Instance.GetNodeOrNull("WeightInput")); + return _L_WeightInput; + } + } + private WeightInput _L_WeightInput; + + public HBoxContainer4(MapEditorCreatePreinstallPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer4 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public class RemarkNameLabel : UiNode + { + public RemarkNameLabel(MapEditorCreatePreinstallPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RemarkNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public class RemarkInput : UiNode + { + public RemarkInput(MapEditorCreatePreinstallPanel uiPanel, Godot.TextEdit node) : base(uiPanel, node) { } + public override RemarkInput Clone() => new (UiPanel, (Godot.TextEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public class HBoxContainer5 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.RemarkNameLabel + /// + public RemarkNameLabel L_RemarkNameLabel + { + get + { + if (_L_RemarkNameLabel == null) _L_RemarkNameLabel = new RemarkNameLabel(UiPanel, Instance.GetNodeOrNull("RemarkNameLabel")); + return _L_RemarkNameLabel; + } + } + private RemarkNameLabel _L_RemarkNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.RemarkInput + /// + public RemarkInput L_RemarkInput + { + get + { + if (_L_RemarkInput == null) _L_RemarkInput = new RemarkInput(UiPanel, Instance.GetNodeOrNull("RemarkInput")); + return _L_RemarkInput; + } + } + private RemarkInput _L_RemarkInput; + + public HBoxContainer5(MapEditorCreatePreinstallPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer5 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.HBoxContainer4 + /// + public HBoxContainer4 L_HBoxContainer4 + { + get + { + if (_L_HBoxContainer4 == null) _L_HBoxContainer4 = new HBoxContainer4(UiPanel, Instance.GetNodeOrNull("HBoxContainer4")); + return _L_HBoxContainer4; + } + } + private HBoxContainer4 _L_HBoxContainer4; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.HBoxContainer5 + /// + public HBoxContainer5 L_HBoxContainer5 + { + get + { + if (_L_HBoxContainer5 == null) _L_HBoxContainer5 = new HBoxContainer5(UiPanel, Instance.GetNodeOrNull("HBoxContainer5")); + return _L_HBoxContainer5; + } + } + private HBoxContainer5 _L_HBoxContainer5; + + public VBoxContainer(MapEditorCreatePreinstallPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreatePreinstall.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreatePreinstall.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public MarginContainer(MapEditorCreatePreinstallPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer.PreinstallNameLabel + /// + public PreinstallNameLabel S_PreinstallNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_PreinstallNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer.PreinstallNameInput + /// + public PreinstallNameInput S_PreinstallNameInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_PreinstallNameInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_MarginContainer.L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer4.WeightNameLabel + /// + public WeightNameLabel S_WeightNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer4.L_WeightNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer4.WeightInput + /// + public WeightInput S_WeightInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer4.L_WeightInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer4 + /// + public HBoxContainer4 S_HBoxContainer4 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer4; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public RemarkNameLabel S_RemarkNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public RemarkInput S_RemarkInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public HBoxContainer5 S_HBoxContainer5 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_MarginContainer.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreatePreinstall.MarginContainer + /// + public MarginContainer S_MarginContainer => L_MarginContainer; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreatePreinstall/MapEditorCreatePreinstallPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreatePreinstall/MapEditorCreatePreinstallPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..7730e2ee878610f859c2f28b181f9cc3c3de10cd --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreatePreinstall/MapEditorCreatePreinstallPanel.cs @@ -0,0 +1,100 @@ +using System.Collections.Generic; +using System.Text.RegularExpressions; +using Godot; + +namespace UI.MapEditorCreatePreinstall; + +public partial class MapEditorCreatePreinstallPanel : MapEditorCreatePreinstall +{ + private RoomPreinstallInfo _roomPreinstallInfo; + private DungeonRoomType _roomType; + + /// + /// 初始化房间预设数据, 用于创建预设 + /// + public void InitData(DungeonRoomType roomType) + { + _roomType = roomType; + } + + /// + /// 初始化房间预设数据, 用于编辑预设 + /// + public void InitData(DungeonRoomType roomType, RoomPreinstallInfo preinstallInfo) + { + InitData(roomType); + _roomPreinstallInfo = preinstallInfo; + S_PreinstallNameInput.Instance.Text = preinstallInfo.Name; + S_WeightInput.Instance.Value = preinstallInfo.Weight; + S_RemarkInput.Instance.Text = preinstallInfo.Remark; + } + + /// + /// 填完数据后创建数据进行验证并创建数据对象, 如果验证失败, 则返回null + /// + public RoomPreinstallInfo GetRoomPreinstall(List roomPreinstalls) + { + RoomPreinstallInfo data; + if (_roomPreinstallInfo != null) //编辑数据 + { + data = _roomPreinstallInfo; + data.Name = S_PreinstallNameInput.Instance.Text; + //检查名称是否合规 + if (string.IsNullOrEmpty(data.Name)) + { + EditorWindowManager.ShowTips("错误", "预设名称不能为空!"); + return null; + } + var index = roomPreinstalls.FindIndex(preinstall => preinstall.Name == data.Name && preinstall != _roomPreinstallInfo); + if (index >= 0) + { + EditorWindowManager.ShowTips("错误", "当前房间已经存在预设名称'" + data.Name + "', 请使用其他名称!"); + return null; + } + + data.Remark = S_RemarkInput.Instance.Text; + data.Weight = (int)S_WeightInput.Instance.Value; + } + else //创建数据 + { + data = new RoomPreinstallInfo(); + data.Name = S_PreinstallNameInput.Instance.Text; + //检查名称是否合规 + if (string.IsNullOrEmpty(data.Name)) + { + EditorWindowManager.ShowTips("错误", "预设名称不能为空!"); + return null; + } + + var index = roomPreinstalls.FindIndex(preinstall => preinstall.Name == data.Name); + if (index >= 0) + { + EditorWindowManager.ShowTips("错误", "当前房间已经存在预设名称'" + data.Name + "', 请使用其他名称!"); + return null; + } + + data.Remark = S_RemarkInput.Instance.Text; + data.Weight = (int)S_WeightInput.Instance.Value; + //预加载波 + data.InitWaveList(); + CreateSpecialMark(data.WaveList); + } + return data; + } + + //创建特殊标记 + private void CreateSpecialMark(List> dataWaveList) + { + if (_roomType == DungeonRoomType.Inlet) //初始房间 + { + var preloading = dataWaveList[0]; + //玩家标记 + var markInfo = new MarkInfo(); + markInfo.Position = new SerializeVector2(); + markInfo.Size = new SerializeVector2(); + markInfo.SpecialMarkType = SpecialMarkType.BirthPoint; + markInfo.MarkList = new List(); + preloading.Add(markInfo); + } + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateRoom/MapEditorCreateRoom.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateRoom/MapEditorCreateRoom.cs new file mode 100644 index 0000000000000000000000000000000000000000..b59e673dd17552a81365c6d7b7b28696a0001eb6 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateRoom/MapEditorCreateRoom.cs @@ -0,0 +1,477 @@ +namespace UI.MapEditorCreateRoom; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorCreateRoom : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(this, GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + + public MapEditorCreateRoom() : base(nameof(MapEditorCreateRoom)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer.RoomNameLabel + /// + public class RoomNameLabel : UiNode + { + public RoomNameLabel(MapEditorCreateRoom uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer.RoomNameInput + /// + public class RoomNameInput : UiNode + { + public RoomNameInput(MapEditorCreateRoom uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override RoomNameInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.RoomNameLabel + /// + public RoomNameLabel L_RoomNameLabel + { + get + { + if (_L_RoomNameLabel == null) _L_RoomNameLabel = new RoomNameLabel(UiPanel, Instance.GetNodeOrNull("RoomNameLabel")); + return _L_RoomNameLabel; + } + } + private RoomNameLabel _L_RoomNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.RoomNameInput + /// + public RoomNameInput L_RoomNameInput + { + get + { + if (_L_RoomNameInput == null) _L_RoomNameInput = new RoomNameInput(UiPanel, Instance.GetNodeOrNull("RoomNameInput")); + return _L_RoomNameInput; + } + } + private RoomNameInput _L_RoomNameInput; + + public HBoxContainer(MapEditorCreateRoom uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer2.GroupNameLabel + /// + public class GroupNameLabel : UiNode + { + public GroupNameLabel(MapEditorCreateRoom uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override GroupNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer2.GroupSelect + /// + public class GroupSelect : UiNode + { + public GroupSelect(MapEditorCreateRoom uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } + public override GroupSelect Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer2 + /// + public class HBoxContainer2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.GroupNameLabel + /// + public GroupNameLabel L_GroupNameLabel + { + get + { + if (_L_GroupNameLabel == null) _L_GroupNameLabel = new GroupNameLabel(UiPanel, Instance.GetNodeOrNull("GroupNameLabel")); + return _L_GroupNameLabel; + } + } + private GroupNameLabel _L_GroupNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.GroupSelect + /// + public GroupSelect L_GroupSelect + { + get + { + if (_L_GroupSelect == null) _L_GroupSelect = new GroupSelect(UiPanel, Instance.GetNodeOrNull("GroupSelect")); + return _L_GroupSelect; + } + } + private GroupSelect _L_GroupSelect; + + public HBoxContainer2(MapEditorCreateRoom uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer3.TypeNameLabel + /// + public class TypeNameLabel : UiNode + { + public TypeNameLabel(MapEditorCreateRoom uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override TypeNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer3.TypeSelect + /// + public class TypeSelect : UiNode + { + public TypeSelect(MapEditorCreateRoom uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } + public override TypeSelect Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer3 + /// + public class HBoxContainer3 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.TypeNameLabel + /// + public TypeNameLabel L_TypeNameLabel + { + get + { + if (_L_TypeNameLabel == null) _L_TypeNameLabel = new TypeNameLabel(UiPanel, Instance.GetNodeOrNull("TypeNameLabel")); + return _L_TypeNameLabel; + } + } + private TypeNameLabel _L_TypeNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.TypeSelect + /// + public TypeSelect L_TypeSelect + { + get + { + if (_L_TypeSelect == null) _L_TypeSelect = new TypeSelect(UiPanel, Instance.GetNodeOrNull("TypeSelect")); + return _L_TypeSelect; + } + } + private TypeSelect _L_TypeSelect; + + public HBoxContainer3(MapEditorCreateRoom uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer3 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer4.WeightNameLabel + /// + public class WeightNameLabel : UiNode + { + public WeightNameLabel(MapEditorCreateRoom uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override WeightNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer4.WeightInput + /// + public class WeightInput : UiNode + { + public WeightInput(MapEditorCreateRoom uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override WeightInput Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer4 + /// + public class HBoxContainer4 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.WeightNameLabel + /// + public WeightNameLabel L_WeightNameLabel + { + get + { + if (_L_WeightNameLabel == null) _L_WeightNameLabel = new WeightNameLabel(UiPanel, Instance.GetNodeOrNull("WeightNameLabel")); + return _L_WeightNameLabel; + } + } + private WeightNameLabel _L_WeightNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.WeightInput + /// + public WeightInput L_WeightInput + { + get + { + if (_L_WeightInput == null) _L_WeightInput = new WeightInput(UiPanel, Instance.GetNodeOrNull("WeightInput")); + return _L_WeightInput; + } + } + private WeightInput _L_WeightInput; + + public HBoxContainer4(MapEditorCreateRoom uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer4 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public class RemarkNameLabel : UiNode + { + public RemarkNameLabel(MapEditorCreateRoom uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RemarkNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public class RemarkInput : UiNode + { + public RemarkInput(MapEditorCreateRoom uiPanel, Godot.TextEdit node) : base(uiPanel, node) { } + public override RemarkInput Clone() => new (UiPanel, (Godot.TextEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public class HBoxContainer5 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.RemarkNameLabel + /// + public RemarkNameLabel L_RemarkNameLabel + { + get + { + if (_L_RemarkNameLabel == null) _L_RemarkNameLabel = new RemarkNameLabel(UiPanel, Instance.GetNodeOrNull("RemarkNameLabel")); + return _L_RemarkNameLabel; + } + } + private RemarkNameLabel _L_RemarkNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.RemarkInput + /// + public RemarkInput L_RemarkInput + { + get + { + if (_L_RemarkInput == null) _L_RemarkInput = new RemarkInput(UiPanel, Instance.GetNodeOrNull("RemarkInput")); + return _L_RemarkInput; + } + } + private RemarkInput _L_RemarkInput; + + public HBoxContainer5(MapEditorCreateRoom uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer5 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.HBoxContainer2 + /// + public HBoxContainer2 L_HBoxContainer2 + { + get + { + if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new HBoxContainer2(UiPanel, Instance.GetNodeOrNull("HBoxContainer2")); + return _L_HBoxContainer2; + } + } + private HBoxContainer2 _L_HBoxContainer2; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.HBoxContainer3 + /// + public HBoxContainer3 L_HBoxContainer3 + { + get + { + if (_L_HBoxContainer3 == null) _L_HBoxContainer3 = new HBoxContainer3(UiPanel, Instance.GetNodeOrNull("HBoxContainer3")); + return _L_HBoxContainer3; + } + } + private HBoxContainer3 _L_HBoxContainer3; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.HBoxContainer4 + /// + public HBoxContainer4 L_HBoxContainer4 + { + get + { + if (_L_HBoxContainer4 == null) _L_HBoxContainer4 = new HBoxContainer4(UiPanel, Instance.GetNodeOrNull("HBoxContainer4")); + return _L_HBoxContainer4; + } + } + private HBoxContainer4 _L_HBoxContainer4; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.HBoxContainer5 + /// + public HBoxContainer5 L_HBoxContainer5 + { + get + { + if (_L_HBoxContainer5 == null) _L_HBoxContainer5 = new HBoxContainer5(UiPanel, Instance.GetNodeOrNull("HBoxContainer5")); + return _L_HBoxContainer5; + } + } + private HBoxContainer5 _L_HBoxContainer5; + + public VBoxContainer(MapEditorCreateRoom uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorCreateRoom.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateRoom.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public MarginContainer(MapEditorCreateRoom uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer.RoomNameLabel + /// + public RoomNameLabel S_RoomNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer.RoomNameInput + /// + public RoomNameInput S_RoomNameInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomNameInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_MarginContainer.L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer2.GroupNameLabel + /// + public GroupNameLabel S_GroupNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer2.L_GroupNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer2.GroupSelect + /// + public GroupSelect S_GroupSelect => L_MarginContainer.L_VBoxContainer.L_HBoxContainer2.L_GroupSelect; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer2 + /// + public HBoxContainer2 S_HBoxContainer2 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer2; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer3.TypeNameLabel + /// + public TypeNameLabel S_TypeNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_TypeNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer3.TypeSelect + /// + public TypeSelect S_TypeSelect => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_TypeSelect; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer3 + /// + public HBoxContainer3 S_HBoxContainer3 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer4.WeightNameLabel + /// + public WeightNameLabel S_WeightNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer4.L_WeightNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer4.WeightInput + /// + public WeightInput S_WeightInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer4.L_WeightInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer4 + /// + public HBoxContainer4 S_HBoxContainer4 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer4; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public RemarkNameLabel S_RemarkNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public RemarkInput S_RemarkInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public HBoxContainer5 S_HBoxContainer5 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_MarginContainer.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateRoom.MarginContainer + /// + public MarginContainer S_MarginContainer => L_MarginContainer; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateRoom/MapEditorCreateRoomPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateRoom/MapEditorCreateRoomPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..7ad311ada278efcac4c1e9d98b2e6f4904204fa2 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateRoom/MapEditorCreateRoomPanel.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.RegularExpressions; +using Godot; + +namespace UI.MapEditorCreateRoom; + +public partial class MapEditorCreateRoomPanel : MapEditorCreateRoom +{ + //编辑模式下的原数据 + private DungeonRoomSplit _roomSplit; + //key: 组名称, value: 选项索引 + private Dictionary _groupMap = new Dictionary(); + + public override void OnCreateUi() + { + //初始化选项 + var groupButton = S_GroupSelect.Instance; + var index = 0; + foreach (var mapGroupInfo in MapProjectManager.GroupMap) + { + var id = index++; + var groupGroupName = mapGroupInfo.Value.GroupName; + _groupMap.Add(groupGroupName, id); + groupButton.AddItem(groupGroupName, id); + } + + var selectButton = S_TypeSelect.Instance; + var roomTypes = Enum.GetValues(); + for (var i = 0; i < roomTypes.Length; i++) + { + var item = roomTypes[i]; + var text = DungeonManager.DungeonRoomTypeToDescribeString(item); + selectButton.AddItem(text, (int)item); + } + } + + /// + /// 初始化数据, 用于编辑房间 + /// + /// + public void InitEditData(DungeonRoomSplit roomSplit) + { + _roomSplit = roomSplit; + //房间名称 + S_RoomNameInput.Instance.Text = roomSplit.RoomInfo.RoomName; + //权重 + S_WeightInput.Instance.Value = roomSplit.RoomInfo.Weight; + //备注 + S_RemarkInput.Instance.Text = roomSplit.RoomInfo.Remark; + //所在的组 + SetSelectGroup(roomSplit.RoomInfo.GroupName); + //房间类型 + SetSelectType((int)roomSplit.RoomInfo.RoomType); + //不可编辑 + S_RoomNameInput.Instance.Editable = false; + S_GroupSelect.Instance.Disabled = true; + S_TypeSelect.Instance.Disabled = true; + } + + /// + /// 设置选中的组 + /// + public void SetSelectGroup(string groupName) + { + if (_groupMap.TryGetValue(groupName, out var value)) + { + S_GroupSelect.Instance.Selected = value; + return; + } + + S_GroupSelect.Instance.Selected = -1; + } + + /// + /// 设置选中的房间类型 + /// + public void SetSelectType(int index) + { + S_TypeSelect.Instance.Selected = index; + } + + /// + /// 填完数据后获取数据对象, 并进行验证, 如果验证失败, 则返回 null + /// + public DungeonRoomSplit GetRoomInfo() + { + if (_roomSplit != null) //修改数据 + { + var roomInfo = _roomSplit.RoomInfo; + roomInfo.Remark = S_RemarkInput.Instance.Text; + roomInfo.Weight = (int)S_WeightInput.Instance.Value; + return _roomSplit; + } + else + { + var roomInfo = new DungeonRoomInfo(); + roomInfo.RoomName = S_RoomNameInput.Instance.Text; + roomInfo.Remark = S_RemarkInput.Instance.Text; + roomInfo.RoomType = (DungeonRoomType)S_TypeSelect.Instance.GetSelectedId(); + roomInfo.Weight = (int)S_WeightInput.Instance.Value; + + //检查名称是否合规 + if (string.IsNullOrEmpty(roomInfo.RoomName)) + { + EditorWindowManager.ShowTips("错误", "房间名称不能为空!"); + return null; + } + + var groupIndex = S_GroupSelect.Instance.Selected; + foreach (var pair in _groupMap) + { + if (pair.Value == groupIndex) + { + roomInfo.GroupName = pair.Key; + } + } + + if (roomInfo.GroupName == null) + { + EditorWindowManager.ShowTips("错误", "组名错误!"); + return null; + } + + + //检测是否有同名房间 + var temp = roomInfo.GroupName + "/" + DungeonManager.DungeonRoomTypeToString(roomInfo.RoomType) + "/" + roomInfo.RoomName; + var dirPath = MapProjectManager.CustomMapPath + temp; + var dir = new DirectoryInfo(dirPath); + if (dir.Exists && dir.GetFiles().Length > 0) + { + EditorWindowManager.ShowTips("错误", $"已经有相同路径的房间了!\n路径: {temp}"); + return null; + } + + roomInfo.Size = new SerializeVector2(); + roomInfo.Position = new SerializeVector2(); + roomInfo.DoorAreaInfos = new List(); + + var roomSplit = new DungeonRoomSplit(); + roomSplit.ErrorType = RoomErrorType.Empty; + roomSplit.Path = dirPath; + roomSplit.RoomInfo = roomInfo; + + var tileInfo = new DungeonTileInfo(); + tileInfo.NavigationList = new List(); + tileInfo.Floor = new List(); + tileInfo.Middle = new List(); + tileInfo.Top = new List(); + + roomSplit.TileInfo = tileInfo; + roomSplit.Preinstall = new List(); + return roomSplit; + } + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/LayerButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/LayerButtonCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..6f3a4f33a1ff49a2f431533e44f5809d57ebcbd9 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/LayerButtonCell.cs @@ -0,0 +1,70 @@ +using UI.MapEditor; + +namespace UI.MapEditorMapLayer; + +public class LayerButtonCell : UiCell +{ + private bool _visible; + + public override void OnInit() + { + CellNode.L_VisibleButton.Instance.Pressed += OnVisibleButtonClick; + } + + public override void OnSetData(MapEditorMapLayerPanel.LayerButtonData data) + { + if (data.IsLock) + { + CellNode.Instance.Icon = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Lock_png); + } + else + { + CellNode.Instance.Icon = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Unlock_png); + } + + CellNode.Instance.Text = data.Title; + var panel = CellNode.UiPanel.ParentUi as MapEditorPanel; + if (panel != null) + { + if (Data.Layer == EditorTileMap.MarkLayer) //标记层 + { + _visible = true; + } + else + { + _visible = panel.S_TileMap.Instance.IsLayerEnabled(data.Layer); + } + SetVisibleIcon(_visible); + } + } + + private void OnVisibleButtonClick() + { + var panel = CellNode.UiPanel.ParentUi as MapEditorPanel; + if (panel != null) + { + _visible = !_visible; + if (Data.Layer == EditorTileMap.MarkLayer) //隐藏标记层 + { + panel.S_MapEditorTools.Instance.S_ToolRoot.Instance.Visible = _visible; + } + else //隐藏地图层级 + { + panel.S_TileMap.Instance.SetLayerEnabled(Data.Layer, _visible); + } + SetVisibleIcon(_visible); + } + } + + private void SetVisibleIcon(bool visible) + { + if (visible) + { + CellNode.L_VisibleButton.Instance.TextureNormal = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Visible_png); + } + else + { + CellNode.L_VisibleButton.Instance.TextureNormal = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Hide_png); + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayer.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayer.cs new file mode 100644 index 0000000000000000000000000000000000000000..b21b49976eb292a99e06ec2bf3729e6a04fb6329 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayer.cs @@ -0,0 +1,153 @@ +namespace UI.MapEditorMapLayer; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorMapLayer : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(this, GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + + public MapEditorMapLayer() : base(nameof(MapEditorMapLayer)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.LayerLabel + /// + public class LayerLabel : UiNode + { + public LayerLabel(MapEditorMapLayer uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override LayerLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton.VisibleButton + /// + public class VisibleButton : UiNode + { + public VisibleButton(MapEditorMapLayer uiPanel, Godot.TextureButton node) : base(uiPanel, node) { } + public override VisibleButton Clone() => new (UiPanel, (Godot.TextureButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton + /// + public class LayerButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.VisibleButton + /// + public VisibleButton L_VisibleButton + { + get + { + if (_L_VisibleButton == null) _L_VisibleButton = new VisibleButton(UiPanel, Instance.GetNodeOrNull("VisibleButton")); + return _L_VisibleButton; + } + } + private VisibleButton _L_VisibleButton; + + public LayerButton(MapEditorMapLayer uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override LayerButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.ScrollContainer + /// + public class ScrollContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.LayerButton + /// + public LayerButton L_LayerButton + { + get + { + if (_L_LayerButton == null) _L_LayerButton = new LayerButton(UiPanel, Instance.GetNodeOrNull("LayerButton")); + return _L_LayerButton; + } + } + private LayerButton _L_LayerButton; + + public ScrollContainer(MapEditorMapLayer uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.LayerLabel + /// + public LayerLabel L_LayerLabel + { + get + { + if (_L_LayerLabel == null) _L_LayerLabel = new LayerLabel(UiPanel, Instance.GetNodeOrNull("LayerLabel")); + return _L_LayerLabel; + } + } + private LayerLabel _L_LayerLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.ScrollContainer + /// + public ScrollContainer L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNodeOrNull("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer _L_ScrollContainer; + + public VBoxContainer(MapEditorMapLayer uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.LayerLabel + /// + public LayerLabel S_LayerLabel => L_VBoxContainer.L_LayerLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton.VisibleButton + /// + public VisibleButton S_VisibleButton => L_VBoxContainer.L_ScrollContainer.L_LayerButton.L_VisibleButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton + /// + public LayerButton S_LayerButton => L_VBoxContainer.L_ScrollContainer.L_LayerButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer + /// + public ScrollContainer S_ScrollContainer => L_VBoxContainer.L_ScrollContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_VBoxContainer; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..ff3448ee3d581a733d00371e5fb89a267fe5872f --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs @@ -0,0 +1,53 @@ +using Godot; +using UI.MapEditor; + +namespace UI.MapEditorMapLayer; + +public partial class MapEditorMapLayerPanel : MapEditorMapLayer +{ + public class LayerButtonData + { + /// + /// 显示文本 + /// + public string Title; + /// + /// 是否锁定 + /// + public bool IsLock; + /// + /// Map层级 + /// + public int Layer; + + public LayerButtonData(string title, bool isLock, int layer) + { + Title = title; + IsLock = isLock; + Layer = layer; + } + } + + private UiGrid _grid; + + public override void OnCreateUi() + { + _grid = new UiGrid(S_LayerButton, typeof(LayerButtonCell)); + _grid.SetCellOffset(new Vector2I(0, 2)); + _grid.SetHorizontalExpand(true); + + _grid.Add(new LayerButtonData("地面", false, EditorTileMap.AutoFloorLayer)); + _grid.Add(new LayerButtonData("自定义底层", false, EditorTileMap.CustomFloorLayer)); + _grid.Add(new LayerButtonData("中层自动图块", true, EditorTileMap.AutoMiddleLayer)); + _grid.Add(new LayerButtonData("自定义中层", false, EditorTileMap.CustomMiddleLayer)); + _grid.Add(new LayerButtonData("高层自动图块", true, EditorTileMap.AutoTopLayer)); + _grid.Add(new LayerButtonData("自定义高层", false, EditorTileMap.CustomTopLayer)); + _grid.Add(new LayerButtonData("标记数据层", false, EditorTileMap.MarkLayer)); + } + + public override void OnDestroyUi() + { + _grid.Destroy(); + } + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorMarkCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorMarkCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..c36e547edd4ae30e0de8e9ca37d6c2a6a108115e --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorMarkCell.cs @@ -0,0 +1,121 @@ +using System; +using Config; +using UI.MapEditor; + +namespace UI.MapEditorMapMark; + +public class EditorMarkCell : UiCell +{ + //上一次点击的时间 + private long _prevClickTime2 = -1; + + public override void OnInit() + { + //这里不绑定 Click 函数, 而是绑定 OnClickHandler, 因为 Select 交给 MapEditorMapMarkPanel 处理了 + CellNode.L_MarkButton.Instance.Pressed += OnClickHandler; + } + + public override void OnSetData(MapEditorMapMarkPanel.MarkCellData data) + { + var text = ""; + //物体名称 + if (data.MarkInfo.MarkList != null && data.MarkInfo.MarkList.Count > 0) + { + var str = ""; + for (var i = 0; i < data.MarkInfo.MarkList.Count; i++) + { + var markInfoItem = data.MarkInfo.MarkList[i]; + if (i > 0) + { + str += ","; + } + + str += ExcelConfig.ActivityObject_Map[markInfoItem.Id].Name; + } + text += str; + } + else + { + if (data.MarkInfo.SpecialMarkType == SpecialMarkType.BirthPoint) + { + text = "出生标记"; + } + else + { + text += "空"; + } + } + + //延时时间 + if (data.Preloading) + { + text += "\n提前加载"; + } + else + { + text += "\n" + data.MarkInfo.DelayTime + "秒"; + } + + CellNode.L_MarkButton.Instance.Text = text; + } + + public void OnClickHandler() + { + EditorManager.SetSelectWaveIndex(Data.ParentCell.Index); + CellNode.UiPanel.SetSelectCell(this, CellNode.Instance, MapEditorMapMarkPanel.SelectToolType.Mark); + //选中标记 + EditorManager.SetSelectMark(Data.MarkInfo); + + //双击判定 + if (_prevClickTime2 >= 0) + { + var now = DateTime.Now.Ticks / 10000; + if (now <= _prevClickTime2 + 500) + { + OnDoubleClickHandler(); + } + + _prevClickTime2 = now; + } + else + { + _prevClickTime2 = DateTime.Now.Ticks / 10000; + } + } + + public void OnDoubleClickHandler() + { + //双击聚焦标记 + var position = Data.MarkInfo.Position.AsVector2(); + CellNode.UiPanel.EditorTileMap.SetLookPosition(position); + } + + public override void OnSelect() + { + CellNode.L_MarkButton.L_Select.Instance.Visible = true; + //选中标记 + EditorManager.SetSelectMark(Data.MarkInfo); + } + + public override void OnUnSelect() + { + CellNode.L_MarkButton.L_Select.Instance.Visible = false; + } + + public override int OnSort(UiCell other) + { + if (!Data.Preloading && other.Data.Preloading) + { + return 0; + } + else if (Data.Preloading) + { + return -1; + } + else if (other.Data.Preloading) + { + return 1; + } + return (int)(Data.MarkInfo.DelayTime * 1000 - other.Data.MarkInfo.DelayTime * 1000); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorWaveCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorWaveCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..85232f391c93cca7836bebd642522d25548b987d --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorWaveCell.cs @@ -0,0 +1,123 @@ +using System.Collections.Generic; +using Godot; +using UI.MapEditor; + +namespace UI.MapEditorMapMark; + +public class EditorWaveCell : UiCell> +{ + public UiGrid MarkGrid; + + public override void OnInit() + { + //这里不绑定 Click 函数, 而是绑定 OnClickHandler, 因为 Select 交给 MapEditorMapMarkPanel 处理了 + CellNode.L_WaveContainer.L_WaveButton.Instance.Pressed += OnClickHandler; + CellNode.L_WaveContainer.L_TextureButton.Instance.Pressed += OnExpandOrClose; + CellNode.L_MarginContainer.L_AddMarkButton.Instance.Pressed += OnAddMark; + + CellNode.L_MarkContainer.L_MarkItem.Instance.SetHorizontalExpand(true); + MarkGrid = new UiGrid(CellNode.L_MarkContainer.L_MarkItem, typeof(EditorMarkCell)); + MarkGrid.SetColumns(1); + MarkGrid.SetHorizontalExpand(true); + MarkGrid.SetCellOffset(new Vector2I(0, 5)); + } + + public override void OnSetData(List data) + { + var array = new MapEditorMapMarkPanel.MarkCellData[data.Count]; + for (var i = 0; i < data.Count; i++) + { + array[i] = new MapEditorMapMarkPanel.MarkCellData(this, data[i], Index == 0); + } + MarkGrid.SetDataList(array); + //执行排序操作 + MarkGrid.Sort(); + } + + public override void OnRefreshIndex() + { + if (Index == 0) + { + CellNode.L_WaveContainer.L_WaveButton.Instance.Text = $"提前加载波"; + } + else + { + CellNode.L_WaveContainer.L_WaveButton.Instance.Text = $"第{Index}波"; + } + } + + public override void OnDestroy() + { + MarkGrid.Destroy(); + } + + //添加标记 + private void OnAddMark() + { + //打开添加标记页面 + EditorWindowManager.ShowCreateMark(CellNode.UiPanel.EditorTileMap.GetCenterPosition(), Index == 0, OnCreateMarkInfo); + } + + //创建的标记完成 + private void OnCreateMarkInfo(MarkInfo markInfo) + { + var preinstall = CellNode.UiPanel.GetSelectPreinstall(); + preinstall.WaveList[Index].Add(markInfo); + MarkGrid.Add(new MapEditorMapMarkPanel.MarkCellData(this, markInfo, Index == 0)); + //添加标记工具 + EventManager.EmitEvent(EventEnum.OnCreateMark, markInfo); + //选中最后一个 + //MarkGrid.SelectIndex + MarkGrid.Click(MarkGrid.Count - 1); + //执行排序操作 + MarkGrid.Sort(); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + + /// + /// 展开/收起按钮点击 + /// + public void OnExpandOrClose() + { + var marginContainer = CellNode.L_MarkContainer.Instance; + var flag = !marginContainer.Visible; + marginContainer.Visible = flag; + CellNode.L_MarginContainer.Instance.Visible = flag; + var textureButton = CellNode.L_WaveContainer.L_TextureButton.Instance; + if (flag) + { + textureButton.TextureNormal = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Down_png); + } + else + { + textureButton.TextureNormal = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Right_png); + } + } + + /// + /// 是否展开 + /// + public bool IsExpand() + { + return CellNode.L_MarkContainer.Instance.Visible; + } + + public void OnClickHandler() + { + EditorManager.SetSelectWaveIndex(Index); + CellNode.UiPanel.SetSelectCell(this, CellNode.L_WaveContainer.Instance, MapEditorMapMarkPanel.SelectToolType.Wave); + //清除选中的标记 + EditorManager.SetSelectMark(null); + } + + public override void OnSelect() + { + CellNode.L_WaveContainer.L_WaveButton.L_Select.Instance.Visible = true; + } + + public override void OnUnSelect() + { + CellNode.L_WaveContainer.L_WaveButton.L_Select.Instance.Visible = false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMark.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMark.cs new file mode 100644 index 0000000000000000000000000000000000000000..2661fec877f48e725e4cf5b9efa4f0c9223fb5d8 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMark.cs @@ -0,0 +1,673 @@ +namespace UI.MapEditorMapMark; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorMapMark : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer((MapEditorMapMarkPanel)this, GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + + public MapEditorMapMark() : base(nameof(MapEditorMapMark)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.MarkLabel + /// + public class MarkLabel : UiNode + { + public MarkLabel(MapEditorMapMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override MarkLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.HBoxContainer.PreinstallOption + /// + public class PreinstallOption : UiNode + { + public PreinstallOption(MapEditorMapMarkPanel uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } + public override PreinstallOption Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.HBoxContainer.AddPreinstall + /// + public class AddPreinstall : UiNode + { + public AddPreinstall(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override AddPreinstall Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.HBoxContainer.EditPreinstall + /// + public class EditPreinstall : UiNode + { + public EditPreinstall(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditPreinstall Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.HBoxContainer.DeletePreinstall + /// + public class DeletePreinstall : UiNode + { + public DeletePreinstall(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override DeletePreinstall Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.PreinstallOption + /// + public PreinstallOption L_PreinstallOption + { + get + { + if (_L_PreinstallOption == null) _L_PreinstallOption = new PreinstallOption(UiPanel, Instance.GetNodeOrNull("PreinstallOption")); + return _L_PreinstallOption; + } + } + private PreinstallOption _L_PreinstallOption; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.AddPreinstall + /// + public AddPreinstall L_AddPreinstall + { + get + { + if (_L_AddPreinstall == null) _L_AddPreinstall = new AddPreinstall(UiPanel, Instance.GetNodeOrNull("AddPreinstall")); + return _L_AddPreinstall; + } + } + private AddPreinstall _L_AddPreinstall; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.EditPreinstall + /// + public EditPreinstall L_EditPreinstall + { + get + { + if (_L_EditPreinstall == null) _L_EditPreinstall = new EditPreinstall(UiPanel, Instance.GetNodeOrNull("EditPreinstall")); + return _L_EditPreinstall; + } + } + private EditPreinstall _L_EditPreinstall; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.DeletePreinstall + /// + public DeletePreinstall L_DeletePreinstall + { + get + { + if (_L_DeletePreinstall == null) _L_DeletePreinstall = new DeletePreinstall(UiPanel, Instance.GetNodeOrNull("DeletePreinstall")); + return _L_DeletePreinstall; + } + } + private DeletePreinstall _L_DeletePreinstall; + + public HBoxContainer(MapEditorMapMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.MarkLabel2 + /// + public class MarkLabel2 : UiNode + { + public MarkLabel2(MapEditorMapMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override MarkLabel2 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.DynamicTool.EditButton + /// + public class EditButton : UiNode + { + public EditButton(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.DynamicTool.DeleteButton + /// + public class DeleteButton : UiNode + { + public DeleteButton(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override DeleteButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.DynamicTool + /// + public class DynamicTool : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.EditButton + /// + public EditButton L_EditButton + { + get + { + if (_L_EditButton == null) _L_EditButton = new EditButton(UiPanel, Instance.GetNodeOrNull("EditButton")); + return _L_EditButton; + } + } + private EditButton _L_EditButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.DeleteButton + /// + public DeleteButton L_DeleteButton + { + get + { + if (_L_DeleteButton == null) _L_DeleteButton = new DeleteButton(UiPanel, Instance.GetNodeOrNull("DeleteButton")); + return _L_DeleteButton; + } + } + private DeleteButton _L_DeleteButton; + + public DynamicTool(MapEditorMapMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override DynamicTool Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.AddWaveButton + /// + public class AddWaveButton : UiNode + { + public AddWaveButton(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override AddWaveButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer.TextureButton + /// + public class TextureButton : UiNode + { + public TextureButton(MapEditorMapMarkPanel uiPanel, Godot.TextureButton node) : base(uiPanel, node) { } + public override TextureButton Clone() => new (UiPanel, (Godot.TextureButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer.WaveButton.Select + /// + public class Select : UiNode + { + public Select(MapEditorMapMarkPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override Select Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer.WaveButton + /// + public class WaveButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer.Select + /// + public Select L_Select + { + get + { + if (_L_Select == null) _L_Select = new Select(UiPanel, Instance.GetNodeOrNull("Select")); + return _L_Select; + } + } + private Select _L_Select; + + public WaveButton(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override WaveButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer + /// + public class WaveContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.TextureButton + /// + public TextureButton L_TextureButton + { + get + { + if (_L_TextureButton == null) _L_TextureButton = new TextureButton(UiPanel, Instance.GetNodeOrNull("TextureButton")); + return _L_TextureButton; + } + } + private TextureButton _L_TextureButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveButton + /// + public WaveButton L_WaveButton + { + get + { + if (_L_WaveButton == null) _L_WaveButton = new WaveButton(UiPanel, Instance.GetNodeOrNull("WaveButton")); + return _L_WaveButton; + } + } + private WaveButton _L_WaveButton; + + public WaveContainer(MapEditorMapMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override WaveContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarginContainer.AddMarkButton + /// + public class AddMarkButton : UiNode + { + public AddMarkButton(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override AddMarkButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.AddMarkButton + /// + public AddMarkButton L_AddMarkButton + { + get + { + if (_L_AddMarkButton == null) _L_AddMarkButton = new AddMarkButton(UiPanel, Instance.GetNodeOrNull("AddMarkButton")); + return _L_AddMarkButton; + } + } + private AddMarkButton _L_AddMarkButton; + + public MarginContainer(MapEditorMapMarkPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer.MarkItem.MarkButton.Select + /// + public class Select_1 : UiNode + { + public Select_1(MapEditorMapMarkPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override Select_1 Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer.MarkItem.MarkButton + /// + public class MarkButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer.MarkItem.Select + /// + public Select_1 L_Select + { + get + { + if (_L_Select == null) _L_Select = new Select_1(UiPanel, Instance.GetNodeOrNull("Select")); + return _L_Select; + } + } + private Select_1 _L_Select; + + public MarkButton(MapEditorMapMarkPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override MarkButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer.MarkItem + /// + public class MarkItem : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer.MarkButton + /// + public MarkButton L_MarkButton + { + get + { + if (_L_MarkButton == null) _L_MarkButton = new MarkButton(UiPanel, Instance.GetNodeOrNull("MarkButton")); + return _L_MarkButton; + } + } + private MarkButton _L_MarkButton; + + public MarkItem(MapEditorMapMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override MarkItem Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer + /// + public class MarkContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkItem + /// + public MarkItem L_MarkItem + { + get + { + if (_L_MarkItem == null) _L_MarkItem = new MarkItem(UiPanel, Instance.GetNodeOrNull("MarkItem")); + return _L_MarkItem; + } + } + private MarkItem _L_MarkItem; + + public MarkContainer(MapEditorMapMarkPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarkContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem + /// + public class WaveItem : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveContainer + /// + public WaveContainer L_WaveContainer + { + get + { + if (_L_WaveContainer == null) _L_WaveContainer = new WaveContainer(UiPanel, Instance.GetNodeOrNull("WaveContainer")); + return _L_WaveContainer; + } + } + private WaveContainer _L_WaveContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(UiPanel, Instance.GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.MarkContainer + /// + public MarkContainer L_MarkContainer + { + get + { + if (_L_MarkContainer == null) _L_MarkContainer = new MarkContainer(UiPanel, Instance.GetNodeOrNull("MarkContainer")); + return _L_MarkContainer; + } + } + private MarkContainer _L_MarkContainer; + + public WaveItem(MapEditorMapMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override WaveItem Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer + /// + public class VBoxContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.AddWaveButton + /// + public AddWaveButton L_AddWaveButton + { + get + { + if (_L_AddWaveButton == null) _L_AddWaveButton = new AddWaveButton(UiPanel, Instance.GetNodeOrNull("AddWaveButton")); + return _L_AddWaveButton; + } + } + private AddWaveButton _L_AddWaveButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.WaveItem + /// + public WaveItem L_WaveItem + { + get + { + if (_L_WaveItem == null) _L_WaveItem = new WaveItem(UiPanel, Instance.GetNodeOrNull("WaveItem")); + return _L_WaveItem; + } + } + private WaveItem _L_WaveItem; + + public VBoxContainer_1(MapEditorMapMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_1 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer.ScrollContainer + /// + public class ScrollContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.VBoxContainer + /// + public VBoxContainer_1 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_1(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_1 _L_VBoxContainer; + + public ScrollContainer(MapEditorMapMarkPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapMark.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.MarkLabel + /// + public MarkLabel L_MarkLabel + { + get + { + if (_L_MarkLabel == null) _L_MarkLabel = new MarkLabel(UiPanel, Instance.GetNodeOrNull("MarkLabel")); + return _L_MarkLabel; + } + } + private MarkLabel _L_MarkLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.MarkLabel2 + /// + public MarkLabel2 L_MarkLabel2 + { + get + { + if (_L_MarkLabel2 == null) _L_MarkLabel2 = new MarkLabel2(UiPanel, Instance.GetNodeOrNull("MarkLabel2")); + return _L_MarkLabel2; + } + } + private MarkLabel2 _L_MarkLabel2; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.DynamicTool + /// + public DynamicTool L_DynamicTool + { + get + { + if (_L_DynamicTool == null) _L_DynamicTool = new DynamicTool(UiPanel, Instance.GetNodeOrNull("DynamicTool")); + return _L_DynamicTool; + } + } + private DynamicTool _L_DynamicTool; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapMark.ScrollContainer + /// + public ScrollContainer L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNodeOrNull("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer _L_ScrollContainer; + + public VBoxContainer(MapEditorMapMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.MarkLabel + /// + public MarkLabel S_MarkLabel => L_VBoxContainer.L_MarkLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.HBoxContainer.PreinstallOption + /// + public PreinstallOption S_PreinstallOption => L_VBoxContainer.L_HBoxContainer.L_PreinstallOption; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.HBoxContainer.AddPreinstall + /// + public AddPreinstall S_AddPreinstall => L_VBoxContainer.L_HBoxContainer.L_AddPreinstall; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.HBoxContainer.EditPreinstall + /// + public EditPreinstall S_EditPreinstall => L_VBoxContainer.L_HBoxContainer.L_EditPreinstall; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.HBoxContainer.DeletePreinstall + /// + public DeletePreinstall S_DeletePreinstall => L_VBoxContainer.L_HBoxContainer.L_DeletePreinstall; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.MarkLabel2 + /// + public MarkLabel2 S_MarkLabel2 => L_VBoxContainer.L_MarkLabel2; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.DynamicTool.EditButton + /// + public EditButton S_EditButton => L_VBoxContainer.L_DynamicTool.L_EditButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.DynamicTool.DeleteButton + /// + public DeleteButton S_DeleteButton => L_VBoxContainer.L_DynamicTool.L_DeleteButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.DynamicTool + /// + public DynamicTool S_DynamicTool => L_VBoxContainer.L_DynamicTool; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.AddWaveButton + /// + public AddWaveButton S_AddWaveButton => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_AddWaveButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer.TextureButton + /// + public TextureButton S_TextureButton => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_WaveContainer.L_TextureButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer.WaveButton + /// + public WaveButton S_WaveButton => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_WaveContainer.L_WaveButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.WaveContainer + /// + public WaveContainer S_WaveContainer => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_WaveContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarginContainer.AddMarkButton + /// + public AddMarkButton S_AddMarkButton => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_MarginContainer.L_AddMarkButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarginContainer + /// + public MarginContainer S_MarginContainer => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_MarginContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer.MarkItem.MarkButton + /// + public MarkButton S_MarkButton => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_MarkContainer.L_MarkItem.L_MarkButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer.MarkItem + /// + public MarkItem S_MarkItem => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_MarkContainer.L_MarkItem; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem.MarkContainer + /// + public MarkContainer S_MarkContainer => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem.L_MarkContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer.VBoxContainer.WaveItem + /// + public WaveItem S_WaveItem => L_VBoxContainer.L_ScrollContainer.L_VBoxContainer.L_WaveItem; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapMark.VBoxContainer.ScrollContainer + /// + public ScrollContainer S_ScrollContainer => L_VBoxContainer.L_ScrollContainer; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..e4906bed978d306073e346acf95b83322bd446e4 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs @@ -0,0 +1,476 @@ +using System.Collections.Generic; +using Godot; +using UI.MapEditor; + +namespace UI.MapEditorMapMark; + +public partial class MapEditorMapMarkPanel : MapEditorMapMark +{ + public enum SelectToolType + { + None, + Wave, + Mark + } + + public class MarkCellData + { + /// + /// 所在的父级 Cell + /// + public EditorWaveCell ParentCell; + /// + /// 标记数据对象 + /// + public MarkInfo MarkInfo; + /// + /// 是否提前加载 + /// + public bool Preloading; + + public MarkCellData(EditorWaveCell parentCell, MarkInfo markInfo, bool preloading) + { + ParentCell = parentCell; + MarkInfo = markInfo; + Preloading = preloading; + } + } + + /// + /// 选中的cell选项 + /// + public IUiCell SelectCell { get; private set; } + + /// + /// Cell 上的工具类型 + /// + public SelectToolType ToolType { get; private set; } = SelectToolType.None; + + /// + /// 编辑器Tile对象 + /// + public EditorTileMap EditorTileMap { get; private set; } + + //波数网格组件 + private UiGrid> _grid; + private EventFactory _eventFactory; + + public override void OnCreateUi() + { + var editorPanel = (MapEditorPanel)ParentUi; + EditorTileMap = editorPanel.S_TileMap.Instance; + + //S_DynamicTool.Instance.GetParent().RemoveChild(S_DynamicTool.Instance); + S_DynamicTool.Instance.Visible = false; + + _grid = new UiGrid>(S_WaveItem, typeof(EditorWaveCell)); + _grid.SetCellOffset(new Vector2I(0, 10)); + _grid.SetColumns(1); + + S_PreinstallOption.Instance.ItemSelected += OnItemSelected; + S_AddPreinstall.Instance.Pressed += OnAddPreinstall; + S_EditPreinstall.Instance.Pressed += OnEditPreinstall; + S_DeletePreinstall.Instance.Pressed += OnDeletePreinstall; + S_AddWaveButton.Instance.Pressed += OnAddWave; + + S_EditButton.Instance.Pressed += OnToolEditClick; + S_DeleteButton.Instance.Pressed += OnToolDeleteClick; + + _eventFactory = EventManager.CreateEventFactory(); + _eventFactory.AddEventListener(EventEnum.OnSelectMark, OnSelectMark); + } + + public override void OnDestroyUi() + { + _eventFactory.RemoveAllEventListener(); + _eventFactory = null; + _grid.Destroy(); + } + + //选中标记回调 + private void OnSelectMark(object arg) + { + if (arg is MarkInfo markInfo && (SelectCell is not EditorMarkCell || (SelectCell is EditorMarkCell markCell && markCell.Data.MarkInfo != markInfo))) + { + var selectPreinstall = GetSelectPreinstall(); + if (selectPreinstall != null) + { + var waveCells = _grid.GetAllCell(); + foreach (var waveCell in waveCells) + { + var tempWaveCell = (EditorWaveCell)waveCell; + var markCells = tempWaveCell.MarkGrid.GetAllCell(); + for (var i = 0; i < markCells.Length; i++) + { + var tempMarkCell = (EditorMarkCell)markCells[i]; + if (tempMarkCell.Data.MarkInfo == markInfo) + { + //如果没有展开, 则调用展开方法 + if (!tempWaveCell.IsExpand()) + { + tempWaveCell.OnExpandOrClose(); + } + //选中物体 + tempMarkCell.OnClickHandler(); + return; + } + } + } + } + } + } + + /// + /// 获取当前选中的预设 + /// + public RoomPreinstallInfo GetSelectPreinstall() + { + var index = S_PreinstallOption.Instance.Selected; + var preinstall = EditorManager.SelectRoom.Preinstall; + if (index >= preinstall.Count) + { + return null; + } + return preinstall[index]; + } + + /// + /// 刷新预设下拉框 + /// + public void RefreshPreinstallSelect(int index = -1) + { + var preinstall = EditorManager.SelectRoom.Preinstall; + var optionButton = S_PreinstallOption.Instance; + var selectIndex = index < 0 ? (preinstall.Count > 0 ? 0 : -1) : index; + optionButton.Clear(); + foreach (var item in preinstall) + { + if (item.WaveList == null) + { + item.InitWaveList(); + } + + optionButton.AddItem($"{item.Name} ({item.Weight})"); + } + + //下拉框选中项 + optionButton.Selected = selectIndex; + OnItemSelected(selectIndex); + } + + /// + /// 下拉框选中项 + /// + public void OnItemSelected(long index) + { + //清除选中项 + RemoveSelectCell(); + EditorManager.SetSelectWaveIndex(-1); + //记录选中波数 + EditorManager.SetSelectPreinstallIndex((int)index); + var preinstall = EditorManager.SelectRoom.Preinstall; + if (index >= 0 && index <= preinstall.Count) + { + _grid.SetDataList(preinstall[(int)index].WaveList.ToArray()); + } + else + { + _grid.RemoveAll(); + } + } + + /// + /// 选中 cell, 并设置显示的工具 + /// + /// 选中 cell 对象 + /// 按钮工具绑定的父节点 + /// 选择工具类型 + public void SetSelectCell(IUiCell uiCell, Node toolRoot, SelectToolType toolType) + { + if (SelectCell == uiCell) + { + return; + } + + if (uiCell == null) + { + RemoveSelectCell(); + return; + } + + if (toolType == SelectToolType.Wave) + { + //不需要显示编辑波数按钮 + S_DynamicTool.L_EditButton.Instance.Visible = false; + //预加载波不能删除 + S_DynamicTool.L_DeleteButton.Instance.Visible = uiCell.Index != 0; + } + else //显示编辑按钮 + { + var markCell = (EditorMarkCell)uiCell; + var markType = markCell.Data.MarkInfo.SpecialMarkType; + if (markType == SpecialMarkType.BirthPoint) //某些特殊标记不能删除 + { + S_DynamicTool.L_EditButton.Instance.Visible = true; + S_DynamicTool.L_DeleteButton.Instance.Visible = false; + } + else //普通标记 + { + S_DynamicTool.L_EditButton.Instance.Visible = true; + S_DynamicTool.L_DeleteButton.Instance.Visible = true; + } + } + + //显示工具 + S_DynamicTool.Instance.Visible = true; + + //改变所在父节点 + var parent = S_DynamicTool.Instance.GetParent(); + if (parent != null) + { + parent.RemoveChild(S_DynamicTool.Instance); + } + + toolRoot.AddChild(S_DynamicTool.Instance); + if (SelectCell != null) + { + SelectCell.OnUnSelect(); + } + SelectCell = uiCell; + ToolType = toolType; + SelectCell.OnSelect(); + } + + /// + /// 移除选中的 cell 对象 + /// + public void RemoveSelectCell() + { + if (SelectCell == null) + { + return; + } + var parent = S_DynamicTool.GetParent(); + if (parent != null) + { + parent.RemoveChild(S_DynamicTool.Instance); + } + SelectCell.OnUnSelect(); + SelectCell = null; + } + + /// + /// 创建预设 + /// + public void OnAddPreinstall() + { + var roomInfoRoomType = EditorManager.SelectRoom.RoomInfo.RoomType; + var roomSplitPreinstall = EditorManager.SelectRoom.Preinstall; + EditorWindowManager.ShowCreatePreinstall(roomInfoRoomType, roomSplitPreinstall, preinstall => + { + //创建逻辑 + roomSplitPreinstall.Add(preinstall); + RefreshPreinstallSelect(roomSplitPreinstall.Count - 1); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + }); + } + + /// + /// 编辑预设 + /// + public void OnEditPreinstall() + { + var roomInfoRoomType = EditorManager.SelectRoom.RoomInfo.RoomType; + var roomSplitPreinstall = EditorManager.SelectRoom.Preinstall; + var selectPreinstall = GetSelectPreinstall(); + EditorWindowManager.ShowEditPreinstall(roomInfoRoomType, roomSplitPreinstall, selectPreinstall, preinstall => + { + //修改下拉菜单数据 + var optionButton = S_PreinstallOption.Instance; + optionButton.SetItemText(optionButton.Selected, $"{preinstall.Name} ({preinstall.Weight})"); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + }); + } + + /// + /// 删除预设 + /// + public void OnDeletePreinstall() + { + var index = EditorManager.SelectPreinstallIndex; + if (index < 0) + { + return; + } + + EditorWindowManager.ShowConfirm("提示", "是否删除当前预设?", v => + { + if (v) + { + //先把选中项置为-1 + EditorManager.SetSelectPreinstallIndex(-1); + //移除预设数据 + EditorManager.SelectRoom.Preinstall.RemoveAt(index); + //刷新选项 + RefreshPreinstallSelect(EditorManager.SelectRoom.Preinstall.Count - 1); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + }); + } + + /// + /// 添加波数 + /// + public void OnAddWave() + { + var index = S_PreinstallOption.Instance.Selected; + if (index == -1) + { + EditorWindowManager.ShowTips("警告", "请先选择预设!"); + return; + } + + var preinstall = EditorManager.SelectRoom.Preinstall; + if (index >= preinstall.Count) + { + EditorWindowManager.ShowTips("警告", "未知预设选项!"); + return; + } + var item = preinstall[index]; + var wave = new List(); + item.WaveList.Add(wave); + _grid.Add(wave); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + + //工具节点编辑按钮点击 + private void OnToolEditClick() + { + if (ToolType == SelectToolType.Mark) + { + OnEditMark(); + } + } + + //工具节点删除按钮点击 + private void OnToolDeleteClick() + { + if (ToolType == SelectToolType.Wave) + { + OnDeleteWave(); + } + else if (ToolType == SelectToolType.Mark) + { + OnDeleteMark(); + } + } + + + /// + /// 删除波数据 + /// + public void OnDeleteWave() + { + var index = EditorManager.SelectWaveIndex; + if (index < 0) + { + return; + } + + var selectPreinstall = GetSelectPreinstall(); + if (selectPreinstall == null) + { + return; + } + + var wave = selectPreinstall.WaveList[index]; + EditorWindowManager.ShowConfirm("提示", $"是否删除当前波?\n当前波数包含{wave.Count}个标记", v => + { + if (v) + { + //隐藏工具 + S_DynamicTool.Reparent(this); + S_DynamicTool.Instance.Visible = false; + //派发移除标记事件 + foreach (var markInfo in wave) + { + EventManager.EmitEvent(EventEnum.OnDeleteMark, markInfo); + } + //移除数据 + selectPreinstall.WaveList.RemoveAt(index); + _grid.RemoveByIndex(index); + EditorManager.SetSelectWaveIndex(-1); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + }); + } + + /// + /// 编辑标记数据 + /// + public void OnEditMark() + { + if (SelectCell is EditorMarkCell markCell) + { + var dataMarkInfo = markCell.Data.MarkInfo; + //打开编辑面板 + EditorWindowManager.ShowEditMark(dataMarkInfo, markCell.Data.Preloading, (mark) => + { + //为了引用不变, 所以这里使用克隆数据 + dataMarkInfo.CloneFrom(mark); + //刷新 Cell + markCell.SetData(markCell.Data); + //执行排序 + markCell.Grid.Sort(); + EventManager.EmitEvent(EventEnum.OnEditMark, dataMarkInfo); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + }); + } + } + + /// + /// 删除标记数据 + /// + public void OnDeleteMark() + { + if (SelectCell is EditorMarkCell markCell) + { + var index = EditorManager.SelectWaveIndex; + if (index < 0) + { + return; + } + + var selectPreinstall = GetSelectPreinstall(); + if (selectPreinstall == null) + { + return; + } + + EditorWindowManager.ShowConfirm("提示", "是否删除当前标记?", v => + { + if (v) + { + var waveCell = (EditorWaveCell)_grid.GetCell(index); + //隐藏工具 + S_DynamicTool.Reparent(this); + S_DynamicTool.Instance.Visible = false; + var markCellIndex = markCell.Index; + var markInfo = waveCell.Data[markCellIndex]; + //派发移除标记事件 + EventManager.EmitEvent(EventEnum.OnDeleteMark, markInfo); + waveCell.MarkGrid.RemoveByIndex(markCellIndex); + waveCell.Data.RemoveAt(markCellIndex); + //派发数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + }); + } + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/GroupButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/GroupButtonCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..39d83ee3f74a367646f2cbddca6435a3b79c2699 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/GroupButtonCell.cs @@ -0,0 +1,34 @@ +using Godot; + +namespace UI.MapEditorProject; + +public class GroupButtonCell : UiCell +{ + public override void OnInit() + { + CellNode.L_SelectTexture.Instance.Visible = false; + } + + public override void OnSetData(DungeonRoomGroup info) + { + CellNode.Instance.Text = info.GroupName; + CellNode.Instance.TooltipText = "路径: " + MapProjectManager.CustomMapPath + "/" + info.GroupName; + } + + public override void OnRefreshIndex() + { + GD.Print("刷新索引: " + Index); + } + + //选中工程 + public override void OnSelect() + { + CellNode.UiPanel.SelectGroup(Data); + CellNode.L_SelectTexture.Instance.Visible = true; + } + + public override void OnUnSelect() + { + CellNode.L_SelectTexture.Instance.Visible = false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProject.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProject.cs new file mode 100644 index 0000000000000000000000000000000000000000..ad57e6ee5b08eb53b8afb7f1a2c467f9e0c4f661 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProject.cs @@ -0,0 +1,823 @@ +namespace UI.MapEditorProject; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorProject : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg + /// + public Bg L_Bg + { + get + { + if (_L_Bg == null) _L_Bg = new Bg((MapEditorProjectPanel)this, GetNode("Bg")); + return _L_Bg; + } + } + private Bg _L_Bg; + + + public MapEditorProject() : base(nameof(MapEditorProject)) + { + } + + public sealed override void OnInitNestedUi() + { + + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.Head.Back + /// + public class Back : UiNode + { + public Back(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Back Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.Head + /// + public class Head : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.Back + /// + public Back L_Back + { + get + { + if (_L_Back == null) _L_Back = new Back(UiPanel, Instance.GetNode("Back")); + return _L_Back; + } + } + private Back _L_Back; + + public Head(MapEditorProjectPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Head Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.GroupSearchInput + /// + public class GroupSearchInput : UiNode + { + public GroupSearchInput(MapEditorProjectPanel uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override GroupSearchInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.GroupSearchButton + /// + public class GroupSearchButton : UiNode + { + public GroupSearchButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override GroupSearchButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.GroupAddButton + /// + public class GroupAddButton : UiNode + { + public GroupAddButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override GroupAddButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.GroupSearchInput + /// + public GroupSearchInput L_GroupSearchInput + { + get + { + if (_L_GroupSearchInput == null) _L_GroupSearchInput = new GroupSearchInput(UiPanel, Instance.GetNode("GroupSearchInput")); + return _L_GroupSearchInput; + } + } + private GroupSearchInput _L_GroupSearchInput; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.GroupSearchButton + /// + public GroupSearchButton L_GroupSearchButton + { + get + { + if (_L_GroupSearchButton == null) _L_GroupSearchButton = new GroupSearchButton(UiPanel, Instance.GetNode("GroupSearchButton")); + return _L_GroupSearchButton; + } + } + private GroupSearchButton _L_GroupSearchButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.GroupAddButton + /// + public GroupAddButton L_GroupAddButton + { + get + { + if (_L_GroupAddButton == null) _L_GroupAddButton = new GroupAddButton(UiPanel, Instance.GetNode("GroupAddButton")); + return _L_GroupAddButton; + } + } + private GroupAddButton _L_GroupAddButton; + + public HBoxContainer_1(MapEditorProjectPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.GroupButton.SelectTexture + /// + public class SelectTexture : UiNode + { + public SelectTexture(MapEditorProjectPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override SelectTexture Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.GroupButton + /// + public class GroupButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.SelectTexture + /// + public SelectTexture L_SelectTexture + { + get + { + if (_L_SelectTexture == null) _L_SelectTexture = new SelectTexture(UiPanel, Instance.GetNode("SelectTexture")); + return _L_SelectTexture; + } + } + private SelectTexture _L_SelectTexture; + + public GroupButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override GroupButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer + /// + public class ScrollContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.GroupButton + /// + public GroupButton L_GroupButton + { + get + { + if (_L_GroupButton == null) _L_GroupButton = new GroupButton(UiPanel, Instance.GetNode("GroupButton")); + return _L_GroupButton; + } + } + private GroupButton _L_GroupButton; + + public ScrollContainer(MapEditorProjectPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer + /// + public class VBoxContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.HBoxContainer + /// + public HBoxContainer_1 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_1(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_1 _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.ScrollContainer + /// + public ScrollContainer L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNode("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer _L_ScrollContainer; + + public VBoxContainer_1(MapEditorProjectPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_1 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.VBoxContainer + /// + public VBoxContainer_1 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_1(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_1 _L_VBoxContainer; + + public MarginContainer(MapEditorProjectPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel + /// + public class Panel : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(UiPanel, Instance.GetNode("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + public Panel(MapEditorProjectPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Panel Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomSearchInput + /// + public class RoomSearchInput : UiNode + { + public RoomSearchInput(MapEditorProjectPanel uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override RoomSearchInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomTypeButton + /// + public class RoomTypeButton : UiNode + { + public RoomTypeButton(MapEditorProjectPanel uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } + public override RoomTypeButton Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomSearchButton + /// + public class RoomSearchButton : UiNode + { + public RoomSearchButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override RoomSearchButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomAddButton + /// + public class RoomAddButton : UiNode + { + public RoomAddButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override RoomAddButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomEditButton + /// + public class RoomEditButton : UiNode + { + public RoomEditButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override RoomEditButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomDeleteButton + /// + public class RoomDeleteButton : UiNode + { + public RoomDeleteButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override RoomDeleteButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.RoomSearchInput + /// + public RoomSearchInput L_RoomSearchInput + { + get + { + if (_L_RoomSearchInput == null) _L_RoomSearchInput = new RoomSearchInput(UiPanel, Instance.GetNode("RoomSearchInput")); + return _L_RoomSearchInput; + } + } + private RoomSearchInput _L_RoomSearchInput; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.RoomTypeButton + /// + public RoomTypeButton L_RoomTypeButton + { + get + { + if (_L_RoomTypeButton == null) _L_RoomTypeButton = new RoomTypeButton(UiPanel, Instance.GetNode("RoomTypeButton")); + return _L_RoomTypeButton; + } + } + private RoomTypeButton _L_RoomTypeButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.RoomSearchButton + /// + public RoomSearchButton L_RoomSearchButton + { + get + { + if (_L_RoomSearchButton == null) _L_RoomSearchButton = new RoomSearchButton(UiPanel, Instance.GetNode("RoomSearchButton")); + return _L_RoomSearchButton; + } + } + private RoomSearchButton _L_RoomSearchButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.RoomAddButton + /// + public RoomAddButton L_RoomAddButton + { + get + { + if (_L_RoomAddButton == null) _L_RoomAddButton = new RoomAddButton(UiPanel, Instance.GetNode("RoomAddButton")); + return _L_RoomAddButton; + } + } + private RoomAddButton _L_RoomAddButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.RoomEditButton + /// + public RoomEditButton L_RoomEditButton + { + get + { + if (_L_RoomEditButton == null) _L_RoomEditButton = new RoomEditButton(UiPanel, Instance.GetNode("RoomEditButton")); + return _L_RoomEditButton; + } + } + private RoomEditButton _L_RoomEditButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.RoomDeleteButton + /// + public RoomDeleteButton L_RoomDeleteButton + { + get + { + if (_L_RoomDeleteButton == null) _L_RoomDeleteButton = new RoomDeleteButton(UiPanel, Instance.GetNode("RoomDeleteButton")); + return _L_RoomDeleteButton; + } + } + private RoomDeleteButton _L_RoomDeleteButton; + + public HBoxContainer_2(MapEditorProjectPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.PreviewImage + /// + public class PreviewImage : UiNode + { + public PreviewImage(MapEditorProjectPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override PreviewImage Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.RoomName + /// + public class RoomName : UiNode + { + public RoomName(MapEditorProjectPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomName Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.RoomType + /// + public class RoomType : UiNode + { + public RoomType(MapEditorProjectPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomType Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.SelectTexture + /// + public class SelectTexture_1 : UiNode + { + public SelectTexture_1(MapEditorProjectPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override SelectTexture_1 Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.ErrorTexture + /// + public class ErrorTexture : UiNode + { + public ErrorTexture(MapEditorProjectPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override ErrorTexture Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton + /// + public class RoomButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.PreviewImage + /// + public PreviewImage L_PreviewImage + { + get + { + if (_L_PreviewImage == null) _L_PreviewImage = new PreviewImage(UiPanel, Instance.GetNode("PreviewImage")); + return _L_PreviewImage; + } + } + private PreviewImage _L_PreviewImage; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomName + /// + public RoomName L_RoomName + { + get + { + if (_L_RoomName == null) _L_RoomName = new RoomName(UiPanel, Instance.GetNode("RoomName")); + return _L_RoomName; + } + } + private RoomName _L_RoomName; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomType + /// + public RoomType L_RoomType + { + get + { + if (_L_RoomType == null) _L_RoomType = new RoomType(UiPanel, Instance.GetNode("RoomType")); + return _L_RoomType; + } + } + private RoomType _L_RoomType; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.SelectTexture + /// + public SelectTexture_1 L_SelectTexture + { + get + { + if (_L_SelectTexture == null) _L_SelectTexture = new SelectTexture_1(UiPanel, Instance.GetNode("SelectTexture")); + return _L_SelectTexture; + } + } + private SelectTexture_1 _L_SelectTexture; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.ErrorTexture + /// + public ErrorTexture L_ErrorTexture + { + get + { + if (_L_ErrorTexture == null) _L_ErrorTexture = new ErrorTexture(UiPanel, Instance.GetNode("ErrorTexture")); + return _L_ErrorTexture; + } + } + private ErrorTexture _L_ErrorTexture; + + public RoomButton(MapEditorProjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override RoomButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer + /// + public class ScrollContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.RoomButton + /// + public RoomButton L_RoomButton + { + get + { + if (_L_RoomButton == null) _L_RoomButton = new RoomButton(UiPanel, Instance.GetNode("RoomButton")); + return _L_RoomButton; + } + } + private RoomButton _L_RoomButton; + + public ScrollContainer_1(MapEditorProjectPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer_1 Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer + /// + public class VBoxContainer_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.HBoxContainer + /// + public HBoxContainer_2 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_2(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_2 _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer + /// + public ScrollContainer_1 L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer_1(UiPanel, Instance.GetNode("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer_1 _L_ScrollContainer; + + public VBoxContainer_2(MapEditorProjectPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_2 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer + /// + public class MarginContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.VBoxContainer + /// + public VBoxContainer_2 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_2(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_2 _L_VBoxContainer; + + public MarginContainer_1(MapEditorProjectPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer_1 Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2 + /// + public class Panel2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.MarginContainer + /// + public MarginContainer_1 L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer_1(UiPanel, Instance.GetNode("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer_1 _L_MarginContainer; + + public Panel2(MapEditorProjectPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Panel2 Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.Panel + /// + public Panel L_Panel + { + get + { + if (_L_Panel == null) _L_Panel = new Panel(UiPanel, Instance.GetNode("Panel")); + return _L_Panel; + } + } + private Panel _L_Panel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.Panel2 + /// + public Panel2 L_Panel2 + { + get + { + if (_L_Panel2 == null) _L_Panel2 = new Panel2(UiPanel, Instance.GetNode("Panel2")); + return _L_Panel2; + } + } + private Panel2 _L_Panel2; + + public HBoxContainer(MapEditorProjectPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.Head + /// + public Head L_Head + { + get + { + if (_L_Head == null) _L_Head = new Head(UiPanel, Instance.GetNode("Head")); + return _L_Head; + } + } + private Head _L_Head; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + public VBoxContainer(MapEditorProjectPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg + /// + public class Bg : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public Bg(MapEditorProjectPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Bg Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.Head.Back + /// + public Back S_Back => L_Bg.L_VBoxContainer.L_Head.L_Back; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.Head + /// + public Head S_Head => L_Bg.L_VBoxContainer.L_Head; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.GroupSearchInput + /// + public GroupSearchInput S_GroupSearchInput => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_GroupSearchInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.GroupSearchButton + /// + public GroupSearchButton S_GroupSearchButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_GroupSearchButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.HBoxContainer.GroupAddButton + /// + public GroupAddButton S_GroupAddButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_GroupAddButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.GroupButton + /// + public GroupButton S_GroupButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_GroupButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel + /// + public Panel S_Panel => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomSearchInput + /// + public RoomSearchInput S_RoomSearchInput => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomSearchInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomTypeButton + /// + public RoomTypeButton S_RoomTypeButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomTypeButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomSearchButton + /// + public RoomSearchButton S_RoomSearchButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomSearchButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomAddButton + /// + public RoomAddButton S_RoomAddButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomAddButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomEditButton + /// + public RoomEditButton S_RoomEditButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomEditButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.HBoxContainer.RoomDeleteButton + /// + public RoomDeleteButton S_RoomDeleteButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_RoomDeleteButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.PreviewImage + /// + public PreviewImage S_PreviewImage => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_RoomButton.L_PreviewImage; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.RoomName + /// + public RoomName S_RoomName => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_RoomButton.L_RoomName; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.RoomType + /// + public RoomType S_RoomType => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_RoomButton.L_RoomType; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton.ErrorTexture + /// + public ErrorTexture S_ErrorTexture => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_RoomButton.L_ErrorTexture; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.VBoxContainer.ScrollContainer.RoomButton + /// + public RoomButton S_RoomButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_RoomButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2 + /// + public Panel2 S_Panel2 => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg + /// + public Bg S_Bg => L_Bg; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..83cfad660a968047e709933f35d4de587bd7b729 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs @@ -0,0 +1,260 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Godot; + +namespace UI.MapEditorProject; + +public partial class MapEditorProjectPanel : MapEditorProject +{ + //当前显示的组数据 + private UiGrid _groupGrid; + //当前显示的房间数据 + private UiGrid _roomGrid; + private EventFactory _eventFactory; + + public override void OnCreateUi() + { + //初始化枚举选项 + var roomTypes = Enum.GetValues(); + var optionButton = S_RoomTypeButton.Instance; + optionButton.AddItem("全部", 0); + for (var i = 0; i < roomTypes.Length; i++) + { + var dungeonRoomType = roomTypes[i]; + optionButton.AddItem(DungeonManager.DungeonRoomTypeToDescribeString(dungeonRoomType), (int)dungeonRoomType + 1); + } + + _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); + + if (PrevUi != null) + { + S_Back.Instance.Visible = true; + S_Back.Instance.Pressed += OpenPrevUi; + } + else + { + S_Back.Instance.Visible = false; + } + + S_GroupSearchButton.Instance.Pressed += OnSearchGroupButtonClick; + S_RoomSearchButton.Instance.Pressed += OnSearchRoomButtonClick; + S_RoomAddButton.Instance.Pressed += OnCreateRoomClick; + S_RoomEditButton.Instance.Pressed += OnEditRoom; + S_RoomDeleteButton.Instance.Pressed += OnDeleteRoom; + S_GroupAddButton.Instance.Pressed += OnCreateGroupClick; + + _eventFactory = EventManager.CreateEventFactory(); + _eventFactory.AddEventListener(EventEnum.OnCreateGroupFinish, OnCreateGroupFinish); + _eventFactory.AddEventListener(EventEnum.OnCreateRoomFinish, OnCreateRoomFinish); + } + + public override void OnShowUi() + { + RefreshGroup(); + OnSearchRoomButtonClick(); + } + + public override void OnDestroyUi() + { + _eventFactory.RemoveAllEventListener(); + _eventFactory = null; + _groupGrid.Destroy(); + _groupGrid = null; + + _roomGrid.Destroy(); + _roomGrid = null; + } + + /// + /// 刷新组数据 + /// + public void RefreshGroup() + { + var index = _groupGrid.SelectIndex; + if (index == -1) + { + index = 0; + } + MapProjectManager.RefreshMapGroup(); + OnSearchGroupButtonClick(); + _groupGrid.SelectIndex = index; + } + + /// + /// 选中地牢组 + /// + public void SelectGroup(DungeonRoomGroup group) + { + EditorManager.SetSelectDungeonGroup(group); + OnSearchRoomButtonClick(); + } + + /// + /// 选择地图并打开地图编辑器 + /// + public void OpenSelectRoom(DungeonRoomSplit room) + { + HideUi(); + //创建地牢Ui + var mapEditor = UiManager.Create_MapEditor(); + mapEditor.PrevUi = this; + //加载地牢 + mapEditor.LoadMap(room); + //打开Ui + mapEditor.ShowUi(); + } + + //搜索组按钮点击 + private void OnSearchGroupButtonClick() + { + var select = _groupGrid.SelectIndex; + //输入文本 + var text = S_GroupSearchInput.Instance.Text; + if (!string.IsNullOrEmpty(text)) + { + var str = text.Trim().ToLower(); + var list = new List(); + foreach (var valuePair in MapProjectManager.GroupMap) + { + if (valuePair.Value.GroupName.Trim().ToLower().Contains(str)) + { + list.Add(valuePair.Value); + } + } + _groupGrid.SetDataList(list.ToArray()); + } + else + { + _groupGrid.SetDataList(MapProjectManager.GroupMap.Values.ToArray()); + } + + _roomGrid.SelectIndex = select; + } + + //搜索房间按钮点击 + private void OnSearchRoomButtonClick() + { + if (EditorManager.SelectDungeonGroup != null) + { + //输入文本 + var text = S_RoomSearchInput.Instance.Text; + //房间类型 + var roomType = S_RoomTypeButton.Instance.GetSelectedId(); + + IEnumerable result = EditorManager.SelectDungeonGroup.GetAllRoomList(); + + //名称搜索 + if (!string.IsNullOrEmpty(text)) + { + var queryText = text.Trim().ToLower(); + result = result.Where(split => + { + return split.RoomInfo.RoomName.Trim().ToLower().Contains(queryText); + }); + } + + //类型搜索 + if (roomType > 0) + { + var type = (DungeonRoomType)(roomType - 1); + result = result.Where(split => split.RoomInfo.RoomType == type); + } + + _roomGrid.SetDataList(result.ToArray()); + } + else + { + _roomGrid.RemoveAll(); + } + } + + //创建组按钮点击 + private void OnCreateGroupClick() + { + EditorWindowManager.ShowCreateGroup(CreateGroup); + } + + //创建地牢房间按钮点击 + private void OnCreateRoomClick() + { + var groupName = EditorManager.SelectDungeonGroup != null ? EditorManager.SelectDungeonGroup.GroupName : null; + EditorWindowManager.ShowCreateRoom(groupName, Mathf.Max(S_RoomTypeButton.Instance.Selected - 1, 0), CreateRoom); + } + + + //编辑房间 + private void OnEditRoom() + { + var selectRoom = _roomGrid.SelectData; + if (selectRoom == null) + { + EditorWindowManager.ShowTips("提示", "请选择需要编辑的房间!"); + } + else + { + EditorWindowManager.ShowEditRoom(selectRoom, (room) => + { + //保存房间数据 + MapProjectManager.SaveRoomInfo(room); + OnSearchRoomButtonClick(); + }); + } + } + + //删除房间 + private void OnDeleteRoom() + { + var selectRoom = _roomGrid.SelectData; + if (selectRoom == null) + { + EditorWindowManager.ShowTips("提示", "请选择需要删除的房间!"); + } + else + { + EditorWindowManager.ShowConfirm("提示", $"是否删除房间: {selectRoom.RoomInfo.RoomName}, 该操作无法撤销!", result => + { + if (result) + { + //删除房间 + if (MapProjectManager.DeleteRoom(EditorManager.SelectDungeonGroup, selectRoom)) + { + MapProjectManager.SaveGroupMap(); + OnSearchRoomButtonClick(); + } + } + }); + } + } + + //创建地牢组 + private void CreateGroup(DungeonRoomGroup group) + { + MapProjectManager.CreateGroup(group); + } + + //创建房间 + private void CreateRoom(DungeonRoomSplit roomSplit) + { + MapProjectManager.CreateRoom(roomSplit); + } + + //创建地牢组完成 + private void OnCreateGroupFinish(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 new file mode 100644 index 0000000000000000000000000000000000000000..9d82d5a7738e50c97ac9db377e99f34ffd05710c --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs @@ -0,0 +1,62 @@ +using Godot; + +namespace UI.MapEditorProject; + +public class RoomButtonCell : UiCell +{ + public override void OnInit() + { + CellNode.L_SelectTexture.Instance.Visible = false; + } + + public override void OnSetData(DungeonRoomSplit data) + { + CellNode.L_RoomName.Instance.Text = data.RoomInfo.RoomName; + CellNode.L_RoomType.Instance.Text = DungeonManager.DungeonRoomTypeToDescribeString(data.RoomInfo.RoomType); + + //预览图 + CellNode.L_PreviewImage.Instance.Texture = data.PreviewImage; + + //提示 + var tipText = "权重: " + data.RoomInfo.Weight; + + //错误消息 + if (data.ErrorType == RoomErrorType.None) + { + CellNode.L_ErrorTexture.Instance.Visible = false; + } + else + { + CellNode.L_ErrorTexture.Instance.Visible = true; + tipText += "\n错误: " + EditorManager.GetRoomErrorTypeMessage(data.ErrorType); + } + + if (!string.IsNullOrEmpty(data.RoomInfo.Remark)) + { + tipText += "\n备注: " + data.RoomInfo.Remark; + } + CellNode.Instance.TooltipText = tipText; + } + + public override void OnDisable() + { + CellNode.L_PreviewImage.Instance.Texture = null; + } + + public override void OnDoubleClick() + { + //打开房间编辑器 + CellNode.UiPanel.OpenSelectRoom(Data); + } + + public override void OnSelect() + { + EditorManager.SetSelectRoom(Data); + CellNode.L_SelectTexture.Instance.Visible = true; + } + + public override void OnUnSelect() + { + CellNode.L_SelectTexture.Instance.Visible = false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/MapEditorSelectObject.cs b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/MapEditorSelectObject.cs new file mode 100644 index 0000000000000000000000000000000000000000..6cfc7e8638aefe588b7af00cb12c18f360c15b2e --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/MapEditorSelectObject.cs @@ -0,0 +1,486 @@ +namespace UI.MapEditorSelectObject; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorSelectObject : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer((MapEditorSelectObjectPanel)this, GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + + public MapEditorSelectObject() : base(nameof(MapEditorSelectObject)) + { + } + + public sealed override void OnInitNestedUi() + { + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.TypeButton.Select + /// + public class Select : UiNode + { + public Select(MapEditorSelectObjectPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override Select Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.TypeButton + /// + public class TypeButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.Select + /// + public Select L_Select + { + get + { + if (_L_Select == null) _L_Select = new Select(UiPanel, Instance.GetNodeOrNull("Select")); + return _L_Select; + } + } + private Select _L_Select; + + public TypeButton(MapEditorSelectObjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override TypeButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer + /// + public class ScrollContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer.TypeButton + /// + public TypeButton L_TypeButton + { + get + { + if (_L_TypeButton == null) _L_TypeButton = new TypeButton(UiPanel, Instance.GetNodeOrNull("TypeButton")); + return _L_TypeButton; + } + } + private TypeButton _L_TypeButton; + + public ScrollContainer(MapEditorSelectObjectPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.ScrollContainer + /// + public ScrollContainer L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNodeOrNull("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer _L_ScrollContainer; + + public VBoxContainer(MapEditorSelectObjectPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public MarginContainer(MapEditorSelectObjectPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel + /// + public class Panel : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(UiPanel, Instance.GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + public Panel(MapEditorSelectObjectPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Panel Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer.HBoxContainer.LineEdit + /// + public class LineEdit : UiNode + { + public LineEdit(MapEditorSelectObjectPanel uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override LineEdit Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer.HBoxContainer.Search + /// + public class Search : UiNode + { + public Search(MapEditorSelectObjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Search Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer.HBoxContainer + /// + public class HBoxContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer.LineEdit + /// + public LineEdit L_LineEdit + { + get + { + if (_L_LineEdit == null) _L_LineEdit = new LineEdit(UiPanel, Instance.GetNodeOrNull("LineEdit")); + return _L_LineEdit; + } + } + private LineEdit _L_LineEdit; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer.Search + /// + public Search L_Search + { + get + { + if (_L_Search == null) _L_Search = new Search(UiPanel, Instance.GetNodeOrNull("Search")); + return _L_Search; + } + } + private Search _L_Search; + + public HBoxContainer_1(MapEditorSelectObjectPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer + /// + public class MarginContainer_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.HBoxContainer + /// + public HBoxContainer_1 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_1(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_1 _L_HBoxContainer; + + public MarginContainer_2(MapEditorSelectObjectPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer_2 Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectButton.PreviewImage + /// + public class PreviewImage : UiNode + { + public PreviewImage(MapEditorSelectObjectPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override PreviewImage Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectButton.ObjectName + /// + public class ObjectName : UiNode + { + public ObjectName(MapEditorSelectObjectPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override ObjectName Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectButton.Select + /// + public class Select_1 : UiNode + { + public Select_1(MapEditorSelectObjectPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override Select_1 Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectButton + /// + public class ObjectButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.PreviewImage + /// + public PreviewImage L_PreviewImage + { + get + { + if (_L_PreviewImage == null) _L_PreviewImage = new PreviewImage(UiPanel, Instance.GetNodeOrNull("PreviewImage")); + return _L_PreviewImage; + } + } + private PreviewImage _L_PreviewImage; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectName + /// + public ObjectName L_ObjectName + { + get + { + if (_L_ObjectName == null) _L_ObjectName = new ObjectName(UiPanel, Instance.GetNodeOrNull("ObjectName")); + return _L_ObjectName; + } + } + private ObjectName _L_ObjectName; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.Select + /// + public Select_1 L_Select + { + get + { + if (_L_Select == null) _L_Select = new Select_1(UiPanel, Instance.GetNodeOrNull("Select")); + return _L_Select; + } + } + private Select_1 _L_Select; + + public ObjectButton(MapEditorSelectObjectPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override ObjectButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer + /// + public class ScrollContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ObjectButton + /// + public ObjectButton L_ObjectButton + { + get + { + if (_L_ObjectButton == null) _L_ObjectButton = new ObjectButton(UiPanel, Instance.GetNodeOrNull("ObjectButton")); + return _L_ObjectButton; + } + } + private ObjectButton _L_ObjectButton; + + public ScrollContainer_1(MapEditorSelectObjectPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer_1 Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2 + /// + public class VBoxContainer2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.MarginContainer + /// + public MarginContainer_2 L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer_2(UiPanel, Instance.GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer_2 _L_MarginContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.ScrollContainer + /// + public ScrollContainer_1 L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer_1(UiPanel, Instance.GetNodeOrNull("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer_1 _L_ScrollContainer; + + public VBoxContainer2(MapEditorSelectObjectPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer2 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer + /// + public class MarginContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.VBoxContainer2 + /// + public VBoxContainer2 L_VBoxContainer2 + { + get + { + if (_L_VBoxContainer2 == null) _L_VBoxContainer2 = new VBoxContainer2(UiPanel, Instance.GetNodeOrNull("VBoxContainer2")); + return _L_VBoxContainer2; + } + } + private VBoxContainer2 _L_VBoxContainer2; + + public MarginContainer_1(MapEditorSelectObjectPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer_1 Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer.Panel2 + /// + public class Panel2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.MarginContainer + /// + public MarginContainer_1 L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer_1(UiPanel, Instance.GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer_1 _L_MarginContainer; + + public Panel2(MapEditorSelectObjectPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override Panel2 Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorSelectObject.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.Panel + /// + public Panel L_Panel + { + get + { + if (_L_Panel == null) _L_Panel = new Panel(UiPanel, Instance.GetNodeOrNull("Panel")); + return _L_Panel; + } + } + private Panel _L_Panel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorSelectObject.Panel2 + /// + public Panel2 L_Panel2 + { + get + { + if (_L_Panel2 == null) _L_Panel2 = new Panel2(UiPanel, Instance.GetNodeOrNull("Panel2")); + return _L_Panel2; + } + } + private Panel2 _L_Panel2; + + public HBoxContainer(MapEditorSelectObjectPanel uiPanel, Godot.HSplitContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HSplitContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer.ScrollContainer.TypeButton + /// + public TypeButton S_TypeButton => L_HBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer.L_ScrollContainer.L_TypeButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel.MarginContainer.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_HBoxContainer.L_Panel.L_MarginContainer.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel + /// + public Panel S_Panel => L_HBoxContainer.L_Panel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer.HBoxContainer.LineEdit + /// + public LineEdit S_LineEdit => L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer2.L_MarginContainer.L_HBoxContainer.L_LineEdit; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.MarginContainer.HBoxContainer.Search + /// + public Search S_Search => L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer2.L_MarginContainer.L_HBoxContainer.L_Search; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectButton.PreviewImage + /// + public PreviewImage S_PreviewImage => L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer2.L_ScrollContainer.L_ObjectButton.L_PreviewImage; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectButton.ObjectName + /// + public ObjectName S_ObjectName => L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer2.L_ScrollContainer.L_ObjectButton.L_ObjectName; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2.ScrollContainer.ObjectButton + /// + public ObjectButton S_ObjectButton => L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer2.L_ScrollContainer.L_ObjectButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2.MarginContainer.VBoxContainer2 + /// + public VBoxContainer2 S_VBoxContainer2 => L_HBoxContainer.L_Panel2.L_MarginContainer.L_VBoxContainer2; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorSelectObject.HBoxContainer.Panel2 + /// + public Panel2 S_Panel2 => L_HBoxContainer.L_Panel2; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/MapEditorSelectObjectPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/MapEditorSelectObjectPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..c06f20bc37f9e936c70744e60b86d7ba735d90e1 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/MapEditorSelectObjectPanel.cs @@ -0,0 +1,129 @@ +using System; +using System.Linq; +using Config; +using Godot; + +namespace UI.MapEditorSelectObject; + +public partial class MapEditorSelectObjectPanel : MapEditorSelectObject +{ + /// + /// 双击选中物体事件 + /// + public event Action SelectObjectEvent; + + public class TypeButtonData + { + /// + /// 类型名称 + /// + public string Name; + /// + /// 类型值 + /// + public int Type; + + public TypeButtonData(string name, int type) + { + Name = name; + Type = type; + } + } + //类型网格组件 + private UiGrid _typeGrid; + //物体网格组件 + private UiGrid _objectGrid; + //允许出现在该面板中的物体类型 + private int[] _typeArray = new[] { 4, 5, 9 }; + + public override void OnCreateUi() + { + S_Search.Instance.Pressed += OnSearch; + + _typeGrid = new UiGrid(S_TypeButton, typeof(TypeButtonCell)); + _typeGrid.SetColumns(1); + _typeGrid.SetHorizontalExpand(true); + _typeGrid.SetCellOffset(new Vector2I(0, 5)); + + _objectGrid = new UiGrid(S_ObjectButton, typeof(ObjectButtonCell)); + _objectGrid.SetAutoColumns(true); + _objectGrid.SetHorizontalExpand(true); + _objectGrid.SetCellOffset(new Vector2I(10, 10)); + } + + public override void OnDestroyUi() + { + _typeGrid.Destroy(); + _objectGrid.Destroy(); + } + + /// + /// 设置显示的物体类型 + /// + public void SetShowType(ActivityType activityType) + { + _typeGrid.RemoveAll(); + if (activityType == ActivityType.None) + { + _typeGrid.Add(new TypeButtonData("所有", -1)); + _typeGrid.Add(new TypeButtonData(ActivityId.GetTypeName(ActivityType.Weapon), (int)ActivityType.Weapon)); + _typeGrid.Add(new TypeButtonData(ActivityId.GetTypeName(ActivityType.Prop), (int)ActivityType.Prop)); + _typeGrid.Add(new TypeButtonData(ActivityId.GetTypeName(ActivityType.Enemy), (int)ActivityType.Enemy)); + } + else + { + _typeGrid.Add(new TypeButtonData(ActivityId.GetTypeName(activityType), (int)activityType)); + } + _typeGrid.SelectIndex = 0; + } + + /// + /// 搜索对象 + /// + public void OnSearch() + { + //类型 + int type; + //名称 + var name = S_LineEdit.Instance.Text; + var buttonData = _typeGrid.GetData(_typeGrid.SelectIndex); + if (buttonData != null) + { + type = buttonData.Type; + } + else + { + type = -1; + } + + //搜索结果 + var arr = ExcelConfig.ActivityObject_List.Where( + o => + { + return o.ShowInMapEditor && + (string.IsNullOrEmpty(name) || o.Name.Contains(name) || o.Id.Contains(name)) && + (type < 0 ? _typeArray.Contains(o.Type) : o.Type == type); + } + ).ToArray(); + _objectGrid.SetDataList(arr); + } + + /// + /// 选中对象 + /// + public void SelectCell(ExcelConfig.ActivityObject activityObject) + { + if (SelectObjectEvent != null) + { + SelectObjectEvent(activityObject); + } + } + + /// + /// 获取选中的数据 + /// + public ExcelConfig.ActivityObject GetSelectData() + { + return _objectGrid.SelectData; + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/ObjectButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/ObjectButtonCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..9c4e03fd967be2f2a3f1a8ab5d2d7791840c203b --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/ObjectButtonCell.cs @@ -0,0 +1,42 @@ +using Config; +using Godot; + +namespace UI.MapEditorSelectObject; + +public class ObjectButtonCell : UiCell +{ + public override void OnInit() + { + CellNode.L_Select.Instance.Visible = false; + } + + public override void OnSetData(ExcelConfig.ActivityObject data) + { + CellNode.L_ObjectName.Instance.Text = data.Name; + if (!string.IsNullOrEmpty(data.Icon)) + { + CellNode.L_PreviewImage.Instance.Visible = true; + CellNode.L_PreviewImage.Instance.Texture = ResourceManager.LoadTexture2D(data.Icon); + } + else + { + CellNode.L_PreviewImage.Instance.Visible = false; + } + } + + public override void OnDoubleClick() + { + //双击选择该对象 + CellNode.UiPanel.SelectCell(Data); + } + + public override void OnSelect() + { + CellNode.L_Select.Instance.Visible = true; + } + + public override void OnUnSelect() + { + CellNode.L_Select.Instance.Visible = false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/TypeButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/TypeButtonCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..9a8efc4f915a5fba0bbcf77ed3ce929884bb2e10 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorSelectObject/TypeButtonCell.cs @@ -0,0 +1,25 @@ +namespace UI.MapEditorSelectObject; + +public class TypeButtonCell : UiCell +{ + public override void OnInit() + { + CellNode.L_Select.Instance.Visible = false; + } + + public override void OnSetData(MapEditorSelectObjectPanel.TypeButtonData data) + { + CellNode.Instance.Text = data.Name; + } + + public override void OnSelect() + { + CellNode.L_Select.Instance.Visible = true; + CellNode.UiPanel.OnSearch(); + } + + public override void OnUnSelect() + { + CellNode.L_Select.Instance.Visible = false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs new file mode 100644 index 0000000000000000000000000000000000000000..f75311bedc1acedceefba7728bd58063ff761ce0 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragArea.cs @@ -0,0 +1,444 @@ +using System; +using Godot; +using UI.MapEditor; + +namespace UI.MapEditorTools; + +public partial class DoorDragArea : Control +{ + /// + /// 当前区域所占大小, 单位: 像素 + /// + public Vector2 AreaSize => new Vector2(_areaSize, GameConfig.TileCellSize * 2); + + //错误时的颜色 + private static Color _errorColor = new Color(1, 0, 0, 0.1882353F); + + /// + /// 朝向 + /// + public DoorDirection Direction { get; private set; } + + /// + /// 绑定的数据 + /// + 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; + //默认颜色 + private Color _defaultColor; + //区域大小, 单位: 像素 + private int _areaSize = GameConfig.TileCellSize * 4; + //拖拽松手后是否可以提交 + private bool _canComment = true; + //开始拖拽时的区域 + private Vector2I _startDragRange; + //是否是拖拽模式 + private bool _isDragMode = false; + //拖拽模式提交回调 + private Action _onSubmit; + //拖拽模式取消时回调 + private Action _onCancel; + + public void SetDoorDragAreaNode(MapEditorTools.DoorToolTemplate node) + { + _node = node; + MapEditorToolsPanel = (MapEditorToolsPanel)node.UiPanel; + _defaultColor = _node.L_DoorArea.Instance.Color; + _startButton = _node.L_StartBtn.Instance; + _endButton = _node.L_EndBtn.Instance; + + _startButton.DragEvent += OnStartAreaDrag; + _endButton.DragEvent += OnEndAreaDrag; + node.L_DoorArea.Instance.MouseEntered += OnMouseEntered; + node.L_DoorArea.Instance.MouseExited += OnMouseExited; + + SetDoorAreaSize(GameConfig.TileCellSize * 4); + } + + public override void _Process(double delta) + { + if (_mouseHover && !DoorHoverArea.IsDrag && Input.IsMouseButtonPressed(MouseButton.Right)) //右键删除区域 + { + MapEditorToolsPanel.RemoveDoorTool(_node); + } + else if (_isDragMode) + { + if (!Input.IsMouseButtonPressed(MouseButton.Left)) //松开了右键 + { + _isDragMode = false; + if (_canComment) //可以提交 + { + _isDragMode = false; + _onCancel = null; + _startButton.EmitSignal(BaseButton.SignalName.ButtonUp); + _endButton.EmitSignal(BaseButton.SignalName.ButtonUp); + if (_onSubmit != null) + { + var doorAreaRange = GetDoorAreaRange(); + _onSubmit(Direction, doorAreaRange.X, doorAreaRange.Y); + _onSubmit = null; + } + } + else //不能提交 + { + if (_onCancel != null) + { + _onCancel(); + } + } + } + } + } + + /// + /// 设置门区域的位置, 单位: 像素 + /// + public void SetDoorAreaPosition(Vector2 position) + { + Position = position; + } + + /// + /// 设置所属悬停区域 + /// + public void SetDoorHoverArea(DoorHoverArea hoverArea) + { + DoorHoverArea = hoverArea; + Direction = hoverArea.Direction; + if (Direction == DoorDirection.N) + { + Scale = new Vector2(1, 1); + RotationDegrees = 0; + } + else if (Direction == DoorDirection.E) + { + Scale = new Vector2(1, 1); + RotationDegrees = 90; + } + else if (Direction == DoorDirection.S) + { + Scale = new Vector2(-1, 1); + RotationDegrees = 180; + } + else + { + Scale = new Vector2(-1, 1); + RotationDegrees = 270; + } + } + + /// + /// 获取门区域所占范围, 单位: 像素, 返回的 Vector2I 的 x 代表起始坐标, y 代表结束坐标 + /// + /// + public Vector2I GetDoorAreaRange() + { + var start = (int)(_startButton.Position.X + _startButton.Size.X); + return new Vector2I(start, start + _areaSize); + } + + /// + /// 设置门区域所占范围, 单位: 像素 + /// + public void SetDoorAreaRange(int start, int end) + { + var startPosition = _startButton.Position; + startPosition.X = start - _startButton.Size.X; + _startButton.Position = startPosition; + + SetDoorAreaSize(end - start); + } + + /// + /// 设置区域起始坐标 + /// + public void SetDoorAreaStart(int start) + { + var startPosition = _startButton.Position; + startPosition.X = start - _startButton.Size.X; + _startButton.Position = startPosition; + + RefreshArea(); + } + + /// + /// 设置区域大小, 单位: 像素 + /// + public void SetDoorAreaSize(int value) + { + _areaSize = value; + RefreshArea(); + //GD.Print("size: " + GetDoorAreaRange()); + } + + //刷新区域位置 + private void RefreshArea() + { + var colorRect = _node.L_DoorArea.Instance; + var position = colorRect.Position; + position.X = _startButton.Position.X + _startButton.Size.X; + colorRect.Position = position; + colorRect.Size = AreaSize; + + var position2 = _endButton.Position; + position2.X = position.X + AreaSize.X; + _endButton.Position = position2; + } + + //拖拽起始点 + private void OnStartAreaDrag(DragState dragState, Vector2 offset) + { + if (dragState == DragState.DragStart) + { + DoorHoverArea.IsDrag = true; + _canComment = true; + _startTempPos = _startButton.Position; + _startDragRange = GetDoorAreaRange(); + } + else if (dragState == DragState.DragMove) + { + if (_isDragMode) + { + offset.X -= GameConfig.TileCellSize; + } + + var position = _startTempPos; + position.X += offset.X + _startButton.Size.X; + var endPosition = _endButton.Position; + + //拖拽模式 + if (_isDragMode) + { + if (position.X > endPosition.X) //该换方向了 + { + _startButton.EmitSignal(BaseButton.SignalName.ButtonUp); + _endButton.EmitSignal(BaseButton.SignalName.ButtonDown); + + if (Mathf.Abs(position.X - endPosition.X) >= GameConfig.TileCellSize * 4 && !_canComment) + { + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + } + return; + } + } + + //计算区域大小 + var areaSize = (int)(endPosition.X - position.X); + _startButton.Position = position - new Vector2(_startButton.Size.X, 0); + //刷新区域位置 + SetDoorAreaSize(areaSize); + + //起始点坐标必须要小于终点坐标, 且起点坐标大于0 + if (position.X < endPosition.X && (DoorHoverArea == null || position.X >= 0)) + { + //区域必须大于等于 4 格宽度 + if (areaSize >= GameConfig.TileCellSize * 4) + { + var doorAreaRange = GetDoorAreaRange(); + //检测是否撞到其他区域 + 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) + { + //可以提交 + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + return; + } + } + } + + //错误的位置 + if (_canComment) + { + _canComment = false; + _node.L_DoorArea.Instance.Color = _errorColor; + } + } + else + { + DoorHoverArea.IsDrag = false; + //松手后如果不能提交, 则还原初始位置 + if (!_canComment) + { + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + SetDoorAreaRange(_startDragRange.X, _startDragRange.Y); + } + else + { + //提交数据 + SubmitData(); + } + if (DoorHoverArea != null) + { + DoorHoverArea.EmitSignal(Control.SignalName.MouseExited); + } + } + } + + private void OnEndAreaDrag(DragState dragState, Vector2 offset) + { + if (dragState == DragState.DragStart) + { + DoorHoverArea.IsDrag = true; + _canComment = true; + _endTempPos = _endButton.Position; + _startDragRange = GetDoorAreaRange(); + } + else if (dragState == DragState.DragMove) + { + var position = _endTempPos; + position.X = position.X += offset.X; + var startPosition = _startButton.Position + new Vector2(_startButton.Size.X, 0); + + //拖拽模式 + if (_isDragMode) + { + if (position.X < startPosition.X) //该换方向了 + { + _endButton.EmitSignal(BaseButton.SignalName.ButtonUp); + _startButton.EmitSignal(BaseButton.SignalName.ButtonDown); + + if (Mathf.Abs(position.X - startPosition.X) >= GameConfig.TileCellSize * 4 && !_canComment) + { + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + } + return; + } + } + + //区域大小 + var areaSize = (int)(position.X - startPosition.X); + //刷新区域位置 + SetDoorAreaSize(areaSize); + + //终点坐标必须要大于起始点坐标, 且终点坐标必须小于宽度 + if (position.X > startPosition.X && (DoorHoverArea == null || position.X <= DoorHoverArea.Size.X)) + { + //区域必须大于等于 4 格宽度 + if (areaSize >= GameConfig.TileCellSize * 4) + { + var doorAreaRange = GetDoorAreaRange(); + //检测是否撞到其他区域 + 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) + { + //可以提交 + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + return; + } + } + } + + //错误的位置 + if (_canComment) + { + _canComment = false; + _node.L_DoorArea.Instance.Color = _errorColor; + } + } + else + { + DoorHoverArea.IsDrag = false; + //松手后如果不能提交, 则还原初始位置 + if (!_canComment) + { + _canComment = true; + _node.L_DoorArea.Instance.Color = _defaultColor; + SetDoorAreaRange(_startDragRange.X, _startDragRange.Y); + } + else + { + //提交数据 + SubmitData(); + } + if (DoorHoverArea != null) + { + DoorHoverArea.EmitSignal(Control.SignalName.MouseExited); + } + } + } + + /// + /// 将该区域变为拖拽模式, 用于创建门区域 + /// + /// 成功提交时回调, 参数1为方向, 参数2为起始点, 参数3为大小 + /// 取消时调用 + public void MakeDragMode(Action onSubmit, Action onCancel) + { + _canComment = false; + _isDragMode = true; + _onSubmit = onSubmit; + _onCancel = onCancel; + _endButton.EmitSignal(BaseButton.SignalName.ButtonDown); + } + + //提交数据 + private void SubmitData() + { + //保存数据 + if (DoorAreaInfo != null) + { + var doorAreaRange = GetDoorAreaRange(); + DoorAreaInfo.Start = doorAreaRange.X; + DoorAreaInfo.End = doorAreaRange.Y; + GD.Print("提交修改: " + doorAreaRange); + //派发修改数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + } + + private void OnMouseEntered() + { + if (MapEditorToolsPanel.EditorMap.Instance.MouseType != EditorTileMap.MouseButtonType.Edit) + { + return; + } + _mouseHover = true; + } + + private void OnMouseExited() + { + if (MapEditorToolsPanel.EditorMap.Instance.MouseType != EditorTileMap.MouseButtonType.Edit) + { + return; + } + _mouseHover = false; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragButton.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragButton.cs new file mode 100644 index 0000000000000000000000000000000000000000..6f81623023fdcba630a0c3d8193f36fcd1302de3 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorDragButton.cs @@ -0,0 +1,106 @@ +using System; +using Godot; +using UI.MapEditor; + +namespace UI.MapEditorTools; + +public partial class DoorDragButton : TextureButton +{ + private static Vector2 _stepValue = new Vector2(GameConfig.TileCellSize, GameConfig.TileCellSize); + + + /// + /// 拖拽当前物体的回调函数, 第一个参数为拖拽状态, 第二个参数为相对于初始点的拖拽偏移坐标 + /// + public event Action DragEvent; + + private DoorDragArea _parent; + private bool _down; + private Vector2 _startPos; + private Vector2 _prevPos; + private MapEditorToolsPanel _mapEditorToolsPanel; + + public override void _Ready() + { + _parent = GetParent(); + ButtonDown += OnButtonDown; + ButtonUp += OnButtonUp; + } + + public void SetMapEditorToolsPanel(MapEditorToolsPanel panel) + { + _mapEditorToolsPanel = panel; + } + + public override void _Process(double delta) + { + if (_down) + { + if (DragEvent != null) + { + var value = (GetGlobalMousePosition() - _startPos) / _parent.Scale / _mapEditorToolsPanel.S_ToolRoot.Instance.Scale; + var offset = Utils.Adsorption(value, _stepValue); + //处理朝向问题 + if (_parent.Direction == DoorDirection.E) + { + offset = new Vector2(offset.Y, offset.X); + } + else if (_parent.Direction == DoorDirection.S) + { + offset = new Vector2(-offset.X, offset.Y); + } + else if (_parent.Direction == DoorDirection.W) + { + offset = new Vector2(offset.Y, -offset.X); + } + + if (offset != _prevPos) + { + _prevPos = offset; + DragEvent(DragState.DragMove, offset); + } + } + } + } + + private void OnButtonDown() + { + if (_mapEditorToolsPanel.EditorMap.Instance.MouseType != EditorTileMap.MouseButtonType.Edit) + { + return; + } + if (_down) + { + return; + } + _down = true; + Modulate = new Color(0.7f, 0.7f, 0.7f, 1); + _startPos = GetGlobalMousePosition(); + _prevPos = new Vector2(-99999, -99999); + if (DragEvent != null) + { + DragEvent(DragState.DragStart, Vector2.Zero); + } + } + + private void OnButtonUp() + { + if (_mapEditorToolsPanel.EditorMap.Instance.MouseType != EditorTileMap.MouseButtonType.Edit) + { + return; + } + if (!_down) + { + return; + } + _down = false; + Modulate = new Color(1, 1, 1, 1); + if (DragEvent != null) + { + var value = (GetGlobalMousePosition() - _startPos) / _parent.Scale / _mapEditorToolsPanel.S_ToolRoot.Instance.Scale; + var offset = Utils.Adsorption(value, _stepValue); + _prevPos = offset; + DragEvent(DragState.DragEnd, offset); + } + } +} \ 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 new file mode 100644 index 0000000000000000000000000000000000000000..21bca904155086dc2149bc557b5884a478968c64 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/DoorHoverArea.cs @@ -0,0 +1,129 @@ +using Godot; +using UI.MapEditor; +using UI.MapEditorTools; + +public partial class DoorHoverArea : ColorRect +{ + /// + /// 是否拖拽中 + /// + public static bool IsDrag { get; set; } + + /// + /// 所属 Ui 对象 + /// + public MapEditorToolsPanel MapEditorToolsPanel { get; private set; } + + /// + /// 房间门的朝向 + /// + public DoorDirection Direction { get; private set; } + + private bool _mouseHover; + private Control _parent; + //当前正在拖拽创建的 DoorToolTemplate + private MapEditorTools.DoorToolTemplate _currToolTemplate; + + public override void _Ready() + { + _parent = GetParent(); + MouseEntered += OnMouseEnter; + MouseExited += OnMouseExit; + } + + public void Init(MapEditorToolsPanel panel, DoorDirection direction) + { + IsDrag = false; + MapEditorToolsPanel = panel; + Direction = direction; + } + + public override void _Process(double delta) + { + if (_mouseHover && MapEditorToolsPanel.ActiveHoverArea == this) + { + if (!IsDrag) + { + var start = Utils.Adsorption(_parent.GetLocalMousePosition().X, GameConfig.TileCellSize); + var previewRoot = MapEditorToolsPanel.S_HoverPreviewRoot.Instance; + + //检测是否会与其他门发生碰撞 + var canCreateDragArea = MapEditorToolsPanel.EditorMap.Instance.CheckDoorArea(Direction, start, start); + if (canCreateDragArea) + { + previewRoot.Visible = true; + previewRoot.Position = new Vector2(start, 0); + + if (Input.IsMouseButtonPressed(MouseButton.Left)) + { + IsDrag = true; + _currToolTemplate = MapEditorToolsPanel.CreateDragDoorTool(this, start, + OnSubmitDoorArea, OnCancelDoorArea); + } + } + else //发生碰撞, 不能提交 + { + previewRoot.Visible = false; + } + } + } + } + + //提交门区域 + private void OnSubmitDoorArea(DoorDirection direction, int start, int end) + { + IsDrag = false; + GD.Print("提交创建: " + direction + ", " + start + ", " + end); + _currToolTemplate.Instance.DoorAreaInfo = MapEditorToolsPanel.EditorMap.Instance.CreateDoorArea(direction, start, end); + //派发修改数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + + //取消提交 + private void OnCancelDoorArea() + { + IsDrag = false; + _currToolTemplate = null; + } + + private void OnMouseEnter() + { + if (MapEditorToolsPanel.EditorMap.Instance.MouseType != EditorTileMap.MouseButtonType.Edit) + { + return; + } + if (MapEditorToolsPanel.ActiveHoverArea == null || !IsDrag) + { + var roomSize = MapEditorToolsPanel.EditorMap.Instance.CurrRoomSize; + //房间大小为0, 不能放置门区域 + if (roomSize.X == 0 && roomSize.Y == 0) + { + return; + } + //正在拖拽标记, 不能放置门区域 + var activeMark = MapEditorToolsPanel.ActiveMark; + if (activeMark != null && (activeMark.IsDrag || activeMark.MarkAreaTool.IsDrag)) + { + return; + } + _mouseHover = true; + MapEditorToolsPanel.SetActiveHoverArea(this); + } + } + + private void OnMouseExit() + { + if (MapEditorToolsPanel.EditorMap.Instance.MouseType != EditorTileMap.MouseButtonType.Edit) + { + return; + } + if (MapEditorToolsPanel.ActiveHoverArea == null || !IsDrag) + { + _mouseHover = false; + if (MapEditorToolsPanel.ActiveHoverArea == this) + { + MapEditorToolsPanel.SetActiveHoverArea(null); + } + } + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorTools.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorTools.cs new file mode 100644 index 0000000000000000000000000000000000000000..77fc4ebfbf3d60ba0121df25984e89228a792fc9 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorTools.cs @@ -0,0 +1,533 @@ +namespace UI.MapEditorTools; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class MapEditorTools : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot + /// + public ToolRoot L_ToolRoot + { + get + { + if (_L_ToolRoot == null) _L_ToolRoot = new ToolRoot((MapEditorToolsPanel)this, GetNodeOrNull("ToolRoot")); + return _L_ToolRoot; + } + } + private ToolRoot _L_ToolRoot; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer((MapEditorToolsPanel)this, GetNodeOrNull("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + + public MapEditorTools() : base(nameof(MapEditorTools)) + { + } + + public sealed override void OnInitNestedUi() + { + _ = L_ToolRoot.L_MarkTemplate; + + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.N_HoverRoot.N_HoverArea + /// + public class N_HoverArea : UiNode + { + public N_HoverArea(MapEditorToolsPanel uiPanel, DoorHoverArea node) : base(uiPanel, node) { } + public override N_HoverArea Clone() => new (UiPanel, (DoorHoverArea)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.N_HoverRoot + /// + public class N_HoverRoot : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.N_HoverArea + /// + public N_HoverArea L_N_HoverArea + { + get + { + if (_L_N_HoverArea == null) _L_N_HoverArea = new N_HoverArea(UiPanel, Instance.GetNodeOrNull("N_HoverArea")); + return _L_N_HoverArea; + } + } + private N_HoverArea _L_N_HoverArea; + + public N_HoverRoot(MapEditorToolsPanel uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override N_HoverRoot Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.E_HoverRoot.E_HoverArea + /// + public class E_HoverArea : UiNode + { + public E_HoverArea(MapEditorToolsPanel uiPanel, DoorHoverArea node) : base(uiPanel, node) { } + public override E_HoverArea Clone() => new (UiPanel, (DoorHoverArea)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.E_HoverRoot + /// + public class E_HoverRoot : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.E_HoverArea + /// + public E_HoverArea L_E_HoverArea + { + get + { + if (_L_E_HoverArea == null) _L_E_HoverArea = new E_HoverArea(UiPanel, Instance.GetNodeOrNull("E_HoverArea")); + return _L_E_HoverArea; + } + } + private E_HoverArea _L_E_HoverArea; + + public E_HoverRoot(MapEditorToolsPanel uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override E_HoverRoot Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.S_HoverRoot.S_HoverArea + /// + public class S_HoverArea : UiNode + { + public S_HoverArea(MapEditorToolsPanel uiPanel, DoorHoverArea node) : base(uiPanel, node) { } + public override S_HoverArea Clone() => new (UiPanel, (DoorHoverArea)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.S_HoverRoot + /// + public class S_HoverRoot : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.S_HoverArea + /// + public S_HoverArea L_S_HoverArea + { + get + { + if (_L_S_HoverArea == null) _L_S_HoverArea = new S_HoverArea(UiPanel, Instance.GetNodeOrNull("S_HoverArea")); + return _L_S_HoverArea; + } + } + private S_HoverArea _L_S_HoverArea; + + public S_HoverRoot(MapEditorToolsPanel uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override S_HoverRoot Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.W_HoverRoot.W_HoverArea + /// + public class W_HoverArea : UiNode + { + public W_HoverArea(MapEditorToolsPanel uiPanel, DoorHoverArea node) : base(uiPanel, node) { } + public override W_HoverArea Clone() => new (UiPanel, (DoorHoverArea)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.W_HoverRoot + /// + public class W_HoverRoot : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.W_HoverArea + /// + public W_HoverArea L_W_HoverArea + { + get + { + if (_L_W_HoverArea == null) _L_W_HoverArea = new W_HoverArea(UiPanel, Instance.GetNodeOrNull("W_HoverArea")); + return _L_W_HoverArea; + } + } + private W_HoverArea _L_W_HoverArea; + + public W_HoverRoot(MapEditorToolsPanel uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override W_HoverRoot Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.HoverPreviewRoot.HoverPreview + /// + public class HoverPreview : UiNode + { + public HoverPreview(MapEditorToolsPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override HoverPreview Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.HoverPreviewRoot + /// + public class HoverPreviewRoot : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.HoverPreview + /// + public HoverPreview L_HoverPreview + { + get + { + if (_L_HoverPreview == null) _L_HoverPreview = new HoverPreview(UiPanel, Instance.GetNodeOrNull("HoverPreview")); + return _L_HoverPreview; + } + } + private HoverPreview _L_HoverPreview; + + public HoverPreviewRoot(MapEditorToolsPanel uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override HoverPreviewRoot Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.DoorToolTemplate.DoorArea + /// + public class DoorArea : UiNode + { + public DoorArea(MapEditorToolsPanel uiPanel, Godot.ColorRect node) : base(uiPanel, node) { } + public override DoorArea Clone() => new (UiPanel, (Godot.ColorRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.DoorToolTemplate.StartBtn + /// + public class StartBtn : UiNode + { + public StartBtn(MapEditorToolsPanel uiPanel, UI.MapEditorTools.DoorDragButton node) : base(uiPanel, node) { } + public override StartBtn Clone() => new (UiPanel, (UI.MapEditorTools.DoorDragButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.DoorToolTemplate.EndBtn + /// + public class EndBtn : UiNode + { + public EndBtn(MapEditorToolsPanel uiPanel, UI.MapEditorTools.DoorDragButton node) : base(uiPanel, node) { } + public override EndBtn Clone() => new (UiPanel, (UI.MapEditorTools.DoorDragButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.DoorToolTemplate + /// + public class DoorToolTemplate : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.DoorArea + /// + public DoorArea L_DoorArea + { + get + { + if (_L_DoorArea == null) _L_DoorArea = new DoorArea(UiPanel, Instance.GetNodeOrNull("DoorArea")); + return _L_DoorArea; + } + } + private DoorArea _L_DoorArea; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.StartBtn + /// + public StartBtn L_StartBtn + { + get + { + if (_L_StartBtn == null) _L_StartBtn = new StartBtn(UiPanel, Instance.GetNodeOrNull("StartBtn")); + return _L_StartBtn; + } + } + private StartBtn _L_StartBtn; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolRoot.EndBtn + /// + public EndBtn L_EndBtn + { + get + { + if (_L_EndBtn == null) _L_EndBtn = new EndBtn(UiPanel, Instance.GetNodeOrNull("EndBtn")); + return _L_EndBtn; + } + } + private EndBtn _L_EndBtn; + + public DoorToolTemplate(MapEditorToolsPanel uiPanel, UI.MapEditorTools.DoorDragArea node) : base(uiPanel, node) { } + public override DoorToolTemplate Clone() => new (UiPanel, (UI.MapEditorTools.DoorDragArea)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot.MarkTemplate + /// + public class MarkTemplate : UiNode + { + public MarkTemplate(MapEditorToolsPanel uiPanel, UI.MapEditorTools.MarkTool node) : base(uiPanel, node) { } + public override MarkTemplate Clone() => new (UiPanel, (UI.MapEditorTools.MarkTool)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.ToolRoot + /// + public class ToolRoot : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.N_HoverRoot + /// + public N_HoverRoot L_N_HoverRoot + { + get + { + if (_L_N_HoverRoot == null) _L_N_HoverRoot = new N_HoverRoot(UiPanel, Instance.GetNodeOrNull("N_HoverRoot")); + return _L_N_HoverRoot; + } + } + private N_HoverRoot _L_N_HoverRoot; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.E_HoverRoot + /// + public E_HoverRoot L_E_HoverRoot + { + get + { + if (_L_E_HoverRoot == null) _L_E_HoverRoot = new E_HoverRoot(UiPanel, Instance.GetNodeOrNull("E_HoverRoot")); + return _L_E_HoverRoot; + } + } + private E_HoverRoot _L_E_HoverRoot; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.S_HoverRoot + /// + public S_HoverRoot L_S_HoverRoot + { + get + { + if (_L_S_HoverRoot == null) _L_S_HoverRoot = new S_HoverRoot(UiPanel, Instance.GetNodeOrNull("S_HoverRoot")); + return _L_S_HoverRoot; + } + } + private S_HoverRoot _L_S_HoverRoot; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.W_HoverRoot + /// + public W_HoverRoot L_W_HoverRoot + { + get + { + if (_L_W_HoverRoot == null) _L_W_HoverRoot = new W_HoverRoot(UiPanel, Instance.GetNodeOrNull("W_HoverRoot")); + return _L_W_HoverRoot; + } + } + private W_HoverRoot _L_W_HoverRoot; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.HoverPreviewRoot + /// + public HoverPreviewRoot L_HoverPreviewRoot + { + get + { + if (_L_HoverPreviewRoot == null) _L_HoverPreviewRoot = new HoverPreviewRoot(UiPanel, Instance.GetNodeOrNull("HoverPreviewRoot")); + return _L_HoverPreviewRoot; + } + } + private HoverPreviewRoot _L_HoverPreviewRoot; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.DoorToolTemplate + /// + public DoorToolTemplate L_DoorToolTemplate + { + get + { + if (_L_DoorToolTemplate == null) _L_DoorToolTemplate = new DoorToolTemplate(UiPanel, Instance.GetNodeOrNull("DoorToolTemplate")); + return _L_DoorToolTemplate; + } + } + private DoorToolTemplate _L_DoorToolTemplate; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.MarkTemplate + /// + public MarkTemplate L_MarkTemplate + { + get + { + if (_L_MarkTemplate == null) _L_MarkTemplate = new MarkTemplate(UiPanel, Instance.GetNodeOrNull("MarkTemplate")); + return _L_MarkTemplate; + } + } + private MarkTemplate _L_MarkTemplate; + + public ToolRoot(MapEditorToolsPanel uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override ToolRoot Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.HBoxContainer.ToolButton.Select + /// + public class Select : UiNode + { + public Select(MapEditorToolsPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override Select Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.HBoxContainer.ToolButton + /// + public class ToolButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.HBoxContainer.Select + /// + public Select L_Select + { + get + { + if (_L_Select == null) _L_Select = new Select(UiPanel, Instance.GetNodeOrNull("Select")); + return _L_Select; + } + } + private Select _L_Select; + + public ToolButton(MapEditorToolsPanel uiPanel, Godot.TextureButton node) : base(uiPanel, node) { } + public override ToolButton Clone() => new (UiPanel, (Godot.TextureButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorTools.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.ToolButton + /// + public ToolButton L_ToolButton + { + get + { + if (_L_ToolButton == null) _L_ToolButton = new ToolButton(UiPanel, Instance.GetNodeOrNull("ToolButton")); + return _L_ToolButton; + } + } + private ToolButton _L_ToolButton; + + public HBoxContainer(MapEditorToolsPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.N_HoverRoot.N_HoverArea + /// + public N_HoverArea S_N_HoverArea => L_ToolRoot.L_N_HoverRoot.L_N_HoverArea; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.N_HoverRoot + /// + public N_HoverRoot S_N_HoverRoot => L_ToolRoot.L_N_HoverRoot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.E_HoverRoot.E_HoverArea + /// + public E_HoverArea S_E_HoverArea => L_ToolRoot.L_E_HoverRoot.L_E_HoverArea; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.E_HoverRoot + /// + public E_HoverRoot S_E_HoverRoot => L_ToolRoot.L_E_HoverRoot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.S_HoverRoot.S_HoverArea + /// + public S_HoverArea S_S_HoverArea => L_ToolRoot.L_S_HoverRoot.L_S_HoverArea; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.S_HoverRoot + /// + public S_HoverRoot S_S_HoverRoot => L_ToolRoot.L_S_HoverRoot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.W_HoverRoot.W_HoverArea + /// + public W_HoverArea S_W_HoverArea => L_ToolRoot.L_W_HoverRoot.L_W_HoverArea; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.W_HoverRoot + /// + public W_HoverRoot S_W_HoverRoot => L_ToolRoot.L_W_HoverRoot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.HoverPreviewRoot.HoverPreview + /// + public HoverPreview S_HoverPreview => L_ToolRoot.L_HoverPreviewRoot.L_HoverPreview; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.HoverPreviewRoot + /// + public HoverPreviewRoot S_HoverPreviewRoot => L_ToolRoot.L_HoverPreviewRoot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.DoorToolTemplate.DoorArea + /// + public DoorArea S_DoorArea => L_ToolRoot.L_DoorToolTemplate.L_DoorArea; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.DoorToolTemplate.StartBtn + /// + public StartBtn S_StartBtn => L_ToolRoot.L_DoorToolTemplate.L_StartBtn; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.DoorToolTemplate.EndBtn + /// + public EndBtn S_EndBtn => L_ToolRoot.L_DoorToolTemplate.L_EndBtn; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.DoorToolTemplate + /// + public DoorToolTemplate S_DoorToolTemplate => L_ToolRoot.L_DoorToolTemplate; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.MarkTemplate + /// + public MarkTemplate S_MarkTemplate => L_ToolRoot.L_MarkTemplate; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot + /// + public ToolRoot S_ToolRoot => L_ToolRoot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.HBoxContainer.ToolButton.Select + /// + public Select S_Select => L_HBoxContainer.L_ToolButton.L_Select; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.HBoxContainer.ToolButton + /// + public ToolButton S_ToolButton => L_HBoxContainer.L_ToolButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_HBoxContainer; + +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..0e97028d3206045f27e0540793fec43f66e2afea --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorToolsPanel.cs @@ -0,0 +1,527 @@ +using System; +using System.Collections.Generic; +using Godot; +using UI.MapEditor; + +namespace UI.MapEditorTools; + +public partial class MapEditorToolsPanel : MapEditorTools +{ + public class ToolBtnData + { + //是否可以选中 + public bool CanSelect = false; + //工具图标 + public string Icon; + //点击时回调 + public Action OnClick; + + public ToolBtnData(bool canSelect, string icon, Action onClick) + { + CanSelect = canSelect; + Icon = icon; + OnClick = onClick; + } + } + + /// + /// 鼠标悬停区域 + /// + public DoorHoverArea ActiveHoverArea { get; private set; } + + /// + /// 鼠标选中的标记对象 + /// + public MarkTool ActiveMark { get; private set; } + + /// + /// 所属编辑器Tile对象 + /// + public MapEditor.MapEditor.TileMap EditorMap { get; private set; } + + /// + /// 是否打开弹窗 + /// + public bool IsOpenPopUps { get; private set; } + + private List _doorTools = new List(); + private UiGrid _toolGrid; + //当前预设的所有标记 + private Dictionary _currMarkToolsMap = new Dictionary(); + private EventFactory _eventFactory; + private int _editToolIndex; + + public override void OnCreateUi() + { + EditorMap = ((MapEditorPanel)ParentUi).S_TileMap; + + S_N_HoverArea.Instance.Init(this, DoorDirection.N); + S_S_HoverArea.Instance.Init(this, DoorDirection.S); + S_W_HoverArea.Instance.Init(this, DoorDirection.W); + S_E_HoverArea.Instance.Init(this, DoorDirection.E); + S_ToolRoot.Instance.RemoveChild(S_DoorToolTemplate.Instance); + S_MarkTemplate.Instance.Visible = false; + + _toolGrid = new UiGrid(S_ToolButton, typeof(ToolButtonCell)); + _toolGrid.SetColumns(10); + //拖拽按钮 + _toolGrid.Add(new ToolBtnData(true, ResourcePath.resource_sprite_ui_commonIcon_DragTool_png, () => + { + EventManager.EmitEvent(EventEnum.OnSelectDragTool); + })); + //画笔按钮 + _toolGrid.Add(new ToolBtnData(true, ResourcePath.resource_sprite_ui_commonIcon_PenTool_png, () => + { + EventManager.EmitEvent(EventEnum.OnSelectPenTool); + })); + //绘制区域按钮 + _toolGrid.Add(new ToolBtnData(true, ResourcePath.resource_sprite_ui_commonIcon_AreaTool_png, () => + { + EventManager.EmitEvent(EventEnum.OnSelectRectTool); + })); + //编辑攻击按钮 + _toolGrid.Add(new ToolBtnData(true, ResourcePath.resource_sprite_ui_commonIcon_DoorTool_png, () => + { + EventManager.EmitEvent(EventEnum.OnSelectEditTool); + })); + _editToolIndex = _toolGrid.Count - 1; + //聚焦按钮 + _toolGrid.Add(new ToolBtnData(false, ResourcePath.resource_sprite_ui_commonIcon_CenterTool_png, () => + { + EventManager.EmitEvent(EventEnum.OnClickCenterTool); + })); + _toolGrid.SelectIndex = 1; + + _eventFactory = EventManager.CreateEventFactory(); + _eventFactory.AddEventListener(EventEnum.OnSelectWave, OnSelectWaveTool); + _eventFactory.AddEventListener(EventEnum.OnCreateMark, OnCreateMarkTool); + _eventFactory.AddEventListener(EventEnum.OnSelectMark, OnSelectMarkTool); + _eventFactory.AddEventListener(EventEnum.OnDeleteMark, OnDeleteMarkTool); + _eventFactory.AddEventListener(EventEnum.OnEditMark, OnEditMarkTool); + _eventFactory.AddEventListener(EventEnum.OnSelectPreinstall, RefreshMark); + } + + public override void OnDestroyUi() + { + _eventFactory.RemoveAllEventListener(); + _eventFactory = null; + S_DoorToolTemplate.Instance.QueueFree(); + _toolGrid.Destroy(); + } + + public override void Process(float delta) + { + S_HoverPreviewRoot.Instance.Visible = ActiveHoverArea != null && !DoorHoverArea.IsDrag; + if (EditorMap.Instance.MouseType == EditorTileMap.MouseButtonType.Edit) + { + S_ToolRoot.Instance.Modulate = new Color(1, 1, 1, 1); + } + else + { + S_ToolRoot.Instance.Modulate = new Color(1, 1, 1, 0.4f); + } + + IsOpenPopUps = UiManager.GetUiInstanceCount(UiManager.UiName.EditorWindow) > 0; + } + + //刷新标记 + private void RefreshMark(object arg) + { + ActiveMark = null; + //删除之前的数据 + foreach (var keyValuePair in _currMarkToolsMap) + { + keyValuePair.Value.QueueFree(); + } + _currMarkToolsMap.Clear(); + //添加新的数据 + var selectPreinstall = EditorManager.SelectPreinstall; + if (selectPreinstall != null) + { + foreach (var markInfos in selectPreinstall.WaveList) + { + foreach (var markInfo in markInfos) + { + CreateMarkTool(markInfo); + } + } + } + } + + //选中波数 + private void OnSelectWaveTool(object arg) + { + //选中编辑工具 + if (_toolGrid.SelectIndex != _editToolIndex) + { + _toolGrid.Click(_editToolIndex); + } + + var selectIndex = EditorManager.SelectWaveIndex; + var waveList = EditorManager.SelectPreinstall.WaveList; + for (var i = 0; i < waveList.Count; i++) + { + var wave = waveList[i]; + foreach (var markInfo in wave) + { + if (_currMarkToolsMap.TryGetValue(markInfo, out var markTemplate)) + { + if (i == selectIndex) //选中当前波数, 透明度改为1 + { + markTemplate.Instance.SetModulateAlpha(1f); + } + else //未选中当前波数, 透明度改为0.6 + { + markTemplate.Instance.SetModulateAlpha(0.45f); + } + } + } + } + } + + //创建标记 + private void OnCreateMarkTool(object arg) + { + var markInfo = (MarkInfo)arg; + CreateMarkTool(markInfo); + } + + //创建标记 + private void CreateMarkTool(MarkInfo markInfo) + { + var cloneAndPut = S_MarkTemplate.CloneAndPut(); + _currMarkToolsMap.Add(markInfo, cloneAndPut); + cloneAndPut.Instance.Visible = true; + cloneAndPut.Instance.InitData(markInfo); + } + + //选中标记 + private void OnSelectMarkTool(object arg) + { + //选中编辑工具 + if (_toolGrid.SelectIndex != _editToolIndex) + { + _toolGrid.Click(_editToolIndex); + } + + if (arg is MarkInfo markInfo) + { + if (ActiveMark == null || markInfo != ActiveMark.MarkInfo) + { + if (_currMarkToolsMap.TryGetValue(markInfo, out var markTemplate)) + { + SetActiveMark(markTemplate.Instance); + } + } + } + else if (arg == null && ActiveMark != null) + { + SetActiveMark(null); + } + } + + //删除标记 + private void OnDeleteMarkTool(object arg) + { + if (arg is MarkInfo markInfo) + { + if (_currMarkToolsMap.TryGetValue(markInfo, out var markTemplate)) + { + if (ActiveMark == markTemplate.Instance) + { + SetActiveMark(null); + } + markTemplate.QueueFree(); + _currMarkToolsMap.Remove(markInfo); + } + } + } + + //编辑标记 + private void OnEditMarkTool(object arg) + { + if (arg is MarkInfo markInfo) + { + if (_currMarkToolsMap.TryGetValue(markInfo, out var markTemplate)) + { + //更新坐标 + markTemplate.Instance.Position = markInfo.Position.AsVector2(); + } + } + } + + /// + /// 获取门区域对象 + /// + public DoorHoverArea GetDoorHoverArea(DoorDirection direction) + { + switch (direction) + { + case DoorDirection.E: return S_E_HoverArea.Instance; + case DoorDirection.N: return S_N_HoverArea.Instance; + case DoorDirection.W: return S_W_HoverArea.Instance; + case DoorDirection.S: return S_S_HoverArea.Instance; + } + return null; + } + + /// + /// 获取门区域根节点 + /// + public Control GetDoorHoverAreaRoot(DoorDirection direction) + { + switch (direction) + { + case DoorDirection.E: return S_E_HoverRoot.Instance; + case DoorDirection.N: return S_N_HoverRoot.Instance; + case DoorDirection.W: return S_W_HoverRoot.Instance; + case DoorDirection.S: return S_S_HoverRoot.Instance; + } + return null; + } + + /// + /// 设置活动的鼠标悬停的区域 + /// + public void SetActiveHoverArea(DoorHoverArea hoverArea) + { + ActiveHoverArea = hoverArea; + if (hoverArea != null) + { + S_HoverPreviewRoot.Instance.Reparent(hoverArea.GetParent(), false); + } + else + { + S_HoverPreviewRoot.Instance.Reparent(S_ToolRoot.Instance, false); + } + } + + /// + /// 设置当前活动的标记 + /// + public void SetActiveMark(MarkTool markTool) + { + if (ActiveMark == markTool) + { + return; + } + + if (ActiveMark != null) //取消选中上一个 + { + ActiveMark.OnUnSelect(); + } + ActiveMark = markTool; + if (markTool != null) //选中当前 + { + ActiveMark.OnSelect(); + EditorManager.SetSelectMark(markTool.MarkInfo); + } + else + { + EditorManager.SetSelectMark(null); + } + } + + /// + /// 创建门区域设置工具 + /// + /// 门区域数据 + public DoorToolTemplate CreateDoorTool(DoorAreaInfo doorAreaInfo) + { + var doorHoverArea = GetDoorHoverArea(doorAreaInfo.Direction); + var inst = CreateDoorToolInstance(doorHoverArea); + inst.Instance.DoorAreaInfo = doorAreaInfo; + inst.Instance.SetDoorAreaPosition(GetDoorHoverAreaRoot(doorAreaInfo.Direction).Position); + inst.Instance.SetDoorAreaRange(doorAreaInfo.Start, doorAreaInfo.End); + return inst; + } + + /// + /// 创建拖拽状态下的门区域工具, 用于创建门区域 + /// + /// 悬停区域 + /// 起始位置, 单位: 像素 + /// 成功提交时回调, 参数1为方向, 参数2为起始点, 参数3为大小 + /// 取消提交时调用 + public DoorToolTemplate CreateDragDoorTool(DoorHoverArea doorHoverArea, int start, + Action onSubmit, Action onCancel) + { + var inst = CreateDoorToolInstance(doorHoverArea); + inst.Instance.SetDoorAreaPosition(GetDoorHoverAreaRoot(doorHoverArea.Direction).Position); + inst.Instance.SetDoorAreaRange(start, start); + inst.Instance.MakeDragMode(onSubmit, () => + { + RemoveDoorTool(inst); + onCancel(); + }); + return inst; + } + + /// + /// 移除门区域设置工具 + /// + public void RemoveDoorTool(DoorToolTemplate toolInstance) + { + _doorTools.Remove(toolInstance); + if (toolInstance.Instance.DoorAreaInfo != null) + { + EditorMap.Instance.RemoveDoorArea(toolInstance.Instance.DoorAreaInfo); + } + toolInstance.Instance.QueueFree(); + //派发修改数据修改事件 + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + + /// + /// 设置工具根节点的大小和缩放 + /// + /// 坐标 + /// 缩放 + public void SetToolTransform(Vector2 pos, Vector2 scale) + { + S_ToolRoot.Instance.Position = pos; + S_ToolRoot.Instance.Scale = scale; + } + + /// + /// 设置鼠标悬停区域位置和大小 + /// + /// 房间起始点, 单位: 格 + /// 房间大小, 单位: 格 + public void SetDoorHoverToolTransform(Vector2I position, Vector2I size) + { + position *= GameConfig.TileCellSize; + size *= GameConfig.TileCellSize; + + var nPos1 = S_N_HoverRoot.Instance.Position; + var ePos1 = S_E_HoverRoot.Instance.Position; + var sPos1 = S_S_HoverRoot.Instance.Position; + var wPos1 = S_W_HoverRoot.Instance.Position; + var nPos2 = position + GameConfig.TileCellSizeVector2I; + var ePos2 = new Vector2(position.X + size.X - GameConfig.TileCellSize, position.Y + GameConfig.TileCellSize); + var sPos2 = new Vector2(position.X + GameConfig.TileCellSize, position.Y + size.Y - GameConfig.TileCellSize); + var wPos2 = position + GameConfig.TileCellSizeVector2I; + + var nSize2 = new Vector2(size.X - GameConfig.TileCellSize * 2, S_N_HoverArea.Instance.Size.Y); + var eSize2 = new Vector2(size.Y - GameConfig.TileCellSize * 2, S_E_HoverArea.Instance.Size.Y); + var sSize2 = new Vector2(size.X - GameConfig.TileCellSize * 2, S_S_HoverArea.Instance.Size.Y); + var wSize2 = new Vector2(size.Y - GameConfig.TileCellSize * 2, S_W_HoverArea.Instance.Size.Y); + + S_N_HoverRoot.Instance.Position = nPos2; + S_E_HoverRoot.Instance.Position = ePos2; + S_S_HoverRoot.Instance.Position = sPos2; + S_W_HoverRoot.Instance.Position = wPos2; + + S_N_HoverArea.Instance.Size = nSize2; + S_E_HoverArea.Instance.Size = eSize2; + S_S_HoverArea.Instance.Size = sSize2; + S_W_HoverArea.Instance.Size = wSize2; + + //调整门区域 + for (var i = 0; i < _doorTools.Count; i++) + { + var doorTool = _doorTools[i]; + var direction = doorTool.Instance.Direction; + var areaRoot = GetDoorHoverAreaRoot(direction); + var doorAreaRange = doorTool.Instance.GetDoorAreaRange(); + doorTool.Instance.SetDoorAreaPosition(areaRoot.Position); + + if (direction == DoorDirection.N) + { + var hOffset = (int)(nPos2.X - nPos1.X); + doorAreaRange.X -= hOffset; + doorAreaRange.Y -= hOffset; + + if (doorAreaRange.X >= 0 && doorAreaRange.Y <= nSize2.X) //允许提交 + { + doorTool.Instance.SetDoorAreaRange(doorAreaRange.X, doorAreaRange.Y); + if (doorTool.Instance.DoorAreaInfo != null) + { + doorTool.Instance.DoorAreaInfo.Start = doorAreaRange.X; + doorTool.Instance.DoorAreaInfo.End = doorAreaRange.Y; + } + } + else //如果超出区域, 则删除 + { + RemoveDoorTool(doorTool); + i--; + } + } + else if (direction == DoorDirection.S) + { + var hOffset = (int)(sPos2.X - sPos1.X); + doorAreaRange.X -= hOffset; + doorAreaRange.Y -= hOffset; + + if (doorAreaRange.X >= 0 && doorAreaRange.Y <= sSize2.X) //允许提交 + { + doorTool.Instance.SetDoorAreaRange(doorAreaRange.X, doorAreaRange.Y); + if (doorTool.Instance.DoorAreaInfo != null) + { + doorTool.Instance.DoorAreaInfo.Start = doorAreaRange.X; + doorTool.Instance.DoorAreaInfo.End = doorAreaRange.Y; + } + } + else //如果超出区域, 则删除 + { + RemoveDoorTool(doorTool); + i--; + } + } + else if (direction == DoorDirection.E) + { + var vOffset = (int)(ePos2.Y - ePos1.Y); + doorAreaRange.X -= vOffset; + doorAreaRange.Y -= vOffset; + + if (doorAreaRange.X >= 0 && doorAreaRange.Y <= eSize2.X) //允许提交 + { + doorTool.Instance.SetDoorAreaRange(doorAreaRange.X, doorAreaRange.Y); + if (doorTool.Instance.DoorAreaInfo != null) + { + doorTool.Instance.DoorAreaInfo.Start = doorAreaRange.X; + doorTool.Instance.DoorAreaInfo.End = doorAreaRange.Y; + } + } + else //如果超出区域, 则删除 + { + RemoveDoorTool(doorTool); + i--; + } + } + else if (direction == DoorDirection.W) + { + var vOffset = (int)(wPos2.Y - wPos1.Y); + doorAreaRange.X -= vOffset; + doorAreaRange.Y -= vOffset; + + if (doorAreaRange.X >= 0 && doorAreaRange.Y <= wSize2.X) //允许提交 + { + doorTool.Instance.SetDoorAreaRange(doorAreaRange.X, doorAreaRange.Y); + if (doorTool.Instance.DoorAreaInfo != null) + { + doorTool.Instance.DoorAreaInfo.Start = doorAreaRange.X; + doorTool.Instance.DoorAreaInfo.End = doorAreaRange.Y; + } + } + else //如果超出区域, 则删除 + { + RemoveDoorTool(doorTool); + i--; + } + } + } + } + + private DoorToolTemplate CreateDoorToolInstance(DoorHoverArea doorHoverArea) + { + var doorTool = S_DoorToolTemplate.Clone(); + S_ToolRoot.Instance.AddChild(doorTool.Instance); + 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; + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkAreaTool.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkAreaTool.cs new file mode 100644 index 0000000000000000000000000000000000000000..1d6d223602654222d29e74168f2bf6aebe8d73a0 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkAreaTool.cs @@ -0,0 +1,280 @@ +using Godot; +using UI.MapEditor; +using Color = Godot.Color; + +namespace UI.MapEditorTools; + +public partial class MarkAreaTool : Node2D +{ + //鼠标悬停颜色 + private static Color _sideColor = new Color(1, 1, 1, 1); + private static Color _sideHoverColor = new Color(0.65f, 0.65f, 0.65f, 1); + private static Color _cornerColor = new Color(1, 1, 1, 1); + private static Color _cornerHoverColor = new Color(0.65f, 0.65f, 0.65f, 1); + + //鼠标悬停状态 + private bool _mouseInL = false; + private bool _mouseInR = false; + private bool _mouseInT = false; + private bool _mouseInB = false; + private bool _mouseInLT = false; + private bool _mouseInRT = false; + private bool _mouseInLB = false; + private bool _mouseInRB = false; + //是否绘制角 + private bool _showCornerBlock = false; + + private MarkInfo _markInfo; + private MarkTool _markTool; + private MapEditorTools.ToolRoot _toolRoot; + + /// + /// 是否正在拖拽中 + /// + public bool IsDrag { get; private set; } = false; + private Vector2 _startMousePosition; + private Vector2 _prevMousePosition; + private Vector2 _startPosition; + private float _startWidth; + private float _startHeight; + + public void InitData(MapEditorTools.ToolRoot toolRoot, MarkTool markTool) + { + _toolRoot = toolRoot; + _markTool = markTool; + _markInfo = markTool.MarkInfo; + _startWidth = _markInfo.Size.X; + _startHeight = _markInfo.Size.Y; + } + + public override void _Process(double delta) + { + if (!Visible || _markInfo == null || _toolRoot.UiPanel.IsOpenPopUps || + !_toolRoot.UiPanel.S_ToolRoot.Instance.Visible || DoorHoverArea.IsDrag) + { + return; + } + + + _showCornerBlock = _markInfo.Size.X >= 4 && _markInfo.Size.Y >= 4; + var globalMousePosition = GetGlobalMousePosition(); + if (IsDrag) //按下拖拽按钮 + { + 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 //拖拽中 + { + var pos = globalMousePosition; + if (pos != _prevMousePosition) + { + + if (_mouseInL) + { + var offset = globalMousePosition - _startMousePosition; + offset = offset / _toolRoot.Instance.Scale * 2f; + var newWidth = Mathf.Max(0, (int)(_startWidth - offset.X)); + _markInfo.Size = new SerializeVector2(newWidth, _markInfo.Size.Y); + } + else if (_mouseInR) + { + var offset = _startMousePosition - globalMousePosition; + offset = offset / _toolRoot.Instance.Scale * 2f; + var newWidth = Mathf.Max(0, (int)(_startWidth - offset.X)); + _markInfo.Size = new SerializeVector2(newWidth, _markInfo.Size.Y); + } + else if (_mouseInT) + { + var offset = globalMousePosition - _startMousePosition; + offset = offset / _toolRoot.Instance.Scale * 2f; + var newHeight = Mathf.Max(0, (int)(_startHeight - offset.Y)); + _markInfo.Size = new SerializeVector2(_markInfo.Size.X, newHeight); + } + else if (_mouseInB) + { + var offset = _startMousePosition - globalMousePosition; + offset = offset / _toolRoot.Instance.Scale * 2f; + var newHeight = Mathf.Max(0, (int)(_startHeight - offset.Y)); + _markInfo.Size = new SerializeVector2(_markInfo.Size.X, newHeight); + } + //---------------------------------------------------------------------------------- + else if (_mouseInLT) + { + var offset = globalMousePosition - _startMousePosition; + offset = offset / _toolRoot.Instance.Scale * 2f; + var newWidth = Mathf.Max(0, (int)(_startWidth - offset.X)); + var newHeight = Mathf.Max(0, (int)(_startHeight - offset.Y)); + _markInfo.Size = new SerializeVector2(newWidth, newHeight); + } + else if (_mouseInLB) + { + var offsetX = (globalMousePosition.X - _startMousePosition.X) / _toolRoot.Instance.Scale.X * 2f; + var offsetY = (_startMousePosition.Y - globalMousePosition.Y) / _toolRoot.Instance.Scale.Y * 2f; + var newWidth = Mathf.Max(0, (int)(_startWidth - offsetX)); + var newHeight = Mathf.Max(0, (int)(_startHeight - offsetY)); + _markInfo.Size = new SerializeVector2(newWidth, newHeight); + } + else if (_mouseInRT) + { + var offsetX = (_startMousePosition.X - globalMousePosition.X) / _toolRoot.Instance.Scale.X * 2f; + var offsetY = (globalMousePosition.Y - _startMousePosition.Y) / _toolRoot.Instance.Scale.Y * 2f; + var newWidth = Mathf.Max(0, (int)(_startWidth - offsetX)); + var newHeight = Mathf.Max(0, (int)(_startHeight - offsetY)); + _markInfo.Size = new SerializeVector2(newWidth, newHeight); + } + else if (_mouseInRB) + { + var offset = _startMousePosition - globalMousePosition; + offset = offset / _toolRoot.Instance.Scale * 2f; + var newWidth = Mathf.Max(0, (int)(_startWidth - offset.X)); + var newHeight = Mathf.Max(0, (int)(_startHeight - offset.Y)); + _markInfo.Size = new SerializeVector2(newWidth, newHeight); + } + _prevMousePosition = pos; + } + } + } + else //未被拖拽 + { + _mouseInL = false; + _mouseInR = false; + _mouseInT = false; + _mouseInB = false; + _mouseInLT = false; + _mouseInRT = false; + _mouseInLB = false; + _mouseInRB = false; + + var flag = false; + //必须要选中 + if (_toolRoot.UiPanel.EditorMap.Instance.MouseType == EditorTileMap.MouseButtonType.Edit) + { + var mousePosition = GetLocalMousePosition(); + //判断鼠标是否在点上 + if (_showCornerBlock && Utils.IsPositionInRect(mousePosition, GetLeftTopRect())) + { + _mouseInLT = true; + flag = true; + } + else if (_showCornerBlock && Utils.IsPositionInRect(mousePosition, GetRightTopRect())) + { + _mouseInRT = true; + flag = true; + } + else if (_showCornerBlock && Utils.IsPositionInRect(mousePosition, GetLeftBottomRect())) + { + _mouseInLB = true; + flag = true; + } + else if (_showCornerBlock && Utils.IsPositionInRect(mousePosition, GetRightBottomRect())) + { + _mouseInRB = true; + flag = true; + } + else if (Utils.IsPositionInRect(mousePosition, GetLeftRect())) + { + _mouseInL = true; + flag = true; + } + else if (Utils.IsPositionInRect(mousePosition, GetRightRect())) + { + _mouseInR = true; + flag = true; + } + else if (Utils.IsPositionInRect(mousePosition, GetTopRect())) + { + _mouseInT = true; + flag = true; + } + else if (Utils.IsPositionInRect(mousePosition, GetBottomRect())) + { + _mouseInB = true; + flag = true; + } + } + + if (flag) + { + if (Input.IsMouseButtonPressed(MouseButton.Left)) + { + IsDrag = true; + _startMousePosition = globalMousePosition; + _prevMousePosition = _startMousePosition; + _startPosition = _markTool.Position; + _startWidth = _markInfo.Size.X; + _startHeight = _markInfo.Size.Y; + } + } + } + + if (Visible) + { + QueueRedraw(); + } + } + + public override void _Draw() + { + //绘制边框 + DrawRect(GetTopRect(), _mouseInT ? _sideHoverColor : _sideColor); + DrawRect(GetBottomRect(), _mouseInB ? _sideHoverColor : _sideColor); + DrawRect(GetLeftRect(), _mouseInL ? _sideHoverColor : _sideColor); + DrawRect(GetRightRect(), _mouseInR ? _sideHoverColor : _sideColor); + if (_showCornerBlock) + { + //绘制角 + DrawRect(GetLeftTopRect(), _mouseInLT ? _cornerHoverColor : _cornerColor); + DrawRect(GetLeftBottomRect(), _mouseInLB ? _cornerHoverColor : _cornerColor); + DrawRect(GetRightTopRect(), _mouseInRT ? _cornerHoverColor : _cornerColor); + DrawRect(GetRightBottomRect(), _mouseInRB ? _cornerHoverColor : _cornerColor); + } + } + + private Rect2 GetTopRect() + { + return new Rect2(-(_markInfo.Size.X + 2) / 2f + 0.5f, -(_markInfo.Size.Y + 2) / 2f - 0.5f, (_markInfo.Size.X + 2) - 1, 1); + } + + private Rect2 GetBottomRect() + { + return new Rect2(-(_markInfo.Size.X + 2) / 2f + 0.5f, (_markInfo.Size.Y + 2) / 2f - 0.5f, (_markInfo.Size.X + 2) - 1, 1); + } + + private Rect2 GetLeftRect() + { + return new Rect2(-(_markInfo.Size.X + 2) / 2f - 0.5f, -(_markInfo.Size.Y + 2) / 2f + 0.5f, 1, (_markInfo.Size.Y + 2) - 1); + } + + private Rect2 GetRightRect() + { + return new Rect2((_markInfo.Size.X + 2) / 2f - 0.5f, -(_markInfo.Size.Y + 2) / 2f + 0.5f, 1, (_markInfo.Size.Y + 2) - 1); + } + + private Rect2 GetLeftTopRect() + { + return new Rect2(-(_markInfo.Size.X + 2) / 2f - 1.5f, -(_markInfo.Size.Y + 2) / 2f - 1.5f, 3, 3); + } + + private Rect2 GetLeftBottomRect() + { + return new Rect2(-(_markInfo.Size.X + 2) / 2f - 1.5f, (_markInfo.Size.Y + 2) / 2f - 1.5f, 3, 3); + } + + private Rect2 GetRightTopRect() + { + return new Rect2((_markInfo.Size.X + 2) / 2f - 1.5f, -(_markInfo.Size.Y + 2) / 2f - 1.5f, 3, 3); + } + + private Rect2 GetRightBottomRect() + { + return new Rect2((_markInfo.Size.X + 2) / 2f - 1.5f, (_markInfo.Size.Y + 2) / 2f - 1.5f, 3, 3); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkTool.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkTool.cs new file mode 100644 index 0000000000000000000000000000000000000000..b95df0a6f7074dd7c52e7eaf47f9a73c76a36aec --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MarkTool.cs @@ -0,0 +1,168 @@ +using Godot; +using UI.MapEditor; + +namespace UI.MapEditorTools; + +/// +/// 标记工具 +/// +public partial class MarkTool : TextureRect, IUiNodeScript +{ + /// + /// 绑定的数据 + /// + public MarkInfo MarkInfo { get; private set; } + + /// + /// 是否拖拽中 + /// + public bool IsDrag { get; private set; } + + /// + /// 标记区域 + /// + public MarkAreaTool MarkAreaTool { get; private set; } + + private bool _enter; + private MapEditorTools.MarkTemplate _toolNode; + private bool _isDown; + private Vector2 _offset; + private Vector2 _startPos; + + public void SetUiNode(IUiNode uiNode) + { + _toolNode = (MapEditorTools.MarkTemplate)uiNode; + _toolNode.Instance.MouseEntered += OnMouseEntered; + _toolNode.Instance.MouseExited += OnMouseExited; + + MarkAreaTool = new MarkAreaTool(); + MarkAreaTool.Position = Size / 2; + MarkAreaTool.Visible = false; + AddChild(MarkAreaTool); + } + + public void OnDestroy() + { + } + + public override void _Process(double delta) + { + if (_toolNode != null && MarkInfo != null && _toolNode.UiPanel.S_ToolRoot.Instance.Visible && !DoorHoverArea.IsDrag) + { + if (_isDown) + { + //松开鼠标或者在拖拽区域 + if (!Input.IsMouseButtonPressed(MouseButton.Left) || MarkAreaTool.IsDrag) + { + _isDown = false; + IsDrag = false; + //移动过, 就派发修改事件 + var pos = GlobalPosition; + if (_startPos != pos) + { + _startPos = pos; + EventManager.EmitEvent(EventEnum.OnEditorDirty); + } + } + } + else if (_enter && !_isDown) + { + //判断是否可以选中 + var activeMark = _toolNode.UiPanel.ActiveMark; + if ((activeMark == null || (!activeMark.IsDrag && !activeMark.MarkAreaTool.IsDrag)) && + !MarkAreaTool.IsDrag && Input.IsMouseButtonPressed(MouseButton.Left) && + _toolNode.UiPanel.EditorMap.Instance.MouseType == EditorTileMap.MouseButtonType.Edit) + { + _isDown = true; + if (_toolNode.UiPanel.ActiveMark != this) + { + IsDrag = false; + _toolNode.UiPanel.SetActiveMark(this); + } + else + { + _offset = GlobalPosition - GetGlobalMousePosition(); + IsDrag = true; + _startPos = GlobalPosition; + } + } + } + + //拖拽中 + if (IsDrag && _toolNode.UiPanel.ActiveMark == this) + { + GlobalPosition = _offset + GetGlobalMousePosition().Round(); + MarkInfo.Position = new SerializeVector2((Position + (Size / 2).Ceil()).Round()); + } + + //只有选中物体才会显示拖拽区域 + if (_toolNode.UiPanel.ActiveMark == this) + { + MarkAreaTool.Visible = true; + } + else + { + MarkAreaTool.Visible = false; + } + QueueRedraw(); + } + } + + /// + /// 初始化数据 + /// + public void InitData(MarkInfo markInfo) + { + MarkInfo = markInfo; + Position = markInfo.Position.AsVector2() - (Size / 2).Ceil(); + _startPos = GlobalPosition; + MarkAreaTool.InitData(_toolNode.UiPanel.S_ToolRoot, this); + } + + private void OnMouseEntered() + { + _enter = true; + } + + private void OnMouseExited() + { + _enter = false; + } + + public override void _Draw() + { + if (MarkInfo != null && !MarkAreaTool.Visible) + { + var size = new Vector2(MarkInfo.Size.X + 2, MarkInfo.Size.Y + 2); + DrawRect(new Rect2(-size / 2 + Size / 2, size.X, size.Y), new Color(1, 1, 1, 0.7f), false, 1); + } + } + + /// + /// 选中标记 + /// + public void OnSelect() + { + var a = Modulate.A; + Modulate = new Color(0, 1, 0, a); + } + + /// + /// 取消选中标记 + /// + public void OnUnSelect() + { + var a = Modulate.A; + Modulate = new Color(1, 1, 1, a); + } + + /// + /// 设置透明度值 + /// + public void SetModulateAlpha(float a) + { + var m = Modulate; + m.A = a; + Modulate = m; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/ToolButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/ToolButtonCell.cs new file mode 100644 index 0000000000000000000000000000000000000000..6d84a6fc01f345ddd420d4d4e07457a824a05a6b --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/ToolButtonCell.cs @@ -0,0 +1,35 @@ +namespace UI.MapEditorTools; + +public class ToolButtonCell : UiCell +{ + public override void OnInit() + { + CellNode.L_Select.Instance.Visible = false; + } + + public override void OnSetData(MapEditorToolsPanel.ToolBtnData data) + { + CellNode.Instance.TextureNormal = ResourceManager.LoadTexture2D(data.Icon); + } + + public override bool CanSelect() + { + return Data.CanSelect; + } + + public override void OnSelect() + { + CellNode.L_Select.Instance.Visible = true; + } + + public override void OnUnSelect() + { + CellNode.L_Select.Instance.Visible = false; + } + + public override void OnClick() + { + Data.OnClick(); + } + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs index c03715042fd75e08c589abe3b61fe4a3e4d54efa..e56f99c9a5f0d125f3cefdda0270e7b46a8a0742 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/ActivePropBar.cs @@ -4,7 +4,7 @@ namespace UI.RoomUI; public class ActivePropBar { - private RoomUI.UiNode_ActivePropBar _activePropBar; + private RoomUI.RoomUI_ActivePropBar _activePropBar; private ShaderMaterial _shaderMaterial; private Vector2 _startCooldownPos; private Vector2 _startCooldownSize; @@ -13,7 +13,7 @@ public class ActivePropBar private bool _initCooldown = false; - public ActivePropBar(RoomUI.UiNode_ActivePropBar activePropBar) + public ActivePropBar(RoomUI.RoomUI_ActivePropBar activePropBar) { _activePropBar = activePropBar; _shaderMaterial = (ShaderMaterial)_activePropBar.L_ActivePropSprite.Instance.Material; diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs index 0779db95388a97451cce13b6b3e6fe73dc9eadfc..85eb7da13d83474b3721781fec7403dfbf65b841 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/InteractiveTipBar.cs @@ -7,11 +7,11 @@ namespace UI.RoomUI; /// public class InteractiveTipBar { - private RoomUI.UiNode_InteractiveTipBar _interactiveTipBar; + private RoomUI.RoomUI_InteractiveTipBar _interactiveTipBar; private EventBinder _binder; private ActivityObject _interactiveTarget; - public InteractiveTipBar(RoomUI.UiNode_InteractiveTipBar interactiveTipBar) + public InteractiveTipBar(RoomUI.RoomUI_InteractiveTipBar interactiveTipBar) { interactiveTipBar.Instance.Visible = false; _interactiveTipBar = interactiveTipBar; diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/LifeBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/LifeBar.cs index 69b51907ceaa676663fd3163f175c00bd3d7c7a9..d56440f689987fedb391d9685648f76dc29041c9 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/LifeBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/LifeBar.cs @@ -6,17 +6,19 @@ namespace UI.RoomUI; public class LifeBar { - private RoomUI.UiNode_LifeBar _bar; - private UiGrid _grid; + private RoomUI.RoomUI_LifeBar _bar; + private UiGrid _grid; private EventFactory _eventFactory; private bool _refreshFlag = false; - public LifeBar(RoomUI.UiNode_LifeBar lifeBar) + public LifeBar(RoomUI.RoomUI_LifeBar lifeBar) { _bar = lifeBar; var uiNodeLife = lifeBar.L_Life; - _grid = new UiGrid(uiNodeLife, typeof(LifeCell), 20, 1, 2); + _grid = new UiGrid(uiNodeLife, typeof(LifeCell)); + _grid.SetColumns(20); + _grid.SetCellOffset(new Vector2I(1, 2)); } public void OnShow() diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/LifeCell.cs b/DungeonShooting_Godot/src/game/ui/roomUI/LifeCell.cs index 821c5f893e1ca0b53d5428d54018f666071d4040..6076f4e0834876f132e0ab57c4331da79234a7ed 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/LifeCell.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/LifeCell.cs @@ -2,7 +2,7 @@ namespace UI.RoomUI; -public class LifeCell : UiCell +public class LifeCell : UiCell { private int _type = -1; diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs index 71f23276e8961ef9d7015a9d276d2ca02c8ca92b..bb0b00bc6fe6cfb4420ebbf39a2b2f0d48a85fcc 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/ReloadBar.cs @@ -7,11 +7,11 @@ namespace UI.RoomUI; /// public class ReloadBar { - private RoomUI.UiNode_ReloadBar _reloadBar; + private RoomUI.RoomUI_ReloadBar _reloadBar; private int width; private float startX = 1; - public ReloadBar(RoomUI.UiNode_ReloadBar reloadBar) + public ReloadBar(RoomUI.RoomUI_ReloadBar reloadBar) { reloadBar.Instance.Visible = false; _reloadBar = reloadBar; diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs index 9db9d95860db8f179a0381de8488598bb3d94374..60858460d9564e0f3d37a45b19e8154e0ba16291 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs @@ -8,41 +8,41 @@ public abstract partial class RoomUI : UiBase /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.InteractiveTipBar /// - public UiNode_InteractiveTipBar L_InteractiveTipBar + public RoomUI_InteractiveTipBar L_InteractiveTipBar { get { - if (_L_InteractiveTipBar == null) _L_InteractiveTipBar = new UiNode_InteractiveTipBar(GetNodeOrNull("InteractiveTipBar")); + if (_L_InteractiveTipBar == null) _L_InteractiveTipBar = new RoomUI_InteractiveTipBar(this, GetNodeOrNull("InteractiveTipBar")); return _L_InteractiveTipBar; } } - private UiNode_InteractiveTipBar _L_InteractiveTipBar; + private RoomUI_InteractiveTipBar _L_InteractiveTipBar; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.ReloadBar /// - public UiNode_ReloadBar L_ReloadBar + public RoomUI_ReloadBar L_ReloadBar { get { - if (_L_ReloadBar == null) _L_ReloadBar = new UiNode_ReloadBar(GetNodeOrNull("ReloadBar")); + if (_L_ReloadBar == null) _L_ReloadBar = new RoomUI_ReloadBar(this, GetNodeOrNull("ReloadBar")); return _L_ReloadBar; } } - private UiNode_ReloadBar _L_ReloadBar; + private RoomUI_ReloadBar _L_ReloadBar; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control /// - public UiNode_Control L_Control + public RoomUI_Control L_Control { get { - if (_L_Control == null) _L_Control = new UiNode_Control(GetNodeOrNull("Control")); + if (_L_Control == null) _L_Control = new RoomUI_Control(this, GetNodeOrNull("Control")); return _L_Control; } } - private UiNode_Control _L_Control; + private RoomUI_Control _L_Control; public RoomUI() : base(nameof(RoomUI)) @@ -52,490 +52,611 @@ public abstract partial class RoomUI : UiBase /// /// 类型: , 路径: RoomUI.InteractiveTipBar.Icon /// - public class UiNode_Icon : IUiNode + public class RoomUI_Icon : UiNode { - public UiNode_Icon(Godot.TextureRect node) : base(node) { } - public override UiNode_Icon Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public RoomUI_Icon(RoomUI uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override RoomUI_Icon Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.InteractiveTipBar.InteractiveIcon /// - public class UiNode_InteractiveIcon : IUiNode + public class RoomUI_InteractiveIcon : UiNode { - public UiNode_InteractiveIcon(Godot.TextureRect node) : base(node) { } - public override UiNode_InteractiveIcon Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public RoomUI_InteractiveIcon(RoomUI uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override RoomUI_InteractiveIcon Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.InteractiveTipBar.Line2D /// - public class UiNode_Line2D : IUiNode + public class RoomUI_Line2D : UiNode { - public UiNode_Line2D(Godot.Line2D node) : base(node) { } - public override UiNode_Line2D Clone() => new ((Godot.Line2D)Instance.Duplicate()); + public RoomUI_Line2D(RoomUI uiPanel, Godot.Line2D node) : base(uiPanel, node) { } + public override RoomUI_Line2D Clone() => new (UiPanel, (Godot.Line2D)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.InteractiveTipBar.NameLabel /// - public class UiNode_NameLabel : IUiNode + public class RoomUI_NameLabel : UiNode { - public UiNode_NameLabel(Godot.Label node) : base(node) { } - public override UiNode_NameLabel Clone() => new ((Godot.Label)Instance.Duplicate()); + public RoomUI_NameLabel(RoomUI uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomUI_NameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.InteractiveTipBar /// - public class UiNode_InteractiveTipBar : IUiNode + public class RoomUI_InteractiveTipBar : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Icon /// - public UiNode_Icon L_Icon + public RoomUI_Icon L_Icon { get { - if (_L_Icon == null) _L_Icon = new UiNode_Icon(Instance.GetNodeOrNull("Icon")); + if (_L_Icon == null) _L_Icon = new RoomUI_Icon(UiPanel, Instance.GetNodeOrNull("Icon")); return _L_Icon; } } - private UiNode_Icon _L_Icon; + private RoomUI_Icon _L_Icon; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.InteractiveIcon /// - public UiNode_InteractiveIcon L_InteractiveIcon + public RoomUI_InteractiveIcon L_InteractiveIcon { get { - if (_L_InteractiveIcon == null) _L_InteractiveIcon = new UiNode_InteractiveIcon(Instance.GetNodeOrNull("InteractiveIcon")); + if (_L_InteractiveIcon == null) _L_InteractiveIcon = new RoomUI_InteractiveIcon(UiPanel, Instance.GetNodeOrNull("InteractiveIcon")); return _L_InteractiveIcon; } } - private UiNode_InteractiveIcon _L_InteractiveIcon; + private RoomUI_InteractiveIcon _L_InteractiveIcon; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Line2D /// - public UiNode_Line2D L_Line2D + public RoomUI_Line2D L_Line2D { get { - if (_L_Line2D == null) _L_Line2D = new UiNode_Line2D(Instance.GetNodeOrNull("Line2D")); + if (_L_Line2D == null) _L_Line2D = new RoomUI_Line2D(UiPanel, Instance.GetNodeOrNull("Line2D")); return _L_Line2D; } } - private UiNode_Line2D _L_Line2D; + private RoomUI_Line2D _L_Line2D; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.NameLabel /// - public UiNode_NameLabel L_NameLabel + public RoomUI_NameLabel L_NameLabel { get { - if (_L_NameLabel == null) _L_NameLabel = new UiNode_NameLabel(Instance.GetNodeOrNull("NameLabel")); + if (_L_NameLabel == null) _L_NameLabel = new RoomUI_NameLabel(UiPanel, Instance.GetNodeOrNull("NameLabel")); return _L_NameLabel; } } - private UiNode_NameLabel _L_NameLabel; + private RoomUI_NameLabel _L_NameLabel; - public UiNode_InteractiveTipBar(Godot.Control node) : base(node) { } - public override UiNode_InteractiveTipBar Clone() => new ((Godot.Control)Instance.Duplicate()); + public RoomUI_InteractiveTipBar(RoomUI uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override RoomUI_InteractiveTipBar Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.ReloadBar.Slot.Block /// - public class UiNode_Block : IUiNode + public class RoomUI_Block : UiNode { - public UiNode_Block(Godot.Sprite2D node) : base(node) { } - public override UiNode_Block Clone() => new ((Godot.Sprite2D)Instance.Duplicate()); + public RoomUI_Block(RoomUI uiPanel, Godot.Sprite2D node) : base(uiPanel, node) { } + public override RoomUI_Block Clone() => new (UiPanel, (Godot.Sprite2D)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.ReloadBar.Slot /// - public class UiNode_Slot : IUiNode + public class RoomUI_Slot : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.ReloadBar.Block /// - public UiNode_Block L_Block + public RoomUI_Block L_Block { get { - if (_L_Block == null) _L_Block = new UiNode_Block(Instance.GetNodeOrNull("Block")); + if (_L_Block == null) _L_Block = new RoomUI_Block(UiPanel, Instance.GetNodeOrNull("Block")); return _L_Block; } } - private UiNode_Block _L_Block; + private RoomUI_Block _L_Block; - public UiNode_Slot(Godot.TextureRect node) : base(node) { } - public override UiNode_Slot Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public RoomUI_Slot(RoomUI uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override RoomUI_Slot Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.ReloadBar /// - public class UiNode_ReloadBar : IUiNode + public class RoomUI_ReloadBar : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Slot /// - public UiNode_Slot L_Slot + public RoomUI_Slot L_Slot { get { - if (_L_Slot == null) _L_Slot = new UiNode_Slot(Instance.GetNodeOrNull("Slot")); + if (_L_Slot == null) _L_Slot = new RoomUI_Slot(UiPanel, Instance.GetNodeOrNull("Slot")); return _L_Slot; } } - private UiNode_Slot _L_Slot; + private RoomUI_Slot _L_Slot; - public UiNode_ReloadBar(Godot.Control node) : base(node) { } - public override UiNode_ReloadBar Clone() => new ((Godot.Control)Instance.Duplicate()); + public RoomUI_ReloadBar(RoomUI uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override RoomUI_ReloadBar Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.LifeBar.Life /// - public class UiNode_Life : IUiNode + public class RoomUI_Life : UiNode { - public UiNode_Life(Godot.TextureRect node) : base(node) { } - public override UiNode_Life Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public RoomUI_Life(RoomUI uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override RoomUI_Life Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.LifeBar /// - public class UiNode_LifeBar : IUiNode + public class RoomUI_LifeBar : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.Life /// - public UiNode_Life L_Life + public RoomUI_Life L_Life { get { - if (_L_Life == null) _L_Life = new UiNode_Life(Instance.GetNodeOrNull("Life")); + if (_L_Life == null) _L_Life = new RoomUI_Life(UiPanel, Instance.GetNodeOrNull("Life")); return _L_Life; } } - private UiNode_Life _L_Life; + private RoomUI_Life _L_Life; - public UiNode_LifeBar(Godot.Control node) : base(node) { } - public override UiNode_LifeBar Clone() => new ((Godot.Control)Instance.Duplicate()); + public RoomUI_LifeBar(RoomUI uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override RoomUI_LifeBar Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.MapBar /// - public class UiNode_MapBar : IUiNode + public class RoomUI_MapBar : UiNode { - public UiNode_MapBar(Godot.TextureRect node) : base(node) { } - public override UiNode_MapBar Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public RoomUI_MapBar(RoomUI uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override RoomUI_MapBar Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar.ActivePropBg /// - public class UiNode_ActivePropBg : IUiNode + public class RoomUI_ActivePropBg : UiNode { - public UiNode_ActivePropBg(Godot.NinePatchRect node) : base(node) { } - public override UiNode_ActivePropBg Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); + public RoomUI_ActivePropBg(RoomUI uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override RoomUI_ActivePropBg Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar.ActivePropSprite /// - public class UiNode_ActivePropSprite : IUiNode + public class RoomUI_ActivePropSprite : UiNode { - public UiNode_ActivePropSprite(Godot.TextureRect node) : base(node) { } - public override UiNode_ActivePropSprite Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public RoomUI_ActivePropSprite(RoomUI uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override RoomUI_ActivePropSprite Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar.CooldownProgress /// - public class UiNode_CooldownProgress : IUiNode + public class RoomUI_CooldownProgress : UiNode { - public UiNode_CooldownProgress(Godot.Sprite2D node) : base(node) { } - public override UiNode_CooldownProgress Clone() => new ((Godot.Sprite2D)Instance.Duplicate()); + public RoomUI_CooldownProgress(RoomUI uiPanel, Godot.Sprite2D node) : base(uiPanel, node) { } + public override RoomUI_CooldownProgress Clone() => new (UiPanel, (Godot.Sprite2D)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar.ActivePropCount /// - public class UiNode_ActivePropCount : IUiNode + public class RoomUI_ActivePropCount : UiNode { - public UiNode_ActivePropCount(Godot.Label node) : base(node) { } - public override UiNode_ActivePropCount Clone() => new ((Godot.Label)Instance.Duplicate()); + public RoomUI_ActivePropCount(RoomUI uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomUI_ActivePropCount Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar.ActivePropPanel /// - public class UiNode_ActivePropPanel : IUiNode + public class RoomUI_ActivePropPanel : UiNode { - public UiNode_ActivePropPanel(Godot.NinePatchRect node) : base(node) { } - public override UiNode_ActivePropPanel Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); + public RoomUI_ActivePropPanel(RoomUI uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override RoomUI_ActivePropPanel Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar.ChargeProgressBar /// - public class UiNode_ChargeProgressBar : IUiNode + public class RoomUI_ChargeProgressBar : UiNode { - public UiNode_ChargeProgressBar(Godot.NinePatchRect node) : base(node) { } - public override UiNode_ChargeProgressBar Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); + public RoomUI_ChargeProgressBar(RoomUI uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override RoomUI_ChargeProgressBar Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar.ChargeProgress /// - public class UiNode_ChargeProgress : IUiNode + public class RoomUI_ChargeProgress : UiNode { - public UiNode_ChargeProgress(Godot.Sprite2D node) : base(node) { } - public override UiNode_ChargeProgress Clone() => new ((Godot.Sprite2D)Instance.Duplicate()); + public RoomUI_ChargeProgress(RoomUI uiPanel, Godot.Sprite2D node) : base(uiPanel, node) { } + public override RoomUI_ChargeProgress Clone() => new (UiPanel, (Godot.Sprite2D)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.ActivePropBar /// - public class UiNode_ActivePropBar : IUiNode + public class RoomUI_ActivePropBar : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ActivePropBg /// - public UiNode_ActivePropBg L_ActivePropBg + public RoomUI_ActivePropBg L_ActivePropBg { get { - if (_L_ActivePropBg == null) _L_ActivePropBg = new UiNode_ActivePropBg(Instance.GetNodeOrNull("ActivePropBg")); + if (_L_ActivePropBg == null) _L_ActivePropBg = new RoomUI_ActivePropBg(UiPanel, Instance.GetNodeOrNull("ActivePropBg")); return _L_ActivePropBg; } } - private UiNode_ActivePropBg _L_ActivePropBg; + private RoomUI_ActivePropBg _L_ActivePropBg; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ActivePropSprite /// - public UiNode_ActivePropSprite L_ActivePropSprite + public RoomUI_ActivePropSprite L_ActivePropSprite { get { - if (_L_ActivePropSprite == null) _L_ActivePropSprite = new UiNode_ActivePropSprite(Instance.GetNodeOrNull("ActivePropSprite")); + if (_L_ActivePropSprite == null) _L_ActivePropSprite = new RoomUI_ActivePropSprite(UiPanel, Instance.GetNodeOrNull("ActivePropSprite")); return _L_ActivePropSprite; } } - private UiNode_ActivePropSprite _L_ActivePropSprite; + private RoomUI_ActivePropSprite _L_ActivePropSprite; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.CooldownProgress /// - public UiNode_CooldownProgress L_CooldownProgress + public RoomUI_CooldownProgress L_CooldownProgress { get { - if (_L_CooldownProgress == null) _L_CooldownProgress = new UiNode_CooldownProgress(Instance.GetNodeOrNull("CooldownProgress")); + if (_L_CooldownProgress == null) _L_CooldownProgress = new RoomUI_CooldownProgress(UiPanel, Instance.GetNodeOrNull("CooldownProgress")); return _L_CooldownProgress; } } - private UiNode_CooldownProgress _L_CooldownProgress; + private RoomUI_CooldownProgress _L_CooldownProgress; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ActivePropCount /// - public UiNode_ActivePropCount L_ActivePropCount + public RoomUI_ActivePropCount L_ActivePropCount { get { - if (_L_ActivePropCount == null) _L_ActivePropCount = new UiNode_ActivePropCount(Instance.GetNodeOrNull("ActivePropCount")); + if (_L_ActivePropCount == null) _L_ActivePropCount = new RoomUI_ActivePropCount(UiPanel, Instance.GetNodeOrNull("ActivePropCount")); return _L_ActivePropCount; } } - private UiNode_ActivePropCount _L_ActivePropCount; + private RoomUI_ActivePropCount _L_ActivePropCount; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ActivePropPanel /// - public UiNode_ActivePropPanel L_ActivePropPanel + public RoomUI_ActivePropPanel L_ActivePropPanel { get { - if (_L_ActivePropPanel == null) _L_ActivePropPanel = new UiNode_ActivePropPanel(Instance.GetNodeOrNull("ActivePropPanel")); + if (_L_ActivePropPanel == null) _L_ActivePropPanel = new RoomUI_ActivePropPanel(UiPanel, Instance.GetNodeOrNull("ActivePropPanel")); return _L_ActivePropPanel; } } - private UiNode_ActivePropPanel _L_ActivePropPanel; + private RoomUI_ActivePropPanel _L_ActivePropPanel; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ChargeProgressBar /// - public UiNode_ChargeProgressBar L_ChargeProgressBar + public RoomUI_ChargeProgressBar L_ChargeProgressBar { get { - if (_L_ChargeProgressBar == null) _L_ChargeProgressBar = new UiNode_ChargeProgressBar(Instance.GetNodeOrNull("ChargeProgressBar")); + if (_L_ChargeProgressBar == null) _L_ChargeProgressBar = new RoomUI_ChargeProgressBar(UiPanel, Instance.GetNodeOrNull("ChargeProgressBar")); return _L_ChargeProgressBar; } } - private UiNode_ChargeProgressBar _L_ChargeProgressBar; + private RoomUI_ChargeProgressBar _L_ChargeProgressBar; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ChargeProgress /// - public UiNode_ChargeProgress L_ChargeProgress + public RoomUI_ChargeProgress L_ChargeProgress { get { - if (_L_ChargeProgress == null) _L_ChargeProgress = new UiNode_ChargeProgress(Instance.GetNodeOrNull("ChargeProgress")); + if (_L_ChargeProgress == null) _L_ChargeProgress = new RoomUI_ChargeProgress(UiPanel, Instance.GetNodeOrNull("ChargeProgress")); return _L_ChargeProgress; } } - private UiNode_ChargeProgress _L_ChargeProgress; + private RoomUI_ChargeProgress _L_ChargeProgress; - public UiNode_ActivePropBar(Godot.Control node) : base(node) { } - public override UiNode_ActivePropBar Clone() => new ((Godot.Control)Instance.Duplicate()); + public RoomUI_ActivePropBar(RoomUI uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override RoomUI_ActivePropBar Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.WeaponBar.WeaponPanel.WeaponSprite /// - public class UiNode_WeaponSprite : IUiNode + public class RoomUI_WeaponSprite : UiNode { - public UiNode_WeaponSprite(Godot.TextureRect node) : base(node) { } - public override UiNode_WeaponSprite Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public RoomUI_WeaponSprite(RoomUI uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override RoomUI_WeaponSprite Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.WeaponBar.WeaponPanel /// - public class UiNode_WeaponPanel : IUiNode + public class RoomUI_WeaponPanel : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.WeaponBar.WeaponSprite /// - public UiNode_WeaponSprite L_WeaponSprite + public RoomUI_WeaponSprite L_WeaponSprite { get { - if (_L_WeaponSprite == null) _L_WeaponSprite = new UiNode_WeaponSprite(Instance.GetNodeOrNull("WeaponSprite")); + if (_L_WeaponSprite == null) _L_WeaponSprite = new RoomUI_WeaponSprite(UiPanel, Instance.GetNodeOrNull("WeaponSprite")); return _L_WeaponSprite; } } - private UiNode_WeaponSprite _L_WeaponSprite; + private RoomUI_WeaponSprite _L_WeaponSprite; - public UiNode_WeaponPanel(Godot.NinePatchRect node) : base(node) { } - public override UiNode_WeaponPanel Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); + public RoomUI_WeaponPanel(RoomUI uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override RoomUI_WeaponPanel Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.WeaponBar.AmmoCount /// - public class UiNode_AmmoCount : IUiNode + public class RoomUI_AmmoCount : UiNode { - public UiNode_AmmoCount(Godot.Label node) : base(node) { } - public override UiNode_AmmoCount Clone() => new ((Godot.Label)Instance.Duplicate()); + public RoomUI_AmmoCount(RoomUI uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomUI_AmmoCount Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control.WeaponBar /// - public class UiNode_WeaponBar : IUiNode + public class RoomUI_WeaponBar : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.WeaponPanel /// - public UiNode_WeaponPanel L_WeaponPanel + public RoomUI_WeaponPanel L_WeaponPanel { get { - if (_L_WeaponPanel == null) _L_WeaponPanel = new UiNode_WeaponPanel(Instance.GetNodeOrNull("WeaponPanel")); + if (_L_WeaponPanel == null) _L_WeaponPanel = new RoomUI_WeaponPanel(UiPanel, Instance.GetNodeOrNull("WeaponPanel")); return _L_WeaponPanel; } } - private UiNode_WeaponPanel _L_WeaponPanel; + private RoomUI_WeaponPanel _L_WeaponPanel; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.AmmoCount /// - public UiNode_AmmoCount L_AmmoCount + public RoomUI_AmmoCount L_AmmoCount { get { - if (_L_AmmoCount == null) _L_AmmoCount = new UiNode_AmmoCount(Instance.GetNodeOrNull("AmmoCount")); + if (_L_AmmoCount == null) _L_AmmoCount = new RoomUI_AmmoCount(UiPanel, Instance.GetNodeOrNull("AmmoCount")); return _L_AmmoCount; } } - private UiNode_AmmoCount _L_AmmoCount; + private RoomUI_AmmoCount _L_AmmoCount; - public UiNode_WeaponBar(Godot.Control node) : base(node) { } - public override UiNode_WeaponBar Clone() => new ((Godot.Control)Instance.Duplicate()); + public RoomUI_WeaponBar(RoomUI uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override RoomUI_WeaponBar Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); } /// /// 类型: , 路径: RoomUI.Control /// - public class UiNode_Control : IUiNode + public class RoomUI_Control : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.LifeBar /// - public UiNode_LifeBar L_LifeBar + public RoomUI_LifeBar L_LifeBar { get { - if (_L_LifeBar == null) _L_LifeBar = new UiNode_LifeBar(Instance.GetNodeOrNull("LifeBar")); + if (_L_LifeBar == null) _L_LifeBar = new RoomUI_LifeBar(UiPanel, Instance.GetNodeOrNull("LifeBar")); return _L_LifeBar; } } - private UiNode_LifeBar _L_LifeBar; + private RoomUI_LifeBar _L_LifeBar; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.MapBar /// - public UiNode_MapBar L_MapBar + public RoomUI_MapBar L_MapBar { get { - if (_L_MapBar == null) _L_MapBar = new UiNode_MapBar(Instance.GetNodeOrNull("MapBar")); + if (_L_MapBar == null) _L_MapBar = new RoomUI_MapBar(UiPanel, Instance.GetNodeOrNull("MapBar")); return _L_MapBar; } } - private UiNode_MapBar _L_MapBar; + private RoomUI_MapBar _L_MapBar; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.ActivePropBar /// - public UiNode_ActivePropBar L_ActivePropBar + public RoomUI_ActivePropBar L_ActivePropBar { get { - if (_L_ActivePropBar == null) _L_ActivePropBar = new UiNode_ActivePropBar(Instance.GetNodeOrNull("ActivePropBar")); + if (_L_ActivePropBar == null) _L_ActivePropBar = new RoomUI_ActivePropBar(UiPanel, Instance.GetNodeOrNull("ActivePropBar")); return _L_ActivePropBar; } } - private UiNode_ActivePropBar _L_ActivePropBar; + private RoomUI_ActivePropBar _L_ActivePropBar; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.WeaponBar /// - public UiNode_WeaponBar L_WeaponBar + public RoomUI_WeaponBar L_WeaponBar { get { - if (_L_WeaponBar == null) _L_WeaponBar = new UiNode_WeaponBar(Instance.GetNodeOrNull("WeaponBar")); + if (_L_WeaponBar == null) _L_WeaponBar = new RoomUI_WeaponBar(UiPanel, Instance.GetNodeOrNull("WeaponBar")); return _L_WeaponBar; } } - private UiNode_WeaponBar _L_WeaponBar; + private RoomUI_WeaponBar _L_WeaponBar; - public UiNode_Control(Godot.Control node) : base(node) { } - public override UiNode_Control Clone() => new ((Godot.Control)Instance.Duplicate()); + public RoomUI_Control(RoomUI uiPanel, Godot.Control node) : base(uiPanel, node) { } + public override RoomUI_Control Clone() => new (UiPanel, (Godot.Control)Instance.Duplicate()); } + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.InteractiveTipBar.Icon + /// + public RoomUI_Icon S_Icon => L_InteractiveTipBar.L_Icon; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.InteractiveTipBar.InteractiveIcon + /// + public RoomUI_InteractiveIcon S_InteractiveIcon => L_InteractiveTipBar.L_InteractiveIcon; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.InteractiveTipBar.Line2D + /// + public RoomUI_Line2D S_Line2D => L_InteractiveTipBar.L_Line2D; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.InteractiveTipBar.NameLabel + /// + public RoomUI_NameLabel S_NameLabel => L_InteractiveTipBar.L_NameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.InteractiveTipBar + /// + public RoomUI_InteractiveTipBar S_InteractiveTipBar => L_InteractiveTipBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.ReloadBar.Slot.Block + /// + public RoomUI_Block S_Block => L_ReloadBar.L_Slot.L_Block; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.ReloadBar.Slot + /// + public RoomUI_Slot S_Slot => L_ReloadBar.L_Slot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.ReloadBar + /// + public RoomUI_ReloadBar S_ReloadBar => L_ReloadBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.LifeBar.Life + /// + public RoomUI_Life S_Life => L_Control.L_LifeBar.L_Life; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.LifeBar + /// + public RoomUI_LifeBar S_LifeBar => L_Control.L_LifeBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.MapBar + /// + public RoomUI_MapBar S_MapBar => L_Control.L_MapBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar.ActivePropBg + /// + public RoomUI_ActivePropBg S_ActivePropBg => L_Control.L_ActivePropBar.L_ActivePropBg; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar.ActivePropSprite + /// + public RoomUI_ActivePropSprite S_ActivePropSprite => L_Control.L_ActivePropBar.L_ActivePropSprite; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar.CooldownProgress + /// + public RoomUI_CooldownProgress S_CooldownProgress => L_Control.L_ActivePropBar.L_CooldownProgress; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar.ActivePropCount + /// + public RoomUI_ActivePropCount S_ActivePropCount => L_Control.L_ActivePropBar.L_ActivePropCount; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar.ActivePropPanel + /// + public RoomUI_ActivePropPanel S_ActivePropPanel => L_Control.L_ActivePropBar.L_ActivePropPanel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar.ChargeProgressBar + /// + public RoomUI_ChargeProgressBar S_ChargeProgressBar => L_Control.L_ActivePropBar.L_ChargeProgressBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar.ChargeProgress + /// + public RoomUI_ChargeProgress S_ChargeProgress => L_Control.L_ActivePropBar.L_ChargeProgress; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.ActivePropBar + /// + public RoomUI_ActivePropBar S_ActivePropBar => L_Control.L_ActivePropBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.WeaponBar.WeaponPanel.WeaponSprite + /// + public RoomUI_WeaponSprite S_WeaponSprite => L_Control.L_WeaponBar.L_WeaponPanel.L_WeaponSprite; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.WeaponBar.WeaponPanel + /// + public RoomUI_WeaponPanel S_WeaponPanel => L_Control.L_WeaponBar.L_WeaponPanel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.WeaponBar.AmmoCount + /// + public RoomUI_AmmoCount S_AmmoCount => L_Control.L_WeaponBar.L_AmmoCount; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control.WeaponBar + /// + public RoomUI_WeaponBar S_WeaponBar => L_Control.L_WeaponBar; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: RoomUI.Control + /// + public RoomUI_Control S_Control => L_Control; + } diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs index 0f0c3c4808751771be037b2dfd7b2cf685509283..56f26c360b61101fb0abe18b38012566febb54ac 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs @@ -60,7 +60,7 @@ public partial class RoomUIPanel : RoomUI private void OnPlayerPickUpProp(object propObj) { var prop = (Prop)propObj; - var message = $"{prop.ItemConfig.Name}\n{prop.ItemConfig.Remark}"; + var message = $"{prop.ItemConfig.Name}\n{prop.ItemConfig.Intro}"; BottomTipsPanel.ShowTips(prop.GetDefaultTexture(), message); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs index e6beffc2ac2b687475c3106b75cffd1943c2e323..01423cf0fc3fad3c24c552e3d7c6151ce5a89770 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/WeaponBar.cs @@ -4,12 +4,12 @@ namespace UI.RoomUI; public class WeaponBar { - private RoomUI.UiNode_WeaponBar _weaponBar; + private RoomUI.RoomUI_WeaponBar _weaponBar; private int _prevAmmo = -1; private int _prevResidue = -1; - public WeaponBar(RoomUI.UiNode_WeaponBar weaponBar) + public WeaponBar(RoomUI.RoomUI_WeaponBar weaponBar) { _weaponBar = weaponBar; SetWeaponTexture(null); diff --git a/DungeonShooting_Godot/src/game/ui/settlement/Settlement.cs b/DungeonShooting_Godot/src/game/ui/settlement/Settlement.cs index e61f5caaf966152b9fc355366ffcdcc219b90d80..906106dc96389a07d7195316de8187eed76ae7de 100644 --- a/DungeonShooting_Godot/src/game/ui/settlement/Settlement.cs +++ b/DungeonShooting_Godot/src/game/ui/settlement/Settlement.cs @@ -8,116 +8,147 @@ public abstract partial class Settlement : UiBase /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Settlement.Bg /// - public UiNode_Bg L_Bg + public Bg L_Bg { get { - if (_L_Bg == null) _L_Bg = new UiNode_Bg(GetNodeOrNull("Bg")); + if (_L_Bg == null) _L_Bg = new Bg((SettlementPanel)this, GetNode("Bg")); return _L_Bg; } } - private UiNode_Bg _L_Bg; + private Bg _L_Bg; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Settlement.Title /// - public UiNode_Title L_Title + public Title L_Title { get { - if (_L_Title == null) _L_Title = new UiNode_Title(GetNodeOrNull("Title")); + if (_L_Title == null) _L_Title = new Title((SettlementPanel)this, GetNode("Title")); return _L_Title; } } - private UiNode_Title _L_Title; + private Title _L_Title; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Settlement.ButtonList /// - public UiNode_ButtonList L_ButtonList + public ButtonList L_ButtonList { get { - if (_L_ButtonList == null) _L_ButtonList = new UiNode_ButtonList(GetNodeOrNull("ButtonList")); + if (_L_ButtonList == null) _L_ButtonList = new ButtonList((SettlementPanel)this, GetNode("ButtonList")); return _L_ButtonList; } } - private UiNode_ButtonList _L_ButtonList; + private ButtonList _L_ButtonList; public Settlement() : base(nameof(Settlement)) { } + public sealed override void OnInitNestedUi() + { + + } + /// /// 类型: , 路径: Settlement.Bg /// - public class UiNode_Bg : IUiNode + public class Bg : UiNode { - public UiNode_Bg(Godot.ColorRect node) : base(node) { } - public override UiNode_Bg Clone() => new ((Godot.ColorRect)Instance.Duplicate()); + public Bg(SettlementPanel uiPanel, Godot.ColorRect node) : base(uiPanel, node) { } + public override Bg Clone() => new (UiPanel, (Godot.ColorRect)Instance.Duplicate()); } /// /// 类型: , 路径: Settlement.Title /// - public class UiNode_Title : IUiNode + public class Title : UiNode { - public UiNode_Title(Godot.Label node) : base(node) { } - public override UiNode_Title Clone() => new ((Godot.Label)Instance.Duplicate()); + public Title(SettlementPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Title Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: Settlement.ButtonList.Restart /// - public class UiNode_Restart : IUiNode + public class Restart : UiNode { - public UiNode_Restart(Godot.Button node) : base(node) { } - public override UiNode_Restart Clone() => new ((Godot.Button)Instance.Duplicate()); + public Restart(SettlementPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Restart Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Settlement.ButtonList.ToMenu /// - public class UiNode_ToMenu : IUiNode + public class ToMenu : UiNode { - public UiNode_ToMenu(Godot.Button node) : base(node) { } - public override UiNode_ToMenu Clone() => new ((Godot.Button)Instance.Duplicate()); + public ToMenu(SettlementPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override ToMenu Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Settlement.ButtonList /// - public class UiNode_ButtonList : IUiNode + public class ButtonList : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Settlement.Restart /// - public UiNode_Restart L_Restart + public Restart L_Restart { get { - if (_L_Restart == null) _L_Restart = new UiNode_Restart(Instance.GetNodeOrNull("Restart")); + if (_L_Restart == null) _L_Restart = new Restart(UiPanel, Instance.GetNode("Restart")); return _L_Restart; } } - private UiNode_Restart _L_Restart; + private Restart _L_Restart; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Settlement.ToMenu /// - public UiNode_ToMenu L_ToMenu + public ToMenu L_ToMenu { get { - if (_L_ToMenu == null) _L_ToMenu = new UiNode_ToMenu(Instance.GetNodeOrNull("ToMenu")); + if (_L_ToMenu == null) _L_ToMenu = new ToMenu(UiPanel, Instance.GetNode("ToMenu")); return _L_ToMenu; } } - private UiNode_ToMenu _L_ToMenu; + private ToMenu _L_ToMenu; - public UiNode_ButtonList(Godot.VBoxContainer node) : base(node) { } - public override UiNode_ButtonList Clone() => new ((Godot.VBoxContainer)Instance.Duplicate()); + public ButtonList(SettlementPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override ButtonList Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); } + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Settlement.Bg + /// + public Bg S_Bg => L_Bg; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Settlement.Title + /// + public Title S_Title => L_Title; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Settlement.ButtonList.Restart + /// + public Restart S_Restart => L_ButtonList.L_Restart; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Settlement.ButtonList.ToMenu + /// + public ToMenu S_ToMenu => L_ButtonList.L_ToMenu; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Settlement.ButtonList + /// + public ButtonList S_ButtonList => L_ButtonList; + } diff --git a/DungeonShooting_Godot/src/game/ui/settlement/SettlementPanel.cs b/DungeonShooting_Godot/src/game/ui/settlement/SettlementPanel.cs index a3a4a60d646dfac0cd8855f30aa5395ac9a71b23..b0ac795edc530b4e63c13011b19baec9825145ac 100644 --- a/DungeonShooting_Godot/src/game/ui/settlement/SettlementPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/settlement/SettlementPanel.cs @@ -7,37 +7,46 @@ namespace UI.Settlement; /// public partial class SettlementPanel : Settlement { - - public override void OnShowUi() + public override void OnCreateUi() { - L_ButtonList.L_Restart.Instance.Pressed += OnRestartClick; - L_ButtonList.L_ToMenu.Instance.Pressed += OnToMenuClick; - } + S_Restart.Instance.Pressed += OnRestartClick; + S_ToMenu.Instance.Pressed += OnToMenuClick; - public override void OnHideUi() - { - L_ButtonList.L_Restart.Instance.Pressed -= OnRestartClick; - L_ButtonList.L_ToMenu.Instance.Pressed -= OnToMenuClick; + if (GameApplication.Instance.DungeonManager.IsEditorMode) //在编辑器模式下打开的Ui + { + S_ToMenu.Instance.Text = "返回编辑器"; + } } - + //重新开始 private void OnRestartClick() { - HideUi(); - GameApplication.Instance.DungeonManager.ExitDungeon(() => + Destroy(); + if (GameApplication.Instance.DungeonManager.IsEditorMode) //在编辑器模式下打开的Ui + { + EditorPlayManager.Restart(); + } + else //正常重新开始 { - GameApplication.Instance.DungeonManager.LoadDungeon(GameApplication.Instance.DungeonConfig); - }); + GameApplication.Instance.DungeonManager.RestartDungeon(GameApplication.Instance.DungeonConfig); + } } //回到主菜单 private void OnToMenuClick() { - HideUi(); - GameApplication.Instance.DungeonManager.ExitDungeon(() => + Destroy(); + if (GameApplication.Instance.DungeonManager.IsEditorMode) //在编辑器模式下打开的Ui + { + EditorPlayManager.Exit(); + } + else //正常关闭Ui { - UiManager.Open_Main(); - }); + GameApplication.Instance.DungeonManager.ExitDungeon(() => + { + UiManager.Open_Main(); + }); + } } } diff --git a/DungeonShooting_Godot/src/test/TestDungeonGenerator.cs b/DungeonShooting_Godot/src/test/TestDungeonGenerator.cs deleted file mode 100644 index 5fae0a769a45f3e1750f00009e094d5984b716de..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/test/TestDungeonGenerator.cs +++ /dev/null @@ -1,109 +0,0 @@ - -using Godot; - -/// -/// 测试地牢生成 -/// -public partial class TestDungeonGenerator : Node2D -{ - [Export] public NodePath TileMapPath; - [Export] public NodePath Camera3D; - - private TileMap _tileMap; - private Camera2D _camera; - - private DungeonGenerator _dungeonGenerator; - private Font _font; - - // public override void _Ready() - // { - // _tileMap = GetNode(TileMapPath); - // _camera = GetNode(Camera3D); - // - // _font = ResourceManager.Load(ResourcePath.resource_font_cn_font_36_tres); - // - // _generateDungeon = new GenerateDungeon(); - // _generateDungeon.Generate(); - // - // foreach (var info in _generateDungeon.RoomInfos) - // { - // //临时铺上地砖 - // var id = (int)_tileMap.TileSet.GetTilesIds()[0]; - // for (int i = 0; i < info.Size.X; i++) - // { - // for (int j = 0; j < info.Size.Y; j++) - // { - // _tileMap.SetCell(i + (int)info.Position.X, j + (int)info.Position.Y, id); - // } - // } - // } - // } - // - // public override void _Process(float delta) - // { - // //移动相机位置 - // var dir = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down"); - // _camera.Position += dir * 1000 * delta; - // - // Update(); - // } - // - // public override void _Draw() - // { - // DrawRoomInfo(_generateDungeon.StartRoom); - // - // } - // - // private void DrawRoomInfo(RoomInfo room) - // { - // var cellSize = _tileMap.CellSize; - // var pos1 = (room.Position + room.Size / 2) * cellSize; - // foreach (var nextRoom in room.Next) - // { - // var pos2 = (nextRoom.Position + nextRoom.Size / 2) * cellSize; - // DrawLine(pos1, pos2, Colors.Red); - // DrawRoomInfo(nextRoom); - // } - // - // DrawString(_font, pos1, room.Id.ToString(), Colors.Yellow); - // - // foreach (var roomDoor in room.Doors) - // { - // var originPos = roomDoor.OriginPosition * cellSize; - // switch (roomDoor.Direction) - // { - // case DoorDirection.E: - // DrawLine(originPos, originPos + new Vector2(3, 0) * cellSize, Colors.Yellow); - // DrawLine(originPos + new Vector2(0, 4) * cellSize, originPos + new Vector2(3, 4) * cellSize, - // Colors.Yellow); - // break; - // case DoorDirection.W: - // DrawLine(originPos, originPos - new Vector2(3, 0) * cellSize, Colors.Yellow); - // DrawLine(originPos + new Vector2(0, 4) * cellSize, originPos - new Vector2(3, -4) * cellSize, - // Colors.Yellow); - // break; - // case DoorDirection.S: - // DrawLine(originPos, originPos + new Vector2(0, 3) * cellSize, Colors.Yellow); - // DrawLine(originPos + new Vector2(4, 0) * cellSize, originPos + new Vector2(4, 3) * cellSize, - // Colors.Yellow); - // break; - // case DoorDirection.N: - // DrawLine(originPos, originPos - new Vector2(0, 3) * cellSize, Colors.Yellow); - // DrawLine(originPos + new Vector2(4, 0) * cellSize, originPos - new Vector2(-4, 3) * cellSize, - // Colors.Yellow); - // break; - // } - // - // if (roomDoor.HasCross && roomDoor.RoomInfo.Id < roomDoor.ConnectRoom.Id) - // { - // DrawRect(new Rect2(roomDoor.Cross * cellSize, cellSize * 4), Colors.Yellow); - // } - // } - // - // //绘制地图上被占用的网格 - // // _generateDungeon.RoomGrid.ForEach((x, y, value) => - // // { - // // DrawRect(new Rect2(new Vector2(x, y) * cellSize + new Vector2(6, 6), new Vector2(4, 4)), Colors.Green); - // // }); - // } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/test/TestExpression.cs b/DungeonShooting_Godot/src/test/TestExpression.cs deleted file mode 100644 index 94614a0621c0613cc95c23a6d5372bada89ebaa4..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/test/TestExpression.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Godot; -using System; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -public partial class TestExpression : Node2D -{ - [Export(PropertyHint.Expression)] - public string Str; - - public override void _Ready() - { - //var expressions = Pretreatment(Str); - - } - - -} diff --git a/DungeonShooting_Godot/src/test/TestNavigation.cs b/DungeonShooting_Godot/src/test/TestNavigation.cs deleted file mode 100644 index 137046a202042f985354310d066ce08f595724df..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/test/TestNavigation.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Godot; - -/// -/// 该demo是以3.4为基础做的导航demo, 后面3.5出了新的导航系统, 游戏中已采用新的导航方案 -/// -public partial class TestNavigation : Node2D -{ - - // private Node2D Node2D; - // private Vector2[] points = new Vector2[0]; - // - // public override void _Ready() - // { - // Node2D = GetNode("Marker2D/Node2D"); - // } - // - // public override void _Input(InputEvent @event) - // { - // if (@event is InputEventMouseButton ieb) { - // if (ieb.ButtonIndex == (int)ButtonList.Left && ieb.Pressed) - // { - // points = Node2D.GetSimplePath(Vector2.Zero, Node2D.ToLocal(ieb.Position)); - // Update(); - // string str = ""; - // foreach (var item in points) - // { - // str += item; - // } - // GD.Print("路径: " + points.Length + ", " + str); - // } - // } - // } - // - // public override void _Draw() - // { - // if (points.Length >= 2) - // { - // GD.Print("绘制线段..."); - // DrawPolyline(points, Colors.Red); - // // DrawMultiline(points, Colors.Red); - // } - // } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs b/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs index bc8bfa3aeddd37ac43de3ca4030b452273895290..1c9b7e965bc203275c8dc4e30d8e94fd8c37c265 100644 --- a/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs +++ b/DungeonShooting_Godot/src/test/TestOptimizeSprite.cs @@ -19,14 +19,14 @@ public partial class TestOptimizeSprite : Node2D for (int i = 0; i < 50000; i++) { - var texture = Utils.RandomChoose(ImageList); - var x = Utils.RandomRangeInt(0, imageCanvas.Width); - var y = Utils.RandomRangeInt(0, imageCanvas.Height); - var centerX = Utils.RandomRangeInt(0, texture.GetWidth()); - var centerY = Utils.RandomRangeInt(0, texture.GetHeight()); - var angle = Utils.RandomRangeInt(0, 360); + var texture = Utils.Random.RandomChoose(ImageList); + var x = Utils.Random.RandomRangeInt(0, imageCanvas.Width); + var y = Utils.Random.RandomRangeInt(0, imageCanvas.Height); + var centerX = Utils.Random.RandomRangeInt(0, texture.GetWidth()); + var centerY = Utils.Random.RandomRangeInt(0, texture.GetHeight()); + var angle = Utils.Random.RandomRangeInt(0, 360); imageCanvas.DrawImageInCanvas(texture, null, x, y, - angle, centerX, centerY, Utils.RandomBoolean(), + angle, centerX, centerY, Utils.Random.RandomBoolean(), () => { successCount++; diff --git a/DungeonShooting_Godot/src/test/TestReadExcel.cs b/DungeonShooting_Godot/src/test/TestReadExcel.cs deleted file mode 100644 index eee0656f7a776e5b8d82be191e8af356ba26a348..0000000000000000000000000000000000000000 --- a/DungeonShooting_Godot/src/test/TestReadExcel.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Godot; -using System; -using System.IO; -// using NPOI.SS.UserModel; -// using NPOI.XSSF.UserModel; - -public partial class TestReadExcel : Node2D -{ - public override void _Ready() - { - // string sourceFile = @"excel/Weapon.xlsx"; - // - // IWorkbook workbook = new XSSFWorkbook(sourceFile); - // ISheet sheet1 = workbook.GetSheet("Sheet1"); - // - // int columnCount = -1; - // foreach (IRow row in sheet1) - // { - // foreach (var cell in row) - // { - // if (columnCount >= 0 && cell.ColumnIndex >= columnCount) - // { - // break; - // } - // var value = cell.StringCellValue; - // if (string.IsNullOrEmpty(value)) - // { - // if (columnCount < 0) - // { - // columnCount = cell.ColumnIndex; - // break; - // } - // else if (cell.ColumnIndex == 0) - // { - // break; - // } - // } - // GD.Print("row: " + row.RowNum + " , Column: " + cell.ColumnIndex + ", value: " + cell.StringCellValue); - // } - // } - // workbook.Close(); - // sheet1.CreateRow(0).CreateCell(0).SetCellValue(1); - // sheet1.CreateRow(1).CreateCell(0).SetCellValue(2); - // sheet1.CreateRow(2).CreateCell(0).SetCellValue(3); - // - // FileStream fs = new FileStream(targetFile, FileMode.Create); - // workbook.Write(fs, true); - // workbook.Close(); - } -}