Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Allow stealing of multiple items at once

lefreutlefreut Member Posts: 1,422
edited July 2016 in UI Modding
This tweak will allow thief to attempt to steal multiple items at once in shops. It should work for BG1EE, SoD and BG2EE.



First, search "name 'STORE_BUYSELL'" and before the menu section (before the `), add this function:
function canSteal()
local nb = 0
for _, v in pairs(store.storeItems) do
if v.highlight == 1 then
nb = nb + 1
end
end
return nb > 0 and nb + #store.groupItems <= 16
end</code>

Then search for the steal button (search "STEAL_BUTTON") and change the clickable and action lines with these:
clickable lua "canSteal()" action " local toSteal = {} for k, v in pairs(store.storeItems) do if v.highlight == 1 then table.insert(toSteal, v.item.name) for i=2, v.amountSelected do table.insert(toSteal, v.item.name) end storeScreen:SelectStoreItem(k - 1, false) end end for _, name in pairs(toSteal) do local steal = 0 for k, v in pairs(store.storeItems) do if v.highlight == 1 then steal = 0 break end if v.item.name == name then steal = k end end if steal == 0 then break end storeScreen:SelectStoreItem(steal - 1, true) storeScreen:OnStealItemButtonClick() end "

Post edited by lefreut on
AncientCowboymf2112Mr2150Avenger_teambgAbelbrusCrevsDaakKurona

Comments

Sign In or Register to comment.