` --reload language if(uiTranslationFile) then Infinity_DoFile("L_" .. uiTranslationFile) else Infinity_DoFile("L_en_us") end listMetaInfo = {} combatLog = {} Infinity_SetHighlightColors(20,107,102,204, 20,107,102,136, 20,107,102,0) lastRandomButtonSequence = -1 function getRandomButtonSequence(buttonImage) local ret = 0 repeat if buttonImage == "GUIBUTWS" then ret = Infinity_RandomNumber(0, 3) elseif buttonImage == "GUIBUTWT" then ret = Infinity_RandomNumber(0, 3) elseif buttonImage == "GUIBUTNT" then ret = Infinity_RandomNumber(0, 3) elseif buttonImage == "GUIBUTNS" then ret = Infinity_RandomNumber(0, 3) elseif buttonImage == "GUIBUTMT" then ret = Infinity_RandomNumber(0, 3) elseif buttonImage == "GUIBTBUT" then ret = Infinity_RandomNumber(0, 4) end until(lastRandomButtonSequence ~= ret) lastRandomButtonSequence = ret return ret end function showToggleHighlight(toggle) local ret = 0 if toggle == 1 then ret = 2 elseif toggle == true then ret = 2 end return ret end currentPanelID = 0 function displayRecordTHAC0() thactxt = '' thactxt = characters[currentID].THAC0.current if (characters[currentID].THAC0.offhand ) then thactxt = thactxt .. '\n' .. characters[currentID].THAC0.offhand end return thactxt end function displayRecordTHAC0Details() if characters[currentID].THAC0.detailsOffhand == nil or characters[currentID].THAC0.detailsOffhand == "" then return characters[currentID].THAC0.details else return characters[currentID].THAC0.details.."\n\n"..characters[currentID].THAC0.detailsOffhand end end function displayRecordDamage() local str = characters[currentID].damage.min .. '-' .. characters[currentID].damage.max if(characters[currentID].damage.minOffhand and characters[currentID].damage.maxOffhand) then str = str .. "\n" .. characters[currentID].damage.minOffhand .. '-' .. characters[currentID].damage.maxOffhand end return str end function displayRecordDamageDetails() if characters[currentID].damage.detailsOffhand == nil or characters[currentID].damage.detailsOffhand == "" then return characters[currentID].damage.details else return characters[currentID].damage.details.."\n\n"..characters[currentID].damage.detailsOffhand end end function displayCompiledAC() local compiledAC = characters[currentID].AC.current if characters[currentID].AC.crushing ~= 0 or characters[currentID].AC.missile ~= 0 or characters[currentID].AC.piercing ~= 0 or characters[currentID].AC.slashing ~= 0 then compiledAC = compiledAC .. " (" .. t("MODIFIERS_LABEL") .. ": " local numMods = 0 if characters[currentID].AC.crushing > 0 then numMods = numMods + 1 setStringTokenLua("","+"..characters[currentID].AC.crushing) compiledAC = compiledAC .. " " .. t("ACMOD_VS_CRUSHING") removeStringTokenLua("") elseif characters[currentID].AC.crushing < 0 then numMods = numMods + 1 setStringTokenLua("",characters[currentID].AC.crushing) compiledAC = compiledAC .. " " .. t("ACMOD_VS_CRUSHING") removeStringTokenLua("") end if characters[currentID].AC.missile > 0 then if numMods > 0 then compiledAC = compiledAC .. ", " end numMods = numMods + 1 setStringTokenLua("","+"..characters[currentID].AC.missile) compiledAC = compiledAC .. " " .. t("ACMOD_VS_MISSILE") removeStringTokenLua("") elseif characters[currentID].AC.missile < 0 then if numMods > 0 then compiledAC = compiledAC .. ", " end numMods = numMods + 1 setStringTokenLua("",characters[currentID].AC.missile) compiledAC = compiledAC .. " " .. t("ACMOD_VS_MISSILE") removeStringTokenLua("") end if characters[currentID].AC.piercing > 0 then if numMods > 0 then compiledAC = compiledAC .. ", " end numMods = numMods + 1 setStringTokenLua("","+"..characters[currentID].AC.piercing) compiledAC = compiledAC .. " " .. t("ACMOD_VS_PIERCING") removeStringTokenLua("") elseif characters[currentID].AC.piercing < 0 then if numMods > 0 then compiledAC = compiledAC .. ", " end numMods = numMods + 1 setStringTokenLua("",characters[currentID].AC.piercing) compiledAC = compiledAC .. " " .. t("ACMOD_VS_PIERCING") removeStringTokenLua("") end if characters[currentID].AC.slashing > 0 then if numMods > 0 then compiledAC = compiledAC .. ", " end numMods = numMods + 1 setStringTokenLua("","+"..characters[currentID].AC.slashing) compiledAC = compiledAC .. " " .. t("ACMOD_VS_SLASHING") removeStringTokenLua("") elseif characters[currentID].AC.slashing < 0 then if numMods > 0 then compiledAC = compiledAC .. ", " end numMods = numMods + 1 setStringTokenLua("",characters[currentID].AC.slashing) compiledAC = compiledAC .. " " .. t("ACMOD_VS_SLASHING") removeStringTokenLua("") end compiledAC = compiledAC .. ")" end return compiledAC end function displaySTR() strtxt = characters[currentID].attr.str.current if characters[currentID].attr.str.current == 18 and characters[currentID].attr.str.extra > 0 then if characters[currentID].attr.str.extra == 100 then strtxt = strtxt .. '/00' elseif characters[currentID].attr.str.extra > 9 then strtxt = strtxt .. '/' .. characters[currentID].attr.str.extra elseif characters[currentID].attr.str.extra > 0 then strtxt = strtxt .. '/0' .. characters[currentID].attr.str.extra end end if(characters[currentID].attr.str.current > characters[currentID].attr.str.base or characters[currentID].attr.str.extra > characters[currentID].attr.str.extraBase) then strtxt = '^G' .. strtxt .. '^-' end if(characters[currentID].attr.str.current < characters[currentID].attr.str.base or characters[currentID].attr.str.extra < characters[currentID].attr.str.extraBase) then strtxt = '^R' .. strtxt .. '^-' end return strtxt end function updateAttrTable() listItems = { } listTest = { } lastID = currentID helpTextString = '' showClassInfo = 0 showJustText = 0 showMemorized = 0 showBothLists = 0 showStats = 1 showAbilityBonuses = 0 otherlist = { } attributeItems = { { characters[currentID].attr.str, 9582 }, { characters[currentID].attr.dex, 9584 }, { characters[currentID].attr.con, 9583 }, { characters[currentID].attr.int, 9585 }, { characters[currentID].attr.wis, 9586 }, { characters[currentID].attr.cha, 9587 } } if currentTab == 1 then showJustText = 1 showStats = 0 helpTextString = characters[currentID].proficiencies.details elseif currentTab == 2 then showClassInfo = 1 showStats = 0 listItems = { { characters[currentID].classlevel.first, characters[currentID].classlevel.first }, { characters[currentID].classlevel.second, characters[currentID].classlevel.second }, { characters[currentID].classlevel.third, characters[currentID].classlevel.third }, } elseif currentTab == 3 then listItems = { { characters[currentID].proficiencies.lore.strRef, characters[currentID].proficiencies.lore.current }, { characters[currentID].proficiencies.reputation.strRef, characters[currentID].proficiencies.reputation.current, characters[currentID].proficiencies.reputation.helpStrRef }, } for k, v in ipairs(characters[currentID].proficiencies.class_skills) do table.insert(listItems, {v.strRef, v.current}) --table.insert(listItems, {v.helpStrRef, ''}) end showJustText = 1 showStats = 0 helpTextString = '' for k, v in ipairs(listItems) do if (v[3] == nil or v[3] == '') then helpTextString = helpTextString .. Infinity_FetchString( v[1]) .. ': ' .. v[2] .. '^-' .. '\n' else helpTextString = helpTextString .. Infinity_FetchString( v[1]) .. ': ' .. v[2] .. '^-' .. '\n' .. Infinity_FetchString(v[3]) ..'\n \n' end end elseif currentTab == 4 then listItems = { } showJustText = 1 showStats = 0 if openAdvance == 0 then for k, v in ipairs(listItems) do --Infinity_Log( 'v[2]'.. v[2]) helpTextString = helpTextString .. '^M' .. Infinity_FetchString( v[1]) .. ': '.. v[2] .. '^-' .. '\n' .. Infinity_FetchString(v[3]) ..'\n \n' end else for k, v in ipairs(listItems) do helpTextString = helpTextString .. '^M' .. Infinity_FetchString( v[1]) .. ': '.. v[2] .. '^-' ..'\n' end end elseif currentTab == 8 then listItems = { } for k, v in ipairs(characters[currentID].proficiencies.ability) do table.insert(listItems, {v.strRef, v.current, v.helpStrRef}) --table.insert(listItems, {v.helpStrRef, ''}) end showAbilityBonuses = 1 showJustText = 0 showStats = 0 for k, v in ipairs(listItems) do helpTextString = helpTextString .. '^M' .. v[2] .. '\n \n' end elseif currentTab == 9 then showJustText = 1 showStats = 0 helpTextString = '' table.insert(listItems, { 'HP_LABEL', characters[currentID].HP.current .. '/' .. characters[currentID].HP.max , characters[currentID].HP.details }) table.insert(listItems, { 'AC_LABEL', displayCompiledAC(), characters[currentID].AC.details }) table.insert(listItems, { 'NUM_ATTACKS_LABEL', characters[currentID].proficiencies.numAttacks.current, '' }) if characters[currentID].proficiencies.weapons.current ~= "" then table.insert(listItems, { 'PROFICIENCIES_LABEL', '', characters[currentID].proficiencies.weapons.current }) end if characters[currentID].proficiencies.fightingstyles.current ~= "" then table.insert(listItems, { 'FIGHTING_STYLES_LABEL', '', characters[currentID].proficiencies.fightingstyles.current }) end if ( characters[currentID].THAC0.detailsOffhand ~= nil and characters[currentID].THAC0.detailsOffhand ~= "" ) then table.insert(listItems, { 'MAIN_HAND_THAC0', characters[currentID].THAC0.current .. '\n' .. characters[currentID].THAC0.details .. '\n\n' .. t('OFF_HAND_THAC0')..': '..characters[currentID].THAC0.offhand .. '\n' .. characters[currentID].THAC0.detailsOffhand, '' }) else table.insert(listItems, { 'THAC0_LABEL', characters[currentID].THAC0.current, characters[currentID].THAC0.details }) end if ( characters[currentID].damage.maxOffhand ) then table.insert(listItems, { 'MAIN_HAND_DAMAGE', characters[currentID].damage.min .. '-' .. characters[currentID].damage.max .. '\n' .. characters[currentID].damage.details .. '\n\n' .. t('OFF_HAND_DAMAGE') .. ': ' .. characters[currentID].damage.minOffhand .. '-' .. characters[currentID].damage.maxOffhand .. '\n' .. characters[currentID].damage.detailsOffhand, ''}) else table.insert(listItems, { 'DAMAGE_LABEL', characters[currentID].damage.min .. '-' .. characters[currentID].damage.max, characters[currentID].damage.details}) end table.insert(listItems, { 'SAVING_THROWS_LABEL', '', characters[currentID].proficiencies.savingThrows }) table.insert(listItems, { 'RESISTANCES_LABEL', '', characters[currentID].proficiencies.resistances }) table.insert(listItems, { 'CURRENT_SCRIPT_LABEL', '', characters[currentID].proficiencies.currentScript }) for k, v in ipairs(listItems) do if (v[3] == '' or v[3] == nil) then helpTextString = helpTextString .. t(v[1]) .. ': '.. v[2] .. '^-' .. '\n\n' else helpTextString = helpTextString .. t(v[1]) .. ': '.. v[2] .. '^-' .. '\n' .. v[3] ..'\n\n' end end elseif currentTab == 6 then otherlist = { { characters[currentID].Stats.bestenemy.strRef, characters[currentID].Stats.bestenemy.current, ' ' }, { characters[currentID].Stats.timespent.strRef, characters[currentID].Stats.timespent.current, ' '}, { characters[currentID].Stats.favspell.strRef, characters[currentID].Stats.favspell.current, ' '}, { characters[currentID].Stats.favweapon.strRef, characters[currentID].Stats.favweapon.current, ' '}, } listItems = { { characters[currentID].Stats.partychapxp.strRef, characters[currentID].Stats.partychapxp.current .. '%', characters[currentID].Stats.partygamexp.current .. '%'}, { characters[currentID].Stats.partychapkills.strRef, characters[currentID].Stats.partychapkills.current .. '%', characters[currentID].Stats.partygamekills.current .. '%'}, { characters[currentID].Stats.chapxpvalue.strRef, characters[currentID].Stats.chapxpvalue.current, characters[currentID].Stats.gamexpvalue.current}, { characters[currentID].Stats.chapkills.strRef, characters[currentID].Stats.chapkills.current, characters[currentID].Stats.gamekills.current}, } elseif currentTab == 7 then listItems = { } showJustText = 1 showStats = 0 helpTextString = Infinity_FetchString(characters[currentID].biography) elseif currentTab == 5 then listItems = { } showJustText = 1 showStats = 0 helpTextString = characters[currentID].kitDesc else listItems = { } end characterViewable = characterScreen:IsCharacterViewable() showClassInfo = showClassInfo == 1 and characterViewable == true showJustText = showJustText == 1 and characterViewable == true showMemorized = showMemorized == 1 and characterViewable == true showBothLists = showBothLists == 1 and characterViewable == true showStats = showStats == 1 and characterViewable == true showAbilityBonuses = showAbilityBonuses == 1 and characterViewable == true end characters = {} currentID = 16974083 canLevelUp = 0 openAdvance = 0 notrealValue = 0 function trunc(str, len) if str:len() < len then return str else return str:sub(1,len) .. "..." end end function characterDescString(char) return Infinity_FetchString(char.race) .. "\n\n" .. Infinity_FetchString(char.alignment) .. "\n\n" .. Infinity_FetchString(char.gender) end function isStatModified(index) if (index == 1 ) then --strength return (characters[currentID].attr.str.current ~= characters[currentID].attr.str.base or characters[currentID].attr.str.extra ~= characters[currentID].attr.str.extraBase) else return attributeItems[index][1].current ~= attributeItems[index][1].base end end function displayAttr(index) str = 0 if (index == 1 ) then str = displaySTR() else str = displayBuff( attributeItems[index][1].current, attributeItems[index][1].base, 1) end return str end function getPercent(first, second) tempNumber = ( first/second ) *100 return tempNumber end function displayBuff( current, base, highisbetter) tmpstr = '' --Infinity_Log( current .. ' - '.. base ) if(highisbetter) then if(current > base) then tmpstr = '^G' .. current .. '^-' elseif (current < base) then tmpstr = '^R' .. current .. '^-' end else if(current > base) then tmpstr = '^R' .. current .. '^-' elseif (current < base) then tmpstr = '^G' .. current .. '^-' end end if(current == base) then tmpstr = current end return tmpstr end function getNextLevelString() local nextLevelXp = characters[currentID].level.nextLvlXp - characters[currentID].level.xp local str = "" if(nextLevelXp > 0) then str = t("NEXT_LEVEL_LABEL") str = str .. " " str = str .. nextLevelXp str = str .. " " str = str .. t("XP_LABEL") else str = t("READY_TO_LEVEL_LABEL") end return str end function CurrentlyInGame() if characterScreen:IsInGame() == true then return true else return false end end function getClassString() local out = characters[currentID].classlevel.first.details if ( characters[currentID].classlevel.second ) then out = out .. '\n\n' .. characters[currentID].classlevel.second.details end if ( characters[currentID].classlevel.third ) then out = out .. '\n\n' .. characters[currentID].classlevel.third.details end out = out .. '\n\n' .. characters[currentID].kitDesc return out end function addCharacterDetail(addBam, addFrame, addData) table.insert(characterDetails, {bam = addBam, frame = addFrame, data = addData}) end function buildCharacterDetails() characterDetails = {} local workingString = "" if characters[currentID].HP.current <= 0 then addCharacterDetail(nil,nil,Infinity_FetchString(11829)) --dead end if characters[currentID].classlevel.second then local strRef = 19722 --dual class if characters[currentID].classlevel.second.active then strRef = 19721 --multi class end addCharacterDetail(nil,nil,Infinity_FetchString(strRef)) addCharacterDetail(nil,nil,"") end addCharacterDetail(nil,nil,characters[currentID].classlevel.first.details) if characters[currentID].classlevel.second then addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,characters[currentID].classlevel.second.details) end if characters[currentID].classlevel.third then addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,characters[currentID].classlevel.third.details) end if next(characters[currentID].statusEffects) ~= nil then addCharacterDetail(nil,nil,"") for k, v in pairs(characters[currentID].statusEffects) do addCharacterDetail(v.bam,v.current,Infinity_FetchString(v.strRef)) end end addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,t("PROFICIENCIES_LABEL")) workingString = Infinity_FetchString(characters[currentID].proficiencies.baseTHAC0.strRef) .. ": " .. characters[currentID].proficiencies.baseTHAC0.current addCharacterDetail(nil,nil,workingString) workingString = Infinity_FetchString(characters[currentID].proficiencies.THAC0Right.strRef) .. ": " .. characters[currentID].proficiencies.THAC0Right.current addCharacterDetail(nil,nil,workingString) if characters[currentID].proficiencies.THAC0Left then workingString = Infinity_FetchString(characters[currentID].proficiencies.THAC0Left.strRef) .. ": " .. characters[currentID].proficiencies.THAC0Left.current addCharacterDetail(nil,nil,workingString) end workingString = Infinity_FetchString(characters[currentID].proficiencies.numAttacks.strRef) .. ": " .. characters[currentID].proficiencies.numAttacks.current addCharacterDetail(nil,nil,workingString) workingString = Infinity_FetchString(characters[currentID].proficiencies.lore.strRef) .. ": " .. characters[currentID].proficiencies.lore.current addCharacterDetail(nil,nil,workingString) workingString = Infinity_FetchString(characters[currentID].proficiencies.reputation.strRef) .. ": " .. characters[currentID].proficiencies.reputation.current addCharacterDetail(nil,nil,workingString) if next(characters[currentID].proficiencies.class_skills) ~= nil then for k, v in ipairs(characters[currentID].proficiencies.class_skills) do workingString = Infinity_FetchString(v.strRef) .. ": " .. v.current addCharacterDetail(nil,nil,workingString) end end workingString = t("CURRENT_SCRIPT_LABEL") .. ": " .. characters[currentID].proficiencies.currentScript addCharacterDetail(nil,nil,workingString) addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,Infinity_FetchString(17379)) --saving throws workingString = Infinity_FetchString(characters[currentID].proficiencies.saveDeath.strRef) .. ": " .. characters[currentID].proficiencies.saveDeath.current addCharacterDetail(nil,nil,workingString) workingString = Infinity_FetchString(characters[currentID].proficiencies.saveWand.strRef) .. ": " .. characters[currentID].proficiencies.saveWand.current addCharacterDetail(nil,nil,workingString) workingString = Infinity_FetchString(characters[currentID].proficiencies.savePoly.strRef) .. ": " .. characters[currentID].proficiencies.savePoly.current addCharacterDetail(nil,nil,workingString) workingString = Infinity_FetchString(characters[currentID].proficiencies.saveBreath.strRef) .. ": " .. characters[currentID].proficiencies.saveBreath.current addCharacterDetail(nil,nil,workingString) workingString = Infinity_FetchString(characters[currentID].proficiencies.saveSpell.strRef) .. ": " .. characters[currentID].proficiencies.saveSpell.current addCharacterDetail(nil,nil,workingString) addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,t("PROFICIENCIES_LABEL")) addCharacterDetail(nil,nil,characters[currentID].proficiencies.weapons.current) if characters[currentID].proficiencies.fightingstyles.current ~= "" then addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,t("FIGHTING_STYLES_LABEL")) addCharacterDetail(nil,nil,characters[currentID].proficiencies.fightingstyles.current) end if characters[currentID].proficiencies.crushingACMod ~= nil or characters[currentID].proficiencies.missileACMod ~= nil or characters[currentID].proficiencies.piercingACMod ~= nil or characters[currentID].proficiencies.slashingACMod ~= nil then addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,Infinity_FetchString(11766)) --armour class modifiers if characters[currentID].proficiencies.crushingACMod ~= nil then workingString = Infinity_FetchString(characters[currentID].proficiencies.crushingACMod.strRef) .. ": " .. characters[currentID].proficiencies.crushingACMod.current addCharacterDetail(nil,nil,workingString) end if characters[currentID].proficiencies.missileACMod ~= nil then workingString = Infinity_FetchString(characters[currentID].proficiencies.missileACMod.strRef) .. ": " .. characters[currentID].proficiencies.missileACMod.current addCharacterDetail(nil,nil,workingString) end if characters[currentID].proficiencies.piercingACMod ~= nil then workingString = Infinity_FetchString(characters[currentID].proficiencies.piercingACMod.strRef) .. ": " .. characters[currentID].proficiencies.piercingACMod.current addCharacterDetail(nil,nil,workingString) end if characters[currentID].proficiencies.slashingACMod ~= nil then workingString = Infinity_FetchString(characters[currentID].proficiencies.slashingACMod.strRef) .. ": " .. characters[currentID].proficiencies.slashingACMod.current addCharacterDetail(nil,nil,workingString) end end addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,t("ABILITIES_TITLE")) for k, v in ipairs(characters[currentID].proficiencies.ability) do addCharacterDetail(nil,nil,v.current) end addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,t("RESISTANCES_LABEL")) addCharacterDetail(nil,nil,characters[currentID].proficiencies.resistances) if characters[currentID].proficiencies.weaponStyleBonus ~= nil then addCharacterDetail(nil,nil,"") addCharacterDetail(nil,nil,Infinity_FetchString(32131)) --weapon style bonuses addCharacterDetail(nil,nil,characters[currentID].proficiencies.weaponStyleBonus) end return characterDetails end listItems = { } listTest = { } characterDetails = {} helpTextString = '' currentTabIndex = 0 currentTab = 0 currentItem = 0 ShowClassInfo = 0 showStats = 0 showJustText = 0 showMemorized = 0 showBothLists = 0 characterViewable = true ` menu { name 'CHARACTER' modal lua "not CurrentlyInGame()" align center center ignoreEsc onopen " currentTab = 1 currentTabIndex = 1 currentItem = 0 showStats = 0 showJustText = 0 showClassInfo = 0 showAbilityBonuses = 0 showMemorized = 0 showBothLists = 0 characterViewable = true if(CurrentlyInGame()) then pushSidebars() end updateAttrTable() if(currentPanelID == const.EXPORT_ID) then Infinity_PushMenu('CHARACTER_EXPORT') else if(currentPanelID == const.CUSTOMIZE_ID) then Infinity_PushMenu('CHARACTER_CUSTOMIZE') else currentPanelID = 0 end end characterDetails = buildCharacterDetails() " onclose " popSidebars() Infinity_PopMenu('CHARACTER_CUSTOMIZE') Infinity_PopMenu('CHARACTER_BIOGRAPHY') Infinity_PopMenu('CHARACTER_SHOW_BIOGRAPHY') Infinity_PopMenu('CHARACTER_INFO') Infinity_PopMenu('CHARACTER_SCRIPT') Infinity_PopMenu('CHARACTER_EXPORT') Infinity_PopMenu('CHARACTER_SOUND') Infinity_PopMenu('CHARACTER_COLOR') Infinity_PopMenu('CHARACTER_SHOW_CLASSINFO') Infinity_PopMenu('CHARGEN_PORTRAIT') currentPanelID = 0 " label { area 0 0 864 709 mosaic "GUIRECBG" } label { area 82 6 700 44 text "CHARACTER_SHEET_LABEL" text style "title" } label { name "LABEL_2_268435495" area 150 50 210 34 text lua "characters[currentID].name" text style 'label' text align center center enabled "characterViewable" } label { name "LABEL_2_268435495" area 526 50 200 38 text lua "characters[currentID].class" text style 'label' text align center center enabled "characterViewable" } label { area 24 112 216 34 text lua "Infinity_FetchString( attributeItems[1][1].strRef)" text style 'label' text align right center enabled "characterViewable" } label { area 252 112 88 34 text lua "displayAttr(1)" --"listItems[1][1].current" text style 'label' text align center center enabled "characterViewable" } label { area 24 152 216 38 text lua "Infinity_FetchString( attributeItems[2][1].strRef)" text style 'label' text align right center enabled "characterViewable" } label { area 252 152 88 38 text lua "displayAttr(2)" --"listItems[2][1].current" text style 'label' text align center center enabled "characterViewable" } label { area 24 197 216 38 text lua "Infinity_FetchString( attributeItems[3][1].strRef)" text style 'label' text align right center enabled "characterViewable" } label { area 252 197 88 38 text lua "displayAttr(3)" --"listItems[3][1].current" text style 'label' text align center center enabled "characterViewable" } label { area 24 241 216 38 text lua "Infinity_FetchString( attributeItems[4][1].strRef)" text style 'label' text align right center enabled "characterViewable" } label { area 252 241 88 38 text lua "displayAttr(4)" --"listItems[4][1].current" text style 'label' text align center center enabled "characterViewable" } label { area 24 286 216 34 text lua "Infinity_FetchString( attributeItems[5][1].strRef)" text style 'label' text align right center enabled "characterViewable" } label { area 252 286 88 34 text lua "displayAttr(5)" --"listItems[5][1].current" text style 'label' text align center center enabled "characterViewable" } label { area 24 328 216 38 text lua "Infinity_FetchString( attributeItems[6][1].strRef)" text style 'label' text align right center enabled "characterViewable" } label { area 252 328 88 38 text lua "displayAttr(6)" --"listItems[6][1].current" text style 'label' text align center center enabled "characterViewable" } button { name "BUTTON_2_2" area 352 108 168 268 --text lua "characters[currentID].portrait" text align center center text point 10 text color B bitmap lua "characters[currentID].portrait" action " Infinity_Log(dump(characters, 0)) " } label { area 356 394 156 108 text lua "characterDescString(characters[currentID])" text style 'list' text align center center enabled "characterViewable" } -- ability bonus stuff list { column { width 100 label { area 0 0 -1 -1 text lua "listItems[rowNumber][2]" text style 'normal' text align left center } } area 50 182 342 418 enabled "showAbilityBonuses" rowheight 45 table "listItems" var currentItem scrollbar 'GUISCRC' hidehighlight action " --helpTextString = Infinity_FetchString( listItems[currentItem][1].helpStrRef) " } list { column { width 100 label { area 0 0 -1 -1 enabled "characterDetails[rowNumber].bam == nil" text lua "characterDetails[rowNumber].data" text style 'label' text align left center } label { area 0 2 22 -1 enabled "characterDetails[rowNumber].bam ~= nil" bam lua "characterDetails[rowNumber].bam" sequence lua "characterDetails[rowNumber].frame" text align left center } label { area 22 0 -1 -1 enabled "characterDetails[rowNumber].bam ~= nil" text lua "characterDetails[rowNumber].data" text style 'label' text align left center } } area 540 108 304 264 rowheight dynamic table characterDetails hidehighlight scrollbar 'GUISCRC' enabled "characterViewable" } label { area 24 410 46 44 text lua "characters[currentID].AC.current" text style 'label' text align center center enabled "characterViewable" } text { area 96 402 248 70 text lua "characters[currentID].AC.details" text style 'label' text align left top scrollbar 'GUISCRC' enabled "characterViewable" } label { area 24 496 46 44 text lua "characters[currentID].HP.current .. '\n' .. characters[currentID].HP.max" text style 'label' text align center center enabled "characterViewable" } text { area 96 490 248 76 text lua "characters[currentID].HP.details" text style 'label' text align left top scrollbar 'GUISCRC' enabled "characterViewable" } label { area 535 416 47 46 text lua "displayRecordTHAC0()" text style 'label' text align center center enabled "characterViewable" } text { area 606 402 242 66 text lua "displayRecordTHAC0Details()" text style 'label' text align left top scrollbar 'GUISCRC' enabled "characterViewable" } label { area 534 508 44 40 text lua "displayRecordDamage()" text style 'label' text align center center enabled "characterViewable" } text { area 606 490 248 80 text lua "displayRecordDamageDetails()" text style 'label' text align left top scrollbar 'GUISCRC' enabled "characterViewable" } button { enabled "CurrentlyInGame()" name "BUTTON_2_50" area 652 608 200 42 text "CUSTOMIZE_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" sequence 0 clickable lua "characterScreen:IsMultiPlayerModifyable()" action " characterScreen:OnCustomizeButtonClick(); " } button { enabled "CurrentlyInGame()" name "BUTTON_2_36" area 652 655 200 42 text "EXPORT_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "characterScreen:IsExportButtonClickable()" action " characterScreen:OnExportButtonClick(); " } button { enabled "CurrentlyInGame()" clickable lua "characterScreen:IsReformPartyButtonClickable()" name "BUTTON_2_51" area 14 655 200 42 text "REFORM_PARTY_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" action "characterScreen:OnReformPartyButtonClick();" } button { enabled "CurrentlyInGame()" name "BUTTON_2_0" area 226 608 200 42 text "DUAL_CLASS_BUTTON" text style "button" pad 10 4 10 4 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "characterScreen:IsDualClassButtonClickable()" action " popup2Button('DUALCLASS_CONFIRMATION', 'YES_BUTTON', function() characterScreen:OnDualClassButtonClick() end, 'NO_BUTTON') " } button { enabled "CurrentlyInGame()" name "BUTTON_2_37" area 440 608 200 42 text "LEVEL_UP_BUTTON" text style "button" pad 10 4 10 4 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "characterScreen:IsLevelUpButtonClickable()" action " characterScreen:OnLevelUpButtonClick();" } button { area 14 608 200 42 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text 'INFORMATION_BUTTON' text style "button" pad 10 4 10 4 clickable lua "characterViewable" action "Infinity_PushMenu('CHARACTER_INFO')" } button { area 280 655 302 42 bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text 'KIT_DESC_LABEL' text style "button" pad 10 4 10 4 clickable lua "characterViewable" action "Infinity_PushMenu('CHARACTER_SHOW_CLASSINFO')" } button { enabled "not CurrentlyInGame()" area 334 608 200 42 text "DONE_BUTTON" text style "button" bam GUIBUTNT sequence 3 action "Infinity_PopMenu()" } } menu { name 'CHARACTER_CUSTOMIZE' align center center modal ignoreesc onOpen " currentPanelID = const.CUSTOMIZE_ID " label { area 0 0 864 710 mosaic GUICGWDE } text { area 382 104 442 506 text 11327 --Customize help text scrollbar 'GUISCRC' text style normal text color 'D' } label { area 48 34 772 52 text "CUSTOMIZE_TITLE" text style title } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 100 340 32 text style "button" text "APPEARANCE_BUTTON" clickable lua " characterScreen:IsAppearanceButtonClickable(); " action " --characterScreen:OnAppearanceButtonClick() createCharScreen:SetSpriteId(currentID) createCharScreen:SetEngineState(6) createCharScreen:ShowPortraitPanel() " } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 136 340 32 text style "button" text "SOUNDS_BUTTON" clickable lua " characterScreen:IsAppearanceButtonClickable(); " action " characterScreen:OnSoundsButtonClick() " } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 172 340 32 text style "button" text "COLORS_BUTTON" clickable lua " characterScreen:IsAppearanceButtonClickable(); " action " characterScreen:OnHairSkinButtonClick() " } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 208 340 32 text style "button" text "SCRIPT_BUTTON" action " characterScreen:OnScriptButtonClick() " } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 244 340 32 text style "button" text "BIOGRAPHY_BUTTON" clickable lua " characterScreen:IsAppearanceButtonClickable(); " action " characterScreen:OnCusomizeBiographyButtonClick() " } button { on escape bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 198 653 234 44 text style "button" text "CANCEL_BUTTON" action " characterScreen:OnCancelButtonClick() currentPanelID = 0 Infinity_PopMenu('CHARACTER_CUSTOMIZE') " } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 438 653 232 44 text style "button" text "DONE_BUTTON" action " characterScreen:OnDoneButtonClick() buildCharacterDetails() currentPanelID = 0 Infinity_PopMenu('CHARACTER_CUSTOMIZE') " } } ` recBioEdit = "" recBioEditBackup = "" ` menu { name 'CHARACTER_BIOGRAPHY' align center center ignoreesc onOpen " recBioEditBackup = recBioEdit currentPanelID = 23 " label { area 0 0 864 710 mosaic GUICGWDE } label { area 48 38 774 44 text "BIOGRAPHY_TITLE" text style 'title' } edit { name "recBioEditArea" area 378 96 464 494 var recBioEdit scrollbar 'GUISCRC' text style "edit" } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 100 340 32 text style "button" text "CLEAR_BUTTON" action " recBioEdit = '' " } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 136 340 32 text style "button" text "DONE_BUTTON" action " characterScreen:OnDoneButtonClick() Infinity_PopMenu() currentPanelID = 17 " } button { bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 172 340 32 text style "button" text "REVERT_BUTTON" action " recBioEdit = recBioEditBackup " } button { on escape bam 'GUIBUTWS' sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" area 24 208 340 32 text style "button" text "CANCEL_BUTTON" action " characterScreen:OnCancelButtonClick() Infinity_PopMenu() currentPanelID = 17 " } } menu { name 'CHARACTER_SHOW_BIOGRAPHY' align center center onOpen " recBioEdit = Infinity_FetchString(characters[currentID].biography) recBioEditBackup = recBioEdit currentPanelID = 23 " label { area 0 0 864 710 mosaic GUIPOPF } label { area 46 30 776 60 text "BIOGRAPHY_TITLE" text style 'title' } text { area 40 98 788 500 text lua recBioEdit scrollbar 'GUISCRC' text style "edit" } button { on escape bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" area 280 652 298 44 text style "button" text "DONE_BUTTON" action " Infinity_PopMenu() " } } menu { name 'CHARACTER_SHOW_CLASSINFO' align center center ignoreesc onOpen " recBioEditBackup = recBioEdit currentPanelID = 23 " label { area 0 0 864 710 mosaic GUIPOPF } label { area 46 30 776 60 text "KIT_DESC_LABEL" text style 'title' } text { area 40 98 788 500 text lua "getClassString()" scrollbar 'GUISCRC' text style "edit" text color 'D' } button { bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" area 280 652 298 44 text style "button" text "DONE_BUTTON" action " Infinity_PopMenu() " } } menu { name 'CHARACTER_INFO' align center center ignoreesc onOpen " recBioEditBackup = recBioEdit currentPanelID = 23 " label { area 0 0 864 710 mosaic GUISTATS } label { area 84 12 700 44 text "ASSIGN_KEYS_PAGE_CHARACTERINFORMATION" text style 'title' } label { area 250 60 184 40 text lua "characters[currentID].name" text style 'label' } label { area 434 60 182 40 text lua "characters[currentID].class" text style 'label' } label { area 36 118 408 34 text lua "Infinity_FetchString(characters[currentID].Stats.bestenemy.strRef)" text style 'label' text align right center } label { area 496 118 328 34 text lua "characters[currentID].Stats.bestenemy.current" text style 'label' text align left center } label { area 36 184 408 34 text lua "Infinity_FetchString(characters[currentID].Stats.timespent.strRef)" text style 'label' text align right center } label { area 496 184 328 34 text lua "characters[currentID].Stats.timespent.current" text style 'label' text align left center } label { area 36 254 408 34 text lua "Infinity_FetchString(characters[currentID].Stats.favspell.strRef)" text style 'label' text align right center } label { area 496 254 328 34 text lua "characters[currentID].Stats.favspell.current" text style 'label' text align left center } label { area 36 328 408 34 text lua "Infinity_FetchString(characters[currentID].Stats.favweapon.strRef)" text style 'label' text align right center } label { area 496 328 328 34 text lua "characters[currentID].Stats.favweapon.current" text style 'label' text align left center } label { area 36 386 416 34 text "CHAPTER_LABEL" text style 'label' text align left center } label { area 488 386 336 34 text "GAME_LABEL" text style 'label' text align right center } label { area 36 444 100 34 text lua "characters[currentID].Stats.partychapxp.current .. '%'" text style 'label' } label { area 170 444 520 34 text lua "Infinity_FetchString(characters[currentID].Stats.partychapxp.strRef)" text style 'label' } label { area 724 444 100 34 text lua "characters[currentID].Stats.partygamexp.current .. '%'" text style 'label' } label { area 36 488 100 34 text lua "characters[currentID].Stats.partychapkills.current .. '%'" text style 'label' } label { area 170 488 520 34 text lua "Infinity_FetchString(characters[currentID].Stats.partychapkills.strRef)" text style 'label' } label { area 724 488 100 34 text lua "characters[currentID].Stats.partygamekills.current .. '%'" text style 'label' } label { area 36 532 100 34 text lua "characters[currentID].Stats.chapxpvalue.current" text style 'label' } label { area 170 532 520 34 text lua "Infinity_FetchString(characters[currentID].Stats.chapxpvalue.strRef)" text style 'label' } label { area 724 532 100 34 text lua "characters[currentID].Stats.gamexpvalue.current" text style 'label' } label { area 36 576 100 34 text lua "characters[currentID].Stats.chapkills.current" text style 'label' } label { area 170 576 520 34 text lua "Infinity_FetchString(characters[currentID].Stats.chapkills.strRef)" text style 'label' } label { area 724 576 100 34 text lua "characters[currentID].Stats.gamekills.current" text style 'label' } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 210 653 234 44 text style "button" text "BIOGRAPHY_BUTTON" action " Infinity_PushMenu('CHARACTER_SHOW_BIOGRAPHY') " } button { on escape bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 464 653 232 44 text style "button" text "DONE_BUTTON" action " characterScreen:OnDoneButtonClick() Infinity_PopMenu() currentPanelID = 17 " } } ` scriptList_idx = 0 showingSmartOptions = false function formatScriptName(text) local i = string.find(text, ":", #text) if(i) then text = string.sub(text,1, i - 1) end if(#text > 35) then text = string.sub(text,1, 35) text = text .. "..." end return text end scriptOptions = { {'SCRIPT_ATTACK_ENEMIES_LABEL', 'SCRIPT_ATTACK_ENEMIES_DESCRIPTION', 1, 0, 0}, {'SCRIPT_USE_MELEE_WEAPONS_LABEL', 'SCRIPT_USE_MELEE_WEAPONS_DESCRIPTION', 2, 0, 0}, {'SCRIPT_USE_RANGED_WEAPONS_LABEL', 'SCRIPT_USE_RANGED_WEAPONS_DESCRIPTION', 3, 0, 0}, {'SCRIPT_USE_ITEMS_LABEL', 'SCRIPT_USE_ITEMS_DESCRIPTION', 4, 0, 0}, {'SCRIPT_USE_SPECIAL_ABILITIES_LABEL', 'SCRIPT_USE_SPECIAL_ABILITIES_DESCRIPTION', 5, 0, 0}, {'SCRIPT_USE_OFFENSIVE_SPELLS_LABEL', 'SCRIPT_USE_OFFENSIVE_SPELLS_DESCRIPTION', 6, 0, 0}, {'SCRIPT_USE_DEFENSIVE_SPELLS_LABEL', 'SCRIPT_USE_DEFENSIVE_SPELLS_DESCRIPTION', 7, 0, 0}, {'SCRIPT_FIND_TRAPS_LABEL', 'SCRIPT_FIND_TRAPS_DESCRIPTION', 8, 0, 0}, {'SCRIPT_HIDE_IN_SHADOWS_LABEL', 'SCRIPT_HIDE_IN_SHADOWS_DESCRIPTION', 9, 0, 0}, {'SCRIPT_SING_BATTLESONG_LABEL', 'SCRIPT_SING_BATTLESONG_DESCRIPTION', 10, 0, 0}, {'SCRIPT_TURN_UNDEAD_LABEL', 'SCRIPT_TURN_UNDEAD_DESCRIPTION', 11, 0, 0} } function handleScriptOptionChange(option) local wasOn = scriptOptions[option][4] == 2 if option == 2 then --Melee if wasOn == true then scriptOptions[option][4] = 0 scriptOptions[option][5] = false else scriptOptions[option][4] = 2 scriptOptions[option][5] = true scriptOptions[option+1][4] = 0 scriptOptions[option+1][5] = false end elseif option == 3 then --Ranged if wasOn == true then scriptOptions[option][4] = 0 scriptOptions[option][5] = false else scriptOptions[option][4] = 2 scriptOptions[option][5] = true scriptOptions[option-1][4] = 0 scriptOptions[option-1][5] = false end elseif option == 8 then --Find Traps if wasOn == true then scriptOptions[option][4] = 0 scriptOptions[option][5] = false else scriptOptions[option][4] = 2 scriptOptions[option][5] = true scriptOptions[option+1][4] = 0 scriptOptions[option+1][5] = false scriptOptions[option+2][4] = 0 scriptOptions[option+2][5] = false scriptOptions[option+3][4] = 0 scriptOptions[option+3][5] = false end elseif option == 9 then --Hide if wasOn == true then scriptOptions[option][4] = 0 scriptOptions[option][5] = false else scriptOptions[option][4] = 2 scriptOptions[option][5] = true scriptOptions[option-1][4] = 0 scriptOptions[option-1][5] = false scriptOptions[option+1][4] = 0 scriptOptions[option+1][5] = false scriptOptions[option+2][4] = 0 scriptOptions[option+2][5] = false end elseif option == 10 then --Sing if wasOn == true then scriptOptions[option][4] = 0 scriptOptions[option][5] = false else scriptOptions[option][4] = 2 scriptOptions[option][5] = true scriptOptions[option-2][4] = 0 scriptOptions[option-2][5] = false scriptOptions[option-1][4] = 0 scriptOptions[option-1][5] = false scriptOptions[option+1][4] = 0 scriptOptions[option+1][5] = false end elseif option == 11 then --Turn if wasOn == true then scriptOptions[option][4] = 0 scriptOptions[option][5] = false else scriptOptions[option][4] = 2 scriptOptions[option][5] = true scriptOptions[option-3][4] = 0 scriptOptions[option-3][5] = false scriptOptions[option-2][4] = 0 scriptOptions[option-2][5] = false scriptOptions[option-1][4] = 0 scriptOptions[option-1][5] = false end else scriptOptions[option][4] = toggleFrame(scriptOptions[option][4]) if scriptOptions[option][4] == 0 then scriptOptions[option][5] = false else scriptOptions[option][5] = true end end end ` menu { name 'CHARACTER_SCRIPT' align center center ignoreesc onOpen " doneEnabled = characterScreen:IsDoneButtonClickable(currentID) currentPanelID = const.SCRIPT_ID showingSmartOptions = false for index, var in pairs(scriptOptions) do var[5] = characterScreen:GetTempSmartScriptLocal(var[3]) if var[5] == false then var[4] = 0 else var[4] = 2 end end " label { area 0 0 864 710 mosaic GUICHISD } label { area 84 12 700 44 text "SCRIPT_TITLE" text style 'title' } label { area 418 454 424 164 rectangle 3 enabled "showingSmartOptions == true" } label { area 36 120 788 44 text "CURRENT_SCRIPT_LABEL" text style 'label' } text { area 460 480 348 120 text lua "scriptDescription" scrollbar 'GUISCRC' text style normal enabled "showingSmartOptions == true" } text { area 446 190 376 422 text lua "scriptDescription" scrollbar 'GUISCRC' text style normal text color 'D' enabled "showingSmartOptions == false" } list { column { width 100 label { area 0 0 -1 -1 enabled "scriptList[rowNumber] ~= ''" text lua "formatScriptName(scriptList[rowNumber])" text style "normal" text color 'D' pad 8 0 0 0 } label { area -10 -10 10000 10000 enabled "scriptList[rowNumber] == ''" rectangle 1 } } area 40 194 360 414 rowheight 18 table "scriptList" var "scriptList_idx" scrollbar 'GUISCRC' action " showingSmartOptions = false if scriptList[scriptList_idx] ~= '' then Infinity_OnScriptItemSelect(scriptList_idx - 1) doneEnabled = characterScreen:IsDoneButtonClickable(currentID) else scriptList_idx = 0 scriptDescription = '' doneEnabled = false end " } list { column { width 80 label { area 10 0 -1 -1 text lua "t( scriptOptions[rowNumber][1])" text style "normal" text align right center } } column { width 20 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "scriptOptions[rowNumber][4]" } } area 444 194 376 266 rowheight 50 table "scriptOptions" var selScriptOpt scrollbar 'GUISCRC' enabled "showingSmartOptions == true" action " scriptDescription = t(scriptOptions[selScriptOpt][2]) selectedSL = 0 selFeedOpt = 0 if(cellNumber == 2) then Infinity_PlaySound('GAM_09') handleScriptOptionChange(selScriptOpt) end " } button { on escape bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 210 653 236 44 text style "button" text "CANCEL_BUTTON" action " characterScreen:OnCancelButtonClick() Infinity_PopMenu() currentPanelID = 17 " } button { clickable lua "doneEnabled" bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 464 653 236 44 text style "button" text "DONE_BUTTON" action " if showingSmartOptions == true then for index, var in pairs(scriptOptions) do characterScreen:SetTempSmartScriptLocal(var[3], var[5]) end end characterScreen:OnDoneButtonClick() Infinity_PopMenu() currentPanelID = 17 " } } ` list_GUIREC_13_0_idx = 0 characterExportCharacterEdit = "" ` menu { name 'CHARACTER_EXPORT' align center center modal ignoreEsc onOpen " currentPanelID = const.EXPORT_ID; Infinity_FocusTextEdit('characterExportCharacterEditArea'); " label { area 0 0 870 714 mosaic GUICGSND } label { area 50 38 768 38 text "EXPORT_TITLE" text style title } list { column { width 100 label { area 0 0 -1 -1 text lua "list_GUIREC_13_0[rowNumber]" text style "list" text color 'D' } } rowheight 18 area 38 88 332 288 table "list_GUIREC_13_0" var "list_GUIREC_13_0_idx" scrollbar 'GUISCRC' action " Infinity_OnCharacterItemSelect(list_GUIREC_13_0_idx - 1) " } label { area 38 376 206 34 text "EXPORT_FILENAME_LABEL" text style "label" text align left center text color 3 } edit { name "characterExportCharacterEditArea" area 38 406 326 24 var characterExportCharacterEdit text style "edit" maxlines 1 rectangle 1 action " if(characterExportCharacterEdit:len() > 7 and key_pressed ~= 8) then return 0 else Infinity_UpdateCharacterRecordExportPanel() return 1 end " } text { area 400 88 440 504 text 10962 text style normal text color 'D' scrollbar 'GUISCRC' } button { on escape sequence 0 area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text style "button" text "CANCEL_BUTTON" action " characterScreen:OnCancelButtonClick() Infinity_PopMenu('CHARACTER_EXPORT') currentPanelID = 0 " } button { clickable lua "characterScreen:IsDoneButtonClickable(currentID)" sequence 0 area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text style "button" text "DONE_BUTTON" action " characterScreen:OnDoneButtonClick() " } } ` list_GUIREC_20_5_idx = 0 doneEnabled = 0 ` menu { name 'CHARACTER_SOUND' align center center ignoreesc onOpen " currentPanelID = const.SOUND_ID Infinity_OnSoundItemSelect(0) doneEnabled = characterScreen:IsDoneButtonClickable(currentID) " label { area 0 0 864 710 mosaic GUICGSND } label { area 216 36 438 44 text "SOUND_TITLE" text style 'title' } list { column { width 100 label { area 0 0 -1 -1 text lua "getFileNameStringRef(rowNumber, list_GUIREC_20_5)" text style "list" pad 8 0 0 0 } } area 36 88 332 348 rowheight 18 table "list_GUIREC_20_5" var "list_GUIREC_20_5_idx" scrollbar 'GUISCRC' action " Infinity_OnSoundItemSelect(list_GUIREC_20_5_idx - 1) doneEnabled = characterScreen:IsDoneButtonClickable(currentID) " } text { area 400 88 440 512 text 11315 scrollbar 'GUISCRC' text style normal text color 'D' } button { clickable lua "list_GUIREC_20_5_idx" bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" area 46 462 300 44 text style "button" text "PLAY_SOUND_BUTTON" action " characterScreen:OnPlayButtonClick(); " } button { on escape bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 198 653 232 44 text style "button" text "CANCEL_BUTTON" action " characterScreen:OnCancelButtonClick() Infinity_PopMenu() currentPanelID = 17 " } button { clickable lua "doneEnabled" bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 438 653 232 44 text style "button" text "DONE_BUTTON" action " characterScreen:OnDoneButtonClick() Infinity_PopMenu() currentPanelID = 17 " } } ` function toggleFrame(curFrame) if curFrame == 0 then return 2 else return 0 end end function getSelected(cur, my) if cur == my then return 1 else return 0 end end function findToggleTitleOption(option) local ret = -1 for index = 1, #toggleTitles, 1 do if toggleTitles[index][3] == option then ret = index end end return ret end function shouldShowStoryModeFakes() local ret = false local found = findToggleTitleOption(65) if found ~= -1 and toggleTitles[found][5] == 1 then ret = true end return ret end function shouldShowHoWModeFakes() local ret = false local found = findToggleTitleOption(59) if found ~= -1 and toggleTitles[found][5] == 1 then ret = true end return ret end function removeOptionFromList(list, option) local startingPoint = 1 local found = false for index = 1, #list-1, 1 do if list[index][3] == option then startingPoint = index found = true break end end if found == true then for index = startingPoint, #list-1, 1 do list[index] = list[index+1] end list[#list] = nil end end toggleTitles = { {"GORE_LABEL", "GORE_DESCRIPTION", 19, 0, 0}, {"GROUP_INFRA_LABEL", "GROUP_INFRA_DESCRIPTION", 42, 0, 0}, {"MAX_HP_ON_LEVEL_LABEL", "MAX_HP_ON_LEVEL_DESCRIPTION", 55, 0, 0}, {"HEAL_ON_REST_LABEL", "HEAL_ON_REST_DESCRIPTION", 50, 0, 0}, {40198, 40199, 57, 0, 0}, {"WEATHER_LABEL", "WEATHER_DESCRIPTION", 47, 0, 0}, {40200, 40201, 59, 0, 0}, {"DIFFICULTY_LABEL_STORYMODE_MIXED", "DIFFICULTY_DESCRIPTION_STORYMODE_BG2EE", 65, 0, 0}, {40844, 40845, 62, 0, 0}, {"NO_DAMAGE_INCREASE_LABEL", "NO_DAMAGE_INCREASE_DESCRIPTION", 64, 0, 0}, {"ENABLE_CLOUD_LABEL", "ENABLE_CLOUD_DESCRIPTION", 60, 0, 0}, {"WORLDMAP_HIGHLIGHT_LABEL", "WORLDMAP_HIGHLIGHT_DESCRIPTION", 66, 0, 0}, {"MP_CHAT_LABEL", "MP_CHAT_DESCRIPTION", 67, 0, 0}, {"AUTO_USE_MAGIC_AMMO_LABEL", "AUTO_USE_MAGIC_AMMO_DESCRIPTION", 68, 0, 0}, } selectedOpt = 0 helpString = 0 ttDelaySLDR = 0 keyboardSLDR = 0 mouseSLDR = 0 difficultySLDR = 0 panelID = 8 function getDifficulty(d) local text = "" if ( d ==0 ) then text = t("DIFFICULTY_LABEL_EASY") elseif (d == 1) then text = t("DIFFICULTY_LABEL_NORMAL") elseif (d == 2) then text = t("DIFFICULTY_LABEL_CORERULES") elseif (d == 3) then text = t("DIFFICULTY_LABEL_HARD") elseif (d == 4) then text = t("DIFFICULTY_LABEL_INSANE") elseif (d == 5) then text = string.upper(t("MULTIPLAYER_DIFFICULTY_LABEL")).." "..t("DIFFICULTY_LABEL_LEGACYOFBHAAL") end return text end function stringToUpperCase(resref) local ret = Infinity_FetchString(40200) ret = string.upper(ret) return ret end ` menu { name 'OPTIONS_GAMEPLAY' align center center modal onOpen " panelID = 8 helpString = 'GAMEPLAY_DESCRIPTION' selectedOpt = 0 selectedSL = 0 if Infinity_CanCloudSave() == false then removeOptionFromList(toggleTitles,60) end ttDelaySLDR = Infinity_GetOption(1, panelID) keyboardSLDR = Infinity_GetOption(3, panelID) mouseSLDR = Infinity_GetOption(2, panelID) difficultySLDR = Infinity_GetOption(12, panelID) for index, var in pairs(toggleTitles) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 end end " button { area 0 0 1024 768 mosaic GUIOPTB sound "" action " helpString = 'GAMEPLAY_DESCRIPTION' selectedOpt = 0 selectedSL = 0 " } label { area 124 36 772 52 text "GAMEPLAY_TITLE" text style title } list { column { width 80 label { area 10 0 -1 -1 text lua "t( toggleTitles[rowNumber][1])" text style "normal" text align left center } } column { width 20 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "toggleTitles[rowNumber][4]" } } area 592 152 378 362 rowheight 46 table "toggleTitles" var selectedOpt scrollbar 'GUISCRC' action " panelID = 8 selectedSL = 0 helpString = toggleTitles[selectedOpt][2] if(cellNumber == 2) then Infinity_PlaySound('GAM_09') toggleTitles[selectedOpt][4] = toggleFrame(toggleTitles[selectedOpt][4]) if toggleTitles[selectedOpt][4] == 0 then toggleTitles[selectedOpt][5] = 0 else toggleTitles[selectedOpt][5] = 1 if selectedOpt == findToggleTitleOption(65) then toggleTitles[findToggleTitleOption(59)][4] = 0 toggleTitles[findToggleTitleOption(59)][5] = 0 elseif selectedOpt == findToggleTitleOption(59) then toggleTitles[findToggleTitleOption(65)][4] = 0 toggleTitles[findToggleTitleOption(65)][5] = 0 end end end if selectedOpt == 8 and toggleTitles[8][5] == 1 then groundItemsButtonToggle = 1 highlightButtonToggle = 1 end " } label { area 578 508 402 130 rectangle 3 } text { area 602 530 354 87 text lua "t(helpString)" text style normal text align left top text color 'D' scrollbar 'GUISCRC' } text { area 108 150 144 39 text "TOOLTIP_DELAY_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 1)" action " helpString = 'TOOLTIP_DELAY_DESCRIPTION' selectedOpt = 0 selectedSL = 1 " } slider { area 252 150 260 39 position "ttDelaySLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 40 pad 8 0 15 0 action " helpString = 'TOOLTIP_DELAY_DESCRIPTION' selectedOpt = 0 selectedSL = 1 " } text { area 108 216 144 39 text "KEYBOARD_SCRLSPEED_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 2)" enabled "not e:IsTouchUI()" action " helpString = 'KEYBOARD_SCRLSPEED_DESCRIPTION' selectedOpt = 0 selectedSL = 2 " } slider { area 252 216 260 40 position "keyboardSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 40 pad 8 0 15 0 enabled "not e:IsTouchUI()" action " helpString = 'KEYBOARD_SCRLSPEED_DESCRIPTION' selectedOpt = 0 selectedSL = 2 " } text { area 108 284 144 39 text "MOUSE_SCRLSPEED_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 3)" enabled "not e:IsTouchUI()" action " helpString = 'MOUSE_SCRLSPEED_DESCRIPTION' selectedOpt = 0 selectedSL = 3 " } slider { area 252 284 260 40 position "mouseSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 40 pad 8 0 15 0 enabled "not e:IsTouchUI()" action " helpString = 'MOUSE_SCRLSPEED_DESCRIPTION' selectedOpt = 0 selectedSL = 3 " } text { area 108 384 144 39 text "DIFFICULTY_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 4)" action " helpString = 'DIFFICULTY_DESCRIPTION' selectedOpt = 0 selectedSL = 4 " } label { area 252 384 260 39 mosaic GUISLDR greyscale 1 } slider { area 252 384 260 39 position "difficultySLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 5 pad 8 0 15 0 enabled "not shouldShowStoryModeFakes() and not shouldShowHoWModeFakes()" action " helpString = 'DIFFICULTY_DESCRIPTION' selectedOpt = 0 selectedSL = 4 " } label { area 304 423 200 35 text lua "getDifficulty(difficultySLDR)" text style "label" text align center center enabled "not shouldShowStoryModeFakes() and not shouldShowHoWModeFakes()" } label { area 304 423 200 35 text "DIFFICULTY_LABEL_STORYMODE" text style "label" text align center center enabled "shouldShowStoryModeFakes()" } label { area 304 423 200 35 text lua "stringToUpperCase(40200)" text style "label" text align center center enabled "shouldShowHoWModeFakes()" } button { bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" area 158 501 302 44 text "ASSIGN_KEYS_BUTTON" text style "button" enabled "not e:IsTouchUI()" action " Infinity_PushMenu( 'OPTIONS_KEYBINDINGS' ); selectedOpt = 0 " } button { area 158 550 302 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "FEEDBACK_BUTTON" text style "button" action " Infinity_PushMenu( 'OPTIONS_FEEDBACK' ); selectedOpt = 0 " } button { area 158 600 302 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "AUTO_PAUSE_BUTTON" text style "button" action " selectedOpt = 0 Infinity_PushMenu( 'OPTIONS_AUTOPAUSE' ); " } button { area 290 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "CANCEL_BUTTON" text style "button" action " Infinity_PopMenu() " } button { area 530 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONE_BUTTON" -- Done text style "button" action " panelID = 8 Infinity_ChangeOption( 1, ttDelaySLDR, panelID) Infinity_ChangeOption( 3, keyboardSLDR, panelID ) Infinity_ChangeOption( 2, mouseSLDR, panelID ) Infinity_ChangeOption( 12, difficultySLDR + 1, panelID) -- cannot set story mode through slider selectedOpt = 0 selectedSL = 0 for index, var in pairs(toggleTitles) do Infinity_ChangeOption( var[3], var[5], panelID) end panelID = 8 Infinity_PopMenu() " } } ` autoPauseToggles = { {'WEAPON_UNUSABLE_LABEL',18036, 5 , 0, 0}, {'END_OF_ROUND_LABEL',10640, 25, 0, 0}, {'ENEMY_SIGHTED_LABEL',23514, 26, 0, 0}, {'SPELL_CAST_LABEL',31872, 31, 0, 0}, {'TRAP_FOUND_LABEL',34672, 34, 0, 0} } characterPauseToggles = { {'CENTER_MEMBER_LABEL',10571, 37, 0, 0}, {'CHARACTER_HIT_LABEL',18032, 1 , 0, 0}, {'CHARACTER_INJURED_LABEL',18033, 2 , 0, 0}, {'CHARACTER_DEATH_LABEL',18034, 3 , 0, 0}, {'CHARACTER_ATTACKED_LABEL',18035, 4 , 0, 0}, {'CHARACTER_TARGET_DESTROYED',18037, 13, 0, 0}, } selOptAP = 0 ` menu { name 'OPTIONS_AUTOPAUSE' modal align center center onOpen " panelID = 10 selOptAP = 0 autopauseString = 18044 for index, var in pairs(autoPauseToggles) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 end end for index, var in pairs(characterPauseToggles) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 end end " button { area 0 0 1024 768 mosaic GUIOPTB action " autopauseString = 18044 selOptAP = 0 " } label { area 128 38 760 44 text "AUTO_PAUSE_TITLE" text style title } list { column { width 85 label { area 10 0 -1 -1 text lua "t( autoPauseToggles[rowNumber][1])" text style "normal" text align left center } } column { width 15 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "autoPauseToggles[rowNumber][4]" } } area 590 154 372 324 rowheight 50 table "autoPauseToggles" var selOptAP scrollbar 'GUISCRC' action " selOptAPC = 0 autopauseString = autoPauseToggles[selOptAP][2] if(cellNumber == 2) then Infinity_PlaySound('GAM_09') autoPauseToggles[selOptAP][4] = toggleFrame(autoPauseToggles[selOptAP][4]) if autoPauseToggles[selOptAP][4] == 0 then autoPauseToggles[selOptAP][5] = 0 else autoPauseToggles[selOptAP][5] = 1 end end " } list { column { width 85 label { area 10 0 -1 -1 text lua "t( characterPauseToggles[rowNumber][1])" text style "normal" text align left center } } column { width 15 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "characterPauseToggles[rowNumber][4]" } } area 106 132 406 458 rowheight 50 table "characterPauseToggles" var selOptAPC scrollbar 'GUISCRC' action " selOptAP = 0 autopauseString = characterPauseToggles[selOptAPC][2] if(cellNumber == 2) then Infinity_PlaySound('GAM_09') characterPauseToggles[selOptAPC][4] = toggleFrame(characterPauseToggles[selOptAPC][4]) if characterPauseToggles[selOptAPC][4] == 0 then characterPauseToggles[selOptAPC][5] = 0 else characterPauseToggles[selOptAPC][5] = 1 end --Infinity_ChangeOption(characterPauseToggles[selOptAPC][3], characterPauseToggles[selOptAPC][5], panelID ) end " } label { area 578 508 402 130 rectangle 3 } text { area 602 530 354 87 text lua "Infinity_FetchString(autopauseString)" text style normal text align left top text color 'D' scrollbar 'GUISCRC' } button { area 290 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" action " panelID = 8 helpString = 'GAMEPLAY_DESCRIPTION' Infinity_PopMenu() " } button { area 530 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" --Done text style "button" action " panelID = 10 for index, var in pairs(autoPauseToggles) do Infinity_ChangeOption( var[3], var[5], panelID) end for index, var in pairs(characterPauseToggles) do Infinity_ChangeOption( var[3], var[5], panelID) end panelID = 8 Infinity_PopMenu() " } } ` graphicsToggles = { {'FULL_SCREEN_LABEL',18000, 9 , 0, 0, 0}, {'HARDWARE_CURSOR_LABEL',34783, 13, 0, 0, 0}, {'SCALE_UI_LABEL',34784, 14, 0, 0, 0}, {'ZOOM_LOCK_LABEL',40771, 36, 0, 0, 0}, {'SPRITE_OUTLINE_LABEL',40852, 15, 0, 0, 0}, {'GREYSCALE_ON_PAUSE_LABEL',40853, 66, 0, 0, 0}, {'HIGHLIGHT_SPRITE_LABEL',40854, 67, 0, 0, 0}, {'DITHER_ALWAYS_LABEL',18021, 52, 0, 0, 0}, {'SHOW_HP_LABEL',40197, 53, 0, 0, 0}, {'SHOW_HEALTHBAR_LABEL',40856, 65, 0, 0, 0}, {'SHOW_BLACK_SPACE_LABEL','SHOW_BLACK_SPACE_DESCRIPTION', 69, 0, 0, 0}, {'NEAREST_NEIGHBOUR_LABEL','NEAREST_NEIGHBOUR_DESCRIPTION', 70, 0, 0, 0}, } addedDirectx = false function appendDirectXOption() if addedDirectx == false then dxOption = {'DIRECTX_LABEL', 40857, 68, 0, 0, 0} table.insert(graphicsToggles, dxOption) addedDirectx = true end end selectedGraphicOpt = 0 fontSizeSLDR = 0 fontSizeCancel = 0 function formatGraphicsInfoString() return options['Graphics']['version'] .. "\nrunning on " .. options['Graphics']['renderer'] .. "\ndriver provided by " .. options['Graphics']['vendor'] end ` menu { name 'OPTIONS_GRAPHICS' modal align center center onOpen " if e:HasDirectX() then appendDirectXOption() end panelID = 6 helpString = 18042 selectedGraphicOpt = 0 selectedSL = 0 fontSizeSLDR = Infinity_GetOption(22, panelID) fontSizeCancel = Infinity_GetOption(22, panelID) for index, var in pairs(graphicsToggles) do var[5] = Infinity_GetOption(var[3], panelID) var[6] = 0 if var[5] == 0 then var[4] = 0 else var[4] = 2 end end if e:IsTouchUI() then removeOptionFromList(graphicsToggles, 9) removeOptionFromList(graphicsToggles, 13) end " button { area 0 0 1024 768 mosaic GUIOPTB sound "" action " helpString = 18042 selectedGraphicOpt = 0 selectedSL = 0 " } label { area 128 40 766 44 text "GRAPHICS_TITLE" text style title } label { area 588 158 376 334 text lua "formatGraphicsInfoString()" text style normal text align center center } text { area 106 238 404 44 text "DISPLAY_OPTIONS_LABEL" text style "button" text align right center text highlight lua "getSelected(selectedSL, 1)" action " selectedGraphicOpt = 0 selectedSL = 1 " } list { column { width 85 label { area 0 0 -1 -1 text lua "t( graphicsToggles[rowNumber][1])" text style "normal" text align right center } } column { width 15 label { area 8 2 32 32 bam ROUNDBUT scaleToClip sequence 3 frame lua "graphicsToggles[rowNumber][4]" } } area 106 290 402 366 rowheight 36 table "graphicsToggles" var selectedGraphicOpt scrollbar 'GUISCRC' action " panelID = 6 helpString = graphicsToggles[selectedGraphicOpt][2] selectedSL = 0 if(cellNumber == 2) then Infinity_PlaySound('GAM_09') graphicsToggles[selectedGraphicOpt][4] = toggleFrame(graphicsToggles[selectedGraphicOpt][4]) if graphicsToggles[selectedGraphicOpt][4] == 0 then graphicsToggles[selectedGraphicOpt][5] = 0 else graphicsToggles[selectedGraphicOpt][5] = 1 end graphicsToggles[selectedGraphicOpt][6] = 1 --Infinity_ChangeOption(graphicsToggles[selectedGraphicOpt][3], graphicsToggles[selectedGraphicOpt][5], panelID ) end " } label { area 578 508 402 130 rectangle 3 } text { area 602 530 354 87 text lua "getStringFromAmbiguousSource(helpString)" text style normal text color 'D' scrollbar 'GUISCRC' } text { area 106 162 136 40 text "FONT_SIZE_LABEL" text style "label" text align right center text upper text useFontZoom 1 text highlight lua "getSelected(selectedSL, 2)" action " helpString = 17204 selectedGraphicOpt = 0 selectedSL = 2 " } slider { area 248 162 256 40 position "fontSizeSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 7 pad 8 0 12 0 action " Infinity_ChangeOption( 22, fontSizeSLDR, 6) helpString = 17204 selectedGraphicOpt = 0 selectedSL = 1 " } button { area 290 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" action " panelID = 6 Infinity_ChangeOption( 22, fontSizeCancel, panelID) selectedSL = 0 Infinity_PopMenu() " } button { area 530 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" --Done text style "button" action " panelID = 6 Infinity_ChangeOption( 22, fontSizeSLDR, panelID) for index, var in pairs(graphicsToggles) do if ( var[6] == 1 ) then Infinity_ChangeOption( var[3], var[5], panelID) end end selectedSL = 0 Infinity_PopMenu() " } } ` soundsToggles = { {'CHARACTER_SUBTITLES_LABEL',18015, 5, 0, 0}, {'BATTLE_CRIES_LABEL',18013, 6, 0, 0}, {'MOVEMENT_SOUNDS_LABEL',18014, 7, 0, 0} } selectedsoundOpt = 0 command = { {'ALWAYS_LABEL',0, 8, 0, 0}, {'SELDOM_LABEL',0, 9, 0, 0}, {'NEVER_LABEL',0, 10, 0, 0} } commandSel = 0 selectOpt = { {'ALWAYS_LABEL',0, 58, 0, 0}, {'SELDOM_LABEL',0, 59, 0, 0}, {'NEVER_LABEL',0, 60, 0, 0} } selectSel = 0 ambientSLDR = 0 sfxSLDR = 0 voiceSLDR = 0 musicSLDR = 0 movieSLDR = 0 ` menu { name 'OPTIONS_SOUND' align center center modal onOpen " panelID = 7 helpString = 18042 selectedsoundOpt = 0 selectedSL = 0 ambientSLDR = Infinity_GetOption(1, panelID) sfxSLDR = Infinity_GetOption(2, panelID) voiceSLDR = Infinity_GetOption(3, panelID) musicSLDR = Infinity_GetOption(4, panelID) movieSLDR = Infinity_GetOption(22, panelID) for index, var in pairs(command) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 commandSel = index end end for index, var in pairs(selectOpt) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 selectSel = index end end for index, var in pairs(soundsToggles) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 selectSel = index end end " button { area 0 0 1024 768 mosaic GUIOPTB sound "" action " helpString = 18042 selectedsoundOpt = 0 selectedSL = 0 " } label { area 138 32 772 60 text "SOUND_TITLE" text style title } text { area 122 458 394 44 text "CHARACTER_SOUNDS_LABEL" text style "button" text align right center } list { column { width 85 label { area 0 0 -1 -1 text lua "t( soundsToggles[rowNumber][1])" text style "normal" text align right center } } column { width 15 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "soundsToggles[rowNumber][4]" } } area 122 502 395 150 rowheight 46 table "soundsToggles" var selectedsoundOpt scrollbar 'GUISCRC' action " panelID = 7 helpString = soundsToggles[selectedsoundOpt][2] selectedSL = 0 if(cellNumber == 2) then Infinity_PlaySound('GAM_09') soundsToggles[selectedsoundOpt][4] = toggleFrame(soundsToggles[selectedsoundOpt][4]) if soundsToggles[selectedsoundOpt][4] == 0 then soundsToggles[selectedsoundOpt][5] = 0 else soundsToggles[selectedsoundOpt][5] = 1 end end " } text { area 594 147 372 44 text "COMMAND_SOUNDS_BUTTON" text style "button" text align right center text highlight lua "getSelected(selectedSL, 1)" action " helpString = 18016 selectedsoundOpt = 0 selectedSL = 1 " } list { column { width 85 label { area 10 0 -1 -1 text lua "t( command[rowNumber][1])" text style "normal" text align right center } } column { width 15 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "command[rowNumber][4]" } } area 594 185 372 145 rowheight 46 table "command" var commandSel scrollbar 'GUISCRC' hidehighlight action " panelID = 7 helpString = 18016 selectedSL = 1 opt = commandSel command[1][4] = 0 command[2][4] = 0 command[3][4] = 0 selectedSoundOpt = 0 Infinity_PlaySound('GAM_09') command[opt][4] = 2 " } text { area 594 329 372 44 text "SELECTION_BUTTON" text style "button" text align right center text highlight lua "getSelected(selectedSL, 2)" action " helpString = 11352 selectedsoundOpt = 0 selectedSL = 2 " } list { column { width 85 label { area 10 0 -1 -1 text lua "t( selectOpt[rowNumber][1])" text style "normal" text align right center } } column { width 15 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "selectOpt[rowNumber][4]" } } area 594 373 372 145 rowheight 46 table "selectOpt" var selectSel scrollbar 'GUISCRC' hidehighlight action " panelID = 7 helpString = 11352 selectedSL = 2 opt = selectSel selectOpt[1][4] = 0 selectOpt[2][4] = 0 selectOpt[3][4] = 0 selectedSoundOpt = 0 Infinity_PlaySound('GAM_09') selectOpt[opt][4] = 2 " } label { area 578 508 402 130 rectangle 3 } text { area 602 530 354 87 text lua "Infinity_FetchString(helpString)" text style normal text color 'D' scrollbar 'GUISCRC' } text { area 122 136 394 44 text "VOLUME_CONTROLS_LABEL" text style "button" text align right center } text { area 106 185 138 39 text "AMBIENT_VOLUME_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 4)" action " helpString = 18008 selectedsoundOpt = 0 selectedSL = 4 " } slider { area 252 185 264 45 position "ambientSLDR" mosaic GUISLDR bam 'SLDRSTAR' sequence 0 frame 1 settings 40 pad 8 0 20 0 action " helpString = 18008 selectedsoundOpt = 0 selectedSL = 4 " } text { area 106 240 138 40 text "SFX_VOLUME_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 5)" action " helpString = 18009 selectedsoundOpt = 0 selectedSL = 5 " } slider { area 252 240 264 44 mosaic GUISLDR position "sfxSLDR" bam 'SLDRSTAR' sequence 0 frame 1 settings 40 pad 8 0 20 0 action " helpString = 18009 selectedsoundOpt = 0 selectedSL = 5 " } text { area 106 295 138 41 text "VOICE_VOLUME_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 6)" action " helpString = 18010 selectedsoundOpt = 0 selectedSL = 6 " } slider { area 252 295 264 45 position "voiceSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 40 pad 8 0 20 0 action " helpString = 18010 selectedsoundOpt = 0 selectedSL = 6 " } text { area 106 350 138 40 text "MUSIC_VOLUME_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 7)" action " helpString = 18011 selectedsoundOpt = 0 selectedSL = 7 " } slider { area 252 350 264 46 position "musicSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 40 pad 8 0 20 0 text highlight lua "getSelected(selectedSL, 7)" action " helpString = 18011 selectedsoundOpt = 0 selectedSL = 7 " } text { area 106 405 138 40 text "MOVIE_VOLUME_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 8)" action " helpString = 18012 selectedsoundOpt = 0 selectedSL = 8 " } slider { area 252 405 264 45 position "movieSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 40 pad 8 0 20 0 action " helpString = 18012 selectedsoundOpt = 0 selectedSL = 8 " } button { area 290 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "CANCEL_BUTTON" text style "button" action " selectedSL = 0 panelID = 8 Infinity_PopMenu() " } button { area 530 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONE_BUTTON" text style "button" action " panelID = 7 for index, var in pairs(command) do Infinity_Log('Com var[4] #' .. index .. ': ' .. var[4]) if var[4] == 2 then Infinity_ChangeOption( var[3], 1, panelID) end end for index, var in pairs(selectOpt) do Infinity_Log('Sel var[4] #' .. index .. ': ' .. var[4]) if var[4] == 2 then Infinity_ChangeOption( var[3], 1, panelID) end end Infinity_ChangeOption( 1, ambientSLDR, panelID) Infinity_ChangeOption( 2, sfxSLDR, panelID ) Infinity_ChangeOption( 3, voiceSLDR, panelID ) Infinity_ChangeOption( 4, musicSLDR, panelID) Infinity_ChangeOption( 22, movieSLDR, panelID) selectedOpt = 0 selectedSL = 0 for index, var in pairs(soundsToggles) do Infinity_ChangeOption( var[3], var[5], panelID) end panelID = 8 Infinity_PopMenu() " } } ` feedbackToggles = { {'COLORED_MARKERS_LABEL', 'COLORED_MARKERS_HELP', 38, 0, 0}, {'CLASSIC_MARKERS_LABEL', 'CLASSIC_MARKERS_HELP', 45, 0, 0}, {'ENABLE_CONFIRMATION_LABEL', 'ENABLE_CONFIRMATION_HELP', 41, 0, 0}, {'DISABLE_COSMETIC_ATTACKS_LABEL', 'DISABLE_COSMETIC_ATTACKS_HELP', 43, 0, 0}, {'JOURNAL_POPUPS_LABEL', 'JOURNAL_POPUPS_HELP', 44, 0, 0} } messagesToggles = { {'TO_HIT_ROLLS_LABEL', 'TO_HIT_ROLLS_HELP', 10, 0, 0}, {'ACTIONS_LABEL', 'ACTIONS_HELP', 12, 0, 0}, {'STATE_CHANGES_LABEL', 'STATE_CHANGES_HELP', 13, 0, 0}, {'COMBAT_INFO_LABEL', 'COMBAT_INFO_HELP', 11, 0, 0}, {'SELECTION_TEXT_LABEL', 'SELECTION_TEXT_HELP', 14, 0, 0}, {'MISC_LABEL', 'MISC_HELP', 15, 0, 0} } selFeedOpt = 0 selMessageOpt = 0 helpString = 0 markerFeedSLDR = 0 locatorFeedSLDR = 0 function getFrequency(d,includeHighter) strref = "" if ( d ==0 ) then strref = "MINIMUM" elseif (d == 1) then strref = "LOW" elseif (d == 2) then strref = "MEDIUM" elseif (d == 3) then strref = "HIGH" elseif (d == 4 and includeHighter == true) then strref = "HIGHER" elseif (d == 4 and includeHighter == false) then strref = "MAXIMUM" elseif (d == 5) then strref = "MAXIMUM" end return t(strref) end ` menu { name 'OPTIONS_FEEDBACK' align center center modal onOpen " panelID = 9 helpString = 'FEEDBACK_HELP' selFeedOpt = 0 selMessageOpt = 0 selectedSL = 0 markerFeedSLDR = Infinity_GetOption(8, panelID) locatorFeedSLDR = Infinity_GetOption(9, panelID) for index, var in pairs(feedbackToggles) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 end end for index, var in pairs(messagesToggles) do var[5] = Infinity_GetOption(var[3], panelID) if var[5] == 0 then var[4] = 0 else var[4] = 2 end end " button { area 0 0 1024 768 mosaic GUIOPTB action " helpString = 'FEEDBACK_HELP' selFeedOpt = 0 selMessageOpt = 0 selectedSL = 0 " } label { area 124 34 774 56 text "FEEDBACK_TITLE" text style title } label { area 100 386 407 44 text "VISUAL_FEEDBACK_LABEL" text style "label" text upper text align right center } list { column { width 85 label { area 0 0 -1 -1 text lua "t( feedbackToggles[rowNumber][1])" text style "normal" text align right center } } column { width 15 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "feedbackToggles[rowNumber][4]" } } area 100 430 407 220 rowheight 50 table "feedbackToggles" var selFeedOpt scrollbar 'GUISCRC' action " selectedSL = 0 selMessageOpt = 0 helpString = feedbackToggles[selFeedOpt][2] if(cellNumber == 2) then Infinity_PlaySound('GAM_09') feedbackToggles[selFeedOpt][4] = toggleFrame(feedbackToggles[selFeedOpt][4]) if feedbackToggles[selFeedOpt][4] == 0 then feedbackToggles[selFeedOpt][5] = 0 else feedbackToggles[selFeedOpt][5] = 1 end end " } label { area 586 156 380 45 text "FEEDBACK_MESSAGES_LABEL" text style "label" text upper text align right center } list { column { width 85 label { area 10 0 -1 -1 text lua "t( messagesToggles[rowNumber][1])" text style "normal" text align right center } } column { width 15 label { area 8 8 32 32 bam ROUNDBUT scaleToClip frame lua "messagesToggles[rowNumber][4]" } } area 586 201 380 313 rowheight 50 table "messagesToggles" var selMessageOpt scrollbar 'GUISCRC' action " helpString = messagesToggles[selMessageOpt][2] selectedSL = 0 selFeedOpt = 0 if(cellNumber == 2) then Infinity_PlaySound('GAM_09') messagesToggles[selMessageOpt][4] = toggleFrame(messagesToggles[selMessageOpt][4]) if messagesToggles[selMessageOpt][4] == 0 then messagesToggles[selMessageOpt][5] = 0 else messagesToggles[selMessageOpt][5] = 1 end end " } label { area 578 508 402 130 rectangle 3 } text { area 602 530 354 87 text lua "t(helpString)" text style normal text color 'D' scrollbar 'GUISCRC' } text { area 106 165 132 36 text "MARKER_FEEDBACK_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 1)" action " helpString = 'MARKER_FEEDBACK_HELP' selFeedOpt = 0 selMessageOpt = 0 selectedSL = 1 " } slider { area 246 165 254 36 position "markerFeedSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 6 pad 8 0 10 0 action " helpString = 'MARKER_FEEDBACK_HELP' selFeedOpt = 0 selMessageOpt = 0 selectedSL = 1 " } label { area 300 201 200 36 text lua "getFrequency(markerFeedSLDR,true)" text style "label" text align center center } text { area 106 280 132 36 text "LOCATOR_FEEDBACK_LABEL" text style "label" text align right center text upper text highlight lua "getSelected(selectedSL, 2)" action " helpString = 'LOCATOR_FEEDBACK_HELP' selFeedOpt = 0 selMessageOpt = 0 selectedSL = 2 " } slider { area 246 280 254 36 position "locatorFeedSLDR" bam 'SLDRSTAR' mosaic GUISLDR sequence 0 frame 1 settings 5 pad 8 0 10 0 action " helpString = 'LOCATOR_FEEDBACK_HELP' selFeedOpt = 0 selMessageOpt = 0 selectedSL = 2 " } label { area 300 316 200 36 text lua "getFrequency(locatorFeedSLDR,false)" text style "label" text align center center } button { area 290 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "CANCEL_BUTTON" text style "button" action " helpString = 'GAMEPLAY_DESCRIPTION' selectedSL = 0 panelID = 8 Infinity_PopMenu() " } button { area 530 705 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONE_BUTTON" --Done text style "button" action " helpString = 'GAMEPLAY_DESCRIPTION' panelID = 9 Infinity_ChangeOption( 8, markerFeedSLDR, panelID) Infinity_ChangeOption( 9, locatorFeedSLDR, panelID ) selectedOpt = 0 selectedSL = 0 for index, var in pairs(messagesToggles) do Infinity_ChangeOption( var[3], var[5], panelID) end for index, var in pairs(feedbackToggles) do Infinity_ChangeOption( var[3], var[5], panelID) end Infinity_PopMenu() " } } ` function getGooglePlaySignInText() if(Infinity_GooglePlaySignedIn() == 1) then return t("SIGN_OUT_BUTTON") else return t("SIGN_IN_BUTTON") end end keyCategory = 1 key = 0 function displayHelp() if not (key == 0) then return 37843 end return 0 end function formatKeyCode(number) local ret = "" if number < 127 and number > 32 then return string.format('%c', keybindings[keyCategory][rowNumber][6]) end ret = t("SDL_" .. string.format('%d', keybindings[keyCategory][rowNumber][6])) return ret end function getHotkeyName(category,number) local ret = "" if category < 5 then ret = t(keybindings[category][number][4]) if ret == keybindings[category][number][4] then ret = Infinity_FetchString(keybindings[category][number][4]) end else ret = Infinity_FetchString(keybindings[category][number][4]) end return ret end ` menu { name 'OPTIONS_KEYBINDINGS' modal align center center button -- Background { area 0 0 864 710 mosaic GUICHISD } label -- Title { area 82 16 700 36 text "ASSIGN_KEYS_TITLE" text style "title" } label -- Instruction { area 252 60 367 42 text "ASSIGN_KEYS_SUBTITLE" text style "label" } label -- Contextual instruction { area 42 116 778 54 text lua "Infinity_FetchString(displayHelp())" text style "label" } list -- Key categories { column { width 100 label { area 0 0 -1 -1 text lua "t(keycategories[rowNumber][2])" text style "normal" text align center center } } area 42 190 360 420 rowheight 24 table "keycategories" var keyCategory scrollbar 'GUISCRC' action " Infinity_StopKeybind() key = 0 " } list -- Key bindings { column { width 90 label { area 0 0 -1 -1 text lua "getHotkeyName(keyCategory,rowNumber)" text style "normal" align left center } } column { width 10 label { area 0 0 -1 -1 text lua "formatKeyCode(keybindings[keyCategory][rowNumber][6])" text style "normal" text upper text align right center } } area 448 190 372 420 rowheight 24 table "keybindings[keyCategory]" var key scrollbar 'GUISCRC' action " if(key > 0) then Infinity_StartKeybind(key); keybindings[keyCategory][key][6] = 0 end " } button { area 440 654 236 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action " Infinity_StopKeybind() key = 0 Infinity_PopMenu(); " } button { area 196 654 236 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "REVERT_BUTTON" text style "button" action " revertKeymap(); " } } ` creditspage = 1 function GetCreditsTitle() return creditspage .. ' / ' .. #credits end ` menu { name 'CREDITS' align center center label { area 2 0 1024 770 mosaic GUISMBM } label { area 114 18 794 36 text lua "GetCreditsTitle()" text style "title" } text { area 114 64 794 632 text lua "Infinity_FetchString(credits[creditspage])" scrollbar 'GUISCRC' scrollbar func "resetScrollbar" text style "label" text point 11 text align center center } button { area 650 712 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "NEXT_BUTTON" text style "button" action " scrollbarReset = 1 creditspage = creditspage + 1; if credits[creditspage] == nil then creditspage = 1 end " } button { area 150 712 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action " scrollbarReset = 1 creditspage = creditspage - 1; if credits[creditspage] == nil then creditspage = #credits end " } button { area 400 712 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action " Infinity_PopMenu(); " } } ` language = 0 showsubtitles = 0 function languageDetails() if languages[language] ~= nil then return Infinity_FetchString(languages[language][2]) .. '\n' .. Infinity_FetchString(languages[language][3]) else return "" end end function findCurrentLanguage() local lang = Infinity_GetINIString('Language', 'Text', '') for k,v in pairs(languages) do if v[1] == lang then language = k end end end function isLanguageSelected(slotNumber) local ret = 0 if slotNumber == language then ret = 2 end return ret end ` menu { name 'OPTIONS_LANGUAGE' modal align center center onOpen " showsubtitles = Infinity_GetINIValue('Program Options', 'Display Subtitles', 1) findCurrentLanguage() " button { area 0 0 1024 768 mosaic 'GUISMBM' } label { area 92 10 840 44 text "LANGUAGE_TITLE" text style "title" } list { column { width 75 label { area 0 0 130 -1 text lua "languages[rowNumber][4]" text style "normal" text align right center } }column { width 25 label { area 0 4 32 32 bam ROUNDBUT scaleToClip frame lua "isLanguageSelected(rowNumber)" } } area 86 138 228 466 rowheight 42 table "languages" var languageVar scrollbar 'GUISCRC' hideHighlight action " if cellNumber == 2 then language = languageVar Infinity_PlaySound('GAM_09') end " } label { area 326 138 610 508 fill 112 111 111 64 } text { area 336 138 600 508 text lua "languageDetails()" text style normal text align center top scrollbar 'GUISCRC' } label { area 86 648 170 34 text "SHOW_SUBTITLES_LABEL" text style "label" text align right center text upper } label { area 326 654 610 42 text lua "Infinity_FetchString(37845)" text style "normal" text align center center text upper } label { area 120 66 784 64 text lua "Infinity_FetchString(37846)" text style "normal" text align center center text color '$' } button { area 282 648 32 34 bam ROUNDBUT scaleToClip toggle showsubtitles } button { area 290 710 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" action " -- cancel for index, var in pairs(languages) do Infinity_Log(var[3]) end Infinity_PopMenu(); " } button { area 530 710 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action " -- done Infinity_SetLanguage(languages[language][1],showsubtitles) Infinity_PopMenu() " } } ` function restoreOverlayFromQuit() --restore the old overlay if applicable if(oldOverlayMenuName) then Infinity_SetOverlay(oldOverlayMenuName) else Infinity_SetOverlay(nil) end end ` menu { name 'QuitMenu' modal align center center label -- Background { area 0 0 670 234 mosaic GUIERR6 } label --Title { area 36 24 600 120 text 20186 text style "label" } button { area 88 170 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "QUIT_GAME_BUTTON" text style "button" on return action " restoreOverlayFromQuit() Infinity_ShutdownGame() " } button { area 370 170 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" on escape action " restoreOverlayFromQuit() Infinity_PopMenu('QuitMenu') " } } ` selectedSlot = nil itemRequestAmt = 0 function showItemAmountRequester(slotName) local slot = characters[id].equipment[slotName] if(slot.item.count == nil) then Infinity_Log("Nil count in requester!") return end if(slot.item.count > 1) then selectedSlot = slotName popupRequester(slot.item.count, inventorySplitStack, false, slot.item.icon) end end function inventorySplitStack(cnt) Infinity_SplitItemStack(characters[id].equipment[selectedSlot].id, cnt,'slot_inv_' .. characters[id].equipment[selectedSlot].id) end function GetAbilityIdentifyString() if(characters[id].equipment[selectedSlot].item.identified == 0) then return t("IDENTIFY_BUTTON") end if(characters[id].equipment[selectedSlot].abilityMode == 1) then return t("ABILITIES_BUTTON") end return "" end requester = {} requester.requesterMax = 0 requester.requesterFunc = nil requester.selling = false requester.icon = "" ` menu { name 'POPUP_REQUESTER' align center center modal onOpen " if requester.selling == false then itemRequestAmt = 1 else itemRequestAmt = requester.requesterMax end " label { area 0 0 465 500 mosaic GUIERR } label { area 124 130 220 64 text "CHOOSE_AMT_LABEL" text align center center text style "label" } edit { area 124 194 120 48 var itemRequestAmt text style "edit" align center center maxlines 1 action " -- only permit numbers as letters. -- character limit of 4 if((tonumber(letter_pressed) ~= nil and #tostring(itemRequestAmt) < 4) or not letter_pressed) then return 1 else return 0 end " } label { area 192 80 78 43 icon lua "requester.icon" } button { bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" area 139 318 201 43 text "CANCEL_BUTTON" text style "button" action " Infinity_PopMenu() " } button { bam GUIBUTWT sequenceonce "getRandomButtonSequence('GUIBUTWT')" area 88 266 299 45 text "DONE_BUTTON" text style "button" action " local cnt = tonumber(itemRequestAmt) Infinity_PopMenu() if(cnt and cnt > 0 and cnt <= requester.requesterMax) then requester.requesterFunc(cnt) end " } button { bam GUIOSW area 248 198 44 44 sequence 0 action " local amt = tonumber(itemRequestAmt) if(amt < requester.requesterMax) then itemRequestAmt = amt + 1 end " actionHold " local amt = tonumber(itemRequestAmt) if(amt < requester.requesterMax) then itemRequestAmt = amt + 1 end " } button { bam GUIOSW area 296 198 44 44 sequence 1 action " local amt = tonumber(itemRequestAmt) if(amt > 1) then itemRequestAmt = amt - 1 end " actionHold " local amt = tonumber(itemRequestAmt) if(amt > 1) then itemRequestAmt = amt - 1 end " } } ` selectedAbility = -1 function initAbilities() --initialize selected ability local i = 1 while ( i < 4 ) do local ability = characters[id].equipment[selectedSlot].abilities[i] if(ability ~= nil) then if(ability.selected == 1) then selectedAbility = i return end end i = i + 1 end end function getItemAbilityFrame(itemSlot) ret = 0 if selectedAbility == itemSlot then ret = 2 end return ret end ` menu { name 'ITEM_ABILITIES' align center center onOpen "initAbilities()" label { area 0 0 864 710 mosaic GUIPOPF } label { area 48 26 774 66 text "ITEM_ABILITIES_TITLE" text style "title" } text { area 180 202 496 52 enabled "characters[id].equipment[selectedSlot].abilities[1] ~= nil" text lua "characters[id].equipment[selectedSlot].abilities[1].text" text style "label" } button { area 180 202 52 52 enabled "characters[id].equipment[selectedSlot].abilities[1] ~= nil" bam "GUIBTBUT" sequenceonce "getRandomButtonSequence('GUIBTBUT')" frame lua "getItemAbilityFrame(1)" icon lua "characters[id].equipment[selectedSlot].abilities[1].icon" action "selectedAbility = 1" } button { area 180 202 52 52 enabled "characters[id].equipment[selectedSlot].abilities[1] == nil" bam "GUIBTBUT" sequenceonce "getRandomButtonSequence('GUIBTBUT')" } text { area 180 266 496 52 enabled "characters[id].equipment[selectedSlot].abilities[2] ~= nil" text lua "characters[id].equipment[selectedSlot].abilities[2].text" text style "label" } button { area 180 266 52 52 enabled "characters[id].equipment[selectedSlot].abilities[2] ~= nil" bam "GUIBTBUT" sequenceonce "getRandomButtonSequence('GUIBTBUT')" frame lua "getItemAbilityFrame(2)" icon lua "characters[id].equipment[selectedSlot].abilities[2].icon" action "selectedAbility = 2" } button { area 180 266 52 52 enabled "characters[id].equipment[selectedSlot].abilities[2] == nil" bam "GUIBTBUT" sequenceonce "getRandomButtonSequence('GUIBTBUT')" } text { area 180 330 496 52 enabled "characters[id].equipment[selectedSlot].abilities[3] ~= nil" text lua "characters[id].equipment[selectedSlot].abilities[3].text" text style "label" } button { area 180 330 52 52 enabled "characters[id].equipment[selectedSlot].abilities[3] ~= nil" bam "GUIBTBUT" sequenceonce "getRandomButtonSequence('GUIBTBUT')" frame lua "getItemAbilityFrame(3)" icon lua "characters[id].equipment[selectedSlot].abilities[3].icon" action "selectedAbility = 3" } button { area 180 330 52 52 enabled "characters[id].equipment[selectedSlot].abilities[3] == nil" bam "GUIBTBUT" sequenceonce "getRandomButtonSequence('GUIBTBUT')" } label { area 110 424 688 122 text 11322 text style "label" } button { area 196 654 232 44 bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" action " Infinity_PopMenu() " } button { area 438 654 232 44 bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action " local itemNum = characters[id].equipment[selectedSlot].abilities[selectedAbility].itemNum Infinity_SelectItemAbility(selectedAbility - 1, itemNum, characters[id].equipment[selectedSlot].id) Infinity_PopMenu() " } } ` TEXT_popup_info = 0 ` menu { name 'POPUP_INFO' align center center modal label { area 0 0 658 236 mosaic GUIERR6 } label { area 24 18 606 130 text lua "getStringFromAmbiguousSource(TEXT_popup_info)" text style "label" } button { area 182 172 304 44 bam GUIBUTWT sequenceonce "getRandomButtonSequence('GUIBUTWT')" text "DONE_BUTTON" text style "button" action " Infinity_PopMenu() " } } menu { name 'POPUP_TWOBUTTON' align center center modal label { area 0 0 658 236 mosaic 'GUIERR6' } label { area 26 20 602 130 text lua "getStringFromAmbiguousSource(Popup2Button.info)" text style "label" text align center center } button { area 78 172 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" align center center text lua "t(Popup2Button.cancelText or 'CANCEL_BUTTON')" text style "button" action " Infinity_PopMenu('POPUP_TWOBUTTON') if (Popup2Button.cancelFunc) then Popup2Button.cancelFunc() end " } button { area 342 172 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" align center center text style "button" text lua "t(Popup2Button.okText or 'DONE_BUTTON')" action " Infinity_PopMenu('POPUP_TWOBUTTON') if (Popup2Button.okFunc) then Popup2Button.okFunc() end " } } menu { name 'POPUP_THREEBUTTON' align center center modal label { area 0 0 660 236 mosaic 'GUIERR6' } label { area 24 20 604 130 text lua "getStringFromAmbiguousSource(Popup3Button.info)" text style "label" text align center center } button { area 18 170 202 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" align center center text lua "t(Popup3Button.rightText)" text style "button" action " Infinity_PopMenu() if (Popup3Button.rightFunc) then Popup3Button.rightFunc() end " } button { area 228 170 202 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" align center center text style "button" text lua "t(Popup3Button.midText)" action " Infinity_PopMenu() if (Popup3Button.midFunc) then Popup3Button.midFunc() end " } button { area 438 170 203 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" align center center text style "button" text lua "t(Popup3Button.leftText)" action " Infinity_PopMenu() if (Popup3Button.leftFunc) then Popup3Button.leftFunc() end " } } menu { name 'POPUP_FOURBUTTON' align center center modal label { area 0 0 900 234 mosaic GUIERR7 } label { area 55 21 789 126 text lua "getStringFromAmbiguousSource(Popup4Button.info)" text style "label" text align center center } button { area 656 170 204 44 bam GUIOSTLM text lua "t(Popup4Button.farRightText)" text style "button" action " Infinity_PopMenu() if (Popup4Button.farRightFunc) then Popup4Button.farRightFunc() end " } button { area 448 170 204 44 bam GUIOSTLM text style "button" text lua "t(Popup4Button.rightText)" action " Infinity_PopMenu() if (Popup4Button.rightFunc) then Popup4Button.rightFunc() end " } button { area 242 170 204 44 bam GUIOSTLM text style "button" text lua "t(Popup4Button.leftText)" action " Infinity_PopMenu() if (Popup4Button.leftFunc) then Popup4Button.leftFunc() end " } button { area 38 170 204 44 bam GUIOSTLM text style "button" text lua "t(Popup4Button.farLeftText)" action " Infinity_PopMenu() if (Popup4Button.farLeftFunc) then Popup4Button.farLeftFunc() end " } } menu { name 'ITEM_IDENTIFY' align center center label { area 0 0 660 236 mosaic GUIERR6 } text { area 29 21 580 126 text 19394 text style "label" align center center } button { area 18 170 200 44 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text style "button" text "CANCEL_BUTTON" action " Infinity_PopMenu() if(createCharScreen:GetEngineState() == 7) then --If we're in import character mode, go back to the import screen. e:SelectEngine(startEngine) startEngine:OnImportCharacterButtonClick() end " } button { area 228 170 200 44 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text style "button" text "SCROLL_BUTTON" clickable lua "Infinity_GetScrollIdentifyEnabled(characters[id].equipment[selectedSlot].id)" action " Infinity_OnScrollIdentify(characters[id].equipment[selectedSlot].id) Infinity_PopMenu() itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item " } button { area 440 170 200 44 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text style "button" text "SPELL_BUTTON" clickable lua "Infinity_GetSpellIdentifyEnabled(characters[id].equipment[selectedSlot].id)" action " Infinity_OnSpellIdentify(characters[id].equipment[selectedSlot].id); Infinity_PopMenu() itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item " } } ` function showItemDescriptionInventory(slotName) if(characters[id].equipment[slotName].empty ~= 0) then return end selectedSlot = slotName Infinity_CheckItemIdentify(characters[id].equipment[slotName].id) showItemDescription(characters[id].equipment[slotName].item, 0, 0) end itemDesc = {} function showItemDescription(item, mode, isStoreItem) itemDesc.item = item itemDesc.mode = mode itemDesc.storeItem = isStoreItem Infinity_PushMenu('ITEM_DESCRIPTION',0,0) end function itemDescLeftButtonEnabled() if(itemDesc.mode == 0) then return GetAbilityIdentifyString() ~= "" elseif(itemDesc.mode == 1) then return (itemDesc.item.isBag == 1 and itemDesc.storeItem == 0) end return 0 end function itemDescLeftButtonText() if(itemDesc.mode == 0) then return GetAbilityIdentifyString() elseif(itemDesc.mode == 1) then return t('OPEN_CONTAINER_BUTTON') end return "" end function itemDescLeftButtonAction() if(itemDesc.mode == 0) then if(characters[id].equipment[selectedSlot].item.identified == 0) then Infinity_PushMenu('ITEM_IDENTIFY',0,0) else Infinity_PushMenu('ITEM_ABILITIES',0,0) end elseif(itemDesc.mode == 1) then storeScreen:OpenBag(itemDesc.item.res) Infinity_PopMenu() end end function itemDescRightButtonEnabled() if(itemDesc.mode == 0) then return characters[id].equipment[selectedSlot].useMode ~= -1 else return 0 end end function itemDescRightButtonText() return Infinity_GetUseButtonText(characters[id].equipment[selectedSlot].id, characters[id].equipment[selectedSlot].useMode) end function itemDescRightButtonAction() Infinity_PopMenu() Infinity_OnUseButtonClick(characters[id].equipment[selectedSlot].id, characters[id].equipment[selectedSlot].useMode) end ` menu { name 'ITEM_DESCRIPTION' align center center modal onOpen " Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 864 710 mosaic GUIINVHI } label { area 81 11 700 44 text "ITEM_TITLE" text style title } label { area 96 70 52 52 icon lua "itemDesc.item.icon" } label { area 286 66 308 56 text lua "itemDesc.item.name" text align center center text style "label" } text { area 62 180 724 353 text lua "itemDesc.item.description" scrollbar 'GUISCRC' text style "normal_parchment" enabled "itemDesc.item.identified ~= 0" } text { area 62 180 724 26 text lua "Infinity_FetchString(17108)" scrollbar 'GUISCRC' text style "normal_parchment" text color "M" enabled "itemDesc.item.identified == 0" } text { area 62 206 724 327 text lua "itemDesc.item.description" scrollbar 'GUISCRC' text style "normal_parchment" enabled "itemDesc.item.identified == 0" } --label --{ -- area 66 210 280 327 -- bam lua "itemDesc.item.descPicture" -- sequence 0 -- frame 0 -- align center center --} button { bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 57 638 234 44 enabled "itemDescLeftButtonEnabled()" text lua "itemDescLeftButtonText()" text style "button" action " itemDescLeftButtonAction() " } button { bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 326 638 230 44 text "DONE_BUTTON" text style "button" action " Infinity_PopMenu(); " } button { bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 572 638 234 44 enabled "itemDescRightButtonEnabled()" text lua "itemDescRightButtonText()" text style "button" action " itemDescRightButtonAction() " } } ` function highlightSidebarButton(engine) return (engine == e:GetActiveEngine() and showJournal ~= 1) end sidebarVisible = { LEFT = 1, RIGHT = 1 } function toggleSidebar(side) local show = side .. "_SIDEBAR" local hide = show .. "_HIDDEN" if(sidebarVisible[side] == 1) then local temp = show show = hide hide = temp sidebarVisible[side] = 0 else sidebarVisible[side] = 1 end Infinity_PushMenu(show) Infinity_PopMenu(hide) end ` menu { name 'LEFT_SIDEBAR' align left top ignoreEsc onOpen " if(sidebarVisible.LEFT == 1) then Infinity_PushMenu('LEFT_SIDEBAR_BOTTOM') else Infinity_PopMenu('LEFT_SIDEBAR') Infinity_PushMenu('LEFT_SIDEBAR_HIDDEN') end rgCheat = 0 " onClose " Infinity_PopMenu('LEFT_SIDEBAR_BOTTOM') " label { name 'leftSidebarBackground' area 0 0 80 1536 mosaic GUIWLSP } label { area 0 1536 80 1536 mosaic GUIWLSP } button { area 3 14 73 55 bam GUILS10 sequence 0 tooltip lua "getTooltipWithHotkey(2,16313)" tooltip force top -- glow lua "highlightSidebarButton(worldScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(0) " actionAlt " if rgCheat == 0 then Infinity_PopMenu('WORLD_ACTIONBAR') Infinity_PushMenu('cheatConsole') Infinity_PushMenu('cheatMenu') rgCheat = 1 else Infinity_PopMenu('cheatConsole') Infinity_PopMenu('cheatMenu') Infinity_PushMenu('WORLD_ACTIONBAR') rgCheat = 0 end " } button { area 3 69 73 55 bam GUILS10 sequence 1 tooltip lua "getTooltipWithHotkey(4,14648)" tooltip force top glow lua "highlightSidebarButton(mapScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(1) " } button { area 3 124 73 55 bam GUILS10 sequence 2 tooltip lua "getTooltipWithHotkey(3,16308)" tooltip force top glow lua "showJournal == 1" clickable lua "sidebarsGreyed ~= 1 and game:GetJournalOpenable()" action " e:GetActiveEngine():OnLeftPanelButtonClick(2) " } button { area 3 179 73 55 bam GUILS10 sequence 3 tooltip lua "getTooltipWithHotkey(0,16307)" tooltip force top glow lua "highlightSidebarButton(inventoryScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(3) " } button { area 3 234 73 55 bam GUILS10 sequence 4 tooltip lua "getTooltipWithHotkey(1,16306)" tooltip force top glow lua "highlightSidebarButton(characterScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(4) " } button { area 3 289 73 55 bam GUILS10 sequence 5 tooltip lua "getTooltipWithHotkey(5,16309)" tooltip force top glow lua "highlightSidebarButton(mageScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(5) " } button { area 3 344 73 55 bam GUILS10 sequence 6 tooltip lua "getTooltipWithHotkey(6,14930)" tooltip force top glow lua "highlightSidebarButton(priestScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(6) " } button { area 3 399 73 55 bam GUILS10 sequence 7 tooltip lua "getTooltipWithHotkey(7,16311)" tooltip force top glow lua "highlightSidebarButton(optionsScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(7) " } button { area 3 454 73 55 enabled "e:IsMultiplayer()" bam GUILS10 sequence 8 tooltip lua "getTooltipWithHotkey(8,16312)" tooltip force top glow lua "highlightSidebarButton(multiplayerScreen)" clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnLeftPanelButtonClick(8) " } button { area 6 0 67 16 bam GUIPNL10 action " toggleSidebar('LEFT') " } } menu { name 'LEFT_SIDEBAR_BOTTOM' align left bottom offset 0 0 --combined height of these buttons makes a menu with height = 231, menu is placed into lower left. y pos is offset from top of this menu. ignoreEsc button { area 3 0 73 55 enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" bam GUILS10 sequence 15 tooltip lua "getTooltipWithHotkey(28,34763)" --37861 tooltip force top clickable lua "sidebarsGreyed ~= 1" action " worldScreen:OnQuickSaveButtonClick(false) " actionAlt " worldScreen:OnQuickSaveButtonClick(true) " } button { area 3 56 73 55 enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" bam GUILS10 sequence 16 tooltip lua "Infinity_FetchString(34772)" --"getTooltipWithHotkey(16,34772)" tooltip force top clickable lua "sidebarsGreyed ~= 1" action " Infinity_PushMenu('HELP') " } button { area 3 112 73 55 bam GUILS10 sequence 9 tooltip lua "getTooltipWithHotkey(31,11942)" tooltip force top clickable lua "sidebarsGreyed ~= 1" action " e:GetActiveEngine():OnRestButtonClick() " } --begin clock label { enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" area 0 182 73 74 bam "CGEAR" frame lua "timer:GetCurrentTime() % 59" useOverlayTint "worldScreen:CheckIfPaused()" overlayTint 180 180 180 } button { enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" area 0 182 73 74 tooltip lua "worldScreen:GetCurrentTimeString()" tooltip force top clickable lua "sidebarsGreyed ~= 1" action " worldScreen:TogglePauseGame(true) " } label { enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" area 0 182 73 74 bam "GEARMASK" scaleToClip useOverlayTint "worldScreen:CheckIfPaused()" overlayTint 180 180 180 ignoreEvents } --end clock label { --area is preset enabled "gameOptions.m_bRenderFrameTimes" frameTimes } } menu { name 'LEFT_SIDEBAR_HIDDEN' align left bottom ignoreEsc button { area 6 -18 67 34 bam GUIPNL1D action " toggleSidebar('LEFT') " } } ` mouseOverPortrait = -1 draggedPortrait = nil function startDraggingPortraitOrder(index) if e:GetActiveEngine() == worldScreen then draggedPortrait = index end end function swapPortraits(dest) worldScreen:SwapPortraits(dest,draggedPortrait) draggedPortrait = nil end function getPartyAITooltip() if aiButtonToggle == 1 then return Infinity_FetchString(15918) else return Infinity_FetchString(15917) end end ` menu { name 'RIGHT_SIDEBAR' align right top ignoreEsc onOpen " if(sidebarVisible.RIGHT == 1) then Infinity_PushMenu('RIGHT_SIDEBAR_BOTTOM') else Infinity_PopMenu('RIGHT_SIDEBAR') Infinity_PushMenu('RIGHT_SIDEBAR_HIDDEN') end if(worldScreen == e:GetActiveEngine() and game:GetPartyAI()) then aiButtonToggle = 1 end if(worldScreen == e:GetActiveEngine()) then Infinity_PushMenu('WORLD_LEVEL_UP_BUTTONS') end " onClose " Infinity_PopMenu('RIGHT_SIDEBAR_BOTTOM') Infinity_PopMenu('WORLD_LEVEL_UP_BUTTONS') " label { name 'rightSidebarBackground' area 0 0 80 1536 mosaic GUIWRSP } label { area 0 1536 80 1536 mosaic GUIWRSP } button { area 11 14 64 90 portrait 0 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 0" glow lua "draggedPortrait and draggedPortrait ~= 0" action "Infinity_OnPortraitLClick(0)" actionAlt "Infinity_OnPortraitRClick(0)" actionDbl "Infinity_OnPortraitDblClick(0)" actiondrag "Infinity_SwapWithPortrait(0)" actionEnter "mouseOverPortrait = 0" actionExit "mouseOverPortrait = -1" actionSimpleDrag "startDraggingPortraitOrder(0)" actionSimpleDrop "swapPortraits(0)" tooltip lua "Infinity_GetPortraitTooltip(0)" clickable lua "sidebarsGreyed ~= 1" } button { area 11 106 64 90 portrait 1 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 1" glow lua "draggedPortrait and draggedPortrait ~= 1" action "Infinity_OnPortraitLClick(1)" actionAlt "Infinity_OnPortraitRClick(1)" actionDbl "Infinity_OnPortraitDblClick(1)" actiondrag "Infinity_SwapWithPortrait(1)" actionEnter "mouseOverPortrait = 1" actionExit "mouseOverPortrait = -1" actionSimpleDrag "startDraggingPortraitOrder(1)" actionSimpleDrop "swapPortraits(1)" tooltip lua "Infinity_GetPortraitTooltip(1)" clickable lua "sidebarsGreyed ~= 1" } button { area 11 198 64 90 portrait 2 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 2" glow lua "draggedPortrait and draggedPortrait ~= 2" action "Infinity_OnPortraitLClick(2)" actionAlt "Infinity_OnPortraitRClick(2)" actionDbl "Infinity_OnPortraitDblClick(2)" actiondrag "Infinity_SwapWithPortrait(2)" actionEnter "mouseOverPortrait = 2" actionExit "mouseOverPortrait = -1" actionSimpleDrag "startDraggingPortraitOrder(2)" actionSimpleDrop "swapPortraits(2)" tooltip lua "Infinity_GetPortraitTooltip(2)" clickable lua "sidebarsGreyed ~= 1" } button { area 11 290 64 90 portrait 3 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 3" glow lua "draggedPortrait and draggedPortrait ~= 3" action "Infinity_OnPortraitLClick(3)" actionAlt "Infinity_OnPortraitRClick(3)" actionDbl "Infinity_OnPortraitDblClick(3)" actiondrag "Infinity_SwapWithPortrait(3)" actionEnter "mouseOverPortrait = 3" actionExit "mouseOverPortrait = -1" actionSimpleDrag "startDraggingPortraitOrder(3)" actionSimpleDrop "swapPortraits(3)" tooltip lua "Infinity_GetPortraitTooltip(3)" clickable lua "sidebarsGreyed ~= 1" } button { area 11 382 64 90 portrait 4 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 4" glow lua "draggedPortrait and draggedPortrait ~= 4" action "Infinity_OnPortraitLClick(4)" actionAlt "Infinity_OnPortraitRClick(4)" actionDbl "Infinity_OnPortraitDblClick(4)" actiondrag "Infinity_SwapWithPortrait(4)" actionEnter "mouseOverPortrait = 4" actionExit "mouseOverPortrait = -1" actionSimpleDrag "startDraggingPortraitOrder(4)" actionSimpleDrop "swapPortraits(4)" tooltip lua "Infinity_GetPortraitTooltip(4)" clickable lua "sidebarsGreyed ~= 1" } button { area 11 474 64 90 portrait 5 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 5" glow lua "draggedPortrait and draggedPortrait ~= 5" action "Infinity_OnPortraitLClick(5)" actionAlt "Infinity_OnPortraitRClick(5)" actionDbl "Infinity_OnPortraitDblClick(5)" actiondrag "Infinity_SwapWithPortrait(5)" actionEnter "mouseOverPortrait = 5" actionExit "mouseOverPortrait = -1" actionSimpleDrag "startDraggingPortraitOrder(5)" actionSimpleDrop "swapPortraits(5)" tooltip lua "Infinity_GetPortraitTooltip(5)" clickable lua "sidebarsGreyed ~= 1" } button { area 10 0 67 16 bam GUIPNL10 action " toggleSidebar('RIGHT') " } } menu { name 'RIGHT_SIDEBAR_BOTTOM' align right bottom ignoreEsc --Buttons form a menu aligned bottom right, with height = 197, y is offset from top of that menu. button { area 6 0 71 48 enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine() and showJournal ~= 1" toggle selectionButtonToggle bam GUILS10 sequence 14 tooltip lua "Infinity_FetchString(34764)" clickable lua "sidebarsGreyed ~= 1" action " worldScreen:OnSelectionButtonClick() " } button { area 6 49 71 48 enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" toggle highlightButtonToggle bam GUILS10 sequence 11 tooltip lua "Infinity_FetchString(40879)" clickable lua "sidebarsGreyed ~= 1" action " worldScreen:SetHighlightEnabled(highlightButtonToggle == 1) " } button { area 6 99 71 48 enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" toggle aiButtonToggle bam GUILS10 sequence 10 tooltip lua "getPartyAITooltip()" clickable lua "sidebarsGreyed ~= 1" action " game:ToggleAI() " } button { area 6 149 71 48 enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" bam GUILS10 sequence 13 tooltip lua "Infinity_FetchString(10485)" clickable lua "sidebarsGreyed ~= 1" action " game:SelectAll() " actionDbl " game:CenterOnGroupLeader() " } } menu { name 'RIGHT_SIDEBAR_HIDDEN' align right bottom ignoreEsc button { area 10 -20 67 36 bam GUIPNL1D action " toggleSidebar('RIGHT') " } } ` TEXT_inventoryError = "" function resetStatsDisplay() tempStats = {} end function getTempDamage() local str = "" local dmgMinTemp = getTempStat(characters[id].damage.min,'dmgMin',1) local dmgMaxTemp = getTempStat(characters[id].damage.max,'dmgMax',1) if(dmgMinTemp == "-" and dmgMaxTemp == "-") then return "-" end if(dmgMinTemp == "-") then str = characters[id].damage.min else str = dmgMinTemp end str = str .. " - " if(dmgMaxTemp == "-") then str = str .. characters[id].damage.max else str = str .. dmgMaxTemp end return str end function getStat(old, newName, coeff) return old end function getTempStat(old, newName, coeff) if(tempStats[id] == nil) then return "-" end local new = tempStats[id][newName] local score = coeff * (new - old) if(score == 0) then return "-" end if(score < 0) then return "^R" .. new .. "^-" end if(score > 0) then return "^G" .. new .. "^-" end end function checkDoubleClickScheduled(slotName) if(doubleClickEventScheduled == slotName) then slotDoubleClick(doubleClickEventScheduled, true) doubleClickEventScheduled = nil end end function getStatsTitle() if(tempStats[id] ~= nil) then return tempStats[id].tempItem else return "" end end function slotDoubleClick(slotName, force) local slot = characters[id].equipment[slotName] if(string.sub(slotName,1,6) == "ground" and force == nil) then --this hack is needed because the unlike other slots, ground item add/remove is a message (doesnt get executed immediately) --since the double click removes the item before re-adding it, we need to wait for that re-add to complete before continuing. doubleClickEventScheduled = slotName return end if(slot ~= nil) then if(slot.item.isBag ~= 0) then Infinity_OpenInventoryContainer(slot.item.res) else showItemAmountRequester(slotName) end end end function getTempHP() local maxHP = getTempStat(characters[id].HP.max,'maxHP',1) local currentHP = getTempStat(characters[id].HP.current, 'currentHP',1) if(maxHP == "-" and currentHP == "-") then --nothing changed. return "-" end if(maxHP == "-") then --only current HP changed. maxHP = characters[id].HP.max end if(currentHP == "-") then --only max HP changed. currentHP = characters[id].HP.current end return currentHP .. '\n' .. maxHP end function shouldGreyOutInventory() return characters[id].HP.current <= 0 or inventoryScreen:IsSpriteOrderable() == false end function getInventoryTHAC0() local str = characters[id].THAC0.current if(characters[id].THAC0.offhand) then str = str .. "\n" .. characters[id].THAC0.offhand end return str end function getInventoryDamage() local str = characters[id].damage.min .. '-' .. characters[id].damage.max if(characters[id].damage.minOffhand and characters[id].damage.maxOffhand) then str = str .. "\n" .. characters[id].damage.minOffhand .. ' - ' .. characters[id].damage.maxOffhand end return str end function getInventoryDamageDetails() if characters[id].damage.detailsOffhand == nil or characters[id].damage.detailsOffhand == "" then return characters[id].damage.details else return characters[id].damage.details.."\n\n"..characters[id].damage.detailsOffhand end end function getInventoryTHAC0Details() if characters[id].THAC0.detailsOffhand == nil or characters[id].THAC0.detailsOffhand == "" then return characters[id].THAC0.details else return characters[id].THAC0.details.."\n\n"..characters[id].THAC0.detailsOffhand end end function scrollGroundItems() forceGroundItemsScrollbar = true if scrollDirection > 0 then Infinity_OnGroundPage(-1) elseif scrollDirection < 0 then Infinity_OnGroundPage(1) end currentFakePage = Infinity_GetCurrentGroundPage() end fakeItemList = {} currentFakePage = 1 currentMaxFakePages = 1 forceGroundItemsScrollbar = false function scrollGroundItemsFunction(top, height, contentHeight) if forceGroundItemsScrollbar then forceGroundItemsScrollbar = false return (currentFakePage / currentMaxFakePages) * (height - contentHeight) elseif top ~= 0 and height ~= contentHeight and currentMaxFakePages ~= 0 then local currentPage = currentFakePage currentFakePage = math.floor((top / (height - contentHeight) * currentMaxFakePages)) if currentPage > currentFakePage then Infinity_OnGroundPage(-1) elseif currentPage < currentFakePage then Infinity_OnGroundPage(1) end return nil end end function isGroundScrollbarEnabled() local maxPages = Infinity_GetMaxGroundPage() if currentMaxFakePages ~= maxPages then currentMaxFakePages = maxPages fakeItemList = {} for i = 1, currentMaxFakePages+1 do fakeItemList[i] = 1 end end return currentMaxFakePages > 0 end ` menu { name 'INVENTORY' align center center ignoreEsc onOpen " Infinity_ActivateInventory() pushSidebars() doubleClickEventScheduled = nil for i = 1, Infinity_GetMaxGroundPage()+1 do fakeItemList[i] = 1 end currentFakePage = Infinity_GetCurrentGroundPage() currentMaxFakePages = Infinity_GetMaxGroundPage()+1 " onClose " Infinity_PopMenu('CHARACTER_COLOR') Infinity_PopMenu('ITEM_DESCRIPTION') Infinity_PopMenu('ITEM_IDENTIFY') popSidebars() fakeItemList = {} " label { area 0 0 864 710 mosaic INVENTOR } label { area 524 50 330 37 text lua "getStatsTitle()" text style "label" text color 'D' } label { enabled "tempStats[id] ~= nil" area 678 87 78 23 text "CURRENT_LABEL" text style "label" text color 'D' text point 10 } label { enabled "tempStats[id] ~= nil" area 762 87 80 23 text "NEW_LABEL" text style "label" text color 'D' text point 10 } text { area 528 120 140 62 text "ARMOR_CLASS_LABEL" text style "label" enabled "tempStats[id] ~= nil" tooltip lua "characters[id].AC.details" text align left center } label { enabled "tempStats[id] ~= nil" area 762 118 76 64 text lua "getTempStat(characters[id].AC.current,'AC',-1)" text style "label" align center center } text { area 528 194 140 64 text "HIT_POINTS_LABEL" text style "label" enabled "tempStats[id] ~= nil" tooltip lua "characters[id].HP.details" text align left center } label { enabled "tempStats[id] ~= nil" area 762 194 76 68 text lua "getTempHP()" text style "label" align center center } text { area 528 276 140 60 text "THAC0_LABEL" text style "label" enabled "tempStats[id] ~= nil" tooltip lua "characters[id].THAC0.details" text align left center } label { enabled "tempStats[id] ~= nil" area 766 270 76 66 text lua "getTempStat(characters[id].THAC0.current,'THAC0',-1)" text style "label" align center center } text { area 528 354 140 52 text "DAMAGE_LABEL" text style "label" enabled "tempStats[id] ~= nil" tooltip lua "characters[id].damage.details" text align left center } label { enabled "tempStats[id] ~= nil" area 762 347 80 59 text lua "getTempDamage()" text style "label" align center center } --stat details begin label { enabled "tempStats[id] == nil" area 536 87 50 43 text lua "characters[id].AC.current" text style "label" align center center } text { enabled "tempStats[id] == nil" area 610 66 220 92 text lua "characters[id].AC.details" text style "normal" scrollbar 'GUISCRC' } label { enabled "tempStats[id] == nil" area 540 194 38 50 text lua "characters[id].HP.current .. '\n' .. characters[id].HP.max" text style "label" align center center } text { enabled "tempStats[id] == nil" area 610 172 220 94 text lua "characters[id].HP.details" text style "normal" scrollbar 'GUISCRC' } label { enabled "tempStats[id] == nil" area 544 312 34 42 text lua "getInventoryTHAC0()" text style "label" align center center } text { enabled "tempStats[id] == nil" area 610 286 220 98 text lua "getInventoryTHAC0Details()" text style "normal" scrollbar 'GUISCRC' } label { enabled "tempStats[id] == nil" area 536 422 50 48 text lua "getInventoryDamage()" text style "label" align center center } text { enabled "tempStats[id] == nil" area 610 399 220 93 text lua "getInventoryDamageDetails()" text style "normal" scrollbar 'GUISCRC' } --stat details end button { area 299 177 128 160 paperdoll 1 actiondrag "Infinity_SwapWithAppearance()" } button { area 13 570 68 100 encumbrance } label { area 108 55 186 32 text lua "characters[id].name" text style "label" } label { area 82 6 700 44 text "INVENTORY_TITLE" text style "title" } label { area 29 201 200 30 text "QUICK_WEAPONS_LABEL" text style "label" } label { area 29 306 162 30 text "QUICK_ITEMS_LABEL" text style "label" } label { area 83 98 150 28 text "QUIVER_LABEL" text style "label" } label { area 723 528 67 30 text "GROUND_LABEL" text style "label" align left center } label { area 790 528 40 30 text lua "Infinity_GetCurrentGroundPage()+1 .. '/' .. Infinity_GetMaxGroundPage()+1" text style "label" align right center } label { area 390 474 118 24 text lua "characters[id].gold" text style "gold" text align center center } label { area 302 55 210 32 text lua "characters[id].class" text style "label" } text { area 34 437 312 47 text lua "TEXT_inventoryError" scrollbar 'GUISCRC' text style normal } slot {name "slot_inv_1" area 26 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon0" } slot {name "slot_inv_2" area 78 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon1" } slot {name "slot_inv_3" area 130 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon2" } slot {name "slot_inv_4" area 182 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon3" } slot {name "slot_inv_5" area 26 347 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.personal0" } slot {name "slot_inv_6" area 78 347 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.personal1" } slot {name "slot_inv_7" area 130 347 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.personal2" } slot {name "slot_inv_11" area 242 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.armor" } slot {name "slot_inv_12" area 294 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.gauntlets" } slot {name "slot_inv_13" area 346 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.helmet" } slot {name "slot_inv_14" area 398 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.amulet" } slot {name "slot_inv_15" area 78 138 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.quiver0" } slot {name "slot_inv_16" area 130 138 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.quiver1" } slot {name "slot_inv_17" area 182 138 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.quiver2" } slot {name "slot_inv_21" area 393 361 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.belt" } slot {name "slot_inv_22" area 218 302 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ringleft" } slot {name "slot_inv_23" area 462 302 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ringright" } slot {name "slot_inv_24" area 282 361 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.cloak" } slot {name "slot_inv_25" area 338 361 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.boots" } slot {name "slot_inv_26" area 461 244 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.shield" } slot {name "slot_inv_30" area 87 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group0" } slot {name "slot_inv_31" area 87 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group1" } slot {name "slot_inv_32" area 140 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group2" } slot {name "slot_inv_33" area 140 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group3" } slot {name "slot_inv_34" area 193 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group4" } slot {name "slot_inv_35" area 193 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group5" } slot {name "slot_inv_36" area 246 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group6" } slot {name "slot_inv_37" area 246 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group7" } slot {name "slot_inv_38" area 299 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group8" } slot {name "slot_inv_39" area 299 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group9" } slot {name "slot_inv_40" area 352 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group10" } slot {name "slot_inv_41" area 352 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group11" } slot {name "slot_inv_42" area 405 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group12" } slot {name "slot_inv_43" area 405 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group13" } slot {name "slot_inv_44" area 458 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group14" } slot {name "slot_inv_45" area 458 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group15" } list { column { width 100 label { area 0,0,928,-1 } } area 619 571 235 108 rowheight 108 hidehighlight table "fakeItemList" var currentFakePage scrollbar 'GUISCRC' scrollbar func "scrollGroundItemsFunction" scrollbar respectConstraints actionScroll "scrollGroundItems()" enabled "isGroundScrollbarEnabled()" } slot {name "slot_inv_68" area 619 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground0" actionScroll "scrollGroundItems()" } slot {name "slot_inv_69" area 619 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground1" actionScroll "scrollGroundItems()" } slot {name "slot_inv_70" area 671 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground2" actionScroll "scrollGroundItems()" } slot {name "slot_inv_71" area 671 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground3" actionScroll "scrollGroundItems()" } slot {name "slot_inv_72" area 723 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground4" actionScroll "scrollGroundItems()" } slot {name "slot_inv_73" area 723 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground5" actionScroll "scrollGroundItems()" } slot {name "slot_inv_74" area 775 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground6" actionScroll "scrollGroundItems()" } slot {name "slot_inv_75" area 775 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground7" actionScroll "scrollGroundItems()" } button { area 464 98 50 52 bam INVBUT colordisplay 2 action " Infinity_PushMenu('CHARACTER_COLOR', 0, 0) " } button { area 464 154 50 52 bam INVBUT colordisplay 1 action " Infinity_PushMenu('CHARACTER_COLOR', 0, 0) " } label --this has to be last so it draws over top of everything. { area 0 0 864 710 enabled "shouldGreyOutInventory()" rectangle 0 rectangle opacity 200 } } ` SLIDER_color_hair_start = 1 SLIDER_color_skin_start = 1 SLIDER_color_major_start = 1 SLIDER_color_minor_start = 1 SLIDER_color_hair = 1 SLIDER_color_skin = 1 SLIDER_color_major = 1 SLIDER_color_minor = 1 ` menu { name 'CHARACTER_COLOR' align center center ignoreesc modal onOpen " Infinity_UpdateLuaStats() SLIDER_color_hair = characters[id].colors.hair SLIDER_color_skin = characters[id].colors.skin SLIDER_color_major = characters[id].colors.major SLIDER_color_minor = characters[id].colors.minor SLIDER_color_hair_start = SLIDER_color_hair SLIDER_color_skin_start = SLIDER_color_skin SLIDER_color_major_start = SLIDER_color_major SLIDER_color_minor_start = SLIDER_color_minor " onClose " if(SLIDER_color_hair_start ~= -1) then Infinity_SetHairColor(SLIDER_color_hair_start) end if(SLIDER_color_skin_start ~= -1) then Infinity_SetSkinColor(SLIDER_color_skin_start) end if(SLIDER_color_major_start ~= -1) then Infinity_SetMajorColor(SLIDER_color_major_start) end if(SLIDER_color_minor_start ~= -1) then Infinity_SetMinorColor(SLIDER_color_minor_start) end " label { area -2 -6 736 716 mosaic GUICGCOL } label { area 154 30 434 56 text "COLOR_CHOICES_TITLE" text style "title" } --button --{ -- area 348 276 114 160 -- align center center -- paperdoll 0 --} button { area 474 270 114 160 align center center paperdoll 1 } label { area 298 224 42 44 colordisplay 6 } label { area 298 292 42 44 colordisplay 3 } label { area 300 414 42 44 colordisplay 2 } label { area 300 482 42 44 colordisplay 1 } label { area 42 168 298 30 text "APPEARANCE_LABEL" text style "label" text point 14 text align left center } label { area 24 198 74 44 text "HAIR_LABEL" text style "label" } slider { palette 6 area 38 224 258 44 bam 'SLDRSTAR' scaleToClip position "SLIDER_color_hair" sequence 0 frame 1 settings lua "game:GetPaletteSize(6)" action " Infinity_SetHairColor(SLIDER_color_hair) " } label { area 24 264 74 44 text "SKIN_LABEL" text style "label" } slider { palette 3 area 38 292 258 44 bam 'SLDRSTAR' scaleToClip position "SLIDER_color_skin" sequence 0 frame 1 settings lua "game:GetPaletteSize(3)" action " Infinity_SetSkinColor(SLIDER_color_skin) " } label { area 46 356 294 30 text "CLOTHING_LABEL" text style "label" text point 14 text align left center } label { area 28 386 74 44 text "MAJOR_LABEL" text style "label" } slider { palette 2 area 38 414 258 44 bam 'SLDRSTAR' scaleToClip position "SLIDER_color_major" sequence 0 frame 1 settings lua "game:GetPaletteSize(2)" action " Infinity_SetMajorColor(SLIDER_color_major) " } label { area 28 452 74 44 text "MINOR_LABEL" align center center text style "label" } slider { palette 1 area 38 482 258 44 bam 'SLDRSTAR' scaleToClip position "SLIDER_color_minor" sequence 0 frame 1 settings lua "game:GetPaletteSize(1)" action " Infinity_SetMinorColor(SLIDER_color_minor) " } button { on escape area 130 648 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action " Infinity_PopMenu('CHARACTER_COLOR',0,0) " } button { on return area 374 648 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action " --save settings SLIDER_color_hair_start = SLIDER_color_hair SLIDER_color_skin_start = SLIDER_color_skin SLIDER_color_major_start = SLIDER_color_major SLIDER_color_minor_start = SLIDER_color_minor if (e:GetActiveEngine() == createCharScreen) then createCharScreen:OnDoneButtonClick() end Infinity_PopMenu('CHARACTER_COLOR',0,0) " } } menu { name 'WORLD_LEVEL_UP_BUTTONS' align right top offset -65 0 ignoreesc enabled "0" --disable this menu for now. button { enabled "Infinity_CanLevelUp(0)" bam GUIOSW area 0 14 44 44 sequence 0 action "Infinity_ActivateRecord(0)" pulse 1 } button { enabled "Infinity_CanLevelUp(1)" bam GUIOSW area 0 106 44 44 sequence 0 action "Infinity_ActivateRecord(1)" pulse 1 } button { enabled "Infinity_CanLevelUp(2)" bam GUIOSW area 0 198 44 44 sequence 0 action "Infinity_ActivateRecord(2)" pulse 1 } button { enabled "Infinity_CanLevelUp(3)" bam GUIOSW area 0 290 44 44 sequence 0 action "Infinity_ActivateRecord(3)" pulse 1 } button { enabled "Infinity_CanLevelUp(4)" bam GUIOSW area 0 382 44 44 sequence 0 action "Infinity_ActivateRecord(4)" pulse 1 } button { enabled "Infinity_CanLevelUp(5)" bam GUIOSW area 0 474 44 44 sequence 0 action "Infinity_ActivateRecord(5)" pulse 1 } } menu { name 'textflash' opacity lua 'getOpacityForInfoBlock(1000)' enabled 'getOpacityForInfoBlock(1000) ~= 0' align center top offset 0 10 label { area 0 0 500 140 rectangle 4 rectangle opacity 200 } label { area 92 30 348 26 text lua "getTitleString()" text style "label" text align left center text point 14 text color C } text { area 20 60 472 62 text lua "getBodyString()" text style "normal" text align left top scrollbar 'GUISCRC' scrollbar hide lua "1" } label { area 16 9 72 55 bam 'GUILS10' sequence 2 frame 0 } button { area 0 0 500 140 action " if(sidebarsGreyed ~= 1) then e:GetActiveEngine():OnLeftPanelButtonClick(2) local tf = next(textflashes) setSelectedQuest(textflashes[tf][5]) end " } button { bam XBUTT on esc area 448 4 44 44 action " --end the animation local tf = next(textflashes) textflashes[tf] = nil " } } ` luaEdit = "" luaEditDebugDump = 0 luaEditHistory = {} luaEditMaxHistory = 10 luaEditHistoryIndex = 0 luaEditShowHistoryList = 0 luaEditHistoryListSelected = 0 function updateLuaHistory() local i = 2 local tempTab = {} tempTab[1] = luaEdit while ( i <= luaEditMaxHistory ) do tempTab[i] = luaEditHistory[i-1] i = i + 1 end luaEditHistory = tempTab end function loadLuaHistory() local i = 1 while (i <= luaEditMaxHistory ) do luaEditHistory[i] = Infinity_GetINIString("Lua Edit","String"..i-1, "") i = i + 1 end end function saveLuaHistory() local i = 1 while (i <= luaEditMaxHistory ) do Infinity_SetINIValue("Lua Edit","String"..i-1, luaEditHistory[i]) i = i + 1 end end function luaEditHistoryUp() if(luaEditHistoryIndex <= 1) then return end luaEditHistoryIndex = luaEditHistoryIndex - 1 luaEdit = luaEditHistory[luaEditHistoryIndex] end function luaEditHistoryDown() if(luaEditHistoryIndex == luaEditMaxHistory) then return end if(luaEditHistory[luaEditHistoryIndex + 1] == "") then return end luaEditHistoryIndex = luaEditHistoryIndex + 1 luaEdit = luaEditHistory[luaEditHistoryIndex] end cheatGoldAmt = 1000000 cheatXpAmt = 500000 cheatAreaDisplayList = {} ` menu { name 'cheatMenu' ignoreEsc onOpen " if game:GetMissionPackInfo25() then cheatAreaDisplayList = cheatAreasHoW else cheatAreaDisplayList = cheatAreas end " label { area 100 0 809 298 mosaic 'GUWBTP30' } list { column { width 20 label { area 0 0 -1 -1 text lua "cheatAreaDisplayList[rowNumber][1]" text style "list" } } column { width 80 label { area 0 0 -1 -1 text lua "cheatAreaDisplayList[rowNumber][2]" text style "list" } } area 122 6 492 240 rowheight 18 table "cheatAreaDisplayList" var cheatTeleportArea scrollbar 'GUISCRC' } button { area 122 246 142 34 bam GUIBUTNS sequence 6 text "TRAVEL_BUTTON" text style "button" action "C:MoveToArea(cheatAreaDisplayList[cheatTeleportArea][1])" } button { area 760 166 142 34 bam GUIBUTNS sequence 6 text "GODBOW_LABEL" text style "button" action "C:CreateItem('godbow')" } button { area 614 206 142 34 bam GUIBUTNS sequence 6 text "GIVE_GOLD_LABEL" text style "button" action "C:AddGold(cheatGoldAmt)" } edit { area 760 206 142 34 var cheatGoldAmt text style "edit" maxlines 1 } button { area 614 246 142 34 bam GUIBUTNS sequence 6 text "GIVE_XP_LABEL" text style "button" action "C:SetCurrentXP(cheatXpAmt)" } edit { area 760 246 142 34 var cheatXpAmt text style "edit" maxlines 1 } button { area 614 166 142 34 bam GUIBUTNS sequence 6 text "EXPLORE_LABEL" text style "button" action "C:ExploreArea()" } } menu { name "luaHistoryMenu" offset 500 -32 align right bottom label { area 0 0 809 300 mosaic 'GUWBTP30' } list { column { width 100 label { area 0 0 -1 -1 text lua "luaEditHistory[rowNumber]" text style "list" } } area 20 10 400 298 rowheight 24 var luaEditHistoryListSelected table "luaEditHistory" scrollbar 'GUISCRC' action " luaEdit = luaEditHistory[luaEditHistoryListSelected] " } } menu { name 'cheatConsole' align center bottom ignoreEsc onOpen " toolbarTop = 50 Infinity_PushMenu('WORLD_MESSAGES') Infinity_PushMenu('cheatMenu', 0, 0); Infinity_FocusTextEdit('luaEditArea'); luaEdit = trim(luaEdit) loadLuaHistory() " onClose " Infinity_PopMenu('cheatMenu', 0, 0); Infinity_PopMenu('luaHistoryMenu', 0, 0); " label { area 0 0 809 50 mosaic GUWBTP20 } edit { name "luaEditArea" area 12 8 790 24 var luaEdit scrollbar 'GUISCRC' text style "edit" fill 112 111 111 64 text useFontZoom 0 action " --if key_pressed is return if (key_pressed == 13) then updateLuaHistory() saveLuaHistory() Infinity_LuaConsoleInput(luaEditObjectId,luaEditDebugDump) return -1 end if (key_pressed == 27) then return 0 end return 1 " } button { area 816 6 32 32 bam ROUNDBUT scaleToClip toggle luaEditShowHistoryList action " if(luaEditShowHistoryList == 0) then Infinity_PopMenu('luaHistoryMenu',0,0) else Infinity_PushMenu('luaHistoryMenu',0,0) end " } button { enabled "Infinity_TextEditHasFocus()" on up action " luaEditHistoryUp() " } button { enabled "Infinity_TextEditHasFocus()" on down action " luaEditHistoryDown() " } } ` cloudLoadState=0 function CheckCloudSaveStatus() Infinity_UpdateCloudSaveState() if(cloudLoadState == 0) then Infinity_PopMenu() end return GetCloudLoadingText() end function GetCloudLoadingText() if(cloudLoadState == 1 or cloudLoadState == 0) then return t('DOWNLOADING_SAVE_NORMAL') end if(cloudLoadState == 2) then return t('SEARCHING_SAVE_NORMAL') end return t('CLOUD_STATE_UNDEFINED_NORMAL') end ` menu { name 'CloudSaveUpdateMenu' modal label { area 0 0 408 418 mosaic GUIERR } label { area 82 74 242 88 text lua "CheckCloudSaveStatus()" text style "label" } button { area 102 318 200 44 bam GUIOSTUM sequence 0 text "SKIP_BUTTON" text style "button" on escape action " Infinity_PopMenu() " } } ` messageBoxCurMessage = nil messageBoxMessages = {} function initMessageBox(message) messageBoxMessages[message] = 1 if(messageBoxCurMessage ~= nil) then --message box already active return end getNextMessage() Infinity_PushMenu('LuaMessageBox',0,0) end function getNextMessage() i = 1 while ( i <= messageBoxMessageCount ) do showMessage = messageBoxMessages[i] if ( showMessage ~= nil ) then messageBoxCurMessage = i return 1 end i = i + 1 end --whole table scanned, all messages have been displayed return 0 end ` menu { name 'LuaMessageBox' align center center ignoreesc modal label { area 0 0 657 234 mosaic GUIERR6 } label { area 29 21 580 126 text lua "messages[messageBoxCurMessage]" text style "label" } button { area 213 170 230 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONE_BUTTON" text style "button" action " messageBoxMessages[messageBoxCurMessage] = nil if(getNextMessage() == 0) then messageBoxCurMessage = nil Infinity_PopMenu() end " } } ` partyImport = {} ` menu { name 'IMPORTPARTY' align center center label { mosaic 'GMPCARBD' area 0 0 1024 768 } label { area 162 16 700 44 text "CREATE_PARTY_TITLE" text style "title" } label { enabled "game:GetMissionPackInfoTBP()" area 54 584 902 62 scrollbar 'GUISCRC' text style "normal" text 69563 } --portraits label { area 67 180 64 90 bam 'GUIRSP10' sequence 0 } button { area 71 182 56 86 bitmap lua "partyImport.character[1].portrait" clickable lua "partyImport.character[1].name ~= ''" action " createPartyScreen:OnPortraitButtonClick(0) " } label { area 67 315 64 90 bam 'GUIRSP10' sequence 0 } button { area 71 317 56 86 bitmap lua "partyImport.character[2].portrait" clickable lua "partyImport.character[2].name ~= ''" action " createPartyScreen:OnPortraitButtonClick(1) " } label { area 67 454 64 90 bam 'GUIRSP10' sequence 0 } button { area 71 456 56 86 bitmap lua "partyImport.character[3].portrait" clickable lua "partyImport.character[3].name ~= ''" action " createPartyScreen:OnPortraitButtonClick(2) " } label { area 557 180 64 90 bam 'GUIRSP10' sequence 0 } button { area 561 182 56 86 bitmap lua "partyImport.character[4].portrait" clickable lua "partyImport.character[4].name ~= ''" action " createPartyScreen:OnPortraitButtonClick(3) " } label { area 557 315 64 90 bam 'GUIRSP10' sequence 0 } button { area 561 317 56 86 bitmap lua "partyImport.character[5].portrait" clickable lua "partyImport.character[5].name ~= ''" action " createPartyScreen:OnPortraitButtonClick(4) " } label { area 557 454 64 90 bam 'GUIRSP10' sequence 0 } button { area 561 456 56 86 bitmap lua "partyImport.character[6].portrait" clickable lua "partyImport.character[6].name ~= ''" action " createPartyScreen:OnPortraitButtonClick(5) " } button { area 528 711 204 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "PLAY_IMPORT_BUTTON" -- Play text style 'button' clickable lua "partyImport.playbuttonclickable" action " createPartyScreen:OnDoneButtonClick() " } button { on escape area 300 711 204 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "BACK_BUTTON" -- Back text style 'button' action " createPartyScreen:OnBackButtonClick() " } --delete/create buttons button { area 155 180 300 44 bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "partyImport.character[1].createdelete" text style "button" action " createPartyScreen:OnCreateDeleteButtonClick(0) " } button { area 155 317 300 44 bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "partyImport.character[2].createdelete" text style "button" action " createPartyScreen:OnCreateDeleteButtonClick(1) " } button { area 155 452 300 44 bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "partyImport.character[3].createdelete" text style "button" action " createPartyScreen:OnCreateDeleteButtonClick(2) " } button { area 645 180 300 44 bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "partyImport.character[4].createdelete" text style "button" action " createPartyScreen:OnCreateDeleteButtonClick(3) " } button { area 645 317 300 44 bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "partyImport.character[5].createdelete" text style "button" action " createPartyScreen:OnCreateDeleteButtonClick(4) " } button { area 645 452 300 44 bam 'GUIBUTWT' sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "partyImport.character[6].createdelete" text style "button" action " createPartyScreen:OnCreateDeleteButtonClick(5) " } -- character labels label { area 155 228 314 50 text lua "partyImport.character[1].name" text style "title" } label { area 155 365 314 50 text lua "partyImport.character[2].name" text style "title" } label { area 155 500 314 50 text lua "partyImport.character[3].name" text style "title" } label { area 645 228 314 50 text lua "partyImport.character[4].name" text style "title" } label { area 645 365 314 50 text lua "partyImport.character[5].name" text style "title" } label { area 645 500 314 50 text lua "partyImport.character[6].name" text style "title" } label { area 28 572 972 80 text lua "Infinity_FetchString(40689)" text style 'label' text point 13 } } ` highlightBG = false highlightSOD = false highlightBP = false logoFrame = 0 function startThreeBookHighlight(book) if book == 1 and highlightBG == true then return 1 elseif book == 2 and highlightSOD == true then return 1 elseif book == 3 and highlightBP == true then return 1 else return 0 end end ` menu { name 'START' align center center ignoreesc onOpen " e:CheckGUISong() local state = startEngine:GetEngineState() if lastStartMenu and lastStartMenu ~= 'START' then Infinity_PushMenu(lastStartMenu) lastStartMenu = nil elseif state == 1 then Infinity_PushMenu('START_SP') elseif state == 2 then Infinity_PushMenu('START_MP') elseif state == 0 then Infinity_PushMenu('START_MAIN') end Infinity_SetBackground('BACKGROUND') Infinity_SetHighlightColors(0x14, 0x6b, 0x66, 0xcc, 0x14, 0x6b, 0x66, 0x88, 0x14, 0x6b, 0x66, 0x00) " onClose " local state = startEngine:GetEngineState() if state == 1 then Infinity_PopMenu('START_SP') elseif state == 2 then Infinity_PopMenu('START_MP') elseif state == 0 or state == 3 then Infinity_PopMenu('START_MAIN') end " label { area 0 0 1024 768 mosaic 'START3EE' } label { area 116 12 786 150 bam 'TITLE' sequence 0 align center center frame 2 } text --iwd { bam 'LOGOIWD' sequence 0 frame lua "startThreeBookHighlight(1)" area 240 227 218 260 align center center action " logoFrame = 0 startEngine:OnSoAButtonClick(true) Infinity_PushMenu('START_MAIN') " actionEnter " highlightBG = true " actionExit " highlightBG = false " } text --how { bam 'LOGOHOW' sequence 0 frame lua "startThreeBookHighlight(2)" area 560 227 218 252 align center center action " logoFrame = 1 startEngine:OnToBButtonClick(true) Infinity_PushMenu('START_MAIN') " actionEnter " highlightSOD = true " actionExit " highlightSOD = false " } button --credits { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 178 714 234 44 pad 10 8 10 8 text style "button" text "CREDITS_BUTTON" action " Infinity_PushMenu('CREDITS') " } button --quit { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 418 714 206 44 pad 10 8 10 8 text style "button" text "QUIT_GAME_BUTTON" enabled "not e:IsTouchUI()" action " startEngine:OnQuitButtonClick() " } button --options { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 628 714 234 44 pad 10 8 10 8 text style "button" text "OPTIONS_BUTTON" action " Infinity_TransitionMenu('START_OPTIONS') optionsScreen:SetEngineState(1) startEngine:OnOptionsButtonClick() lastStartMenu = 'START' " } label { area 898 726 118 38 text lua "versionString" text style "label" text point 15 align center center } } menu { name 'START_MAIN' align center center ignoreEsc onOpen " canContinue = startEngine:HasGameToContinue() " label { area 0 0 1024 768 mosaic 'START' } label { area 116 12 786 150 bam 'TITLE' sequence 0 align center center frame lua 'logoFrame' } label { area 332 190 352 456 bam 'BIGLOGO' align center center frame lua 'logoFrame' } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 86 314 232 44 pad 10 8 10 8 text style "button" text "SINGLEPLAYER_BUTTON" --text 15413 action " startEngine:SetEngineState(1) Infinity_TransitionMenu('START_SP') " } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 710 314 232 44 pad 10 8 10 8 text style "button" text "MULTIPLAYER_BUTTON" action " startEngine:OnMultiPlayerButtonClick() " } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 710 395 232 44 pad 10 8 10 8 text style "button" text 40333 --"CONTINUE_BUTTON" clickable lua "canContinue" action "startEngine:OnContinueGame()" } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 86 476 232 44 pad 10 8 10 8 text style "button" text "OPTIONS_BUTTON" action " Infinity_TransitionMenu('START_OPTIONS') optionsScreen:SetEngineState(1) startEngine:OnOptionsButtonClick() lastStartMenu = 'START_MAIN' " } button { area 710 476 232 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" pad 10 8 10 8 text style "button" text "BACK_BUTTON" action " e:GetObjectGame():SetCampaign('') Infinity_PopMenu() " } label { area 898 726 118 38 text lua "versionString" text style "label" text point 15 align center center } } menu { name 'START_SP' align center center ignoreEsc label { area 0 0 1024 768 mosaic 'START' } label { area 116 12 786 150 bam 'TITLE' sequence 0 align center center frame lua 'logoFrame' } label { area 328 190 352 456 bam 'BIGLOGO' align center center frame lua 'logoFrame' } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 86 314 230 44 pad 10 8 10 8 text style "button" text "NEW_GAME_BUTTON" action " Infinity_PopMenu(); startEngine:OnCreatePartyButtonClick(); " } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 710 314 230 44 pad 10 8 10 8 text style "button" text "LOAD_GAME_BUTTON" action "Infinity_PopMenu(); startEngine:OnLoadGameButtonClick()" } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 86 395 230 44 pad 10 8 10 8 text style "button" text "PREGENERATE_BUTTON" action "Infinity_PopMenu(); startEngine:OnPreGenerateButtonClick()" } --button --{ -- bam 'GUIBUTMT' -- sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" -- area 710 395 230 44 -- pad 10 8 10 8 -- text style "button" -- text "IMPORT_GAME_BUTTON" -- action -- " -- Infinity_PopMenu(); -- startEngine:OnImportCharacterButtonClick(); -- " --} --button --{ -- bam 'GUIBUTMT' -- sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" -- area 86 476 230 44 -- pad 10 8 10 8 -- text style "button" -- text "OPTIONS_BUTTON" -- action " -- Infinity_TransitionMenu('START_OPTIONS') -- optionsScreen:SetEngineState(1) -- startEngine:OnOptionsButtonClick() -- lastStartMenu = 'START_SP' -- " --} button { area 710 476 230 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" pad 10 8 10 8 text style "button" text "BACK_BUTTON" action "startEngine:SetEngineState(0); Infinity_TransitionMenu('START')" } label { area 898 726 118 38 text lua "versionString" text style "label" text point 15 align center center } } ` shownSpellOffset = 0 numberOfKnownMageSpellSlots = 32 mageName = "" function magePageInfo() if bookMode == 0 then -- Regular if characters[id].hasSorcererBook then return t("SPELLS_CAN_CAST_LABEL") .. ": " .. characters[id].mageDetails[currentSpellLevel].slotsRemaining .. "/" .. characters[id].mageDetails[currentSpellLevel].maxMemorized else return t("MEMORIZED_LABEL") .. ": " .. #bottomSpells .. "/" .. characters[id].mageDetails[currentSpellLevel].maxMemorized end elseif bookMode == 1 then -- Sequencer/Contingency return t("SPELLS_LABEL") .. " :" .. #bottomSpells .. "/" .. #bottomSpellsPlaceHolder end return "" end contingencyDescription = 0 function mageBookDescription() if mageBookEnabled == true then if bookMode == 0 then if characters[id].mageSpells[currentSpellLevel][currentBookSpell] then return Infinity_FetchString(characters[id].mageSpells[currentSpellLevel][currentBookSpell].description) else return t('SPELL_MEMORIZATION_HELP') end elseif bookMode == 1 then if contingencyDescription == 0 and currentBookSpell ~= 0 then return Infinity_FetchString(bookSpells[currentBookSpell].description) else lastCurrentBookSpell = 0 if contingencyDescription == 0 then contingencyDescription = mageBookStrings[contingencyResRef].tip end return Infinity_FetchString(contingencyDescription) end end end return "" end function mageBookTitle() if bookMode == 1 and mageBookStrings[contingencyResRef] then return t(mageBookStrings[contingencyResRef].title) else return t('MAGE_SPELLS_TITLE') end end function mageBookAction() if bookMode == 1 and mageBookStrings[contingencyResRef] then return t(mageBookStrings[contingencyResRef].action) else return t("MAGE_BOOK_LABEL") end end function makeBlankTable(num) local out = {} for i = 1,num do table.insert(out, {}) end return out end function contingencyDoneButtonText() if contingencyComplete() then return t("DONE_BUTTON") else return t("CANCEL_BUTTON") end end function filterMemorizedMageSpells() local out = {} currentSpellLevel = math.min(currentSpellLevel, 9) for k,v in pairs(characters[id].mageSpells[currentSpellLevel]) do for i=v.memorizedCount, 1, -1 do local spell = deepcopy(v) if(i <= v.castableCount) then spell.castable = 1 else spell.castable = 0 end table.insert(out, spell) end end return out end function findFirstDifferenceInSpellList(oldList, newList) local ret = -1 local spellIndex = 1 if oldList ~= nil and newList ~= nil then while oldList[spellIndex] ~= nil do if newList[spellIndex] == nil then print("New list empty at point "..spellIndex) ret = spellIndex break end if oldList[spellIndex].icon ~= newList[spellIndex].icon then print("Lists differ at point "..spellIndex.." "..oldList[spellIndex].icon.." vs "..newList[spellIndex].icon) ret = spellIndex break end spellIndex = spellIndex + 1 end if oldList[spellIndex] == nil and newList[spellIndex] ~= nil then print("New list has a new spell at point "..spellIndex) ret = spellIndex end end return ret end showMageMemorizationFlash = false function refreshMageBook() if currentSpellLevel == nil then currentSpellLevel = 1 end if bookMode == 0 then if characters[id].hasMageBook then bookSpells = characters[id].mageSpells[currentSpellLevel] newBottomSpells = filterMemorizedMageSpells() if showMageMemorizationFlash == true then showMageMemorizationFlash = false end bottomSpells = newBottomSpells bottomSpellsPlaceHolder = makeBlankTable(characters[id].mageDetails[currentSpellLevel].maxMemorized) else bookSpells = characters[id].mageSpells[currentSpellLevel] bottomSpells = {} bottomSpellsPlaceHolder = {} end elseif bookMode == 1 then bookSpells = filterContingencyMageSpells() bottomSpells = sequencerSpells bottomSpellsPlaceHolder = makeBlankTable(contingencyMaxSpells) contingencyDescription = mageBookStrings[contingencyResRef].tip end end function setMageBookLevel(num) currentBookSpell = 0 shownSpellOffset = 0 if currentSpellLevel ~= num then Infinity_PlaySound('GAM_05') end currentSpellLevel = num mageScreen:SetSpellLevel(num-1) refreshMageBook() end function createMageMemorizationSparkle(x,y,w,h, fromList, listIndex) Infinity_InstanceAnimation("TEMPLATE_mageMemorizationSparkle","FLASHBR",x,y,w,h,fromList,listIndex) memorizationFlashes[currentAnimationID][1] = true memorizationFlashes[currentAnimationID][3] = false currentAnimationID = currentAnimationID + 1 if currentAnimationID > #(memorizationFlashes) then currentAnimationID = 1 end end currentAnimationID = 1 updateCounterMemorizationSparkles = 1 function updateMemorizationSparkles() local sparkleNumber = 1 updateCounterMemorizationSparkles = updateCounterMemorizationSparkles + 1 if updateCounterMemorizationSparkles > 2 then updateCounterMemorizationSparkles = 1 for sparkleNumber = 1, #(memorizationFlashes), 1 do if memorizationFlashes[sparkleNumber][1] == true then memorizationFlashes[sparkleNumber][2] = memorizationFlashes[sparkleNumber][2] + 1 if memorizationFlashes[sparkleNumber][2] > 7 then memorizationFlashes[sparkleNumber][1] = false memorizationFlashes[sparkleNumber][2] = 0 memorizationFlashes[sparkleNumber][3] = true end end end end end function destroyMemorizationSparkle(instanceId) local ret = memorizationFlashes[instanceId][3] memorizationFlashes[instanceId][3] = false return ret end function showMemorizationSparkle(instanceId) updateMemorizationSparkles() return memorizationFlashes[instanceId][1] end function unmemorizingMageSpell(resref) local index = 1 local sparkle = -1 for index = 1, #(bottomSpells), 1 do if bottomSpells[index].resref == resref then sparkle = index if bottomSpells[index].castable == 0 then break end end end local x,y,w,h = Infinity_GetArea("BUTTON_MEMORIZEDSPELL_" .. sparkle) createMageMemorizationSparkle(x, y, w, h, 'memorizedListMage', sparkle) end memorizationFlashes = { {false, 0, false}, {false, 0, false}, {false, 0, false}, {false, 0, false}, {false, 0, false}, {false, 0, false}, {false, 0, false}, {false, 0, false}, {false, 0, false}, {false, 0, false} } function getMageBookLevel() local ret = t('LEVEL_LABEL').." "..currentSpellLevel return ret end function getMageBookSpellFraction() local ret = "" if #bookSpells > numberOfKnownMageSpellSlots then ret = (shownSpellOffset + 1) .. "/" .. math.floor(((#bookSpells / numberOfKnownMageSpellSlots) + 1)) end return ret end function getMageBookSpellLevelFrame(level) local ret = 0 if currentSpellLevel == level then ret = 2 end return ret end function getMemorizedMageSpellSlotEnabled(slot) local ret = true if slot > characters[id].mageDetails[currentSpellLevel].maxMemorized then return false elseif characters[id].hasSorcererBook then return false end return ret end function showSpellDetails(spell, isMemorizedSlot) if(spell.isPlaceholder) then return end currentSpell = spell showEraseButton = not isMemorizedSlot Infinity_PushMenu("SPELL_DESCRIPTION") end ` menu { name 'MAGE' align center center modal lua "bookMode == 1" onopen " showMageMemorizationFlash = false mgpage = nil setMageBookLevel(1) if showContingency then Infinity_SetArea('bookListMage', nil, 412, nil, 156) Infinity_SetArea('bookDescription', nil, 412, nil, 156) else Infinity_SetArea('bookListMage', nil, 186, nil, 274) Infinity_SetArea('bookDescription', nil, 186, nil, 274) end if bookMode == 1 then contingencyDescription = mageBookStrings[contingencyResRef].tip end currentContingencyCondition = 0 currentContingencyTarget = 0 currentAnimationID = 1 updateCounterMemorizationSparkles = 1 " onclose " " button { enabled "CurrentlyInGame()" on escape action " --Return to world screen on escape e:SelectEngine(worldScreen) " } template { label { enabled "showMemorizationSparkle(instanceId)" ignoreEvents area 0 0 40 39 bam "FLASH" usealpha lua "true" frame lua "memorizationFlashes[instanceId][2]" align center center } name "TEMPLATE_mageMemorizationSparkle" } label { area 0 0 864 710 mosaic "GUIMGB" } label { area 82 10 700 44 text lua "mageBookAction()" text style "title" } label { area 210 59 446 30 text lua "mageName" text style "label" } button { area 168 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(1)" sequence 0 enabled "maxMagePage > 0" action "setMageBookLevel(1)" } button { area 227 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(2)" sequence 1 enabled "maxMagePage > 1" action "setMageBookLevel(2)" } button { area 286 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(3)" sequence 2 enabled "maxMagePage > 2" action "setMageBookLevel(3)" } button { area 345 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(4)" sequence 3 enabled "maxMagePage > 3" action "setMageBookLevel(4)" } button { area 404 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(5)" sequence 4 enabled "maxMagePage > 4" action "setMageBookLevel(5)" } button { area 464 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(6)" sequence 5 enabled "maxMagePage > 5" action "setMageBookLevel(6)" } button { area 523 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(7)" sequence 6 enabled "maxMagePage > 6" action "setMageBookLevel(7)" } button { area 583 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(8)" sequence 7 enabled "maxMagePage > 7" action "setMageBookLevel(8)" } button { area 644 110 54 54 bam GUIPRTC frame lua "getMageBookSpellLevelFrame(9)" sequence 8 enabled "maxMagePage > 8" action "setMageBookLevel(9)" } label { area 146 178 268 224 rectangle 1 rectangle opacity 200 enabled "showContingency" } label { area 152 182 262 28 enabled "showContingency" text "CONDITION_NORMAL" text style "normal" } list { column { width 100 label { area 10 0 -1 -1 text lua "Infinity_FetchString( contingencyConditions[rowNumber].strref)" text style "normal" text align left center } } area 152 210 262 186 enabled "showContingency" rowheight 40 table "contingencyConditions" var currentContingencyCondition scrollbar 'GUISCRC' action " contingencyDescription = contingencyConditions[currentContingencyCondition].desc " } label { area 452 176 254 226 rectangle 1 rectangle opacity 200 enabled "showContingency" } label { area 458 182 240 28 enabled "showContingency" text "TARGET_NORMAL" text style "normal" } list { column { width 100 label { area 10 0 -1 -1 text lua "Infinity_FetchString( contingencyTargets[rowNumber].strref)" text style "normal" text align left center } } area 458 210 240 186 enabled "showContingency" rowheight 40 table "contingencyTargets" var currentContingencyTarget scrollbar 'GUISCRC' action " contingencyDescription = contingencyTargets[currentContingencyTarget].desc " } list { column { width 100 label { area 0 0 -1 -1 bam "SPELFRMS" sequence 0 align center center } } area 252 522 362 176 enabled "#bottomSpellsPlaceHolder ~= 0 or bookMode == 1" rowwidth 36 table "bottomSpellsPlaceHolder" } label { area 358 480 152 36 text lua "magePageInfo()" text style "label" } button { area 624 656 236 42 enabled "bookMode == 0 and (#characters[id].contingencySpells > 0 or #characters[id].sequencerSpells > 0)" bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "CONTINGENCY_BUTTON" text style "button" action "Infinity_PushMenu('MAGE_CONTINGENCY')" } label { area 170 194 112 30 text lua "getMageBookLevel()" text style "parchment" text align right center text point 20 } label { area 286 194 54 30 text lua "getMageBookSpellFraction()" text style "parchment" text align right center text point 20 } label { area 462 194 231 30 text lua "KNOWN_ARCANE_SPELLS_LABEL" text style "parchment" text align right center text point 20 } button {area 169 228 54 54 sequence 0 name "BUTTON_BOOKSPELL_1" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 1]"} button {area 228 228 54 54 sequence 1 name "BUTTON_BOOKSPELL_2" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 2]"} button {area 286 228 54 54 sequence 2 name "BUTTON_BOOKSPELL_3" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 3]"} button {area 345 228 54 54 sequence 3 name "BUTTON_BOOKSPELL_4" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 4]"} button {area 169 288 54 54 sequence 4 name "BUTTON_BOOKSPELL_5" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 5]"} button {area 228 288 54 54 sequence 5 name "BUTTON_BOOKSPELL_6" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 6]"} button {area 286 288 54 54 sequence 6 name "BUTTON_BOOKSPELL_7" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 7]"} button {area 345 288 54 54 sequence 7 name "BUTTON_BOOKSPELL_8" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 8]"} button {area 169 350 54 54 sequence 8 name "BUTTON_BOOKSPELL_9" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 9]"} button {area 228 350 54 54 sequence 9 name "BUTTON_BOOKSPELL_10" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 10]"} button {area 286 350 54 54 sequence 0 name "BUTTON_BOOKSPELL_11" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 11]"} button {area 345 350 54 54 sequence 1 name "BUTTON_BOOKSPELL_12" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 12]"} button {area 169 410 54 54 sequence 2 name "BUTTON_BOOKSPELL_13" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 13]"} button {area 228 410 54 54 sequence 3 name "BUTTON_BOOKSPELL_14" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 14]"} button {area 286 410 54 54 sequence 4 name "BUTTON_BOOKSPELL_15" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 15]"} button {area 345 410 54 54 sequence 5 name "BUTTON_BOOKSPELL_16" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 16]"} button {area 461 228 54 54 sequence 6 name "BUTTON_BOOKSPELL_17" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 17]"} button {area 521 228 54 54 sequence 7 name "BUTTON_BOOKSPELL_18" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 18]"} button {area 580 228 54 54 sequence 8 name "BUTTON_BOOKSPELL_19" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 19]"} button {area 639 228 54 54 sequence 9 name "BUTTON_BOOKSPELL_20" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 20]"} button {area 461 288 54 54 sequence 4 name "BUTTON_BOOKSPELL_21" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 21]"} button {area 521 288 54 54 sequence 5 name "BUTTON_BOOKSPELL_22" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 22]"} button {area 580 288 54 54 sequence 6 name "BUTTON_BOOKSPELL_23" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 23]"} button {area 639 288 54 54 sequence 7 name "BUTTON_BOOKSPELL_24" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 24]"} button {area 461 350 54 54 sequence 4 name "BUTTON_BOOKSPELL_21" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 25]"} button {area 521 350 54 54 sequence 5 name "BUTTON_BOOKSPELL_22" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 26]"} button {area 580 350 54 54 sequence 6 name "BUTTON_BOOKSPELL_23" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 27]"} button {area 639 350 54 54 sequence 7 name "BUTTON_BOOKSPELL_24" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 28]"} button {area 461 410 54 54 sequence 4 name "BUTTON_BOOKSPELL_21" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 29]"} button {area 521 410 54 54 sequence 5 name "BUTTON_BOOKSPELL_22" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 30]"} button {area 580 410 54 54 sequence 6 name "BUTTON_BOOKSPELL_23" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 31]"} button {area 639 410 54 54 sequence 7 name "BUTTON_BOOKSPELL_24" spellinfo "bookSpells[shownSpellOffset * numberOfKnownMageSpellSlots + 32]"} label {area 254 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(1)" enabled "getMemorizedMageSpellSlotEnabled(1)"} button {area 254 530 54 54 sequence 0 name "BUTTON_MEMORIZEDSPELL_1" memorizedspellinfo "bottomSpells[1]"} label {area 315 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(2)" enabled "getMemorizedMageSpellSlotEnabled(2)"} button {area 315 530 54 54 sequence 1 name "BUTTON_MEMORIZEDSPELL_2" memorizedspellinfo "bottomSpells[2]"} label {area 376 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(3)" enabled "getMemorizedMageSpellSlotEnabled(3)"} button {area 376 530 54 54 sequence 2 name "BUTTON_MEMORIZEDSPELL_3" memorizedspellinfo "bottomSpells[3]"} label {area 437 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(4)" enabled "getMemorizedMageSpellSlotEnabled(4)"} button {area 437 530 54 54 sequence 3 name "BUTTON_MEMORIZEDSPELL_4" memorizedspellinfo "bottomSpells[4]"} label {area 498 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(5)" enabled "getMemorizedMageSpellSlotEnabled(5)"} button {area 498 530 54 54 sequence 4 name "BUTTON_MEMORIZEDSPELL_5" memorizedspellinfo "bottomSpells[5]"} label {area 559 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(6)" enabled "getMemorizedMageSpellSlotEnabled(6)"} button {area 559 530 54 54 sequence 5 name "BUTTON_MEMORIZEDSPELL_6" memorizedspellinfo "bottomSpells[6]"} label {area 254 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(7)" enabled "getMemorizedMageSpellSlotEnabled(7)"} button {area 254 585 54 54 sequence 6 name "BUTTON_MEMORIZEDSPELL_7" memorizedspellinfo "bottomSpells[7]"} label {area 315 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(8)" enabled "getMemorizedMageSpellSlotEnabled(8)"} button {area 315 585 54 54 sequence 7 name "BUTTON_MEMORIZEDSPELL_8" memorizedspellinfo "bottomSpells[8]"} label {area 376 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(9)" enabled "getMemorizedMageSpellSlotEnabled(9)"} button {area 376 585 54 54 sequence 8 name "BUTTON_MEMORIZEDSPELL_9" memorizedspellinfo "bottomSpells[9]"} label {area 437 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(10)" enabled "getMemorizedMageSpellSlotEnabled(10)"} button {area 437 585 54 54 sequence 9 name "BUTTON_MEMORIZEDSPELL_10" memorizedspellinfo "bottomSpells[10]"} label {area 498 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(11)" enabled "getMemorizedMageSpellSlotEnabled(11)"} button {area 498 585 54 54 sequence 0 name "BUTTON_MEMORIZEDSPELL_11" memorizedspellinfo "bottomSpells[11]"} label {area 559 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(12)" enabled "getMemorizedMageSpellSlotEnabled(12)"} button {area 559 585 54 54 sequence 1 name "BUTTON_MEMORIZEDSPELL_12" memorizedspellinfo "bottomSpells[12]"} label {area 254 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(13)" enabled "getMemorizedMageSpellSlotEnabled(13)"} button {area 254 640 54 54 sequence 2 name "BUTTON_MEMORIZEDSPELL_13" memorizedspellinfo "bottomSpells[13]"} label {area 315 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(14)" enabled "getMemorizedMageSpellSlotEnabled(14)"} button {area 315 640 54 54 sequence 3 name "BUTTON_MEMORIZEDSPELL_14" memorizedspellinfo "bottomSpells[14]"} label {area 376 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(15)" enabled "getMemorizedMageSpellSlotEnabled(15)"} button {area 376 640 54 54 sequence 4 name "BUTTON_MEMORIZEDSPELL_15" memorizedspellinfo "bottomSpells[15]"} label {area 437 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(16)" enabled "getMemorizedMageSpellSlotEnabled(16)"} button {area 437 640 54 54 sequence 5 name "BUTTON_MEMORIZEDSPELL_16" memorizedspellinfo "bottomSpells[16]"} label {area 498 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(17)" enabled "getMemorizedMageSpellSlotEnabled(17)"} button {area 498 640 54 54 sequence 6 name "BUTTON_MEMORIZEDSPELL_17" memorizedspellinfo "bottomSpells[17]"} label {area 559 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(18)" enabled "getMemorizedMageSpellSlotEnabled(18)"} button {area 559 640 54 54 sequence 7 name "BUTTON_MEMORIZEDSPELL_18" memorizedspellinfo "bottomSpells[18]"} button { area 588 584 236 52 enabled "bookMode == 1" bam GUIOSTLR text lua "contingencyDoneButtonText()" text style "button" action " if contingencyComplete() then mageScreen:DoneSequencingSpells() else mageScreen:CancelSequencingSpells() end e:SelectEngine(worldScreen) " } button { area 18 252 52 130 bam GUIPRC sequence 0 action " if shownSpellOffset > 0 then shownSpellOffset = shownSpellOffset - 1 Infinity_PlaySound('GAM_05') elseif shownSpellOffset == 0 and currentSpellLevel > 1 then setMageBookLevel(currentSpellLevel - 1) if #bookSpells > 0 then shownSpellOffset = math.floor((#bookSpells-1) / numberOfKnownMageSpellSlots) end end " } button { area 792 252 52 130 bam GUIPRC sequence 1 action " if (shownSpellOffset + 1) < math.floor((((#bookSpells-1) / numberOfKnownMageSpellSlots) + 1)) then shownSpellOffset = shownSpellOffset + 1 Infinity_PlaySound('GAM_05') elseif currentSpellLevel < 9 and ((shownSpellOffset + 1) == math.floor((((#bookSpells-1) / numberOfKnownMageSpellSlots) + 1)) or #bookSpells == 0) then setMageBookLevel(currentSpellLevel + 1) end " } label { area 0 0 865 710 fill 0 0 0 176 enabled "mageBookEnabled == false" } } ` contingencySpellType = 0 contingencySpellLevel = 1 contingencySwapTable = {} function getContingencyTitle() return t(mageBookStrings[contingencyResRef].title) end function getContingencySpellType() local ret = "" if contingencySpellType == 0 then ret = t("MAGE_SPELLS_TITLE") else ret = t("ASSIGN_KEYS_PRIESTSPELLS") end return ret end function getContingencySpellLevel() local ret = "" ret = t("LEVEL_LABEL").." "..contingencySpellLevel return ret end function getContingencyTypeButtonText() local ret if contingencySpellType == 0 then ret = Infinity_FetchString(7204) else ret = Infinity_FetchString(7203) end return ret end function tableInsert(out, v) if mageScreen:SpellSwappedInContingency(v.resref) then for key,value in pairs(contingencySwapTable) do value.castableCount = v.castableCount table.insert(out, value) end else table.insert(out, v) end end function filterContingencyMageSpells() local out = {} if contingencySpellType == 0 then if characters[id].mageSpells ~= nil and characters[id].mageSpells[contingencySpellLevel] ~= nil then for k,v in pairs(characters[id].mageSpells[contingencySpellLevel]) do if v.castableCount > 0 and mageScreen:SpellAllowedForContingency(v.level, v.resref) then tableInsert(out, v) end end end else if characters[id].priestSpells ~= nil and characters[id].priestSpells[contingencySpellLevel] ~= nil then for k,v in pairs(characters[id].priestSpells[contingencySpellLevel]) do if v.castableCount > 0 and mageScreen:SpellAllowedForContingency(v.level, v.resref) then tableInsert(out, v) end end end end return out end function getContingencySpellIcon(slotNumber) local ret = "" if slotNumber <= #bookSpells then ret = bookSpells[slotNumber].icon end return ret end function getContingencySpellCastableCount(slotNumber) local ret = "" if slotNumber <= #bookSpells and bookSpells[slotNumber].castableCount > 1 then ret = bookSpells[slotNumber].castableCount end return ret end function contingencyDisplaySpellDescription(slotNumber) if slotNumber <= #bookSpells then contingencyDescription = bookSpells[slotNumber].description end end function contingencyDisplaySetSpellDescription(slotNumber) if slotNumber <= #sequencerSpells then contingencyDescription = sequencerSpells[slotNumber].description end end function changeContingencySpellLevel(changeAmount) local newLevel = contingencySpellLevel + changeAmount if newLevel >= 1 and newLevel <= maxMagePage then contingencySpellLevel = newLevel bookSpells = filterContingencyMageSpells() end end function swapContingencySpellType() contingencySpellType = 1 - contingencySpellType if contingencySpellType == 0 and contingencySpellLevel > maxMagePage then contingencySpellLevel = maxMagePage elseif contingencySpellType == 1 and contingencySpellLevel > math.min(maxMagePage, 7) then contingencySpellLevel = math.min(maxMagePage, 7) end end function getContingencySetSpellIcon(slotNumber) local ret = "" if sequencerSpells ~= nil and #sequencerSpells >= slotNumber then ret = sequencerSpells[slotNumber].icon end return ret end function contingencyComplete() local ret = false if showContingency and #sequencerSpells == contingencyMaxSpells and (currentContingencyCondition or 0) > 0 and (currentContingencyTarget or 0) > 0 then ret = true elseif not showContingency and #sequencerSpells == contingencyMaxSpells then ret = true end return ret end ` menu { name 'CONTINGENCY' align center center modal onOpen " currentContingencyCondition = 0 currentContingencyTarget = 0 contingencySpellType = 0 contingencySpellLevel = 1 bookSpells = filterContingencyMageSpells() contingencyDescription = mageBookStrings[contingencyResRef].tip " label { area 0 0 864 710 mosaic "GUIPOPF" } label { area 60 34 744 44 text lua "getContingencyTitle()" text style "title" } label { area 56 132 356 37 text "CONDITION_LABEL" enabled "showContingency" text style "label" text align left center } list { column { width 100 label { area 10 0 -1 -1 text lua "Infinity_FetchString( contingencyConditions[rowNumber].strref)" text style "normal" text align left center } } area 54 167 358 129 rowheight 40 enabled "showContingency" table "contingencyConditions" var currentContingencyCondition scrollbar 'GUISCRC' action " contingencyDescription = contingencyConditions[currentContingencyCondition].desc " } label { area 429 130 380 37 text "TARGET_LABEL" text style "label" text align left center enabled "showContingency" } list { column { width 100 label { area 10 0 -1 -1 text lua "Infinity_FetchString( contingencyTargets[rowNumber].strref)" text style "normal" text align left center } } area 444 167 358 129 enabled "showContingency" rowheight 40 table "contingencyTargets" var currentContingencyTarget scrollbar 'GUISCRC' action " contingencyDescription = contingencyTargets[currentContingencyTarget].desc " } label { area 77 296 304 37 text lua "getContingencySpellType()" text style "label" text align left center } label { area 326 296 196 37 text lua "getContingencySpellLevel()" text style "label" text align right center } button { area 551 294 44 44 bam "GUIOSW" sequence 0 action " changeContingencySpellLevel(1) " } button { area 596 294 44 44 bam "GUIOSW" sequence 1 action " changeContingencySpellLevel(-1) " } button { area 649 300 140 32 bam "GUIBUTNS" text lua "getContingencyTypeButtonText()" text style "button" sequenceonce "getRandomButtonSequence('GUIBUTNS')" action " swapContingencySpellType() bookSpells = filterContingencyMageSpells() " } button { area 59 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(1)" count lua "getContingencySpellCastableCount(1)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(1) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[1].resref, bookSpells[1].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(1) " } button { area 128 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(2)" count lua "getContingencySpellCastableCount(2)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(2) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[2].resref, bookSpells[2].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(2) " } button { area 197 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(3)" count lua "getContingencySpellCastableCount(3)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(3) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[3].resref, bookSpells[3].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(3) " } button { area 268 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(4)" count lua "getContingencySpellCastableCount(4)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(4) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[4].resref, bookSpells[4].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(4) " } button { area 337 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(5)" count lua "getContingencySpellCastableCount(5)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(5) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[5].resref, bookSpells[5].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(5) " } button { area 408 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(6)" count lua "getContingencySpellCastableCount(6)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(6) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[6].resref, bookSpells[6].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(6) " } button { area 477 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(7)" count lua "getContingencySpellCastableCount(7)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(7) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[7].resref, bookSpells[7].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(7) " } button { area 547 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(8)" count lua "getContingencySpellCastableCount(8)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(8) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[8].resref, bookSpells[8].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(8) " } button { area 616 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(9)" count lua "getContingencySpellCastableCount(9)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(9) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[9].resref, bookSpells[9].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(9) " } button { area 685 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(10)" count lua "getContingencySpellCastableCount(10)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(10) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[10].resref, bookSpells[10].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(10) " } button { area 754 343 52 52 bam "GUIBTBUT" icon lua "getContingencySpellIcon(11)" count lua "getContingencySpellCastableCount(11)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySpellDescription(11) if #sequencerSpells < contingencyMaxSpells then mageScreen:SequenceSpell( bookSpells[11].resref, bookSpells[11].masterResref ) end " actionAlt " contingencyDisplaySpellDescription(11) " } button { area 312 405 52 52 enabled "contingencyMaxSpells >= 1" bam "GUIBTBUT" icon lua "getContingencySetSpellIcon(1)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySetSpellDescription(1) mageScreen:UnSequenceSpell( sequencerSpells[1].resref, sequencerSpells[1].masterResref ) table.remove(sequencerSpells, 1) " actionAlt " contingencyDisplaySetSpellDescription(1) " } button { area 408 405 52 52 enabled "contingencyMaxSpells >= 2" bam "GUIBTBUT" icon lua "getContingencySetSpellIcon(2)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySetSpellDescription(2) mageScreen:UnSequenceSpell( sequencerSpells[2].resref, sequencerSpells[2].masterResref ) table.remove(sequencerSpells, 2) " actionAlt " contingencyDisplaySetSpellDescription(2) " } button { area 508 405 52 52 enabled "contingencyMaxSpells >= 3" bam "GUIBTBUT" icon lua "getContingencySetSpellIcon(3)" sequenceonce "getRandomButtonSequence('GUIBTBUT')" action " contingencyDisplaySetSpellDescription(3) mageScreen:UnSequenceSpell( sequencerSpells[3].resref, sequencerSpells[3].masterResref ) table.remove(sequencerSpells, 3) " actionAlt " contingencyDisplaySetSpellDescription(3) " } text { area 40 474 770 123 text lua "Infinity_FetchString(contingencyDescription)" text style "label" text align left top scrollbar "GUISCRC" } button { on escape area 196 653 230 44 bam "GUIBUTMT" sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" action " mageScreen:CancelSequencingSpells() e:SelectEngine(worldScreen) " } button { area 438 653 230 44 bam "GUIBUTMT" sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "contingencyComplete()" action " mageScreen:DoneSequencingSpells() e:SelectEngine(worldScreen) " } } ` function incrSpellDescriptionKnown(incr) local nextSpell = bookSpells[currentSpell.index + incr + 1] if(nextSpell ~= nil) then currentSpell = nextSpell return end if(incr > 0) then currentSpell = bookSpells[1] else currentSpell = bookSpells[#bookSpells] end end function getNextDifferentMemorizedSpell(incr, startIdx, matchIdx) local k = startIdx while ( k > 0 and k <= #bottomSpells) do local v = bottomSpells[k] if(v.memorizedIndex ~= matchIdx and not v.isPlaceholder) then return v end k = k + incr end return nil end function incrSpellDescriptionMemorized(incr) local nextSpell = getNextDifferentMemorizedSpell(incr, currentSpell.memorizedDisplayIdx, currentSpell.memorizedIndex) if(nextSpell ~= nil) then currentSpell = nextSpell return end if(incr > 0) then currentSpell = getNextDifferentMemorizedSpell(incr, 1, -1) else currentSpell = getNextDifferentMemorizedSpell(incr, #bottomSpells, -1) end end function incrSpellDescription(incr) if(currentSpell.memorizedDisplayIdx == nil) then incrSpellDescriptionKnown(incr) else incrSpellDescriptionMemorized(incr) end end function inSpellBook() return e:GetActiveEngine() == e:GetEngineWizSpell() or e:GetActiveEngine() == e:GetEnginePriestSpell() end showEraseButton = true ` menu { name "SPELL_DESCRIPTION" align center center modal --popupSound 1 onOpen " if(e:GetActiveEngine() == worldScreen) then worldScreenWasPaused = worldScreen:CheckIfPaused() if worldScreenWasPaused == false then worldScreen:TogglePauseGame(true) end end if characters[id].hasSorcererBook then showEraseButton = false end " onClose " if(e:GetActiveEngine() == worldScreen) then if worldScreenWasPaused == false then worldScreen:TogglePauseGame(true) end worldScreenWasPaused = false end " label { area 0 0 862 710 mosaic GUIINVHI } --button --{ -- enabled "inSpellBook()" -- area 620 -8 35 34 -- bam "ARROBUTT" -- sequence 0 -- action -- " -- incrSpellDescription(-1) -- " --} --button --{ -- enabled "inSpellBook()" -- area 734 -8 34 34 -- bam "ARROBUTT" -- sequence 1 -- action -- " -- incrSpellDescription(1) -- " --} label { area 76 50 92 92 icon lua "currentSpell.icon" } label { area 76 50 94 92 mosaic "ITMVIG" } label { area 669 70 51 50 mosaic "ITMVIGSM" } --label --{ -- area 669 -12 46 46 -- icon lua "currentSpell.icon" --} label { area 76 5 712 45 text 16189 text style "title" } label { area 270 60 326 66 text lua "Infinity_FetchString(currentSpell.name)" text style "label" } text { area 66 176 738 352 text lua "Infinity_FetchString(currentSpell.description)" text style "normal_parchment" scrollbar 'GUISCRC' } button { area 194 566 233 45 text 34711 text style "button" bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" enabled "isWizSpellMode() and showEraseButton" action " mageScreen:EraseKnownSpell(currentSpell.resref) Infinity_PopMenu('SPELL_DESCRIPTION') " } button { on escape area 436 566 233 45 text "DONE_BUTTON" text style "button" bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" enabled "isWizSpellMode() and showEraseButton" action "Infinity_PopMenu('SPELL_DESCRIPTION')" } button { on escape area 284 652 300 45 text "DONE_BUTTON" text style "button" bam GUIBUTWT sequenceonce "getRandomButtonSequence('GUIBUTWT')" enabled "not isWizSpellMode() or not showEraseButton" action "Infinity_PopMenu('SPELL_DESCRIPTION')" } } ` function refreshMageContingency() preparedSpells = {} for k, v in pairs(characters[id].contingencySpells) do table.insert(preparedSpells, v) end for k, v in pairs(characters[id].sequencerSpells) do table.insert(preparedSpells, v) end end ` menu { name 'MAGE_CONTINGENCY' align center center modal onopen "refreshMageContingency()" label { area 0 0 864 710 mosaic "GUIPOPF" } label { area 48 28 776 60 text "CONTINGENCY_TITLE" text style "title" } label { area 238 108 190 36 text "CONDITION_LABEL" text style "label" text align left center } label { area 428 108 200 36 text "TARGET_LABEL" text style "label" text align left center } label { area 628 108 196 36 text "SPELL_LABEL" text style "label" text align left center } list { column { width 25 label { area 0 0 -1 -1 text lua "t(mageBookStrings[preparedSpells[rowNumber].resref].title)" text style "label" align left center } } column { width 25 label { area 0 0 -1 -1 text lua "Infinity_FetchString(preparedSpells[rowNumber].condition)" text style "label" align left center } } column { width 25 label { area 0 0 -1 -1 text lua "Infinity_FetchString(preparedSpells[rowNumber].target)" text style "label" align left center } } column { width 5 label { enabled "preparedSpells[rowNumber].spells[1] ~= nil" area 0 0 -1 -1 bam lua "preparedSpells[rowNumber].spells[1].icon" align center center } } column { width 5 label { enabled "preparedSpells[rowNumber].spells[2] ~= nil" area 0 0 -1 -1 bam lua "preparedSpells[rowNumber].spells[2].icon" align center center } } column { width 5 label { enabled "preparedSpells[rowNumber].spells[3] ~= nil" area 0 0 -1 -1 bam lua "preparedSpells[rowNumber].spells[3].icon" align center center } } column { width 5 label { area 0 0 -1 -1 bam "GUISTMPC" sequence 2 align center center enabled "preparedSpells[rowNumber].dispellable" } } area 44 144 780 300 rowheight 56 table "preparedSpells" var "currentContingencySpell" action " if (cellNumber == 7) and preparedSpells[currentContingencySpell].dispellable then popup2Button(32665, 'YES_BUTTON', function() mageScreen:OnDispellButtonClick(currentContingencySpell) end, 'NO_BUTTON') end " } button { area 280 652 302 44 bam GUIBUTWT sequenceonce "getRandomButtonSequence('GUIBUTWT')" text "DONE_BUTTON" text style "button" action "Infinity_PopMenu('MAGE_CONTINGENCY')" } } menu { name "POPUP_DETAILS" align center center modal label { area 0 0 864 710 mosaic "GUIINVHI" } label { area 82 10 700 40 text lua "Infinity_FetchString(PopupDetails.title)" text style "title" } label { area 278 66 310 50 text lua "Infinity_FetchString(PopupDetails.name)" text style "label" } text { area 62 178 736 348 text lua "Infinity_FetchString(PopupDetails.description)" text style "parchment" scrollbar 'GUISCRC' } label { area 96 72 52 52 bam lua "PopupDetails.icon" align center center sequence 0 } button { area 316 654 234 42 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" on escape action " Infinity_PopMenu('POPUP_DETAILS') " } } ` numberOfKnownPriestSpellSlots = 24 currentSpellLevel = 1 shownSpellOffset = 0 function priestPageInfo() if characters[id].hasShamanBook then return t("SPELLS_CAN_CAST_LABEL") .. ": " .. characters[id].priestDetails[currentSpellLevel].slotsRemaining .. "/" .. characters[id].priestDetails[currentSpellLevel].maxMemorized else return t("MEMORIZED_LABEL") .. ": " .. #bottomSpells .. "/" .. characters[id].priestDetails[currentSpellLevel].maxMemorized end end function priestBookDescription() if priestBookEnabled == true then if characters[id].priestSpells[currentSpellLevel][currentBookSpell] then return Infinity_FetchString(characters[id].priestSpells[currentSpellLevel][currentBookSpell].description) else return t('SPELL_MEMORIZATION_HELP') end end return "" end function filterMemorizedPriestSpells() local out = {} currentSpellLevel = math.min(currentSpellLevel, 7) for k,v in pairs(characters[id].priestSpells[currentSpellLevel]) do for i=v.memorizedCount, 1, -1 do local spell = deepcopy(v) if(i <= v.castableCount) then spell.castable = 1 else spell.castable = 0 end spell.memorizedDisplayIdx = #out + 1 table.insert(out, spell) end end return out end showPriestMemorizationFlash = false function setPriestBookLevel(num) currentBookSpell = 0 shownSpellOffset = 0 if currentSpellLevel ~= num then Infinity_PlaySound('GAM_05') end currentSpellLevel = num refreshPriestBook() end function createPriestMemorizationSparkle(x,y,w,h, fromList, listIndex) Infinity_InstanceAnimation("TEMPLATE_priestMemorizationSparkle","FLASHBR",x,y,w,h,fromList,listIndex) memorizationFlashes[currentAnimationID][1] = true memorizationFlashes[currentAnimationID][3] = false currentAnimationID = currentAnimationID + 1 if currentAnimationID > #(memorizationFlashes) then currentAnimationID = 1 end end function unmemorizingPriestSpell(resref) local index = 1 local sparkle = -1 for index = 1, #(bottomSpells), 1 do if bottomSpells[index].resref == resref then sparkle = index if bottomSpells[index].castable == 0 then break end end end x,y,w,h = Infinity_GetArea("BUTTON_MEMORIZEDSPELL_" .. sparkle) createPriestMemorizationSparkle(x, y, w, h, 'memorizedListPriest', sparkle) end function refreshPriestBook() --currentSpellLevel = priestScreen:GetSpellLevel()+1 if characters[id].hasClericBook then bookSpells = characters[id].priestSpells[currentSpellLevel] newBottomSpells = filterMemorizedPriestSpells() bottomSpells = newBottomSpells bottomSpellsPlaceHolder = makeBlankTable(characters[id].priestDetails[currentSpellLevel].maxMemorized) elseif characters[id].hasShamanBook then bookSpells = characters[id].priestSpells[currentSpellLevel] bottomSpells = {} bottomSpellsPlaceHolder = {} else bookSpells = {} bottomSpells = {} bottomSpellsPlaceHolder = {} end end function getMemorizedSpellSlotGreyscale(slot) local ret = false if slot > #bottomSpells or bottomSpells[slot].castable == 0 then ret = true end return ret end function getMemorizedPriestSpellSlotEnabled(slot) local ret = true if characters[id].hasShamanBook then return false end if slot > characters[id].priestDetails[currentSpellLevel].maxMemorized then return false end return ret end function isWizSpellMode() return e:GetActiveEngine() == e:GetEngineWizSpell() end function memorizeSpell(spell) local success = false if(isWizSpellMode()) then success = mageScreen:MemorizeSpell( spell.level, spell.index ) else success = priestScreen:MemorizeSpell(spell.level, spell.index) end if(success == true) then --show the sparkle on the last of this set local index = 0 for k,v in pairs(bottomSpells) do if(v.icon == spell.icon) then index = k + v.memorizedCount - v.castableCount - 1 break end end x,y,w,h = Infinity_GetArea("BUTTON_MEMORIZEDSPELL_" .. index) if(isWizSpellMode()) then createMageMemorizationSparkle(x, y, w, h, 'memorizedListMage', index) else createPriestMemorizationSparkle(x, y, w, h, 'memorizedListPriest', index) end Infinity_PlaySound('GAM_24') showMageMemorizationFlash = true end end function unmemorizeSpell(spell) if(spell.isPlaceholder) then return end showMageMemorizationFlash = false if(spell.castableCount >= spell.memorizedCount) then --Unmemorizing a castable spell. popup2Button(11824, 'REMOVE_BUTTON', function() finishUnmemorizeSpell(spell) end) else finishUnmemorizeSpell(spell) end end function finishUnmemorizeSpell(spell) local success = false if(isWizSpellMode()) then success = mageScreen:UnmemorizeSpell( spell.level, spell.memorizedIndex ) else success = priestScreen:UnmemorizeSpell(spell.level,spell.memorizedIndex) end Infinity_PlaySound('GAM_44') end function getPriestBookLevel() local ret = t('LEVEL_LABEL').." "..currentSpellLevel return ret end function getPriestBookSpellFraction() local ret = "" if #bookSpells > numberOfKnownPriestSpellSlots then ret = (shownSpellOffset + 1) .. "/" .. math.floor(((#bookSpells / numberOfKnownPriestSpellSlots) + 1)) end return ret end function getPriestBookSpellLevelFrame(level) local ret = 0 if currentSpellLevel == level then ret = 2 end return ret end ` menu { name 'PRIEST' align center center onopen " currentSpellLevel = 1 shownSpellOffset = 0 showPriestMemorizationFlash = false pushSidebars() prpage = nil setPriestBookLevel(1) currentAnimationID = 1 updateCounterMemorizationSparkles = 1 bookSpells = {} bottomSpells = {} currentBookSpell = 0 refreshPriestBook() currentAnimationID = 1 updateCounterMemorizationSparkles = 1 " onclose " popSidebars() " button { on escape action " --Return to world screen on escape e:SelectEngine(worldScreen) " } template { label { enabled "showMemorizationSparkle(instanceId)" ignoreEvents area 0 0 45 42 bam "FLASHBR" usealpha lua "true" frame lua "memorizationFlashes[instanceId][2]" align center center } name "TEMPLATE_priestMemorizationSparkle" } label { area 0 0 864 710 mosaic "GUIPRB" } label { area 82 10 700 44 text "PRIEST_SCROLL_TITLE" text style "title" } label { area 210 59 446 30 text lua "priestName" text style "label" } button { area 168 110 54 54 bam GUIPRTC frame lua "getPriestBookSpellLevelFrame(1)" sequence 0 enabled "maxPriestPage > 0" action "setPriestBookLevel(1)" } button { area 246 110 54 54 bam GUIPRTC frame lua "getPriestBookSpellLevelFrame(2)" sequence 1 enabled "maxPriestPage > 1" action "setPriestBookLevel(2)" } button { area 328 110 54 54 bam GUIPRTC frame lua "getPriestBookSpellLevelFrame(3)" sequence 2 enabled "maxPriestPage > 2" action "setPriestBookLevel(3)" } button { area 403 110 54 54 bam GUIPRTC frame lua "getPriestBookSpellLevelFrame(4)" sequence 3 enabled "maxPriestPage > 3" action "setPriestBookLevel(4)" } button { area 484 110 54 54 bam GUIPRTC frame lua "getPriestBookSpellLevelFrame(5)" sequence 4 enabled "maxPriestPage > 4" action "setPriestBookLevel(5)" } button { area 566 110 54 54 bam GUIPRTC frame lua "getPriestBookSpellLevelFrame(6)" sequence 5 enabled "maxPriestPage > 5" action "setPriestBookLevel(6)" } button { area 642 110 54 54 bam GUIPRTC frame lua "getPriestBookSpellLevelFrame(7)" sequence 6 enabled "maxPriestPage > 6" action "setPriestBookLevel(7)" } label { area 161 170 147 36 text lua "getPriestBookLevel()" text style "parchment" text align right center text point 20 } label { area 315 170 154 36 text lua "getPriestBookSpellFraction()" text style "parchment" text align left center text point 20 } label { area 566 170 154 36 text lua "KNOWN_DIVINE_SPELLS_LABEL" text style "parchment" text align center center text point 20 } button {area 224 198 54 54 sequence 0 name "BUTTON_BOOKSPELL_1" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 1]"} button {area 296 198 54 54 sequence 1 name "BUTTON_BOOKSPELL_2" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 2]"} button {area 368 198 54 54 sequence 2 name "BUTTON_BOOKSPELL_3" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 3]"} button {area 438 198 54 54 sequence 3 name "BUTTON_BOOKSPELL_4" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 4]"} button {area 507 198 54 54 sequence 4 name "BUTTON_BOOKSPELL_5" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 5]"} button {area 575 198 54 54 sequence 5 name "BUTTON_BOOKSPELL_6" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 6]"} button {area 224 258 54 54 sequence 6 name "BUTTON_BOOKSPELL_7" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 7]"} button {area 296 258 54 54 sequence 7 name "BUTTON_BOOKSPELL_8" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 8]"} button {area 368 258 54 54 sequence 8 name "BUTTON_BOOKSPELL_9" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 9]"} button {area 438 258 54 54 sequence 9 name "BUTTON_BOOKSPELL_10" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 10]"} button {area 507 258 54 54 sequence 0 name "BUTTON_BOOKSPELL_11" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 11]"} button {area 575 258 54 54 sequence 1 name "BUTTON_BOOKSPELL_12" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 12]"} button {area 224 321 54 54 sequence 2 name "BUTTON_BOOKSPELL_13" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 13]"} button {area 296 321 54 54 sequence 3 name "BUTTON_BOOKSPELL_14" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 14]"} button {area 368 321 54 54 sequence 4 name "BUTTON_BOOKSPELL_15" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 15]"} button {area 438 321 54 54 sequence 5 name "BUTTON_BOOKSPELL_16" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 16]"} button {area 507 321 54 54 sequence 6 name "BUTTON_BOOKSPELL_17" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 17]"} button {area 575 321 54 54 sequence 7 name "BUTTON_BOOKSPELL_18" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 18]"} button {area 224 382 54 54 sequence 8 name "BUTTON_BOOKSPELL_19" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 19]"} button {area 296 382 54 54 sequence 9 name "BUTTON_BOOKSPELL_20" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 20]"} button {area 368 382 54 54 sequence 4 name "BUTTON_BOOKSPELL_21" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 21]"} button {area 438 382 54 54 sequence 5 name "BUTTON_BOOKSPELL_22" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 22]"} button {area 507 382 54 54 sequence 6 name "BUTTON_BOOKSPELL_23" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 23]"} button {area 575 382 54 54 sequence 7 name "BUTTON_BOOKSPELL_24" spellinfo "bookSpells[shownSpellOffset * numberOfKnownPriestSpellSlots + 24]"} label {area 254 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(1)" enabled "getMemorizedPriestSpellSlotEnabled(1)"} button {area 254 530 54 54 sequence 0 name "BUTTON_MEMORIZEDSPELL_1" memorizedspellinfo "bottomSpells[1]"} label {area 315 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(2)" enabled "getMemorizedPriestSpellSlotEnabled(2)"} button {area 315 530 54 54 sequence 1 name "BUTTON_MEMORIZEDSPELL_2" memorizedspellinfo "bottomSpells[2]"} label {area 376 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(3)" enabled "getMemorizedPriestSpellSlotEnabled(3)"} button {area 376 530 54 54 sequence 2 name "BUTTON_MEMORIZEDSPELL_3" memorizedspellinfo "bottomSpells[3]"} label {area 437 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(4)" enabled "getMemorizedPriestSpellSlotEnabled(4)"} button {area 437 530 54 54 sequence 3 name "BUTTON_MEMORIZEDSPELL_4" memorizedspellinfo "bottomSpells[4]"} label {area 498 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(5)" enabled "getMemorizedPriestSpellSlotEnabled(5)"} button {area 498 530 54 54 sequence 4 name "BUTTON_MEMORIZEDSPELL_5" memorizedspellinfo "bottomSpells[5]"} label {area 559 530 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(6)" enabled "getMemorizedPriestSpellSlotEnabled(6)"} button {area 559 530 54 54 sequence 5 name "BUTTON_MEMORIZEDSPELL_6" memorizedspellinfo "bottomSpells[6]"} label {area 254 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(7)" enabled "getMemorizedPriestSpellSlotEnabled(7)"} button {area 254 585 54 54 sequence 6 name "BUTTON_MEMORIZEDSPELL_7" memorizedspellinfo "bottomSpells[7]"} label {area 315 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(8)" enabled "getMemorizedPriestSpellSlotEnabled(8)"} button {area 315 585 54 54 sequence 7 name "BUTTON_MEMORIZEDSPELL_8" memorizedspellinfo "bottomSpells[8]"} label {area 376 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(9)" enabled "getMemorizedPriestSpellSlotEnabled(9)"} button {area 376 585 54 54 sequence 8 name "BUTTON_MEMORIZEDSPELL_9" memorizedspellinfo "bottomSpells[9]"} label {area 437 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(10)" enabled "getMemorizedPriestSpellSlotEnabled(10)"} button {area 437 585 54 54 sequence 9 name "BUTTON_MEMORIZEDSPELL_10" memorizedspellinfo "bottomSpells[10]"} label {area 498 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(11)" enabled "getMemorizedPriestSpellSlotEnabled(11)"} button {area 498 585 54 54 sequence 0 name "BUTTON_MEMORIZEDSPELL_11" memorizedspellinfo "bottomSpells[11]"} label {area 559 585 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(12)" enabled "getMemorizedPriestSpellSlotEnabled(12)"} button {area 559 585 54 54 sequence 1 name "BUTTON_MEMORIZEDSPELL_12" memorizedspellinfo "bottomSpells[12]"} label {area 254 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(13)" enabled "getMemorizedPriestSpellSlotEnabled(13)"} button {area 254 640 54 54 sequence 2 name "BUTTON_MEMORIZEDSPELL_13" memorizedspellinfo "bottomSpells[13]"} label {area 315 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(14)" enabled "getMemorizedPriestSpellSlotEnabled(14)"} button {area 315 640 54 54 sequence 3 name "BUTTON_MEMORIZEDSPELL_14" memorizedspellinfo "bottomSpells[14]"} label {area 376 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(15)" enabled "getMemorizedPriestSpellSlotEnabled(15)"} button {area 376 640 54 54 sequence 4 name "BUTTON_MEMORIZEDSPELL_15" memorizedspellinfo "bottomSpells[15]"} label {area 437 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(16)" enabled "getMemorizedPriestSpellSlotEnabled(16)"} button {area 437 640 54 54 sequence 5 name "BUTTON_MEMORIZEDSPELL_16" memorizedspellinfo "bottomSpells[16]"} label {area 498 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(17)" enabled "getMemorizedPriestSpellSlotEnabled(17)"} button {area 498 640 54 54 sequence 6 name "BUTTON_MEMORIZEDSPELL_17" memorizedspellinfo "bottomSpells[17]"} label {area 559 640 54 54 bam "spelfram" greyscale lua "getMemorizedSpellSlotGreyscale(18)" enabled "getMemorizedPriestSpellSlotEnabled(18)"} button {area 559 640 54 54 sequence 7 name "BUTTON_MEMORIZEDSPELL_18" memorizedspellinfo "bottomSpells[18]"} label { area 356 478 154 36 text lua "priestPageInfo()" text style "label" } button { area 30 252 52 130 bam GUIPRC sequence 0 action " if shownSpellOffset > 0 then shownSpellOffset = shownSpellOffset - 1 Infinity_PlaySound('GAM_05') elseif shownSpellOffset == 0 and currentSpellLevel > 1 then setPriestBookLevel(currentSpellLevel - 1) if #bookSpells > 0 then shownSpellOffset = math.floor((#bookSpells-1) / numberOfKnownPriestSpellSlots) end end " } button { area 782 252 52 130 bam GUIPRC sequence 1 action " if (shownSpellOffset + 1) < math.floor((((#bookSpells-1) / numberOfKnownPriestSpellSlots) + 1)) then shownSpellOffset = shownSpellOffset + 1 Infinity_PlaySound('GAM_05') elseif currentSpellLevel < 7 and ((shownSpellOffset + 1) == math.floor((((#bookSpells-1) / numberOfKnownPriestSpellSlots) + 1)) or #bookSpells == 0) then setPriestBookLevel(currentSpellLevel + 1) end " } label { area 0 0 865 710 fill 0 0 0 176 enabled "priestBookEnabled == false" } } ` versionString = "" function canClickSaveLoad() return game:IsClient() == false end ` menu { name "ESC_MENU" ignoreesc align center center onOpen " versionString = CBaldurChitin:GetVersionString() pushSidebars() " onClose "popSidebars()" label { area 0 0 864 768 mosaic STONEOPT } label { area 256 90 350 44 text "OPTIONS_TITLE" text style "title" } label { area 244 134 378 26 text lua "versionString" text style "normal" text align center center } button { area 642 476 200 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" pad 10 8 10 8 text style "button" text "GAMEPLAY_BUTTON" text style "button" action " Infinity_PushMenu( 'OPTIONS_GAMEPLAY' ) " } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 642 376 200 44 pad 10 8 10 8 text style "button" text "GRAPHICS_BUTTON" text style "button" action " Infinity_PushMenu( 'OPTIONS_GRAPHICS' ) " } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 642 280 200 44 pad 10 8 10 8 text style "button" text "SOUND_BUTTON" text style "button" action " Infinity_PushMenu( 'OPTIONS_SOUND' ) " } button { area 284 616 300 45 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "RETURN_GAME_BUTTON" text style "button" action " e:SelectEngine( worldScreen ); " } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 22 280 200 44 pad 10 8 10 8 text style "button" text "LOAD_GAME_BUTTON" clickable lua "canClickSaveLoad()" action " popup2Button(19531, 'LOAD_BUTTON', function() optionsScreen:LoadGame() end) " } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 22 376 200 44 pad 10 8 10 8 text style "button" text "QUIT_GAME_BUTTON" action " popup3Button(16456, 'SAVE_BUTTON', function() optionsScreen:SaveGame(0) end, 'QUIT_BUTTON', function() optionsScreen:QuitGame() end, --'MAIN_MENU_BUTTON', function() optionsScreen:QuitGame() end, --'QUIT_BUTTON', function() Infinity_ShutdownGame() end, 'CANCEL_BUTTON', nil ) " } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 22 476 200 44 pad 10 8 10 8 text style "button" text "SAVE_GAME_BUTTON" clickable lua "canClickSaveLoad()" action " optionsScreen:SaveGame(0) " } label { area 236 168 378 454 bam 'BIGLOGO' align center center frame lua 'logoFrame' } } ` OptionsButtons = { {text = "GAMEPLAY_BUTTON", menu = "OPTIONS_GAMEPLAY", sequence = 0}, {text = "GRAPHICS_BUTTON", menu = "OPTIONS_GRAPHICS", sequence = 1}, {text = "LANGUAGE_BUTTON", menu = "OPTIONS_LANGUAGE", sequence = 0}, {text = "MOVIES_BUTTON", menu = "", sequence = 2}, {text = "SOUND_BUTTON", menu = "OPTIONS_SOUND", sequence = 1}, } ` menu { name 'START_OPTIONS' align center center ignoreEsc label { area 0 0 1024 768 mosaic 'START' } label { area 116 12 786 150 bam 'TITLE' sequence 0 align center center frame lua 'logoFrame' } label { area 332 190 352 456 bam 'BIGLOGO' align center center frame lua 'logoFrame' } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 86 314 232 44 pad 10 8 10 8 text style "button" text "SOUND_BUTTON" action "Infinity_PushMenu( 'OPTIONS_SOUND' )" } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 710 314 232 44 pad 10 8 10 8 text style "button" text "GRAPHICS_BUTTON" action "Infinity_PushMenu( 'OPTIONS_GRAPHICS' )" } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 86 395 232 44 pad 10 8 10 8 text style "button" text "LANGUAGE_BUTTON" action "Infinity_PushMenu( 'OPTIONS_LANGUAGE' )" } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 710 395 232 44 pad 10 8 10 8 text style "button" text "MOVIES_BUTTON" action "e:SelectEngine(moviesScreen)" } button { bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 86 476 232 44 pad 10 8 10 8 text style "button" text "GAMEPLAY_BUTTON" action "Infinity_PushMenu( 'OPTIONS_GAMEPLAY' )" } button { on escape area 710 476 232 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" pad 10 8 10 8 text style "button" text "BACK_BUTTON" action " Infinity_PopMenu() e:SelectEngine(startEngine) " } label { area 898 726 118 38 text lua "versionString" text style "label" text point 15 align center center } } ` mapnoteSettings = {} showNotes = 1 function showNote(instanceId) if(mapScreen:IsNoteVisible(mapnoteSettings[instanceId].worldCoord.x, mapnoteSettings[instanceId].worldCoord.y) and mapnoteSettings[instanceId].screenCoord.x >= 0 and mapnoteSettings[instanceId].screenCoord.y >= 0) then return showNotes else return false end end notesAlpha = 0 function getAndIncrementNotesAlpha() if(notesAlpha < .99) then notesAlpha = notesAlpha + 0.075 end if(notesAlpha > 1) then notesAlpha = 1 end return notesAlpha end function mapNoteText() local ret = "" if areaMapHover ~= -1 then ret = Infinity_FetchString(mapnoteSettings[areaMapHover].text) end return ret end ` menu { name 'AREA_MAP_TITLE' align center top opacity lua "notesAlpha" ignoreEsc label { area 277 60 315 92 rectangle 3 } label { name "AREA_MAP_BACKGROUND" area 0 0 870 96 mosaic "GUIMAPAB" } label { area 114 8 642 44 name "AREA_MAP_TITLE" text "AREA_MAP_TITLE" text style title } label { area 114 56 642 32 text lua "mapNoteText()" text style "label" text align center center } button { area 302 100 34 34 bam "ROUNDBUT" scaleToClip frame lua "mapScreen:DisplayExploredMap() and 2 or 0" action "mapScreen:ToggleDisplayExploredMap()" } label { area 340 100 230 34 text "WORLDMAP_HIGHLIGHT_LABEL" text style "label" text align center center sequence lua "mapScreen:DisplayExploredMap() and 0 or 1" } button { area 38 30 66 58 bam "MAPBUT" sequence 1 frame lua "showNotes == 1 and 0 or 1" toggle showNotes } button { area 756 30 68 58 bam MAPBUT sequence 0 action " worldMapScreen:StartWorldMap(0) e:SelectEngine(worldMapScreen) " } } ` areaMapHover = -1 function showAreaMapNoteTooltip(id) if id == areaMapHover then return true else return false end end ` menu { name 'AREA_MAP' align left top ignoreesc onOpen "pushSidebars(); Infinity_PushMenu('AREA_MAP_TITLE'); notesAlpha = 0" onClose "popSidebars(); Infinity_PopMenu('AREA_MAP_TITLE');" opacity lua "getAndIncrementNotesAlpha()" template { button { enabled "showNote(instanceId)" area 0 0 45 42 bam "FLAG1" sequence lua "mapnoteSettings[instanceId].sequence" actionAlt " mapScreen:OnUserNoteClick(instanceId, mapnoteSettings[instanceId].worldCoord.x, mapnoteSettings[instanceId].worldCoord.y) Infinity_PushMenu('NOTE_ADD',0,0) " actionEnter " areaMapHover = instanceId " actionExit " areaMapHover = -1 " } name "TEMPLATE_mapnote" } } ` colorChoice = nil ` menu { name 'NOTE_ADD' align center center onOpen " if colorChoice == nil then colorChoice = Infinity_FindUIItemByName('BUTTON_mapNoteColor_' .. mapScreen:GetColorChoice()) end " onClose " colorChoice = nil " modal label { area 0 0 660 234 mosaic GUIERR6 } edit { name "mapNoteEditArea" area 40 32 576 34 var mapNoteEdit maxlines 1 scrollbar 'GUISCRC' text style "edit" } button { area 437 166 200 44 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text style "button" text "DONE_BUTTON" action " mapScreen:OnUserNoteDoneButtonClick() Infinity_PopMenu('NOTE_ADD',0,0) " } button { area 228 166 200 44 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text style "button" text "CANCEL_BUTTON" action " Infinity_PopMenu('NOTE_ADD',0,0) " } button { area 18 166 200 44 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text style "button" text "DELETE_BUTTON" action " mapScreen:OnUserNoteDeleteButtonClick() Infinity_PopMenu('NOTE_ADD',0,0) " } button { name "BUTTON_mapNoteColor_0" area 25 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 0 action " mapScreen:OnColorChoice(0) " } button { name "BUTTON_mapNoteColor_1" area 105 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 1 action " mapScreen:OnColorChoice(1) " } button { name "BUTTON_mapNoteColor_2" area 185 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 2 action " mapScreen:OnColorChoice(2) " } button { name "BUTTON_mapNoteColor_3" area 265 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 3 action " mapScreen:OnColorChoice(3) " } button { name "BUTTON_mapNoteColor_4" area 345 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 4 action " mapScreen:OnColorChoice(4) " } button { name "BUTTON_mapNoteColor_5" area 425 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 5 action " mapScreen:OnColorChoice(5) " } button { name "BUTTON_mapNoteColor_6" area 505 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 6 action " mapScreen:OnColorChoice(6) " } button { name "BUTTON_mapNoteColor_7" area 585 92 45 42 bam "FLAG1" highlightgroup colorChoice sequence 7 action " mapScreen:OnColorChoice(7) " } } menu { name "WORLD_MAP" align center center label { area 0 0 1024 768 mosaic GUIMAPWB } label { area 211 22 583 56 text "WORLD_MAP_TITLE" text style "title" } button { area 51 35 66 58 bam "MAPBUT" action " worldMapScreen:OnCancelButtonClick() " } button { area 842 22 50 50 bam "MAPBUT" sequence 2 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(0,200) " } button { area 896 12 48 46 bam "MAPBUT" sequence 3 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(100,200) " } button { area 940 22 50 50 bam "MAPBUT" sequence 4 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(200,200) " } button { area 830 78 46 46 bam "MAPBUT" sequence 5 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(0,100) " } button { area 876 58 78 80 bam "MAPBUT" sequence 10 action " worldMapScreen:CenterMarker() " } button { area 958 78 46 44 bam "MAPBUT" sequence 6 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(200,100) " } button { area 842 122 50 50 bam "MAPBUT" sequence 7 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(0,0) " } button { area 896 144 44 48 bam "MAPBUT" sequence 8 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(100,0) " } button { area 944 122 46 48 bam "MAPBUT" sequence 9 action " worldMapScreen:OnMapMouseDown(100,100) worldMapScreen:OnMapMouseMove(200,0) " } map { name "worldmap" area 10 200 1003 559 worldmap action " worldMapScreen:OnMapMouseDown(eventXCoord,eventYCoord) " actionDbl " worldMapScreen:TravelToSelected() " actionDrag " worldMapScreen:OnMapMouseMove(eventXCoord,eventYCoord) " actionEnter " Infinity_StartItemCapture('worldmap') " actionExit " Infinity_StopItemCapture('worldmap') " } } ` chapterBackground = "" text_CHAPTERSCROLL_title = "" text_CHAPTERSCROLL = "" text_CHAPTERSCROLL_timeStart = 0 text_CHAPTERSCROLL_auto = 1 function UpdateChapterScroll(top, height, contentHeight) if(text_CHAPTERSCROLL_auto == 0) then --defer to default scrolling return nil end local dT = Infinity_GetClockTicks() - text_CHAPTERSCROLL_timeStart local newTop = (dT * -0.006) + height if(newTop + contentHeight + height < height) then return top end return newTop end function setChapterBackground(id) chapterBackground = chapterBackgrounds[id] end function positionChapterText() if chapterBackground == chapterBackgrounds[0] then Infinity_SetArea('text_CHAPTERSCROLL_item', 440, 426, 554, 188) elseif chapterBackground == chapterBackgrounds[1] then Infinity_SetArea('text_CHAPTERSCROLL_item', 700, 218, 312, 322) elseif chapterBackground == chapterBackgrounds[2] then Infinity_SetArea('text_CHAPTERSCROLL_item', 36, 162, 344, 392) elseif chapterBackground == chapterBackgrounds[3] then Infinity_SetArea('text_CHAPTERSCROLL_item', 454, 158, 542, 174) elseif chapterBackground == chapterBackgrounds[4] then Infinity_SetArea('text_CHAPTERSCROLL_item', 436, 352, 568, 256) elseif chapterBackground == chapterBackgrounds[5] then Infinity_SetArea('text_CHAPTERSCROLL_item', 518, 358, 486, 238) elseif chapterBackground == chapterBackgrounds[6] then Infinity_SetArea('text_CHAPTERSCROLL_item', 646, 184, 352, 398) elseif chapterBackground == chapterBackgrounds[7] then Infinity_SetArea('text_CHAPTERSCROLL_item', 122, 480, 802, 138) end end function getChapterText() positionChapterText() return text_CHAPTERSCROLL_title end ` menu { name 'CHAPTER' align center center ignoreEsc onOpen " " label { area 0 0 1024 768 mosaic lua "chapterBackground" } label { area 168 24 702 84 text lua "getChapterText()" text style "title" } text { name "text_CHAPTERSCROLL_item" area 576 236 316 322 text lua "text_CHAPTERSCROLL" text style normal scrollbar 'GUISCRC' scrollbar func 'UpdateChapterScroll' scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1' action " text_CHAPTERSCROLL_auto = 0 " } button { area 518 688 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "chapterScreen:IsDoneButtonClickable()" action " chapterScreen:OnDoneButtonClick() " } button { area 274 688 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "REPLAY_BUTTON" text style "button" --clickable lua "chapterScreen:IsReplayButtonClickable()" action " chapterScreen:OnReplayButtonClick() " } } ` epilogueImage = "GUIOSTUR" ` menu { name 'EPILOGUE' align center center ignoreEsc label { area 0 0 1024 768 mosaic "NPCCHAP" } label { area 106 230 210 330 bitmap lua "epilogueImage" } text { name "text_EPILOGUESCROLL_item" area 32 162 340 392 text lua "text_CHAPTERSCROLL" text style normal scrollbar 'GUISCRC' scrollbar func 'UpdateChapterScroll' scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1' action " text_CHAPTERSCROLL_auto = 0 " } button { area 590 708 234 44 bam GUIOSTUR text "DONE_BUTTON" text style "button" clickable lua "chapterScreen:IsDoneButtonClickable()" action " chapterScreen:OnDoneButtonClick() " } button { area 252 708 234 44 bam GUIOSTUL text "REPLAY_BUTTON" text style "button" clickable lua "chapterScreen:IsReplayButtonClickable()" action " chapterScreen:OnReplayButtonClick() " } } menu { name 'CHAPTER_WAITING_FOR_PROVIDER' modal align center center label { area 0 0 406 418 mosaic GUIERR } label --Title { area 74 82 254 80 text "WAITING_FOR_OTHER_PLAYERS" text style "label" } } ` store = {} storeGroupItemsVar = 0 storeItemsVar = 0 function getStoreSlotHighlight(highlight) if(highlight == 0) then return 0 else return 2 end end function storeSplitStack(count) storeScreen:SelectStoreItem(storeItemsVar-1, true); storeScreen:SetStoreItemCount(storeItemsVar-1, count); end function groupSplitStack(count) storeScreen:SelectGroupItem(storeGroupItemsVar-1, true); storeScreen:SetGroupItemCount(storeGroupItemsVar-1, count); end function checkContainerText(normalStr, containerStr) if(storeScreen:IsContainer()) then return t(containerStr) else return t(normalStr) end end function getStoreItemCount(row) local count = store.storeItems[rowNumber].item.count if(count ~= 0xFFFF) then return count else -- maxword, infinite count. return nil end end ` menu { name 'STORE_BUYSELL' align center center onOpen "storeScreen:UpdateBuySellPanel()" ignoreEsc label { area 0 0 864 710 mosaic GUISTBSC ignoreEvents } label { area 48 16 768 44 text lua "checkContainerText('BUY_SELL_TITLE','CONTAINER_TITLE')" text style "title" } label { area 266 76 330 30 text lua "Infinity_FetchString(storeScreen:GetStoreName())" text style "subTitle" } label { area 728 70 102 48 enabled "not storeScreen:IsContainer()" text lua "game:GetPartyGold()" text style "gold" align right center } label { area 94 499 144 27 enabled "not storeScreen:IsContainer()" text "COST_LABEL" text style "label" align right center } label { area 319 499 108 27 enabled "not storeScreen:IsContainer()" text lua "storeScreen:GetStoreCost()" text style "normal" align center center } label { area 533 499 145 27 enabled "not storeScreen:IsContainer()" text "PRICE_LABEL" text style "label" align right center } label { area 717 499 108 27 enabled "not storeScreen:IsContainer()" text lua "storeScreen:GetGroupCost()" text style "normal" align center center } label { area 26 116 349 30 text lua "checkContainerText('STORE_LABEL',Infinity_FetchString(storeScreen:GetStoreName()))" text style "label" align left center } list { column { width 100 label { area 5 0 64 57 bam STONSLOT frame lua "getStoreSlotHighlight(store.storeItems[rowNumber].highlight)" icon lua "store.storeItems[rowNumber].item.icon" tint lua "store.storeItems[rowNumber].item.tint" usages lua "store.storeItems[rowNumber].amountSelected" --how many selected count lua "store.storeItems[rowNumber].item.stackSize" --How many to a stack align center center } label { area 80 0 250 57 text lua "store.storeItems[rowNumber].label" text style "normal" text align left center } label { area 310 0 91 57 enabled "not storeScreen:IsContainer()" text lua "store.storeItems[rowNumber].value" text style "gold" } label { enabled "store.storeItems[rowNumber].valid == 0 and store.storeItems[rowNumber].highlight == 0" area 0 0 436 57 rectangle 1 rectangle opacity 150 } } area 10 150 442 346 hidehighlight rowheight 57 table "store.storeItems" var "storeItemsVar" scrollbar 'GUISCRC' scrollbar clunkyScroll 57 action " if store.storeItems[storeItemsVar].clickable == 1 then if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then local highlight = true if(store.storeItems[storeItemsVar].highlight == 1) then highlight = false end storeScreen:SelectStoreItem( storeItemsVar - 1, highlight) end end " actionalt " showItemDescription(store.storeItems[storeItemsVar].item, 1, 1) " actionDbl " if store.storeItems[storeItemsVar].clickable == 1 then if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then local maxCount = store.storeItems[storeItemsVar].maxCount if(maxCount > 1) then popupRequester(maxCount, storeSplitStack, false, store.storeItems[storeItemsVar].item.icon) end end end " } label { area 467 116 250 30 text lua "Infinity_GetSelectedCharacterName()" text style "label" align left center } list { column { width 100 label { area 5 0 64 57 bam STONSLOT frame lua "getStoreSlotHighlight(store.groupItems[rowNumber].highlight)" tint lua "store.groupItems[rowNumber].item.tint" icon lua "store.groupItems[rowNumber].item.icon" count lua "store.groupItems[rowNumber].count" usages lua "store.groupItems[rowNumber].item.usages" align center center } label { area 80 0 200 57 text lua "store.groupItems[rowNumber].label" text style "normal" text align left center } label { area 300 0 62 57 enabled "not storeScreen:IsContainer()" text lua "store.groupItems[rowNumber].value" text style "gold" } label { --#21242 We don't grey out bags, even though they're not selectable, because we can open them. enabled "store.groupItems[rowNumber].valid == 0 and store.groupItems[rowNumber].item.isBag ~= 1" area 0 0 436 57 rectangle 1 rectangle opacity 150 } } area 456 150 398 346 enabled "not storeScreen:IsCloseBagButtonClickable()" hidehighlight rowheight 57 table "store.groupItems" var "storeGroupItemsVar" scrollbar 'GUISCRC' scrollbar clunkyScroll 57 action " if store.groupItems[storeGroupItemsVar].valid ~= 0 then local selected = true if(store.groupItems[storeGroupItemsVar].highlight == 1) then selected = false end storeScreen:SelectGroupItem( storeGroupItemsVar - 1, selected) end " actionalt " showItemDescription(store.groupItems[storeGroupItemsVar].item, 1, 0) " actionDbl " if(store.groupItems[storeGroupItemsVar].item.isBag == 1) then showItemDescription(store.groupItems[storeGroupItemsVar].item, 1, 0) itemDescLeftButtonAction() else if store.groupItems[storeGroupItemsVar].valid ~= 0 then local count = store.groupItems[storeGroupItemsVar].item.count local stock = store.groupItems[storeGroupItemsVar].numInStock if(count > 1) then popupRequester(count, groupSplitStack, true, store.groupItems[storeGroupItemsVar].item.icon) elseif stock > 1 then popupRequester(stock, groupSplitStack, true, store.groupItems[storeGroupItemsVar].item.icon) end end end " } list { column { width 100 label { area 5 0 64 57 bam STONSLOT frame lua "getStoreSlotHighlight(store.groupItems[rowNumber].highlight)" tint lua "store.groupItems[rowNumber].item.tint" icon lua "store.groupItems[rowNumber].item.icon" count lua "store.groupItems[rowNumber].item.count" usages lua "store.groupItems[rowNumber].count" align center center } label { area 80 0 200 57 text lua "store.groupItems[rowNumber].label" text style "normal" text align left center } label { area 300 0 62 57 enabled "not storeScreen:IsContainer()" text lua "store.groupItems[rowNumber].value" text style "gold" } label { enabled "store.groupItems[rowNumber].valid == 0" area 0 0 436 57 rectangle 1 rectangle opacity 150 } } area 456 150 398 340 enabled "storeScreen:IsCloseBagButtonClickable()" hidehighlight rowheight 57 table "store.groupItems" var "storeGroupItemsVar" scrollbar 'GUISCRC' scrollbar clunkyScroll 57 action " if store.groupItems[storeGroupItemsVar].valid ~= 0 then local selected = true if(store.groupItems[storeGroupItemsVar].highlight == 1) then selected = false end storeScreen:SelectGroupItem( storeGroupItemsVar - 1, selected) end " actionalt " showItemDescription(store.groupItems[storeGroupItemsVar].item, 1, 0) " actionDbl " if store.groupItems[storeGroupItemsVar].valid ~= 0 then local count = store.groupItems[storeGroupItemsVar].item.count local stock = store.groupItems[storeGroupItemsVar].numInStock if(count > 1) then popupRequester(count, groupSplitStack, true, store.groupItems[storeGroupItemsVar].item.icon) elseif stock > 1 then popupRequester(stock, groupSplitStack, true, store.groupItems[storeGroupItemsVar].item.icon) end end " } button { area 218 539 201 42 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text lua "checkContainerText('BUY_BUTTON', 'TO_BACKPACK_BUTTON')" text style "button" clickable lua "storeScreen:IsBuyItemButtonClickable()" action " storeScreen:OnBuyItemButtonClick() " } button { area 430 539 201 43 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text lua "checkContainerText('SELL_BUTTON','TO_CONTAINER_BUTTON')" text style "button" clickable lua "storeScreen:IsSellItemButtonClickable()" action " storeScreen:OnSellItemButtonClick() " } button { area 360 532 201 43 enabled "(not storeScreen:IsContainer()) and storeScreen:IsStealEnabled()" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "STEAL_BUTTON" text style "button" clickable lua "storeScreen:IsStealItemButtonClickable()" action " storeScreen:OnStealItemButtonClick() " } button { area 644 539 200 42 enabled "storeScreen:IsCloseBagButtonClickable()" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "CLOSE_CONTAINER_BUTTON" text style "button" action " storeScreen:OnCloseBagButtonClick() " } button { area 14 496 68 90 encumbrance } label { area 10 150 442 346 enabled "storeScreen:IsSpriteOrderable() == false" rectangle 0 rectangle opacity 200 ignoreEvents } label { area 456 150 398 346 enabled "storeScreen:IsSpriteOrderable() == false" rectangle 0 rectangle opacity 200 ignoreEvents } } ` identifyItemsVar = 0 ` menu { name 'STORE_IDENTIFY' align center center onOpen " storeScreen:UpdateIdentifyPanel() store.identifyText = '' " ignoreEsc label { area 0 0 864 710 mosaic GUISTIDB ignoreEvents } label { area 48 6 768 52 text "IDENTIFY_TITLE" text style "title" } label { area 274 58 314 26 text lua "Infinity_FetchString(storeScreen:GetStoreName())" text style "subTitle" } label { area 728 70 102 48 text lua "game:GetPartyGold()" text style "gold" } label { area 100 508 194 30 text "COST_LABEL" text style "label" text align center center } label { area 294 508 72 30 text lua "storeScreen:GetIdentifyCost()" text style "gold" } list { column { width 100 label { area 5 0 64 57 bam STONSLOT frame lua "getStoreSlotHighlight(store.identifyItems[rowNumber].highlight)" icon lua "store.identifyItems[rowNumber].item.icon" tint lua "store.identifyItems[rowNumber].item.tint" align center center } label { area 80 0 204 57 text lua "store.identifyItems[rowNumber].label" text style "normal" text align left center } label { enabled "store.identifyItems[rowNumber].valid == 0" area 0 0 308 57 rectangle 1 rectangle opacity 150 } } area 64 162 350 342 hidehighlight rowheight 57 table "store.identifyItems" var "identifyItemsVar" scrollbar 'GUISCRC' scrollbar clunkyScroll 57 action " local highlight = true if(store.identifyItems[identifyItemsVar].highlight == 1) then highlight = false end if(highlight == true and store.identifyItems[identifyItemsVar].valid == 0) then return end storeScreen:SelectIdentifyItem( identifyItemsVar - 1, highlight) " } button { area 120 544 200 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "IDENTIFY_BUTTON" text style "button" clickable lua "storeScreen:IsIdentifyItemButtonClickable()" action " storeScreen:OnIdentifyItemButtonClick() " } text { area 461 150 365 412 text lua "store.identifyText" text style "normal_parchment" scrollbar 'GUISCRC' } } ` function getDonationFrame() if(store.hasDonated ~= nil and store.hasDonated == 1) then return 1 else return 0 end end storeDonateAmountEdit = 0 --no longer used in ui, but the engine needs it. function changeDonationAmount(amount) if (amt == nil) then amt = 0 end amt = amt + amount if (amt > 0) then storeDonateAmountEdit = tostring(amt) else storeDonateAmountEdit = '0' end end ` menu { name 'STORE_DONATE' align center center ignoreEsc onOpen " storeScreen:UpdateDonatePanel() store.donateText = '' " label { area 0 0 864 710 mosaic GUISTDOB ignoreEvents } label { area 48 6 768 50 text "DONATE_TITLE" text style "title" } label { area 277 64 310 34 text lua "Infinity_FetchString(storeScreen:GetStoreName())" text style "subTitle" } label { area 73 151 311 267 bam "DONATE" frame lua "getDonationFrame()" } label { area 51 431 346 38 text "ENTER_DONATION_LABEL" text style "label" } edit { name "storeDonateAmountEditArea" area 119 477 122 48 var storeDonateAmountEdit text style "edit" text align left center maxlines 1 action " -- only permit numbers as letters. if(tonumber(letter_pressed) ~= nil or not letter_pressed) then return 1 else return 0 end " } button { bam GUIOSW area 244 481 44 44 sequence 0 action " changeDonationAmount(1) " actionHold " changeDonationAmount(1) " } button { bam GUIOSW area 288 481 44 44 sequence 1 clickable lua "tonumber(storeDonateAmountEdit) > 0" action " changeDonationAmount(-1) " actionHold " changeDonationAmount(-1) " } button { area 119 537 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONATE_BUTTON" text style "button" clickable lua "storeScreen:IsDonateButtonClickable()" action " storeScreen:OnDonateButtonClick() " } label { area 710 76 98 44 text lua "game:GetPartyGold()" text style "gold" } text { area 473 182 331 364 text lua "store.donateText" text style "normal_parchment" text color 'N' text point 20 scrollbar 'GUISCRC' } } ` function storeRest() storeScreen:RestParty() end ` menu { name 'STORE_ROOMS' align center center onOpen " storeScreen:SetRoomType(1) storeScreen:UpdateRentRoomPanel() " ignoreEsc label { area 0 0 864 710 mosaic GUISTROB ignoreEvents } label { area 48 6 768 48 text "ROOMS_TITLE" text style "title" } label { area 254 58 360 48 text lua "Infinity_FetchString(storeScreen:GetStoreName())" text style "subTitle" } label { area 732 66 106 52 text lua "game:GetPartyGold()" text style "gold" } button { area 31 128 245 161 bam "INNROOMS" sequence 0 clickable lua "storeScreen:IsRoomTypeClickable(1)" action " storeScreen:SetRoomType(1) selectedRoom = Infinity_FindUIItemByName('BUTTON_room_peasant') " } button { name "BUTTON_room_peasant" area 41 304 235 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "PEASANT_BUTTON" text style "button" glow lua "storeScreen:GetRoomType() == 1" clickable lua "storeScreen:IsRoomTypeClickable(1)" action " storeScreen:SetRoomType(1) " } button { area 385 128 245 161 bam "INNROOMS" sequence 1 clickable lua "storeScreen:IsRoomTypeClickable(2)" action " storeScreen:SetRoomType(2) selectedRoom = Infinity_FindUIItemByName('BUTTON_room_merchant') " } button { name "BUTTON_room_merchant" area 390 304 235 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "MERCHANT_BUTTON" text style "button" glow lua "storeScreen:GetRoomType() == 2" clickable lua "storeScreen:IsRoomTypeClickable(2)" action " storeScreen:SetRoomType(2) " } button { area 31 367 245 161 bam "INNROOMS" sequence 3 clickable lua "storeScreen:IsRoomTypeClickable(3)" frame 0 action " storeScreen:SetRoomType(3) selectedRoom = Infinity_FindUIItemByName('BUTTON_room_noble') " } button { name "BUTTON_room_noble" area 41 540 235 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "NOBLE_BUTTON" text style "button" glow lua "storeScreen:GetRoomType() == 3" clickable lua "storeScreen:IsRoomTypeClickable(3)" action " storeScreen:SetRoomType(3) " } button { area 385 367 245 161 bam "INNROOMS" sequence 2 clickable lua "storeScreen:IsRoomTypeClickable(4)" action " storeScreen:SetRoomType(4) selectedRoom = Infinity_FindUIItemByName('BUTTON_room_royal') " } button { name "BUTTON_room_royal" area 390 540 235 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "ROYAL_BUTTON" text style "button" glow lua "storeScreen:GetRoomType() == 4" clickable lua "storeScreen:IsRoomTypeClickable(4)" action " storeScreen:SetRoomType(4) " } label { area 654 464 70 40 text "COST_LABEL" text style "label" } text { area 662 137 160 298 text lua "store.roomText" text style "normal" text color 'D' } label { area 727 464 119 40 text lua "storeScreen:GetRoomCost()" text style "gold" } button { area 648 518 204 48 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "RENT_BUTTON" text style "button" action " storeScreen:OnRentRoomButtonClick() " } } menu { name 'STORE_HEALING' align center center onOpen "storeScreen:UpdateBuySpellPanel()" ignoreEsc label { area 0 0 864 710 mosaic GUISTIDB ignoreEvents } label { area 48 6 768 52 text "HEALING_TITLE" text style "title" } label { area 274 58 314 26 text lua "Infinity_FetchString(storeScreen:GetStoreName())" text style "subTitle" } label { area 728 70 102 48 text lua "game:GetPartyGold()" text style "gold" } label { area 68 126 144 32 text "COST_LABEL" text style "label" align left center } label { area 282 126 90 32 text lua "storeScreen:GetSpellCost()" text style "gold" } list { column { width 100 label { area 5 0 64 57 bam STONSLOT frame lua "getStoreSlotHighlight(store.healingSpells[rowNumber].highlight)" icon lua "store.healingSpells[rowNumber].icon" tint lua "store.healingSpells[rowNumber].tint" align center center } label { area 80 0 150 57 text lua "Infinity_FetchString(store.healingSpells[rowNumber].name)" text style "normal" text align left center } label { area 230 0 54 57 text style "gold" text align center center text lua "store.healingSpells[rowNumber].value" } label { enabled "store.healingSpells[rowNumber].valid == 0" area 0 0 308 57 rectangle 1 rectangle opacity 150 } } area 64 162 350 342 hidehighlight rowheight 57 table "store.healingSpells" var "healingSpellsVar" scrollbar 'GUISCRC' scrollbar clunkyScroll 57 action " local highlight = true if(store.healingSpells[healingSpellsVar].highlight == 1) then highlight = false end if(highlight == true and store.healingSpells[healingSpellsVar].valid == 0) then return end storeScreen:SelectSpellItem( healingSpellsVar - 1, highlight) " actionAlt " local spell = store.healingSpells[healingSpellsVar] popupDetails(16189, spell.name, spell.description,spell.icon) " } button { area 122 544 200 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "BUY_BUTTON" text style "button" action " storeScreen:OnBuySpellButtonClick() " } text { area 461 150 350 412 text lua "store.spellText" text style "normal_parchment" scrollbar 'GUISCRC' } } ` drinkListButtonSequences = {} function getDrinkLabel(rowNumber) local ret = "" Infinity_SetToken("ITEMNAME",store.drinks[rowNumber].name) Infinity_SetToken("ITEMCOST",store.drinks[rowNumber].value) ret = Infinity_FetchString(10162) return ret end ` menu { name 'STORE_DRINKS' align center center ignoreEsc onOpen " storeScreen:UpdateBuyDrinksPanel() store.drinkText = '' drinkListButtonSequences = {} for k,y in pairs(gameSaves.files) do drinkListButtonSequences[k] = getRandomButtonSequence('GUIBUTWT') end " label { area 0 0 864 710 mosaic GUISTIDB ignoreEvents } label { area 48 6 768 50 text "DRINKS_TITLE" text style "title" } label { area 277 52 310 38 text lua "Infinity_FetchString(storeScreen:GetStoreName())" text style "subTitle" } label { area 734 70 94 48 text lua "game:GetPartyGold()" text style "gold" } label { area 64 127 202 31 text "DRINK_LABEL" text style "label" text align left center } label { area 266 127 104 31 text "COST_LABEL" text style "label" text align right center } label { area 64 158 302 -54 rectangle 1 } list { column { width 100 label { area 5 7 308 57 bam GUIBUTWT sequence lua "drinkListButtonSequences[rowNumber]" } label { area 7 0 298 57 text lua "getDrinkLabel(rowNumber)" text style "label" text align center center } label { enabled "store.drinks[rowNumber].valid == 0" area 0 0 308 57 rectangle 1 rectangle opacity 150 } } area 64 162 348 342 rowheight 57 table "store.drinks" var "storeDrinksVar" hideHighlight scrollbar clunkyScroll 57 scrollbar 'GUISCRC' action " if storeDrinksVar ~= nil and storeDrinksVar ~= 0 then storeScreen:OnBuyDrinkButtonClick(storeDrinksVar - 1) end " } label { area 650 154 127 93 bam lua "store.qualityIcon" } label { area 460 146 162 48 text "RUMORS_LABEL" text style "label_parchment" } text { area 489 251 310 296 text lua "store.drinkText" text style "normal_parchment" scrollbar 'GUISCRC' } } ` storePanelButtonHighlightGroup = nil function setStoreMainPanel(buttonId) local oldMenu = storeScreen:GetMenuName(storeCurMenuId) Infinity_PopMenu(oldMenu) storeCurMenuId = storeScreen:GetPanelButtonPanelId(buttonId) Infinity_PushMenu(storeScreen:GetMenuName(storeCurMenuId)) end function getBuySellTooltip() if(storeScreen:IsContainer()) then return t('TRANSFER_ITEMS_TOOLTIP') else return Infinity_FetchString(storeScreen:GetPanelButtonToolTip(0)) end end ` menu { name 'STORE_CHOOSER' align center center onOpen " local menuName = storeScreen:GetMenuName(storeCurMenuId) Infinity_PushMenu(menuName) pushSidebars() local buttonId = storeScreen:GetPanelButtonId(storeCurMenuId) storePanelButtonHighlightGroup = Infinity_FindUIItemByName('BUTTON_storechooser_' .. buttonId) " onClose " local menuName = storeScreen:GetMenuName(storeCurMenuId) Infinity_PopMenu(menuName) popSidebars() " ignoreEsc label { area -8 4 864 710 } label { area 0 598 864 116 mosaic GUISTBBB } label { area 22 616 80 70 bam lua "store.icon" } button { area 626 658 230 44 on escape bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action " storeScreen:OnMainDoneButtonClick() " } button { name 'BUTTON_storechooser_0' area 110 616 62 64 enabled "storeScreen:GetPanelButtonEnabled(0)" bam GUISTBBC highlightgroup storePanelButtonHighlightGroup sequence lua "storeScreen:GetPanelButtonSequence(0)" tooltip lua "getBuySellTooltip()" action " setStoreMainPanel(0) " } button { name 'BUTTON_storechooser_1' area 182 616 62 64 enabled "storeScreen:GetPanelButtonEnabled(1)" bam GUISTBBC highlightgroup storePanelButtonHighlightGroup sequence lua "storeScreen:GetPanelButtonSequence(1)" tooltip lua "Infinity_FetchString(storeScreen:GetPanelButtonToolTip(1))" action " setStoreMainPanel(1) " } button { name 'BUTTON_storechooser_2' area 254 616 62 64 enabled "storeScreen:GetPanelButtonEnabled(2)" bam GUISTBBC highlightgroup storePanelButtonHighlightGroup sequence lua "storeScreen:GetPanelButtonSequence(2)" tooltip lua "Infinity_FetchString(storeScreen:GetPanelButtonToolTip(2))" action " setStoreMainPanel(2) " } button { name 'BUTTON_storechooser_3' area 326 616 62 64 enabled "storeScreen:GetPanelButtonEnabled(3)" bam GUISTBBC highlightgroup storePanelButtonHighlightGroup sequence lua "storeScreen:GetPanelButtonSequence(3)" tooltip lua "Infinity_FetchString(storeScreen:GetPanelButtonToolTip(3))" action " setStoreMainPanel(3) " } } ` function worldDeathLoadClickable() if(e:IsMultiplayer() and not e:IsHosting()) then return false end return not worldScreen:GetHardPaused() end function worldDeathQuitClickable() return not worldScreen:GetHardPaused() end function worldDeathText() if(e:IsMultiplayer()) then if(e:IsHosting()) then return Infinity_FetchString(19377) else return Infinity_FetchString(11331) end else if(worldDeathStr == nil) then return Infinity_FetchString(16498) else return Infinity_FetchString(worldDeathStr) end end end function worldDeathQuitText() if(e:IsMultiplayer()) then return t('LOGOUT_BUTTON') else return t('QUIT_BUTTON') end end groundItemsButtonToggle = 0 highlightButtonToggle = 0 worldChatEdit = "" ` menu { name "WORLD_DEATH" align center bottom ignoreEsc modal onopen " Infinity_PopMenu('WORLD_MESSAGES') Infinity_PopMenu('WORLD_ACTIONBAR') " label { area 0 0 500 140 mosaic "GUDEATH0" } label { area 91 10 316 66 text lua "worldDeathText()" text style "label" text align center center } button { area 15 88 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "LOAD_BUTTON" text style "button" clickable lua "worldDeathLoadClickable()" action " Infinity_PopMenu() worldScreen:OnDeathLoad() " } button { area 258 88 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text style "button" text lua "worldDeathQuitText()" clickable lua "worldDeathQuitClickable()" action " Infinity_PopMenu() worldScreen:OnDeathQuit() " } } ` actionBarTooltip = {} ` menu { name "WORLD_ACTIONBAR" align center bottom onOpen " toolbarTop = 54 Infinity_PushMenu('WORLD_MESSAGES') if(groundItemsButtonToggle == 1) then worldScreen:StartGroundItems() end worldScreen:SetHighlightEnabled(highlightButtonToggle == 1) " onClose " Infinity_PopMenu('WORLD_QUICKLOOT'); Infinity_PopMenu('WORLD_MESSAGES'); " ignoreEsc label { area 0 0 746 57 mosaic GUWBTP10 } button { area 21 12 32 32 bam ROUNDBUT scaleToClip tooltip lua "Infinity_FetchString(34787)" toggle groundItemsButtonToggle action " if(groundItemsButtonToggle == 1) then worldScreen:StartGroundItems() else worldScreen:StopGroundItems() end " actionAlt " if(groundItemsButtonToggle == 1) then worldScreen:StartGroundItems() else worldScreen:StopGroundItems() end " } button { area 68 1 52 52 actionBar 0 enabled "buttonArray:GetButtonEnabled(0)" tooltip lua "actionBarTooltip[0]" action "buttonArray:OnLButtonPressed(0)" actionAlt "buttonArray:OnRButtonPressed(0)" } button { area 122 1 52 52 actionBar 1 enabled "buttonArray:GetButtonEnabled(1)" tooltip lua "actionBarTooltip[1]" action "buttonArray:OnLButtonPressed(1)" actionAlt "buttonArray:OnRButtonPressed(1)" } button { area 177 1 52 52 actionBar 2 enabled "buttonArray:GetButtonEnabled(2)" tooltip lua "actionBarTooltip[2]" action "buttonArray:OnLButtonPressed(2)" actionAlt "buttonArray:OnRButtonPressed(2)" } button { area 231 1 52 52 actionBar 3 enabled "buttonArray:GetButtonEnabled(3)" tooltip lua "actionBarTooltip[3]" action "buttonArray:OnLButtonPressed(3)" actionAlt "buttonArray:OnRButtonPressed(3)" } button { area 299 1 52 52 actionBar 4 enabled "buttonArray:GetButtonEnabled(4)" tooltip lua "actionBarTooltip[4]" action "buttonArray:OnLButtonPressed(4)" actionAlt "buttonArray:OnRButtonPressed(4)" } button { area 353 1 52 52 actionBar 5 enabled "buttonArray:GetButtonEnabled(5)" tooltip lua "actionBarTooltip[5]" action "buttonArray:OnLButtonPressed(5)" actionAlt "buttonArray:OnRButtonPressed(5)" } button { area 407 1 52 52 actionBar 6 enabled "buttonArray:GetButtonEnabled(6)" tooltip lua "actionBarTooltip[6]" action "buttonArray:OnLButtonPressed(6)" actionAlt "buttonArray:OnRButtonPressed(6)" } button { area 461 1 52 52 actionBar 7 enabled "buttonArray:GetButtonEnabled(7)" tooltip lua "actionBarTooltip[7]" action "buttonArray:OnLButtonPressed(7)" actionAlt "buttonArray:OnRButtonPressed(7)" } button { area 528 1 52 52 actionBar 8 enabled "buttonArray:GetButtonEnabled(8)" tooltip lua "actionBarTooltip[8]" action "buttonArray:OnLButtonPressed(8)" actionAlt "buttonArray:OnRButtonPressed(8)" } button { area 582 1 52 52 actionBar 9 enabled "buttonArray:GetButtonEnabled(9)" tooltip lua "actionBarTooltip[9]" action "buttonArray:OnLButtonPressed(9)" actionAlt "buttonArray:OnRButtonPressed(9)" } button { area 636 1 52 52 actionBar 10 enabled "buttonArray:GetButtonEnabled(10)" tooltip lua "actionBarTooltip[10]" action "buttonArray:OnLButtonPressed(10)" actionAlt "buttonArray:OnRButtonPressed(10)" } button { area 689 1 52 52 actionBar 11 enabled "buttonArray:GetButtonEnabled(11)" tooltip lua "actionBarTooltip[11]" action "buttonArray:OnLButtonPressed(11)" actionAlt "buttonArray:OnRButtonPressed(11)" } } ` loot = { containerItems = {}, groupItems = {}, groundItems = {} } function getContainerItemProperty(index, property) local idxScrolled = index + worldScreen:GetTopContainerItem() if(loot.containerItems[idxScrolled] == nil or loot.containerItems[idxScrolled].item == nil) then return nil end return loot.containerItems[idxScrolled].item[property] end function getGroupItemProperty(index, property) local idxScrolled = index + worldScreen:GetTopGroupItem() if(loot.groupItems[idxScrolled] == nil or loot.groupItems[idxScrolled].item == nil) then return nil end return loot.groupItems[idxScrolled].item[property] end function scrollContainerItems() if scrollDirection > 0 then if worldScreen:ContainerScrollEnabled(-1) then worldScreen:OnContainerScroll(-1) end elseif scrollDirection < 0 then if worldScreen:ContainerScrollEnabled(1) then worldScreen:OnContainerScroll(1) end end end function scrollGroupItems() if scrollDirection > 0 then if worldScreen:GroupScrollEnabled(-1) then worldScreen:OnGroupScroll(-1) end elseif scrollDirection < 0 then if worldScreen:GroupScrollEnabled(1) then worldScreen:OnGroupScroll(1) end end end function showContainerItemDescription(index) local idxScrolled = index + worldScreen:GetTopContainerItem() if(loot.containerItems[idxScrolled] == nil or loot.containerItems[idxScrolled].item == nil) then return nil end Infinity_GetContainerItemDescription(idxScrolled) showItemDescription(loot.containerItems[idxScrolled].item, 2) end function showGroupItemDescription(index) local idxScrolled = index + worldScreen:GetTopGroupItem() if(loot.groupItems[idxScrolled] == nil or loot.groupItems[idxScrolled].item == nil) then return nil end Infinity_GetGroupItemDescription(idxScrolled) showItemDescription(loot.groupItems[idxScrolled].item, 2) end ` menu { name "WORLD_CONTAINER" align center bottom offset -24 0 ignoreesc label { area 0 0 653 130 mosaic gmpwmsg0 } label { area 16 10 83 100 bam lua "loot.containerIcon" } button { area 104 2 209 116 actionScroll "scrollContainerItems()" } button { area 108 8 52 52 bam STONSLOT tooltip lua "getContainerItemProperty(0,'name')" tint lua "getContainerItemProperty(0,'tint')" icon lua "getContainerItemProperty(0,'icon')" count lua "getContainerItemProperty(0,'count')" usages lua "getContainerItemProperty(0,'usages')" action "worldScreen:OnContainerButtonClick(0)" actionAlt "showContainerItemDescription(0)" actionScroll "scrollContainerItems()" } button { area 162 8 52 52 bam STONSLOT tooltip lua "getContainerItemProperty(1,'name')" tint lua "getContainerItemProperty(1,'tint')" icon lua "getContainerItemProperty(1,'icon')" count lua "getContainerItemProperty(1,'count')" usages lua "getContainerItemProperty(1,'usages')" action "worldScreen:OnContainerButtonClick(1)" actionAlt "showContainerItemDescription(1)" actionScroll "scrollContainerItems()" } button { area 216 8 52 52 bam STONSLOT tooltip lua "getContainerItemProperty(2,'name')" tint lua "getContainerItemProperty(2,'tint')" icon lua "getContainerItemProperty(2,'icon')" count lua "getContainerItemProperty(2,'count')" usages lua "getContainerItemProperty(2,'usages')" action "worldScreen:OnContainerButtonClick(2)" actionAlt "showContainerItemDescription(2)" actionScroll "scrollContainerItems()" } button { area 108 62 52 52 bam STONSLOT tooltip lua "getContainerItemProperty(3,'name')" tint lua "getContainerItemProperty(3,'tint')" icon lua "getContainerItemProperty(3,'icon')" count lua "getContainerItemProperty(3,'count')" usages lua "getContainerItemProperty(3,'usages')" action "worldScreen:OnContainerButtonClick(3)" actionAlt "showContainerItemDescription(3)" actionScroll "scrollContainerItems()" } button { area 162 62 52 52 bam STONSLOT tooltip lua "getContainerItemProperty(4,'name')" tint lua "getContainerItemProperty(4,'tint')" icon lua "getContainerItemProperty(4,'icon')" count lua "getContainerItemProperty(4,'count')" usages lua "getContainerItemProperty(4,'usages')" action "worldScreen:OnContainerButtonClick(4)" actionAlt "showContainerItemDescription(4)" actionScroll "scrollContainerItems()" } button { area 216 62 52 52 bam STONSLOT tooltip lua "getContainerItemProperty(5,'name')" tint lua "getContainerItemProperty(5,'tint')" icon lua "getContainerItemProperty(5,'icon')" count lua "getContainerItemProperty(5,'count')" usages lua "getContainerItemProperty(5,'usages')" action "worldScreen:OnContainerButtonClick(5)" actionAlt "showContainerItemDescription(5)" actionScroll "scrollContainerItems()" } button { area 268 8 44 44 enabled "worldScreen:ContainerScrollEnabled(-1)" bam guisv10 sequence 0 action " worldScreen:OnContainerScroll(-1) " actionScroll "scrollContainerItems()" } button { area 268 70 44 44 enabled "worldScreen:ContainerScrollEnabled(1)" bam guisv10 sequence 1 action " worldScreen:OnContainerScroll(1) " actionScroll "scrollContainerItems()" } label { area 313 12 68 100 encumbrance } button { area 406 2 162 116 actionScroll "scrollGroupItems()" } button { area 411 8 52 52 bam STONSLOT tooltip lua "getGroupItemProperty(0,'name')" tint lua "getGroupItemProperty(0,'tint')" icon lua "getGroupItemProperty(0,'icon')" count lua "getGroupItemProperty(0,'count')" usages lua "getGroupItemProperty(0,'usages')" action "worldScreen:OnContainerButtonClick(10)" actionAlt "showGroupItemDescription(0)" actionScroll "scrollGroupItems()" } button { area 465 8 52 52 bam STONSLOT tooltip lua "getGroupItemProperty(1,'name')" tint lua "getGroupItemProperty(1,'tint')" icon lua "getGroupItemProperty(1,'icon')" count lua "getGroupItemProperty(1,'count')" usages lua "getGroupItemProperty(1,'usages')" action "worldScreen:OnContainerButtonClick(11)" actionAlt "showGroupItemDescription(1)" actionScroll "scrollGroupItems()" } button { area 411 62 52 52 bam STONSLOT tooltip lua "getGroupItemProperty(2,'name')" tint lua "getGroupItemProperty(2,'tint')" icon lua "getGroupItemProperty(2,'icon')" count lua "getGroupItemProperty(2,'count')" usages lua "getGroupItemProperty(2,'usages')" action "worldScreen:OnContainerButtonClick(12)" actionAlt "showGroupItemDescription(2)" actionScroll "scrollGroupItems()" } button { area 465 62 52 52 bam STONSLOT tooltip lua "getGroupItemProperty(3,'name')" tint lua "getGroupItemProperty(3,'tint')" icon lua "getGroupItemProperty(3,'icon')" count lua "getGroupItemProperty(3,'count')" usages lua "getGroupItemProperty(3,'usages')" action "worldScreen:OnContainerButtonClick(13)" actionAlt "showGroupItemDescription(3)" actionScroll "scrollGroupItems()" } button { area 517 8 44 44 enabled "worldScreen:GroupScrollEnabled(-1)" bam guisv10 sequence 0 action " worldScreen:OnGroupScroll(-1) " actionScroll "scrollGroupItems()" } button { area 517 70 44 44 enabled "worldScreen:GroupScrollEnabled(1)" bam guisv10 sequence 1 action " worldScreen:OnGroupScroll(1) " actionScroll "scrollGroupItems()" } label { area 568 20 78 50 bam GUIGOLD } label { area 575 76 71 28 text lua "game:GetPartyGold()" text style "gold" } button { area 40 82 32 32 bam "ROUNDBUT" scaleToClip action " worldScreen:TakeAllFromContainer() " } } ` function getSlotContainerId(index) local idxScrolled = index + worldScreen:GetTopGroundItem() if(loot.groundItems[idxScrolled] == nil) then return nil end return loot.groundItems[idxScrolled].containerId end function getGroundItemProperty(index, property) local idxScrolled = index + worldScreen:GetTopGroundItem() if(loot.groundItems[idxScrolled] == nil or loot.groundItems[idxScrolled].item == nil) then return nil end return loot.groundItems[idxScrolled].item[property] end function groundItemClick(slotId) local slot = loot.groundItems[slotId + worldScreen:GetTopGroundItem()] if(slot and slot.item) then worldScreen:OnGroundButtonClick(slot.slotId, slot.containerId, slot.item.res) end end function showGroundItemDescription(slotId) local slot = loot.groundItems[slotId + worldScreen:GetTopGroundItem()] if(slot and slot.item) then Infinity_GetGroundItemDescription(slotId + worldScreen:GetTopGroundItem(), slot.slotId, slot.containerId) showItemDescription(slot.item, 2) end end ` menu { name 'WORLD_QUICKLOOT' align center bottom ignoreEsc onOpen " Infinity_SetOffset('WORLD_QUICKLOOT',0, -toolbarTop) " button { area 2 4 40 57 bam GUIBTACT frame 44 enabled "worldScreen:GroundScrollEnabled(-1) or worldScreen:GroundScrollEnabled(1)" action " worldScreen:OnGroundScroll(-1) " } button { area 610 4 40 57 bam GUIBTACT frame 42 enabled "worldScreen:GroundScrollEnabled(-1) or worldScreen:GroundScrollEnabled(1)" action " worldScreen:OnGroundScroll(1) " } button { area 46 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(0,'name')" tint lua "getGroundItemProperty(0,'tint')" icon lua "getGroundItemProperty(0,'icon')" count lua "getGroundItemProperty(0,'count')" usages lua "getGroundItemProperty(0,'usages')" action "groundItemClick(0)" actionAlt "showGroundItemDescription(0)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(0,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 102 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(1,'name')" tint lua "getGroundItemProperty(1,'tint')" icon lua "getGroundItemProperty(1,'icon')" count lua "getGroundItemProperty(1,'count')" usages lua "getGroundItemProperty(1,'usages')" action "groundItemClick(1)" actionAlt "showGroundItemDescription(1)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(1,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 158 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(2,'name')" tint lua "getGroundItemProperty(2,'tint')" icon lua "getGroundItemProperty(2,'icon')" count lua "getGroundItemProperty(2,'count')" usages lua "getGroundItemProperty(2,'usages')" action "groundItemClick(2)" actionAlt "showGroundItemDescription(2)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(2,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 214 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(3,'name')" tint lua "getGroundItemProperty(3,'tint')" icon lua "getGroundItemProperty(3,'icon')" count lua "getGroundItemProperty(3,'count')" usages lua "getGroundItemProperty(3,'usages')" action "groundItemClick(3)" actionAlt "showGroundItemDescription(3)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(3,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 270 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(4,'name')" tint lua "getGroundItemProperty(4,'tint')" icon lua "getGroundItemProperty(4,'icon')" count lua "getGroundItemProperty(4,'count')" usages lua "getGroundItemProperty(4,'usages')" action "groundItemClick(4)" actionAlt "showGroundItemDescription(4)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(4,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 326 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(5,'name')" tint lua "getGroundItemProperty(5,'tint')" icon lua "getGroundItemProperty(5,'icon')" count lua "getGroundItemProperty(5,'count')" usages lua "getGroundItemProperty(5,'usages')" action "groundItemClick(5)" actionAlt "showGroundItemDescription(5)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(5,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 383 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(6,'name')" tint lua "getGroundItemProperty(6,'tint')" icon lua "getGroundItemProperty(6,'icon')" count lua "getGroundItemProperty(6,'count')" usages lua "getGroundItemProperty(6,'usages')" action "groundItemClick(6)" actionAlt "showGroundItemDescription(6)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(6,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 439 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(7,'name')" tint lua "getGroundItemProperty(7,'tint')" icon lua "getGroundItemProperty(7,'icon')" count lua "getGroundItemProperty(7,'count')" usages lua "getGroundItemProperty(7,'usages')" action "groundItemClick(7)" actionAlt "showGroundItemDescription(7)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(7,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 495 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(8,'name')" tint lua "getGroundItemProperty(8,'tint')" icon lua "getGroundItemProperty(8,'icon')" count lua "getGroundItemProperty(8,'count')" usages lua "getGroundItemProperty(8,'usages')" action "groundItemClick(8)" actionAlt "showGroundItemDescription(8)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(8,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } button { area 551 5 52 52 bam STONSLOT tooltip lua "getGroundItemProperty(9,'name')" tint lua "getGroundItemProperty(9,'tint')" icon lua "getGroundItemProperty(9,'icon')" count lua "getGroundItemProperty(9,'count')" usages lua "getGroundItemProperty(9,'usages')" action "groundItemClick(9)" actionAlt "showGroundItemDescription(9)" actionEnter "mouseOverQuicklootContainer = getSlotContainerId(9,'containerId')" actionExit "mouseOverQuicklootContainer = nil" } } menu { name 'WORLD_PICKPARTY' modal align center bottom ignoreEsc label { area 0 -28 854 162 mosaic GUWPKPC0 } label { area 15 -20 431 50 text "REMOVE_MEMBERS_LABEL" text style "label" align left center } button { area 15 26 61 91 bitmap lua "worldScreen:GetPickPartyPortrait(0)" glow lua "worldScreen:GetPickPartyCharacterId(0) == worldScreen:GetPickPartyRemoveCharacterId()" action " worldScreen:OnPickPartyPortraitButtonClick(0) " } button { area 77 26 61 91 bitmap lua "worldScreen:GetPickPartyPortrait(1)" glow lua "worldScreen:GetPickPartyCharacterId(1) == worldScreen:GetPickPartyRemoveCharacterId()" action " worldScreen:OnPickPartyPortraitButtonClick(1) " } button { area 139 26 61 91 bitmap lua "worldScreen:GetPickPartyPortrait(2)" glow lua "worldScreen:GetPickPartyCharacterId(2) == worldScreen:GetPickPartyRemoveCharacterId()" action " worldScreen:OnPickPartyPortraitButtonClick(2) " } button { area 201 26 61 91 bitmap lua "worldScreen:GetPickPartyPortrait(3)" glow lua "worldScreen:GetPickPartyCharacterId(3) == worldScreen:GetPickPartyRemoveCharacterId()" action " worldScreen:OnPickPartyPortraitButtonClick(3) " } button { area 263 26 61 91 bitmap lua "worldScreen:GetPickPartyPortrait(4)" glow lua "worldScreen:GetPickPartyCharacterId(4) == worldScreen:GetPickPartyRemoveCharacterId()" action " worldScreen:OnPickPartyPortraitButtonClick(4) " } button { area 325 26 61 91 bitmap lua "worldScreen:GetPickPartyPortrait(5)" glow lua "worldScreen:GetPickPartyCharacterId(5) == worldScreen:GetPickPartyRemoveCharacterId()" action " worldScreen:OnPickPartyPortraitButtonClick(5) " } button { area 387 26 61 91 bitmap lua "worldScreen:GetPickPartyPortrait(6)" glow lua "worldScreen:GetPickPartyCharacterId(6) == worldScreen:GetPickPartyRemoveCharacterId()" action " worldScreen:OnPickPartyPortraitButtonClick(6) " } label { area 747 -16 91 32 text lua "game:GetCharacterOverflowCount()" text style "normal" align center center } button { area 638 22 200 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "REMOVE_BUTTON" text style "button" clickable lua "worldScreen:IsPickPartyRemoveButtonClickable()" action " Infinity_PushMenu('REFORM_CONFIRMATION') " } button { area 638 73 200 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONE_BUTTON" text style "button" clickable lua "worldScreen:IsPickPartyDoneButtonClickable()" on esc action " worldScreen:OnPickPartyDoneButtonClick() " } } menu { name "REFORM_CONFIRMATION" align center bottom ignoreEsc modal onopen " Infinity_PopMenu('WORLD_PICKPARTY') " label { area 0 0 500 140 mosaic "GUDEATH0" } label { area 91 10 316 66 text 17518 text style "label" text align center center } button { area 15 88 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "REMOVE_BUTTON" text style "button" clickable lua "worldDeathLoadClickable()" action " Infinity_PopMenu() worldScreen:RemoveCharacterFromParty() Infinity_PushMenu('WORLD_PICKPARTY') " } button { area 258 88 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text style "button" text "CANCEL_BUTTON" clickable lua "worldDeathQuitClickable()" action " Infinity_PopMenu() Infinity_PushMenu('WORLD_PICKPARTY') " } } ` currentSave = 0 function getSaveBackground(row) if(row == currentSave) then return "GUISAVEC" else return "GUISAVEB" end end loadSaveOffset = 0 forceLoadGameScrollbar = false function scrollLoadGames() forceLoadGameScrollbar = true if scrollDirection > 0 then scrollLoadGamesUp() elseif scrollDirection < 0 then scrollLoadGamesDown() end end function scrollLoadGamesUp() if loadSaveOffset > 0 then loadSaveOffset = loadSaveOffset - 1 end end function scrollLoadGamesDown() if loadSaveOffset < (#(gameSaves.files) - 4) then loadSaveOffset = loadSaveOffset + 1 end end function loadGameScrollbarFunction(top, height, contentHeight) if forceLoadGameScrollbar then forceLoadGameScrollbar = false return (loadSaveOffset / (#(gameSaves.files) - 4)) * (height - contentHeight) elseif top ~= 0 and height ~= contentHeight and #(gameSaves.files) ~= 4 then loadSaveOffset = math.floor((top / (height - contentHeight)) * (#(gameSaves.files) - 4)) if loadSaveOffset ~= 0 then end return nil end end function saveFileExists(saveIndex) local ret = true if gameSaves == nil then ret = false elseif gameSaves == {} then ret = false elseif gameSaves.files[saveIndex] == nil then ret = false elseif gameSaves.files[saveIndex] == {} then ret = false end return ret end ` menu { name 'LOAD' align center center ignoreEsc onOpen " loadSaveOffset = 0 forceLoadGameScrollbar = false " button { area 0 0 1024 768 mosaic GUISRSVB action " currentSave = nil " actionScroll " scrollLoadGames() " } label { area 126 22 766 50 text "LOAD_TITLE" text style "title" actionScroll " scrollLoadGames() " } --SAVE 1 label { area 216 138 466 28 enabled "saveFileExists(1 + loadSaveOffset)" text lua "gameSaves.files[1 + loadSaveOffset].slotName" text style "label" align left center } label { area 216 172 466 24 enabled "saveFileExists(1 + loadSaveOffset)" text lua "gameSaves.files[1 + loadSaveOffset].chapter .. ' ' .. gameSaves.files[1 + loadSaveOffset].time" text style "label" align left center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset].hasPortrait0" area 316 208 30 48 bitmap res "gameSaves.files[1 + loadSaveOffset].portrait0" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset].hasPortrait1" area 378 208 30 48 bitmap res "gameSaves.files[1 + loadSaveOffset].portrait1" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset].hasPortrait2" area 440 208 30 48 bitmap res "gameSaves.files[1 + loadSaveOffset].portrait2" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset].hasPortrait3" area 502 208 30 48 bitmap res "gameSaves.files[1 + loadSaveOffset].portrait3" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset].hasPortrait4" area 564 208 30 48 bitmap res "gameSaves.files[1 + loadSaveOffset].portrait4" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset].hasPortrait5" area 626 208 30 48 bitmap res "gameSaves.files[1 + loadSaveOffset].portrait5" align center center } --SAVE 2 label { area 216 282 466 28 enabled "saveFileExists(2 + loadSaveOffset)" text lua "gameSaves.files[2 + loadSaveOffset].slotName" text style "label" align left center } label { area 216 314 466 26 enabled "saveFileExists(2 + loadSaveOffset)" text lua "gameSaves.files[2 + loadSaveOffset].chapter .. ' ' .. gameSaves.files[2 + loadSaveOffset].time" text style "label" align left center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset].hasPortrait0" area 316 352 30 48 bitmap res "gameSaves.files[2 + loadSaveOffset].portrait0" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset].hasPortrait1" area 378 352 30 48 bitmap res "gameSaves.files[2 + loadSaveOffset].portrait1" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset].hasPortrait2" area 440 352 30 48 bitmap res "gameSaves.files[2 + loadSaveOffset].portrait2" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset].hasPortrait3" area 502 352 30 48 bitmap res "gameSaves.files[2 + loadSaveOffset].portrait3" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset].hasPortrait4" area 564 352 30 48 bitmap res "gameSaves.files[2 + loadSaveOffset].portrait4" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset].hasPortrait5" area 626 352 30 48 bitmap res "gameSaves.files[2 + loadSaveOffset].portrait5" align center center } --SAVE 3 label { area 216 428 466 28 enabled "saveFileExists(3 + loadSaveOffset)" text lua "gameSaves.files[3 + loadSaveOffset].slotName" text style "label" align left center } label { area 216 460 466 26 enabled "saveFileExists(3 + loadSaveOffset)" text lua "gameSaves.files[3 + loadSaveOffset].chapter .. ' ' .. gameSaves.files[3 + loadSaveOffset].time" text style "label" align left center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset].hasPortrait0" area 316 500 30 48 bitmap res "gameSaves.files[3 + loadSaveOffset].portrait0" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset].hasPortrait1" area 378 500 30 48 bitmap res "gameSaves.files[3 + loadSaveOffset].portrait1" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset].hasPortrait2" area 440 500 30 48 bitmap res "gameSaves.files[3 + loadSaveOffset].portrait2" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset].hasPortrait3" area 502 500 30 48 bitmap res "gameSaves.files[3 + loadSaveOffset].portrait3" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset].hasPortrait4" area 564 500 30 48 bitmap res "gameSaves.files[3 + loadSaveOffset].portrait4" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset].hasPortrait5" area 626 500 30 48 bitmap res "gameSaves.files[3 + loadSaveOffset].portrait5" align center center } --SAVE 4 label { area 216 570 466 30 enabled "saveFileExists(4 + loadSaveOffset)" text lua "gameSaves.files[4 + loadSaveOffset].slotName" text style "label" align left center } label { area 216 606 466 24 enabled "saveFileExists(4 + loadSaveOffset)" text lua "gameSaves.files[4 + loadSaveOffset].chapter .. ' ' .. gameSaves.files[4 + loadSaveOffset].time" text style "label" align left center } button { enabled "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset].hasPortrait0" area 316 644 30 48 bitmap res "gameSaves.files[4 + loadSaveOffset].portrait0" align center center } button { enabled "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset].hasPortrait1" area 378 644 30 48 bitmap res "gameSaves.files[4 + loadSaveOffset].portrait1" align center center } button { enabled "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset].hasPortrait2" area 440 644 30 48 bitmap res "gameSaves.files[4 + loadSaveOffset].portrait2" align center center } button { enabled "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset].hasPortrait3" area 502 644 30 48 bitmap res "gameSaves.files[4 + loadSaveOffset].portrait3" align center center } button { enabled "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset].hasPortrait4" area 564 644 30 48 bitmap res "gameSaves.files[4 + loadSaveOffset].portrait4" align center center } button { enabled "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset].hasPortrait5" area 626 644 30 48 bitmap res "gameSaves.files[4 + loadSaveOffset].portrait5" align center center } list { column { width 100 label { area 0,0,928,-1 } } area 20 126 934 580 rowheight 145 hidehighlight table "gameSaves.files" var currentSave scrollbar 'GUISCRC' scrollbar func "loadGameScrollbarFunction" scrollbar respectConstraints } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset].hasScreenShot" area 26 130 164 132 bitmap res "gameSaves.files[1 + loadSaveOffset].screenshot" align center center actionScroll " scrollLoadGames() " actionDbl " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[1 + loadSaveOffset].fileName) " } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset].hasScreenShot" area 26 276 164 132 bitmap res "gameSaves.files[2 + loadSaveOffset].screenshot" align center center actionScroll " scrollLoadGames() " actionDbl " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[2 + loadSaveOffset].fileName) " } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset].hasScreenShot" area 26 422 164 132 bitmap res "gameSaves.files[3 + loadSaveOffset].screenshot" align center center actionScroll " scrollLoadGames() " actionDbl " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[3 + loadSaveOffset].fileName) " } button { enabled "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset].hasScreenShot" area 26 566 164 132 bitmap res "gameSaves.files[4 + loadSaveOffset].screenshot" align center center actionScroll " scrollLoadGames() " actionDbl " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[4 + loadSaveOffset].fileName) " } button { area 712 164 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset] ~= nil" text "LOAD_BUTTON" text style "button" action " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[1 + loadSaveOffset].fileName) " actionScroll " scrollLoadGames() " } button { area 712 212 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + loadSaveOffset] ~= nil" text "DELETE_BUTTON" text style "button" action " popup2Button(15305, 'DELETE_BUTTON', function() loadScreen:DeleteGame(gameSaves.files[1 + loadSaveOffset].slotIndex) end) " actionScroll " scrollLoadGames() " } button { area 712 308 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset] ~= nil" text "LOAD_BUTTON" text style "button" action " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[2 + loadSaveOffset].fileName) " actionScroll " scrollLoadGames() " } button { area 712 356 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + loadSaveOffset] ~= nil" text "DELETE_BUTTON" text style "button" action " popup2Button(15305, 'DELETE_BUTTON', function() loadScreen:DeleteGame(gameSaves.files[2 + loadSaveOffset].slotIndex) end) " actionScroll " scrollLoadGames() " } button { area 712 452 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset] ~= nil" text "LOAD_BUTTON" text style "button" action " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[3 + loadSaveOffset].fileName) " actionScroll " scrollLoadGames() " } button { area 712 502 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + loadSaveOffset] ~= nil" text "DELETE_BUTTON" text style "button" action " popup2Button(15305, 'DELETE_BUTTON', function() loadScreen:DeleteGame(gameSaves.files[3 + loadSaveOffset].slotIndex) end) " actionScroll " scrollLoadGames() " } button { area 712 596 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset] ~= nil" text "LOAD_BUTTON" text style "button" action " Infinity_PlaySound('GAM_09') loadScreen:LoadGame(gameSaves.files[4 + loadSaveOffset].fileName) " actionScroll " scrollLoadGames() " } button { area 712 646 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(4 + loadSaveOffset) and gameSaves.files[4 + loadSaveOffset] ~= nil" text "DELETE_BUTTON" text style "button" action " popup2Button(15305, 'DELETE_BUTTON', function() loadScreen:DeleteGame(gameSaves.files[4 + loadSaveOffset].slotIndex) end) " actionScroll " scrollLoadGames() " } button { area 634 710 302 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "CANCEL_BUTTON" text style "button" on escape action " loadScreen:OnMainCancelButtonClick() " actionScroll " scrollLoadGames() " } } ` function compareSaves(s1,s2) --return true if s1 comes before s2 --show the most recent saves first return s1.fileTime > s2.fileTime end function sortSaves() table.sort(gameSaves.files,compareSaves) end saveListButtonSequences = {} saveSaveOffset = 0 forceSaveGameScrollbar = false function scrollSaveGames() forceSaveGameScrollbar = true if scrollDirection > 0 then scrollSaveGamesUp() elseif scrollDirection < 0 then scrollSaveGamesDown() end end function scrollSaveGamesUp() if saveSaveOffset > 0 then saveSaveOffset = saveSaveOffset - 1 end end function scrollSaveGamesDown() if saveSaveOffset < (#(gameSaves.files) - 3) then saveSaveOffset = saveSaveOffset + 1 end end function saveGameScrollbarFunction(top, height, contentHeight) if forceSaveGameScrollbar then forceSaveGameScrollbar = false return (saveSaveOffset / (#(gameSaves.files) - 3)) * (height - contentHeight) elseif top ~= 0 and height ~= contentHeight and #(gameSaves.files) ~= 3 then saveSaveOffset = math.floor((top / (height - contentHeight)) * (#(gameSaves.files) - 3)) return nil end end ` menu { name 'SAVE' align center center ignoreEsc onOpen " saveListButtonSequences = {} for k,y in pairs(gameSaves.files) do saveListButtonSequences[k] = getRandomButtonSequence('GUIBUTNT') end " button { area 0 0 1024 768 mosaic GUISRSVB action " currentSave = nil " actionScroll " scrollSaveGames() " } label { area 126 22 766 50 text "SAVE_TITLE" text style "title" } --SAVE 1 label { area 216 284 300 24 enabled "saveFileExists(1 + loadSaveOffset)" text lua "gameSaves.files[1 + saveSaveOffset].slotName" text style "label" align left center } label { area 216 316 300 22 enabled "saveFileExists(1 + loadSaveOffset)" text lua "gameSaves.files[1 + saveSaveOffset].chapter .. ' ' .. gameSaves.files[1 + saveSaveOffset].time" text style "label" align left center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset].hasPortrait0" area 316 352 30 48 bitmap res "gameSaves.files[1 + saveSaveOffset].portrait0" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset].hasPortrait1" area 378 352 30 48 bitmap res "gameSaves.files[1 + saveSaveOffset].portrait1" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset].hasPortrait2" area 440 352 30 48 bitmap res "gameSaves.files[1 + saveSaveOffset].portrait2" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset].hasPortrait3" area 502 352 30 48 bitmap res "gameSaves.files[1 + saveSaveOffset].portrait3" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset].hasPortrait4" area 564 352 30 48 bitmap res "gameSaves.files[1 + saveSaveOffset].portrait4" align center center } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset].hasPortrait5" area 626 352 30 48 bitmap res "gameSaves.files[1 + saveSaveOffset].portrait5" align center center } --SAVE 2 label { area 216 426 300 30 enabled "saveFileExists(2 + loadSaveOffset)" text lua "gameSaves.files[2 + saveSaveOffset].slotName" text style "label" align left center } label { area 216 460 300 26 enabled "saveFileExists(2 + loadSaveOffset)" text lua "gameSaves.files[2 + saveSaveOffset].chapter .. ' ' .. gameSaves.files[2 + saveSaveOffset].time" text style "label" align left center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset].hasPortrait0" area 316 500 30 48 bitmap res "gameSaves.files[2 + saveSaveOffset].portrait0" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset].hasPortrait1" area 378 500 30 48 bitmap res "gameSaves.files[2 + saveSaveOffset].portrait1" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset].hasPortrait2" area 440 500 30 48 bitmap res "gameSaves.files[2 + saveSaveOffset].portrait2" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset].hasPortrait3" area 502 500 30 48 bitmap res "gameSaves.files[2 + saveSaveOffset].portrait3" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset].hasPortrait4" area 564 500 30 48 bitmap res "gameSaves.files[2 + saveSaveOffset].portrait4" align center center } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset].hasPortrait5" area 626 500 30 48 bitmap res "gameSaves.files[2 + saveSaveOffset].portrait5" align center center } --SAVE 3 label { area 216 570 300 26 enabled "saveFileExists(3 + loadSaveOffset)" text lua "gameSaves.files[3 + saveSaveOffset].slotName" text style "label" align left center } label { area 216 606 300 24 enabled "saveFileExists(3 + loadSaveOffset)" text lua "gameSaves.files[3 + saveSaveOffset].chapter .. ' ' .. gameSaves.files[3 + saveSaveOffset].time" text style "label" align left center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset].hasPortrait0" area 316 644 30 48 bitmap res "gameSaves.files[3 + saveSaveOffset].portrait0" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset].hasPortrait1" area 378 644 30 48 bitmap res "gameSaves.files[3 + saveSaveOffset].portrait1" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset].hasPortrait2" area 440 644 30 48 bitmap res "gameSaves.files[3 + saveSaveOffset].portrait2" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset].hasPortrait3" area 502 644 30 48 bitmap res "gameSaves.files[3 + saveSaveOffset].portrait3" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset].hasPortrait4" area 564 644 30 48 bitmap res "gameSaves.files[3 + saveSaveOffset].portrait4" align center center } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset].hasPortrait5" area 626 644 30 48 bitmap res "gameSaves.files[3 + saveSaveOffset].portrait5" align center center } list { column { width 100 label { area 0 0 1 1 } } area 4 268 954 442 rowheight 145 table "gameSaves.files" hidehighlight var currentSave scrollbar 'GUISCRC' scrollbar func "saveGameScrollbarFunction" scrollbar respectConstraints } button { enabled "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset].hasScreenShot" area 26 276 164 132 bitmap res "gameSaves.files[1 + saveSaveOffset].screenshot" align center center actionScroll " scrollSaveGames() " actionDbl " Infinity_PlaySound('GAM_09') currentSave = 1 + saveSaveOffset Infinity_PushMenu( 'SAVE_NEWSAVE' ); " } button { enabled "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset].hasScreenShot" area 26 422 164 132 bitmap res "gameSaves.files[2 + saveSaveOffset].screenshot" align center center actionScroll " scrollSaveGames() " actionDbl " Infinity_PlaySound('GAM_09') currentSave = 2 + saveSaveOffset Infinity_PushMenu( 'SAVE_NEWSAVE' ); " } button { enabled "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset].hasScreenShot" area 26 566 164 132 bitmap res "gameSaves.files[3 + saveSaveOffset].screenshot" align center center actionScroll " scrollSaveGames() " actionDbl " Infinity_PlaySound('GAM_09') currentSave = 3 + saveSaveOffset Infinity_PushMenu( 'SAVE_NEWSAVE' ); " } button { area 712 308 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset] ~= nil" text "SAVE_BUTTON" text style "button" action " Infinity_PlaySound('GAM_09') currentSave = 1 + saveSaveOffset Infinity_PushMenu( 'SAVE_NEWSAVE' ); " actionScroll " scrollSaveGames() " } button { area 712 356 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(1 + loadSaveOffset) and gameSaves.files[1 + saveSaveOffset] ~= nil" text "DELETE_BUTTON" text style "button" action " popup2Button(15305, 'DELETE_BUTTON', function() saveScreen:DeleteGame(gameSaves.files[1 + saveSaveOffset].slotIndex) end) " actionScroll " scrollSaveGames() " } button { area 712 452 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset] ~= nil" text "SAVE_BUTTON" text style "button" action " Infinity_PlaySound('GAM_09') currentSave = 2 + saveSaveOffset Infinity_PushMenu( 'SAVE_NEWSAVE' ); " actionScroll " scrollSaveGames() " } button { area 712 502 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(2 + loadSaveOffset) and gameSaves.files[2 + saveSaveOffset] ~= nil" text "DELETE_BUTTON" text style "button" action " popup2Button(15305, 'DELETE_BUTTON', function() saveScreen:DeleteGame(gameSaves.files[2 + saveSaveOffset].slotIndex) end) " actionScroll " scrollSaveGames() " } button { area 712 596 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset] ~= nil" text "SAVE_BUTTON" text style "button" action " Infinity_PlaySound('GAM_09') currentSave = 3 + saveSaveOffset Infinity_PushMenu( 'SAVE_NEWSAVE' ); " actionScroll " scrollSaveGames() " } button { area 712 646 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "saveFileExists(3 + loadSaveOffset) and gameSaves.files[3 + saveSaveOffset] ~= nil" text "DELETE_BUTTON" text style "button" action " popup2Button(15305, 'DELETE_BUTTON', function() saveScreen:DeleteGame(gameSaves.files[3 + saveSaveOffset].slotIndex) end) " actionScroll " scrollSaveGames() " } label { area 212 138 470 30 text 'NEW_SAVE_LABEL' text style "label" text align left center actionScroll " scrollSaveGames() " } button { area 712 164 204 48 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "SAVE_BUTTON" text style "button" action " --saveScreen:SaveGame(#saveFiles, 'Test Save ' .. #saveFiles) currentSave = 0 Infinity_PushMenu( 'SAVE_NEWSAVE' ); " actionScroll " scrollSaveGames() " } button { area 712 212 204 48 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DELETE_BUTTON" text style "button" clickable lua "false" actionScroll " scrollSaveGames() " } button { area 634 710 302 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "CANCEL_BUTTON" text style "button" on escape action " saveScreen:OnMainCancelButtonClick() " actionScroll " scrollSaveGames() " } } ` newSaveName = '' function completeSave() Infinity_PopMenu('SAVE_NEWSAVE') saveScreen:SaveGame(#gameSaves.files, newSaveName) end function completeOverwrite() Infinity_PopMenu('SAVE_NEWSAVE') saveScreen:SaveGame(gameSaves.files[currentSave].slotIndex,newSaveName) end ` menu { name 'SAVE_NEWSAVE' align center center modal onOpen " bitmapbools = { hasScreenShot = 0, hasPortrait0 = 0, hasPortrait1 = 0, hasPortrait2 = 0, hasPortrait3 = 0, hasPortrait4 = 0, hasPortrait5 = 0, } newSaveName = '' if currentSave ~= 0 then newSaveName = gameSaves.files[currentSave].slotName bitmapbools = { hasScreenShot = gameSaves.files[currentSave].hasScreenShot, hasPortrait0 = gameSaves.files[currentSave].hasPortrait0, hasPortrait1 = gameSaves.files[currentSave].hasPortrait1, hasPortrait2 = gameSaves.files[currentSave].hasPortrait2, hasPortrait3 = gameSaves.files[currentSave].hasPortrait3, hasPortrait4 = gameSaves.files[currentSave].hasPortrait4, hasPortrait5 = gameSaves.files[currentSave].hasPortrait5, } end Infinity_FocusTextEdit('newSaveNameArea') " label { area 0 0 786 341 mosaic GUISRRQB } label { area 50 20 714 30 text "ENTER_SAVE_LABEL" text style "label" text align left center } edit { name "newSaveNameArea" area 256 76 472 22 var newSaveName text style "edit" maxlines 1 fill 112 111 111 64 action " --On return pressed if (key_pressed == 13) then Infinity_FocusTextEdit('') if(currentSave ~= 0) then completeOverwrite() else completeSave() end return -1 end return 1 " } label { area 252 110 476 20 text lua "gameSaves.currentGameInfo.chapter .. ' ' .. gameSaves.currentGameInfo.time" text style "label" text align left center } button { enabled "bitmapbools.hasScreenShot" area 66 72 162 142 bitmap res "gameSaves.files[currentSave].screenshot" align center center } button { enabled "bitmapbools.hasPortrait0" area 356 150 30 48 bitmap res "gameSaves.files[currentSave].portrait0" align center center } button { enabled "bitmapbools.hasPortrait1" area 418 150 30 48 bitmap res "gameSaves.files[currentSave].portrait1" align center center } button { enabled "bitmapbools.hasPortrait2" area 482 150 30 48 bitmap res "gameSaves.files[currentSave].portrait2" align center center } button { enabled "bitmapbools.hasPortrait3" area 544 150 30 48 bitmap res "gameSaves.files[currentSave].portrait3" align center center } button { enabled "bitmapbools.hasPortrait4" area 608 150 30 48 bitmap res "gameSaves.files[currentSave].portrait4" align center center } button { enabled "bitmapbools.hasPortrait5" area 670 150 30 48 bitmap res "gameSaves.files[currentSave].portrait5" align center center } button { area 524 288 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "SAVE_BUTTON" text style "button" action " completeSave() " } button { enabled currentSave area 524 288 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "OVERWRITE_BUTTON" text style "button" action " completeOverwrite() " } button { area 248 288 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" action " Infinity_PopMenu('SAVE_NEWSAVE') " } } ` worldMessageBoxText = "" worldMessageBoxLines = 0 worldMessageBoxClickedOnce = 0 function dragMessagesY(newY) setMessagesY(newY) worldMessageBoxClickedOnce = 1 end function clampMessageBoxHeight(hNew, hOld) if(hNew <= 64) then --lower bound on height, sliced rects can't get too small and we don't want to make the message box invisible. return hOld - 64 end if(hNew >= 500) then --also don't go too high because it looks bad. return hOld - 500 end return hOld - hNew end function setMessagesY(newY) local x,y,w,hOld = Infinity_GetArea('messagesRect') h = hOld - newY newY = clampMessageBoxHeight(h,hOld) adjustItemGroup({"messagesHandleY"},0,newY,0,0) adjustItemGroup({"messagesRect","worldMessageBox"},0,newY,0,-newY) toolbarTop = toolbarTop - newY Infinity_SetOffset('WORLD_QUICKLOOT',0, -toolbarTop) chatboxScrollToBottom = 1 worldMessageBoxTop = y + newY end ` menu { name 'WORLD_MESSAGES' align center bottom ignoreEsc onOpen " Infinity_SetOffset('WORLD_MESSAGES', 0, -toolbarTop) local x,y,w,h = Infinity_GetArea('messagesRect') toolbarTop = toolbarTop + h setMessagesY(worldMessageBoxTop - y) " onClose " local x,y,w,h = Infinity_GetArea('messagesRect') toolbarTop = toolbarTop - h " label { name 'messagesRect' area 0 143 863 110 rectangle 4 } button { area 28 152 816 85 on pageup action " dragMessagesY(-20) " } button { area 28 152 816 85 on pagedown action " dragMessagesY(20) " } list { column { width 100 label { area 0 0 810 -1 text lua "combatLog[rowNumber]" text style "gamelog" } } name "worldMessageBox" area 28 167 816 70 rowheight dynamic table "combatLog" hideHighlight scrollbar 'GUISCRC' scrollbar func "chatboxScroll" scrollbar skipReset } handle { name 'messagesHandleY' area 0 143 863 22 pulse lua "worldMessageBoxClickedOnce == 0" actionDrag " dragMessagesY(motionY) " } } ` worldNPCDialogText = "" worldPlayerDialogChoices = {} glowTest = nil startingDialogHeight = 0 function dialogEntryGreyed() return not worldScreen:GetInControlOfDialog() end function getDesiredDialogHeight() --get npc area local npcX,npcY,npcW,npcH = Infinity_GetArea('worldNPCDialog') --get dialog choices height local choicesHeight = Infinity_GetListHeight('worldPlayerDialogChoicesList') return (20 + choicesHeight + npcH + 20) end function getCurrentDialogHeight() local x,y,w,contentHeight = Infinity_GetArea('worldDialogBackground') if(showWorldMessages == 1) then --Don't include the height of the message log (and its offset) if its active local xM,yM,wM,hM = Infinity_GetArea('worldDialogMessageBox') local xD,yD,wD,hD = Infinity_GetArea('worldDialogMessageDivider') contentHeight = contentHeight - (yD - y) end return contentHeight end function resizeDialog() buildResponsesList() --fit the npc text area to the text height. Infinity_ScaleToText("worldNPCDialog") --get npc area local npcX,npcY,npcW,npcH = Infinity_GetArea('worldNPCDialog') if(npcH > 150) then --limit the npc text height to 150 npcH = 150 Infinity_SetArea('worldNPCDialog',nil,nil,nil,npcH) end --Get available height to work in local contentHeight = getCurrentDialogHeight() local desiredHeight = getDesiredDialogHeight() --make enough room for the choices and dialog if(contentHeight < desiredHeight) then resizeDialogContent(contentHeight - desiredHeight) else local xD,yD,wD,hD = Infinity_GetArea('worldDialogMessageDivider') --resize the choices list based on the dialog height cH = contentHeight - npcH - (npcY - yD) - 32 cY = npcY + npcH + 16 if cH > 50 then --set the new list area. Infinity_SetArea('worldPlayerDialogChoicesList',nil,cY,nil,cH) else local heightDifference = 50 - cH cY = cY - heightDifference cH = cH + heightDifference Infinity_SetArea('worldPlayerDialogChoicesList',nil,cY,nil,cH) npcH = npcH - heightDifference Infinity_SetArea('worldNPCDialog',nil,nil,nil,npcH) end end end function resizeDialogContent(newY) local x,y,w,hOld = Infinity_GetArea('worldDialogBackground') local h = hOld - newY local contentHeight = getCurrentDialogHeight() - newY if(contentHeight <= 150) then --lower bound on height, should leave plenty of room for portrait. -- also don't push our toolbar top out of view. return end if(contentHeight >= 500) then -- upper bound as well because too high looks bad. return end y = y + newY Infinity_SetArea('worldDialogBackground',x,y,w,h) adjustItemGroup({'dialogHandleY', 'worldNPCDialog', 'worldDialogShowMessagesButton', 'worldDialogPortraitArea','worldDialogMessageBox','worldDialogMessageDivider'},0,newY,0,0) toolbarTop = toolbarTop - newY resizeDialog() end function dragDialogMessagesY(newY) local x,y,w,hOld = Infinity_GetArea('worldDialogMessageBox') local h = hOld - newY newY = clampMessageBoxHeight(h,hOld) --different behavior if the message log is visible. adjustItemGroup({'dialogHandleY','worldDialogShowMessagesButton'},0,newY,0,0) adjustItemGroup({'worldDialogBackground','worldDialogMessageBox'},0,newY,0,-newY) toolbarTop = toolbarTop - newY return end function showMessagesButtonFrame() if(showWorldMessages == 1) then return 1 else return 0 end end function toggleDialogShowMessages() if(showWorldMessages == 1) then showWorldMessages = 0 else showWorldMessages = 1 end local xM,yM,wM,hM = Infinity_GetArea('worldDialogMessageBox') local xD,yD,wD,hD = Infinity_GetArea('worldDialogMessageDivider') local xB,yB,wB,hB = Infinity_GetArea('worldDialogBackground') local bgAdjust if(showWorldMessages == 1) then Infinity_SetArea('worldDialogMessageBox',nil,yB - hM - hD + 8,nil,nil) Infinity_SetArea('worldDialogMessageDivider',nil,yB,nil,nil) bgAdjust = hM + 16 + hD else bgAdjust = -hM - 16 - hD end adjustItemGroup({'worldDialogBackground'},0,-bgAdjust,0,bgAdjust) adjustItemGroup({'dialogHandleY','worldDialogShowMessagesButton'}, 0, -bgAdjust, 0, 0) toolbarTop = toolbarTop - bgAdjust end function getDialogEntryText(row) local text = worldPlayerDialogChoices[row].text if (row == worldPlayerDialogSelection) then --Color the text white when selected text = string.gsub(text, "%^0xff212eff", "^0xFFFFFFFF") end return text end ` menu { name 'WORLD_DIALOG' offset 0 -57 align center bottom ignoreEsc onOpen " local x,y,w,h = Infinity_GetArea('worldDialogBackground') toolbarTop = toolbarTop + h Infinity_PushMenu('WORLD_DIALOG_CONFIRM') if(isTouchActionbar() and not dialogViewMode) then Infinity_PushMenu('WORLD_DIALOG_LEFT') Infinity_PushMenu('WORLD_DIALOG_RIGHT') end greySidebars() " onClose " local x,y,w,h = Infinity_GetArea('worldDialogBackground') toolbarTop = toolbarTop - h resizeDialogContent(h - 253) Infinity_PopMenu('WORLD_DIALOG_CONFIRM') Infinity_PopMenu('WORLD_DIALOG_LEFT') Infinity_PopMenu('WORLD_DIALOG_RIGHT') ungreySidebars() " label { name "worldDialogBackground" area 0 0 863 253 rectangle 4 } button { enabled "showWorldMessages" area 28 152 816 85 on pageup action " local x,y,w,h = Infinity_GetArea('worldDialogBackground') dragDialogMessagesY(-20) " } button { enabled "showWorldMessages" area 28 152 816 85 on pagedown action " local x,y,w,h = Infinity_GetArea('worldDialogBackground') dragDialogMessagesY(20) " } label { name "worldDialogPortraitArea" area 22 22 54 84 bitmap lua "worldNPCDialogPortrait" } text { name "worldNPCDialog" area 84 22 749 16 text lua "worldNPCDialogText" text style "gamelog" scrollbar 'GUISCRC' } text { name "worldDialogMessageBox" enabled "showWorldMessages" area 20 -124 813 124 text lua "worldMessageBoxText" text style "gamelog" scrollbar 'GUISCRC' scrollbar func "chatboxScroll" } handle { enabled "showWorldMessages" name "dialogHandleY" area 0 0 863 32 actionDrag " dragDialogMessagesY(motionY) " } text { name "worldDialogShowMessagesButton" area 754 16 62 28 tooltip lua "t('LOG_HISTORY_TOOLTIP')" bam "CHATHIST" frame lua "showMessagesButtonFrame()" action " toggleDialogShowMessages() " } text { name "worldDialogMessageDivider" enabled "showWorldMessages" area 33 0 800 8 mosaic "DLGDIVI" } list { column { width 100 label { area 0 0 -1 -1 enabled "dialogEntryGreyed()" rectangle 1 rectangle opacity 100 } text { area 0 0 -1 -1 text lua "getDialogEntryText(rowNumber)" text style "gamelog" } } name "worldPlayerDialogChoicesList" area 84 54 749 183 rowheight dynamic hideHighlight table "worldPlayerDialogChoices" var "worldPlayerDialogSelection" scrollbar 'GUISCRC' actionEnter " if(gameOptions.m_bConfirmDialog == true) then return end glowTest = mouseoverRow worldPlayerDialogSelection = mouseoverRow " actionExit " if(gameOptions.m_bConfirmDialog == true) then return end glowTest = nil worldPlayerDialogSelection = 0 " action " --In confirm mode, just highlight the choice. if(gameOptions.m_bConfirmDialog == true) then return end worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker) worldPlayerDialogSelection = 0 " } } ` function getDialogButtonEnabled() if(gameOptions.m_bConfirmDialog == true) then return true else return (#worldPlayerDialogChoices == 0) end end function getDialogButtonClickable() if(gameOptions.m_bConfirmDialog == true) then return (#worldPlayerDialogChoices == 0) or (worldPlayerDialogSelection and worldPlayerDialogSelection > 0) --no choices, or we've selected a choice. else return true end end ` menu { name 'WORLD_DIALOG_CONFIRM' align center bottom ignoreEsc button { area 0 0 302 45 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "dialogButtonText" enabled "getDialogButtonEnabled()" clickable lua "getDialogButtonClickable()" text style "button" action " if(gameOptions.m_bConfirmDialog == true and (#worldPlayerDialogChoices > 0)) then -- if confirm dialog and choices available. worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker) worldPlayerDialogSelection = 0 else -- no choices, just step. worldScreen:StepDialog() end " } } menu { name 'CHARACTER_SELECT' align center center onopen "selectedCharacter = 0" ignoreesc label { mosaic GUIMPB area 0 154 1024 614 } label { area 32 172 966 50 text "IMPORT_TITLE" text style "title" } list { column { width 8 label { area 0 0 0 100 } label { area 10 8 54 84 bitmap lua "character_select[rowNumber].portrait" } } column { width 92 label { area 20 4 -1 -1 text lua "character_select[rowNumber].name .. '\n' .. character_select[rowNumber].desc" text style "label" text align left top } } area 24 244 964 360 rowheight dynamic table "character_select" var selectedCharacter scrollbar GUISCRC } button { on escape area 194 718 232 44 bam GUIOSTUL text "BACK_BUTTON" text style "button" action "Infinity_PopMenu('CHARACTER_SELECT');" } button { area 650 718 238 44 text "DONE_BUTTON" text style "button" bam GUIOSTUR clickable lua "selectedCharacter ~= 0" action " createCharScreen:OnPrerollCharacterPick(character_select[selectedCharacter].id) Infinity_PopMenu('CHARACTER_SELECT') " } } ` chargen = { races = {}, kits = {}, } function chargenAcceptOrExport() if createCharScreen:GetEngineState() == 4 then return t("EXPORT_BUTTON") else return t("ACCEPT_BUTTON") end end function isChargenBackButtonClickable() local ret = createCharScreen:IsMainBackButtonClickable() if createCharScreen:GetCurrentStep() < 1 then ret = false end return ret end ` menu { name 'CHARGEN' align center center ignoreesc label { area 0 0 1024 768 mosaic 'GUICGB' } label { area 64 16 898 44 text "CHARGEN_TITLE" text style "title" } text { area 426 171 296 429 text lua "chargen.information" scrollbar 'GUISCRC' text style "normal" text color 'D' } label { area 775 171 210 330 bitmap lua "chargen.portrait" } button { area 36 176 346 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 0" glow lua "createCharScreen:GetCurrentStep() == 0" text "GENDER_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 36 206 340 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 3" glow lua "createCharScreen:GetCurrentStep() == 3" text "RACE_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 36 236 340 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 4" glow lua "createCharScreen:GetCurrentStep() == 4" text "CLASS_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 36 266 340 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 7" glow lua "createCharScreen:GetCurrentStep() == 7" text "ALIGNMENT_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 36 296 340 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 8" glow lua "createCharScreen:GetCurrentStep() == 8" text "ABILITIES_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 36 326 340 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 9" glow lua "createCharScreen:GetCurrentStep() == 9" text "SKILLS_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 36 356 340 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 15" glow lua "createCharScreen:GetCurrentStep() == 15" text "APPEARANCE_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 36 386 340 30 bam GUIBUTWS sequenceonce lua "getRandomButtonSequence('GUIBUTWS')" clickable lua "createCharScreen:GetCurrentStep() == 17" glow lua "createCharScreen:GetCurrentStep() == 17" text "NAME_BUTTON" text style "button" action "createCharScreen:OnMenuButtonClick()" } button { area 781 518 204 44 text "IMPORT_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" action "createCharScreen:OnImportCharacterButtonClick()" } button { area 781 622 204 44 text lua "Infinity_FetchString(8159)" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" enabled "createCharScreen:GetCurrentStep() >= 1" clickable lua "createCharScreen:IsMainBackButtonClickable()" action "createCharScreen:OnMainCancelButtonClick()" } button { area 781 622 204 44 text "CANCEL_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" enabled "createCharScreen:GetCurrentStep() == 0" clickable lua "createCharScreen:IsMainBackButtonClickable()" action "createCharScreen:OnMainCancelButtonClick()" } button { area 781 570 204 44 text "BIOGRAPHY_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" clickable lua "createCharScreen:GetCurrentStep() >= 17" action "createCharScreen:OnBiographyButtonClick()" } button { on escape area 276 690 232 44 text "BACK_BUTTON" text style "button" bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" clickable lua "isChargenBackButtonClickable()" action "createCharScreen:OnMainBackButtonClick()" } button { on escape area 781 622 204 44 text "CANCEL_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" enabled "not createCharScreen:IsMainBackButtonClickable()" action "createCharScreen:OnMainCancelButtonClick()" } button { area 520 690 232 44 text lua "chargenAcceptOrExport()" text style "button" bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" clickable lua "createCharScreen:IsChargenComplete()" action "createCharScreen:AcceptCharacter(-1)" } } ` createCharGenderHelp = 17236 ` menu { name 'CHARGEN_GENDER' align center center ignoreesc modal onOpen " toggleMale = 0 toggleFemale = 0 createCharGenderHelp = 17236 Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 539 668 mosaic 'GUICGGEN' } label { area 8 18 522 44 text "GENDER_TITLE" text style "title" } label { area 26 386 488 178 text lua "Infinity_FetchString(createCharGenderHelp)" text style "normal" text color 'D' } button { area 74 140 190 168 bam GUIGEND1 sequence 0 toggle toggleMale action "toggleFemale = 0; createCharScreen:OnGenderSelectButtonClick(1)" } button { area 280 140 188 168 bam GUIGEND1 sequence 1 toggle toggleFemale action "toggleMale = 0; createCharScreen:OnGenderSelectButtonClick(2)" } button { on escape area 70 596 202 44 text "BACK_BUTTON" text style "button" bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 286 596 204 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } menu { name 'CHARGEN_PORTRAIT' align center center ignoreesc modal onOpen " Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 539 668 mosaic 'GUICGAPP' } label { area 12 20 508 44 text "APPEARANCE_TITLE" text style "title" } button { area 106 216 52 132 bam GUIPRC sequence 0 action "createCharScreen:DecCurrentPortrait()" } button { area 388 216 52 132 bam GUIPRC sequence 1 action "createCharScreen:IncCurrentPortrait()" } label { area 170 148 212 330 bitmap lua "createCharScreen:GetCurrentPortrait()" } button { on escape area 36 610 232 44 text "BACK_BUTTON" text style "button" bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" action " Infinity_PopMenu() if e:GetActiveEngine() == createCharScreen then createCharScreen:OnCancelButtonClick() end " } button { on return area 278 610 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` function raceOrGeneralHelp() race = chargen.races[currentChargenRace] if race then return Infinity_FetchString(race.desc) else return Infinity_FetchString(17237) end end function getRaceHighlightFrame(index) local ret = 0 if index == currentChargenRace then ret = 2 elseif index == currentChargenRace then --need a button down test ret = 1 end return ret end raceButtonSequences = {} ` menu { name 'CHARGEN_RACE' align center center ignoreesc modal onopen " currentChargenRace = nil raceButtonSequences = {} for k,v in pairs(chargen.races) do raceButtonSequences[k] = getRandomButtonSequence('GUIBUTWS') end Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 870 714 mosaic 'GUICGWDE' } label { area 48 38 768 44 text "RACE_TITLE" text style "title" } list { column { width 100 label { area 0 0 360 34 text lua "Infinity_FetchString(chargen.races[rowNumber].name)" text style "list" pad 8 0 0 0 text lower text align center center bam "GUIBUTWS" sequenceonce lua "raceButtonSequences[rowNumber]" frame lua "getRaceHighlightFrame(rowNumber)" } } action " if chargen.races[currentChargenRace] then Infinity_PlaySound('GAM_09') createCharScreen:OnRaceSelectButtonClick(chargen.races[currentChargenRace].id) end " rowheight 34 area 22 90 360 500 table "chargen.races" var currentChargenRace hideHighlight scrollbar 'GUISCRC' } text { area 376 94 468 498 text lua "raceOrGeneralHelp()" text style "normal" text color 'D' scrollbar 'GUISCRC' } button { on escape area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` function classOrGeneralHelp() class = chargen.class[currentChargenClass] if class then return Infinity_FetchString(class.desc) else --only bit that may need to change for dual class! :) return Infinity_FetchString(17242) end end function getClassHighlightFrame(index) local ret = 0 if index == currentChargenClass then ret = 2 elseif index == currentChargenClass then --need a button down test ret = 1 end return ret end classButtonSequences = {} ` menu { name 'CHARGEN_CLASS' align center center ignoreesc modal onopen " currentChargenClass = nil classButtonSequences = {} for k,v in pairs(chargen.class) do classButtonSequences[k] = getRandomButtonSequence('GUIBUTWS') end Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 870 714 mosaic 'GUICGWDE' } label { area 48 38 768 44 text "CLASS_TITLE" text style "title" } list { column { width 100 label { area 0 0 360 32 text lua "Infinity_FetchString(chargen.class[rowNumber].name)" text style "list" pad 8 0 0 0 text lower text align center center bam "GUIBUTWS" sequenceonce lua "classButtonSequences[rowNumber]" frame lua "getClassHighlightFrame(rowNumber)" } } action " if chargen.class[currentChargenClass] then Infinity_PlaySound('GAM_09') createCharScreen:OnClassSelectButtonClick(chargen.class[currentChargenClass].id) end " rowheight 32 area 22 90 352 500 table "chargen.class" var currentChargenClass scrollbar 'GUISCRC' hideHighlight } text { area 376 94 468 498 text lua "classOrGeneralHelp()" text style "normal" text color 'D' scrollbar 'GUISCRC' } button { on escape area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" clickable lua "createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS" action "createCharScreen:OnCancelButtonClick(); Infinity_PopMenu('CHARGEN_CLASS');" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "createCharScreen:OnDoneButtonClick(); Infinity_PopMenu('CHARGEN_CLASS'); " } } ` function kitOrGeneralHelp() kit = chargen.kit[currentChargenKit] if kit then return Infinity_FetchString(kit.desc) else return Infinity_FetchString(17242) end end function getKitHighlightFrame(index) local ret = 0 if index == currentChargenKit then ret = 2 elseif index == currentChargenKit then --need a button down test ret = 1 end return ret end kitButtonSequences = {} ` menu { name 'CHARGEN_KIT' align center center ignoreesc modal onOpen " kitButtonSequences = {} for k,v in pairs(chargen.kit) do kitButtonSequences[k] = getRandomButtonSequence('GUIBUTWS') end Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 870 714 mosaic 'GUICGWDE' } label { area 48 38 768 44 text "CLASS_KIT_TITLE" text style "title" } list { column { width 100 label { area 0 0 360 32 text lua "Infinity_FetchString(chargen.kit[rowNumber].name)" text style "list" pad 8 0 0 0 text lower text align center center bam "GUIBUTWS" sequenceonce lua "kitButtonSequences[rowNumber]" frame lua "getKitHighlightFrame(rowNumber)" } } action " if chargen.kit[currentChargenKit] then Infinity_PlaySound('GAM_09') createCharScreen:OnKitSelectButtonClick(chargen.kit[currentChargenKit].id) end " rowheight 32 area 22 90 360 500 table "chargen.kit" var currentChargenKit scrollbar 'GUISCRC' hideHighlight } text { area 376 94 468 498 text lua "kitOrGeneralHelp()" text style "normal" text color 'D' scrollbar 'GUISCRC' } button { on escape area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` function alignmentOrGeneralHelp() alignment = chargen.alignment[currentChargenAlignment] if alignment then return Infinity_FetchString(alignment.desc) else return Infinity_FetchString(9602) end end function getAlignmentHighlightFrame(index) local ret = 0 if index == currentChargenAlignment then ret = 2 elseif index == currentChargenAlignment then --need a button down test ret = 1 end return ret end alignmentButtonSequences = {} ` menu { name 'CHARGEN_ALIGNMENT' align center center ignoreesc modal onopen " currentChargenAlignment = nil alignmentButtonSequences = {} for k,v in pairs(chargen.alignment) do alignmentButtonSequences[k] = getRandomButtonSequence('GUIBUTWS') end Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 870 714 mosaic 'GUICGWDE' } label { area 48 38 768 44 text "ALIGNMENT_TITLE" text style "title" } list { column { width 100 label { area 0 0 360 32 text lua "Infinity_FetchString(chargen.alignment[rowNumber].name)" text style "list" pad 8 0 0 0 text lower text align center center bam "GUIBUTWS" sequenceonce lua "alignmentButtonSequences[rowNumber]" frame lua "getAlignmentHighlightFrame(rowNumber)" } } action " if chargen.alignment[currentChargenAlignment] then Infinity_PlaySound('GAM_09') createCharScreen:OnAlignmentSelectButtonClick(chargen.alignment[currentChargenAlignment].id) end " rowheight 32 area 22 90 360 500 table "chargen.alignment" var currentChargenAlignment scrollbar 'GUISCRC' hideHighlight } text { area 376 94 468 498 text lua "alignmentOrGeneralHelp()" text style "normal" text color 'D' scrollbar 'GUISCRC' } button { on escape area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` chargen.ability = { {name = 'STRENGTH_LABEL', desc = 9582}, {name = 'DEXTERITY_LABEL', desc = 9584}, {name = 'CONSTITUTION_LABEL', desc = 9583}, {name = 'INTELLIGENCE_LABEL', desc = 9585}, {name = 'WISDOM_LABEL', desc = 9586}, {name = 'CHARISMA_LABEL', desc = 9587}, } function abilityOrGeneralHelp() ability = chargen.ability[currentChargenAbility] if ability and ability.desc ~= -1 then createCharScreen:SetAbilityHelpInfo(currentChargenAbility) return Infinity_FetchString(ability.desc) else return Infinity_FetchString(17247) end end function abilityPlusMinusPressed(ability, plus) if ticksStarting < 10 then createCharScreen:OnAbilityPlusMinusButtonClick(ability, plus) end ticksPassed = 0 ticksStarting = 0 end function abilityPlusMinusHeld(ability, plus) ticksStarting = ticksStarting + 1 if ticksStarting > 10 then ticksPassed = ticksPassed + 1 if ticksPassed > 7 then createCharScreen:OnAbilityPlusMinusButtonClick(ability, plus) ticksPassed = 0 end end end ` menu { name 'CHARGEN_ABILITIES' align center center ignoreesc modal onopen " currentChargenAbility = 0 ticksPassed = 0 ticksStarting = 0 Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 2 870 714 mosaic 'GUICGROL' } label { area 216 26 434 42 text "ABILITIES_TITLE" text style "title" } --Strength label { area 22 90 204 43 text lua "t(chargen.ability[1].name)" text style "normal" align right center } label { area 246 90 44 43 text lua "chargen.ability[1].roll" text style "normal" align center center } button { area 22 90 268 43 action " currentChargenAbility = 1 " } button { area 324 90 42 42 bam GUIOSW sequence 0 action " currentChargenAbility = 1 abilityPlusMinusPressed(1,true) " actionHold " currentChargenAbility = 1 abilityPlusMinusHeld(1,true) " } button { area 372 90 42 42 bam GUIOSW sequence 1 action " currentChargenAbility = 1 abilityPlusMinusPressed(1,false) " actionHold " currentChargenAbility = 1 abilityPlusMinusHeld(1,false) " } --Dexterity label { area 22 142 204 48 text lua "t(chargen.ability[2].name)" text style "normal" align right center } label { area 246 142 44 48 text lua "chargen.ability[2].roll" text style "normal" align center center } button { area 22 142 268 43 action " currentChargenAbility = 2 " } button { area 324 145 42 42 bam GUIOSW sequence 0 action " currentChargenAbility = 2 abilityPlusMinusPressed(2,true) " actionHold " currentChargenAbility = 2 abilityPlusMinusHeld(2,true) " } button { area 372 145 42 42 bam GUIOSW sequence 1 action " currentChargenAbility = 2 abilityPlusMinusPressed(2,false) " actionHold " currentChargenAbility = 2 abilityPlusMinusHeld(2,false) " } --Constitution label { area 22 196 204 50 text lua "t(chargen.ability[3].name)" text style "normal" align right center } label { area 246 196 44 50 text lua "chargen.ability[3].roll" text style "normal" align center center } button { area 22 196 268 43 action " currentChargenAbility = 3 " } button { area 324 200 42 42 bam GUIOSW sequence 0 action " currentChargenAbility = 3 abilityPlusMinusPressed(3,true) " actionHold " currentChargenAbility = 3 abilityPlusMinusHeld(3,true) " } button { area 372 200 42 42 bam GUIOSW sequence 1 action " currentChargenAbility = 3 abilityPlusMinusPressed(3,false) " actionHold " currentChargenAbility = 3 abilityPlusMinusHeld(3,false) " } --Intelligence label { area 22 256 204 48 text lua "t(chargen.ability[4].name)" text style "normal" align right center } label { area 246 256 44 48 text lua "chargen.ability[4].roll" text style "normal" align center center } button { area 22 256 268 43 action " currentChargenAbility = 4 " } button { area 324 259 42 42 bam GUIOSW sequence 0 action " currentChargenAbility = 4 abilityPlusMinusPressed(4,true) " actionHold " currentChargenAbility = 4 abilityPlusMinusHeld(4,true) " } button { area 372 259 42 42 bam GUIOSW sequence 1 action " currentChargenAbility = 4 abilityPlusMinusPressed(4,false) " actionHold " currentChargenAbility = 4 abilityPlusMinusHeld(4,false) " } --Wisdom label { area 22 314 204 44 text lua "t(chargen.ability[5].name)" text style "normal" align right center } label { area 246 314 44 44 text lua "chargen.ability[5].roll" text style "normal" align center center } button { area 22 314 268 43 action " currentChargenAbility = 5 " } button { area 324 315 42 42 bam GUIOSW sequence 0 action " currentChargenAbility = 5 abilityPlusMinusPressed(5,true) " actionHold " currentChargenAbility = 5 abilityPlusMinusHeld(5,true) " } button { area 372 315 42 42 bam GUIOSW sequence 1 action " currentChargenAbility = 5 abilityPlusMinusPressed(5,false) " actionHold " currentChargenAbility = 5 abilityPlusMinusHeld(5,false) " } --Charisma label { area 22 366 204 42 text lua "t(chargen.ability[6].name)" text style "normal" align right center } label { area 246 366 44 42 text lua "chargen.ability[6].roll" text style "normal" align center center } button { area 22 366 268 43 action " currentChargenAbility = 6 " } button { area 324 366 42 42 bam GUIOSW sequence 0 action " currentChargenAbility = 6 abilityPlusMinusPressed(6,true) " actionHold " currentChargenAbility = 6 abilityPlusMinusHeld(6,true) " } button { area 372 366 42 42 bam GUIOSW sequence 1 action " currentChargenAbility = 6 abilityPlusMinusPressed(6,false) " actionHold " currentChargenAbility = 6 abilityPlusMinusHeld(6,false) " } label { area 30 414 200 42 text "TOTAL_ROLL_NORMAL" text style "normal" text align right center } label { area 246 414 50 42 text lua "chargen.totalRoll" text style "normal" text align center center } label { area 316 414 106 50 text lua "chargen.extraAbilityPoints" text style "normal" text align center center } text { area 446 94 396 510 text lua "abilityOrGeneralHelp()" text style "normal" text color 'D' scrollbar 'GUISCRC' } button { area 26 482 204 46 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "REROLL_BUTTON" text style "button" action "createCharScreen:OnAbilityReRollButtonClick()" } button { area 26 534 204 46 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "STORE_BUTTON" text style "button" action "createCharScreen:OnAbilityStoreButtonClick()" } button { area 26 584 204 46 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "RECALL_BUTTON" text style "button" clickable lua "createCharScreen:IsAbilityRecallButtonClickable()" action "createCharScreen:OnAbilityRecallButtonClick()" } button { on '8' action "createCharScreen:OnCheatyMcCheaterson()" } button { on escape area 198 656 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 656 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` function proficiencyOrGeneralHelp(fallback) local prof = chargen.proficiency[currentChargenProficiency] local skill = chargen.thief_skill[currentChargenThiefSkill] if prof and prof.desc ~= -1 then return Infinity_FetchString(prof.desc) elseif skill and skill.desc ~= -1 then return Infinity_FetchString(skill.description) else if(chargen.levelingUp) then if(levelUpInfoToggle == 1) then return chargen.charInfo else return chargen.levelInfo end else return Infinity_FetchString(fallback) end end end function getProficienciesTitle() if(chargen.levelingUp) then return t("LEVEL_UP_TITLE") else return t("PROF_SLOTS_LABEL") end end function isChargenProficienciesBackButtonClickable() return ((not chargen.levelingUp) and createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_PROFICIENCIES) end ` menu { name 'CHARGEN_PROFICIENCIES' modal align center center ignoreesc onopen " currentChargenProficiency = nil currentChargenThiefSkill = nil ticksPassed = 0 ticksStarting = 0 Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " modal label { area 0 0 870 714 mosaic GUIPO64D } label { area 46 28 778 54 text lua "getProficienciesTitle()" text style "title" } label { area 42 552 392 44 text 40687 text style "label" text align right center } label { area 452 552 50 44 text lua "chargen.extraProficiencySlots" text style "label" text align center center } list { column { width 53 label { area 0 0 230 55 text lua "Infinity_FetchString(chargen.proficiency[rowNumber].name)" text style "normal" align right center } } column { width 5 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 4" } } column { width 5 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 3" } } column { width 5 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 2" } } column { width 5 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 1" } } column { width 5 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 0" } } column { width 12 label { area 0 6 45 42 bam GUIOSW frame lua "getPlusFrame(7)" sequence 0 align center center } } column { width 10 label { area 0 6 45 42 bam GUIOSW sequence 1 frame lua "getMinusFrame(8)" align center center } } action " currentChargenThiefSkill = nil if ticksStarting < 10 then if cellNumber == 7 and plusButtonClickable(currentChargenProficiency) then Infinity_PlaySound('GAM_09') createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, true) elseif cellNumber == 8 and minusButtonClickable(currentChargenProficiency) then Infinity_PlaySound('GAM_09') createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, false) end end cellNumber = nil ticksPassed = 0 ticksStarting = 0 " actionUpdate " currentChargenThiefSkill = nil ticksStarting = ticksStarting + 1 if ticksStarting > 10 then ticksPassed = ticksPassed + 1 if ticksPassed > 7 then if cellNumber == 7 and plusButtonClickable(currentChargenProficiency) then createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, true) elseif cellNumber == 8 and minusButtonClickable(currentChargenProficiency) then createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, false) end ticksPassed = 0 end end " rowheight 54 area 42 98 460 442 table "chargen.proficiency" var currentChargenProficiency scrollbar 'GUISCRC' hideHighlight } text { area 514 102 314 494 text lua "proficiencyOrGeneralHelp(9588)" text style "normal" text color 'D' scrollbar 'GUISCRC' } button { on escape area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" clickable lua "isChargenProficienciesBackButtonClickable()" action "createCharScreen:OnCancelButtonClick();" } button { on return area 438 652 234 46 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "createCharScreen:OnDoneButtonClick();" } } menu { name 'CHARGEN_SKILLS' modal align center center ignoreesc onopen "currentChargenProficiency = nil; currentChargenThiefSkill = nil; ticksPassed = 0; ticksStarting = 0" modal label { area 0 0 870 714 mosaic GUICGSKL } label { area 216 26 438 40 text 11983 text style "title" } label { area 402 424 106 30 text lua "chargen.extraSkillPoints" text style "label" text align center center } list { column { width 60 label { area 0 0 280 54 text lua "Infinity_FetchString(chargen.thief_skill[rowNumber].name)" text style "normal" text align right center } } column { width 10 label { area 0 0 40 54 text lua "chargen.thief_skill[rowNumber].value" text style "normal" text align center center } } column { width 20 label { area 50 6 45 42 bam GUIOSW enabled "createCharScreen:IsThiefSkillPlusMinusButtonClickable()" frame lua "currentCellCheck(3)" sequence 0 } } column { width 10 label { area 0 6 45 42 bam GUIOSW enabled "createCharScreen:IsThiefSkillPlusMinusButtonClickable()" frame lua "currentCellCheck(4)" sequence 1 } } action " currentChargenProficiency = nil if ticksStarting < 10 then if createCharScreen:IsThiefSkillPlusMinusButtonClickable() then if cellNumber == 3 then Infinity_PlaySound('GAM_09') createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, true) elseif cellNumber == 4 then Infinity_PlaySound('GAM_09') createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, false) end end end cellNumber = nil ticksPassed = 0 ticksStarting = 0 " actionUpdate " currentChargenProficiency = nil if createCharScreen:IsThiefSkillPlusMinusButtonClickable() then ticksStarting = ticksStarting + 1 if ticksStarting > 10 then ticksPassed = ticksPassed + 1 if ticksPassed > 2 then if cellNumber == 3 then createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, true) elseif cellNumber == 4 then createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, false) end ticksPassed = 0 end end end " rowheight 47 area 36 80 486 338 hideHighlight table "chargen.thief_skill" var currentChargenThiefSkill scrollbar 'GUISCRC' } text { area 528 90 312 508 text lua "proficiencyOrGeneralHelp(17248)" text style "normal" scrollbar 'GUISCRC' } button { on escape area 198 654 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" clickable lua "isChargenProficienciesBackButtonClickable()" action "createCharScreen:OnCancelButtonClick();" } button { on return area 440 654 234 46 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "createCharScreen:OnDoneButtonClick();" } } menu { name 'LEVELUP_PROFICIENCIES' modal align center center ignoreesc onopen "currentChargenProficiency = nil; currentChargenThiefSkill = nil; ticksPassed = 0; ticksStarting = 0" label { area 0 0 1024 768 mosaic GUILUPB } label { area 162 16 700 44 text lua "getProficienciesTitle()" text style "title" } label { area 58 172 398 44 text "PROF_SLOTS_LABEL" text style "label" } label { area 460 172 50 44 text lua "chargen.extraProficiencySlots" text style "label" } label { area 326 72 366 42 text lua "characters[currentID].name" text style "label" } label { area 326 120 366 36 text lua "characters[currentID].class" text style "label" } label { area 510 172 398 44 text "SKILLS_LABEL" text style "label" } label { area 900 172 50 44 text lua "chargen.extraSkillPoints" text style "label" } list { column { width 64 label { area 0 0 280 63 text lua "Infinity_FetchString(chargen.proficiency[rowNumber].name)" text style "normal" align right center } } column { width 3 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 4" } } column { width 3 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 3" } } column { width 3 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 2" } } column { width 3 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 1" } } column { width 3 label { bam GUIPFC area 0 19 16 16 align center center enabled "chargen.proficiency[rowNumber].value > 0" } } column { width 10 label { area 0 6 45 45 bam GUIOSW frame lua "getPlusFrame(7)" sequence 0 align center center } } column { width 10 label { area 0 6 45 45 bam GUIOSW sequence 1 frame lua "getMinusFrame(8)" align center center } } action " currentChargenThiefSkill = nil if ticksStarting < 10 then if cellNumber == 7 and plusButtonClickable(currentChargenProficiency) then Infinity_PlaySound('GAM_09') createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, true) elseif cellNumber == 8 and minusButtonClickable(currentChargenProficiency) then Infinity_PlaySound('GAM_09') createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, false) end end cellNumber = nil ticksPassed = 0 ticksStarting = 0 " actionUpdate " currentChargenThiefSkill = nil ticksStarting = ticksStarting + 1 if ticksStarting > 10 then ticksPassed = ticksPassed + 1 if ticksPassed > 7 then if cellNumber == 7 and plusButtonClickable(currentChargenProficiency) then createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, true) elseif cellNumber == 8 and minusButtonClickable(currentChargenProficiency) then createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, false) end ticksPassed = 0 end end " rowheight 63 area 37 248 497 432 table "chargen.proficiency" var currentChargenProficiency scrollbar 'GUISCRC' scrollbar clunkyScroll 63 hideHighlight } list { column { width 55 label { area 0 0 180 54 text lua "Infinity_FetchString(chargen.thief_skill[rowNumber].name)" text style "normal" text align left center } } column { width 15 label { area 0 0 60 54 text lua "chargen.thief_skill[rowNumber].value" text style "normal" text align left center } } column { width 18 label { area 24 6 45 42 bam GUIOSW enabled "createCharScreen:IsThiefSkillPlusMinusButtonClickable()" frame lua "currentCellCheck(3)" sequence 0 } } column { width 12 label { area 0 6 45 42 bam GUIOSW enabled "createCharScreen:IsThiefSkillPlusMinusButtonClickable()" frame lua "currentCellCheck(4)" sequence 1 } } action " currentChargenProficiency = nil if ticksStarting < 10 then if createCharScreen:IsThiefSkillPlusMinusButtonClickable() then if cellNumber == 3 then Infinity_PlaySound('GAM_09') createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, true) elseif cellNumber == 4 then Infinity_PlaySound('GAM_09') createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, false) end end end cellNumber = nil ticksPassed = 0 ticksStarting = 0 " actionUpdate " currentChargenProficiency = nil if createCharScreen:IsThiefSkillPlusMinusButtonClickable() then ticksStarting = ticksStarting + 1 if ticksStarting > 10 then ticksPassed = ticksPassed + 1 if ticksPassed > 2 then if cellNumber == 3 then createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, true) elseif cellNumber == 4 then createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, false) end ticksPassed = 0 end end end " rowheight 54 scrollbar clunkyScroll 54 area 578 262 414 216 table "chargen.thief_skill" var currentChargenThiefSkill scrollbar 'GUISCRC' hideHighlight } text { area 568 484 424 200 text lua "proficiencyOrGeneralHelp()" text style "normal" scrollbar 'GUISCRC' } button { enabled "chargen.levelingUp" area 438 704 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "INFORMATION_BUTTON" text style "button" toggle "levelUpInfoToggle" action " currentChargenProficiency = nil currentChargenThiefSkill = nil " } button { on escape area 37 704 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" clickable lua "isChargenProficienciesBackButtonClickable()" action "createCharScreen:OnCancelButtonClick();" } button { on return area 762 704 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action " Infinity_PopMenu() createCharScreen:OnDoneButtonClick() " } } ` function specialistFrame(num) if spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[num].key].specialist then return 3 end return 0 end function spellLearnOrUnlearnText() if currentChargenChooseMageSpell == nil or not chargen.choose_spell[currentChargenChooseMageSpell].enabled then return t("BUTTON_LEARN") else return t("BUTTON_UNLEARN") end end function spellLearnOrUnlearnClickable() spl = chargen.choose_spell[currentChargenChooseMageSpell] if chargen.extraSpells == 0 and spl ~= nil and spl.enabled == false or spl == nil or spl.known then return false else return true end end function chooseSpellOrGeneralHelp() local helpText = chargen.helpText spl = chargen.choose_spell[currentChargenChooseMageSpell] if spl == nil then return helpText end local desc = spellBook[chargen.currentSpellLevelChoice][spl.key].desc if currentChargenChooseMageSpell and desc ~= -1 then return Infinity_FetchString(desc) else return helpText end end function nextOrDone() if(createCharScreen:HasMoreMageLevels()) then return t('NEXT_BUTTON') else return t('DONE_BUTTON') end end function shouldShowSpecialistMessage() local ret = false if chargen.extraSpells == 0 and not createCharScreen:IsDoneButtonClickable() then ret = true end return ret end ` menu { name 'CHARGEN_CHOOSE_SPELLS' align center center ignoreesc modal onOpen " table.sort(chargen.choose_spell, sortBySpellName) currentChargenChooseMageSpell = nil if currentChargenKit == nil then currentChargenKit = 0 end local currentKitName = '' --gnome illusionists if currentChargenRace ~= 6 and chargen.kit then currentKitName = Infinity_FetchString(chargen.kit[currentChargenKit].name) else currentKitName = Infinity_FetchString(37204) end if currentKitName == Infinity_FetchString(37192) then setStringTokenLua('',t('ABJURATION_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37195) then setStringTokenLua('',t('CONJURATION_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37198) then setStringTokenLua('',t('DIVINATION_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37201) then setStringTokenLua('',t('ENCHANTMENT_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37204) then setStringTokenLua('',t('ILLUSION_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37207) then setStringTokenLua('',t('EVOCATION_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37210) then setStringTokenLua('',t('NECROMANCY_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37213) then setStringTokenLua('',t('TRANSMUTATION_SCHOOL_TOKEN')) elseif currentKitName == Infinity_FetchString(37216) then setStringTokenLua('',Infinity_FetchString(54893)) end " label { area 0 0 870 714 mosaic GUIPO64D } label { area 46 28 778 56 text lua "t(chargen.title) .. ': ' .. t('LEVEL_LABEL') .. ' ' .. chargen.currentSpellLevelChoice" text style "title" } list { column { width 16 label { bam GUIPFC area 4 19 16 16 align center center enabled "chargen.choose_spell[rowNumber].enabled or chargen.choose_spell[rowNumber].known" } label { bam GUIBTBUT sequenceonce "getRandomButtonSequence('GUIBTBUT')" area 20 0 52 52 align center center frame lua "specialistFrame(rowNumber)" } label { area 20 0 52 52 greyscale lua "chargen.choose_spell[rowNumber].enabled == false" bam lua "spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].groundicon" align center center } } column { width 84 label { area 4 0 -1 -1 text lua "Infinity_FetchString(spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].name)" text style "normal" glow lua "chargen.choose_spell[rowNumber].enabled" align left center } } scrollbar 'GUISCRC' rowheight 52 area 40 98 462 444 table "chargen.choose_spell" var currentChargenChooseMageSpell action " if cellNumber == 1 and not chargen.choose_spell[currentChargenChooseMageSpell].known then Infinity_PlaySound('GAM_09') createCharScreen:OnLearnMageSpellButtonClick(currentChargenChooseMageSpell) end " } text { area 514 104 314 438 text lua "chooseSpellOrGeneralHelp()" text style "normal" scrollbar 'GUISCRC' } label { area 286 552 168 48 text "SPELLS_REMAINING_NORMAL" text style "normal" text align right center } label { area 454 552 48 48 text lua "chargen.extraSpells" text style "normal" text align center center } label { area 40 612 790 39 enabled "shouldShowSpecialistMessage()" text lua "t('SPECIALIST_SPELL_REQ')" text style "normal" text align center center rectangle 0 } button { area 518 548 302 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text lua "spellLearnOrUnlearnText()" text style "button" clickable lua "spellLearnOrUnlearnClickable()" action "createCharScreen:OnLearnMageSpellButtonClick(currentChargenChooseMageSpell)" } button { on escape area 198 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" clickable lua "not chargen.levelingUp" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "createCharScreen:OnDoneButtonClick()" } } ` function mageMemorizeSpellOrGeneralHelp() spl = chargen.choose_spell[currentChargenMemorizeMageSpell] if spl == nil then return Infinity_FetchString(17253) end local desc = mageSpells[chargen.currentSpellLevelChoice][spl.key].desc if currentChargenMemorizeMageSpell and desc ~= -1 then return Infinity_FetchString(desc) else return Infinity_FetchString(17253) end end ` menu { name 'CHARGEN_MEMORIZE_MAGE' align center center ignoreesc modal onOpen " table.sort(chargen.choose_spell, sortByMageSpellName) currentChargenMemorizeMageSpell = nil " label { area 0 0 870 714 mosaic GUIPO64D } label { area 46 28 778 56 text lua "chargen.title" text style "title" } list { column { width 12 label { bam GUIBTBUT sequenceonce "getRandomButtonSequence('GUIBTBUT')" area 0 0 52 52 align center center icon lua "mageSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].groundicon" frame lua "specialistFrame(rowNumber)" count lua "chargen.choose_spell[rowNumber].count" } } column { width 68 label { area 4 0 -1 -1 text lua "Infinity_FetchString(mageSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].name)" text style "normal" glow lua "chargen.choose_spell[rowNumber].enabled" align left center } } column { width 10 label { area 0 4 45 42 bam GUIOSW frame lua "currentCellCheck(3)" sequence 0 } } column { width 10 label { area 0 4 45 42 bam GUIOSW frame lua "currentCellCheck(4)" sequence 1 } } scrollbar 'GUISCRC' rowheight 52 area 40 98 462 444 table "chargen.choose_spell" var currentChargenMemorizeMageSpell action " if cellNumber == 3 then Infinity_PlaySound('GAM_09') createCharScreen:OnMemorizeMageSpellButtonClick(currentChargenMemorizeMageSpell, 1) elseif cellNumber == 4 then Infinity_PlaySound('GAM_09') createCharScreen:OnMemorizeMageSpellButtonClick(currentChargenMemorizeMageSpell, -1) end cellNumber = nil " } text { area 514 104 314 438 text lua "mageMemorizeSpellOrGeneralHelp()" text style "normal" scrollbar 'GUISCRC' } label { area 286 552 168 48 text "SPELLS_REMAINING_NORMAL" text style "normal" text align right center } label { area 454 552 48 48 text lua "chargen.extraSpells" text style "normal" text align center center } button { on escape area 198 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text lua "nextOrDone()" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "createCharScreen:OnDoneButtonClick()" } } ` function priestMemorizeSpellOrGeneralHelp() spl = chargen.choose_spell[currentChargenMemorizePriestSpell] if spl == nil then return Infinity_FetchString(17253) end local desc = priestSpells[chargen.currentSpellLevelChoice][spl.key].desc if currentChargenMemorizePriestSpell and desc ~= -1 then return Infinity_FetchString(desc) else return Infinity_FetchString(17253) end end ` menu { name 'CHARGEN_MEMORIZE_PRIEST' align center center ignoreesc modal onOpen " table.sort(chargen.choose_spell, sortByPriestSpellName) currentChargenMemorizePriestSpell = nil " label { area 0 0 870 714 mosaic GUIPO64D } label { area 46 28 778 56 text lua "chargen.title" text style "title" } list { column { width 12 label { bam GUIBTBUT sequenceonce "getRandomButtonSequence('GUIBTBUT')" area 0 0 52 52 align center center icon lua "priestSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].groundicon" frame 0 count lua "chargen.choose_spell[rowNumber].count" } } column { width 68 label { area 4 0 -1 -1 text lua "Infinity_FetchString(priestSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].name)" text style "normal" glow lua "chargen.choose_spell[rowNumber].enabled" align left center } } column { width 10 label { area 0 4 45 42 bam GUIOSW sequence 0 } } column { width 10 label { area 0 4 45 42 bam GUIOSW sequence 1 } } scrollbar 'GUISCRC' rowheight 52 area 40 98 462 444 table "chargen.choose_spell" var currentChargenMemorizePriestSpell action " if cellNumber == 3 then Infinity_PlaySound('GAM_09') createCharScreen:OnMemorizePriestSpellButtonClick(currentChargenMemorizePriestSpell, 1) elseif cellNumber == 4 then Infinity_PlaySound('GAM_09') createCharScreen:OnMemorizePriestSpellButtonClick(currentChargenMemorizePriestSpell, -1) end " } text { area 514 104 314 438 text lua "priestMemorizeSpellOrGeneralHelp()" text style "normal" scrollbar 'GUISCRC' } label { area 286 552 168 48 text "SPELLS_REMAINING_NORMAL" text style "normal" text align right center } label { area 454 552 48 48 text lua "chargen.extraSpells" text style "normal" text align center center } button { on escape area 198 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text lua "nextOrDone()" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "createCharScreen:OnDoneButtonClick()" } } ` currentChargenCustomSound = 0 ` menu { name 'CHARGEN_CUSTOMSOUNDS' align center center ignoreesc modal onOpen " Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 870 714 mosaic 'GUICGSND' } label { area 214 36 440 44 text "SOUND_TITLE" text style title } list { column { width 100 label { area 0 0 384 18 text lua "getFileNameStringRef(rowNumber, chargen.customSound)" text style "normal" text color 'D' pad 8 0 0 0 } } area 38 88 334 346 rowheight 18 table "chargen.customSound" var "currentChargenCustomSound" scrollbar 'GUISCRC' action " Infinity_PlaySound('GAM_09') createCharScreen:OnSoundItemSelect(currentChargenCustomSound-1) " } text { area 400 92 438 506 text "SOUND_DESCRIPTION" scrollbar 'GUISCRC' text style normal text color 'D' } button { area 44 460 300 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "PLAY_SOUND_BUTTON" text style "button" action "createCharScreen:OnPlayButtonClick()" } button { on escape area 198 654 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 654 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` function hatedRaceOrGeneralHelp() race = chargen.hatedRace[currentChargenHatedRace] if race then return Infinity_FetchString(race.desc) else return Infinity_FetchString(17256) end end function getHatedRaceHighlightFrame(index) local ret = 0 if index == currentChargenHatedRace then ret = 2 elseif index == currentChargenHatedRace then --need a button down test ret = 1 end return ret end hatedRaceButtonSequences = {} ` menu { name 'CHARGEN_HATEDRACE' align center center ignoreesc modal onOpen " hatedRaceButtonSequences = {} for k,v in pairs(chargen.hatedRace) do hatedRaceButtonSequences[k] = getRandomButtonSequence('GUIBUTWS') end Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 870 714 mosaic 'GUICGWDE' } label { area 50 38 768 44 text "HATED_RACE_TITLE" text style "title" } list { column { width 100 label { area 0 0 340 35 text lua "Infinity_FetchString(chargen.hatedRace[rowNumber].name)" text style "list" text align center center pad 8 0 0 0 bam "GUIBUTWS" sequenceonce lua "hatedRaceButtonSequences[rowNumber]" frame lua "getHatedRaceHighlightFrame(rowNumber)" } } action " if chargen.hatedRace[currentChargenHatedRace] then Infinity_PlaySound('GAM_09') createCharScreen:OnRacialEnemySelectButtonClick(chargen.hatedRace[currentChargenHatedRace].id) end " rowheight 35 area 22 90 360 500 table "chargen.hatedRace" var currentChargenHatedRace scrollbar 'GUISCRC' hideHighlight } text { area 376 94 468 498 text lua "hatedRaceOrGeneralHelp()" text style "normal" text color 'D' scrollbar 'GUISCRC' } button { on escape area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` charNameEdit = "" ` menu { name 'CHARGEN_NAME' modal align center center ignoreesc onopen " if chargen.name then charNameEdit = chargen.name else charNameEdit = '' end Infinity_FocusTextEdit('charNameEditArea') Infinity_PlaySound('GAM_03') " onClose " Infinity_PlaySound('GAM_04') " label { area 0 0 660 246 mosaic 'GUIERR6' } label { area 192 22 272 44 text "NAME_LABEL" text style "button" } label { area 192 88 272 36 fill 112 111 111 64 } edit { name "charNameEditArea" area 198 94 260 24 var charNameEdit text style "edit" maxlines 1 maxchars 20 } button { on escape area 20 168 302 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" } button { on return area 334 168 302 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" } } ` createBioEdit = "" ` menu { name 'CHARGEN_BIO' align center center ignoreesc modal label { area 0 0 866 718 mosaic 'GUIPOPF' } label { area 46 34 768 52 text "BIOGRAPHY_TITLE" text style "title" } edit { name "createBioEditArea" area 40 102 786 496 var createBioEdit scrollbar 'GUISCRC' text style "edit" } button { on escape area 66 654 232 44 text "BACK_BUTTON" text style "button" bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" action "createCharScreen:OnCancelButtonClick()" } button { area 318 654 232 44 text "CLEAR_BUTTON" text style "button" bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" action "createBioEdit = ''" } button { on return area 568 654 238 44 text "DONE_BUTTON" text style "button" bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" action "createCharScreen:OnDoneButtonClick()" } } ` list_GUICG_20_2_idx = 0 function NextOrDone() if createCharScreen:GetImportState() == 1 then return t("NEXT_BUTTON") else return t("DONE_BUTTON") end end ` menu { name 'CHARGEN_IMPORT' align center center ignoreesc modal onOpen " list_GUICG_20_2_idx = 0 " label { area 0 0 870 714 mosaic 'GUICGWDE' } label { area 50 38 768 44 text "IMPORT_TITLE" text style "title" } list { column { width 100 label { area 0 0 -1 -1 text lua "list_GUICG_20_2[rowNumber]" text style "list" text color 'D' pad 8 0 0 0 } } rowheight 35 area 22 90 360 500 table "list_GUICG_20_2" var "list_GUICG_20_2_idx" scrollbar 'GUISCRC' action " Infinity_OnCharacterImportItemSelect(list_GUICG_20_2_idx - 1) " } text { area 376 94 468 498 text 10963 text style normal text color 'D' scrollbar 'GUISCRC' } button { on escape area 196 652 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu('CHARGEN_IMPORT'); createCharScreen:OnCancelButtonClick()" } button { on return area 438 652 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text lua "NextOrDone()" text style "button" clickable lua "list_GUICG_20_2_idx ~= 0" action "Infinity_PopMenu('CHARGEN_IMPORT'); createCharScreen:OnDoneButtonClick()" } } ` chargenExportCharacterEdit = "" list_GUICG_21_2_idx = 0 ` menu { name 'CHARGEN_EXPORT' modal align center center ignoreesc onopen "chargenExportListId = 0" label { area 0 0 864 710 mosaic 'GUICGSND' } label { area 218 34 434 46 text "EXPORT_TITLE" text style "title" } list { column { width 100 label { area 0 0 -1 -1 text lua "list_GUICG_21_2[rowNumber]" text style "list" text color 'D' pad 8 0 0 0 } } area 36 88 334 292 rowheight 18 table "list_GUICG_21_2" var "chargenExportListId" scrollbar 'GUISCRC' action " createCharScreen:OnCharacterExportItemSelect(chargenExportListId - 1) " } text { area 400 84 438 516 text 10962 text style "normal" text color 'D' } label { area 36 384 334 24 text "EXPORT_FILENAME_LABEL" text style "label" text color 3 } label { area 36 412 334 24 fill 112 111 111 64 } edit { name "chargenExportCharacterEditArea" area 36 412 334 24 var chargenExportCharacterEdit text style "edit" maxlines 1 } button { on escape area 196 654 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action "Infinity_PopMenu('CHARGEN_EXPORT'); createCharScreen:OnCancelButtonClick()" } button { on return area 438 654 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action "Infinity_PopMenu('CHARGEN_EXPORT'); createCharScreen:OnDoneButtonClick()" } } menu { name 'CHARGEN_DUALCLASS' align center center ignoreesc label { area 0 0 870 714 mosaic guidcx } label { area 82 10 700 44 text "DUALCLASS_TITLE" text style "title" } label { area 62 124 363 37 text lua "characters[currentID].name" text style "label" } label { area 459 124 363 37 text lua "characters[currentID].class" text style "label" } label { area 136 191 177 243 bitmap lua "characters[currentID].portrait" } text { area 481 194 336 407 text 10811 --dual class info text style "normal" scrollbar 'GUISCRC' } button { area 58 496 342 36 clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_CLASS" bam GUIBUTWS sequenceonce "getRandomButtonSequence('GUIBUTWS')" text "CLASS_BUTTON" text style "button" action " createCharScreen:OnMenuButtonClick() " } button { area 58 532 342 36 clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_PROFICIENCIES" bam GUIBUTWS sequenceonce "getRandomButtonSequence('GUIBUTWS')" text "SKILLS_BUTTON" text style "button" action " createCharScreen:OnMenuButtonClick() " } button { area 440 653 232 44 bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_DONE" text "DONE_BUTTON" text style "button" action " createCharScreen:OnDoneButtonClick() " } button { area 198 653 232 44 clickable false bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" action " createCharScreen:OnCancelButtonClick() " } } ` difficulties = { {name = "DIFFICULTY_LABEL_STORYMODE", description = "DIFFICULTY_DESCRIPTION_STORYMODE_BG2EE"}, {name = "DIFFICULTY_LABEL_EASY", description = "DIFFICULTY_DESCRIPTION_EASY_BG2EE"}, {name = "DIFFICULTY_LABEL_NORMAL", description = "DIFFICULTY_DESCRIPTION_NORMAL_BG2EE"}, {name = "DIFFICULTY_LABEL_CORERULES", description = "DIFFICULTY_DESCRIPTION_CORERULES_BG2EE"}, {name = "DIFFICULTY_LABEL_HARD", description = "DIFFICULTY_DESCRIPTION_HARD_BG2EE"}, {name = "DIFFICULTY_LABEL_INSANE", description = "DIFFICULTY_DESCRIPTION_INSANE_BG2EE"}, {name = 40200, description = "DIFFICULTY_DESCRIPTION_LEGACYOFBHAAL_BG2EE"}, } fromSinglePlayer = false fromMultiPlayer = false function WhoYouGonnaCall() --singleplayer or import fromSinglePlayer = (createCharScreen:GetEngineState() == 1 or createCharScreen:GetEngineState() == 7) and multiplayerScreen:GetEngineState() ~= 1 end ` menu { name 'CHARGEN_DIFFICULTY' align center center ignoreesc onopen " currentDifficulty = 3 WhoYouGonnaCall() " label { mosaic GUICREDT area 0 0 1024 768 } label { area 30 6 966 50 text "DIFFICULTY_LABEL" text style "title" } list { column { width 15 label { area 20 5 60 60 bam "GUIDIFFS" frame lua "rowNumber-1" align center center } } column { width 15 label { area 0 0 64 -1 text lua "t( difficulties[rowNumber].name )" text style "label" text align center center text color B } } column { width 70 label { area 10 0 -1 -1 text lua "t( difficulties[rowNumber].description )" text style "label" text point 12 text align left center text color B } } area 44 106 946 516 rowheight 69 table "difficulties" var "currentDifficulty" scrollbar 'GUISCRC' action " " } button { on escape area 276 712 232 44 bam GUIOSTUL text 15416 text style "button" action " Infinity_PopMenu() if(createCharScreen:GetEngineState() == 7) then --if create char is in import mode, kick us back to the start screen. e:SelectEngine(startEngine) end " } button { area 530 712 238 44 bam GUIOSTUR text lua "t('VENTURE_FORTH')" text style "button" enabled "fromSinglePlayer" action " Infinity_PopMenu() createCharScreen:AcceptCharacter(currentDifficulty) " } button { area 530 712 238 44 bam GUIOSTUR text 11973 text style "button" enabled "fromMultiPlayer" action " Infinity_PopMenu() Infinity_PopMenu() Infinity_PopMenu() Infinity_PopMenu() if connectionLocalNetworkGame == 1 then connectionIsHosting = true chooseNetworkProtocol(2) end fromMultiPlayer = false mulitplayerPreexistingDifficulty = currentDifficulty connectionScreen:OnNewGameButtonClick() " } } ` currentHLASelection = nil function chargenHLADescription() if currentHLASelection == nil then return 63817 else return chargen.HLAs[currentHLASelection].description end end function chargenHLAPlusMinusFrame(cell, rownumber) if cell == 3 then if chargen.HLAs[rownumber].canAdd then return currentCellCheck(cell) else return 3 end elseif cell == 4 then if chargen.HLAs[rownumber].canSubtract then return currentCellCheck(cell) else return 3 end end end ` menu { name 'CHARGEN_HIGH_LEVEL_ABILITIES' align center center ignoreesc modal onOpen " currentHLASelection = nil " label { area 0 0 870 714 mosaic GUIHSBS } label { area 74 10 716 52 text "HIGH_LEVEL_ABILITIES_TITLE" text style "title" } label { area 36 114 448 52 text lua "chargen.numHLAs" text style "title" } text { area 522 118 302 494 text lua "Infinity_FetchString(chargenHLADescription())" text style "normal" scrollbar 'GUISCRC' } list { column { width 15 label { bam GUIBTBUT sequenceonce "getRandomButtonSequence('GUIBTBUT')" area 0 0 52 52 align center center icon lua "chargen.HLAs[rowNumber].icon" glow lua "chargen.HLAs[rowNumber].count > 0" count lua "chargen.HLAs[rowNumber].count" } } column { width 61 label { area 4 0 -1 -1 text lua "Infinity_FetchString(chargen.HLAs[rowNumber].name)" text style "normal" align left center } } column { width 12 label { area 0 4 45 42 bam GUIOSW frame lua "chargenHLAPlusMinusFrame(3, rowNumber)" sequence 0 } } column { width 12 label { area 0 4 45 42 bam GUIOSW frame lua "chargenHLAPlusMinusFrame(4, rowNumber)" sequence 1 } } scrollbar 'GUISCRC' rowheight 52 area 58 194 404 404 table "chargen.HLAs" var currentHLASelection action " print(chargen.HLAs[currentHLASelection].count) if cellNumber == 3 and chargenHLAPlusMinusFrame(3, currentHLASelection) ~= 3 then createCharScreen:OnHLAButtonClick(currentHLASelection, 1) elseif cellNumber == 4 and chargenHLAPlusMinusFrame(4, currentHLASelection) ~= 3 then createCharScreen:OnHLAButtonClick(currentHLASelection, -1) end cellNumber = nil " } button { area 210 652 238 44 bam GUIOSTUL text "DONE_BUTTON" text style "button" clickable lua "createCharScreen:IsDoneButtonClickable()" action " createCharScreen:OnDoneButtonClick() " } } ` TEXT_popup_big = 0 ` menu { name 'POPUP_BIG' align center center modal label { area 0 0 512 651 mosaic GUICONNB } text { area 82 64 338 452 text lua "Infinity_FetchString(TEXT_popup_big)" text style "label" text align left top scrollbar 'GUISCRC' } button { area 148 530 204 44 bam GUIOSTUM text "DONE_BUTTON" text style "button" action " Infinity_PopMenu() " } } ` list_GUIMOVIE_0_0_idx = 0 ` menu { name 'MOVIES' align center center button { on escape action " --Return to world screen on escape e:SelectEngine(optionsScreen) " } label { area 0 0 1024 768 mosaic "GUIMOVB" } label { area 360 76 314 44 text "MOVIES_TITLE" text style "title" } list { column { width 100 label { area 0 0 384 18 text lua "list_GUIMOVIE_0_0[rowNumber].description" text style "list" text align left center } } area 326 138 382 316 rowheight 18 table "list_GUIMOVIE_0_0" var "list_GUIMOVIE_0_0_idx" scrollbar 'GUISCRC' action " moviesScreen:OnMovieItemSelect(list_GUIMOVIE_0_0[list_GUIMOVIE_0_0_idx].movieCode) " } button { area 366 470 300 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "PLAY_MOVIE_BUTTON" text style "button" clickable lua "list_GUIMOVIE_0_0_idx ~= 0" action "moviesScreen:OnPlayButtonClick()" } button { area 366 514 300 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "CREDITS_BUTTON" text style "button" action "moviesScreen:OnCreditsButtonClick()" } button { area 366 558 300 44 bam GUIBUTWT sequenceonce lua "getRandomButtonSequence('GUIBUTWT')" text "DONE_BUTTON" text style "button" action " Infinity_PopMenu('MOVIES') moviesScreen:OnDoneButtonClick() " } } ` --Multiplayer start. mp_shownSessions = {} selectedMp = 0 detailsStr = "" passwordReq = 0 passwordMp = "" connectionPlayerNameEdit = "" connectionFilterNoPasswords = 0 connectionFilterNoFullGames = 0 selectedIndex = 0 connectionIsHosting = false function connectionBuildGameList() local index = 1 local count = 0 local entryOK = true local foundSelected = false for index = 1, #(mp_sessions), 1 do entryOK = true Infinity_GetPasswordRequired(index) if mp_sessions[index] == nil then entryOK = false elseif mp_sessions[index]["flags"] == nil then entryOK = false elseif connectionFilterNoPasswords == 1 and passwordReq ~= 0 then entryOK = false elseif connectionFilterNoFullGames == 1 and mp_sessions[index]["players"] == 6 then entryOK = false end if entryOK == true then count = count + 1 mp_shownSessions[count] = {} mp_shownSessions[count]["actualIndex"] = index mp_shownSessions[count]["updated_at"] = mp_sessions[index]["updated_at"] if mp_sessions[index]['sessionIDString'] == selectedIndex then selectedMp = count foundSelected = true end end end local tableCount = #(mp_shownSessions) while tableCount > count do mp_shownSessions[tableCount] = nil tableCount = tableCount - 1 end if foundSelected == false then selectedMp = 0 end end function chooseNetworkProtocol(num) connectionScreen:SelectServiceProvider(num) end function joinGameEnabled() if selectedMp <= 0 or mp_shownSessions[selectedMp]['actualIndex'] == nil then return 0 else return 1 end end function gameHasPassword(slot) if(mp_sessions[mp_shownSessions[slot]["actualIndex"]] == nil) then --if the session isn't loaded don't show anything. return "" end Infinity_GetPasswordRequired(mp_shownSessions[slot]["actualIndex"]) if passwordReq ~= 0 then ret = t("YES") else ret = t("NO") end return ret end function connectionGetGameName(slot) ret = "" ret = mp_sessions[mp_shownSessions[slot]["actualIndex"]]['name'] return ret end function connectionGetNumPlayers(slot) ret = 0 ret = mp_sessions[mp_shownSessions[slot]["actualIndex"]]['players'] return ret end function connectionGetGameType(slot) ret = "" if mp_sessions[mp_shownSessions[slot]["actualIndex"]] ~= nil then if mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "iwd-main" then ret = t(16509) elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "iwd-how" then ret = t(26799) end end return ret end function matchMultiplayerGameType(gameVersion) if gameVersion == "iwd-main" then startEngine:OnSoAButtonClick(false) e:CheckGUISong() elseif gameVersion == "iwd-how" then startEngine:OnToBButtonClick(false) e:CheckGUISong() end end ` menu { name 'CONNECTION' align center center onOpen " connectionFilterNoPasswords = 0 connectionFilterNoFullGames = 0 connectionIsHosting = false connectionBuildGameList() if connectionPlayerNameEdit == '' then connectionSetDefaultGameSettings() end " label -- Background { area 0 0 1024 768 mosaic GUIINVHB } label -- Title { area 174 12 700 46 text "JOIN_GAME_TITLE" text style title } label { area 72 196 504 24 text lua "t('GAME_NAME_LABEL')" text style "label_parchment" align center center } label { area 576 196 84 24 text lua "t('PASSWORD_LABEL')" text style "label_parchment" align center center } label { area 660 196 70 24 text lua "t('PLAYERS_LABEL')" text style "label_parchment" align center center } label { area 730 196 186 24 text lua "t('GAME_TYPE_LABEL')" text style "label_parchment" align center center } list -- Multiplayer sessions { column { width 60 label { area 20 0 500 40 text lua "connectionGetGameName(rowNumber)" text style "list_parchment" align left center } } column { width 10 label { area 20 0 210 40 text lua "gameHasPassword(rowNumber)" text style "list_parchment" align left center } } column { width 10 label { area 20 0 210 40 text lua "connectionGetNumPlayers(rowNumber)" text style "list_parchment" align left center } } column { width 20 label { area 20 0 210 40 text lua "connectionGetGameType(rowNumber)" text style "list_parchment" align left center } } area 72 220 882 364 rowheight 44 table "mp_shownSessions" var selectedMp scrollbar 'GUISCRC' action " selectedIndex = mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['sessionIDString'] " } label -- player name { area 300 80 210 40 text "PLAYER_NAME_LABEL" text style "label" } label { area 304 120 206 38 fill 16 15 15 84 } edit { name "ConnectionPlayerNameEditArea" area 308 125 196 27 var connectionPlayerNameEdit text style "edit" text align center center maxlines 1 maxchars 32 action " if(key_pressed == 92) then return -1 elseif letter_pressed == '\\' then return -1 else return 1 end " } label -- filter options { area 559 80 165 45 text style 'label' text "CONNECTION_NOT_PASSWORD_PROTECTED_LABEL" align left center tooltip lua "t('CONNECTION_NO_PASSWORDS_TOOLTIP')" } button { area 514 80 40 40 bam ROUNDBUT scaleToClip toggle "connectionFilterNoPasswords" tooltip lua "t('CONNECTION_NO_PASSWORDS_TOOLTIP')" action " connectionBuildGameList() " } label { area 559 120 165 44 text style 'label' text "CONNECTION_NOT_FULL_LABEL" align left center tooltip lua "t('CONNECTION_NO_FULL_GAMES_TOOLTIP')" } button { area 514 120 40 40 bam ROUNDBUT scaleToClip toggle "connectionFilterNoFullGames" tooltip lua "t('CONNECTION_NO_FULL_GAMES_TOOLTIP')" action " connectionBuildGameList() " } button -- Create game { area 62 114 202 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "CONNECTION_CREATE_NEW_GAME_BUTTON" text style "button" action " Infinity_PushMenu('CONNECTION_CREATE') " } button -- Direct Connect { area 418 638 202 44 bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "CONNECTION_DIRECT_CONNECTION_BUTTON" text style "button" tooltip lua "t('CONNECTION_DIRECT_CONNECT_TOOLTIP')" action " connectionIsHosting = false chooseNetworkProtocol(2) " } button -- refresh { area 894 92 60 60 bam 'GUMPBUTX' sequence 2 align center center tooltip lua "t('CONNECTION_REFRESH_TOOLTIP')" action " selectedMp = nil mp_shownSessions = {} mp_sessions = {} connectionScreen:ClearSessions() " } button -- Join game { area 532 714 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "JOIN_BUTTON" text style "button" clickable lua "joinGameEnabled()" action " Infinity_GetPasswordRequired(mp_shownSessions[selectedMp]['actualIndex']) if string.find(connectionPlayerNameEdit, '%S') == nil then Infinity_PushMenu('CONNECTION_NAME') elseif passwordReq == 0 then Infinity_PopMenu(); Infinity_PopMenu(); mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['password'] = passwordMp Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex']) else Infinity_PushMenu('CONNECTION_PASSWORD') end " } button -- Back/ Log out { area 278 714 232 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "BACK_BUTTON" text style "button" on escape action " Infinity_PopMenu(); connectionScreen:OnMainCancelButtonClick() " } } ` connectionTCPIPEdit = "" ` menu { name 'CONNECTION_IP' modal align center center onopen "Infinity_FocusTextEdit('ConnectionTCPIPEditArea')" label { area 0 0 680 242 mosaic GUIERR6 } label --Title { area 38 20 592 64 text 20681 text style "label" } button { area 370 170 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" on return clickable lua "connectionScreen:IsValidAddress(connectionTCPIPEdit)" action " Infinity_PopMenu(); connectionScreen:JoinGameIPAddress(connectionTCPIPEdit) " } button { area 88 170 234 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" on escape action " Infinity_PopMenu(); chooseNetworkProtocol(1) " } label { area 56 84 542 32 fill 112 111 111 64 } edit { name "ConnectionTCPIPEditArea" area 62 88 532 22 var connectionTCPIPEdit text style "edit" maxlines 1 } } ` connection = {} connectionSessionNameEdit = "" connectionSessionPasswordEdit = "" connectionPasswordProtected = 0 connectionLocalNetworkGame = 0 function connectionCreateGameClickable() local ret = string.find(connectionPlayerNameEdit, '%S') ~= nil and string.find(connectionSessionNameEdit, '%S') ~= nil if connectionPasswordProtected == 1 then ret = ret and string.find(connectionSessionPasswordEdit, '%S') ~= nil end return ret end function connectionSetDefaultGameSettings() local player = t("MULTIPLAYER_DEFAULT_PLAYER") local game = t("MULTIPLAYER_ENTER_GAME_NAME") local pass = t("MULTIPLAYER_ENTER_GAME_PASSWORD") if connectionPlayerNameEdit == "" then connectionPlayerNameEdit = Infinity_GetINIString('Multiplayer', 'Player Name', player) connectionPlayerNameEdit = connectionPlayerNameEdit:gsub("\\", "") Infinity_SetINIValue('Multiplayer', 'Player Name', connectionPlayerNameEdit) end if connectionSessionPasswordEdit == "" then connectionSessionPasswordEdit = Infinity_GetINIString('Multiplayer', 'Session Password', pass) connectionSessionPasswordEdit = connectionSessionPasswordEdit:gsub("\\", "") Infinity_SetINIValue('Multiplayer', 'Session Password', connectionSessionPasswordEdit) end if connectionSessionNameEdit == "" then connectionSessionNameEdit = Infinity_GetINIString('Multiplayer', 'Session Name', game) connectionSessionNameEdit = connectionSessionNameEdit:gsub("\\", "") Infinity_SetINIValue('Multiplayer', 'Session Name', connectionSessionNameEdit) end if connectionSessionPasswordEdit ~= "" then connectionPasswordProtected = 1 else connectionPasswordProtected = 0 end if connectionScreen:HasServiceProvider() then connectionLocalNetworkGame = 0 else connectionLocalNetworkGame = 1 end end ` menu { name 'CONNECTION_CREATE' align center center ignoreEsc modal onOpen " connectionSetDefaultGameSettings() " label { area 0 0 512 651 mosaic "GUICONNB" } label { area 54 6 392 42 text style 'title' text "CREATEGAME_TITLE" } label { area 100 114 298 30 fill 112 111 111 64 } label -- player { area 80 69 340 45 text style 'label' text "PLAYER_NAME_LABEL" } edit { name "connectionPlayerNameEditArea" area 110 118 282 22 var connectionPlayerNameEdit text style "edit" maxlines 1 maxchars 32 action " if(key_pressed == 92) then return -1 elseif letter_pressed == '\\' then return -1 else return 1 end " } label -- session { area 80 159 340 45 text style 'label' text "SESSION_NAME_LABEL" } label { area 100 204 304 30 fill 112 111 111 64 } edit { name "connectionSessionNameEditArea" area 110 208 288 22 var connectionSessionNameEdit text style "edit" maxlines 1 action " if(key_pressed == 92) then return -1 elseif letter_pressed == '\\' then return -1 else return 1 end " } text -- password option { area 179 259 241 45 text style 'label' text "CONNECTION_PASSWORD_PROTECTED" tooltip lua "t('CONNECTION_PASSWORD_PROTECTED_TOOLTIP')" align left center } button { area 134 259 40 40 bam ROUNDBUT scaleToClip toggle "connectionPasswordProtected" tooltip lua "t('CONNECTION_PASSWORD_PROTECTED_TOOLTIP')" action " if connectionPasswordProtected == 1 then Infinity_FocusTextEdit('connectionSessionPasswordEditArea') end " } text -- local option { area 179 304 241 45 text style 'label' text "CONNECTION_LOCAL_NETWORK_GAME" tooltip lua "t('CONNECTION_LOCAL_NETWORK_GAME_TOOLTIP')" align left center } button { area 134 304 40 40 bam ROUNDBUT scaleToClip glow lua "connectionLocalNetworkGame" tooltip lua "t('CONNECTION_LOCAL_NETWORK_GAME_TOOLTIP')" action " if connectionScreen:HasServiceProvider() then connectionLocalNetworkGame = 1 - connectionLocalNetworkGame end " } label -- password { area 80 363 340 45 text style 'label' text "CHOOSE_PASSWORD_LABEL" enabled connectionPasswordProtected } edit { name "connectionSessionPasswordEditArea" area 100 408 304 30 var connectionSessionPasswordEdit text style "edit" text align center center maxlines 1 enabled connectionPasswordProtected fill 112 111 111 64 action " if(key_pressed == 92) then return -1 elseif letter_pressed == '\\' then return -1 else return 1 end " } button { clickable lua "connectionCreateGameClickable()" area 138 534 232 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text style "button" text "CREATEGAME_BUTTON" action " local stringStart = string.find(connectionPlayerNameEdit, '%S'); connectionPlayerNameEdit = string.sub(connectionPlayerNameEdit, stringStart, string.len(connectionPlayerNameEdit)) stringStart = string.find(connectionSessionNameEdit, '%S'); connectionSessionNameEdit = string.sub(connectionSessionNameEdit, stringStart, string.len(connectionSessionNameEdit)) if connectionPasswordProtected == 1 then stringStart = string.find(connectionSessionPasswordEdit, '%S'); connectionSessionPasswordEdit = string.sub(connectionSessionPasswordEdit, stringStart, string.len(connectionSessionPasswordEdit)) end if connectionPasswordProtected == 0 then connectionSessionPasswordEdit = '' end Infinity_PushMenu('CONNECTION_NEWORSAVED') " } button { area 138 584 232 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text style "button" text "BACK_BUTTON" action " Infinity_PopMenu() " } } menu { name 'CONNECTION_NEWORSAVED' align center center modal label { area 0 0 658 234 mosaic "GUIERR6" } label { area 26 22 604 128 text style 'label' text "CONNECTION_SELECT_GAME_TYPE_LABEL" } button { area 230 172 204 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text style "button" text "NEW_GAME_BUTTON" tooltip lua "t('CONNECTION_NEW_GAME_TOOLTIP')" action " Infinity_PopMenu() Infinity_PopMenu() Infinity_PopMenu() fromMultiPlayer = true local difficultyOffset = 1 if Infinity_GetOption(65,8) ~= 0 then mulitplayerPreexistingDifficulty = 1 elseif Infinity_GetOption(59,8) ~= 0 then mulitplayerPreexistingDifficulty = 7 else mulitplayerPreexistingDifficulty = Infinity_GetOption(12, 8) + 1 + 1 end connectionScreen:OnNewGameButtonClick() " } button { area 440 172 204 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text style "button" text "LOAD_BUTTON" tooltip lua "t('CONNECTION_LOAD_GAME_TOOLTIP')" action " Infinity_PopMenu() Infinity_PopMenu() Infinity_PopMenu() if connectionLocalNetworkGame == 1 then connectionIsHosting = true chooseNetworkProtocol(2) end connectionScreen:OnLoadGameButtonClick() " } button { area 18 172 204 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text style "button" text "BACK_BUTTON" action " Infinity_PopMenu() " } } ` connectionPasswordPasswordEdit = "" ` menu { name 'CONNECTION_PASSWORD' align center center modal onOpen " if mp_sessions[selectedMp]['name'] == Infinity_GetINIString('Multiplayer', 'Session Name', '') then connectionPasswordPasswordEdit = Infinity_GetINIString('Multiplayer', 'Session Password', '') else connectionPasswordPasswordEdit = '' end Infinity_FocusTextEdit('connectionPasswordPasswordEditArea') " label { area 0 0 660 240 mosaic "GUIERR6" } label { area 12 16 632 48 text style 'title' text "PASSWORD_REQUIRED_LABEL" } label { area 12 54 632 36 text style 'label' text "ENTER_PASSWORD_LABEL" } button { bam XBUTT on esc area 616 0 44 44 action " Infinity_PopMenu() " } edit { name "connectionPasswordPasswordEditArea" area 28 86 598 58 var connectionPasswordPasswordEdit text style "edit" text align center center maxlines 1 fill 112 111 111 64 action " --On return pressed if (key_pressed == 13) then local stringStart = string.find(connectionNameNameEdit, '%S') if stringStart ~= nil then local stringStart = string.find(connectionPasswordPasswordEdit, '%S') mp_sessions[selectedMp]['password'] = string.sub(connectionPasswordPasswordEdit, stringStart, string.len(connectionPasswordPasswordEdit) ) Infinity_PopMenu() Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex']) end return -1 end return 1 " } button { area 416 166 204 44 bam 'GUIBUTNT' text style "button" text "DONE_BUTTON" clickable lua "connectionPasswordPasswordEdit ~='' and string.find(connectionPasswordPasswordEdit, '%S') ~= nil" action " Infinity_PopMenu(); local stringStart = string.find(connectionPasswordPasswordEdit, '%S') mp_sessions[selectedMp]['password'] = string.sub(connectionPasswordPasswordEdit, stringStart, string.len(connectionPasswordPasswordEdit) ) Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex']) " } button { area 34 166 204 44 bam 'GUIBUTNT' text style "button" text "BACK_BUTTON" action " Infinity_PopMenu() " } } ` connectionNameNameEdit = "" ` menu { name 'CONNECTION_NAME' align center center modal onOpen " connectionNameNameEdit = '' Infinity_FocusTextEdit('connectionNameNameEditArea') " label { area 0 0 660 240 mosaic "GUIERR6" } label { area 12 16 632 70 text style 'title' text "PLAYER_NAME_LABEL" } button { bam XBUTT on esc area 616 0 44 44 action " Infinity_PopMenu() " } edit { name "connectionNameNameEditArea" area 28 86 598 58 var connectionNameNameEdit text style "edit" text align center center maxlines 1 fill 112 111 111 64 action " --On return pressed if (key_pressed == 13) then local stringStart = string.find(connectionNameNameEdit, '%S') if stringStart ~= nil then connectionPlayerNameEdit = string.sub(connectionNameNameEdit, stringStart, string.len(connectionNameNameEdit) ) Infinity_PopMenu() Infinity_GetPasswordRequired(mp_shownSessions[selectedMp]['actualIndex']) if passwordReq == 0 then Infinity_PopMenu(); Infinity_PopMenu(); mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['password'] = passwordMp Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex']) else Infinity_PushMenu('CONNECTION_PASSWORD') end end return -1 end return 1 " } button { area 416 166 204 44 bam 'GUIBUTNT' text style "button" text "DONE_BUTTON" clickable lua "connectionNameNameEdit ~='' and string.find(connectionNameNameEdit, '%S') ~= nil" action " Infinity_PopMenu(); local stringStart = string.find(connectionNameNameEdit, '%S') connectionPlayerNameEdit = string.sub(connectionNameNameEdit, stringStart, string.len(connectionNameNameEdit) ) Infinity_GetPasswordRequired(mp_shownSessions[selectedMp]['actualIndex']) if passwordReq == 0 then Infinity_PopMenu(); Infinity_PopMenu(); mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['password'] = passwordMp Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex']) else Infinity_PushMenu('CONNECTION_PASSWORD') end " } button { area 34 166 204 44 bam 'GUIBUTNT' text style "button" text "BACK_BUTTON" action " Infinity_PopMenu() " } } menu { name 'CONNECTION_PLAYERNAME' align center center ignoreEsc modal onOpen " connectionPlayerNameEdit = Infinity_GetINIString('Multiplayer', 'Player Name', 'Player Name') Infinity_FocusTextEdit('connectionPlayerNameEditArea') " label { area 0 0 512 651 mosaic "GUICONNB" } label { area 58 10 384 40 text style "label" text "CURRENT_PLAYERS_LABEL" } label { area 83 446 338 32 text style "label" text "PLAYER_NAME_LABEL" } list { column { width 100 label { area 0 0 -1 -1 text lua "connection.currentPlayers[rowNumber].name" text style "edit" align center center } } action " " rowheight 50 area 83 72 338 365 table "connection.currentPlayers" var connectionSelectedPlayer } edit { name "connectionPlayerNameEditArea" area 110 479 280 35 var connectionPlayerNameEdit text style "edit" text align center center maxlines 1 maxchars 32 fill 112 111 111 64 } button { clickable lua "connectionPlayerNameEdit ~= ''" area 154 538 204 44 bam GUIBUTNT sequence 0 text "DONE_BUTTON" text style "button" on return action " Infinity_PopMenu(); Infinity_PopMenu(); connectionScreen:SetPlayerName(connectionPlayerNameEdit) " } } menu { name 'CONNECTION_JOINING' modal align center center label { area 0 0 657 234 mosaic GUIERR6 } label --Title { area 30 20 600 64 text 20274 text style "label" } button { area 222 170 230 44 bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" on escape action " Infinity_PopMenu(); " } } menu { name 'CONNECTION_ERROR' modal align center center label { area 0 0 462 498 mosaic GUIERR } label --Title { area 124 132 220 106 text lua "Infinity_FetchString(CONNECTION_ERROR_MESSAGE)" text style "label" } button { area 138 314 202 44 bam GUIBUTNT sequence 0 text "CANCEL_BUTTON" text style "button" on escape action " Infinity_PopMenu(); " } } menu { name 'CONNECTION_WAITING_FOR_PROVIDER' modal align center center ignoreEsc label { area 0 0 682 238 mosaic GUIERR6 } label --Title { area 44 20 590 106 text "CONNECTION_FINDING_DEVICES" text style "label" } button { area 79 170 234 44 bam GUIBUTMT sequence 0 text "CANCEL_BUTTON" text style "button" on escape action " Infinity_PopMenu('CONNECTION_WAITING_FOR_PROVIDER') Infinity_PopMenu('CONNECTION'); connectionScreen:OnMainCancelButtonClick() " } button { area 343 170 234 44 bam GUIBUTMT sequence 0 text "CONNECTION_LOCAL_NETWORK_GAME" text style "button" on return action " Infinity_PopMenu('CONNECTION_WAITING_FOR_PROVIDER') connectionScreen:StopConnectingToProvider() " } } menu { name 'CONNECTION_WAITING_FOR_SERVER' modal align center center label { area 0 0 462 498 mosaic GUIERR } label --Title { area 124 132 220 106 text "CONNECTION_WAITING_FOR_SERVER" text style "label" } button { area 138 314 202 44 bam GUIBUTNT sequence 0 text "CANCEL_BUTTON" text style "button" on escape action " Infinity_PopMenu('CONNECTION_WAITING_FOR_SERVER') connectionScreen:CancelJoinGame(); " } } menu { name 'BACKGROUND' align center center label { area 0 0 3840 2160 mosaic 'GUIBG' } } ` multiplayer = {} mpChatEdit = "" mpHelpTextString = "" mpModifyingCharacter = -1 mpErrorText = -1 mpErrorState = -1 text_GUIMP_0_25 = "" text_GUIMP_0_25_lines = 0 multiplayerInPermission = false multiplayerInPermissionForPlayer = 0 multiplayerSessionName = "" multiplayerSaveName = "" multiplayerChapter = "" multiplayerTimePlayed = "" multiplayerDifficultyLabel = "" mulitplayerPreexistingDifficulty = 0; multiplayerLocalPlayerID = 1 multiplayerFromInGame = false mpaCharacters = { {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"}, {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"}, {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"}, {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"}, {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"}, {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"} } mpaPlayers = { {name = "", id = 0, color = "0xd7ed87"}, {name = "", id = 0, color = "0xFFAF7A"}, {name = "", id = 0, color = "0x7aFFa3"}, {name = "", id = 0, color = "0x57F9FF"}, {name = "", id = 0, color = "0xF2F188"}, {name = "", id = 0, color = "0xFE97FF"} } function updateMultiplayerPlayerSlot(slot,setting,value) if multiplayerLocalPlayerID == 1 and setting == "name" and mpaPlayers[slot][setting] == "" and value ~= "" then mpaPlayers[slot][setting] = value broadcastPlayerAdded(slot) elseif multiplayerLocalPlayerID == 1 and setting == "name" and mpaPlayers[slot][setting] ~= "" and value == "" then broadcastPlayerRemoved(slot) mpaPlayers[slot][setting] = value else mpaPlayers[slot][setting] = value end end function updateMultiplayerCharacterSlot(slot,setting,value) if multiplayerLocalPlayerID == 1 and setting == "color" and mpaCharacters[slot][setting] == "0xffffff" and value ~= "0xffffff" then mpaCharacters[slot][setting] = value broadcastCharacterAdded(slot) elseif multiplayerLocalPlayerID == 1 and setting == "ready" and mpaCharacters[slot][setting] == false and value == true then broadcastCharacterReady(slot) mpaCharacters[slot][setting] = value elseif multiplayerLocalPlayerID == 1 and setting == "ready" and mpaCharacters[slot][setting] == true and value == false then broadcastCharacterNotReady(slot) mpaCharacters[slot][setting] = value else mpaCharacters[slot][setting] = value end end function clearCharacterSlot(slot, announce) if announce == true and mpaCharacters[slot]['name'] ~= "" then broadcastCharacterRemoved(slot) end mpaCharacters[slot]['ready'] = false mpaCharacters[slot]['name'] = "" mpaCharacters[slot]['class'] = "" mpaCharacters[slot]['portrait'] = "NOPORTLS" mpaCharacters[slot]['inprogress'] = false mpaCharacters[slot]['color'] = "0xffffff" end function clearPlayerSlot(slot, announce) if announce == true and mpaPlayers[slot]["name"] ~= "" then broadcastPlayerRemoved(slot) end mpaPlayers[slot]["name"] = "" mpaPlayers[slot]["id"] = 0 end function getMultiplayerCharacterName(slot, newLine, getClass) local ret = "" local separator = ", " if newLine == true then separator = "\n" end if mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID == mpaCharacters[slot]["player"] then ret = t("MULTIPLAYER_CREATE_CHARACTER_MESSAGE") elseif mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID ~= mpaCharacters[slot]["player"] and mpaCharacters[slot]["inprogress"] == false then ret = t("MULTIPLAYER_EMPTY_CHARACTER_MESSAGE") elseif mpaCharacters[slot]["inprogress"] == true and mpaCharacters[slot]["class"] == "" then setStringTokenLua("",getMultiplayerPlayerName(mpaCharacters[slot]["player"], false, true)) setStringTokenLua("",separator) ret = t("MULTIPLAYER_CREATING_CHARACTER_MESSAGE") removeStringTokenLua("") removeStringTokenLua("") elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" then ret = "^0xff"..mpaCharacters[slot]["color"]..mpaCharacters[slot]["name"].."^-" if getClass == true then ret = ret..separator..mpaCharacters[slot]["class"] end end return ret end function getMultiplayerCharacterButtonText(slot) local ret = "" if mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID == mpaCharacters[slot]["player"] then ret = t("CREATE_CHAR_BUTTON") elseif mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID ~= mpaCharacters[slot]["player"] then ret = "" elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] == "" then ret = "" elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" and mpaCharacters[slot]["player"] ~= multiplayerLocalPlayerID then ret = t("MULTIPLAYER_VIEW_DETAILS_BUTTON") elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" and mpaCharacters[slot]["player"] == multiplayerLocalPlayerID and multiplayer.allowreformparty == false and multiplayerDifficultyLabel ~= "" then ret = t("MULTIPLAYER_VIEW_DETAILS_BUTTON") elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" and mpaCharacters[slot]["player"] == multiplayerLocalPlayerID then ret = t("MULTIPLAYER_EDIT_CHAR_BUTTON") end return ret end function shouldGreyscaleEditButton(slot) local ret = false local storedString = t("MULTIPLAYER_VIEW_DETAILS_BUTTON") if multiplayerFromInGame == true then ret = true end if ret == true and getMultiplayerCharacterButtonText(slot) == storedString then ret = false end if ret == true and (multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[7] == true) then ret = false end if ret == true and mpaCharacters[slot]["name"] == "" then ret = false end if ret == false and mpaCharacters[slot]['ready'] == true and getMultiplayerCharacterButtonText(slot) ~= storedString and multiplayerFromInGame == false then ret = true end return ret end function getMultiplayerCharacterReadyText(slot) local ret = "" if mpaCharacters[slot]["name"] == "" and mpaCharacters[slot]["inprogress"] == false then ret = "" elseif mpaCharacters[slot]["ready"] == false then ret = t("MULTIPLAYER_NOT_READY_MESSAGE") elseif mpaCharacters[slot]["ready"] == true then ret = t("MULTIPLAYER_READY_MESSAGE") end return ret end function getMultiplayerPlayerName(slot,newLine,hostyou) local ret = mpaPlayers[slot]["name"] if ret ~= "" then ret = "^0x"..mpaPlayers[slot]["color"]..mpaPlayers[slot]["name"].."^-" end local separator = " " if newLine == true then separator = "\n" end if hostyou == true then if slot == multiplayerLocalPlayerID then ret = ret..separator.."^0xFFFFFFFF"..t("MULTIPLAYER_PLAYER_YOU").."^-" elseif slot == 1 then ret = ret..separator.."^0xFFFFFFFF"..t("MULTIPLAYER_PLAYER_HOST").."^-" elseif ret == "" then ret = "^0xFF9B9B9B"..t("MULTIPLAYER_EMPTY_PLAYER").."^-" end end return ret end function getMultiplayerPlayerControlledCharacter(player,slot) local count = 0 local ret = "NOCTRL" -- need blank square or something local index = 1 for index = 1, 6, 1 do if mpaCharacters[index]["player"] == player then count = count + 1 end if currentMultiplayerSelectPlayer == player and mpDraggedCharacter == index then slot = slot + 1 end if count == slot then ret = mpaCharacters[index]["portrait"] break end end return ret end function getMultiplayerPlayerControlledCharacterSlot(player,slot) local count = 0 local ret = -1 local index = 1 for index = 1, 6, 1 do if mpaCharacters[index]["player"] == player then count = count + 1 end if count == slot then ret = index break end end return ret end function getPlayerKickWidth(slot) if multiplayerLocalPlayerID ~= 1 or slot == 1 then return 0 else return 10 end end function getPlayerNameWidth(slot) if multiplayerLocalPlayerID ~= 1 or slot == 1 then return 45 else return 35 end end function getStartGameButtonTooltip() if multiplayer.donebuttonclickable then return "" else return t("MULTIPLAYER_CANNOT_START") end end function updateMultiplayerSessionData(sessionName, saveName, chapter, timePlayed, difficulty) local gold = "^0xffc7f8fb" multiplayerSessionName = gold..sessionName.."^-" if areaName ~= "" then multiplayerSaveName = gold..t("MULTIPLAYER_SAVED_GAME_LABEL").."^- ^0xffffffff"..saveName.."^-" multiplayerChapter = gold..t("MULTIPLAYER_CHAPTER_LABEL").."^- ^0xffffffff"..chapter.."^-" multiplayerTimePlayed = gold..t("MULTIPLAYER_TIME_PLAYED_LABEL").."^- ^0xffffffff"..timePlayed.."^-" if difficulty > 0 then mulitplayerPreexistingDifficulty = difficulty multiplayerDifficultyLabel = gold..t("MULTIPLAYER_DIFFICULTY_LABEL").."^-^0xffffffff"..t(difficulties[difficulty].name).."^-" end else multiplayerSaveName = gold..t("MULTIPLAYER_NEW_GAME_LABEL").."^- ^0xffffffff"..saveName.."^-" multiplayerChapter = gold..t("MULTIPLAYER_CHAPTER_LABEL").."^- ^0xffffffff"..chapter.."^-" multiplayerTimePlayed = gold..t("MULTIPLAYER_TIME_PLAYED_NEW_GAME").."^-" if difficulty > 0 then multiplayerDifficultyLabel = gold..t("MULTIPLAYER_DIFFICULTY_LABEL").."^- ^0xffffffff"..t(difficulties[difficulty].name).."^-" end end end function broadcastCharacterControlChange(slot, newPlayer) print("newPlayer "..newPlayer.." current "..currentMultiplayerSelectPlayer.." playernumber "..mpaCharacters[slot]["player"]) if mpaCharacters[slot]["player"] ~= newPlayer then local host = getMultiplayerPlayerName(1,false,false) local player = getMultiplayerPlayerName(newPlayer,false,false) setStringTokenLua("",host) setStringTokenLua("",player) local message = t("MULTIPLAYER_SLOT_"..slot.."_ASSIGNED_TO") removeStringTokenLua("") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end end function broadcastCharacterAdded(slot) local player = getMultiplayerPlayerName(mpaCharacters[slot]["player"],false,false) local character = getMultiplayerCharacterName(slot, false, true) setStringTokenLua("",player) setStringTokenLua("",character) local message = t("MULTIPLAYER_HAS_ADDED") removeStringTokenLua("") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end function broadcastCharacterRemoved(slot) local player = getMultiplayerPlayerName(mpaCharacters[slot]["player"],false,false) local character = getMultiplayerCharacterName(slot, false, true) setStringTokenLua("",player) setStringTokenLua("",character) local message = t("MULTIPLAYER_HAS_REMOVED") removeStringTokenLua("") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end function broadcastCharacterReady(slot) local character = getMultiplayerCharacterName(slot, false, false) setStringTokenLua("",character) local message = t("MULTIPLAYER_IS_READY_TO_START") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end function broadcastCharacterNotReady(slot) local character = getMultiplayerCharacterName(slot, false, false) setStringTokenLua("",character) local message = t("MULTIPLAYER_IS_NO_LONGER_READY") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end function broadcastPlayerAdded(slot) local player = getMultiplayerPlayerName(slot,false,false) setStringTokenLua("",player) local message = t("MULTIPLAYER_HAS_JOINED_THE_GAME") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end function broadcastPlayerRemoved(slot) local player = getMultiplayerPlayerName(slot,false,false) setStringTokenLua("",player) local message = t("MULTIPLAYER_HAS_LEFT_THE_GAME") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end mpDraggedCharacter = nil mpDraggedPortrait = 'NOCTRL' function multiplayerStartSwapPortraits(player, character) if multiplayerLocalPlayerID == 1 and player > 0 and player < 7 and mpaPlayers[player]["name"] ~= "" then print("Starting the drag of player "..player.." character slot "..character) mpDraggedCharacter = character multiplayerScreen:SetModifiedCharacterSlot(character - 1) currentMultiplayerSelectPlayer = player mpDraggedPortrait = mpaCharacters[character]["portrait"] end end function multiplayerStopSwapPortraits(player) if multiplayerLocalPlayerID == 1 then if player > 0 and player < 7 and mpaPlayers[player]["name"] ~= "" and currentMultiplayerSelectPlayer ~= nil then if mpaCharacters[mpDraggedCharacter]['ready'] == true and mpaCharacters[mpDraggedCharacter]['player'] ~= player then multiplayerScreen:OnReadyButtonClick(mpDraggedCharacter-1) end broadcastCharacterControlChange(mpDraggedCharacter, player) multiplayerScreen:OnPlayerSelection(player-1) end mpDraggedCharacter = nil currentMultiplayerSelectPlayer = nil mpDraggedPortrait = 'NOCTRL' end end function getMultiplayerReadyTooltip(character) local ret = "" if mpaCharacters[character]["ready"] == true then ret = t("MULTIPLAYER_READY_BUTTON_ON_TOOLTIP") else ret = t("MULTIPLAYER_READY_BUTTON_OFF_TOOLTIP") end return ret end function multiplayerUpdateDraggedPortrait() if mpDraggedPortrait ~= 'NOCTRL' and multiplayerLocalPlayerID == 1 then local x,y,w,h = Infinity_GetArea('multiplayerDraggingPortraitImage') x,y = Infinity_GetMousePosition(); x = x - 20 y = y - 30 Infinity_SetArea('multiplayerDraggingPortraitImage',x,y,w,h) return true else local x,y,w,h = Infinity_GetArea('multiplayerDraggingPortraitImage') Infinity_SetArea('multiplayerDraggingPortraitImage',-20,-20,w,h) return false end end function get4CheckFrame(slot) local ret = 0 if mpaCharacters[slot]['ready'] == true and mpaCharacters[slot]['player'] == multiplayerLocalPlayerID then ret = 2 elseif mpaCharacters[slot]['ready'] == true then ret = 4 elseif mpaCharacters[slot]['ready'] == false and mpaCharacters[slot]['player'] ~= multiplayerLocalPlayerID then ret = 3 end return ret end ` menu { name 'MULTIPLAYER' align center center ignoreesc onOpen " existingDifficulty = Infinity_GetOption(12, 8) + 1; multiplayerFromInGame = multiplayerScreen:GetEngineState() == 2 " label { mosaic GUISMBM area 0 0 1024 768 } label { area 162 16 700 44 text "ARBITRATION_TITLE" text style "title" } label { area 514 70 492 618 fill 0 0 0 255 } label { area 504 60 512 638 rectangle 3 } label { area 524 112 471 93 fill 20 107 102 180 } label { area 524 207 471 93 fill 50 50 50 180 } label { area 524 302 471 93 fill 20 107 102 180 } label { area 524 397 471 93 fill 50 50 50 180 } label { area 524 492 471 93 fill 20 107 102 180 } label { area 524 587 471 93 fill 50 50 50 180 } label { area 524 84 136 22 text lua "t('PLAYER_LABEL')" text style "label" align center center } label { area 660 84 232 22 text lua "t('CHARACTER_LABEL')" text style "label" align center center } label { area 892 84 103 22 text lua "t('READY_TO_PLAY_LABEL')" text style "label" align center center } list -- character list { column --player { width 32 label { area 7 5 140 44 text lua "getMultiplayerPlayerName(mpaCharacters[rowNumber]['player'],true,true)" text style "label" enabled "multiplayerLocalPlayerID == 1 and rowNumber ~= 1" } label { area 7 0 145 95 text lua "getMultiplayerPlayerName(mpaCharacters[rowNumber]['player'],true,true)" text style "label" enabled "multiplayerLocalPlayerID ~= 1 or rowNumber == 1" } label { area 7 50 145 32 bam 'GUIBUTNS' sequenceonce "getRandomButtonSequence('GUIBUTNS')" frame lua "currentCellCheck(1)" align center center enabled "multiplayerLocalPlayerID == 1 and rowNumber ~= 1" text lua "t('MULTIPLAYER_CHANGE_PLAYER_BUTTON')" text style "button" } } column --portrait { width 15 label { area 2 1 64 90 bam 'GUIRSP10' sequence 0 align center center } label { area 6 3 56 85 bitmap lua 'mpaCharacters[rowNumber]["portrait"]' sequence 1 align center center } } column --character { width 45 label { area 4 0 195 44 text lua "getMultiplayerCharacterName(rowNumber, true, true)" text style "label" enabled "getMultiplayerCharacterButtonText(rowNumber) ~= ''" } label { area 4 0 195 95 text lua "getMultiplayerCharacterName(rowNumber, true, true)" text style "label" enabled "getMultiplayerCharacterButtonText(rowNumber) == ''" } label { area 8 45 195 44 bam 'GUIBUTNT' sequenceonce "getRandomButtonSequence('GUIBUTNT')" frame lua "currentCellCheck(3)" align center center enabled "getMultiplayerCharacterButtonText(rowNumber) ~= ''" } label { area 8 45 195 44 text lua "getMultiplayerCharacterButtonText(rowNumber)" text style "button" } label { area 8 45 195 44 fill 0 0 0 170 enabled "shouldGreyscaleEditButton(rowNumber)" } } column --ready { width 13 label { area 0 50 50 44 text lua "getMultiplayerCharacterReadyText(rowNumber)" text style "label" } } area 520 112 475 570 rowheight 95 table "mpaCharacters" var selectedCharacter scrollbar 'GUISCRC' hidehighlight action " if cellNumber == 1 then cellNumber = nil if multiplayerLocalPlayerID == 1 and selectedCharacter ~= 1 then if multiplayerFromInGame == false then multiplayerScreen:SetModifiedCharacterSlot(selectedCharacter - 1) currentMultiplayerSelectPlayer = mpaCharacters[selectedCharacter]['player'] Infinity_PushMenu('MP_PICKPLAYER') elseif shouldGreyscaleEditButton(selectedCharacter) == false then multiplayerScreen:OnModifyButtonClick() end end elseif cellNumber == 2 then cellNumber = nil elseif cellNumber == 3 then cellNumber = nil if shouldGreyscaleEditButton(selectedCharacter) == false then if getMultiplayerCharacterButtonText(selectedCharacter) == t('MULTIPLAYER_VIEW_DETAILS_BUTTON') then multiplayerScreen:OnPortraitButtonClick(selectedCharacter-1) elseif getMultiplayerCharacterButtonText(selectedCharacter) == t('CREATE_CHAR_BUTTON') then if multiplayerFromInGame == false then multiplayerScreen:SetModifiedCharacterSlot(selectedCharacter-1) multiplayerScreen:UpdateModifyCharacterPanel() elseif shouldGreyscaleEditButton(selectedCharacter) == false then multiplayerScreen:OnModifyButtonClick() end elseif getMultiplayerCharacterButtonText(selectedCharacter) == t('MULTIPLAYER_EDIT_CHAR_BUTTON') then if multiplayerFromInGame == false then mpModifyingCharacter = selectedCharacter - 1 Infinity_PushMenu('MP_MODIFYCHARACTER') elseif shouldGreyscaleEditButton(selectedCharacter) == false then multiplayerScreen:OnModifyButtonClick() end end end elseif cellNumber == 4 then cellNumber = nil end " actionAlt " cellNumber = nil " } --ready buttons button { area 942 112 50 50 bam 'ROUNDBUT' scaleToClip frame lua "get4CheckFrame(1)" tooltip lua "getMultiplayerReadyTooltip(1)" action " if multiplayerFromInGame == false then if multiplayerLocalPlayerID == mpaCharacters[1]['player'] then multiplayerScreen:OnReadyButtonClick(1-1) end end " } button { area 942 207 50 50 bam 'ROUNDBUT' scaleToClip frame lua "get4CheckFrame(2)" action " if multiplayerFromInGame == false then if multiplayerLocalPlayerID == mpaCharacters[2]['player'] then multiplayerScreen:OnReadyButtonClick(2-1) end end " } button { area 942 302 50 50 bam 'ROUNDBUT' scaleToClip frame lua "get4CheckFrame(3)" action " if multiplayerFromInGame == false then if multiplayerLocalPlayerID == mpaCharacters[3]['player'] then multiplayerScreen:OnReadyButtonClick(3-1) end end " } button { area 942 397 50 50 bam 'ROUNDBUT' scaleToClip frame lua "get4CheckFrame(4)" action " if multiplayerFromInGame == false then if multiplayerLocalPlayerID == mpaCharacters[4]['player'] then multiplayerScreen:OnReadyButtonClick(4-1) end end " } button { area 942 492 50 50 bam 'ROUNDBUT' scaleToClip frame lua "get4CheckFrame(5)" action " if multiplayerFromInGame == false then if multiplayerLocalPlayerID == mpaCharacters[5]['player'] then multiplayerScreen:OnReadyButtonClick(5-1) end end " } button { area 942 587 50 50 bam 'ROUNDBUT' scaleToClip frame lua "get4CheckFrame(6)" action " if multiplayerFromInGame == false then if multiplayerLocalPlayerID == mpaCharacters[6]['player'] then multiplayerScreen:OnReadyButtonClick(6-1) end end " } label { area 40 308 454 25 fill 125 125 125 180 } label { area 40 343 454 47 fill 50 50 50 180 } label { area 40 394 454 47 fill 50 50 50 180 } label { area 40 445 454 47 fill 50 50 50 180 } label { area 40 496 454 47 fill 50 50 50 180 } label { area 40 547 454 47 fill 50 50 50 180 } label { area 40 598 454 47 fill 50 50 50 180 } label { area 40 308 207 25 text lua "t('PLAYERS_LABEL')" text style "label" align center center } label { area 247 308 187 25 text lua "t('PARTY_SLOTS_LABEL')" text style "label" align center center } label { area 434 308 60 25 text lua "t('RULES_LABEL')" text style "label" align center center } list -- player list { column -- kick { width lua "getPlayerKickWidth(rowNumber)" label { area 6 5 45 45 } } column --player { width lua "getPlayerNameWidth(rowNumber)" label { area 0 0 195 55 text lua "getMultiplayerPlayerName(rowNumber, false, true)" text style "label" align left center enabled "getPlayerKickWidth(rowNumber) == 0" } label { area 0 0 150 55 text lua "getMultiplayerPlayerName(rowNumber, false, true)" text style "label" align left center enabled "getPlayerKickWidth(rowNumber) ~= 0" } } column --portraits { width 45 label { area 6 5 25 38 } } column -- permissions { width 10 label { area 6 5 45 45 } } area 52 339 442 306 rowheight 51 table "mpaPlayers" var selectedPlayer scrollbar 'GUISCRC' hidehighlight action " if cellNumber == 1 and selectedPlayer > 1 then cellNumber = 0 elseif cellNumber == 2 then cellNumber = 0 elseif cellNumber == 3 then cellNumber = 0 elseif cellNumber == 4 and selectedPlayer > 1 then cellNumber = 0 end " } --kick button { area 40 395 46 45 bam GUMPBUTX sequence 4 clickable lua "mpaPlayers[2]['name'] ~= ''" align center center enabled "multiplayerLocalPlayerID == 1" tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')" action " if mpaPlayers[2]['name'] ~= '' then multiplayerScreen:OnKickPlayerButtonClick(2-1) end " } button { area 40 446 46 45 bam GUMPBUTX sequence 4 clickable lua "mpaPlayers[3]['name'] ~= ''" align center center enabled "multiplayerLocalPlayerID == 1" tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')" action " if mpaPlayers[3]['name'] ~= '' then multiplayerScreen:OnKickPlayerButtonClick(3-1) end " } button { area 40 497 46 45 bam GUMPBUTX sequence 4 clickable lua "mpaPlayers[4]['name'] ~= ''" align center center enabled "multiplayerLocalPlayerID == 1" tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')" action " if mpaPlayers[4]['name'] ~= '' then multiplayerScreen:OnKickPlayerButtonClick(4-1) end " } button { area 40 548 46 45 bam GUMPBUTX sequence 4 clickable lua "mpaPlayers[5]['name'] ~= ''" align center center enabled "multiplayerLocalPlayerID == 1" tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')" action " if mpaPlayers[5]['name'] ~= '' then multiplayerScreen:OnKickPlayerButtonClick(5-1) end " } button { area 40 599 46 45 bam GUMPBUTX sequence 4 clickable lua "mpaPlayers[6]['name'] ~= ''" align center center enabled "multiplayerLocalPlayerID == 1" tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')" action " if mpaPlayers[6]['name'] ~= '' then multiplayerScreen:OnKickPlayerButtonClick(6-1) end " } --permissions button { area 446 395 46 45 bam GUMPBUTX sequence 3 clickable lua "mpaPlayers[2]['name'] ~= '' and multiplayerLocalPlayerID == 1" align center center tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')" action " if mpaPlayers[2]['name'] ~= '' then multiplayerInPermission = true multiplayerInPermissionForPlayer = 2 Infinity_PushMenu('MP_PERMISSIONS') end " } button { area 446 446 46 45 bam GUMPBUTX sequence 3 clickable lua "mpaPlayers[3]['name'] ~= '' and multiplayerLocalPlayerID == 1" align center center tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')" action " if mpaPlayers[3]['name'] ~= '' then multiplayerInPermission = true multiplayerInPermissionForPlayer = 3 Infinity_PushMenu('MP_PERMISSIONS') end " } button { area 446 497 46 45 bam GUMPBUTX sequence 3 clickable lua "mpaPlayers[4]['name'] ~= '' and multiplayerLocalPlayerID == 1" align center center tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')" action " if mpaPlayers[4]['name'] ~= '' then multiplayerInPermission = true multiplayerInPermissionForPlayer = 4 Infinity_PushMenu('MP_PERMISSIONS') end " } button { area 446 548 46 45 bam GUMPBUTX sequence 3 clickable lua "mpaPlayers[5]['name'] ~= '' and multiplayerLocalPlayerID == 1" align center center tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')" action " if mpaPlayers[5]['name'] ~= '' then multiplayerInPermission = true multiplayerInPermissionForPlayer = 5 Infinity_PushMenu('MP_PERMISSIONS') end " } button { area 446 599 46 45 bam GUMPBUTX sequence 3 clickable lua "mpaPlayers[6]['name'] ~= '' and multiplayerLocalPlayerID == 1" align center center tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')" action " if mpaPlayers[6]['name'] ~= '' then multiplayerInPermission = true multiplayerInPermissionForPlayer = 6 Infinity_PushMenu('MP_PERMISSIONS') end " } --character drag/drop --player 1 button { area 247 348 180 38 actionSimpleDrop " multiplayerStopSwapPortraits(1) " } button { area 247 348 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(1,1)' sequence 1 align center center --No changing control of character 1 } button { area 278 348 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(1,2)' sequence 1 align center center actionSimpleDrag " if multiplayerFromInGame == false then local slot = getMultiplayerPlayerControlledCharacterSlot(1,2) multiplayerStartSwapPortraits(1,slot) elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then multiplayerScreen:OnModifyButtonClick() end " actionSimpleDrop " multiplayerStopSwapPortraits(1) " } button { area 309 348 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(1,3)' sequence 1 align center center actionSimpleDrag " if multiplayerFromInGame == false then local slot = getMultiplayerPlayerControlledCharacterSlot(1,3) multiplayerStartSwapPortraits(1,slot) elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then multiplayerScreen:OnModifyButtonClick() end " actionSimpleDrop " multiplayerStopSwapPortraits(1) " } button { area 340 348 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(1,4)' sequence 1 align center center actionSimpleDrag " if multiplayerFromInGame == false then local slot = getMultiplayerPlayerControlledCharacterSlot(1,4) multiplayerStartSwapPortraits(1,slot) elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then multiplayerScreen:OnModifyButtonClick() end " actionSimpleDrop " multiplayerStopSwapPortraits(1) " } button { area 371 348 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(1,5)' sequence 1 align center center actionSimpleDrag " if multiplayerFromInGame == false then local slot = getMultiplayerPlayerControlledCharacterSlot(1,5) multiplayerStartSwapPortraits(1,slot) elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then multiplayerScreen:OnModifyButtonClick() end " actionSimpleDrop " multiplayerStopSwapPortraits(1) " } button { area 402 348 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(1,6)' sequence 1 align center center actionSimpleDrag " if multiplayerFromInGame == false then local slot = getMultiplayerPlayerControlledCharacterSlot(1,6) multiplayerStartSwapPortraits(1,slot) elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then multiplayerScreen:OnModifyButtonClick() end " actionSimpleDrop " multiplayerStopSwapPortraits(1) " } --player 2 button { area 247 399 180 38 actionSimpleDrop " multiplayerStopSwapPortraits(2) " } button { area 247 399 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(2,1)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(2,1) multiplayerStartSwapPortraits(2,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(2) " } button { area 278 399 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(2,2)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(2,2) multiplayerStartSwapPortraits(2,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(2) " } button { area 309 399 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(2,3)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(2,3) multiplayerStartSwapPortraits(2,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(2) " } button { area 340 399 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(2,4)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(2,4) multiplayerStartSwapPortraits(2,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(2) " } button { area 371 399 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(2,5)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(2,5) multiplayerStartSwapPortraits(2,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(2) " } button { area 402 399 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(2,6)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(2,6) multiplayerStartSwapPortraits(2,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(2) " } --player 3 button { area 247 449 180 38 actionSimpleDrop " multiplayerStopSwapPortraits(3) " } button { area 247 449 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(3,1)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(3,1) multiplayerStartSwapPortraits(3,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(3) " } button { area 278 449 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(3,2)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(3,2) multiplayerStartSwapPortraits(3,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(3) " } button { area 309 449 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(3,3)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(3,3) multiplayerStartSwapPortraits(3,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(3) " } button { area 340 449 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(3,4)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(3,4) multiplayerStartSwapPortraits(3,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(3) " } button { area 371 449 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(3,5)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(3,5) multiplayerStartSwapPortraits(3,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(3) " } button { area 402 449 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(3,6)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(3,6) multiplayerStartSwapPortraits(3,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(3) " } --player 4 button { area 247 500 180 38 actionSimpleDrop " multiplayerStopSwapPortraits(4) " } button { area 247 500 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(4,1)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(4,1) multiplayerStartSwapPortraits(4,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(4) " } button { area 278 500 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(4,2)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(4,2) multiplayerStartSwapPortraits(4,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(4) " } button { area 309 500 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(4,3)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(4,3) multiplayerStartSwapPortraits(4,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(4) " } button { area 340 500 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(4,4)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(4,4) multiplayerStartSwapPortraits(4,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(4) " } button { area 371 500 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(4,5)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(4,5) multiplayerStartSwapPortraits(4,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(4) " } button { area 402 500 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(4,6)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(4,6) multiplayerStartSwapPortraits(4,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(4) " } --player 5 button { area 247 551 180 38 actionSimpleDrop " multiplayerStopSwapPortraits(5) " } button { area 247 551 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(5,1)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(5,1) multiplayerStartSwapPortraits(5,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(5) " } button { area 278 551 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(5,2)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(5,2) multiplayerStartSwapPortraits(5,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(5) " } button { area 309 551 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(5,3)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(5,3) multiplayerStartSwapPortraits(5,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(5) " } button { area 340 551 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(5,4)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(5,4) multiplayerStartSwapPortraits(5,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(5) " } button { area 371 551 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(5,5)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(5,5) multiplayerStartSwapPortraits(5,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(5) " } button { area 402 551 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(5,6)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(5,6) multiplayerStartSwapPortraits(5,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(5) " } --player 6 button { area 247 602 180 38 actionSimpleDrop " multiplayerStopSwapPortraits(6) " } button { area 247 602 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(6,1)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(6,1) multiplayerStartSwapPortraits(6,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(6) " } button { area 278 602 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(6,2)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(6,2) multiplayerStartSwapPortraits(6,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(6) " } button { area 309 602 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(6,3)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(6,3) multiplayerStartSwapPortraits(6,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(6) " } button { area 340 602 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(6,4)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(6,4) multiplayerStartSwapPortraits(6,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(6) " } button { area 371 602 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(6,5)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(6,5) multiplayerStartSwapPortraits(6,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(6) " } button { area 402 602 25 38 bitmap lua 'getMultiplayerPlayerControlledCharacter(6,6)' sequence 1 align center center actionSimpleDrag " local slot = getMultiplayerPlayerControlledCharacterSlot(6,6) multiplayerStartSwapPortraits(6,slot) " actionSimpleDrop " multiplayerStopSwapPortraits(6) " } label -- game name { area 40 84 454 56 text lua "multiplayerSessionName" text style 'label' } label -- new game type/save name { area 206 140 288 44 text lua "multiplayerSaveName" text style 'label' align left center } label -- chapter { area 206 180 288 44 text lua "multiplayerChapter" text style 'label' align left center } label -- time played { area 206 220 288 44 text lua "multiplayerTimePlayed" text style 'label' align left center } label -- difficulty { area 206 260 288 44 text lua "multiplayerDifficultyLabel" text style 'label' align left center } label -- logo { area 26 109 174 199 bam "LOGOIWD" enabled "not e:GetObjectGame():GetMissionPackInfo25()" sequence 0 align center center } label -- logo { area 26 109 174 199 bam "LOGOHOW" enabled "e:GetObjectGame():GetMissionPackInfo25()" sequence 0 align center center } button { area 524 714 232 44 bam 'GUIBUTMT' sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "START_GAME_BUTTON" -- Done text style 'button' clickable lua "multiplayer.donebuttonclickable" enabled "not multiplayerFromInGame" tooltip lua "getStartGameButtonTooltip()" action " multiplayerScreen:OnMainDoneButtonClick(mulitplayerPreexistingDifficulty) " } button { on escape area 524 714 236 44 bam 'GUIBUTMT' sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" -- Done text style 'button' clickable lua "multiplayer.donebuttonclickable" enabled "multiplayerFromInGame" tooltip lua "getStartGameButtonTooltip()" action " multiplayerScreen:OnMainDoneButtonClick(mulitplayerPreexistingDifficulty) " } button { area 284 714 230 44 bam 'GUIBUTMT' sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "LOGOUT_BUTTON" -- Logout text style 'button' action " multiplayerScreen:OnLogoutButtonClick() " } button { area 303 654 197 44 bam 'GUIBUTNT' sequenceonce "getRandomButtonSequence('GUIBUTNT')" text "MULTIPLAYER_GAME_OPTIONS_BUTTON" text style 'button' enabled "multiplayerLocalPlayerID == 1" action " helpTextString = Infinity_FetchString(11323) Infinity_PushMenu('MP_OPTIONS') " } --dragged portrait label { name "multiplayerDraggingPortraitImage" area -20 -20 37 57 bitmap lua 'mpDraggedPortrait' sequence 1 align center center enabled "multiplayerUpdateDraggedPortrait()" } } ` multiplayerPermissions = { {'MULTIPLAYER_PERMISSIONS_MODIFY', 'MULTIPLAYER_PERMISSIONS_MODIFY_TOOLTIP', false, false, 7}, {'MULTIPLAYER_PERMISSIONS_GOLD', 'MULTIPLAYER_PERMISSIONS_GOLD_TOOLTIP', false, false, 0}, {'MULTIPLAYER_PERMISSIONS_TRAVEL', 'MULTIPLAYER_PERMISSIONS_TRAVEL_TOOLTIP', false, false, 1}, {'MULTIPLAYER_PERMISSIONS_VIEW', 'MULTIPLAYER_PERMISSIONS_VIEW_TOOLTIP', false, false, 3}, {'MULTIPLAYER_PERMISSIONS_DIALOGUE','MULTIPLAYER_PERMISSIONS_DIALOGUE_TOOLTIP', false, false, 2}, {'MULTIPLAYER_PERMISSIONS_PAUSE', 'MULTIPLAYER_PERMISSIONS_PAUSE_TOOLTIP', false, false, 4} } function broadcastPermissionChange(player,permission,setting) local player = getMultiplayerPlayerName(player,false,true) local todo = t(multiplayerPermissions[permission][1]) setStringTokenLua("",player) setStringTokenLua("",todo) if setting == true then message = t("MULTIPLAYER_IS_NOW_PERMITTED") else message = t("MULTIPLAYER_IS_NOT_PERMITTED") end removeStringTokenLua("") removeStringTokenLua("") print(message) Infinity_SendChatMessage(message, true) end function getMultiplayerPlayerPermissionDescription() local player = getMultiplayerPlayerName(multiplayerInPermissionForPlayer,false,false) setStringTokenLua("",player) local canPerform = t("MULTIPLAYER_CAN_PERFORM") removeStringTokenLua("") return canPerform end ` menu { name 'MP_PERMISSIONS' align center center modal onOpen " local index = 1 for index = 0, #(multiplayer.player[multiplayerInPermissionForPlayer].permissions), 1 do local luaIndex = -1 local loopLuaIndex = -1 for loopLuaIndex = 1, #multiplayerPermissions, 1 do if multiplayerPermissions[loopLuaIndex][5] == index then luaIndex = loopLuaIndex break end end if luaIndex ~= -1 then if multiplayer.player[multiplayerInPermissionForPlayer].permissions[index] == true then multiplayerPermissions[luaIndex][3] = true multiplayerPermissions[luaIndex][4] = true elseif multiplayer.player[multiplayerInPermissionForPlayer].permissions[index] == false then multiplayerPermissions[luaIndex][3] = false multiplayerPermissions[luaIndex][4] = false else multiplayerPermissions[luaIndex][3] = false multiplayerPermissions[luaIndex][4] = false end end end " label { area 0 4 512 656 mosaic "GUICONNB" } label { area 56 16 388 38 text "PERMISSIONS_TITLE" text style "title" } label { area 88 72 330 48 text lua "getMultiplayerPlayerPermissionDescription()" text style "title" } button { bam XBUTT on esc area 462 10 44 44 action " multiplayerScreen:OnCancelButtonClick() Infinity_PopMenu() " } --bottom buttons button { area 152 534 200 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "CANCEL_BUTTON" -- Back text style 'button' action " multiplayerScreen:OnCancelButtonClick() Infinity_PopMenu() " } button { on return area 152 586 200 44 bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" text "DONE_BUTTON" -- Done text style 'button' enabled "multiplayerLocalPlayerID == 1" action " local index = 1 for index = #(multiplayerPermissions), 1, -1 do if multiplayerPermissions[index][3] ~= multiplayerPermissions[index][4] then broadcastPermissionChange(multiplayerInPermissionForPlayer,index,multiplayerPermissions[index][3]) multiplayerScreen:OnPermissionButtonClick(multiplayerInPermissionForPlayer - 1, multiplayerPermissions[index][5]) end end multiplayerInPermission = false multiplayerScreen:OnDoneButtonClick() Infinity_PopMenu() " } --permissions button { area 161 132 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerPermissions[1][3])" tooltip lua "t(multiplayerPermissions[1][2])" action " if multiplayerLocalPlayerID == 1 then multiplayerPermissions[1][3] = not multiplayerPermissions[1][3] end " } text { area 206 126 212 56 text lua "t(multiplayerPermissions[1][1])" tooltip lua "t(multiplayerPermissions[1][2])" text style "normal" align left center } button { area 161 196 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerPermissions[2][3])" tooltip lua "t(multiplayerPermissions[2][2])" action " if multiplayerLocalPlayerID == 1 then multiplayerPermissions[2][3] = not multiplayerPermissions[2][3] end " } text { area 206 190 212 56 text lua "t(multiplayerPermissions[2][1])" tooltip lua "t(multiplayerPermissions[2][2])" text style "normal" align left center } button { area 161 262 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerPermissions[3][3])" tooltip lua "t(multiplayerPermissions[3][2])" action " if multiplayerLocalPlayerID == 1 then multiplayerPermissions[3][3] = not multiplayerPermissions[3][3] end " } text { area 206 254 212 56 text lua "t(multiplayerPermissions[3][1])" tooltip lua "t(multiplayerPermissions[3][2])" text style "normal" align left center } button { area 161 324 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerPermissions[4][3])" tooltip lua "t(multiplayerPermissions[4][2])" action " if multiplayerLocalPlayerID == 1 then multiplayerPermissions[4][3] = not multiplayerPermissions[4][3] end " } text { area 206 318 212 56 text lua "t(multiplayerPermissions[4][1])" tooltip lua "t(multiplayerPermissions[4][2])" text style "normal" align left center } button { area 161 386 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerPermissions[5][3])" tooltip lua "t(multiplayerPermissions[5][2])" action " if multiplayerLocalPlayerID == 1 then multiplayerPermissions[5][3] = not multiplayerPermissions[5][3] end " } text { area 206 380 212 56 text lua "t(multiplayerPermissions[5][1])" tooltip lua "t(multiplayerPermissions[5][2])" text style "normal" align left center } button { area 161 450 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerPermissions[6][3])" tooltip lua "t(multiplayerPermissions[6][2])" action " if multiplayerLocalPlayerID == 1 then multiplayerPermissions[6][3] = not multiplayerPermissions[6][3] end " } text { area 206 444 212 56 text lua "t(multiplayerPermissions[6][1])" tooltip lua "t(multiplayerPermissions[6][2])" text style "normal" align left center } } ` multiplayerGameOptions = { {"LISTEN_JOIN_LABEL", "LISTEN_JOIN_TOOLTIP", false, false}, {"ALLOW_REFORM_LABEL", "ALLOW_REFORM_TOOLTIP", false, false} } multiplayerImportOptions = { {"MULTIPLAYER_IMPORT_CHARACTER_RULES_SEI"}, {"MULTIPLAYER_IMPORT_CHARACTER_RULES_SE"}, {"MULTIPLAYER_IMPORT_CHARACTER_RULES_S"} } multiplayerImportOption = 0 function broadcastOptionChange(slot, onOff) if multiplayerLocalPlayerID == 1 then local message = "" if slot < 3 then local setting = t(multiplayerGameOptions[slot][1]) setStringTokenLua("",setting) if onOff == true then message = t("MULTIPLAYER_GAME_WILL_NOW") else message = t("MULTIPLAYER_GAME_WILL_NO_LONGER") end removeStringTokenLua("") else local setting = t(multiplayerImportOptions[slot-2][1]) setStringTokenLua("",setting) message = t("MULTIPLAYER_IMPORT_SETTINGS_CHANGE") removeStringTokenLua("") end print(message) Infinity_SendChatMessage(message, true) end end ` menu { name 'MP_OPTIONS' align center center modal onOpen " multiplayerGameOptions[1][3] = multiplayer.listentojoin multiplayerGameOptions[1][4] = multiplayerGameOptions[1][3] multiplayerGameOptions[2][3] = multiplayer.allowreformparty multiplayerGameOptions[2][4] = multiplayerGameOptions[2][3] multiplayerImportOption = multiplayer.importsetting + 1 " label { area 0 0 488 656 mosaic "GUICONNB" } label { area 82 70 340 44 text "OPTIONS_TITLE" text style "title" } label { area 74 262 348 56 text "MULTIPLAYER_IMPORT_CHARACTER_RULES_LABEL" text style "title" align center center } button { area 107 136 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight( multiplayerGameOptions[1][3] )" tooltip lua "t(multiplayerGameOptions[1][2])" action " multiplayerGameOptions[1][3] = not multiplayerGameOptions[1][3] " } text { area 152 130 212 55 text lua "t(multiplayerGameOptions[1][1])" text style "normal" tooltip lua "t(multiplayerGameOptions[1][2])" align left center } button { area 107 200 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight( multiplayerGameOptions[2][3] )" tooltip lua "t(multiplayerGameOptions[2][2])" action " multiplayerGameOptions[2][3] = not multiplayerGameOptions[2][3] " } text { area 152 194 212 55 text lua "t(multiplayerGameOptions[2][1])" text style "normal" tooltip lua "t(multiplayerGameOptions[2][2])" align left center } button { area 107 342 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerImportOption == 1)" tooltip lua "t('IMPORT_RULES_TOOLTIP')" action " multiplayerImportOption = 1 " } text { area 152 336 212 55 text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_SEI')" tooltip lua "t('IMPORT_RULES_TOOLTIP')" text style "normal" align left center } button { area 107 400 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerImportOption == 2)" tooltip lua "t('IMPORT_RULES_TOOLTIP')" action " multiplayerImportOption = 2 " } text { area 152 391 212 55 text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_SE')" tooltip lua "t('IMPORT_RULES_TOOLTIP')" text style "normal" align left center } button { area 107 452 40 40 bam ROUNDBUT scaleToClip sequence 0 frame lua "showToggleHighlight(multiplayerImportOption == 3)" tooltip lua "t('IMPORT_RULES_TOOLTIP')" action " multiplayerImportOption = 3 " } text { area 152 446 212 56 text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_S')" tooltip lua "t('IMPORT_RULES_TOOLTIP')" text style "normal" align left center } button { bam XBUTT on esc area 444 8 44 44 action " multiplayerScreen:OnCancelButtonClick() Infinity_PopMenu() " } --bottom buttons button { on return area 136 590 228 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" -- Done text style 'button' action " if multiplayerImportOption ~= multiplayer.importsetting + 1 then multiplayerScreen:SetImportSetting(multiplayerImportOption - 1) broadcastOptionChange(multiplayerImportOption+2) end if multiplayerGameOptions[1][3] ~= multiplayerGameOptions[1][4] then broadcastOptionChange(1, multiplayerGameOptions[1][3]) multiplayerScreen:ToggleListenToJoin() end if multiplayerGameOptions[2][3] ~= multiplayerGameOptions[2][4] then broadcastOptionChange(2, multiplayerGameOptions[2][3]) multiplayerScreen:ToggleAllowReformParty() end Infinity_PopMenu() " } button { on escape area 136 536 228 44 bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" -- Cancel text style 'button' action " multiplayerScreen:OnCancelButtonClick() Infinity_PopMenu() " } } ` function getActivePlayerIndex(index) local ret = -1 local count = 0 local slot = 0 for slot = 1, 6, 1 do if mpaPlayers[slot]["name"] ~= '' then count = count + 1 end if count == index then ret = slot break end end return ret end ` menu { name 'MP_PICKPLAYER' align center center modal label { mosaic 'GUICONNB' area 0 0 512 658 } label { area 56 60 390 44 text "SELECT_PLAYER_TITLE" text style "title" } -- list list { column { width 100 label { area 20 0 320 45 text lua "getMultiplayerPlayerName(getActivePlayerIndex(rowNumber), false, true)" text style "normal" align center center } } action " " rowheight 45 area 82 116 340 394 table "multiplayer.player" var currentMultiplayerSelectPlayer } button { bam XBUTT on esc area 464 4 44 44 action " Infinity_PopMenu() " } button { on escape area 152 534 200 44 text "CANCEL_BUTTON" text style "button" align center center bam 'GUIBUTNT' sequence "getRandomButtonSequence('GUIBUTMT')" action " Infinity_PopMenu() " } button { on escape area 152 586 200 44 text "DONE_BUTTON" text style "button" align center center bam 'GUIBUTNT' sequence "getRandomButtonSequence('GUIBUTMT')" action " if mpaCharacters[selectedCharacter]['ready'] == true and mpaCharacters[selectedCharacter]['player'] ~= getActivePlayerIndex(currentMultiplayerSelectPlayer) then multiplayerScreen:OnReadyButtonClick(selectedCharacter-1) end broadcastCharacterControlChange(selectedCharacter, getActivePlayerIndex(currentMultiplayerSelectPlayer)) multiplayerScreen:OnPlayerSelection(getActivePlayerIndex(currentMultiplayerSelectPlayer)-1) Infinity_PopMenu() " } } ` function multiplayerIsDelete () if (multiplayer.character[mpModifyingCharacter+1].portrait ~= '') then return t("DELETE_BUTTON") else return t("CREATE_BUTTON") end end function getModifyConfirmationLabel() return t('MULTIPLAYER_EDIT_CONFIRM').. ' ' .. getMultiplayerCharacterName(mpModifyingCharacter+1) end ` menu { name 'MP_MODIFYCHARACTER' align center center modal label { mosaic 'GUIERR6' area 0 0 682 234 } label { area 28 20 600 124 text lua "getModifyConfirmationLabel()" text style "title" align center center } button { on escape area 79 170 234 44 text "CANCEL_BUTTON" -- cancel text style "button" align center center bam GUIBUTMT action " Infinity_PopMenu() " } button { on return area 343 170 234 44 text lua "multiplayerIsDelete()" text style "button" align center center bam GUIBUTMT action " Infinity_PopMenu() multiplayerScreen:SetModifiedCharacterSlot(mpModifyingCharacter) if (multiplayer.character[mpModifyingCharacter+1].portrait ~= '') then multiplayerScreen:OnModifyCharacterDelete() else multiplayerScreen:UpdateModifyCharacterPanel() end " } } menu { name 'MP_ERRORONE' align center center modal label { mosaic 'GUIERR6' area 0 0 657 253 } label { area 29 21 600 126 text lua "Infinity_FetchString( mpErrorText )" text style "normal" align center center } button { on return area 213 170 230 44 text "DONE_BUTTON" -- done text style "button" align center center bam GUIBUTMT sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" action " Infinity_PopMenu() " } } menu { name 'MP_ERRORTWO' align center center modal label { mosaic 'GUIERR' area 0 0 464 494 } label { area 124 132 222 108 text lua "Infinity_FetchString( mpErrorText )" text style "normal" align center center } button { on return enabled "mpErrorState == 2" area 86 266 302 44 text "MODIFY_BUTTON" -- modify text style "button" align center center bam GUIBUTWT action " Infinity_PopMenu() multiplayerScreen:ModifyCharacters() " } button { on return enabled "mpErrorState == 3" area 86 270 302 44 text "KICK_BUTTON" -- kick player text style "button" align center center bam GUIBUTWT action " Infinity_PopMenu() multiplayerScreen:KickPlayer() " } button { on return enabled "mpErrorState == 4" area 86 270 302 44 text "LOGOUT_BUTTON" -- log out text style "button" align center center bam GUIBUTWT action " local index = 1 Infinity_PopMenu() multiplayerScreen:Logout() " } button { on escape area 138 314 204 44 text "CANCEL_BUTTON" -- cancel text style "button" align center center bam GUIBUTNT action " Infinity_PopMenu() " } } ` function dragMPChat(newY) --do a quick bounds check. local area = {Infinity_GetArea("mpChatDisplayBackground")} if(area[4] + newY <= 150) then newY = 150 - area[4] end area = {Infinity_GetArea("mpChatHandle")} local screenWidth, screenHeight = Infinity_GetScreenSize() if(area[2] + area[4] + newY > screenHeight) then newY = screenHeight - area[2] - area[4] end adjustItemGroup({"mpChatDisplayBackground","mpChatDisplay"}, 0, 0, 0, newY) adjustItemGroup({"mpChatEditBackground","mpChatEdit","mpChatHandle"}, 0, newY, 0 , 0) end mpChatTable = {} showMpChat = 0 function updateChatViewed() if(showMpChat == 0) then chatViewed = 0 end end function updateMPChatPreview(message) if(showMpChat == 0) then table.insert(mpChatTable,{text = message}) end end function getMPMessageOpacity() local current = mpChatTable[#mpChatTable] if(current == nil) then return 0 end if(current.displayTime == nil) then current.displayTime = 500 --set the box size Infinity_ScaleToText("mpChatPreview") --give some extra room for the padding adjustItemGroup({"mpChatPreview"},0,0,0,16) end if(current.displayTime > 0) then current.displayTime = current.displayTime - 4 end if(current.displayTime > 255) then return 255 else return current.displayTime end end function getMPMessage() if(#mpChatTable > 0 and mpChatTable[#mpChatTable].displayTime ~= nil) then return mpChatTable[#mpChatTable].text end return nil end function getChatIconOpacity() if(chatViewed == 1) then return 255 end local sinWave = math.sin(Infinity_GetFrameCounter() / 15) local sinWaveAdjusted = (sinWave / 2) + 0.5 return sinWaveAdjusted * 255 end function getChatBarTooltip() if(showMpChat == 0) then return t("MULTIPLAYER_CHAT_BAR_COLLAPSED") else return t("MULTIPLAYER_CHAT_BAR_EXPANDED") end end function resizeMpEditBox() Infinity_ScaleToText('mpChatEdit') local x,y,w,h = Infinity_GetArea('mpChatEdit') local offset = 20 if(h + offset < 42) then h = (42 - offset) end Infinity_SetArea('mpChatEdit',x,y,w,h) Infinity_SetArea('mpChatEditBackground',nil,nil,nil,h + offset) Infinity_SetArea('mpChatHandle',nil,y+h+(offset/2),nil,nil) end function mpChatboxScroll(top, height, contentHeight) if(mpChatboxJumpToBottom and contentHeight > height) then mpChatboxJumpToBottom = nil return height-contentHeight end if(mpChatboxScrollToBottom == 0 and mpChatboxScrollLastHeight == contentHeight) then --defer to default scrolling return nil elseif mpChatboxScrollToBottom == 0 then mpChatboxScrollLastHeight = contentHeight return height-contentHeight end if(contentHeight < height) then --no scrolling required, content fits mpChatboxScrollToBottom = nil return nil end local dT = Infinity_GetClockTicks() - mpChatboxScrollTimeLast mpChatboxScrollTimeLast = Infinity_GetClockTicks() top = top + lastTrimmedContentHeight lastTrimmedContentHeight = 0 local newTop = (dT * -0.25) + top if (newTop + contentHeight > height + 200) then return (height - contentHeight + 200) end if(newTop + contentHeight < height) then mpChatboxScrollToBottom = 0 return height - contentHeight end return newTop end mpChatboxScrollLastHeight = 0 mpChatboxScrollToBottom = nil mpChatboxScrollTimeLast = 0 mpChatEditOverlay = "" ` menu { name "MP_CHAT_OVERLAY" enabled "e:IsMultiplayer()" align right top ignoreEsc offset -120 0 onOpen " chatViewed = 1 " label { name "mpChatDisplayBackground" enabled "showMpChat" area 0 0 300 372 rectangle 4 rectangle opacity 200 } label { area 0 0 300 42 rectangle 0 } label { area 10 8 28 28 bam "CHTICN" frame 1 opacity lua "getChatIconOpacity()" } label { area 10 8 28 28 bam "CHTICN" frame 0 opacity lua "255 - getChatIconOpacity()" } label { area 42 0 252 42 text "MULTIPLAYER_CHAT_LABEL" text style "label" } button { area 0 0 300 42 toggle "showMpChat" tooltip lua "getChatBarTooltip()" action " chatViewed = 1 mpChatboxScrollToBottom = 1 if showMpChat == 1 then Infinity_FocusTextEdit('mpChatEdit') else Infinity_FocusTextEdit('') end " } label { name "mpChatPreview" enabled "showMpChat == 0" opacity lua "getMPMessageOpacity()" area 0 42 300 37 text style "normal" text lua "getMPMessage()" pad 8 8 8 8 rectangle 1 ignoreEvents } text { name "mpChatDisplay" enabled "showMpChat" area 22 54 256 268 text lua "mpChatText" scrollbar 'GUISCRC' scrollbar func "mpChatboxScroll" text style normal } label { name "mpChatEditBackground" enabled "showMpChat" area 0 324 300 42 rectangle 0 } edit { name "mpChatEdit" enabled "showMpChat" area 10 334 290 24 var mpChatEditOverlay scrollbar 'GUISCRC' text style "edit" maxchars 255 action " --On return pressed if (key_pressed == 13) then if (mpChatEditOverlay ~= '') then Infinity_SendChatMessage(mpChatEditOverlay, false) Infinity_PlaySound('WAL_19B') mpChatEditOverlay='' resizeMpEditBox() mpChatboxScrollToBottom = 1 return -1 end end return 1 " actionalt " resizeMpEditBox() " } handle { name "mpChatHandle" area 104 366 95 38 bam "MPCHATAB" enabled "showMpChat" tooltip lua "t('MULTIPLAYER_CHAT_RESIZE_TOOLTIP')" actionDrag " dragMPChat(motionY) " } } ` function initQuests() --instead of always searching the quests, just map entry ids to their quests entryToQuest = {} for questIdx, quest in pairs(quests) do quests[questIdx].stateType = const.ENTRY_TYPE_NONE for objIdx,objective in pairs(quest.objectives) do quests[questIdx].objectives[objIdx].stateType = const.ENTRY_TYPE_NONE for entryIdx,entry in pairs(objective.entries) do quests[questIdx].objectives[objIdx].entries[entryIdx].stateType = const.ENTRY_TYPE_NONE entryToQuest[entry.id] = questIdx end end end end function compareByRecvTime(o1,o2) if(not o1.recvTime and not o2.recvTime) then return false end if(not o1.recvTime) then return false end if(not o2.recvTime) then return true end return o1.recvTime > o2.recvTime end function buildEntry(text, recvTime, stateType, chapter, timeStamp) local entry = { text = text, recvTime = recvTime, stateType = stateType, timeStamp = timeStamp, chapters = {} } entry.chapters[chapter] = 1 return entry end --Update a journal entry by the strref/journalId function updateJournalEntry(journalId, recvTime, stateType, chapter, timeStamp) if(stateType == const.ENTRY_TYPE_USER) then local entry = buildEntry(journalId, recvTime, stateType, chapter, timeStamp) table.insert(userNotes,entry) --update display data buildQuestDisplay() return end --find the quest that is parent to this entry. --NOTE this can be placed in a loop if there needs to be more than quest to an entry --this would just mean entryToQuest returns a table that we iterate over local questId = entryToQuest[journalId] if questId == nil or stateType == const.ENTRY_TYPE_INFO then --add loose entries into the looseEntries table so they still get displayed. for _,entry in pairs(looseEntries) do if entry.text == journalId then return end end local entry = buildEntry(journalId, recvTime, stateType, chapter, timeStamp) table.insert(looseEntries,entry) --update display data buildQuestDisplay() return end local quest = quests[questId] if quest == nil then print("JOURNAL ERROR - no quest entry associated with questId "..questId) return end local previous = nil --traverse quest to find objective and entry for objIdx,objective in pairs(quest.objectives) do for entryIdx,entry in pairs(objective.entries) do if(entry.id == journalId) then --now we know where our quest, objective, and entry are --update quest, objective and entry appropriately entry.recvTime = recvTime entry.stateType = stateType if(not entry.chapters) then entry.chapters = {} end entry.chapters[chapter] = 1 entry.timeStamp = timeStamp objective.entries[entryIdx] = entry objective.recvTime = recvTime if(not objective.chapters) then objective.chapters = {} end objective.chapters[chapter] = 1 if(objective.stateType ~= const.ENTRY_TYPE_COMPLETE) then objective.stateType = stateType end quest.objectives[objIdx] = objective quest.recvTime = recvTime if(not quest.chapters) then quest.chapters = {} end quest.chapters[chapter] = 1 if(quest.stateType ~= const.ENTRY_TYPE_COMPLETE) then quest.stateType = stateType end --mark any previous objective as complete if(entry.previous ~= nil) then for objIdx2,objective2 in pairs(quest.objectives) do for k, prevObj in pairs(entry.previous) do if(prevObj == objective2.text) then quest.objectives[objIdx2].stateType = const.ENTRY_TYPE_COMPLETE end end end end quests[questId] = quest --remove all in subgroup (except myself!) if(stateType == const.JOURNAL_STATE_COMPLETE and entry.subGroup) then for k,v in pairs(subGroups[entry.subGroup]) do Infinity_Log("Checking subgroup, id = " .. v.id) if(v.id ~= entry.id) then removeJournalEntry(v.id) end end end end end end --sort the objectives. table.sort(quest.objectives,compareByRecvTime) --update display data buildQuestDisplay() end function checkEntryComplete(journalId, stateType) --Check if a journal entry is part of a quest that's already complete --If anything other than an unfinished entry return false. if(stateType ~= const.ENTRY_TYPE_INPROGRESS) then return false end --Check if my quest is marked complete. local questIndex = entryToQuest[journalId] if (questIndex ~= 1 and quests[questIndex].stateType == const.ENTRY_TYPE_COMPLETE) then return 1 else return 0 end end --this should maybe be done recursively, but i kinda want direct control over each level function buildQuestDisplay() --this is basically just a flatten local chapterIndex = 0 questDisplay = {} journalDisplay = {} local journalEntries = {} --temp holding table for sorting the entries for k,quest in pairs(quests) do --skip inactive quests if(quest.stateType ~= nil and quest.stateType ~= const.ENTRY_TYPE_NONE) then quest.quest = 1 -- tell the renderer what type of entry this is table.insert(questDisplay, quest) local curQuestIdx = #questDisplay --we'll need to modify current quest with it's children, store a reference. local questChildren = {} if curQuestIdx == 1 then questDisplay[curQuestIdx].chapters = {} for index = 0, 7, 1 do questDisplay[curQuestIdx].chapters[index] = 1 end end for k2,objective in pairs(quest.objectives) do if(objective.stateType ~= const.ENTRY_TYPE_NONE) then objective.objective = 1 objective.parent = curQuestIdx if(objective.stateType ~= const.ENTRY_TYPE_INFO) then --info entries should not go into quests table.insert(questDisplay, objective) table.insert(questChildren, #questDisplay) end local curObjectiveIdx = #questDisplay local objectiveChildren = {} for k3,entry in pairs(objective.entries) do entry.entry = 1 entry.parent = curObjectiveIdx if curQuestIdx == 1 and entry.timeStamp ~= nil then entry.chapters = {} for index = 0, 7, 1 do entry.chapters[index] = 1 end end table.insert(questDisplay, entry) table.insert(objectiveChildren, #questDisplay) end questDisplay[curObjectiveIdx].children = objectiveChildren end end questDisplay[curQuestIdx].children = questChildren end end --add the loose entries (entries without quests) to the journal display for k,entry in pairs(looseEntries) do entry.entry = 1 table.insert(journalEntries,entry) end -- add the user entries to the journal display for k,entry in pairs(userNotes) do entry.entry = 2 table.insert(journalEntries,entry) end --sort the entries table.sort(journalEntries, compareByRecvTime) for k,entry in pairs(journalEntries) do local title = {} title.title = 1 title.text = entry.timeStamp title.chapters = entry.chapters table.insert(journalDisplay,title) table.insert(journalDisplay, entry) end end function questContainsSearchString(row) if(journalSearchString == nil or journalSearchString == "") then return 1 end --no search string, do nothing local text = Infinity_FetchString(questDisplay[row].text) if(string.find(string.lower(text),string.lower(journalSearchString))) then return 1 end -- string contains search string. if(questDisplay[row].children == nil) then return nil end --no children, does not contain search string. for k,v in pairs(questDisplay[row].children) do --Infinity_Log(v) if(containsSearchString(v)) then return 1 end -- one of children contains search string end return nil --does not contain search string end function containsChapter(tab, chapter) if(not tab) then return nil end return tab[chapter] end function entryEnabled(row) local rowTab = questDisplay[row] local ret = true if rowTab == nil then ret = false elseif rowTab.entry == nil then ret = false elseif not containsChapter(rowTab.chapters,chapter) then ret = false --elseif not objectiveEnabled(rowTab.parent) then -- ret = false elseif not questDisplay[questDisplay[rowTab.parent].parent].expanded then ret = false elseif journalMode == const.JOURNAL_MODE_DONEQUESTS and questDisplay[row].stateType ~= const.ENTRY_TYPE_COMPLETE then ret = false elseif journalMode == const.JOURNAL_MODE_QUESTS and questDisplay[row].stateType == const.ENTRY_TYPE_COMPLETE then ret = false end return ret end function getEntryText(row) return questDisplay[row].timeStamp .. "\n" .. questDisplay[row].text end function objectiveEnabled(row) local rowTab = questDisplay[row] local ret = true if rowTab == nil then ret = false elseif rowTab.objective == nil then ret = false elseif not containsChapter(rowTab.chapters,chapter) then ret = false elseif not questEnabled(rowTab.parent) then ret = false elseif not questDisplay[rowTab.parent].expanded then ret = false elseif journalMode == const.JOURNAL_MODE_DONEQUESTS and questDisplay[rowTab.parent].stateType ~= const.ENTRY_TYPE_COMPLETE then ret = false elseif journalMode == const.JOURNAL_MODE_QUESTS and questDisplay[rowTab.parent].stateType == const.ENTRY_TYPE_COMPLETE then ret = false end return ret end function getObjectiveText(row) local rowTab = questDisplay[row] if (rowTab == nil) then return nil end local text = rowTab.text if(text == "" or text == nil) then text = t("NO_OBJECTIVE_NORMAL") end --objectives shouldn't really display a completed state since they don't actually follow a progression. --if(getFinished(row)) then -- text = "^0xFF666666" .. text .. " (Finished)^-" --end return text end function questEnabled(row) ret = true if not questDisplay[row] then ret = false elseif not questDisplay[row].quest then ret = false elseif not containsChapter(questDisplay[row].chapters,chapter) then ret = false elseif #questDisplay[row].children <= 0 then ret = false elseif journalMode == const.JOURNAL_MODE_DONEQUESTS and questDisplay[row].stateType ~= const.ENTRY_TYPE_COMPLETE then ret = (row == 1) elseif journalMode == const.JOURNAL_MODE_QUESTS and questDisplay[row].stateType == const.ENTRY_TYPE_COMPLETE then ret = (row == 1) end return ret end function getQuestText(row) local rowTab = questDisplay[row] if (rowTab == nil) then return nil end local text = Infinity_FetchString(rowTab.text) return text end function getArrowFrame(row) if(questDisplay[row] == nil or (questDisplay[row].objective == nil and questDisplay[row].quest == nil)) then return "" end if(questDisplay[row].expanded) then return '-' else return '+' end end function getArrowEnabled(row) if(questDisplay[row].quest == nil and questDisplay[row].objective == nil) then return nil end if(questDisplay[row].objective) then return nil end if(questDisplay[row].quest and not questEnabled(row)) then return nil end return 1 end function getFinished(row) if(questDisplay[row].stateType == const.ENTRY_TYPE_COMPLETE) then return 1 else return nil end end function showObjectiveSeperator(row) if questDisplay[row] ~= nil and questDisplay[row].quest == nil then return 1 else return nil end end function showObjectiveSeperatorold(row) if(objectiveEnabled(row) or entryEnabled(row)) then local idx = row + 1 while(questDisplay[idx]) do if entryEnabled(idx) then return 1 else return nil end idx = idx + 1 end end end function getJournalTitleEnabled(row) local ret = true if not journalDisplay[row].title then ret = false elseif not containsChapter(journalDisplay[row].chapters,chapter) then ret = false elseif not journalContainsSearchString(row) then ret = false elseif journalMode == const.JOURNAL_MODE_JOURNAL and journalDisplay[row+1].entry == 2 then return false elseif journalMode == const.JOURNAL_MODE_USER and journalDisplay[row+1].entry == 1 then return false end return ret end function getJournalTitleText(row) return journalDisplay[row].text end function getJournalEntryEnabled(row) local ret = true if not journalDisplay[row].entry then ret = false elseif not containsChapter(journalDisplay[row].chapters,chapter) then ret = false elseif not journalContainsSearchString(row) then ret = false elseif journalMode == const.JOURNAL_MODE_JOURNAL and journalDisplay[row].entry == 2 then return false elseif journalMode == const.JOURNAL_MODE_USER and journalDisplay[row].entry == 1 then return false end return ret end function getJournalEntryText(row) local text = Infinity_FetchString(journalDisplay[row].text) if(text == nil or text == "") then text = journalDisplay[row].text end if(journalSearchString and journalSearchString ~= "") then --do the search string highlight text = highlightString(text, journalSearchString, "^0xFF0000FF") end return text end function getJournalDarken(row) local entry = journalDisplay[row] if journalMode == const.JOURNAL_MODE_JOURNAL then return false end if(entry.title) then return (row == selectedJournal or row + 1 == selectedJournal) end if(entry.entry) then return (row == selectedJournal or row - 1 == selectedJournal) end end function journalContainsSearchString(row) if(journalSearchString == nil or journalSearchString == "") then return 1 end --no search string, do nothing local text = Infinity_FetchString(journalDisplay[row].text) if(text == "") then text = journalDisplay[row].text end --no stringref, use the text. if(string.find(string.lower(text),string.lower(journalSearchString))) then return 1 end -- string contains search string. --check if the corresponding row to this one contains the string. local pairText = nil if(journalDisplay[row].title) then --check the corresponding entry pairText = Infinity_FetchString(journalDisplay[row+1].text) or journalDisplay[row+1].text if(pairText == "") then pairText = journalDisplay[row+1].text end else if (journalDisplay[row].entry) then pairText = Infinity_FetchString(journalDisplay[row-1].text) or journalDisplay[row-1].text if(pairText == "") then pairText = journalDisplay[row-1].text end end end if(string.find(string.lower(pairText),string.lower(journalSearchString))) then return 1 end -- pair string contains search string. return nil --does not contain search string end function dragJournal() local offsetX,offsetY,menuWidth,menuHeight = Infinity_GetMenuArea('JOURNAL') offsetX = offsetX + motionX offsetY = offsetY + motionY --clamping if(offsetX < 80) then offsetX = 80 end if(offsetY < 0) then offsetY = 0 end local screenWidth, screenHeight = Infinity_GetScreenSize() if(offsetX > screenWidth - 80 - menuWidth) then offsetX = screenWidth - 80 - menuWidth end if(offsetY > screenHeight - menuHeight) then offsetY = screenHeight - menuHeight end Infinity_SetOffset('JOURNAL', offsetX, offsetY) end function journalEntryClickable(selectedJournal) local entry = journalDisplay[selectedJournal] if(entry) then return true end end function getJournalEntryRef(selectedJournal) local entry = journalDisplay[selectedJournal] if(not entry) then return end if(entry.title) then return journalDisplay[selectedJournal + 1].text else return entry.text end end function getJournalBackgroundFrame() if(journalMode == const.JOURNAL_MODE_QUESTS) then return 0 else return 1 end end function isJournalRevertButtonClickable() local ret = false if Infinity_FetchString(journalNoteEditRef) ~= journalNoteEdit then ret = true end return ret end function isJournalDeleteButtonClickable() local ret = false if journalNoteEditRef ~= nil then ret = true end return ret end journalMode = const.JOURNAL_MODE_QUESTS journalSearchString = "" ` menu { name 'JOURNAL' align center center ignoreEsc onOpen " buildQuestDisplay() chapter = math.max(0,Infinity_GetMaxChapterPage()); if(e:GetActiveEngine() == worldScreen) then worldScreenWasPaused = worldScreen:CheckIfPaused() if worldScreenWasPaused == false then worldScreen:TogglePauseGame(true) end end if questDisplay and questDisplay[1] then questDisplay[1].expanded = true end pushSidebars() " onClose " if(e:GetActiveEngine() == worldScreen) then if worldScreenWasPaused == false then worldScreen:TogglePauseGame(true) end worldScreenWasPaused = false end " label --background background { area 0 0 866 714 mosaic "GUIJRNL" } --label --Background --{ -- area 0 0 485 747 -- bam "QUESTBG" -- sequence 0 -- frame lua "getJournalBackgroundFrame()" --} label -- Chapter { area 187 18 487 62 text "JOURNAL_LABEL" text style "title" mosaic "PCHAPTER" } button { area 58 612 232 48 text "JOURNAL_LABEL" text style "button" bam GUIBUTMT glow lua "journalMode == const.JOURNAL_MODE_JOURNAL" sequenceonce "getRandomButtonSequence('GUIBUTMT')" action "journalMode = const.JOURNAL_MODE_JOURNAL" } button { area 72 104 232 46 text "QUESTS_LABEL" text style "button" bam GUIBUTMT glow lua "journalMode == const.JOURNAL_MODE_QUESTS" sequenceonce "getRandomButtonSequence('GUIBUTMT')" action "journalMode = const.JOURNAL_MODE_QUESTS" } button { area 562 104 232 46 text lua "Infinity_FetchString(34593)" text style "button" bam GUIBUTMT glow lua "journalMode == const.JOURNAL_MODE_DONEQUESTS" sequenceonce "getRandomButtonSequence('GUIBUTMT')" action "journalMode = const.JOURNAL_MODE_DONEQUESTS" } button { area 572 612 232 46 text lua "Infinity_FetchString(34594)" text style "button" bam GUIBUTMT glow lua "journalMode == const.JOURNAL_MODE_USER" sequenceonce "getRandomButtonSequence('GUIBUTMT')" action "journalMode = const.JOURNAL_MODE_USER" } label -- Chapter { area 316 100 232 50 text lua "chapterText()" text style "label" mosaic "PCHAPTER" } button --prev chapter { area 54 262 56 134 bam "GUIPRC" sequence 0 action " incrChapter(-1); " } button { area 768 262 54 134 bam "GUIPRC" sequence 1 action " incrChapter(1); " } --[Bug #20368] Recent events button cut for now. -- --button --{ -- enabled "journalMode == const.JOURNAL_MODE_QUESTS" -- area 278 616 162 47 -- bam "PAPERBUT" -- sequence 1 -- text "RECENT_EVENTS_LABEL" -- text style "button_parchment" -- action -- " -- Infinity_PushMenu('JOURNAL_RECENT_EVENTS') -- " --} --label --{ -- enabled "journalMode == const.JOURNAL_MODE_JOURNAL" -- area 54 88 374 32 -- fill 50 50 50 150 --} --edit --{ -- enabled "journalMode == const.JOURNAL_MODE_JOURNAL" -- area 62 94 357 22 -- var journalSearchString -- placeholder "ENTER_SEARCH_TERM_NORMAL" -- text style "edit" -- maxlines 1 --} list { column { width 5 label { area 0 0 31 31 enabled "getArrowEnabled(rowNumber)" text lua "getArrowFrame(rowNumber)" text style "label_parchment" text point 20 align top center } } column { width 95 label { enabled "questEnabled(rowNumber)" area 8 0 -1 -1 text lua "getQuestText(rowNumber)" text style "label" align left center text color M } label { enabled "entryEnabled(rowNumber+1)" area 16 0 -1 -1 pad 0 10 0 10 text lua "getEntryText(rowNumber+1)" text style "normal_parchment" } } enabled "journalMode == const.JOURNAL_MODE_QUESTS or journalMode == const.JOURNAL_MODE_DONEQUESTS" rowheight dynamic hidehighlight seperator "showObjectiveSeperator(rowNumber)" table "questDisplay" var selectedQuest scrollbar 'GUISCRC' area 140 186 578 383 action " if(questDisplay[selectedQuest].expanded) then questDisplay[selectedQuest].expanded = nil else questDisplay[selectedQuest].expanded = 1 end " } list --journal { column { width 100 --light label { enabled "getJournalTitleEnabled(rowNumber) and not getJournalDarken(rowNumber)" area 0 0 -1 -1 pad 0 16 0 0 text lua "getJournalTitleText(rowNumber)" text style "label_parchment" text color 0 120 0 255 } label { enabled "getJournalEntryEnabled(rowNumber) and not getJournalDarken(rowNumber)" area 0 0 -1 -1 pad 8 16 0 16 text lua "getJournalEntryText(rowNumber)" text style "normal_parchment" } --dark label { enabled "(getJournalTitleEnabled(rowNumber) or getJournalEntryEnabled(rowNumber)) and getJournalDarken(rowNumber)" area 0 0 -1 -1 fill 0 0 0 150 } label { enabled "getJournalTitleEnabled(rowNumber) and getJournalDarken(rowNumber)" area 0 0 -1 -1 pad 0 16 0 0 text lua "getJournalTitleText(rowNumber)" text style "label_parchment" text color 255 100 100 255 } label { enabled "getJournalEntryEnabled(rowNumber) and getJournalDarken(rowNumber)" area 0 0 -1 -1 pad 8 16 0 16 text lua "getJournalEntryText(rowNumber)" text style "normal_parchment" text color 'B' } } enabled "journalMode == const.JOURNAL_MODE_JOURNAL or journalMode == const.JOURNAL_MODE_USER" seperator "getJournalEntryEnabled(rowNumber)" rowheight dynamic hidehighlight table "journalDisplay" var selectedJournal scrollbar 'GUISCRC' area 134 174 594 410 } button { enabled "journalMode == const.JOURNAL_MODE_USER" area 330 602 204 47 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text "ADD_ENTRY_LABEL" text style "button" action " journalMode = const.JOURNAL_MODE_EDIT journalNoteEdit = '' journalNoteEditRef = nil " } button { enabled "journalMode == const.JOURNAL_MODE_USER" clickable lua "journalEntryClickable(selectedJournal)" area 330 649 204 47 bam GUIBUTNT sequenceonce "getRandomButtonSequence('GUIBUTNT')" text "EDIT_ENTRY_LABEL" text style "button" action " journalNoteEditRef = getJournalEntryRef(selectedJournal) journalNoteEdit = Infinity_FetchString(journalNoteEditRef) journalMode = const.JOURNAL_MODE_EDIT " } label { enabled "journalMode == const.JOURNAL_MODE_EDIT" area 148 186 566 22 text style "normal_parchment" text "WRITE_ENTRY_TEXT" text align center center } label { enabled "journalMode == const.JOURNAL_MODE_EDIT" area 148 208 566 42 text style "label" text color 0 120 0 255 text lua "Infinity_GetTimeString()" } edit { enabled "journalMode == const.JOURNAL_MODE_EDIT" area 148 250 566 319 text style "edit_parchment" var journalNoteEdit scrollbar 'GUISCRC' } button { enabled "journalMode == const.JOURNAL_MODE_EDIT" area 72 103 232 47 bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "CANCEL_BUTTON" text style "button" action " journalMode = const.JOURNAL_MODE_USER " } button { enabled "journalMode == const.JOURNAL_MODE_EDIT" area 562 103 232 47 bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "DONE_BUTTON" text style "button" action " if(journalNoteEditRef == nil) then Infinity_OnAddUserEntry(journalNoteEdit) else Infinity_OnEditUserEntry(journalNoteEditRef, journalNoteEdit) end journalMode = const.JOURNAL_MODE_USER " } button { enabled "journalMode == const.JOURNAL_MODE_EDIT" area 58 612 232 48 bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "REVERT_BUTTON" text style "button" clickable lua "isJournalRevertButtonClickable()" action " journalNoteEdit = Infinity_FetchString(journalNoteEditRef) journalMode = const.JOURNAL_MODE_EDIT " } button { enabled "journalMode == const.JOURNAL_MODE_EDIT" area 572 612 232 48 bam GUIBUTMT sequenceonce "getRandomButtonSequence('GUIBUTMT')" text "DELETE_BUTTON" text style "button" clickable lua "isJournalDeleteButtonClickable()" action " Infinity_OnRemoveUserEntry(journalNoteEditRef) removeUserEntry(journalNoteEditRef) journalMode = const.JOURNAL_MODE_USER " } } menu { name 'JOURNAL_RECENT_EVENTS' align center center modal label { area 0 0 672 672 mosaic "RECENTEV" } label { area 158 52 354 46 text "RECENT_EVENTS_TITLE" text style "title" } button { area 594 10 33 35 bam "XBUTT" action " Infinity_PopMenu('JOURNAL_RECENT_EVENTS') " } text { area 126 106 422 458 text "Recent events text will go here." text style "normal" } button { area 320 572 200 44 text "DONE_BUTTON" text style 'button' bam GUIBUTNT sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" action " Infinity_PopMenu('JOURNAL_RECENT_EVENTS') " } } ` function processQuestsWithStyle() out = "" for k,v in pairs(quests_old) do local questStrref = v[3] out = out .. "createQuest ( " .. questStrref .. " )\n" for k2,v2 in pairs(journals_quests_old) do if(v2[2] == k) then local subgroup = v2[const.ENTRIES_IDX_SUBGROUP] if(subgroup == 0) then subgroup = "nil" end out = out .. "createEntry ( " .. questStrref .. ", -1, " .. v2[1] .. ", {}, " .. subgroup .." )\n" end end end Infinity_Log(out) end ` menu { name 'MESSAGE_SCREEN' align center center label { area 0 0 657 234 mosaic GUIERR6 } label { area 29 21 580 126 text lua "Infinity_FetchString(messageScreenText)" text style "label" } } ` function getDLCDescription() return Infinity_FetchString(dlcScreen:GetDLCDescription()) end function getDLCTitle() return Infinity_FetchString(dlcScreen:GetDLCTitle()) end function getDLCIndex() return dlcScreen:GetDLCIndex() .. "/" .. dlcScreen:GetDLCCount() end function isDLCBuyButtonClickable() local isBought = dlcScreen:GetDLCBought() return isBought == false end ` menu { name 'START_DLC' align center center label { area 0 0 1024 768 mosaic 'GUIDLC' } label { area 60 14 906 42 text "STRREF_GUI_LOWER_DLC_STORE" text style 'title' text align center center } label { area 574 582 346 28 text lua "getDLCIndex()" text style 'title' text align center center } label { area 578 162 336 52 text lua "getDLCTitle()" text style 'title' text align center center } text { area 578 220 336 362 text lua "getDLCDescription()" text style 'normal' scrollbar 'GUISCRC' } label { area 154 98 366 566 bitmap lua "dlcScreen:GetDLCImage()" } button { bam 'GUIPRC' sequence 0 area 22 274 56 140 align center center action " dlcScreen:DecrementDLCIndex() " } button { bam 'GUIPRC' sequence 1 area 946 270 52 140 align center center action " dlcScreen:IncrementDLCIndex() " } button { bam 'GUIOSTUL' sequence 0 area 280 710 240 48 align center center text style "button" text "BACK_BUTTON" action " dlcScreen:OnDoneButtonClick() " } button { bam 'GUIOSTCL' sequence 0 area 602 646 302 46 align center center text style "button" text "STRREF_GUI_DLC_RESTORE_PURCHASES" action " dlcScreen:RestorePurchases() " } button { bam 'BUYBUTT' sequence 2 area 530 710 238 48 align center center text style "button" text "BUY_BUTTON" clickable lua "isDLCBuyButtonClickable()" action " dlcScreen:OnBuyButtonClick() " } } ` dlcStatusDescriptionText = "" dlcStatusButtonText = "" dlcStatusState = 0 DLC_STATE_WAITING = 0 DLC_STATE_IN_PROGRESS = 1 DLC_STATE_SUCCESS = 2 DLC_STATE_FAILED = 3 DLC_STATE_CANCELLED = 4 DLC_STATE_RESTORING_PURCHASES = 5 DLC_STATE_RESTORING_PURCHASES_COMPLETE = 6 DLC_STATE_DOWNLOADING = 7 function checkDLCState() dlcStatusState = dlcScreen:GetDLCState() if dlcStatusState == DLC_STATE_WAITING then dlcStatusDescriptionText = t("STRREF_GUI_DLC_WAITING") dlcStatusButtonText = t("BACK_BUTTON") elseif dlcStatusState == DLC_STATE_IN_PROGRESS then dlcStatusDescriptionText = t("STRREF_GUI_DLC_IN_PROGRESS") dlcStatusButtonText = t("BACK_BUTTON") elseif dlcStatusState == DLC_STATE_SUCCESS then dlcStatusDescriptionText = t("STRREF_GUI_DLC_SUCCESS") dlcStatusButtonText = t("CONTINUE_BUTTON") elseif dlcStatusState == DLC_STATE_FAILED then dlcStatusDescriptionText = t("STRREF_GUI_DLC_FAILED") dlcStatusButtonText = t("CONTINUE_BUTTON") elseif dlcStatusState == DLC_STATE_CANCELLED then dlcStatusDescriptionText = t("STRREF_GUI_DLC_CANCELLED") dlcStatusButtonText = t("CONTINUE_BUTTON") elseif dlcStatusState == DLC_STATE_RESTORING_PURCHASES then dlcStatusDescriptionText = t("STRREF_GUI_DLC_RESTORING_PURCHASES") dlcStatusButtonText = t("BACK_BUTTON") elseif dlcStatusState == DLC_STATE_RESTORING_PURCHASES_COMPLETE then dlcStatusDescriptionText = t("STRREF_GUI_DLC_RESTORING_PURCHASES_COMPLETE") dlcStatusButtonText = t("CONTINUE_BUTTON") elseif dlcStatusState == DLC_STATE_DOWNLOADING then dlcScreen:GetDownloadString() dlcStatusButtonText = "" else dlcStatusDescriptionText = "WAFFLES_Dont Know How We Got Here_WAFFLES" dlcStatusButtonText = "WAFFLES_WAFFLES_WAFFLES" end end function getDLCStatusText() checkDLCState() return dlcStatusDescriptionText end ` menu { name 'START_DLC_STATUS' align center center label { area 0 0 408 420 mosaic 'GUIERR' } label { area 86 76 236 84 text style "label" text lua "getDLCStatusText()" } button { bam 'GUIOSTUM' sequence 0 area 104 320 202 46 align center center text style "button" text lua "dlcStatusButtonText" enabled "dlcStatusState ~= DLC_STATE_DOWNLOADING" action " dlcScreen:OnErrorButtonClick(); " } } ` gameplayTutorialsActive = 1 gameScreenTutorialsActive = 1 classAbilityTutorialsActive = 1 gameplayTutorialButtonText = "- " screensTutorialButtonText = "- " abilitiesTutorialButtonText = "- " queuedTutorialMovie = "waffle" gameplayTutorials = { {34896,"tut02"}, {34992,"tut03"}, {34991,"tut04"}, {40766,"tut06"}, {40767,"tut12"}, {40769,"tut16"}, } screenTutorials = { {34897,"tut01"}, {16307,"tut07"}, {33901,"tut08"}, {34899,"tut10"}, {34901,"tut11"}, {34900,"tut13"}, {34898,"tut14"}, } abilityTutorials = { {34903,"tut05"}, {34904,"tut09"}, {40768,"tut15"}, {34904,"tut17"}, } function getTutorialText(tutorialsTable, section) return Infinity_FetchString(tutorialsTable[section][1]) end function toggleGameplayTutorials() local difference = 124 if gameplayTutorialsActive == 1 then gameplayTutorialButtonText = '+ '..Infinity_FetchString(34905) difference = -124 Infinity_SetArea('gameplayTutorialList', nil, nil, nil, 0) else gameplayTutorialButtonText = '- '..Infinity_FetchString(34905) Infinity_SetArea('gameplayTutorialList', nil, nil, nil, 148) end gameplayTutorialsActive = 1 - gameplayTutorialsActive local x,y,w,h = Infinity_GetArea('gameScreensTutorialButton') y = y + difference Infinity_SetArea('gameScreensTutorialButton', nil, y, nil, nil) x,y,w,h = Infinity_GetArea('screenTutorialList') y = y + difference Infinity_SetArea('screenTutorialList', nil, y, nil, nil) x,y,w,h = Infinity_GetArea('classAbilitiesTutorialButton') y = y + difference Infinity_SetArea('classAbilitiesTutorialButton', nil, y, nil, nil) x,y,w,h = Infinity_GetArea('abilityTutorialList') y = y + difference Infinity_SetArea('abilityTutorialList', nil, y, nil, nil) end function toggleScreenTutorials() local difference = 146 if gameScreenTutorialsActive == 1 then screensTutorialButtonText = '+ '..Infinity_FetchString(34906) difference = -146 Infinity_SetArea('screenTutorialList', nil, nil, nil, 0) else screensTutorialButtonText = '- '..Infinity_FetchString(34906) Infinity_SetArea('screenTutorialList', nil, nil, nil, 170) end gameScreenTutorialsActive = 1 - gameScreenTutorialsActive x,y,w,h = Infinity_GetArea('classAbilitiesTutorialButton') y = y + difference Infinity_SetArea('classAbilitiesTutorialButton', nil, y, nil, nil) x,y,w,h = Infinity_GetArea('abilityTutorialList') y = y + difference Infinity_SetArea('abilityTutorialList', nil, y, nil, nil) end function toggleAbilityTutorials() if classAbilityTutorialsActive == 1 then abilitiesTutorialButtonText = '+ '..Infinity_FetchString(34907) Infinity_SetArea('abilityTutorialList', nil, nil, nil, 0) else abilitiesTutorialButtonText = '- '..Infinity_FetchString(34907) Infinity_SetArea('abilityTutorialList', nil, nil, nil, 100) end classAbilityTutorialsActive = 1 - classAbilityTutorialsActive end ` menu { name 'TUTORIAL' align center center onOpen " if gameplayTutorialsActive == 0 then toggleGameplayTutorials() end if gameScreenTutorialsActive == 0 then toggleScreenTutorials() end if classAbilityTutorialsActive == 0 then toggleAbilityTutorials() end gameplayTutorialButtonText = '- '..Infinity_FetchString(34905) screensTutorialButtonText = '- '..Infinity_FetchString(34906) abilitiesTutorialButtonText = '- '..Infinity_FetchString(34907) " onClose " Infinity_StopMovie('tutorialMoviesMovieThing') " label { area 0 0 1024 768 mosaic 'GUITUTB' } label { area 126 38 768 50 text style "label" text "TUTORIAL_MOVIES_LABEL" } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 412 706 202 42 align center center text style "button" text "BACK_BUTTON" action " Infinity_PopMenu() " } button { name "gameplayTutorialButton" area 106 128 400 42 align left center text lua "gameplayTutorialButtonText" text color 4 action " toggleGameplayTutorials() " } list { column { width 100 label { area 0 0 -1 -1 text lua "getTutorialText(gameplayTutorials, rowNumber)" text style "label" align top center } } name "gameplayTutorialList" rowheight dynamic hidehighlight seperator "true" table "gameplayTutorials" var selectedGameplayTutorial area 114 162 382 148 action " Infinity_PlayMovie(gameplayTutorials[selectedGameplayTutorial][2],'tutorialMoviesMovieThing') " } button { name "gameScreensTutorialButton" area 106 294 400 42 align left center text lua "screensTutorialButtonText" text color 4 action " toggleScreenTutorials() " } list { column { width 100 label { area 0 0 -1 -1 text lua "getTutorialText(screenTutorials, rowNumber)" text style "label" align top center } } name "screenTutorialList" rowheight dynamic hidehighlight seperator "true" table "screenTutorials" var selectedScreenTutorial area 114 328 382 170 action " Infinity_PlayMovie(screenTutorials[selectedScreenTutorial][2],'tutorialMoviesMovieThing') " } button { name "classAbilitiesTutorialButton" area 106 482 400 42 align left center text lua "abilitiesTutorialButtonText" text color 4 action " toggleAbilityTutorials() " } list { column { width 100 label { area 0 0 -1 -1 text lua "getTutorialText(abilityTutorials, rowNumber)" text style "label" align top center } } name "abilityTutorialList" rowheight dynamic hidehighlight seperator "true" table "abilityTutorials" var selectedAbilityTutorial area 114 515 382 100 action " Infinity_PlayMovie(abilityTutorials[selectedAbilityTutorial][2],'tutorialMoviesMovieThing') " } movie { name "tutorialMoviesMovieThing" area 586 160 382 472 queuedMovie "queuedTutorialMovie" subtitle area 592 160 384 80 subtitle background 0 0 0 160 } } ` createPartyOffset = 0 prerollCharacters = {} function scrollPregens() if scrollDirection > 0 then scrollPregenUp() elseif scrollDirection < 0 then scrollPregenDown() end end function scrollPregenUp() if createPartyOffset > 0 then createPartyOffset = createPartyOffset - 1 end end function scrollPregenDown() if createPartyOffset < (#prerollCharacters - 3) then createPartyOffset = createPartyOffset + 1 end end function getPregenCharacterName(slotNumber) local ret = "" if slotNumber + createPartyOffset < #prerollCharacters+1 then ret = prerollCharacters[slotNumber+createPartyOffset]["name"] end return ret end function getPregenCharacterBiography(slotNumber) local ret = "" if slotNumber + createPartyOffset < #prerollCharacters+1 then ret = prerollCharacters[slotNumber+createPartyOffset]["description"] end return ret end function getPregenCharacterPortrait(slotNumber) local ret = "noportsm" if slotNumber + createPartyOffset < #prerollCharacters+1 then ret = prerollCharacters[slotNumber+createPartyOffset]["image"] end return ret end function getPregenCharacterFileName(slotNumber) local ret = "" if slotNumber + createPartyOffset < #prerollCharacters+1 then ret = prerollCharacters[slotNumber+createPartyOffset]["file"] end return ret end function playAsPreroll(slotNumber) local fileName = getPregenCharacterFileName(slotNumber) if fileName ~= "" then end end ` menu { name 'CHARGEN_SELECTPREGEN' align center center onOpen " createPartyOffset = 0 createCharScreen:GetImportableCharacters() " label { area 0 0 1024 768 mosaic 'GUICGPR' } button { area 0 0 1024 768 actionScroll " scrollPregens() " } label { area 158 18 714 40 text style "title" text "CHARGEN_TITLE" actionScroll " scrollPregens() " } button { bitmap "noportsm" area 48 128 62 90 align center center actionScroll " scrollPregens() " } label { area 134 106 534 30 text style "label" align left top text lua "Infinity_FetchString(10264)" actionScroll " scrollPregens() " } label { area 152 148 502 82 text style "label" align left top text lua "Infinity_FetchString(34752)" } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 760 98 202 42 align center center text style "button" text "CREATE_BUTTON" action " Infinity_PopMenu() Infinity_PushMenu('CHARGEN') " } button { bitmap lua 'getPregenCharacterPortrait(1)' area 48 328 58 86 align center center actionScroll " scrollPregens() " } label { area 162 306 542 26 text style "label" align left top text lua "getPregenCharacterName(1)" actionScroll " scrollPregens() " } label { area 128 350 602 82 text style "label" align left top text lua "getPregenCharacterBiography(1)" } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 760 338 202 42 align center center text style "button" text "PLAY_IMPORT_BUTTON" action " Infinity_PopMenu() createCharScreen:OnPrerollCharacterPick(0 + createPartyOffset) " } button { bitmap lua 'getPregenCharacterPortrait(2)' area 48 474 58 86 align center center actionScroll " scrollPregens() " } label { area 162 452 542 28 text style "label" align left top text lua "getPregenCharacterName(2)" actionScroll " scrollPregens() " } label { area 128 498 602 82 text style "label" align left top text lua "getPregenCharacterBiography(2)" } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 760 490 202 42 align center center text style "button" text "PLAY_IMPORT_BUTTON" action " Infinity_PopMenu() createCharScreen:OnPrerollCharacterPick(1 + createPartyOffset) " } button { bitmap lua 'getPregenCharacterPortrait(3)' area 48 624 58 86 align center center actionScroll " scrollPregens() " } label { area 158 602 546 24 text style "label" align left top text lua "getPregenCharacterName(3)" actionScroll " scrollPregens() " } label { area 128 648 602 82 text style "label" align left top text lua "getPregenCharacterBiography(3)" } button { bam 'GUIBUTNT' sequenceonce lua "getRandomButtonSequence('GUIBUTNT')" area 760 636 202 42 align center center text style "button" text "PLAY_IMPORT_BUTTON" action " Infinity_PopMenu() createCharScreen:OnPrerollCharacterPick(2 + createPartyOffset) " } button { bam 'GUISV10' sequence 0 area 52 274 46 50 action " scrollPregenUp() " actionScroll " scrollPregens() " } button { bam 'GUISV10' sequence 1 area 52 718 46 50 action " scrollPregenDown() " actionScroll " scrollPregens() " } button { on escape bam 'GUIBUTMT' sequenceonce lua "getRandomButtonSequence('GUIBUTMT')" area 760 710 232 46 align center center text style "button" text "BACK_BUTTON" action " Infinity_PopMenu() createCharScreen:OnMainCancelButtonClick() " } } ` dialogTable = {} dialogOverflowTable = {} hasDialogResponse = nil chatboxScrollToBottom = nil chatboxScrollTimeLast = 0 chatboxContentHeight = 0 chatboxOverflowed = nil chatboxJumpToBottom = nil -- The following two values determine how many item entries can exist. We trim -- the number of entries to numDialogTrimEntries once it has overflowed that value -- by numDialogOverflowLimit. numDialogTrimEntries = 512 numDialogOverflowEntries = numDialogTrimEntries + 128 lastTrimmedContentHeight = 0 function getNumDialogTableEntries() local count = 0 for _ in pairs(dialogTable) do count = count + 1 end return count end function trimDialogTableSize() local numTableEntries = getNumDialogTableEntries() if (numTableEntries > numDialogOverflowEntries) then local numEntriesToRemove = numTableEntries - numDialogTrimEntries while (numEntriesToRemove > 0) do -- Get our table entry and calculate its size local tableEntry = dialogTable[1] local delta = Infinity_GetContentHeight(styles.normal.font, w, tableEntry.text, styles.normal.point, 1, styles.normal.useFontZoom) --1 for indent. chatboxContentHeight = chatboxContentHeight - delta lastTrimmedContentHeight = lastTrimmedContentHeight + delta table.remove(dialogTable, 1) numEntriesToRemove = numEntriesToRemove - 1 end end end function buildResponsesList() hasDialogResponse = nil dialogResponses = {} for k,v in pairs(worldPlayerDialogChoices) do if v.marker then table.insert(dialogResponses, v) hasDialogResponse = 1 end end end function canShowDialogButton(num) -- Show the buttons if we have a response, and the dialog button is not enabled return dialogResponses and dialogResponses[num] ~= nil and showDialogButtonChoices() end function addDialogMessage(text,marker,makeTop) local tab = {} tab.text = text tab.marker = marker if(marker) then dialogViewMode = nil if(text == "") then --empty markers are a signal, we shouldn't actually display them. if(makeTop == true) then --we'll ensure the next line is included in the visible content. chatboxContentHeight = 0 end return else hasDialogResponse = 1 end end --Calculate running total of dialog content height local x,y,w,h = Infinity_GetArea("worldPlayerDialogChoicesList") w = w - 18 --account for scrollbar influence on width local delta = Infinity_GetContentHeight(styles.normal.font, w, text, styles.normal.point, 1, styles.normal.useFontZoom) --1 for indent. chatboxContentHeight = chatboxContentHeight + delta if(marker and chatboxContentHeight > h) then --More to display than we have room for, put the responses in overflow and hide them behind button table.insert(dialogOverflowTable,tab) else table.insert(dialogTable,tab) end if(makeTop == true) then --we'll ensure the next line is included in the visible content. chatboxContentHeight = 0 end trimDialogTableSize() triggerChatboxScroll() buildResponsesList() end function clearDialogResponses() for k,v in pairs(dialogTable) do if(v.marker) then table.remove(dialogTable,k) clearDialogResponses() end end hasDialogResponse = nil chatboxOverflowed = nil chatboxContentHeight = 0 dialogOverflowTable = {} end function dialogEntrySelectable(row) return (dialogTable[row].marker ~= nil) end function showDialogButtonChoices() return not (not hasDialogResponse or dialogViewMode or #dialogOverflowTable > 0) end function getResponsePickable() return not hasDialogResponse or dialogViewMode or (gameOptions.m_bConfirmDialog == true) end function getDialogButtonText() if(dialogViewMode) then return t("DONE_BUTTON") end if(#dialogOverflowTable > 0) then return t("SHOW_MORE_RESPONSES_BUTTON") end if(gameOptions.m_bConfirmDialog == true) then return t("CHOOSE_RESPONSE_BUTTON") end return dialogButtonText end function triggerChatboxScroll() chatboxScrollToBottom = 1 chatboxScrollTimeLast = Infinity_GetClockTicks() end function chatboxScroll(top, height, contentHeight) if(chatboxJumpToBottom and contentHeight > height) then chatboxJumpToBottom = nil return height-contentHeight end if(chatboxScrollToBottom == 0) then --defer to default scrolling return nil end if(contentHeight < height) then --no scrolling required, content fits chatboxScrollToBottom = nil return nil end local dT = Infinity_GetClockTicks() - chatboxScrollTimeLast chatboxScrollTimeLast = Infinity_GetClockTicks() top = top + lastTrimmedContentHeight lastTrimmedContentHeight = 0 local newTop = (dT * -0.25) + top if (newTop + contentHeight > height + 200) then return (height - contentHeight + 200) end if(newTop + contentHeight < height) then chatboxScrollToBottom = 0 return height - contentHeight end return newTop end function displayOverflowResponses() for k,v in pairs(dialogOverflowTable) do table.insert(dialogTable,v) end dialogOverflowTable = {} triggerChatboxScroll() buildResponsesList() end function GetFirstMarkedResponse() for k,v in pairs(dialogTable) do if v.marker ~= nil then return k end end return -1 end function onDialogButtonClick() if(dialogViewMode) then --In dialog view mode this button closes the menu. worldScreen:StopDialogHistory() return end if(#dialogOverflowTable > 0) then displayOverflowResponses() return end if(gameOptions.m_bConfirmDialog == true and hasDialogResponse) then -- if confirm dialog and choices available. worldScreen:OnDialogReplyClick(dialogTable[worldPlayerDialogSelection].marker) worldPlayerDialogSelection = 0 return else -- no choices, just step. worldScreen:StepDialog() end end function getDialogRowClickable(row) return dialogTable[row].marker ~= nil end function isTouchActionbar() --Make this read from an option to make it easy to switch out. local default = 0 if(e:IsTouchUI()) then default = 1 end local val = Infinity_GetINIValue('Program Options', 'Use Touch Actionbar', default) if (val ~= 0) then return 1 else return nil end end ` menu { name 'WORLD_DIALOG_LEFT' align left center ignoreEsc --ignoreFocus 1 onOpen " Infinity_PushMenu('WORLD_DIALOG_LEFT_BUTTONS') " onClose " Infinity_PopMenu('WORLD_DIALOG_LEFT_BUTTONS') " label { area 0 0 80 1536 mosaic GUIWLSP } } menu { name 'WORLD_DIALOG_LEFT_BUTTONS' align left center ignoreEsc --ignoreFocus 1 label { area 0 0 85 780 rectangle 4 } button { area 15 25 54 54 bam CBUTT scaleToClip text lua "'...'" text style "button" pad -3 -6 0 0 enabled "not showDialogButtonChoices()" clickable lua "not dialogEntryGreyed()" action " onDialogButtonClick() " } button { area 15 25 54 54 bam CBUTT scaleToClip text lua "'1'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(1)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[1].marker) " } button { area 15 100 54 54 bam CBUTT scaleToClip text lua "'2'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(2)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[2].marker) " } button { area 15 175 54 54 bam CBUTT scaleToClip text lua "'3'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(3)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[3].marker) " } button { area 15 250 54 54 bam CBUTT scaleToClip text lua "'4'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(4)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[4].marker) " } button { area 15 325 54 54 bam CBUTT scaleToClip text lua "'5'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(5)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[5].marker) " } button { area 15 400 54 54 bam CBUTT scaleToClip text lua "'6'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(6)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[6].marker) " } button { area 15 475 54 54 bam CBUTT scaleToClip text lua "'7'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(7)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[7].marker) " } button { area 15 550 54 54 bam CBUTT scaleToClip text lua "'8'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(8)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[8].marker) " } button { area 15 625 54 54 bam CBUTT scaleToClip text lua "'9'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(9)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[9].marker) " } button { area 15 700 54 54 bam CBUTT scaleToClip text lua "'10'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(10)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[10].marker) " } } menu { name 'WORLD_DIALOG_RIGHT' align right center ignoreEsc --ignoreFocus 1 enabled "canShowDialogButton(11)" onOpen " Infinity_PushMenu('WORLD_DIALOG_RIGHT_BUTTONS') " onClose " Infinity_PopMenu('WORLD_DIALOG_RIGHT_BUTTONS') " label { area 0 0 80 1536 mosaic GUIWRSP } } menu { name 'WORLD_DIALOG_RIGHT_BUTTONS' align right center ignoreEsc --ignoreFocus 1 enabled "canShowDialogButton(11)" label { area 0 0 85 780 rectangle 4 } button { area 15 25 54 54 bam CBUTT scaleToClip text lua "'11'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(11)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[11].marker) " } button { area 15 100 54 54 bam CBUTT scaleToClip text lua "'12'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(12)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[12].marker) " } button { area 15 175 54 54 bam CBUTT scaleToClip text lua "'13'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(13)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[13].marker) " } button { area 15 250 54 54 bam CBUTT scaleToClip text lua "'14'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(14)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[14].marker) " } button { area 15 325 54 54 bam CBUTT scaleToClip text lua "'15'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(15)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[15].marker) " } button { area 15 400 54 54 bam CBUTT scaleToClip text lua "'16'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(16)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[16].marker) " } button { area 15 475 54 54 bam CBUTT scaleToClip text lua "'17'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(17)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[17].marker) " } button { area 15 550 54 54 bam CBUTT scaleToClip text lua "'18'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(18)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[18].marker) " } button { area 15 625 54 54 bam CBUTT scaleToClip text lua "'19'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(19)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[19].marker) " } button { area 15 700 54 54 bam CBUTT scaleToClip text lua "'20'" text style "button" pad -3 -6 0 0 enabled "canShowDialogButton(20)" clickable lua "not dialogEntryGreyed()" action " worldScreen:OnDialogReplyClick(dialogResponses[20].marker) " } } ` currentButtonHelp = 11 buttonHelp = { {'GUILS10', 0, -1, 0, 0, -1, '', 'HELPTUTORIAL_RETURNTOGAME'}, -- 1 return to game {'GUILS10', 1, -1, 0, 0, -1, '', 'HELPTUTORIAL_MAP'}, -- 2 map {'GUILS10', 2, -1, 0, 0, -1, '', 'HELPTUTORIAL_JOURNAL'}, -- 3 journal {'GUILS10', 3, -1, 0, 0, -1, '', 'HELPTUTORIAL_INVENTORY'}, -- 4 inventory {'GUILS10', 4, -1, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERRECORD'}, -- 5 record {'GUILS10', 5, -1, 0, 0, -1, '', 'HELPTUTORIAL_MAGESPELLS'}, -- 6 mage book {'GUILS10', 6, -1, 0, 0, -1, '', 'HELPTUTORIAL_PRIESTSPELLS'}, -- 7 priest scroll {'GUILS10', 7, -1, 0, 0, -1, '', 'HELPTUTORIAL_OPTIONS'}, -- 8 options {'GUILS10', 8, -1, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERARBITRATION'}, -- 9 arbitration {'GUILS10', 15, -1, 0, 0, -1, '', 'HELPTUTORIAL_QUICKSAVE'}, -- 10 quick save {'GUILS10', 16, -1, 0, 0, -1, '', 'HELPTUTORIAL_HELP'}, -- 11 help {'GUILS10', 9, -1, 0, 0, -1, '', 'HELPTUTORIAL_REST'}, -- 12 rest {'GUILS10', 14, -1, 0, 0, -1, '', 'HELPTUTORIAL_SELECT'}, -- 13 drag {'GUILS10', 11, -1, 0, 0, -1, '', 'HELPTUTORIAL_HIGHLIGHT'}, -- 14 highlight {'GUILS10', 10, -1, 0, 0, -1, '', 'HELPTUTORIAL_TOGGLEAI'}, -- 15 ai {'GUILS10', 13, -1, 0, 0, -1, '', 'HELPTUTORIAL_SELECTALL'}, -- 16 select all {'', -1, 0, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 17 player 1 {'', -1, 1, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 18 player 2 {'', -1, 2, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 19 player 3 {'', -1, 3, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 20 player 4 {'', -1, 4, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 21 player 5 {'', -1, 5, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 22 player 6 {'', -1, -1, 1, 0, -1, '', 'HELPTUTORIAL_CLOCK'}, -- 23 clock {'ROUNDBUT', 0, -1, 0, 1, -1, '', 'HELPTUTORIAL_QUICKLOOT'}, -- 24 quick loot {'GUIBTACT', 64, -1, 0, 0, 0, '', 'HELPTUTORIAL_ARROWLEFT'}, -- 25 {'GUIBTACT', 66, -1, 0, 0, 1, '', 'HELPTUTORIAL_ARROWRIGHT'}, -- 26 {'GUIBTACT', 22, -1, 0, 0, 2, '', 'HELPTUTORIAL_BARDSONG'}, -- 27 {'GUIBTACT', 12, -1, 0, 0, 3, '', 'HELPTUTORIAL_CASTSPELLS'}, -- 28 {'GUIBTACT', 34, -1, 0, 0, 4, '', 'HELPTUTORIAL_FINDTRAPS'}, -- 29 {'GUIBTACT', 4, -1, 0, 0, 5, '', 'HELPTUTORIAL_DIALOG'}, -- 30 {'GUIBTACT', 20, -1, 0, 0, 6, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 31 {'GUIBTACT', 0, -1, 0, 0, 7, '', 'HELPTUTORIAL_DEFEND'}, -- 32 {'GUIBTACT', 14, -1, 0, 0, 8, '', 'HELPTUTORIAL_ATTACK'}, -- 33 {'GUIBTACT', 40, -1, 0, 0, 9, '', 'HELPTUTORIAL_SHAPECHANGE'}, -- 34 {'GUIBTACT', 38, -1, 0, 0, 10, '', 'HELPTUTORIAL_SPECIALABILITIES'}, -- 35 {'GUIBTACT', 30, -1, 0, 0, 11, '', 'HELPTUTORIAL_STEALTH'}, -- 36 {'GUIBTACT', 26, -1, 0, 0, 12, '', 'HELPTUTORIAL_THIEVING'}, -- 37 {'GUIBTACT', 8, -1, 0, 0, 13, '', 'HELPTUTORIAL_TURNUNDEAD'}, -- 38 {'GUIBTACT', 18, -1, 0, 0, 14, '', 'HELPTUTORIAL_USEITEM'}, -- 39 {'GUIBTACT', 58, -1, 0, 0, 15, '', 'HELPTUTORIAL_STOP'}, -- 40 {'GUIBTACT', 20, -1, 0, 0, 16, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 41 {'GUIBTACT', 20, -1, 0, 0, 17, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 42 {'GUIBTACT', 20, -1, 0, 0, 18, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 43 {'GUIBTACT', 20, -1, 0, 0, 19, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 44 {'GUIBTACT', 20, -1, 0, 0, 20, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 45 {'STONSL10', -1, -1, 0, 0, 21, 'STONITEM', 'HELPTUTORIAL_QUICKITEM'}, -- 46 {'STONSL10', -1, -1, 0, 0, 22, 'STONITEM', 'HELPTUTORIAL_QUICKITEM'}, -- 47 {'STONSL10', -1, -1, 0, 0, 23, 'STONITEM', 'HELPTUTORIAL_QUICKITEM'}, -- 48 {'STONSL10', 12, -1, 0, 0, 24, 'STONSPEL', 'HELPTUTORIAL_QUICKSPELLS'}, -- 49 {'STONSL10', 12, -1, 0, 0, 25, 'STONSPEL', 'HELPTUTORIAL_QUICKSPELLS'}, -- 50 {'STONSL10', 12, -1, 0, 0, 26, 'STONSPEL', 'HELPTUTORIAL_QUICKSPELLS'}, -- 51 {'STONSL10', -1, -1, 0, 0, 27, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 52 {'STONSL10', -1, -1, 0, 0, 28, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 53 {'STONSL10', -1, -1, 0, 0, 29, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 54 {'STONSL10', -1, -1, 0, 0, 30, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 55 {'STONSL10', -1, -1, 0, 0, 31, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 56 {'STONSL10', -1, -1, 0, 0, 32, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 57 {'STONSL10', -1, -1, 0, 0, 33, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 58 {'STONSL10', -1, -1, 0, 0, 34, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 59 {'STONSL10', -1, -1, 0, 0, 35, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 60 {'STONSL10', -1, -1, 0, 0, 36, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 61 {'STONSL10', -1, -1, 0, 0, 37, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 62 {'STONSL10', -1, -1, 0, 0, 38, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 63 {'STONSL10', -1, -1, 0, 0, 39, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 64 {'STONSL10', -1, -1, 0, 0, 40, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 65 {'STONSL10', -1, -1, 0, 0, 41, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 66 {'STONSL10', -1, -1, 0, 0, 42, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 67 {'STONSL10', -1, -1, 0, 0, 43, '', 'HELPTUTORIAL_ARROWLEFT'}, -- 68 {'STONSL10', -1, -1, 0, 0, 44, '', 'HELPTUTORIAL_ARROWRIGHT'}, -- 69 {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {'STONSL10', -1, -1, 0, 0, 67, '', 'HELPTUTORIAL_SWITCHTOMAGE'}, -- 91 {}, {'STONSL10', -1, -1, 0, 0, 69, '', 'HELPTUTORIAL_SWITCHTOCLERIC'}, -- 93 } ` menu { name 'HELP' align center center ignoreEsc onOpen " currentButtonHelp = 11 Infinity_PushMenu('LEFT_SIDEBAR_HELP') Infinity_PushMenu('RIGHT_SIDEBAR_HELP') Infinity_PushMenu('WORLD_ACTIONBAR_HELP') " onClose " Infinity_PopMenu('LEFT_SIDEBAR_HELP') Infinity_PopMenu('RIGHT_SIDEBAR_HELP') Infinity_PopMenu('WORLD_ACTIONBAR_HELP') " label { area 0 0 662 244 mosaic GUIERR6 } label { enabled "buttonHelp[currentButtonHelp][3] == -1 and buttonHelp[currentButtonHelp][4] == 0 and buttonHelp[currentButtonHelp][5] == 0 and buttonHelp[currentButtonHelp][6] == -1" area 34 24 75 54 bam lua "buttonHelp[currentButtonHelp][1]" sequence lua "buttonHelp[currentButtonHelp][2]" } label { enabled "buttonHelp[currentButtonHelp][3] == -1 and buttonHelp[currentButtonHelp][4] == 0 and buttonHelp[currentButtonHelp][5] ~= 0 and buttonHelp[currentButtonHelp][6] == -1" area 34 24 44 44 bam lua "buttonHelp[currentButtonHelp][1]" sequence lua "buttonHelp[currentButtonHelp][2]" scaleToClip } label { enabled "buttonHelp[currentButtonHelp][3] == -1 and buttonHelp[currentButtonHelp][4] == 0 and buttonHelp[currentButtonHelp][5] == 0 and buttonHelp[currentButtonHelp][6] ~= -1" area 34 24 75 54 bam lua "buttonHelp[currentButtonHelp][1]" frame lua "buttonHelp[currentButtonHelp][2]" } button { area 34 24 64 90 enabled "buttonHelp[currentButtonHelp][3] ~= -1" portrait lua "buttonHelp[currentButtonHelp][3]" } label { enabled "buttonHelp[currentButtonHelp][4] ~= 0" area 29 16 74 74 bam "CGEAR" frame lua "timer:GetCurrentTime() % 24" } label { enabled "buttonHelp[currentButtonHelp][4] ~= 0" area 29 16 74 74 bam "GEARMASK" scaleToClip frame lua "timer:GetCurrentHour() % timer.TIMESCALE_HOUR_PER_DAY" } label { enabled "buttonHelp[currentButtonHelp][7] ~= ''" area 34 24 52 52 align center center bam lua "buttonHelp[currentButtonHelp][7]" frame lua "buttonHelp[currentButtonHelp][7]" } label { area 118 24 510 120 text lua "t(buttonHelp[currentButtonHelp][8])" text style "label" text align left top } button { area 190 168 300 40 bam GUIBUTWT text "DONE_BUTTON" text style "button" action " Infinity_PopMenu('HELP') " } } menu { name 'LEFT_SIDEBAR_HELP' align left top ignoreEsc onOpen " Infinity_PushMenu('LEFT_SIDEBAR_BOTTOM_HELP') " onClose " Infinity_PopMenu('LEFT_SIDEBAR_BOTTOM_HELP') " label { name 'leftSidebarBackground' area 0 0 80 1536 mosaic GUIWLSP } label { area 0 1536 80 1536 mosaic GUIWLSP } button { area 3 14 73 55 bam GUILS10 sequence 0 tooltip lua "getTooltipWithHotkey(2,16313)" glow lua "true" action " currentButtonHelp = 1 " } button { area 3 69 73 55 bam GUILS10 sequence 1 tooltip lua "getTooltipWithHotkey(4,14648)" glow lua "true" action " currentButtonHelp = 2 " } button { area 3 124 73 55 bam GUILS10 sequence 2 tooltip lua "getTooltipWithHotkey(3,16308)" glow lua "true" action " currentButtonHelp = 3 " } button { area 3 179 73 55 bam GUILS10 sequence 3 tooltip lua "getTooltipWithHotkey(0,16307)" glow lua "true" action " currentButtonHelp = 4 " } button { area 3 234 73 55 bam GUILS10 sequence 4 tooltip lua "getTooltipWithHotkey(1,16306)" glow lua "true" action " currentButtonHelp = 5 " } button { area 3 289 73 55 bam GUILS10 sequence 5 tooltip lua "getTooltipWithHotkey(5,16309)" glow lua "true" action " currentButtonHelp = 6 " } button { area 3 344 73 55 bam GUILS10 sequence 6 tooltip lua "getTooltipWithHotkey(6,14930)" glow lua "true" action " currentButtonHelp = 7 " } button { area 3 399 73 55 bam GUILS10 sequence 7 tooltip lua "getTooltipWithHotkey(7,16311)" glow lua "true" action " currentButtonHelp = 8 " } button { area 3 454 73 55 enabled "e:IsMultiplayer()" bam GUILS10 sequence 8 tooltip lua "getTooltipWithHotkey(8,16312)" glow lua "true" action " currentButtonHelp = 9 " } } menu { name 'LEFT_SIDEBAR_BOTTOM_HELP' align left bottom offset 0 0 --combined height of these buttons makes a menu with height = 231, menu is placed into lower left. y pos is offset from top of this menu. ignoreEsc button { area 3 0 73 55 enabled "worldScreen == e:GetActiveEngine()" bam GUILS10 sequence 15 tooltip lua "getTooltipWithHotkey(28,34763)" --37861 glow lua "true" action " currentButtonHelp = 10 " } button { area 3 56 73 55 enabled "worldScreen == e:GetActiveEngine()" bam GUILS10 sequence 16 tooltip lua "Infinity_FetchString(34772)" --"getTooltipWithHotkey(16,34772)" glow lua "true" action " currentButtonHelp = 11 " } button { area 3 112 73 55 bam GUILS10 sequence 9 tooltip lua "getTooltipWithHotkey(31,11942)" glow lua "true" action " currentButtonHelp = 12 " } --begin clock label { enabled "worldScreen == e:GetActiveEngine()" area 0 182 73 74 bam "CGEAR" frame lua "timer:GetCurrentTime() % 59" useOverlayTint "worldScreen:CheckIfPaused()" overlayTint 180 180 180 } button { enabled "worldScreen == e:GetActiveEngine() and showJournal ~= 1" area 0 182 73 74 bam "GEARMASK" scaleToClip useOverlayTint "worldScreen:CheckIfPaused()" tooltip lua "worldScreen:GetCurrentTimeString()" overlayTint 180 180 180 action " currentButtonHelp = 23 " } --end clock label { --area is preset enabled "gameOptions.m_bRenderFrameTimes" frameTimes } } menu { name 'RIGHT_SIDEBAR_HELP' align right top ignoreEsc onOpen " Infinity_PushMenu('RIGHT_SIDEBAR_BOTTOM_HELP') " onClose " Infinity_PopMenu('RIGHT_SIDEBAR_BOTTOM_HELP') " label { name 'rightSidebarBackground' area 0 0 80 1536 mosaic GUIWRSP } label { area 0 1536 80 1536 mosaic GUIWRSP } button { area 11 14 64 90 portrait 0 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 0" glow lua "true" action " currentButtonHelp = 17 " tooltip lua "Infinity_GetPortraitTooltip(0)" } button { area 11 106 64 90 portrait 1 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 1" glow lua "true" action " currentButtonHelp = 18 " tooltip lua "Infinity_GetPortraitTooltip(1)" } button { area 11 198 64 90 portrait 2 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 2" glow lua "true" action " currentButtonHelp = 19 " tooltip lua "Infinity_GetPortraitTooltip(2)" } button { area 11 290 64 90 portrait 3 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 3" glow lua "true" action " currentButtonHelp = 20 " tooltip lua "Infinity_GetPortraitTooltip(3)" } button { area 11 382 64 90 portrait 4 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 4" glow lua "true" action " currentButtonHelp = 21 " tooltip lua "Infinity_GetPortraitTooltip(4)" } button { area 11 474 64 90 portrait 5 bam GUIRSP10 enabled "Infinity_GetNumCharacters() > 5" glow lua "true" action " currentButtonHelp = 22 " tooltip lua "Infinity_GetPortraitTooltip(5)" } } menu { name 'RIGHT_SIDEBAR_BOTTOM_HELP' align right bottom ignoreEsc --Buttons form a menu aligned bottom right, with height = 197, y is offset from top of that menu. button { area 6 0 71 48 enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine()" bam GUILS10 sequence 14 glow lua "true" tooltip lua "Infinity_FetchString(34764)" action " currentButtonHelp = 13 " } button { area 6 49 71 48 enabled "worldScreen == e:GetActiveEngine()" tooltip lua "Infinity_FetchString(40879)" bam GUILS10 sequence 11 glow lua "true" action " currentButtonHelp = 14 " } button { area 6 99 71 48 enabled "worldScreen == e:GetActiveEngine()" tooltip lua "getPartyAITooltip()" bam GUILS10 sequence 10 glow lua "true" action " currentButtonHelp = 15 " } button { area 6 149 71 48 enabled "worldScreen == e:GetActiveEngine()" tooltip lua "Infinity_FetchString(10485)" bam GUILS10 sequence 13 glow lua "true" action " currentButtonHelp = 16 " } } menu { name "WORLD_ACTIONBAR_HELP" align center bottom onOpen " " onClose " " ignoreEsc label { area 0 0 746 57 mosaic GUWBTP10 } button { area 21 12 32 32 bam ROUNDBUT glow lua "true" scaleToClip action " currentButtonHelp = 24 " } button { area 68 1 52 52 actionBar 0 enabled "buttonArray:GetButtonEnabled(0)" tooltip lua "actionBarTooltip[0]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(0) " } button { area 122 1 52 52 actionBar 1 enabled "buttonArray:GetButtonEnabled(1)" tooltip lua "actionBarTooltip[1]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(1) " } button { area 177 1 52 52 actionBar 2 enabled "buttonArray:GetButtonEnabled(2)" tooltip lua "actionBarTooltip[2]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(2) " } button { area 231 1 52 52 actionBar 3 enabled "buttonArray:GetButtonEnabled(3)" tooltip lua "actionBarTooltip[3]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(3) " } button { area 299 1 52 52 actionBar 4 enabled "buttonArray:GetButtonEnabled(4)" tooltip lua "actionBarTooltip[4]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(4) " } button { area 353 1 52 52 actionBar 5 enabled "buttonArray:GetButtonEnabled(5)" tooltip lua "actionBarTooltip[5]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(5) " } button { area 407 1 52 52 actionBar 6 enabled "buttonArray:GetButtonEnabled(6)" tooltip lua "actionBarTooltip[6]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(6) " } button { area 461 1 52 52 actionBar 7 enabled "buttonArray:GetButtonEnabled(7)" tooltip lua "actionBarTooltip[7]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(7) " } button { area 528 1 52 52 actionBar 8 enabled "buttonArray:GetButtonEnabled(8)" tooltip lua "actionBarTooltip[8]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(8) " } button { area 582 1 52 52 actionBar 9 enabled "buttonArray:GetButtonEnabled(9)" tooltip lua "actionBarTooltip[9]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(9) " } button { area 636 1 52 52 actionBar 10 enabled "buttonArray:GetButtonEnabled(10)" tooltip lua "actionBarTooltip[10]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(10) " } button { area 689 1 52 52 actionBar 11 enabled "buttonArray:GetButtonEnabled(11)" tooltip lua "actionBarTooltip[11]" glow lua "true" action " currentButtonHelp = 25 + buttonArray:GetButtonType(11) " } }