JASS:
private static method saveWithLocal takes nothing returns boolean
local player tplay = GetTriggerPlayer()
local integer pnumb = GetPlayerId(tplay)
local NumberStack stack = BigInt.create(encryptionKey)
local string encrypted
local integer i = 1
local string s
set SaveTriggers[pnumb] = CreateTrigger()
set SaveDialog[pnumb] = DialogCreate()
call TriggerAddAction(SaveTriggers[pnumb], function thistype.onSaveDialogClick)
call SaveHeroLevel(udg_PlayerUnit[pnumb], stack)
call SaveGold(stack, tplay)
call SaveCustomInventory(stack, tplay)
call SaveHero(stack, tplay)
call DisplayTimedTextToPlayer(tplay,0,0,60,"Saving. . .")
set encrypted=EncryptNumber(stack, 1000000, 3, pnumb, "salt value", .85)
set encrypted=AddRepeatedString(encrypted,"-",4,0)
set encrypted=ColorCodeString(encrypted, "40e0d0", "ff69b4", "00AA00", "ffff00", 0)
call AddBoolean(101, true, tplay)
call SaveData(BankId, tplay)
call LoadData(BankId, tplay)
if ReadBoolean(101, tplay) != true then
call print("Your computer does not have localized storing enabled. Type '-write' and you will get further instructions to enable. Untill then, this code will overwrite your first slot")
call AddString(i + 20, "Level " + I2S(GetHeroLevel(udg_PlayerUnit[pnumb])) + " " + GetUnitName(udg_PlayerUnit[pnumb]), tplay)
call AddString(i, encrypted, tplay)
call SaveData(BankId, tplay)
else
loop
set s = ReadString(i + 20, tplay)
if StringLength(s) < 5 then
set SaveButtonArray[(i) + (pnumb * 22)] = DialogAddButton(SaveDialog[pnumb], "Empty Slot", i)
call TriggerRegisterDialogButtonEvent(SaveTriggers[pnumb], SaveButtonArray[(i - 22) + (pnumb * 22)])
call print(s)
else
set SaveButtonArray[(i) + (pnumb * 22)] = DialogAddButton(SaveDialog[pnumb], s, i)
call TriggerRegisterDialogButtonEvent(SaveTriggers[pnumb], SaveButtonArray[(i) + (pnumb * 22)])
call print(s)
endif
set i = i + 1
exitwhen i == 11
endloop
set SaveButtonArray[(21) + (pnumb * 22)] = DialogAddButton(SaveDialog[pnumb], "Other Page", 21)
call TriggerRegisterDialogButtonEvent(SaveTriggers[pnumb], SaveButtonArray[(21) + (pnumb * 22)])
set SaveButtonArray[(22) + (pnumb * 22)] = DialogAddButton(SaveDialog[pnumb], "Exit Dialog", 22)
call TriggerRegisterDialogButtonEvent(SaveTriggers[pnumb], SaveButtonArray[(22) + (pnumb * 22)])
call DialogDisplay(tplay, SaveDialog[pnumb], true)
set EncryptionString[pnumb] = encrypted
endif
call stack.destroy()
set tplay = null
return false
endmethod
call GroupEnumUnitsInRangeOfLoc( returns it
Ive been toying with it for a wihle and i just cant get it to work >.<
e/ forgot the "function" -.- i replaced the code with something else. The action thistype.onSaveDialogClick doesnt play when the button is clicked? but t