參考 Mixu's Legendary Lords 2 (Warlord Feskit added)
其中的 script/campaign/mod/mixu_le_tullaris.lua
他的某个英雄要点出坐骑需要完成任务,我就参考这个锁住的范例
下方的程式码只是我先禁用某个技能,不过没成功
脚本结果是我想要搜寻所有派系人物,只要不是玩家的都禁用该技能
这该怎么修改
function yun_tullaris()
local human_factions = cm:get_human_factions();
for i = 1, #human_factions do
yun_ggo
end -- end of playable factions check
end-- end of function
function yun_ggo()
core:add_listener(
"yun_PanelOpenedCampaign",
"PanelOpenedCampaign",
function(context) return context.string == "character_details_panel" end,
function(context)
local skill_UI = find_uicomponent(core:get_ui_root(), "character_details_panel", "background", "skills_subpanel", "listview", "list_clip", "list_box", "chain0", "chain", "wh2_skill_chakax_mount_carnosaur", "card")
skill_UI:SetDisabled(true)
skill_UI:SetState("locked")
end,
true
)
core:add_listener(
"yun_ComponentLClickUp",
"ComponentLClickUp",
function(context) return context.string == "skills" or context.string == "button_cycle_right" or context.string == "button_cycle_left"
end,
function(context)
cm:callback(function()
local skill_UI = find_uicomponent(core:get_ui_root(), "character_details_panel", "background", "skills_subpanel", "listview", "list_clip", "list_box", "chain0", "chain", "wh2_skill_chakax_mount_carnosaur", "card")
skill_UI:SetDisabled(true)
skill_UI:SetState("locked")
end, 0.1);
end,
true
)
end-- End of function
其中的 script/campaign/mod/mixu_le_tullaris.lua
他的某个英雄要点出坐骑需要完成任务,我就参考这个锁住的范例
下方的程式码只是我先禁用某个技能,不过没成功
脚本结果是我想要搜寻所有派系人物,只要不是玩家的都禁用该技能
这该怎么修改
function yun_tullaris()
local human_factions = cm:get_human_factions();
for i = 1, #human_factions do
yun_ggo
end -- end of playable factions check
end-- end of function
function yun_ggo()
core:add_listener(
"yun_PanelOpenedCampaign",
"PanelOpenedCampaign",
function(context) return context.string == "character_details_panel" end,
function(context)
local skill_UI = find_uicomponent(core:get_ui_root(), "character_details_panel", "background", "skills_subpanel", "listview", "list_clip", "list_box", "chain0", "chain", "wh2_skill_chakax_mount_carnosaur", "card")
skill_UI:SetDisabled(true)
skill_UI:SetState("locked")
end,
true
)
core:add_listener(
"yun_ComponentLClickUp",
"ComponentLClickUp",
function(context) return context.string == "skills" or context.string == "button_cycle_right" or context.string == "button_cycle_left"
end,
function(context)
cm:callback(function()
local skill_UI = find_uicomponent(core:get_ui_root(), "character_details_panel", "background", "skills_subpanel", "listview", "list_clip", "list_box", "chain0", "chain", "wh2_skill_chakax_mount_carnosaur", "card")
skill_UI:SetDisabled(true)
skill_UI:SetState("locked")
end, 0.1);
end,
true
)
end-- End of function