mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-19 17:16:08 +08:00
fix: 链接错误
This commit is contained in:
parent
121fbe369d
commit
d7544b98c8
@ -206,7 +206,7 @@ mainSetting
|
|||||||
|
|
||||||
设置的编辑组件实际上只是一种特殊的组件,它接收下面三个参数(`props`)
|
设置的编辑组件实际上只是一种特殊的组件,它接收下面三个参数(`props`)
|
||||||
|
|
||||||
- `item`: 这个设置的信息,一般只会用到 `value`,也就是这个设置的值,其他信息请参考[API 列表](../api/class.md)
|
- `item`: 这个设置的信息,一般只会用到 `value`,也就是这个设置的值
|
||||||
- `setting`: 根级设置实例,例如对于上面注册的设置,就是 `mainSetting`,而不是其任意一级的级联设置
|
- `setting`: 根级设置实例,例如对于上面注册的设置,就是 `mainSetting`,而不是其任意一级的级联设置
|
||||||
- `displayer`: 设置渲染控制器,一般情况下,当设置完值后,调用 `displayer.update` 即可
|
- `displayer`: 设置渲染控制器,一般情况下,当设置完值后,调用 `displayer.update` 即可
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ mainUi.open('settings', { info: mySetting });
|
|||||||
|
|
||||||
除此之外,样板还提供了能够用于创建自己的设置 UI 的 API,它是类 `SettingDisplayer`,你可以为你自己的 UI 创建一个其实例,从而辅助你去创建自己的显示 UI。
|
除此之外,样板还提供了能够用于创建自己的设置 UI 的 API,它是类 `SettingDisplayer`,你可以为你自己的 UI 创建一个其实例,从而辅助你去创建自己的显示 UI。
|
||||||
|
|
||||||
创建实例时,要求传入设置作为参数。你可以通过 `add` 来选择一个设置,通过 `cut` 来截断一个设置,最终呈现出来的选择栈会存储在属性 `selectStack` 中,要渲染的信息会存储在属性 `displayInfo` 中。当一个设置被更改时,可以通过 `update` 函数来刷新显示。这样,我们就可以写出自己的设置 UI 了。对于这些内容的详细说明,请参考[API 列表](../api/class.md)。下面是一个极度简易的设置 UI 示例,其中省略了非常多的部分。
|
创建实例时,要求传入设置作为参数。你可以通过 `add` 来选择一个设置,通过 `cut` 来截断一个设置,最终呈现出来的选择栈会存储在属性 `selectStack` 中,要渲染的信息会存储在属性 `displayInfo` 中。当一个设置被更改时,可以通过 `update` 函数来刷新显示。这样,我们就可以写出自己的设置 UI 了。下面是一个极度简易的设置 UI 示例,其中省略了非常多的部分。
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { MotaSetting, SettingDisplayer, MComponent } = Mota.requireAll('class');
|
const { MotaSetting, SettingDisplayer, MComponent } = Mota.requireAll('class');
|
||||||
|
@ -186,10 +186,10 @@ const myUI = mainUi.get('myUI');
|
|||||||
|
|
||||||
对于 `UiController`,它有下列事件可以被监听:
|
对于 `UiController`,它有下列事件可以被监听:
|
||||||
|
|
||||||
- `focus(before, after)`: 当 UI 被聚焦时触发,`before` 参数表示之前聚焦的内容,也可能不存在被聚焦的内容,会是 `null`,`after` 参数表示聚焦至哪一个 UI。该事件会在 `mainUi.focusByNum` 或者 `mainUi.focus` 函数执行后触发,这两个函数在样板中没有调用案例,如果需要可以自行调用。该事件继承自类 [`Focus`](../api/class.md#Focus) 的事件。
|
- `focus(before, after)`: 当 UI 被聚焦时触发,`before` 参数表示之前聚焦的内容,也可能不存在被聚焦的内容,会是 `null`,`after` 参数表示聚焦至哪一个 UI。该事件会在 `mainUi.focusByNum` 或者 `mainUi.focus` 函数执行后触发,这两个函数在样板中没有调用案例,如果需要可以自行调用。该事件继承自类 [`Focus`](../api/class/focus) 的事件。
|
||||||
- `unfocus(before)`: 取消任何聚焦时触发,与 `focus` 事件类似。该事件继承自类 [`Focus`](../api/class.md#Focus) 的事件。
|
- `unfocus(before)`: 取消任何聚焦时触发,与 `focus` 事件类似。该事件继承自类 [`Focus`](../api/class/focus) 的事件。
|
||||||
- `add(item)`: 打开新 UI 时触发,参数是打开的 UI,是 `GameUi` 实例。该事件继承自类 [`Focus`](../api/class.md#Focus) 的事件。
|
- `add(item)`: 打开新 UI 时触发,参数是打开的 UI,是 `GameUi` 实例。该事件继承自类 [`Focus`](../api/class/focus) 的事件。
|
||||||
- `pop(item)`: 弹出最后一个 UI 时触发,参数是被弹出的 `GameUi` 实例。注意关闭 UI 不会触发此事件,因为关闭 UI 会使用 `splice` 而不是 `pop`。该事件继承自类 [`Focus`](../api/class.md#Focus) 的事件。
|
- `pop(item)`: 弹出最后一个 UI 时触发,参数是被弹出的 `GameUi` 实例。注意关闭 UI 不会触发此事件,因为关闭 UI 会使用 `splice` 而不是 `pop`。该事件继承自类 [`Focus`](../api/class/focus) 的事件。
|
||||||
- `splice(spliced)`: 当 UI 被截断(关闭)时触发,参数是被关闭的 UI 数组。该事件继承自类 [`Focus`](../api/class.md#Focus) 的事件。
|
- `splice(spliced)`: 当 UI 被截断(关闭)时触发,参数是被关闭的 UI 数组。该事件继承自类 [`Focus`](../api/class/focus) 的事件。
|
||||||
- `start()`: 当 UI 根组件被打开时触发。当 UI 控制器从没有任何 UI 变成有至少一个 UI 被显示时,也即当没有 UI 打开的情况下任何 UI 被打开时,会触发此事件。无参数。
|
- `start()`: 当 UI 根组件被打开时触发。当 UI 控制器从没有任何 UI 变成有至少一个 UI 被显示时,也即当没有 UI 打开的情况下任何 UI 被打开时,会触发此事件。无参数。
|
||||||
- `end()`: 当 UI 根组件被关闭时触发,即当所有 UI 都被关闭时触发。无参数。
|
- `end()`: 当 UI 根组件被关闭时触发,即当所有 UI 都被关闭时触发。无参数。
|
||||||
|
@ -1063,7 +1063,8 @@ maps.prototype._canMoveDirectly_checkNextPoint = function (blocksObj, x, y) {
|
|||||||
const damage = core.status.thisMap.enemy.mapDamage[index];
|
const damage = core.status.thisMap.enemy.mapDamage[index];
|
||||||
if (damage) {
|
if (damage) {
|
||||||
if (damage.damage !== 0) return false;
|
if (damage.damage !== 0) return false;
|
||||||
if (damage.mockery) return false;
|
if (damage.ambush) return false;
|
||||||
|
if (damage.repulse) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1157,7 +1158,8 @@ maps.prototype._automaticRoute_deepAdd = function (x, y, blocks) {
|
|||||||
const damage = core.status.thisMap.enemy.mapDamage[`${x},${y}`];
|
const damage = core.status.thisMap.enemy.mapDamage[`${x},${y}`];
|
||||||
if (damage) {
|
if (damage) {
|
||||||
deepAdd += damage.damage * 100;
|
deepAdd += damage.damage * 100;
|
||||||
deepAdd += !!damage.mockery ? 1e5 : 0;
|
deepAdd += damage.repulse ? 1000 : 0;
|
||||||
|
deepAdd += damage.ambush ? 1000 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return deepAdd;
|
return deepAdd;
|
||||||
|
Loading…
Reference in New Issue
Block a user