Total War: WARHAMMER II

Total War: WARHAMMER II

Quest Auto Resolver [Coop Supported]
 This topic has been pinned, so it's probably important
Banda  [developer] 2 Jan, 2022 @ 7:43am
Lua Code
Source Code

core:add_listener( "ms-autoresolve", "PanelOpenedCampaign", function(context) return context.string == "popup_pre_battle" end, function() local root_ui = core:get_ui_root(); local auto_resolve_sp_menu = find_uicomponent(root_ui, "popup_pre_battle", "mid", "regular_deployment", "button_set_attack"); local auto_resolve_sp_btn = find_uicomponent(auto_resolve_sp_menu, "button_autoresolve"); local auto_resolve_mp_menu = find_uicomponent(root_ui, "popup_pre_battle", "mid", "regular_deployment", "button_set_mp"); local auto_resolve_mp_btn = find_uicomponent(auto_resolve_mp_menu, "button_autoresolve"); if auto_resolve_mp_menu:Visible() then if auto_resolve_mp_btn and cm:pending_battle_cache_is_quest_battle() then auto_resolve_mp_btn:SetDisabled(false); auto_resolve_mp_btn:SetCurrentStateImageOpacity(0, 255); auto_resolve_mp_btn:SetCurrentStateImageOpacity(1, 255); auto_resolve_mp_btn:SetCurrentStateImageOpacity(2, 255); auto_resolve_mp_btn:SetOpacity(false, 255); auto_resolve_mp_btn:SetInteractive(true); end if auto_resolve_sp_btn and cm:pending_battle_cache_is_quest_battle() == false then auto_resolve_sp_btn:SetDisabled(false); end else if auto_resolve_sp_btn and cm:pending_battle_cache_is_quest_battle() then auto_resolve_sp_btn:SetDisabled(false); auto_resolve_sp_btn:SetCurrentStateImageOpacity(0, 255); auto_resolve_sp_btn:SetCurrentStateImageOpacity(1, 255); auto_resolve_sp_btn:SetCurrentStateImageOpacity(2, 255); auto_resolve_sp_btn:SetOpacity(false, 255); auto_resolve_sp_btn:SetInteractive(true); end if auto_resolve_sp_btn and cm:pending_battle_cache_is_quest_battle() == false then auto_resolve_sp_btn:SetDisabled(false); end end end, true);
Last edited by Banda; 2 Jan, 2022 @ 7:48am