呼叫方式
addon:CreateConditionSlider()
可直接透過 addon 使用,不需要相依項目。
作用
建立一個帶有滑桿與數字輸入框的原生數值條件輸入控制項。設定 SetSliderValues、SetValue、SetIsPercent 與 SetCallback;OnValueChanged 回報已提交的值。使用 parent:AddChild(widget) 新增它。
參數
| 名稱 | 類型 | 作用 |
|---|---|---|
self | RMAddon | Rotation Master 插件實例(使用冒號呼叫時隱含傳入)。 |
傳回值
| 1 | RMConditionInput | 支援滑桿範圍、百分比顯示與待處理編輯驗證的數值元件。 |
|---|
版本
內建輔助函式在每個版本上都會註冊。不同的是它們讀取的遊戲 API;某個 API 不存在時,輔助函式會改用備用方式,或傳回 nil 並附上原因。
它不會直接讀取任何遊戲 API。
插件如何呼叫它
- 距離內計數 (widget)
local distance = addon:CreateConditionSlider() - 距離生命力百分比達到所需時間 (widget)
local health = addon:CreateConditionSlider()
相依項目
constructor→UI.condition_inputs.constructor
原始碼
UI/condition_inputs.lua,第 161 行。在遊戲中為唯讀;「複製」會產生一份可編輯的複本。
UI.condition_inputs.CreateConditionSlider(self)
local w=addon:AcquireConditionWidget('RM-ConditionSlider',function() return constructor(true) end)
---@cast w RMConditionInput
return w