sapdon 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc/dev/core.md +2 -3
- package/doc/dev/ui-architecture.md +274 -0
- package/doc/dev/ui-lessons.md +147 -0
- package/doc/guidebook.md +294 -0
- package/doc/user/api/neo-guidebook.md +1 -1
- package/doc/user/api/sapdon-ui.md +34 -30
- package/doc/user/tutorials/neo-guidebook-experience.md +3 -3
- package/doc/user/tutorials/sapdon-ui.md +10 -13
- package/package.json +1 -1
- package/prod/core/index.d.ts +810 -666
- package/prod/core/index.js +1 -1
package/prod/core/index.d.ts
CHANGED
|
@@ -2973,21 +2973,148 @@ declare class RecipeRegistry {
|
|
|
2973
2973
|
registerShapeless(identifier: any): AddonRecipeShapeless_1_17;
|
|
2974
2974
|
}
|
|
2975
2975
|
|
|
2976
|
+
type Any$1 = any;
|
|
2976
2977
|
declare class UISystem {
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
addElement(element:
|
|
2985
|
-
getElement(element_name:
|
|
2986
|
-
addAnimation(name:
|
|
2987
|
-
getAnimation(animation_name:
|
|
2988
|
-
toObject():
|
|
2989
|
-
|
|
2990
|
-
|
|
2978
|
+
identifier: string;
|
|
2979
|
+
namespace: string;
|
|
2980
|
+
name: string;
|
|
2981
|
+
path: string;
|
|
2982
|
+
elements: Map<string, Any$1>;
|
|
2983
|
+
animations: Map<string, Any$1>;
|
|
2984
|
+
constructor(identifier: string, path: string);
|
|
2985
|
+
addElement(element: Any$1): this;
|
|
2986
|
+
getElement(element_name: string): Any$1;
|
|
2987
|
+
addAnimation(name: string, value: Any$1): void;
|
|
2988
|
+
getAnimation(animation_name: string): Any$1;
|
|
2989
|
+
toObject(): Record<string, Any$1>;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
/** 共享 UI 类型定义(JSON UI 规范的受控映射) */
|
|
2993
|
+
/** 尺寸向量(像素数字或百分比/计算字符串),如 [320, 207] / ["50%", "100%"] */
|
|
2994
|
+
type Size2 = [number | string, number | string];
|
|
2995
|
+
/** 偏移向量 [x, y](像素) */
|
|
2996
|
+
type Offset2 = [number, number];
|
|
2997
|
+
/** 锚点(anchor_from / anchor_to)可选值 */
|
|
2998
|
+
type Anchor = 'top_left' | 'top_middle' | 'top_right' | 'left_middle' | 'center' | 'right_middle' | 'bottom_left' | 'bottom_middle' | 'bottom_right';
|
|
2999
|
+
/** 数据绑定类型 */
|
|
3000
|
+
type BindingType = 'global' | 'view' | 'collection' | 'collection_details' | 'none';
|
|
3001
|
+
/** 数据绑定条件 */
|
|
3002
|
+
type BindingCondition = 'always' | 'always_when_visible' | 'visible' | 'once' | 'none' | 'visibility_changed';
|
|
3003
|
+
/** 调制操作类型(Modifications.OPERATION 的字面量) */
|
|
3004
|
+
type ModificationOperation = 'insert_back' | 'insert_front' | 'insert_after' | 'insert_before' | 'move_back' | 'move_front' | 'move_after' | 'move_before' | 'swap' | 'replace' | 'remove';
|
|
3005
|
+
/** 支持任意键的 JSON UI 属性包(类内部索引签名基类型) */
|
|
3006
|
+
type JsonUIBag = {
|
|
3007
|
+
[key: string]: any;
|
|
3008
|
+
};
|
|
3009
|
+
|
|
3010
|
+
/**
|
|
3011
|
+
* DataBindingObject 类
|
|
3012
|
+
*
|
|
3013
|
+
* 该类表示数据绑定配置,用于将硬编码值或变量绑定到元素属性。
|
|
3014
|
+
*
|
|
3015
|
+
* 属性:
|
|
3016
|
+
* - ignored: boolean - 是否忽略绑定(默认值:false)
|
|
3017
|
+
* - binding_type: enum - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
3018
|
+
* - binding_name: string - 数据绑定名称或条件的值
|
|
3019
|
+
* - binding_name_override: string - 应用 binding_name 值的 UI 元素属性名称
|
|
3020
|
+
* - binding_collection_name: string - 要使用的集合名称
|
|
3021
|
+
* - binding_collection_prefix: string - 集合前缀
|
|
3022
|
+
* - binding_condition: enum - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
3023
|
+
* - source_control_name: string - 要观察其属性值的 UI 元素名称
|
|
3024
|
+
* - source_property_name: string - 存储 source_control_name 引用的 UI 元素的属性值
|
|
3025
|
+
* - target_property_name: string - 应用 source_property_name 值的 UI 元素属性
|
|
3026
|
+
* - resolve_sibling_scope: boolean - 是否允许选择同级元素而非子元素(默认值:false)
|
|
3027
|
+
*/
|
|
3028
|
+
|
|
3029
|
+
type BindingTypeOrString = BindingType | string;
|
|
3030
|
+
type BindingConditionOrString = BindingCondition | string;
|
|
3031
|
+
declare class DataBindingObject {
|
|
3032
|
+
[key: string]: unknown;
|
|
3033
|
+
ignored: boolean;
|
|
3034
|
+
binding_type: BindingTypeOrString;
|
|
3035
|
+
binding_name: string;
|
|
3036
|
+
binding_name_override: string;
|
|
3037
|
+
binding_collection_name: string;
|
|
3038
|
+
binding_collection_prefix: string;
|
|
3039
|
+
binding_condition: BindingConditionOrString;
|
|
3040
|
+
source_control_name: string;
|
|
3041
|
+
source_property_name: string;
|
|
3042
|
+
target_property_name: string;
|
|
3043
|
+
resolve_sibling_scope: boolean;
|
|
3044
|
+
/**
|
|
3045
|
+
* 设置是否忽略绑定。
|
|
3046
|
+
* @param {boolean} ignored - 是否忽略绑定(默认值:false)
|
|
3047
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3048
|
+
*/
|
|
3049
|
+
setIgnored(ignored?: boolean): this;
|
|
3050
|
+
/**
|
|
3051
|
+
* 设置绑定类型。
|
|
3052
|
+
* @param {BindingTypeOrString} type - 绑定类型(可能值:global, view, collection, collection_details, none)
|
|
3053
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3054
|
+
*/
|
|
3055
|
+
setBindingType(type: BindingTypeOrString): this;
|
|
3056
|
+
/**
|
|
3057
|
+
* 设置数据绑定名称或条件的值。
|
|
3058
|
+
* @param {string} name - 数据绑定名称或条件的值
|
|
3059
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3060
|
+
*/
|
|
3061
|
+
setBindingName(name: string): this;
|
|
3062
|
+
/**
|
|
3063
|
+
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
3064
|
+
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
3065
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3066
|
+
*/
|
|
3067
|
+
setBindingNameOverride(nameOverride: string): this;
|
|
3068
|
+
/**
|
|
3069
|
+
* 设置要使用的集合名称。
|
|
3070
|
+
* @param {string} collectionName - 集合名称
|
|
3071
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3072
|
+
*/
|
|
3073
|
+
setBindingCollectionName(collectionName: string): this;
|
|
3074
|
+
/**
|
|
3075
|
+
* 设置集合前缀。
|
|
3076
|
+
* @param {string} prefix - 集合前缀
|
|
3077
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3078
|
+
*/
|
|
3079
|
+
setBindingCollectionPrefix(prefix: string): this;
|
|
3080
|
+
/**
|
|
3081
|
+
* 设置数据绑定的条件。
|
|
3082
|
+
* @param {BindingConditionOrString} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
3083
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3084
|
+
*/
|
|
3085
|
+
setBindingCondition(condition: BindingConditionOrString): this;
|
|
3086
|
+
/**
|
|
3087
|
+
* 设置要观察其属性值的 UI 元素名称。
|
|
3088
|
+
* @param {string} controlName - UI 元素名称
|
|
3089
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3090
|
+
*/
|
|
3091
|
+
setSourceControlName(controlName: string): this;
|
|
3092
|
+
/**
|
|
3093
|
+
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
3094
|
+
* @param {string} propertyName - 属性名称
|
|
3095
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3096
|
+
*/
|
|
3097
|
+
setSourcePropertyName(propertyName: string): this;
|
|
3098
|
+
/**
|
|
3099
|
+
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
3100
|
+
* @param {string} propertyName - 属性名称
|
|
3101
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3102
|
+
*/
|
|
3103
|
+
setTargetPropertyName(propertyName: string): this;
|
|
3104
|
+
/**
|
|
3105
|
+
* 设置是否允许选择同级元素而非子元素。
|
|
3106
|
+
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
3107
|
+
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
3108
|
+
*/
|
|
3109
|
+
setResolveSiblingScope(resolve?: boolean): this;
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3112
|
+
declare class DataBinding {
|
|
3113
|
+
[key: string]: unknown;
|
|
3114
|
+
bindings: DataBindingObject[];
|
|
3115
|
+
binding: DataBindingObject;
|
|
3116
|
+
setBinding(binding: DataBindingObject): this;
|
|
3117
|
+
addDataBinding(dataBindingObject: DataBindingObject): this;
|
|
2991
3118
|
}
|
|
2992
3119
|
|
|
2993
3120
|
/**
|
|
@@ -3019,190 +3146,165 @@ declare class UISystem {
|
|
|
3019
3146
|
* - grid_position: Vector [row, column] - Position that the control will take inside the grid. This also allows to modify specific grid items of a hardcoded grid
|
|
3020
3147
|
* - collection_index: int - Index that the control takes in the collection
|
|
3021
3148
|
*/
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
* 该类表示一个具有各种属性和方法的 UI 控件元素,用于操作其状态。
|
|
3026
|
-
*
|
|
3027
|
-
* 属性:
|
|
3028
|
-
* - visible: boolean - 控制 UI 元素是否可见(默认值:true)
|
|
3029
|
-
* - enabled: boolean - 如果为 true,且 UI 元素或其任何子元素处于锁定状态,则它们将被锁定(默认值:true)
|
|
3030
|
-
* - layer: int - 相对于父元素的 Z-Index/层级(类似于 CSS 中的 zindex)。较高的层级将渲染在上方(默认值:0)
|
|
3031
|
-
* - alpha: float - 元素的透明度。仅影响 UI 元素本身,其子元素不受影响。如果希望透明度同时应用于父元素和子元素,请使用 propagate_alpha(默认值:1.0)
|
|
3032
|
-
* - propagate_alpha: boolean - 透明度是否应同时应用于父元素及其所有子元素(默认值:false)
|
|
3033
|
-
* - clips_children: boolean - 是否在视觉上和交互上裁剪超出 UI 元素边界的内容(默认值:false)
|
|
3034
|
-
* - allow_clipping: boolean - 是否允许在 UI 元素中启用裁剪。否则,clips_children 将无效(默认值:true)
|
|
3035
|
-
* - clip_offset: Vector [x, y] - 裁剪起始点的偏移量(默认值:[0, 0])
|
|
3036
|
-
* - clip_state_change_event: string - 裁剪状态更改时触发的事件
|
|
3037
|
-
* - enable_scissor_test: boolean - 是否启用裁剪测试(默认值:false)
|
|
3038
|
-
* - property_bag: object - 属性包,包含与数据相关的属性/变量,而不是 UI 元素的实际结构和外观
|
|
3039
|
-
* - selected: boolean - 文本框是否默认被选中
|
|
3040
|
-
* - use_child_anchors: boolean - 是否使用 UI 元素子元素的 anchor_from 和 anchor_to(默认值:false)
|
|
3041
|
-
* - controls: array - 用于向元素添加子元素
|
|
3042
|
-
* - anims: string[] - 动画名称数组
|
|
3043
|
-
* - disable_anim_fast_forward: boolean - 是否禁用动画快进
|
|
3044
|
-
* - animation_reset_name: string - 重置动画的名称
|
|
3045
|
-
* - ignored: boolean - 是否忽略该 UI 元素(默认值:false)
|
|
3046
|
-
* - variables: array 或 object - 一组条件,用于更改变量的值
|
|
3047
|
-
* - modifications: array - 允许修改资源包中的 UI 文件(最底层为原版资源包)
|
|
3048
|
-
* - grid_position: Vector [row, column] - 控件在网格中的位置。此属性还允许修改硬编码网格中的特定网格项
|
|
3049
|
-
* - collection_index: int - 控件在集合中的索引
|
|
3050
|
-
*/
|
|
3149
|
+
|
|
3150
|
+
/** 附加到 Control.controls 的子元素:可序列化元素对象或 JSON UI 控件对象 */
|
|
3151
|
+
type ChildControl = Record<string, unknown>;
|
|
3051
3152
|
declare class Control {
|
|
3153
|
+
[key: string]: unknown;
|
|
3154
|
+
visible: boolean;
|
|
3155
|
+
enabled: boolean;
|
|
3156
|
+
layer: number;
|
|
3157
|
+
alpha: number;
|
|
3158
|
+
propagate_alpha: boolean;
|
|
3159
|
+
clips_children: boolean;
|
|
3160
|
+
allow_clipping: boolean;
|
|
3161
|
+
clip_offset: Offset2;
|
|
3162
|
+
clip_state_change_event: string;
|
|
3163
|
+
enable_scissor_test: boolean;
|
|
3164
|
+
property_bag: JsonUIBag;
|
|
3165
|
+
selected: boolean;
|
|
3166
|
+
use_child_anchors: boolean;
|
|
3167
|
+
controls: ChildControl[];
|
|
3168
|
+
anims: string[];
|
|
3169
|
+
disable_anim_fast_forward: boolean;
|
|
3170
|
+
animation_reset_name: string;
|
|
3171
|
+
ignored: boolean;
|
|
3172
|
+
variables: JsonUIBag;
|
|
3173
|
+
modifications: unknown[];
|
|
3174
|
+
grid_position: Offset2;
|
|
3175
|
+
collection_index: number;
|
|
3052
3176
|
/**
|
|
3053
3177
|
* 设置控件的可见性。
|
|
3054
3178
|
* @param {boolean} visible - 控件是否可见(默认值:true)
|
|
3055
3179
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3056
3180
|
*/
|
|
3057
|
-
setVisible(visible?: boolean):
|
|
3058
|
-
visible: boolean | undefined;
|
|
3181
|
+
setVisible(visible?: boolean): this;
|
|
3059
3182
|
/**
|
|
3060
3183
|
* 设置控件的启用状态。
|
|
3061
3184
|
* @param {boolean} enabled - 控件是否启用(默认值:true)
|
|
3062
3185
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3063
3186
|
*/
|
|
3064
|
-
setEnabled(enabled?: boolean):
|
|
3065
|
-
enabled: boolean | undefined;
|
|
3187
|
+
setEnabled(enabled?: boolean): this;
|
|
3066
3188
|
/**
|
|
3067
3189
|
* 设置控件的层级(z-index)。
|
|
3068
3190
|
* @param {number} layer - 要设置的层级(默认值:0)
|
|
3069
3191
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3070
3192
|
*/
|
|
3071
|
-
setLayer(layer?: number):
|
|
3072
|
-
layer: number | undefined;
|
|
3193
|
+
setLayer(layer?: number): this;
|
|
3073
3194
|
/**
|
|
3074
3195
|
* 设置控件的透明度。
|
|
3075
3196
|
* @param {number} alpha - 要设置的透明度值(默认值:1.0)
|
|
3076
3197
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3077
3198
|
*/
|
|
3078
|
-
setAlpha(alpha?: number):
|
|
3079
|
-
alpha: number | undefined;
|
|
3199
|
+
setAlpha(alpha?: number): this;
|
|
3080
3200
|
/**
|
|
3081
3201
|
* 设置透明度是否应传播到子元素。
|
|
3082
3202
|
* @param {boolean} propagate - 透明度是否应传播(默认值:false)
|
|
3083
3203
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3084
3204
|
*/
|
|
3085
|
-
setPropagateAlpha(propagate?: boolean):
|
|
3086
|
-
propagate_alpha: boolean | undefined;
|
|
3205
|
+
setPropagateAlpha(propagate?: boolean): this;
|
|
3087
3206
|
/**
|
|
3088
3207
|
* 设置控件是否应裁剪其子元素。
|
|
3089
3208
|
* @param {boolean} clips - 控件是否应裁剪其子元素(默认值:false)
|
|
3090
3209
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3091
3210
|
*/
|
|
3092
|
-
setClipsChildren(clips?: boolean):
|
|
3093
|
-
clips_children: boolean | undefined;
|
|
3211
|
+
setClipsChildren(clips?: boolean): this;
|
|
3094
3212
|
/**
|
|
3095
3213
|
* 设置控件是否允许裁剪。
|
|
3096
3214
|
* @param {boolean} allow - 是否允许裁剪(默认值:true)
|
|
3097
3215
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3098
3216
|
*/
|
|
3099
|
-
setAllowClipping(allow?: boolean):
|
|
3100
|
-
allow_clipping: boolean | undefined;
|
|
3217
|
+
setAllowClipping(allow?: boolean): this;
|
|
3101
3218
|
/**
|
|
3102
3219
|
* 设置控件的裁剪偏移量。
|
|
3103
|
-
* @param {
|
|
3220
|
+
* @param {Offset2} offset - 裁剪偏移量,格式为 [x, y](默认值:[0, 0])
|
|
3104
3221
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3105
3222
|
*/
|
|
3106
|
-
setClipOffset(offset?:
|
|
3107
|
-
clip_offset: number[] | undefined;
|
|
3223
|
+
setClipOffset(offset?: Offset2): this;
|
|
3108
3224
|
/**
|
|
3109
3225
|
* 设置裁剪状态更改事件。
|
|
3110
3226
|
* @param {string} event - 裁剪状态更改时触发的事件名称
|
|
3111
3227
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3112
3228
|
*/
|
|
3113
|
-
setClipStateChangeEvent(event: string):
|
|
3114
|
-
clip_state_change_event: string | undefined;
|
|
3229
|
+
setClipStateChangeEvent(event: string): this;
|
|
3115
3230
|
/**
|
|
3116
3231
|
* 设置是否启用裁剪测试。
|
|
3117
3232
|
* @param {boolean} enable - 是否启用裁剪测试(默认值:false)
|
|
3118
3233
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3119
3234
|
*/
|
|
3120
|
-
setEnableScissorTest(enable?: boolean):
|
|
3121
|
-
enable_scissor_test: boolean | undefined;
|
|
3235
|
+
setEnableScissorTest(enable?: boolean): this;
|
|
3122
3236
|
/**
|
|
3123
3237
|
* 设置控件的属性包。
|
|
3124
|
-
* @param {
|
|
3238
|
+
* @param {JsonUIBag} bag - 要设置的属性包
|
|
3125
3239
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3126
3240
|
*/
|
|
3127
|
-
setPropertyBag(bag:
|
|
3128
|
-
property_bag: object | undefined;
|
|
3241
|
+
setPropertyBag(bag: JsonUIBag): this;
|
|
3129
3242
|
/**
|
|
3130
3243
|
* 设置控件是否被选中。
|
|
3131
3244
|
* @param {boolean} selected - 控件是否被选中(默认值:false)
|
|
3132
3245
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3133
3246
|
*/
|
|
3134
|
-
setSelected(selected?: boolean):
|
|
3135
|
-
selected: boolean | undefined;
|
|
3247
|
+
setSelected(selected?: boolean): this;
|
|
3136
3248
|
/**
|
|
3137
3249
|
* 设置控件是否使用子元素的锚点。
|
|
3138
3250
|
* @param {boolean} use - 是否使用子元素的锚点(默认值:false)
|
|
3139
3251
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3140
3252
|
*/
|
|
3141
|
-
setUseChildAnchors(use?: boolean):
|
|
3142
|
-
use_child_anchors: boolean | undefined;
|
|
3253
|
+
setUseChildAnchors(use?: boolean): this;
|
|
3143
3254
|
/**
|
|
3144
3255
|
* 向控件添加子控件。
|
|
3145
|
-
* @param {
|
|
3256
|
+
* @param {ChildControl} control - 要添加的子控件
|
|
3146
3257
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3147
3258
|
*/
|
|
3148
|
-
addControl(control:
|
|
3149
|
-
controls: any[] | undefined;
|
|
3259
|
+
addControl(control: ChildControl): this;
|
|
3150
3260
|
/**
|
|
3151
3261
|
* 设置控件的动画。
|
|
3152
3262
|
* @param {string[]} anims - 动画名称数组
|
|
3153
3263
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3154
3264
|
*/
|
|
3155
|
-
setAnimations(anims: string[]):
|
|
3156
|
-
anims: string[] | undefined;
|
|
3265
|
+
setAnimations(anims: string[]): this;
|
|
3157
3266
|
/**
|
|
3158
3267
|
* 设置是否禁用动画快进。
|
|
3159
3268
|
* @param {boolean} disable - 是否禁用动画快进(默认值:false)
|
|
3160
3269
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3161
3270
|
*/
|
|
3162
|
-
setDisableAnimFastForward(disable?: boolean):
|
|
3163
|
-
disable_anim_fast_forward: boolean | undefined;
|
|
3271
|
+
setDisableAnimFastForward(disable?: boolean): this;
|
|
3164
3272
|
/**
|
|
3165
3273
|
* 设置动画重置名称。
|
|
3166
3274
|
* @param {string} name - 要重置的动画名称
|
|
3167
3275
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3168
3276
|
*/
|
|
3169
|
-
setAnimationResetName(name: string):
|
|
3170
|
-
animation_reset_name: string | undefined;
|
|
3277
|
+
setAnimationResetName(name: string): this;
|
|
3171
3278
|
/**
|
|
3172
3279
|
* 设置是否忽略该控件。
|
|
3173
3280
|
* @param {boolean} ignored - 是否忽略该控件(默认值:false)
|
|
3174
3281
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3175
3282
|
*/
|
|
3176
|
-
setIgnored(ignored?: boolean):
|
|
3177
|
-
ignored: boolean | undefined;
|
|
3283
|
+
setIgnored(ignored?: boolean): this;
|
|
3178
3284
|
/**
|
|
3179
3285
|
* 设置控件的变量。
|
|
3180
|
-
* @param {
|
|
3286
|
+
* @param {JsonUIBag} variables - 要设置的变量
|
|
3181
3287
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3182
3288
|
*/
|
|
3183
|
-
setVariables(variables:
|
|
3184
|
-
variables: object | undefined;
|
|
3289
|
+
setVariables(variables: JsonUIBag): this;
|
|
3185
3290
|
/**
|
|
3186
3291
|
* 设置控件的修改项。
|
|
3187
|
-
* @param {
|
|
3292
|
+
* @param {unknown[]} modifications - 要设置的修改项
|
|
3188
3293
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3189
3294
|
*/
|
|
3190
|
-
setModifications(modifications:
|
|
3191
|
-
modifications: any;
|
|
3295
|
+
setModifications(modifications: unknown[]): this;
|
|
3192
3296
|
/**
|
|
3193
3297
|
* 设置控件在网格中的位置。
|
|
3194
|
-
* @param {
|
|
3298
|
+
* @param {Offset2} position - 网格位置,格式为 [行, 列]
|
|
3195
3299
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3196
3300
|
*/
|
|
3197
|
-
setGridPosition(position:
|
|
3198
|
-
grid_position: number[] | undefined;
|
|
3301
|
+
setGridPosition(position: Offset2): this;
|
|
3199
3302
|
/**
|
|
3200
3303
|
* 设置控件在集合中的索引。
|
|
3201
3304
|
* @param {number} index - 要设置的索引
|
|
3202
3305
|
* @returns {Control} 返回当前实例以支持链式调用
|
|
3203
3306
|
*/
|
|
3204
|
-
setCollectionIndex(index: number):
|
|
3205
|
-
collection_index: number | undefined;
|
|
3307
|
+
setCollectionIndex(index: number): this;
|
|
3206
3308
|
}
|
|
3207
3309
|
|
|
3208
3310
|
/**
|
|
@@ -3224,125 +3326,163 @@ declare class Control {
|
|
|
3224
3326
|
* - draggable: enum - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
3225
3327
|
* - follows_cursor: boolean - 是否使元素跟随光标(默认值:false)
|
|
3226
3328
|
*/
|
|
3329
|
+
|
|
3330
|
+
type AnchorOrString = Anchor | string;
|
|
3331
|
+
type SizeOrString = Size2 | string;
|
|
3227
3332
|
declare class Layout {
|
|
3333
|
+
[key: string]: unknown;
|
|
3334
|
+
size: SizeOrString;
|
|
3335
|
+
max_size: Size2;
|
|
3336
|
+
min_size: Size2;
|
|
3337
|
+
offset: Offset2;
|
|
3338
|
+
anchor_from: AnchorOrString;
|
|
3339
|
+
anchor_to: AnchorOrString;
|
|
3340
|
+
inherit_max_sibling_width: boolean;
|
|
3341
|
+
inherit_max_sibling_height: boolean;
|
|
3342
|
+
use_anchored_offset: boolean;
|
|
3343
|
+
contained: boolean;
|
|
3344
|
+
draggable: 'vertical' | 'horizontal' | 'both';
|
|
3345
|
+
follows_cursor: boolean;
|
|
3228
3346
|
/**
|
|
3229
3347
|
* 设置 UI 元素的大小。
|
|
3230
|
-
* @param {
|
|
3348
|
+
* @param {Size2} size - 大小,格式为 [width, height](默认值:["default", "default"])
|
|
3231
3349
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3232
3350
|
*/
|
|
3233
|
-
setSize(size?:
|
|
3234
|
-
size: any[] | undefined;
|
|
3351
|
+
setSize(size?: SizeOrString): this;
|
|
3235
3352
|
/**
|
|
3236
3353
|
* 设置 UI 元素的最大大小。
|
|
3237
|
-
* @param {
|
|
3354
|
+
* @param {Size2} maxSize - 最大大小,格式为 [width, height](默认值:["default", "default"])
|
|
3238
3355
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3239
3356
|
*/
|
|
3240
|
-
setMaxSize(maxSize?:
|
|
3241
|
-
max_size: string[] | undefined;
|
|
3357
|
+
setMaxSize(maxSize?: Size2): this;
|
|
3242
3358
|
/**
|
|
3243
3359
|
* 设置 UI 元素的最小大小。
|
|
3244
|
-
* @param {
|
|
3360
|
+
* @param {Size2} minSize - 最小大小,格式为 [width, height](默认值:["default", "default"])
|
|
3245
3361
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3246
3362
|
*/
|
|
3247
|
-
setMinSize(minSize?:
|
|
3248
|
-
min_size: string[] | undefined;
|
|
3363
|
+
setMinSize(minSize?: Size2): this;
|
|
3249
3364
|
/**
|
|
3250
3365
|
* 设置 UI 元素相对于父元素的位置。
|
|
3251
|
-
* @param {
|
|
3366
|
+
* @param {Offset2} offset - 偏移量,格式为 [x, y](默认值:[0, 0])
|
|
3252
3367
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3253
3368
|
*/
|
|
3254
|
-
setOffset(offset?:
|
|
3255
|
-
offset: number[] | undefined;
|
|
3369
|
+
setOffset(offset?: Offset2): this;
|
|
3256
3370
|
/**
|
|
3257
3371
|
* 设置父元素中的锚点。
|
|
3258
|
-
* @param {
|
|
3372
|
+
* @param {AnchorOrString} anchorFrom - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
3259
3373
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3260
3374
|
*/
|
|
3261
|
-
setAnchorFrom(anchorFrom?:
|
|
3262
|
-
anchor_from: string | undefined;
|
|
3375
|
+
setAnchorFrom(anchorFrom?: AnchorOrString): this;
|
|
3263
3376
|
/**
|
|
3264
3377
|
* 设置元素自身的锚点。
|
|
3265
|
-
* @param {
|
|
3378
|
+
* @param {AnchorOrString} anchorTo - 锚点(可能值:top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle, bottom_right)(默认值:center)
|
|
3266
3379
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3267
3380
|
*/
|
|
3268
|
-
setAnchorTo(anchorTo?:
|
|
3269
|
-
anchor_to: string | undefined;
|
|
3381
|
+
setAnchorTo(anchorTo?: AnchorOrString): this;
|
|
3270
3382
|
/**
|
|
3271
3383
|
* 设置是否使用兄弟元素的最大宽度。
|
|
3272
3384
|
* @param {boolean} inherit - 是否使用兄弟元素的最大宽度(默认值:false)
|
|
3273
3385
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3274
3386
|
*/
|
|
3275
|
-
setInheritMaxSiblingWidth(inherit?: boolean):
|
|
3276
|
-
inherit_max_sibling_width: boolean | undefined;
|
|
3387
|
+
setInheritMaxSiblingWidth(inherit?: boolean): this;
|
|
3277
3388
|
/**
|
|
3278
3389
|
* 设置是否使用兄弟元素的最大高度。
|
|
3279
3390
|
* @param {boolean} inherit - 是否使用兄弟元素的最大高度(默认值:false)
|
|
3280
3391
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3281
3392
|
*/
|
|
3282
|
-
setInheritMaxSiblingHeight(inherit?: boolean):
|
|
3283
|
-
inherit_max_sibling_height: boolean | undefined;
|
|
3393
|
+
setInheritMaxSiblingHeight(inherit?: boolean): this;
|
|
3284
3394
|
/**
|
|
3285
3395
|
* 设置是否使用基于锚点的偏移。
|
|
3286
3396
|
* @param {boolean} use - 是否使用基于锚点的偏移(默认值:false)
|
|
3287
3397
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3288
3398
|
*/
|
|
3289
|
-
setUseAnchoredOffset(use?: boolean):
|
|
3290
|
-
use_anchored_offset: boolean | undefined;
|
|
3399
|
+
setUseAnchoredOffset(use?: boolean): this;
|
|
3291
3400
|
/**
|
|
3292
3401
|
* 设置是否限制元素在父元素边界内。
|
|
3293
3402
|
* @param {boolean} contained - 是否限制元素在父元素边界内(默认值:false)
|
|
3294
3403
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3295
3404
|
*/
|
|
3296
|
-
setContained(contained?: boolean):
|
|
3297
|
-
contained: boolean | undefined;
|
|
3405
|
+
setContained(contained?: boolean): this;
|
|
3298
3406
|
/**
|
|
3299
3407
|
* 设置是否使元素可拖动。
|
|
3300
|
-
* @param {
|
|
3408
|
+
* @param {'vertical' | 'horizontal' | 'both'} draggable - 是否使元素可拖动(可能值:vertical, horizontal, both)
|
|
3301
3409
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3302
3410
|
*/
|
|
3303
|
-
setDraggable(draggable:
|
|
3304
|
-
draggable: string | undefined;
|
|
3411
|
+
setDraggable(draggable: 'vertical' | 'horizontal' | 'both'): this;
|
|
3305
3412
|
/**
|
|
3306
3413
|
* 设置是否使元素跟随光标。
|
|
3307
3414
|
* @param {boolean} follows - 是否使元素跟随光标(默认值:false)
|
|
3308
3415
|
* @returns {Layout} 返回当前实例以支持链式调用
|
|
3309
3416
|
*/
|
|
3310
|
-
setFollowsCursor(follows?: boolean):
|
|
3311
|
-
follows_cursor: boolean | undefined;
|
|
3417
|
+
setFollowsCursor(follows?: boolean): this;
|
|
3312
3418
|
}
|
|
3313
3419
|
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
}
|
|
3420
|
+
/**
|
|
3421
|
+
* Elements
|
|
3422
|
+
A JSON UI element is the basic form of data within JSON UI. Elements must have a unique name for each namespace so as to not have a conflict with other elements of the same name yet may have different functions.
|
|
3423
|
+
|
|
3424
|
+
Here the element type is label so it will render a text of Hello World when called:
|
|
3320
3425
|
|
|
3426
|
+
vanilla/ui/example_file.json
|
|
3427
|
+
|
|
3428
|
+
{
|
|
3429
|
+
"test_element": {
|
|
3430
|
+
"type": "label",
|
|
3431
|
+
"text": "Hello World"
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
Types
|
|
3435
|
+
The following are some of the element types, which are possible values for the type property:
|
|
3436
|
+
|
|
3437
|
+
label - for creating text objects
|
|
3438
|
+
image - for rendering images from a filepath provided
|
|
3439
|
+
button - for creating interactive and clickable elements
|
|
3440
|
+
panel - an empty container where you can store all other elements that may overlap to each other
|
|
3441
|
+
stack_panel - an empty container where you can store all other elements in a stack that doesn't overlap to each other
|
|
3442
|
+
grid - uses another element as a template, and then renders it repeatedly in multiple rows and columns
|
|
3443
|
+
factory - renders an element based off of another element, is capable of calling hardcoded values and variables
|
|
3444
|
+
custom - is paired with another property renderer which renders hardcoded JSON UI elements
|
|
3445
|
+
screen - elements that are called by the game directly, usually root panel elements
|
|
3446
|
+
*/
|
|
3447
|
+
|
|
3448
|
+
type SerializedElement = Record<string, JsonUIBag>;
|
|
3449
|
+
type AnyJSON = any;
|
|
3321
3450
|
declare class UIElement {
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
name: any;
|
|
3451
|
+
type: string | undefined;
|
|
3452
|
+
id: string;
|
|
3453
|
+
name: string;
|
|
3326
3454
|
control: Control;
|
|
3327
3455
|
layout: Layout;
|
|
3328
|
-
properties: Map<
|
|
3329
|
-
variables: Map<
|
|
3456
|
+
properties: Map<string, AnyJSON>;
|
|
3457
|
+
variables: Map<string, AnyJSON>;
|
|
3330
3458
|
dataBinding: DataBinding;
|
|
3331
|
-
modifications:
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3459
|
+
modifications: {
|
|
3460
|
+
array_name: string;
|
|
3461
|
+
operation: ModificationOperation;
|
|
3462
|
+
value: AnyJSON;
|
|
3463
|
+
}[];
|
|
3464
|
+
constructor(name: string, type?: string, template?: string);
|
|
3465
|
+
enableDebug(color?: [number, number, number, number]): this;
|
|
3466
|
+
setLayout(layout: Layout): this;
|
|
3467
|
+
setControl(control: Control): this;
|
|
3468
|
+
addControl(control: UIElement | JsonUIBag): this;
|
|
3469
|
+
addControls(controls: (UIElement | JsonUIBag)[]): this;
|
|
3470
|
+
addVariable(name: string, value: AnyJSON): this;
|
|
3471
|
+
addProp(name: string, value: AnyJSON): this;
|
|
3472
|
+
addModification(modification: {
|
|
3473
|
+
array_name: string;
|
|
3474
|
+
operation: ModificationOperation;
|
|
3475
|
+
value: AnyJSON;
|
|
3476
|
+
}): this;
|
|
3477
|
+
/**
|
|
3478
|
+
* 声明待序列化合并的属性包(子类覆写以加入自己的专属属性包)。
|
|
3479
|
+
* 合并顺序对结果无影响:重复键值均相同。
|
|
3480
|
+
*/
|
|
3481
|
+
protected serializableSources(): object[];
|
|
3482
|
+
serialize(): SerializedElement;
|
|
3343
3483
|
}
|
|
3344
3484
|
/**
|
|
3345
|
-
* Modifications
|
|
3485
|
+
* Modifications
|
|
3346
3486
|
To modify JSON UI in a non-intrusive way, you can use the modifications property to modify previously existing JSON UI elements from other packs (usually vanilla JSON UI files). Doing this makes sure only necessary parts are modified unless otherwise intended, to improve compatibility with other packs that modify the JSON UI.
|
|
3347
3487
|
|
|
3348
3488
|
Modification Description
|
|
@@ -3360,17 +3500,17 @@ declare class UIElement {
|
|
|
3360
3500
|
*/
|
|
3361
3501
|
declare class Modifications {
|
|
3362
3502
|
static OPERATION: Readonly<{
|
|
3363
|
-
INSERT_BACK: "insert_back";
|
|
3364
|
-
INSERT_FRONT: "insert_front";
|
|
3365
|
-
INSERT_AFTER: "insert_after";
|
|
3366
|
-
INSERT_BEFORE: "insert_before";
|
|
3367
|
-
MOVE_BACK: "move_back";
|
|
3368
|
-
MOVE_FRONT: "move_front";
|
|
3369
|
-
MOVE_AFTER: "move_after";
|
|
3370
|
-
MOVE_BEFORE: "move_before";
|
|
3371
|
-
SWAP: "swap";
|
|
3372
|
-
REPLACE: "replace";
|
|
3373
|
-
REMOVE: "remove";
|
|
3503
|
+
readonly INSERT_BACK: "insert_back";
|
|
3504
|
+
readonly INSERT_FRONT: "insert_front";
|
|
3505
|
+
readonly INSERT_AFTER: "insert_after";
|
|
3506
|
+
readonly INSERT_BEFORE: "insert_before";
|
|
3507
|
+
readonly MOVE_BACK: "move_back";
|
|
3508
|
+
readonly MOVE_FRONT: "move_front";
|
|
3509
|
+
readonly MOVE_AFTER: "move_after";
|
|
3510
|
+
readonly MOVE_BEFORE: "move_before";
|
|
3511
|
+
readonly SWAP: "swap";
|
|
3512
|
+
readonly REPLACE: "replace";
|
|
3513
|
+
readonly REMOVE: "remove";
|
|
3374
3514
|
}>;
|
|
3375
3515
|
}
|
|
3376
3516
|
|
|
@@ -3383,44 +3523,46 @@ declare class Modifications {
|
|
|
3383
3523
|
* - control_name: string - 工厂的子控件名
|
|
3384
3524
|
* - control_ids: object - 工厂的子控件 ID 对象组
|
|
3385
3525
|
*/
|
|
3526
|
+
|
|
3386
3527
|
declare class Factory {
|
|
3528
|
+
[key: string]: unknown;
|
|
3529
|
+
factory: JsonUIBag;
|
|
3387
3530
|
/**
|
|
3388
3531
|
* 设置工厂的名。
|
|
3389
3532
|
* @param {string} name - 名(格式:name)
|
|
3390
3533
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
3391
3534
|
*/
|
|
3392
|
-
setName(name: string):
|
|
3393
|
-
factory: {} | undefined;
|
|
3535
|
+
setName(name: string): this;
|
|
3394
3536
|
/**
|
|
3395
3537
|
* 设置工厂的子控件名。
|
|
3396
3538
|
* @param {string} name - 子控件名(格式:namespace.controls_name)
|
|
3397
3539
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
3398
3540
|
*/
|
|
3399
|
-
setControlName(name: string):
|
|
3541
|
+
setControlName(name: string): this;
|
|
3400
3542
|
/**
|
|
3401
3543
|
* 设置工厂的子控件 ID 对象组。
|
|
3402
|
-
* @param {
|
|
3544
|
+
* @param {JsonUIBag} ids - 子控件 ID 对象组
|
|
3403
3545
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
3404
3546
|
*/
|
|
3405
|
-
setControlIds(ids:
|
|
3547
|
+
setControlIds(ids: JsonUIBag): this;
|
|
3406
3548
|
/**
|
|
3407
3549
|
* 添加一个子控件 ID。
|
|
3408
3550
|
* @param {string} key - 子控件的键名
|
|
3409
3551
|
* @param {string} value - 子控件的 ID 值
|
|
3410
3552
|
* @returns {Factory} 返回当前实例以支持链式调用
|
|
3411
3553
|
*/
|
|
3412
|
-
addControlId(key: string, value: string):
|
|
3554
|
+
addControlId(key: string, value: string): this;
|
|
3413
3555
|
}
|
|
3414
3556
|
|
|
3415
3557
|
declare class Panel extends UIElement {
|
|
3558
|
+
factory: Factory;
|
|
3416
3559
|
/**
|
|
3417
|
-
*
|
|
3418
|
-
* @param {
|
|
3419
|
-
* @param {*} [template]
|
|
3560
|
+
* @param {string} id
|
|
3561
|
+
* @param {string} [template]
|
|
3420
3562
|
*/
|
|
3421
|
-
constructor(id:
|
|
3422
|
-
|
|
3423
|
-
|
|
3563
|
+
constructor(id: string, template?: string);
|
|
3564
|
+
setLayout(layout: Layout): this;
|
|
3565
|
+
protected serializableSources(): object[];
|
|
3424
3566
|
}
|
|
3425
3567
|
|
|
3426
3568
|
/**
|
|
@@ -3449,147 +3591,152 @@ declare class Panel extends UIElement {
|
|
|
3449
3591
|
* - force_texture_reload: boolean - 是否在纹理路径更改时强制重新加载图像
|
|
3450
3592
|
* - base_size: Vector [width, height] - 基础大小
|
|
3451
3593
|
*/
|
|
3594
|
+
type UV = [number, number];
|
|
3595
|
+
type ClipDirection = 'left' | 'right' | 'up' | 'down' | 'center';
|
|
3596
|
+
type TextureFileSystem = 'InUserPackage' | 'InAppPackage' | 'RawPath' | 'RawPersistent' | 'InSettingsDir' | 'InExternalDir' | 'InServerPackage' | 'InDataDir' | 'InUserDir' | 'InWorldDir' | 'StoreCache' | string;
|
|
3452
3597
|
declare class Sprite {
|
|
3598
|
+
[key: string]: unknown;
|
|
3599
|
+
texture: string;
|
|
3600
|
+
allow_debug_missing_texture: boolean;
|
|
3601
|
+
uv: UV;
|
|
3602
|
+
uv_size: UV;
|
|
3603
|
+
texture_file_system: TextureFileSystem;
|
|
3604
|
+
nineslice_size: number | [number, number, number, number];
|
|
3605
|
+
tiled: boolean | 'x' | 'y';
|
|
3606
|
+
tiled_scale: [number, number];
|
|
3607
|
+
clip_direction: ClipDirection | string;
|
|
3608
|
+
clip_ratio: number;
|
|
3609
|
+
clip_pixelperfect: boolean;
|
|
3610
|
+
keep_ratio: boolean;
|
|
3611
|
+
bilinear: boolean;
|
|
3612
|
+
fill: boolean;
|
|
3613
|
+
$fit_to_width: boolean;
|
|
3614
|
+
zip_folder: string;
|
|
3615
|
+
grayscale: boolean;
|
|
3616
|
+
force_texture_reload: boolean;
|
|
3617
|
+
base_size: [number, number];
|
|
3453
3618
|
/**
|
|
3454
3619
|
* 设置图像纹理路径。
|
|
3455
3620
|
* @param {string} texture - 图像路径(例如:"textures/ui/White")
|
|
3456
3621
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3457
3622
|
*/
|
|
3458
|
-
setTexture(texture: string):
|
|
3459
|
-
texture: string | undefined;
|
|
3623
|
+
setTexture(texture: string): this;
|
|
3460
3624
|
/**
|
|
3461
3625
|
* 设置是否在纹理未找到时显示缺失纹理。
|
|
3462
3626
|
* @param {boolean} allow - 是否显示缺失纹理(默认值:true)
|
|
3463
3627
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3464
3628
|
*/
|
|
3465
|
-
setAllowDebugMissingTexture(allow?: boolean):
|
|
3466
|
-
allow_debug_missing_texture: boolean | undefined;
|
|
3629
|
+
setAllowDebugMissingTexture(allow?: boolean): this;
|
|
3467
3630
|
/**
|
|
3468
3631
|
* 设置纹理映射的起始位置。
|
|
3469
|
-
* @param {
|
|
3632
|
+
* @param {UV} uv - 起始位置,格式为 [u, v]
|
|
3470
3633
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3471
3634
|
*/
|
|
3472
|
-
setUV(uv:
|
|
3473
|
-
uv: number[] | undefined;
|
|
3635
|
+
setUV(uv: UV): this;
|
|
3474
3636
|
/**
|
|
3475
3637
|
* 设置纹理映射的大小。
|
|
3476
|
-
* @param {
|
|
3638
|
+
* @param {UV} uvSize - 大小,格式为 [width, height]
|
|
3477
3639
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3478
3640
|
*/
|
|
3479
|
-
setUVSize(uvSize:
|
|
3480
|
-
uv_size: number[] | undefined;
|
|
3641
|
+
setUVSize(uvSize: UV): this;
|
|
3481
3642
|
/**
|
|
3482
3643
|
* 设置纹理来源。
|
|
3483
|
-
* @param {
|
|
3644
|
+
* @param {TextureFileSystem} source - 纹理来源(可能值:InUserPackage, InAppPackage 等)
|
|
3484
3645
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3485
3646
|
*/
|
|
3486
|
-
setTextureFileSystem(source?:
|
|
3487
|
-
texture_file_system: string | undefined;
|
|
3647
|
+
setTextureFileSystem(source?: TextureFileSystem): this;
|
|
3488
3648
|
/**
|
|
3489
3649
|
* 设置 9-slice 分割大小。
|
|
3490
|
-
* @param {number|number
|
|
3650
|
+
* @param {number | [number, number, number, number]} size - 9-slice 分割大小
|
|
3491
3651
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3492
3652
|
*/
|
|
3493
|
-
setNineSliceSize(size: number | number
|
|
3494
|
-
nineslice_size: number | number[] | undefined;
|
|
3653
|
+
setNineSliceSize(size: number | [number, number, number, number]): this;
|
|
3495
3654
|
/**
|
|
3496
3655
|
* 设置是否平铺纹理。
|
|
3497
|
-
* @param {boolean|
|
|
3656
|
+
* @param {boolean | 'x' | 'y'} tiled - 是否平铺纹理(可能值:true/false, x, y)
|
|
3498
3657
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3499
3658
|
*/
|
|
3500
|
-
setTiled(tiled: boolean |
|
|
3501
|
-
tiled: string | boolean | undefined;
|
|
3659
|
+
setTiled(tiled: boolean | 'x' | 'y'): this;
|
|
3502
3660
|
/**
|
|
3503
3661
|
* 设置平铺纹理的缩放比例。
|
|
3504
|
-
* @param {number
|
|
3662
|
+
* @param {[number, number]} scale - 缩放比例,格式为 [sX, sY](默认值:[1, 1])
|
|
3505
3663
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3506
3664
|
*/
|
|
3507
|
-
setTiledScale(scale?: number
|
|
3508
|
-
tiled_scale: number[] | undefined;
|
|
3665
|
+
setTiledScale(scale?: [number, number]): this;
|
|
3509
3666
|
/**
|
|
3510
3667
|
* 设置裁剪方向的起始点。
|
|
3511
|
-
* @param {
|
|
3668
|
+
* @param {ClipDirection} direction - 裁剪方向(可能值:left, right, up, down, center)
|
|
3512
3669
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3513
3670
|
*/
|
|
3514
|
-
setClipDirection(direction: string):
|
|
3515
|
-
clip_direction: string | undefined;
|
|
3671
|
+
setClipDirection(direction: ClipDirection | string): this;
|
|
3516
3672
|
/**
|
|
3517
3673
|
* 设置裁剪比例。
|
|
3518
3674
|
* @param {number} ratio - 裁剪比例(范围:0.0 到 1.0)
|
|
3519
3675
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3520
3676
|
*/
|
|
3521
|
-
setClipRatio(ratio: number):
|
|
3522
|
-
clip_ratio: number | undefined;
|
|
3677
|
+
setClipRatio(ratio: number): this;
|
|
3523
3678
|
/**
|
|
3524
3679
|
* 设置是否尽可能保持像素精确裁剪。
|
|
3525
3680
|
* @param {boolean} pixelPerfect - 是否保持像素精确裁剪
|
|
3526
3681
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3527
3682
|
*/
|
|
3528
|
-
setClipPixelPerfect(pixelPerfect?: boolean):
|
|
3529
|
-
clip_pixelperfect: boolean | undefined;
|
|
3683
|
+
setClipPixelPerfect(pixelPerfect?: boolean): this;
|
|
3530
3684
|
/**
|
|
3531
3685
|
* 设置是否在调整大小时保持比例。
|
|
3532
3686
|
* @param {boolean} keep - 是否保持比例(默认值:true)
|
|
3533
3687
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3534
3688
|
*/
|
|
3535
|
-
setKeepRatio(keep?: boolean):
|
|
3536
|
-
keep_ratio: boolean | undefined;
|
|
3689
|
+
setKeepRatio(keep?: boolean): this;
|
|
3537
3690
|
/**
|
|
3538
3691
|
* 设置是否在调整大小时使用双线性函数。
|
|
3539
3692
|
* @param {boolean} bilinear - 是否使用双线性函数(默认值:false)
|
|
3540
3693
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3541
3694
|
*/
|
|
3542
|
-
setBilinear(bilinear?: boolean):
|
|
3543
|
-
bilinear: boolean | undefined;
|
|
3695
|
+
setBilinear(bilinear?: boolean): this;
|
|
3544
3696
|
/**
|
|
3545
3697
|
* 设置是否拉伸图像以适应大小。
|
|
3546
3698
|
* @param {boolean} fill - 是否拉伸图像(默认值:false)
|
|
3547
3699
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3548
3700
|
*/
|
|
3549
|
-
setFill(fill?: boolean):
|
|
3550
|
-
fill: boolean | undefined;
|
|
3701
|
+
setFill(fill?: boolean): this;
|
|
3551
3702
|
/**
|
|
3552
3703
|
* 设置是否适应宽度。
|
|
3553
3704
|
* @param {boolean} fit - 是否适应宽度
|
|
3554
3705
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3555
3706
|
*/
|
|
3556
|
-
setFitToWidth(fit?: boolean):
|
|
3557
|
-
$fit_to_width: boolean | undefined;
|
|
3707
|
+
setFitToWidth(fit?: boolean): this;
|
|
3558
3708
|
/**
|
|
3559
3709
|
* 设置压缩文件夹路径。
|
|
3560
3710
|
* @param {string} folder - 压缩文件夹路径
|
|
3561
3711
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3562
3712
|
*/
|
|
3563
|
-
setZipFolder(folder: string):
|
|
3564
|
-
zip_folder: string | undefined;
|
|
3713
|
+
setZipFolder(folder: string): this;
|
|
3565
3714
|
/**
|
|
3566
3715
|
* 设置是否以黑白渲染图像。
|
|
3567
3716
|
* @param {boolean} grayscale - 是否以黑白渲染图像(默认值:false)
|
|
3568
3717
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3569
3718
|
*/
|
|
3570
|
-
setGrayscale(grayscale?: boolean):
|
|
3571
|
-
grayscale: boolean | undefined;
|
|
3719
|
+
setGrayscale(grayscale?: boolean): this;
|
|
3572
3720
|
/**
|
|
3573
3721
|
* 设置是否在纹理路径更改时强制重新加载图像。
|
|
3574
|
-
* @param {boolean} force -
|
|
3722
|
+
* @param {boolean} force - 是否强制重新加载图像(默认值:false)
|
|
3575
3723
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3576
3724
|
*/
|
|
3577
|
-
setForceTextureReload(force?: boolean):
|
|
3578
|
-
force_texture_reload: boolean | undefined;
|
|
3725
|
+
setForceTextureReload(force?: boolean): this;
|
|
3579
3726
|
/**
|
|
3580
3727
|
* 设置基础大小。
|
|
3581
|
-
* @param {number
|
|
3728
|
+
* @param {[number, number]} size - 基础大小,格式为 [width, height]
|
|
3582
3729
|
* @returns {Sprite} 返回当前实例以支持链式调用
|
|
3583
3730
|
*/
|
|
3584
|
-
setBaseSize(size: number
|
|
3585
|
-
base_size: number[] | undefined;
|
|
3731
|
+
setBaseSize(size: [number, number]): this;
|
|
3586
3732
|
}
|
|
3587
3733
|
|
|
3588
3734
|
declare class Image extends UIElement {
|
|
3589
|
-
constructor(id: any, template: any);
|
|
3590
3735
|
sprite: Sprite;
|
|
3591
3736
|
factory: Factory;
|
|
3592
|
-
|
|
3737
|
+
constructor(id: string, template?: string);
|
|
3738
|
+
setSprite(sprite: Sprite): this;
|
|
3739
|
+
protected serializableSources(): object[];
|
|
3593
3740
|
}
|
|
3594
3741
|
|
|
3595
3742
|
/**
|
|
@@ -3614,126 +3761,131 @@ declare class Image extends UIElement {
|
|
|
3614
3761
|
* - backup_font_type: enum - 备用字体类型(默认值:default)
|
|
3615
3762
|
* - text_alignment: enum - 文本对齐方式(未定义时根据 anchor_from 和 anchor_to 自动调整)
|
|
3616
3763
|
*/
|
|
3764
|
+
type RGB = [number, number, number];
|
|
3765
|
+
type FontSize = 'small' | 'normal' | 'large' | 'extra_large';
|
|
3766
|
+
type TextAlignment = 'left' | 'right' | 'center';
|
|
3617
3767
|
declare class Text {
|
|
3768
|
+
[key: string]: unknown;
|
|
3769
|
+
text: string;
|
|
3770
|
+
color: RGB;
|
|
3771
|
+
locked_color: RGB;
|
|
3772
|
+
shadow: boolean;
|
|
3773
|
+
hide_hyphen: boolean;
|
|
3774
|
+
notify_on_ellipses: string[];
|
|
3775
|
+
enable_profanity_filter: boolean;
|
|
3776
|
+
locked_alpha: number;
|
|
3777
|
+
font_size: FontSize;
|
|
3778
|
+
font_scale_factor: number;
|
|
3779
|
+
localize: boolean;
|
|
3780
|
+
line_padding: number;
|
|
3781
|
+
font_type: string;
|
|
3782
|
+
backup_font_type: string;
|
|
3783
|
+
text_alignment: TextAlignment;
|
|
3618
3784
|
/**
|
|
3619
3785
|
* 设置文本内容。
|
|
3620
3786
|
* @param {string} text - 文本内容
|
|
3621
3787
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3622
3788
|
*/
|
|
3623
|
-
setText(text?: string):
|
|
3624
|
-
text: string | undefined;
|
|
3789
|
+
setText(text?: string): this;
|
|
3625
3790
|
/**
|
|
3626
3791
|
* 设置文本颜色。
|
|
3627
|
-
* @param {
|
|
3792
|
+
* @param {RGB} color - RGB 颜色值(格式:[r, g, b],默认值:[1.0, 1.0, 1.0])
|
|
3628
3793
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3629
3794
|
*/
|
|
3630
|
-
setColor(color?:
|
|
3631
|
-
color: number[] | undefined;
|
|
3795
|
+
setColor(color?: RGB): this;
|
|
3632
3796
|
/**
|
|
3633
3797
|
* 设置父级禁用时的文本颜色。
|
|
3634
|
-
* @param {
|
|
3798
|
+
* @param {RGB} lockedColor - RGB 颜色值(格式:[r, g, b])
|
|
3635
3799
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3636
3800
|
*/
|
|
3637
|
-
setLockedColor(lockedColor:
|
|
3638
|
-
locked_color: number[] | undefined;
|
|
3801
|
+
setLockedColor(lockedColor: RGB): this;
|
|
3639
3802
|
/**
|
|
3640
3803
|
* 设置是否显示文本阴影。
|
|
3641
3804
|
* @param {boolean} shadow - 是否显示阴影(默认值:false)
|
|
3642
3805
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3643
3806
|
*/
|
|
3644
|
-
setShadow(shadow?: boolean):
|
|
3645
|
-
shadow: boolean | undefined;
|
|
3807
|
+
setShadow(shadow?: boolean): this;
|
|
3646
3808
|
/**
|
|
3647
3809
|
* 设置是否隐藏断词连字符。
|
|
3648
3810
|
* @param {boolean} hide - 是否隐藏连字符(默认值:false)
|
|
3649
3811
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3650
3812
|
*/
|
|
3651
|
-
setHideHyphen(hide?: boolean):
|
|
3652
|
-
hide_hyphen: boolean | undefined;
|
|
3813
|
+
setHideHyphen(hide?: boolean): this;
|
|
3653
3814
|
/**
|
|
3654
3815
|
* 设置文本出现省略号时需通知的控件名称数组。
|
|
3655
3816
|
* @param {string[]} controls - 控件名称数组
|
|
3656
3817
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3657
3818
|
*/
|
|
3658
|
-
setNotifyOnEllipses(controls: string[]):
|
|
3659
|
-
notify_on_ellipses: string[] | undefined;
|
|
3819
|
+
setNotifyOnEllipses(controls: string[]): this;
|
|
3660
3820
|
/**
|
|
3661
3821
|
* 添加一个需通知省略号事件的控件名称。
|
|
3662
3822
|
* @param {string} controlName - 控件名称
|
|
3663
3823
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3664
3824
|
*/
|
|
3665
|
-
addNotifyOnEllipses(controlName: string):
|
|
3825
|
+
addNotifyOnEllipses(controlName: string): this;
|
|
3666
3826
|
/**
|
|
3667
3827
|
* 设置是否启用脏话过滤。
|
|
3668
3828
|
* @param {boolean} enable - 是否启用过滤(默认值:false)
|
|
3669
3829
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3670
3830
|
*/
|
|
3671
|
-
setEnableProfanityFilter(enable?: boolean):
|
|
3672
|
-
enable_profanity_filter: boolean | undefined;
|
|
3831
|
+
setEnableProfanityFilter(enable?: boolean): this;
|
|
3673
3832
|
/**
|
|
3674
3833
|
* 设置父级禁用时的透明度。
|
|
3675
3834
|
* @param {number} alpha - 透明度(范围:0.0 到 1.0)
|
|
3676
3835
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3677
3836
|
*/
|
|
3678
|
-
setLockedAlpha(alpha: number):
|
|
3679
|
-
locked_alpha: number | undefined;
|
|
3837
|
+
setLockedAlpha(alpha: number): this;
|
|
3680
3838
|
/**
|
|
3681
3839
|
* 设置字体大小。
|
|
3682
|
-
* @param {
|
|
3840
|
+
* @param {FontSize} size - 字体大小(可能值:small, normal, large, extra_large,默认值:normal)
|
|
3683
3841
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3684
3842
|
*/
|
|
3685
|
-
setFontSize(size?:
|
|
3686
|
-
font_size: string | undefined;
|
|
3843
|
+
setFontSize(size?: FontSize): this;
|
|
3687
3844
|
/**
|
|
3688
3845
|
* 设置字体缩放比例。
|
|
3689
3846
|
* @param {number} factor - 缩放比例(默认值:1.0)
|
|
3690
3847
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3691
3848
|
*/
|
|
3692
|
-
setFontScaleFactor(factor?: number):
|
|
3693
|
-
font_scale_factor: number | undefined;
|
|
3849
|
+
setFontScaleFactor(factor?: number): this;
|
|
3694
3850
|
/**
|
|
3695
3851
|
* 设置是否启用本地化翻译。
|
|
3696
3852
|
* @param {boolean} localize - 是否启用本地化(默认值:false)
|
|
3697
3853
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3698
3854
|
*/
|
|
3699
|
-
setLocalize(localize?: boolean):
|
|
3700
|
-
localize: boolean | undefined;
|
|
3855
|
+
setLocalize(localize?: boolean): this;
|
|
3701
3856
|
/**
|
|
3702
3857
|
* 设置行间距。
|
|
3703
3858
|
* @param {number} padding - 行间距
|
|
3704
3859
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3705
3860
|
*/
|
|
3706
|
-
setLinePadding(padding: number):
|
|
3707
|
-
line_padding: number | undefined;
|
|
3861
|
+
setLinePadding(padding: number): this;
|
|
3708
3862
|
/**
|
|
3709
3863
|
* 设置字体类型。
|
|
3710
3864
|
* @param {string} font - 字体类型(可能值:default, rune, unicode 等,默认值:default)
|
|
3711
3865
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3712
3866
|
*/
|
|
3713
|
-
setFontType(font?: string):
|
|
3714
|
-
font_type: string | undefined;
|
|
3867
|
+
setFontType(font?: string): this;
|
|
3715
3868
|
/**
|
|
3716
3869
|
* 设置备用字体类型。
|
|
3717
3870
|
* @param {string} backupFont - 备用字体类型(默认值:default)
|
|
3718
3871
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3719
3872
|
*/
|
|
3720
|
-
setBackupFontType(backupFont?: string):
|
|
3721
|
-
backup_font_type: string | undefined;
|
|
3873
|
+
setBackupFontType(backupFont?: string): this;
|
|
3722
3874
|
/**
|
|
3723
3875
|
* 设置文本对齐方式。
|
|
3724
|
-
* @param {
|
|
3876
|
+
* @param {TextAlignment} alignment - 对齐方式(例如:left, right, center)
|
|
3725
3877
|
* @returns {Text} 返回当前实例以支持链式调用
|
|
3726
3878
|
*/
|
|
3727
|
-
setTextAlignment(alignment:
|
|
3728
|
-
text_alignment: string | undefined;
|
|
3879
|
+
setTextAlignment(alignment: TextAlignment): this;
|
|
3729
3880
|
}
|
|
3730
3881
|
|
|
3731
3882
|
declare class Label extends UIElement {
|
|
3732
|
-
constructor(id: any, template: any);
|
|
3733
3883
|
text: Text;
|
|
3734
3884
|
factory: Factory;
|
|
3735
|
-
|
|
3736
|
-
|
|
3885
|
+
constructor(id: string, template?: string);
|
|
3886
|
+
setLayout(layout: Layout): this;
|
|
3887
|
+
setText(text: Text): this;
|
|
3888
|
+
protected serializableSources(): object[];
|
|
3737
3889
|
}
|
|
3738
3890
|
|
|
3739
3891
|
declare namespace UiAPI {
|
|
@@ -4115,7 +4267,8 @@ declare class ItemComponent {
|
|
|
4115
4267
|
* - handle_deselect: boolean - 是否处理取消选择事件
|
|
4116
4268
|
* - button_up_right_of_first_refusal: boolean - 是否在首次拒绝后处理按钮释放事件
|
|
4117
4269
|
*/
|
|
4118
|
-
declare class ButtonMapping
|
|
4270
|
+
declare class ButtonMapping {
|
|
4271
|
+
[key: string]: unknown;
|
|
4119
4272
|
ignored: boolean;
|
|
4120
4273
|
from_button_id: string;
|
|
4121
4274
|
to_button_id: string;
|
|
@@ -4127,170 +4280,113 @@ declare class ButtonMapping$1 {
|
|
|
4127
4280
|
handle_select: boolean;
|
|
4128
4281
|
handle_deselect: boolean;
|
|
4129
4282
|
button_up_right_of_first_refusal: boolean;
|
|
4283
|
+
constructor();
|
|
4130
4284
|
/**
|
|
4131
4285
|
* 设置是否忽略映射。
|
|
4132
4286
|
* @param {boolean} ignored - 是否忽略映射(默认值:false)
|
|
4133
4287
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4134
4288
|
*/
|
|
4135
|
-
setIgnored(ignored?: boolean):
|
|
4289
|
+
setIgnored(ignored?: boolean): this;
|
|
4136
4290
|
/**
|
|
4137
4291
|
* 设置触发事件的按钮 ID。
|
|
4138
4292
|
* @param {string} fromButtonId - 触发事件的按钮 ID
|
|
4139
4293
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4140
4294
|
*/
|
|
4141
|
-
setFromButtonId(fromButtonId: string):
|
|
4295
|
+
setFromButtonId(fromButtonId: string): this;
|
|
4142
4296
|
/**
|
|
4143
4297
|
* 设置事件触发时执行的按钮 ID。
|
|
4144
4298
|
* @param {string} toButtonId - 事件触发时执行的按钮 ID
|
|
4145
4299
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4146
4300
|
*/
|
|
4147
|
-
setToButtonId(toButtonId: string):
|
|
4301
|
+
setToButtonId(toButtonId: string): this;
|
|
4148
4302
|
/**
|
|
4149
4303
|
* 设置映射类型。
|
|
4150
4304
|
* @param {string} mappingType - 映射类型(可能值:global, pressed, double_pressed, focused)
|
|
4151
4305
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4152
4306
|
*/
|
|
4153
|
-
setMappingType(mappingType: string):
|
|
4307
|
+
setMappingType(mappingType: string): this;
|
|
4154
4308
|
/**
|
|
4155
4309
|
* 设置映射范围。
|
|
4156
4310
|
* @param {string} scope - 映射范围(可能值:view, controller)
|
|
4157
4311
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4158
4312
|
*/
|
|
4159
|
-
setScope(scope: string):
|
|
4313
|
+
setScope(scope: string): this;
|
|
4160
4314
|
/**
|
|
4161
4315
|
* 设置输入模式条件。
|
|
4162
4316
|
* @param {string} condition - 输入模式条件(可能值:not_gaze, not_gamepad, gamepad_and_not_gaze)
|
|
4163
4317
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4164
4318
|
*/
|
|
4165
|
-
setInputModeCondition(condition: string):
|
|
4319
|
+
setInputModeCondition(condition: string): this;
|
|
4166
4320
|
/**
|
|
4167
4321
|
* 设置是否忽略输入范围。
|
|
4168
4322
|
* @param {boolean} ignore - 是否忽略输入范围
|
|
4169
4323
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4170
4324
|
*/
|
|
4171
|
-
setIgnoreInputScope(ignore?: boolean):
|
|
4325
|
+
setIgnoreInputScope(ignore?: boolean): this;
|
|
4172
4326
|
/**
|
|
4173
4327
|
* 设置是否消耗事件。
|
|
4174
4328
|
* @param {boolean} consume - 是否消耗事件
|
|
4175
4329
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4176
4330
|
*/
|
|
4177
|
-
setConsumeEvent(consume?: boolean):
|
|
4331
|
+
setConsumeEvent(consume?: boolean): this;
|
|
4178
4332
|
/**
|
|
4179
4333
|
* 设置是否处理选择事件。
|
|
4180
4334
|
* @param {boolean} handle - 是否处理选择事件
|
|
4181
4335
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4182
4336
|
*/
|
|
4183
|
-
setHandleSelect(handle?: boolean):
|
|
4337
|
+
setHandleSelect(handle?: boolean): this;
|
|
4184
4338
|
/**
|
|
4185
4339
|
* 设置是否处理取消选择事件。
|
|
4186
4340
|
* @param {boolean} handle - 是否处理取消选择事件
|
|
4187
4341
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4188
4342
|
*/
|
|
4189
|
-
setHandleDeselect(handle?: boolean):
|
|
4343
|
+
setHandleDeselect(handle?: boolean): this;
|
|
4190
4344
|
/**
|
|
4191
4345
|
* 设置是否在首次拒绝后处理按钮释放事件。
|
|
4192
4346
|
* @param {boolean} handle - 是否处理按钮释放事件
|
|
4193
4347
|
* @returns {ButtonMapping} 返回当前实例以支持链式调用
|
|
4194
4348
|
*/
|
|
4195
|
-
setButtonUpRightOfFirstRefusal(handle?: boolean):
|
|
4349
|
+
setButtonUpRightOfFirstRefusal(handle?: boolean): this;
|
|
4196
4350
|
}
|
|
4197
4351
|
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
setBindingName(name: string): DataBindingObject;
|
|
4237
|
-
binding_name: string | undefined;
|
|
4238
|
-
/**
|
|
4239
|
-
* 设置应用 binding_name 值的 UI 元素属性名称。
|
|
4240
|
-
* @param {string} nameOverride - 应用 binding_name 值的 UI 元素属性名称
|
|
4241
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4242
|
-
*/
|
|
4243
|
-
setBindingNameOverride(nameOverride: string): DataBindingObject;
|
|
4244
|
-
binding_name_override: string | undefined;
|
|
4245
|
-
/**
|
|
4246
|
-
* 设置要使用的集合名称。
|
|
4247
|
-
* @param {string} collectionName - 集合名称
|
|
4248
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4249
|
-
*/
|
|
4250
|
-
setBindingCollectionName(collectionName: string): DataBindingObject;
|
|
4251
|
-
binding_collection_name: string | undefined;
|
|
4252
|
-
/**
|
|
4253
|
-
* 设置集合前缀。
|
|
4254
|
-
* @param {string} prefix - 集合前缀
|
|
4255
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4256
|
-
*/
|
|
4257
|
-
setBindingCollectionPrefix(prefix: string): DataBindingObject;
|
|
4258
|
-
binding_collection_prefix: string | undefined;
|
|
4259
|
-
/**
|
|
4260
|
-
* 设置数据绑定的条件。
|
|
4261
|
-
* @param {string} condition - 数据绑定的条件(可能值:always, always_when_visible, visible, once, none, visibility_changed)
|
|
4262
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4263
|
-
*/
|
|
4264
|
-
setBindingCondition(condition: string): DataBindingObject;
|
|
4265
|
-
binding_condition: string | undefined;
|
|
4266
|
-
/**
|
|
4267
|
-
* 设置要观察其属性值的 UI 元素名称。
|
|
4268
|
-
* @param {string} controlName - UI 元素名称
|
|
4269
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4270
|
-
*/
|
|
4271
|
-
setSourceControlName(controlName: string): DataBindingObject;
|
|
4272
|
-
source_control_name: string | undefined;
|
|
4273
|
-
/**
|
|
4274
|
-
* 设置存储 source_control_name 引用的 UI 元素的属性值。
|
|
4275
|
-
* @param {string} propertyName - 属性名称
|
|
4276
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4277
|
-
*/
|
|
4278
|
-
setSourcePropertyName(propertyName: string): DataBindingObject;
|
|
4279
|
-
source_property_name: string | undefined;
|
|
4280
|
-
/**
|
|
4281
|
-
* 设置应用 source_property_name 值的 UI 元素属性。
|
|
4282
|
-
* @param {string} propertyName - 属性名称
|
|
4283
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4284
|
-
*/
|
|
4285
|
-
setTargetPropertyName(propertyName: string): DataBindingObject;
|
|
4286
|
-
target_property_name: string | undefined;
|
|
4287
|
-
/**
|
|
4288
|
-
* 设置是否允许选择同级元素而非子元素。
|
|
4289
|
-
* @param {boolean} resolve - 是否允许选择同级元素(默认值:false)
|
|
4290
|
-
* @returns {DataBindingObject} 返回当前实例以支持链式调用
|
|
4291
|
-
*/
|
|
4292
|
-
setResolveSiblingScope(resolve?: boolean): DataBindingObject;
|
|
4293
|
-
resolve_sibling_scope: boolean | undefined;
|
|
4352
|
+
interface ProgressBarLayer {
|
|
4353
|
+
color: [number, number, number];
|
|
4354
|
+
clipRatio: number;
|
|
4355
|
+
}
|
|
4356
|
+
interface HudProgressBarOptions {
|
|
4357
|
+
id: string;
|
|
4358
|
+
texture: string;
|
|
4359
|
+
uv?: [number, number];
|
|
4360
|
+
uvSize?: [number, number];
|
|
4361
|
+
barSize?: [string | number, string | number];
|
|
4362
|
+
layers: ProgressBarLayer[];
|
|
4363
|
+
states: number;
|
|
4364
|
+
fillColor?: [number, number, number];
|
|
4365
|
+
fillUv?: [number, number];
|
|
4366
|
+
segments?: {
|
|
4367
|
+
count: number;
|
|
4368
|
+
color: [number, number, number];
|
|
4369
|
+
};
|
|
4370
|
+
hudSize?: [string | number, string | number];
|
|
4371
|
+
anchorFrom?: string;
|
|
4372
|
+
anchorTo?: string;
|
|
4373
|
+
offset?: [number, number];
|
|
4374
|
+
clipDirection?: string;
|
|
4375
|
+
}
|
|
4376
|
+
declare class HudProgressBar {
|
|
4377
|
+
private panel;
|
|
4378
|
+
private options;
|
|
4379
|
+
constructor(options: HudProgressBarOptions);
|
|
4380
|
+
private build;
|
|
4381
|
+
getPanel(): Panel;
|
|
4382
|
+
mountToHud(): void;
|
|
4383
|
+
}
|
|
4384
|
+
|
|
4385
|
+
type AnyUI = any;
|
|
4386
|
+
declare class UISystemRegistry {
|
|
4387
|
+
#private;
|
|
4388
|
+
static registerUISystem(ui_system: AnyUI): void;
|
|
4389
|
+
static addOuterUIdefs(ui_defs: string[]): void;
|
|
4294
4390
|
}
|
|
4295
4391
|
|
|
4296
4392
|
/**
|
|
@@ -4311,84 +4407,86 @@ declare class DataBindingObject {
|
|
|
4311
4407
|
* - consume_hover_events: boolean - 是否消耗悬停事件
|
|
4312
4408
|
* - gesture_tracking_button: string - 手势跟踪按钮
|
|
4313
4409
|
*/
|
|
4410
|
+
|
|
4314
4411
|
declare class Input {
|
|
4412
|
+
[key: string]: unknown;
|
|
4413
|
+
button_mappings: JsonUIBag[];
|
|
4414
|
+
modal: boolean;
|
|
4415
|
+
inline_modal: boolean;
|
|
4416
|
+
always_listen_to_input: boolean;
|
|
4417
|
+
always_handle_pointer: boolean;
|
|
4418
|
+
always_handle_controller_direction: boolean;
|
|
4419
|
+
hover_enabled: boolean;
|
|
4420
|
+
prevent_touch_input: boolean;
|
|
4421
|
+
consume_event: boolean;
|
|
4422
|
+
consume_hover_events: boolean;
|
|
4423
|
+
gesture_tracking_button: string;
|
|
4315
4424
|
/**
|
|
4316
4425
|
* 设置按钮映射配置。
|
|
4317
|
-
* @param {
|
|
4426
|
+
* @param {JsonUIBag[]} mappings - 按钮映射配置数组
|
|
4318
4427
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4319
4428
|
*/
|
|
4320
|
-
setButtonMappings(mappings:
|
|
4321
|
-
button_mappings: ButtonMapping[] | undefined;
|
|
4429
|
+
setButtonMappings(mappings: JsonUIBag[]): this;
|
|
4322
4430
|
/**
|
|
4323
4431
|
* 设置是否为模态输入。
|
|
4324
4432
|
* @param {boolean} modal - 是否为模态输入
|
|
4325
4433
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4326
4434
|
*/
|
|
4327
|
-
setModal(modal?: boolean):
|
|
4328
|
-
modal: boolean | undefined;
|
|
4435
|
+
setModal(modal?: boolean): this;
|
|
4329
4436
|
/**
|
|
4330
4437
|
* 设置是否为内联模态输入。
|
|
4331
4438
|
* @param {boolean} inlineModal - 是否为内联模态输入
|
|
4332
4439
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4333
4440
|
*/
|
|
4334
|
-
setInlineModal(inlineModal?: boolean):
|
|
4335
|
-
inline_modal: boolean | undefined;
|
|
4441
|
+
setInlineModal(inlineModal?: boolean): this;
|
|
4336
4442
|
/**
|
|
4337
4443
|
* 设置是否始终监听输入。
|
|
4338
4444
|
* @param {boolean} alwaysListen - 是否始终监听输入
|
|
4339
4445
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4340
4446
|
*/
|
|
4341
|
-
setAlwaysListenToInput(alwaysListen?: boolean):
|
|
4342
|
-
always_listen_to_input: boolean | undefined;
|
|
4447
|
+
setAlwaysListenToInput(alwaysListen?: boolean): this;
|
|
4343
4448
|
/**
|
|
4344
4449
|
* 设置是否始终处理指针事件。
|
|
4345
4450
|
* @param {boolean} alwaysHandle - 是否始终处理指针事件
|
|
4346
4451
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4347
4452
|
*/
|
|
4348
|
-
setAlwaysHandlePointer(alwaysHandle?: boolean):
|
|
4349
|
-
always_handle_pointer: boolean | undefined;
|
|
4453
|
+
setAlwaysHandlePointer(alwaysHandle?: boolean): this;
|
|
4350
4454
|
/**
|
|
4351
4455
|
* 设置是否始终处理控制器方向事件。
|
|
4352
4456
|
* @param {boolean} alwaysHandle - 是否始终处理控制器方向事件
|
|
4353
4457
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4354
4458
|
*/
|
|
4355
|
-
setAlwaysHandleControllerDirection(alwaysHandle?: boolean):
|
|
4356
|
-
always_handle_controller_direction: boolean | undefined;
|
|
4459
|
+
setAlwaysHandleControllerDirection(alwaysHandle?: boolean): this;
|
|
4357
4460
|
/**
|
|
4358
4461
|
* 设置是否启用悬停事件。
|
|
4359
4462
|
* @param {boolean} enabled - 是否启用悬停事件
|
|
4360
4463
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4361
4464
|
*/
|
|
4362
|
-
setHoverEnabled(enabled?: boolean):
|
|
4363
|
-
hover_enabled: boolean | undefined;
|
|
4465
|
+
setHoverEnabled(enabled?: boolean): this;
|
|
4364
4466
|
/**
|
|
4365
4467
|
* 设置是否阻止触摸输入。
|
|
4366
4468
|
* @param {boolean} prevent - 是否阻止触摸输入
|
|
4367
4469
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4368
4470
|
*/
|
|
4369
|
-
setPreventTouchInput(prevent?: boolean):
|
|
4370
|
-
prevent_touch_input: boolean | undefined;
|
|
4471
|
+
setPreventTouchInput(prevent?: boolean): this;
|
|
4371
4472
|
/**
|
|
4372
4473
|
* 设置是否消耗事件。
|
|
4373
4474
|
* @param {boolean} consume - 是否消耗事件
|
|
4374
4475
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4375
4476
|
*/
|
|
4376
|
-
setConsumeEvent(consume?: boolean):
|
|
4377
|
-
consume_event: boolean | undefined;
|
|
4477
|
+
setConsumeEvent(consume?: boolean): this;
|
|
4378
4478
|
/**
|
|
4379
4479
|
* 设置是否消耗悬停事件。
|
|
4380
4480
|
* @param {boolean} consume - 是否消耗悬停事件
|
|
4381
4481
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4382
4482
|
*/
|
|
4383
|
-
setConsumeHoverEvents(consume?: boolean):
|
|
4384
|
-
consume_hover_events: boolean | undefined;
|
|
4483
|
+
setConsumeHoverEvents(consume?: boolean): this;
|
|
4385
4484
|
/**
|
|
4386
4485
|
* 设置手势跟踪按钮。
|
|
4387
4486
|
* @param {string} button - 手势跟踪按钮
|
|
4388
4487
|
* @returns {Input} 返回当前实例以支持链式调用
|
|
4389
4488
|
*/
|
|
4390
|
-
setGestureTrackingButton(button: string):
|
|
4391
|
-
gesture_tracking_button: string | undefined;
|
|
4489
|
+
setGestureTrackingButton(button: string): this;
|
|
4392
4490
|
}
|
|
4393
4491
|
|
|
4394
4492
|
/**
|
|
@@ -4402,62 +4500,75 @@ declare class Input {
|
|
|
4402
4500
|
* - sound_pitch: float - 声音音调(默认值:1.0)
|
|
4403
4501
|
* - sounds: Array of sound objects - 触发事件时播放的声音数组
|
|
4404
4502
|
*/
|
|
4503
|
+
|
|
4405
4504
|
declare class Sound {
|
|
4505
|
+
[key: string]: unknown;
|
|
4506
|
+
sound_name: string;
|
|
4507
|
+
sound_volume: number;
|
|
4508
|
+
sound_pitch: number;
|
|
4509
|
+
sounds: JsonUIBag[];
|
|
4406
4510
|
/**
|
|
4407
4511
|
* 设置声音名称。
|
|
4408
4512
|
* @param {string} name - 声音名称(定义在 RP/sounds/sound_definitions.json 文件中)
|
|
4409
4513
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
4410
4514
|
*/
|
|
4411
|
-
setSoundName(name: string):
|
|
4412
|
-
sound_name: string | undefined;
|
|
4515
|
+
setSoundName(name: string): this;
|
|
4413
4516
|
/**
|
|
4414
4517
|
* 设置声音音量。
|
|
4415
4518
|
* @param {number} volume - 音量(范围:0.0 到 1.0,默认值:1.0)
|
|
4416
4519
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
4417
4520
|
*/
|
|
4418
|
-
setSoundVolume(volume?: number):
|
|
4419
|
-
sound_volume: number | undefined;
|
|
4521
|
+
setSoundVolume(volume?: number): this;
|
|
4420
4522
|
/**
|
|
4421
4523
|
* 设置声音音调。
|
|
4422
4524
|
* @param {number} pitch - 音调(默认值:1.0)
|
|
4423
4525
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
4424
4526
|
*/
|
|
4425
|
-
setSoundPitch(pitch?: number):
|
|
4426
|
-
sound_pitch: number | undefined;
|
|
4527
|
+
setSoundPitch(pitch?: number): this;
|
|
4427
4528
|
/**
|
|
4428
4529
|
* 设置触发事件时播放的声音数组。
|
|
4429
|
-
* @param {
|
|
4530
|
+
* @param {JsonUIBag[]} sounds - 声音对象数组
|
|
4430
4531
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
4431
4532
|
*/
|
|
4432
|
-
setSounds(sounds:
|
|
4433
|
-
sounds: object[] | undefined;
|
|
4533
|
+
setSounds(sounds: JsonUIBag[]): this;
|
|
4434
4534
|
/**
|
|
4435
4535
|
* 添加一个声音对象到声音数组。
|
|
4436
|
-
* @param {
|
|
4536
|
+
* @param {JsonUIBag} sound - 声音对象
|
|
4437
4537
|
* @returns {Sound} 返回当前实例以支持链式调用
|
|
4438
4538
|
*/
|
|
4439
|
-
addSound(sound:
|
|
4539
|
+
addSound(sound: JsonUIBag): this;
|
|
4440
4540
|
}
|
|
4441
4541
|
|
|
4542
|
+
/**
|
|
4543
|
+
* Button
|
|
4544
|
+
Property Name Type Default Value Description
|
|
4545
|
+
default_control string Name of the child control that will be displayed only in the default state
|
|
4546
|
+
hover_control string Name of the child control that will be displayed only in the hover state
|
|
4547
|
+
pressed_control string Name of the child control that will be displayed only in the pressed state
|
|
4548
|
+
locked_control string Name of the child control that will be displayed only in the locked state
|
|
4549
|
+
*/
|
|
4550
|
+
|
|
4442
4551
|
declare class Button extends UIElement {
|
|
4443
|
-
constructor(id: any, template: any);
|
|
4444
4552
|
input: Input;
|
|
4445
4553
|
sound: Sound;
|
|
4446
4554
|
factory: Factory;
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4555
|
+
constructor(id: string, template?: string);
|
|
4556
|
+
setDefaultControl(default_control: string): this;
|
|
4557
|
+
setHoverControl(hover_control: string): this;
|
|
4558
|
+
setPressedControl(pressed_control: string): this;
|
|
4559
|
+
setLockedControl(locked_control: string): this;
|
|
4560
|
+
setInput(input: Input): this;
|
|
4561
|
+
setSound(sound: Sound): this;
|
|
4562
|
+
setLayout(layout: Layout): this;
|
|
4563
|
+
protected serializableSources(): object[];
|
|
4454
4564
|
}
|
|
4455
4565
|
|
|
4456
4566
|
declare class CollectionPanel extends UIElement {
|
|
4457
|
-
constructor(id: any, template: any);
|
|
4458
4567
|
factory: Factory;
|
|
4459
|
-
|
|
4460
|
-
|
|
4568
|
+
constructor(id: string, template?: string);
|
|
4569
|
+
setCollectionName(collection_name: string): this;
|
|
4570
|
+
setLayout(layout: Layout): this;
|
|
4571
|
+
protected serializableSources(): object[];
|
|
4461
4572
|
}
|
|
4462
4573
|
|
|
4463
4574
|
/**
|
|
@@ -4475,62 +4586,66 @@ declare class CollectionPanel extends UIElement {
|
|
|
4475
4586
|
* - precached_grid_item_count: int - 预缓存的网格项目数量
|
|
4476
4587
|
*/
|
|
4477
4588
|
declare class GridProp {
|
|
4589
|
+
[key: string]: unknown;
|
|
4590
|
+
grid_dimensions: [number, number];
|
|
4591
|
+
maximum_grid_items: number;
|
|
4592
|
+
grid_dimension_binding: string;
|
|
4593
|
+
grid_rescaling_type: 'vertical' | 'horizontal' | 'none';
|
|
4594
|
+
grid_fill_direction: 'vertical' | 'horizontal' | 'none';
|
|
4595
|
+
grid_item_template: string;
|
|
4596
|
+
precached_grid_item_count: number;
|
|
4478
4597
|
/**
|
|
4479
4598
|
* 设置网格的列数和行数。
|
|
4480
|
-
* @param {number
|
|
4599
|
+
* @param {[number, number]} dimensions - 格式为 [columns, rows]
|
|
4481
4600
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
4482
4601
|
*/
|
|
4483
|
-
setGridDimensions(dimensions: number
|
|
4484
|
-
grid_dimensions: number[] | undefined;
|
|
4602
|
+
setGridDimensions(dimensions: [number, number]): this;
|
|
4485
4603
|
/**
|
|
4486
4604
|
* 设置网格生成的最大项目数。
|
|
4487
4605
|
* @param {number} maxItems - 最大项目数
|
|
4488
4606
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
4489
4607
|
*/
|
|
4490
|
-
setMaximumGridItems(maxItems: number):
|
|
4491
|
-
maximum_grid_items: number | undefined;
|
|
4608
|
+
setMaximumGridItems(maxItems: number): this;
|
|
4492
4609
|
/**
|
|
4493
4610
|
* 设置网格尺寸的绑定名称。
|
|
4494
4611
|
* @param {string} binding - 绑定名称
|
|
4495
4612
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
4496
4613
|
*/
|
|
4497
|
-
setGridDimensionBinding(binding: string):
|
|
4498
|
-
grid_dimension_binding: string | undefined;
|
|
4614
|
+
setGridDimensionBinding(binding: string): this;
|
|
4499
4615
|
/**
|
|
4500
4616
|
* 设置网格重新缩放方向。
|
|
4501
|
-
* @param {
|
|
4617
|
+
* @param {'vertical' | 'horizontal' | 'none'} type - 可能值:vertical, horizontal, none(默认值:none)
|
|
4502
4618
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
4503
4619
|
*/
|
|
4504
|
-
setGridRescalingType(type?:
|
|
4505
|
-
grid_rescaling_type: string | undefined;
|
|
4620
|
+
setGridRescalingType(type?: 'vertical' | 'horizontal' | 'none'): this;
|
|
4506
4621
|
/**
|
|
4507
4622
|
* 设置网格填充方向。
|
|
4508
|
-
* @param {
|
|
4623
|
+
* @param {'vertical' | 'horizontal' | 'none'} direction - 可能值:vertical, horizontal, none(默认值:none)
|
|
4509
4624
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
4510
4625
|
*/
|
|
4511
|
-
setGridFillDirection(direction?:
|
|
4512
|
-
grid_fill_direction: string | undefined;
|
|
4626
|
+
setGridFillDirection(direction?: 'vertical' | 'horizontal' | 'none'): this;
|
|
4513
4627
|
/**
|
|
4514
4628
|
* 设置处理集合的子元素名称。
|
|
4515
4629
|
* @param {string} template - 元素名称(例如:"common.container_item")
|
|
4516
4630
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
4517
4631
|
*/
|
|
4518
|
-
setGridItemTemplate(template: string):
|
|
4519
|
-
grid_item_template: string | undefined;
|
|
4632
|
+
setGridItemTemplate(template: string): this;
|
|
4520
4633
|
/**
|
|
4521
4634
|
* 设置预缓存的网格项目数量。
|
|
4522
4635
|
* @param {number} count - 预缓存数量
|
|
4523
4636
|
* @returns {GridProp} 返回当前实例以支持链式调用
|
|
4524
4637
|
*/
|
|
4525
|
-
setPrecachedGridItemCount(count: number):
|
|
4526
|
-
precached_grid_item_count: number | undefined;
|
|
4638
|
+
setPrecachedGridItemCount(count: number): this;
|
|
4527
4639
|
}
|
|
4528
4640
|
|
|
4529
4641
|
declare class Grid extends CollectionPanel {
|
|
4530
4642
|
gridNum: number;
|
|
4531
4643
|
grid: GridProp;
|
|
4532
|
-
|
|
4533
|
-
|
|
4644
|
+
constructor(id: string, template?: string);
|
|
4645
|
+
setGridProp(grid_prop: GridProp): this;
|
|
4646
|
+
addGridItem(grid_position: Offset2, content: UIElement | JsonUIBag, name?: string, debugColor?: [number, number, number, number]): this;
|
|
4647
|
+
protected serializableSources(): object[];
|
|
4648
|
+
serialize(): SerializedElement;
|
|
4534
4649
|
}
|
|
4535
4650
|
|
|
4536
4651
|
/**
|
|
@@ -4553,218 +4668,114 @@ declare class Grid extends CollectionPanel {
|
|
|
4553
4668
|
* - jump_to_bottom_on_update: boolean - 是否在更新时跳转到底部
|
|
4554
4669
|
*/
|
|
4555
4670
|
declare class ScrollView {
|
|
4671
|
+
[key: string]: unknown;
|
|
4672
|
+
scrollbar_track_button: string;
|
|
4673
|
+
scrollbar_touch_button: string;
|
|
4674
|
+
scroll_speed: number;
|
|
4675
|
+
gesture_control_enabled: boolean;
|
|
4676
|
+
always_handle_scrolling: boolean;
|
|
4677
|
+
touch_mode: boolean;
|
|
4678
|
+
scrollbar_box: string;
|
|
4679
|
+
scrollbar_track: string;
|
|
4680
|
+
scroll_view_port: string;
|
|
4681
|
+
scroll_content: string;
|
|
4682
|
+
scroll_box_and_track_panel: string;
|
|
4683
|
+
jump_to_bottom_on_update: boolean;
|
|
4556
4684
|
/**
|
|
4557
4685
|
* 设置滚动条轨道按钮的 ID。
|
|
4558
4686
|
* @param {string} buttonId - 滚动条轨道按钮的 ID
|
|
4559
4687
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4560
4688
|
*/
|
|
4561
|
-
setScrollbarTrackButton(buttonId: string):
|
|
4562
|
-
scrollbar_track_button: string | undefined;
|
|
4689
|
+
setScrollbarTrackButton(buttonId: string): this;
|
|
4563
4690
|
/**
|
|
4564
4691
|
* 设置滚动条触摸按钮的 ID。
|
|
4565
4692
|
* @param {string} buttonId - 滚动条触摸按钮的 ID
|
|
4566
4693
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4567
4694
|
*/
|
|
4568
|
-
setScrollbarTouchButton(buttonId: string):
|
|
4569
|
-
scrollbar_touch_button: string | undefined;
|
|
4695
|
+
setScrollbarTouchButton(buttonId: string): this;
|
|
4570
4696
|
/**
|
|
4571
4697
|
* 设置滚动速度。
|
|
4572
4698
|
* @param {number} speed - 滚动速度
|
|
4573
4699
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4574
4700
|
*/
|
|
4575
|
-
setScrollSpeed(speed: number):
|
|
4576
|
-
scroll_speed: number | undefined;
|
|
4701
|
+
setScrollSpeed(speed: number): this;
|
|
4577
4702
|
/**
|
|
4578
4703
|
* 设置是否启用手势控制。
|
|
4579
4704
|
* @param {boolean} enabled - 是否启用手势控制(默认值:false)
|
|
4580
4705
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4581
4706
|
*/
|
|
4582
|
-
setGestureControlEnabled(enabled?: boolean):
|
|
4583
|
-
gesture_control_enabled: boolean | undefined;
|
|
4707
|
+
setGestureControlEnabled(enabled?: boolean): this;
|
|
4584
4708
|
/**
|
|
4585
4709
|
* 设置是否始终处理滚动。
|
|
4586
4710
|
* @param {boolean} alwaysHandle - 是否始终处理滚动(默认值:false)
|
|
4587
4711
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4588
4712
|
*/
|
|
4589
|
-
setAlwaysHandleScrolling(alwaysHandle?: boolean):
|
|
4590
|
-
always_handle_scrolling: boolean | undefined;
|
|
4713
|
+
setAlwaysHandleScrolling(alwaysHandle?: boolean): this;
|
|
4591
4714
|
/**
|
|
4592
4715
|
* 设置是否启用触摸模式。
|
|
4593
4716
|
* @param {boolean} touchMode - 是否启用触摸模式(默认值:false)
|
|
4594
4717
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4595
4718
|
*/
|
|
4596
|
-
setTouchMode(touchMode?: boolean):
|
|
4597
|
-
touch_mode: boolean | undefined;
|
|
4719
|
+
setTouchMode(touchMode?: boolean): this;
|
|
4598
4720
|
/**
|
|
4599
4721
|
* 设置滚动条滑块子元素的名称。
|
|
4600
4722
|
* @param {string} boxName - 滚动条滑块子元素的名称
|
|
4601
4723
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4602
4724
|
*/
|
|
4603
|
-
setScrollbarBox(boxName: string):
|
|
4604
|
-
scrollbar_box: string | undefined;
|
|
4725
|
+
setScrollbarBox(boxName: string): this;
|
|
4605
4726
|
/**
|
|
4606
4727
|
* 设置滚动条轨道子元素的名称。
|
|
4607
4728
|
* @param {string} trackName - 滚动条轨道子元素的名称
|
|
4608
4729
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4609
4730
|
*/
|
|
4610
|
-
setScrollbarTrack(trackName: string):
|
|
4611
|
-
scrollbar_track: string | undefined;
|
|
4731
|
+
setScrollbarTrack(trackName: string): this;
|
|
4612
4732
|
/**
|
|
4613
4733
|
* 设置视口子元素的名称。
|
|
4614
4734
|
* @param {string} viewPortName - 视口子元素的名称
|
|
4615
4735
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4616
4736
|
*/
|
|
4617
|
-
setScrollViewPort(viewPortName: string):
|
|
4618
|
-
scroll_view_port: string | undefined;
|
|
4737
|
+
setScrollViewPort(viewPortName: string): this;
|
|
4619
4738
|
/**
|
|
4620
4739
|
* 设置内容根父元素的名称。
|
|
4621
4740
|
* @param {string} contentName - 内容根父元素的名称
|
|
4622
4741
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4623
4742
|
*/
|
|
4624
|
-
setScrollContent(contentName: string):
|
|
4625
|
-
scroll_content: string | undefined;
|
|
4743
|
+
setScrollContent(contentName: string): this;
|
|
4626
4744
|
/**
|
|
4627
4745
|
* 设置包含滚动条滑块和轨道的子元素名称。
|
|
4628
4746
|
* @param {string} panelName - 包含滚动条滑块和轨道的子元素名称
|
|
4629
4747
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4630
4748
|
*/
|
|
4631
|
-
setScrollBoxAndTrackPanel(panelName: string):
|
|
4632
|
-
scroll_box_and_track_panel: string | undefined;
|
|
4749
|
+
setScrollBoxAndTrackPanel(panelName: string): this;
|
|
4633
4750
|
/**
|
|
4634
4751
|
* 设置是否在更新时跳转到底部。
|
|
4635
4752
|
* @param {boolean} jump - 是否在更新时跳转到底部(默认值:false)
|
|
4636
4753
|
* @returns {ScrollView} 返回当前实例以支持链式调用
|
|
4637
4754
|
*/
|
|
4638
|
-
setJumpToBottomOnUpdate(jump?: boolean):
|
|
4639
|
-
jump_to_bottom_on_update: boolean | undefined;
|
|
4755
|
+
setJumpToBottomOnUpdate(jump?: boolean): this;
|
|
4640
4756
|
}
|
|
4641
4757
|
|
|
4642
4758
|
declare class ScrollingPanel extends UIElement {
|
|
4643
|
-
constructor(id: any, template: any);
|
|
4644
4759
|
input: Input;
|
|
4645
4760
|
scrollView: ScrollView;
|
|
4646
4761
|
factory: Factory;
|
|
4762
|
+
constructor(id: string, template?: string);
|
|
4763
|
+
protected serializableSources(): object[];
|
|
4647
4764
|
}
|
|
4648
4765
|
|
|
4649
4766
|
declare class StackPanel extends Panel {
|
|
4650
|
-
constructor(id: any, template: any);
|
|
4651
|
-
type: string;
|
|
4652
4767
|
orientation: string;
|
|
4653
4768
|
stackNum: number;
|
|
4654
|
-
|
|
4769
|
+
constructor(id: string, template?: string);
|
|
4770
|
+
addStack(size: Size2 | string, content: UIElement | JsonUIBag, debug?: boolean): this;
|
|
4655
4771
|
/**
|
|
4656
4772
|
* Possible values:
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
* @param {
|
|
4773
|
+
vertical
|
|
4774
|
+
horizontal
|
|
4775
|
+
* @param {string} orientation
|
|
4660
4776
|
*/
|
|
4661
|
-
setOrientation(orientation:
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
declare class ChestUISystem {
|
|
4665
|
-
static chest_screen: UISystem;
|
|
4666
|
-
static registerContainerUI(new_container_title: any, ui_system_root_panel: any): void;
|
|
4667
|
-
}
|
|
4668
|
-
|
|
4669
|
-
/**
|
|
4670
|
-
* 自定义容器 UI 系统类,用于创建和管理容器界面。
|
|
4671
|
-
* 支持动态添加网格项、设置标题、调整尺寸等功能。
|
|
4672
|
-
*/
|
|
4673
|
-
declare class ContainerUISystem {
|
|
4674
|
-
/**
|
|
4675
|
-
* 构造函数,初始化容器 UI 系统。
|
|
4676
|
-
* @param {string} identifier - 容器的唯一标识符。
|
|
4677
|
-
* @param {string} path - 资源路径。
|
|
4678
|
-
*/
|
|
4679
|
-
constructor(identifier: string, path: string);
|
|
4680
|
-
system: UISystem;
|
|
4681
|
-
title: string;
|
|
4682
|
-
root_panel_size: number[];
|
|
4683
|
-
gridDimension: number[];
|
|
4684
|
-
output_grids: any[];
|
|
4685
|
-
main_panel: Panel;
|
|
4686
|
-
grids: Grid;
|
|
4687
|
-
setInputGrid(output_arr: any): void;
|
|
4688
|
-
/**
|
|
4689
|
-
* 向网格中添加一个网格项。
|
|
4690
|
-
* @param {number[]} grid_position - 网格项的位置 [行, 列] 用于定位实体的背包槽。
|
|
4691
|
-
* @param {number[]} offset - 网格项的偏移量 [x, y]。
|
|
4692
|
-
* @param {Object} [options] - 可选参数,用于配置网格项。
|
|
4693
|
-
* @param {boolean} [options.enable=true] - 是否启用该网格项,默认为 true。
|
|
4694
|
-
* @param {number[]} [options.size] - 网格项的大小 [宽度, 高度]。
|
|
4695
|
-
* @param {UIElement[]} [options.background_images] - 网格项的背景图片控件。
|
|
4696
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
4697
|
-
*/
|
|
4698
|
-
addGridItem(grid_position: number[], offset: number[], options?: {
|
|
4699
|
-
enable?: boolean | undefined;
|
|
4700
|
-
size?: number[] | undefined;
|
|
4701
|
-
background_images?: UIElement[] | undefined;
|
|
4702
|
-
}): ContainerUISystem;
|
|
4703
|
-
addInputGrid(grid_position: any, offset: any, options: any): void;
|
|
4704
|
-
addOutputGrid(grid_position: any, offset: any, options: any): void;
|
|
4705
|
-
/**
|
|
4706
|
-
* 向主面板中添加一个 UI 元素。
|
|
4707
|
-
* @param {Object} element - 要添加的 UI 元素。
|
|
4708
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
4709
|
-
*/
|
|
4710
|
-
addElementToMain(element: Object): ContainerUISystem;
|
|
4711
|
-
/**
|
|
4712
|
-
* 设置网格的维度(行和列)。
|
|
4713
|
-
* @param {number[]} dimension - 网格的维度 [行数, 列数]。
|
|
4714
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
4715
|
-
*/
|
|
4716
|
-
setGridDimension(dimension: number[]): ContainerUISystem;
|
|
4717
|
-
/**
|
|
4718
|
-
* 设置容器的标题。
|
|
4719
|
-
* @param {string} title - 容器的标题。
|
|
4720
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
4721
|
-
*/
|
|
4722
|
-
setTitle(title: string): ContainerUISystem;
|
|
4723
|
-
/**
|
|
4724
|
-
* 设置根面板的尺寸。
|
|
4725
|
-
* @param {number[]} size - 根面板的尺寸 [宽度, 高度]。
|
|
4726
|
-
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
4727
|
-
*/
|
|
4728
|
-
setSize(size: number[]): ContainerUISystem;
|
|
4729
|
-
setItemMatrix(n: any, matrix: any): void;
|
|
4730
|
-
#private;
|
|
4731
|
-
}
|
|
4732
|
-
|
|
4733
|
-
declare const ServerFormSystem: UISystem;
|
|
4734
|
-
declare class ServerFormButton extends UIElement {
|
|
4735
|
-
/**
|
|
4736
|
-
* 定义一个新的表单按钮
|
|
4737
|
-
* @param {*} name
|
|
4738
|
-
* @param {*} binding_button_name
|
|
4739
|
-
*/
|
|
4740
|
-
constructor(name: any, binding_button_name: any);
|
|
4741
|
-
/**
|
|
4742
|
-
*
|
|
4743
|
-
* @param {string} texture
|
|
4744
|
-
* @returns
|
|
4745
|
-
*/
|
|
4746
|
-
setDefaultTexture(texture: string): this;
|
|
4747
|
-
setPressedTexture(texture: any): this;
|
|
4748
|
-
setHoverTexture(texture: any): this;
|
|
4749
|
-
}
|
|
4750
|
-
declare const form_button_panel: Panel;
|
|
4751
|
-
declare class ServerUISystem {
|
|
4752
|
-
static "__#private@#binding_map": Map<any, any>;
|
|
4753
|
-
static "__#private@#binding_title_list": any[];
|
|
4754
|
-
static addBindingTitle(title_name: any): void;
|
|
4755
|
-
static getBindingTitleList(): any[];
|
|
4756
|
-
static getBindingContentList(): any[];
|
|
4757
|
-
static bindingTitlewithContent(title_name: any, content: any): void;
|
|
4758
|
-
static "__#private@#updateServerFormSystem"(): void;
|
|
4759
|
-
}
|
|
4760
|
-
|
|
4761
|
-
declare class Guidebook {
|
|
4762
|
-
constructor(identifier: any, path: any);
|
|
4763
|
-
system: UISystem;
|
|
4764
|
-
addPageBinding(page_name: any, left_control_name: any, right_control_name: any): this;
|
|
4765
|
-
addPage(page_name: any, left_control: any, right_control: any): this;
|
|
4766
|
-
addElement(element: any): this;
|
|
4767
|
-
#private;
|
|
4777
|
+
setOrientation(orientation: string): this;
|
|
4778
|
+
serialize(): SerializedElement;
|
|
4768
4779
|
}
|
|
4769
4780
|
|
|
4770
4781
|
type CustomButtonConfig = {
|
|
@@ -4851,17 +4862,8 @@ declare class NeoGuidebook {
|
|
|
4851
4862
|
}
|
|
4852
4863
|
|
|
4853
4864
|
/**
|
|
4854
|
-
*
|
|
4855
|
-
*
|
|
4856
|
-
*/
|
|
4857
|
-
declare class SapdonButton extends UIElement {
|
|
4858
|
-
constructor(id: string);
|
|
4859
|
-
/** 设置锚点对齐(如 bottom_left / bottom_right / top_right),默认尺寸 32×32 */
|
|
4860
|
-
setAnchor(anchor: string): this;
|
|
4861
|
-
}
|
|
4862
|
-
/**
|
|
4863
|
-
* SapdonTexturedButton:sapdon 页面壳内的纹理按钮。
|
|
4864
|
-
* 默认模板固定为 server_form.sapdon_textured_button(三态纹理 + binding_button_text 门控)。
|
|
4865
|
+
* @deprecated 图标/纹理按钮请改用 FormButton(@common.button + 三态纹理 + 门控绑定)。
|
|
4866
|
+
* 本类仅为兼容 NeoGuidebook 保留;后续随 guidebook 迁移一并移除。
|
|
4865
4867
|
*/
|
|
4866
4868
|
declare class SapdonTexturedButton extends UIElement {
|
|
4867
4869
|
constructor(id: string, bindingButtonName?: string);
|
|
@@ -4934,39 +4936,132 @@ declare class NeoGuidebookPage {
|
|
|
4934
4936
|
clear(): this;
|
|
4935
4937
|
}
|
|
4936
4938
|
|
|
4939
|
+
declare namespace HudUISystem {
|
|
4940
|
+
/**
|
|
4941
|
+
* 获取HUD UI系统实例
|
|
4942
|
+
* @returns The HUD UI System instance
|
|
4943
|
+
*/
|
|
4944
|
+
function getInstance(): UISystem;
|
|
4945
|
+
function registerElement(element: UIElement): void;
|
|
4946
|
+
function mountRootElement(element: UIElement): void;
|
|
4947
|
+
}
|
|
4948
|
+
|
|
4949
|
+
declare class HudStatePanel {
|
|
4950
|
+
name: string;
|
|
4951
|
+
private root_panel;
|
|
4952
|
+
private ui_id;
|
|
4953
|
+
constructor(name: string);
|
|
4954
|
+
addStateControl(state: string | number, control: UIElement): this;
|
|
4955
|
+
getPanel(): Panel;
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
declare class ChestUISystem {
|
|
4959
|
+
static chest_screen: UISystem;
|
|
4960
|
+
static registerContainerUI(new_container_title: string, ui_system_root_panel: string): void;
|
|
4961
|
+
}
|
|
4962
|
+
|
|
4963
|
+
type Any = any;
|
|
4964
|
+
/**
|
|
4965
|
+
* 自定义容器 UI 系统类,用于创建和管理容器界面。
|
|
4966
|
+
* 支持动态添加网格项、设置标题、调整尺寸等功能。
|
|
4967
|
+
*/
|
|
4968
|
+
declare class ContainerUISystem {
|
|
4969
|
+
#private;
|
|
4970
|
+
system: UISystem;
|
|
4971
|
+
title: string;
|
|
4972
|
+
root_panel_size: [number, number];
|
|
4973
|
+
gridDimension: [number, number];
|
|
4974
|
+
output_grids: number[][];
|
|
4975
|
+
main_panel: Panel;
|
|
4976
|
+
grids: Grid;
|
|
4977
|
+
constructor(identifier: string, path: string);
|
|
4978
|
+
setInputGrid(output_arr: number[][]): void;
|
|
4979
|
+
/**
|
|
4980
|
+
* 向网格中添加一个网格项。
|
|
4981
|
+
* @param {number[]} grid_position - 网格项的位置 [行, 列] 用于定位实体的背包槽。
|
|
4982
|
+
* @param {number[]} offset - 网格项的偏移量 [x, y]。
|
|
4983
|
+
* @param {Object} [options] - 可选参数,用于配置网格项。
|
|
4984
|
+
* @param {boolean} [options.enable=true] - 是否启用该网格项,默认为 true。
|
|
4985
|
+
* @param {number[]} [options.size] - 网格项的大小 [宽度, 高度]。
|
|
4986
|
+
* @param {UIElement[]} [options.background_images] - 网格项的背景图片控件。
|
|
4987
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
4988
|
+
*/
|
|
4989
|
+
addGridItem(grid_position: Offset2, offset: Offset2, options?: {
|
|
4990
|
+
enable?: boolean;
|
|
4991
|
+
size?: Any;
|
|
4992
|
+
background_images?: Any;
|
|
4993
|
+
}): this;
|
|
4994
|
+
addInputGrid(grid_position: Offset2, offset: Offset2, options?: {
|
|
4995
|
+
enable?: boolean;
|
|
4996
|
+
size?: Any;
|
|
4997
|
+
background_images?: Any;
|
|
4998
|
+
}): void;
|
|
4999
|
+
addOutputGrid(grid_position: Offset2, offset: Offset2, options?: {
|
|
5000
|
+
enable?: boolean;
|
|
5001
|
+
size?: Any;
|
|
5002
|
+
background_images?: Any;
|
|
5003
|
+
}): void;
|
|
5004
|
+
/**
|
|
5005
|
+
* 向主面板中添加一个 UI 元素。
|
|
5006
|
+
* @param {Any} element - 要添加的 UI 元素。
|
|
5007
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5008
|
+
*/
|
|
5009
|
+
addElementToMain(element: Any): this;
|
|
5010
|
+
/**
|
|
5011
|
+
* 设置网格的维度(行和列)。
|
|
5012
|
+
* @param {number[]} dimension - 网格的维度 [行数, 列数]。
|
|
5013
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5014
|
+
*/
|
|
5015
|
+
setGridDimension(dimension: number[]): this;
|
|
5016
|
+
/**
|
|
5017
|
+
* 设置容器的标题。
|
|
5018
|
+
* @param {string} title - 容器的标题。
|
|
5019
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5020
|
+
*/
|
|
5021
|
+
setTitle(title: string): this;
|
|
5022
|
+
/**
|
|
5023
|
+
* 设置根面板的尺寸。
|
|
5024
|
+
* @param {number[]} size - 根面板的尺寸 [宽度, 高度]。
|
|
5025
|
+
* @returns {ContainerUISystem} 返回当前实例以支持链式调用。
|
|
5026
|
+
*/
|
|
5027
|
+
setSize(size: number[]): this;
|
|
5028
|
+
setItemMatrix(n: number, matrix: number[][]): void;
|
|
5029
|
+
}
|
|
5030
|
+
|
|
4937
5031
|
/**
|
|
4938
5032
|
* sapdon_ui: 页面壳路由系统(生成 server_form.json)
|
|
4939
5033
|
*
|
|
4940
|
-
*
|
|
4941
|
-
*
|
|
4942
|
-
* └─
|
|
4943
|
-
*
|
|
4944
|
-
*
|
|
4945
|
-
*
|
|
4946
|
-
*
|
|
4947
|
-
*
|
|
5034
|
+
* 采用 Bedrock Wiki「Modifying Server Forms — Action Form」官方路由:
|
|
5035
|
+
* main_screen_content ─(modification: insert_back controls)→ sapdon_form_factory
|
|
5036
|
+
* └─ factory { name: server_form_factory, control_ids.long_form } → @server_form.sapdon_long_form_panel
|
|
5037
|
+
* └─ (modifications insert_back) 所有注册页 Panel($panel_id 前缀门控)
|
|
5038
|
+
* └─ content@$user_content_panel (下) + buttons@$user_buttons_panel (上)
|
|
5039
|
+
* vanilla long_form ─(modification: bindings)→ title 含 'sapdon_ui:' 时隐藏原生表单
|
|
5040
|
+
*
|
|
5041
|
+
* 关键收益:自定义页处于 main_screen_content 作用域 → #form_text / #title_text 均可解析。
|
|
4948
5042
|
*/
|
|
4949
5043
|
interface SapdonPageRegistration {
|
|
4950
5044
|
panelId: string;
|
|
4951
5045
|
contentPanel: UIElement | string;
|
|
4952
5046
|
buttonsPanel?: UIElement | string;
|
|
4953
|
-
/**
|
|
5047
|
+
/** 页面控件名(默认 pageN) */
|
|
4954
5048
|
name?: string;
|
|
4955
5049
|
}
|
|
4956
5050
|
declare class SapdonServerUI {
|
|
4957
5051
|
static readonly MARKER = "sapdon_ui:";
|
|
4958
5052
|
static readonly NS = "server_form";
|
|
4959
5053
|
private static _system;
|
|
4960
|
-
private static
|
|
5054
|
+
private static _factories;
|
|
4961
5055
|
private static _pageCount;
|
|
4962
|
-
/** 框架侧固定提供的按钮项模�?form_button@common_buttons.light_text_button */
|
|
4963
|
-
static createFormButtonTemplate(): UIElement;
|
|
4964
|
-
/** 框架侧固定提供的纹理按钮模板 sapdon_textured_button@common.button(三态纹理 + 门控) */
|
|
4965
|
-
static createTexturedButtonTemplate(): UIElement;
|
|
4966
|
-
/** 通用页面壳 custom_panel_content: panel_id 精确匹配 + 内容(下)/按键(上) */
|
|
4967
|
-
static createPanelContentShell(): UIElement;
|
|
4968
5056
|
private static _ensureBuilt;
|
|
4969
|
-
/**
|
|
5057
|
+
/** 页面根壳:在页面自己的 UISystem 里生成 <name> 元素(门控 + content/buttons 子控件 + 变量),供工厂 long_form 引用 */
|
|
5058
|
+
static createPageRoot(reg: {
|
|
5059
|
+
name: string;
|
|
5060
|
+
panelId: string;
|
|
5061
|
+
contentRef: string;
|
|
5062
|
+
buttonsRef: string;
|
|
5063
|
+
}): UIElement;
|
|
5064
|
+
/** 注册一个自定义页面:向 main_screen_content 追加一个纯 gated factory(long_form → @<页ns>.<name>),门控在页面根 */
|
|
4970
5065
|
static registerPage(reg: SapdonPageRegistration): void;
|
|
4971
5066
|
static getSystem(): UISystem | null;
|
|
4972
5067
|
}
|
|
@@ -4986,80 +5081,129 @@ declare class SapdonPanel {
|
|
|
4986
5081
|
}
|
|
4987
5082
|
|
|
4988
5083
|
/**
|
|
4989
|
-
*
|
|
4990
|
-
*
|
|
4991
|
-
*
|
|
5084
|
+
* FormButton:服务端表单按钮(纯样式)。
|
|
5085
|
+
* 只管长什么样(三态纹理 / 尺寸 / 锚点 / 门控键),不含几何与绑定。
|
|
5086
|
+
* 必须 addButton 进 FormButtonGrid 才被注入集合/门控绑定并定位生效。
|
|
4992
5087
|
*/
|
|
4993
|
-
declare class
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
setSize(
|
|
4999
|
-
/**
|
|
5000
|
-
|
|
5001
|
-
/**
|
|
5002
|
-
|
|
5003
|
-
build(): Grid;
|
|
5088
|
+
declare class FormButton extends Button {
|
|
5089
|
+
constructor(id: string);
|
|
5090
|
+
/** 三态纹理 default/hover/pressed */
|
|
5091
|
+
setTexture(defaultTex: string, hoverTex: string, pressedTex: string): this;
|
|
5092
|
+
/** 尺寸(原地改,保留锚点/offset) */
|
|
5093
|
+
setSize(w: number | string, h: number | string): this;
|
|
5094
|
+
/** 锚点对齐(原地改,导航贴角用) */
|
|
5095
|
+
setAnchor(anchor: string): this;
|
|
5096
|
+
/** 门控键:仅当运行时 emit 的 #form_button_text 等于该键时可见(绑定由 Grid 注入) */
|
|
5097
|
+
setBinding(key: string): this;
|
|
5004
5098
|
}
|
|
5005
5099
|
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5100
|
+
/**
|
|
5101
|
+
* FormButtonGrid:按键格盘(几何 + 激活)。
|
|
5102
|
+
* 内部一个 Grid(collection: form_buttons),把面板按 dimensions 分格;
|
|
5103
|
+
* addButton 时按 index 派生基准格 base 并注入 FormButton 的三组绑定。
|
|
5104
|
+
*/
|
|
5105
|
+
declare class FormButtonGrid {
|
|
5106
|
+
private grid;
|
|
5107
|
+
private cols;
|
|
5108
|
+
private rows;
|
|
5109
|
+
private index;
|
|
5110
|
+
private debug;
|
|
5111
|
+
private static readonly RED;
|
|
5112
|
+
constructor(id: string, options: {
|
|
5113
|
+
dimensions: [number, number];
|
|
5114
|
+
size: [number | string, number | string];
|
|
5115
|
+
});
|
|
5116
|
+
/** 给每个格子描红调试框 */
|
|
5117
|
+
enableDebug(): this;
|
|
5118
|
+
/** 加一枚内容:index 决定基准格(off_col = index%c, off_row = index/c);给 pos 则叠加。仅 FormButton 注入集合/门控绑定。 */
|
|
5119
|
+
addButton(index: number, btn: FormButton | UIElement, pos?: [number, number]): this;
|
|
5120
|
+
/** 注入 FormButton 的集合/门控绑定(离开 Grid 则无效) */
|
|
5121
|
+
private injectBindings;
|
|
5122
|
+
build(): UIElement;
|
|
5011
5123
|
}
|
|
5012
5124
|
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5125
|
+
/**
|
|
5126
|
+
* SapdonGuideBook —— 帕秋莉式手册(分类索引 INDEX + 词条列表 CAT + 内容页 ENT + home/prev/next 导航)。
|
|
5127
|
+
*
|
|
5128
|
+
* 线协议(运行时发射):
|
|
5129
|
+
* body = "INDEX" → 显示分类索引网格(子按钮 = 各分类,setBinding 精确门控)
|
|
5130
|
+
* body = "CAT:<id>|p<N>" → 分类页(p0 左简介/右 list,p1+ 左右 list)
|
|
5131
|
+
* body = "ENT:<id>:<gi>|p<N>" → 词条内容页(按 pageType 渲染、可分页)
|
|
5132
|
+
* title = "sapdon_ui:<name>"
|
|
5133
|
+
* button(...) → 集合 form_buttons:分类按钮 or 导航,均 exact-match 门控
|
|
5134
|
+
*/
|
|
5135
|
+
type GuideBookPageType = 'text' | 'crafting' | 'spotlight' | 'image';
|
|
5136
|
+
interface GuideBookChapter {
|
|
5137
|
+
name: string;
|
|
5138
|
+
icon: string;
|
|
5139
|
+
/** 词条正文(多行,ENT 页逐行渲染;text 类型按 5 行/半页分页) */
|
|
5140
|
+
lines: string[];
|
|
5141
|
+
/** 页类型(默认 text) */
|
|
5142
|
+
pageType?: GuideBookPageType;
|
|
5143
|
+
/** crafting:3×3 合成格(9 项,空位 '')+ 输出图标 */
|
|
5144
|
+
craft?: {
|
|
5145
|
+
grid: string[];
|
|
5146
|
+
output: string;
|
|
5147
|
+
};
|
|
5148
|
+
/** spotlight:大图标 + 描述 */
|
|
5149
|
+
spotlight?: {
|
|
5150
|
+
icon: string;
|
|
5151
|
+
desc: string;
|
|
5152
|
+
};
|
|
5153
|
+
/** image:整页图 + 说明 */
|
|
5154
|
+
image?: {
|
|
5155
|
+
texture: string;
|
|
5156
|
+
caption: string;
|
|
5030
5157
|
};
|
|
5031
|
-
hudSize?: [string | number, string | number];
|
|
5032
|
-
anchorFrom?: string;
|
|
5033
|
-
anchorTo?: string;
|
|
5034
|
-
offset?: [number, number];
|
|
5035
|
-
clipDirection?: string;
|
|
5036
|
-
}
|
|
5037
|
-
declare class HudProgressBar {
|
|
5038
|
-
private panel;
|
|
5039
|
-
private options;
|
|
5040
|
-
constructor(options: HudProgressBarOptions);
|
|
5041
|
-
private build;
|
|
5042
|
-
getPanel(): Panel;
|
|
5043
|
-
mountToHud(): void;
|
|
5044
|
-
}
|
|
5045
|
-
|
|
5046
|
-
declare namespace HudUISystem {
|
|
5047
|
-
/**
|
|
5048
|
-
* 获取HUD UI系统实例
|
|
5049
|
-
* @returns The HUD UI System instance
|
|
5050
|
-
*/
|
|
5051
|
-
function getInstance(): UISystem;
|
|
5052
|
-
function registerElement(element: UIElement): void;
|
|
5053
|
-
function mountRootElement(element: UIElement): void;
|
|
5054
5158
|
}
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5159
|
+
interface GuideBookCategory {
|
|
5160
|
+
/** 英文 id(路由用,如 intro / routing / controls / undecided) */
|
|
5161
|
+
id: string;
|
|
5162
|
+
/** 中文标题(左页标题 / 索引卡名称) */
|
|
5163
|
+
title: string;
|
|
5164
|
+
/** 分类图标(索引卡) */
|
|
5165
|
+
icon: string;
|
|
5166
|
+
/** 简介正文(左页,多行,逐行渲染) */
|
|
5167
|
+
introLines: string[];
|
|
5168
|
+
/** 右页章节条目 */
|
|
5169
|
+
chapters: GuideBookChapter[];
|
|
5170
|
+
}
|
|
5171
|
+
declare class SapdonGuideBook {
|
|
5172
|
+
private system;
|
|
5173
|
+
private namespace;
|
|
5174
|
+
private name;
|
|
5175
|
+
private size;
|
|
5176
|
+
private background;
|
|
5177
|
+
private debug;
|
|
5178
|
+
private coverTitle;
|
|
5179
|
+
private coverLines;
|
|
5180
|
+
constructor(identifier: string, size?: [number, number], background?: string);
|
|
5181
|
+
enableDebug(): this;
|
|
5182
|
+
/** 自定义封面:标题(可含 \n)+ 简介行 */
|
|
5183
|
+
setCover(title: string, lines: string[]): this;
|
|
5184
|
+
/** 布局容器:<tag> 命中 #form_text(含 tag 即显示) */
|
|
5185
|
+
private gateLayout;
|
|
5186
|
+
private navButton;
|
|
5187
|
+
private closeButton;
|
|
5188
|
+
/** NeoGuidebook 书页纸面:页脊 + 页边模板(左/右半页) */
|
|
5189
|
+
private bookPagePane;
|
|
5190
|
+
/** 全幅纸页基底:横向 50/50 左右半页(crease+edge),layer 0 常显 */
|
|
5191
|
+
private bookPageBase;
|
|
5192
|
+
/** 给游离 FormButton 注入集合/门控绑定(非 FormButtonGrid 场景,如章节条目行) */
|
|
5193
|
+
private wireButton;
|
|
5194
|
+
/** 章节列表列(章节标题 + 分割线 + ≤8 行条目) */
|
|
5195
|
+
private catListColumn;
|
|
5196
|
+
/** 介绍列(标题 + 分割线 + 简介逐行)——仅 p0 左页 */
|
|
5197
|
+
private catIntroColumn;
|
|
5198
|
+
/**
|
|
5199
|
+
* CAT 页(L2):按词条数分页容器,门控 CAT:<id>|p<N>。
|
|
5200
|
+
* p0:左=介绍,右=章节 list(≤8);p1+:左、右都是章节 list(容量 8+8=16,先填左列再右列)。
|
|
5201
|
+
*/
|
|
5202
|
+
private catPages;
|
|
5203
|
+
/** ENT 词条内容页(L3):按 pageType 分派布局;text 按 5 行/半页分页;门控 ENT:<id>:<gi>|p<N> */
|
|
5204
|
+
private entPages;
|
|
5205
|
+
build(categories: GuideBookCategory[]): this;
|
|
5206
|
+
getSystem(): UISystem;
|
|
5063
5207
|
}
|
|
5064
5208
|
|
|
5065
5209
|
declare class ItemTextureManager {
|
|
@@ -5139,5 +5283,5 @@ declare namespace registry {
|
|
|
5139
5283
|
function submit(): void;
|
|
5140
5284
|
}
|
|
5141
5285
|
|
|
5142
|
-
export { AddonAnimationController, AddonAnimationStateMachine, AddonAttachable, AddonAttachableDefinition, AddonAttachableDescription, AddonBiome, AddonBiomeDefinition, AddonBiomeDescription, AddonBlock, AddonBlockDefinition, AddonBlockDescription, AddonClientEntity, AddonClientEntityDefinition, AddonClientEntityDescription, AddonEntity, AddonEntityDefinition, AddonEntityDescription, AddonFeatureRule, AddonFeatureRuleDecription, AddonFeatureRuleDenifition, AddonItem, AddonItemDefinition, AddonItemDescription, AddonManifest, AddonManifestDependency, AddonManifestHeader, AddonManifestMetadata, AddonManifestModule, AddonMenuCategory, AddonOreFeature, AddonOreFeatureDefinition, AddonOreFeatureDescription, AddonRecipe, AddonRecipeFurnace, AddonRecipeFurnace_1_12, AddonRecipeFurnace_1_17, AddonRecipeShaped, AddonRecipeShaped_1_12, AddonRecipeShaped_1_17, AddonRecipeShaped_1_19, AddonRecipeShaped_1_20, AddonRecipeShapeless, AddonRecipeShapeless_1_12, AddonRecipeShapeless_1_17, AddonRenderController, AddonRenderControllerGroup, AddonSemanticVersion, Armor, ArmorType, Attachable, BasicBlock, BasicBundle, BasicEntity, BasicMovementBundle, Biome, BiomeAPI, BiomeComponent, BiomeFilter, Block, BlockAPI, BlockComponent, BlockCustomComponentBuilder, BookButton, BookCategoryGrid, BookImage, BookRecipeGrid, BookText, BookTitle, BookTitleBar, Button, ButtonMapping
|
|
5143
|
-
export type { ArmorOptions, ArmorSpec, BeforeOnPlayerPlaceEvent, BlockCustomComponentHandlers, BlockDescriptor, BlockPlacerOptions, ConstructorOf, CooldownOptions, CreateModelItemOptions, DiggerOptions, DurabilitySensorOptions, DurabilityThreshold, EncodeDecoder, EntityPlacerOptions, FlipbookEntry, FlipbookItemOptions, FloatLiteral, FoodComponentOptions, FoodOptions, ISerializer, IconTextures, ItemCatalogCategory, ItemCatalogGroupOptions, ItemComponentMap, ItemOptions, ItemRarity, KineticWeaponOptions, ModelBoneTransform, OnBlockStateChangeEvent, OnBreakEvent, OnEntityEvent, OnEntityFallOnEvent, OnPlaceEvent, OnPlayerBreakEvent, OnPlayerInteractEvent, OnRandomTickEvent, OnRedstoneUpdateEvent, OnStepOffEvent, OnStepOnEvent, OnTickEvent, PiercingWeaponOptions, Range, RawType, RecordOptions, RepairItem, SapdonPageRegistration, ShooterAmmunition, ShooterOptions, StorageItemOptions, SwingSoundsOptions, TextureEntry, TextureVariation, ThrowableOptions, UseModifiersOptions };
|
|
5286
|
+
export { AddonAnimationController, AddonAnimationStateMachine, AddonAttachable, AddonAttachableDefinition, AddonAttachableDescription, AddonBiome, AddonBiomeDefinition, AddonBiomeDescription, AddonBlock, AddonBlockDefinition, AddonBlockDescription, AddonClientEntity, AddonClientEntityDefinition, AddonClientEntityDescription, AddonEntity, AddonEntityDefinition, AddonEntityDescription, AddonFeatureRule, AddonFeatureRuleDecription, AddonFeatureRuleDenifition, AddonItem, AddonItemDefinition, AddonItemDescription, AddonManifest, AddonManifestDependency, AddonManifestHeader, AddonManifestMetadata, AddonManifestModule, AddonMenuCategory, AddonOreFeature, AddonOreFeatureDefinition, AddonOreFeatureDescription, AddonRecipe, AddonRecipeFurnace, AddonRecipeFurnace_1_12, AddonRecipeFurnace_1_17, AddonRecipeShaped, AddonRecipeShaped_1_12, AddonRecipeShaped_1_17, AddonRecipeShaped_1_19, AddonRecipeShaped_1_20, AddonRecipeShapeless, AddonRecipeShapeless_1_12, AddonRecipeShapeless_1_17, AddonRenderController, AddonRenderControllerGroup, AddonSemanticVersion, Armor, ArmorType, Attachable, BasicBlock, BasicBundle, BasicEntity, BasicMovementBundle, Biome, BiomeAPI, BiomeComponent, BiomeFilter, Block, BlockAPI, BlockComponent, BlockCustomComponentBuilder, BookButton, BookCategoryGrid, BookImage, BookRecipeGrid, BookText, BookTitle, BookTitleBar, Button, ButtonMapping, ChapterItem, ChestUISystem, ClientEntity, CollectionPanel, ContainerUISystem, Control, CoordinateDistribution, CropBlock, DataBinding, DataBindingObject, Divider, DummyEntity, EmptySpace, Entity, EntityAPI, EntityComponent, Factory, FeatureAPI, FeatureConditions, FeatureDistribution, FeatureRule, FenceBlock, FlipbookItem, FlipbookTextureConfig, FlipbookTextures, FollowMobBehavior, FollowParentBehavior, Food, FormButton, FormButtonGrid, GeometryBlock, GlassBlock, GoHomeBehavior, Grid, GridProp, HeadBlock, HudProgressBar, HudStatePanel, HudUISystem, Image, Input, Item, ItemAPI, ItemCatalog, ItemCategory, ItemComponent, ItemTextureManager, Label, Layout, Modifications, MoveTowardsHomeRestrictionBehavior, NativeEntity, NativeEntityData, Navigation, NearestAttackableTargetBehavor, NeoGuidebook, NeoGuidebookPage, NonNullMap, OreBlock, OreFeature, Panel, PickupItemsBehavior, Projectile, RandomStrollBehavior, RecipeAPI, RecipeInputTags, RecipeTags, RecipeTypes, RotatableBlock, RotationTypes, SapdonGuideBook, SapdonPanel, SapdonServerUI, SapdonTexturedButton, ScrollView, ScrollingPanel, Serializable, Serializer, Sound, Sprite, StackPanel, StairBlock, TemptBehavior, TerrainTextureManager, Text, TextureVariationConfig, TileBlock, TintMethod, TrapdoorBlock, UIElement, UISystem, UISystemRegistry, UiAPI, decode, defaultSerializer, encode, f64, getMetadata, getOrCreateMetadata, isRawJSON, jsonEncodeDecoder, jsonEncoderReplacer, mixin, registerBlock, registerEntity, registry, serialize };
|
|
5287
|
+
export type { ArmorOptions, ArmorSpec, BeforeOnPlayerPlaceEvent, BlockCustomComponentHandlers, BlockDescriptor, BlockPlacerOptions, ConstructorOf, CooldownOptions, CreateModelItemOptions, DiggerOptions, DurabilitySensorOptions, DurabilityThreshold, EncodeDecoder, EntityPlacerOptions, FlipbookEntry, FlipbookItemOptions, FloatLiteral, FoodComponentOptions, FoodOptions, GuideBookCategory, GuideBookChapter, GuideBookPageType, ISerializer, IconTextures, ItemCatalogCategory, ItemCatalogGroupOptions, ItemComponentMap, ItemOptions, ItemRarity, KineticWeaponOptions, ModelBoneTransform, OnBlockStateChangeEvent, OnBreakEvent, OnEntityEvent, OnEntityFallOnEvent, OnPlaceEvent, OnPlayerBreakEvent, OnPlayerInteractEvent, OnRandomTickEvent, OnRedstoneUpdateEvent, OnStepOffEvent, OnStepOnEvent, OnTickEvent, PiercingWeaponOptions, Range, RawType, RecordOptions, RepairItem, SapdonPageRegistration, SerializedElement, ShooterAmmunition, ShooterOptions, StorageItemOptions, SwingSoundsOptions, TextureEntry, TextureVariation, ThrowableOptions, UseModifiersOptions };
|