SusAbilitySlot

单个技能格 — 图标、名称、按键提示、冷却遮罩,可选按住施法。
包
SusGame · HUD(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Icon | Prop<string> | "" | |
Label | Prop<string> | "" | |
Description | Prop<string> | "" | |
Keybind | Prop<string> | "" | |
Cooldown01 | Prop<float> | 0f | |
CooldownText | Prop<string> | "" | |
CooldownStyle | Prop<string> | "Radial" | |
Disabled | Prop<bool> | false | |
UseHold | Prop<bool> | false | |
HoldDurationMs | Prop<int> | 800 |
插槽
没有插槽。
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
Activate | OnActivate | — |
HoldComplete | OnHoldComplete | — |
HoldCancel | OnHoldCancel | — |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
breakpoint-smsus-ability-slotsus-ability-slot__cdsus-ability-slot__cd-labelsus-ability-slot__cd-wipesus-ability-slot__hold-hostsus-ability-slot__icon-hostsus-ability-slot__keysus-ability-slot__namesus-ability-slot--disabledsus-ability-slot--holdsus-ability-slot--on-cd
用法
csharp
var slot = new SusAbilitySlot();
slot.Icon.Value = "sword";
slot.Label.Value = "Strike";
slot.Description.Value = "Melee hit — 1 AP";
slot.Keybind.Value = "1";
slot.Cooldown01.Value = 0.4f;
slot.CooldownText.Value = "2s";
slot.Disabled.Value = false;
slot.UseHold.Value = false;
slot.OnActivate += () => { /* … */ };xml
<template>
<sus:SusAbilitySlot :Icon="Icon.Value"
:Label="Label.Value"
:Description="Desc.Value"
:Keybind="Key.Value"
:Cooldown01="Cd.Value"
:CooldownText="CdText.Value"
:Disabled="Disabled.Value"
:UseHold="Hold.Value"
:HoldDurationMs="HoldMs.Value"
@activate="OnActivate"
@hold-complete="OnHoldComplete"
@hold-cancel="OnHoldCancel" />
</template>
<script>
public Prop<string> Icon = new("sword");
public Prop<string> Label = new("Strike");
public Prop<string> Desc = new("Melee hit — 1 AP");
public Prop<string> Key = new("1");
public Prop<float> Cd = new(0.4f);
public Prop<string> CdText = new("2s");
public Prop<bool> Disabled = new(false);
public Prop<bool> Hold = new(false);
public Prop<int> HoldMs = new(800);
void OnActivate() { /* … */ }
void OnHoldComplete() { /* … */ }
void OnHoldCancel() { /* … */ }
</script>| Prop | 作用 |
|---|---|
Icon | 内部 SusIcon 使用的图标名 |
Label | 图标下方的名称 |
Description | 提示框正文(配合 label) |
Keybind | 角标按键文字 |
Cooldown01 | 0 就绪 · 1 完全在冷却中 |
CooldownText | 冷却期间的覆盖文字 |
Disabled | 阻止激活 / 按住 |
UseHold | 用 SusHoldButton 代替普通点击 |
HoldDurationMs | UseHold 时的按住时长 |
备注
- 当
Cooldown01 > 0.01时启用冷却样式类。 - 在技能栏内,优先使用 SusAbilityBar 的
SetAbilities—— 它会替你写入这些属性。