Instantly share code, notes, and snippets.
-
Save suy/e4771a6629325774a75f7b37b93db8e4 to your computer and use it in GitHub Desktop.
Install log of LeUI+ToF with "locked" abilities screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
` | |
deferredOptions = {} | |
function getDeferredOption(section, option) | |
if (not deferredOptions[tostring(section)]) then | |
deferredOptions[tostring(section)] = {} | |
end | |
if (not deferredOptions[section][tostring(option)]) then | |
deferredOptions[section][tostring(option)] = tonumber(Infinity_GetINIValue(section,option)) or 0 | |
end | |
return deferredOptions[section][option] | |
end | |
function setDeferredOption(section, option, value) | |
if (not deferredOptions[tostring(section)]) then | |
deferredOptions[tostring(section)] = {} | |
end | |
deferredOptions[section][tostring(option)] = tonumber(value) or 0 | |
end | |
function flushDeferredOptions() | |
for s,t in pairs(deferredOptions) do | |
for o,v in pairs(t) do | |
Infinity_SetINIValue(s,o,v) | |
end | |
end | |
end | |
` | |
` | |
--reload language | |
if(uiTranslationFile) then | |
Infinity_DoFile("L_" .. uiTranslationFile) | |
else | |
Infinity_DoFile("L_en_us") | |
end | |
characters = {} | |
currentID = 16974083 | |
currentPanelID = 0 | |
listMetaInfo = {} | |
combatLog = {} | |
function updateAttrTable() | |
if (characters[currentID] == nil) then return end | |
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 } | |
} | |
recordStats = {} | |
table.insert(recordStats, {1,t("ABILITIES_TITLE")}) | |
for i=1,6 do | |
table.insert(recordStats, {2,Infinity_FetchString(attributeItems[i][1].strRef),displayAttr(i)}) | |
end | |
table.insert(recordStats, {1,t("COMBAT_STATS_LABEL")}) | |
table.insert(recordStats, {2,t("ARMOR_CLASS_LABEL"),characters[currentID].AC.current}) | |
table.insert(recordStats, {2,t("HIT_POINTS_LABEL"),characters[currentID].HP.current .. ' / ' .. characters[currentID].HP.max}) | |
table.insert(recordStats, {2,t("THAC0_LABEL"),characters[currentID].THAC0.current}) | |
if characters[currentID].THAC0.offhand then | |
table.insert(recordStats, {2,t("OFF_HAND_THAC0"),characters[currentID].THAC0.offhand}) | |
else | |
table.insert(recordStats, {2,t("OFF_HAND_THAC0"),'-'}) | |
end | |
table.insert(recordStats, {2,t("DAMAGE_LABEL"),characters[currentID].damage.min .. ' - ' .. characters[currentID].damage.max}) | |
if characters[currentID].damage.minOffhand and characters[currentID].damage.maxOffhand then | |
table.insert(recordStats, {2,t("OFF_HAND_DAMAGE"),characters[currentID].damage.minOffhand .. ' - ' .. characters[currentID].damage.maxOffhand}) | |
else | |
table.insert(recordStats, {2,t("OFF_HAND_DAMAGE"),'-'}) | |
end | |
table.insert(recordStats, {2,t("NUM_ATTACKS_LABEL"),characters[currentID].proficiencies.numAttacks.current}) | |
table.insert(recordStats, {1,t("SAVING_THROWS_LABEL")}) | |
for s in (characters[currentID].proficiencies.savingThrows.."\n"):gmatch("(.-)\n") do | |
local pos = s:find(":", 1) | |
table.insert(recordStats, {2,s:sub(1, pos - 1),s:sub(pos + 2)}) | |
end | |
recordInfos = {} | |
if characters[currentID].classlevel.second then | |
local strRef = characters[currentID].classlevel.second.active and 19721 or 19722 | |
table.insert(recordInfos, {1,Infinity_FetchString(strRef)}) | |
table.insert(recordInfos, {1,""}) | |
end | |
getClassString() | |
if not isEmpty(characters[currentID].statusEffects) then | |
table.insert(recordInfos, {1,""}) | |
for k, v in pairs(characters[currentID].statusEffects) do | |
table.insert(recordInfos, {2,v}) | |
end | |
end | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,t("PROFICIENCIES_LABEL")}) | |
local lore = Infinity_FetchString(characters[currentID].proficiencies.lore.strRef) .. ": " .. characters[currentID].proficiencies.lore.current | |
table.insert(recordInfos, {1,lore}) | |
local reputation = Infinity_FetchString(characters[currentID].proficiencies.reputation.strRef) .. ": " .. characters[currentID].proficiencies.reputation.current | |
table.insert(recordInfos, {1,reputation}) | |
local script = t("CURRENT_SCRIPT_LABEL") .. ": " .. characters[currentID].proficiencies.currentScript | |
table.insert(recordInfos, {1,script}) | |
if not isEmpty(characters[currentID].proficiencies.class_skills) then | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,t("SKILLS_LABEL")}) | |
for k, v in ipairs(characters[currentID].proficiencies.class_skills) do | |
local skills = Infinity_FetchString(v.strRef) .. ": " .. v.current | |
table.insert(recordInfos, {1,skills}) | |
end | |
end | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,t("FIGHTING_STYLES_LABEL")}) | |
table.insert(recordInfos, {1,characters[currentID].proficiencies.weapons.current}) | |
if characters[currentID].proficiencies.fightingstyles.current ~= "" then | |
table.insert(recordInfos, {1,characters[currentID].proficiencies.fightingstyles.current}) | |
end | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,Infinity_FetchString(10315)}) | |
for k, v in ipairs(characters[currentID].proficiencies.ability) do | |
if not dwHideAbility(v.current) then | |
table.insert(recordInfos, {1,v.current}) | |
end | |
end | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,t("RESISTANCES_LABEL")}) | |
table.insert(recordInfos, {1,characters[currentID].proficiencies.resistances}) | |
if characters[currentID].proficiencies.weaponStyleBonus then | |
local weaponStyleBonus = trim(characters[currentID].proficiencies.weaponStyleBonus) | |
if weaponStyleBonus ~= "" then | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,t("WEAPON_STYLE_BONUS_LABEL")}) | |
table.insert(recordInfos, {1,weaponStyleBonus}) | |
end | |
end | |
end | |
function characterDescString(char) | |
return Infinity_FetchString(char.gender) .. "\n" .. dwDisplayRace(char) .. "\n" .. dwFilterKitDesc(char.class) .. "\n" .. Infinity_FetchString(char.alignment) | |
end | |
function displaySTR() | |
local txt = characters[currentID].attr.str.current | |
if (characters[currentID].attr.str.current == 18 and characters[currentID].attr.str.extra ~= 0) then | |
txt = txt .. '/' .. string.format('%02d', characters[currentID].attr.str.extra % 100) | |
end | |
if (characters[currentID].attr.str.current > characters[currentID].attr.str.base or characters[currentID].attr.str.extra > characters[currentID].attr.str.extraBase) then | |
txt = '^G' .. txt .. '^-' | |
end | |
if (characters[currentID].attr.str.current < characters[currentID].attr.str.base or characters[currentID].attr.str.extra < characters[currentID].attr.str.extraBase) then | |
txt = '^R' .. txt .. '^-' | |
end | |
return txt | |
end | |
function displayBuff(current, base) | |
if(current > base) then | |
return '^G' .. current .. '^-' | |
elseif (current < base) then | |
return '^R' .. current .. '^-' | |
end | |
return current | |
end | |
function displayAttr(index) | |
if (index == 1) then | |
return displaySTR() | |
else | |
return displayBuff(attributeItems[index][1].current, attributeItems[index][1].base) | |
end | |
end | |
function CurrentlyInGame() | |
return characterScreen:IsInGame() | |
end | |
function isEmpty(t) | |
if next(t) == nil then | |
return true | |
end | |
return false | |
end | |
function getClassString() | |
table.insert(recordInfos, {1,dwFilterKitDesc(dwOverrideClassNames(characters[currentID].classlevel.first.details,characters[currentID].class))}) | |
if characters[currentID].classlevel.second then | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,dwFilterKitDesc(dwOverrideClassNames(characters[currentID].classlevel.second.details,characters[currentID].class))}) | |
end | |
if characters[currentID].classlevel.third then | |
table.insert(recordInfos, {1,""}) | |
table.insert(recordInfos, {1,dwFilterKitDesc(dwOverrideClassNames(characters[currentID].classlevel.third.details,characters[currentID].class))}) | |
end | |
end | |
function getStatusString(strRef) | |
if type(dwAddCharacterIcon2) == 'function' then | |
strRef = dwAddCharacterIcon2(strRef) | |
end | |
return Infinity_FetchString(strRef) | |
end | |
` | |
menu | |
{ | |
name 'CHARACTER' | |
modal lua "not CurrentlyInGame()" | |
align center center | |
ignoreEsc | |
onopen | |
" | |
dwXPAdjust() | |
if (dwOpenRangerFavoredEnemy) then | |
Infinity_PopMenu()Infinity_PushMenu('DW_HATEDRACE') | |
else | |
dwRecordedRace[currentID]=dwFindSubraceData(characters[currentID]) | |
if(CurrentlyInGame()) then | |
pushSidebars() | |
end | |
characterViewable = characterScreen:IsCharacterViewable() | |
updateAttrTable() | |
end" | |
onclose | |
" | |
popSidebars() | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIREC2 | |
} | |
label | |
{ | |
area 82 0 700 42 | |
text "CHARACTER_SHEET_LABEL" | |
text style "title" | |
} | |
label | |
{ | |
area 318 44 230 32 | |
text lua "characters[currentID].name" | |
text style "label" | |
} | |
label | |
{ | |
area 332 108 200 314 | |
bitmap lua "characters[currentID].portrait" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 280 30 | |
mosaic INVSEP2 | |
respectClipping | |
enabled "recordStats[rowNumber][1] == 1" | |
text lua "recordStats[rowNumber][2]" | |
text style 'normal' | |
text color 'D' | |
text point 10 | |
text align left bottom | |
text useFontZoom 0 | |
pad 10 0 0 2 | |
} | |
label | |
{ | |
area 0 0 205 23 | |
enabled "recordStats[rowNumber][1] == 2" | |
text lua "recordStats[rowNumber][2]" | |
text style 'normal' | |
text align right center | |
} | |
label | |
{ | |
area 220 0 70 23 | |
enabled "recordStats[rowNumber][1] == 2" | |
text lua "recordStats[rowNumber][3]" | |
text style 'normal' | |
text align left center | |
} | |
} | |
enabled "characterViewable" | |
area 28 78 296 510 | |
rowheight dynamic | |
table "recordStats" | |
hidehighlight | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 -1 -1 | |
enabled "recordInfos[rowNumber][1] == 1" | |
text lua "recordInfos[rowNumber][2]" | |
text style 'parchment' | |
text align left center | |
text color D | |
} | |
label | |
{ | |
area 0 2 22 -1 | |
enabled "recordInfos[rowNumber][1] == 2" | |
bam lua "recordInfos[rowNumber][2].bam" | |
sequence lua "recordInfos[rowNumber][2].current" | |
text align left center | |
} | |
label | |
{ | |
area 22 0 -1 -1 | |
enabled "recordInfos[rowNumber][1] == 2" | |
text lua "getStatusString(recordInfos[rowNumber][2].strRef)" | |
text style 'parchment' | |
text align left center | |
text color D | |
} | |
} | |
enabled "characterViewable" | |
area 548 84 296 502 | |
rowheight dynamic | |
table "recordInfos" | |
hidehighlight | |
scrollbar 'GUISCRC' | |
} | |
label | |
{ | |
area 332 440 200 96 | |
text lua "characterDescString(characters[currentID])" | |
text style 'normal' | |
text align center center | |
} | |
button | |
{ | |
clickable lua "CurrentlyInGame() and characterScreen:IsLevelUpButtonClickable()" | |
area 331 546 201 44 | |
bam GUIOSTUM | |
text 'LEVEL_UP_BUTTON' | |
text style "button" | |
action | |
" | |
dwIsChargen=false;dwIsLevelling=true;dwIsDualClassing=false;dw_first_level_profs=false;dwRangerLevelOld=dwFindRangerLevel(false); dwHLANumberOld=dwNumberHLAs(false);characterScreen:OnLevelUpButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
enabled "not CurrentlyInGame()" | |
area 331 546 201 44 | |
bam GUIOSTUM | |
text 'DONE_BUTTON' | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
clickable lua "characterViewable" | |
area 36 610 234 44 | |
bam GUIOSTUL | |
text 'INFORMATION_BUTTON' | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('CHARACTER_INFORMATION') | |
" | |
} | |
button | |
{ | |
clickable lua "CurrentlyInGame() and characterScreen:IsReformPartyButtonClickable()" | |
area 36 654 234 44 | |
bam GUIOSTLL | |
text 'REFORM_PARTY_BUTTON' | |
text style "button" | |
action | |
" | |
characterScreen:OnReformPartyButtonClick() | |
" | |
} | |
button | |
{ | |
clickable lua "CurrentlyInGame() and characterScreen:IsDualClassButtonClickable()" | |
area 331 610 201 44 | |
bam GUIOSTUM | |
text 'DUAL_CLASS_BUTTON' | |
text style "button" | |
action | |
" | |
dwIsChargen=false;dwIsLevelling=false;dwIsDualClassing=true;dwOriginalClass,dwOriginalKit=dwFindClassKit(2);dwOriginalClass,dwOriginalKit=dwFindClassKit(2);characterScreen:OnDualClassButtonClick() | |
" | |
} | |
button | |
{ | |
area 331 654 201 44 | |
bam GUIOSTLM | |
text 'KIT_DESC_LABEL' | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('CHARACTER_KIT') | |
" | |
} | |
button | |
{ | |
clickable lua "CurrentlyInGame() and characterScreen:IsMultiPlayerModifyable()" | |
area 598 610 234 44 | |
bam GUIOSTUR | |
text 'CUSTOMIZE_BUTTON' | |
text style "button" | |
action | |
" | |
characterScreen:OnCustomizeButtonClick() | |
" | |
} | |
button | |
{ | |
clickable lua "CurrentlyInGame() and characterScreen:IsExportButtonClickable()" | |
area 598 654 234 44 | |
bam GUIOSTLR | |
text 'EXPORT_BUTTON' | |
text style "button" | |
action | |
" | |
characterScreen:OnExportButtonClick() | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARACTER_CUSTOMIZE' | |
align center center | |
modal | |
ignoreesc | |
onOpen | |
" | |
currentPanelID = const.CUSTOMIZE_ID | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "CUSTOMIZE_TITLE" | |
text style title | |
} | |
label | |
{ | |
area 318 64 230 42 | |
text lua "characters[currentID].name" | |
text style 'label' | |
} | |
text | |
{ | |
area 436 130 378 470 | |
text 11327 --Customize help text | |
scrollbar 'GUISCRC' | |
text style normal | |
text color D | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 192 340 32 | |
text style "button" | |
text "APPEARANCE_BUTTON" | |
action | |
" | |
characterScreen:OnAppearanceButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 228 340 32 | |
text style "button" | |
text "SOUNDS_BUTTON" | |
action | |
" | |
characterScreen:OnSoundsButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 264 340 32 | |
text style "button" | |
text "COLORS_BUTTON" | |
action | |
" | |
characterScreen:OnHairSkinButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 300 340 32 | |
text style "button" | |
text "SCRIPT_BUTTON" | |
action | |
" | |
characterScreen:OnScriptButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 336 340 32 | |
text style "button" | |
text "BIOGRAPHY_BUTTON" | |
action | |
" | |
characterScreen:OnCusomizeBiographyButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
characterScreen:OnCancelButtonClick() | |
currentPanelID = 0 | |
Infinity_PopMenu('CHARACTER_CUSTOMIZE') | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnDoneButtonClick() | |
else | |
characterScreen:OnCancelButtonClick() | |
end | |
currentPanelID = 0 | |
Infinity_PopMenu('CHARACTER_CUSTOMIZE') | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnCancelButtonClick() | |
else | |
characterScreen:OnDoneButtonClick() | |
end | |
currentPanelID = 0 | |
Infinity_PopMenu('CHARACTER_CUSTOMIZE') | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARACTER_INFORMATION' | |
align center center | |
modal | |
ignoreesc | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUISTATS | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "Infinity_FetchString(13707)" | |
text style 'title' | |
} | |
label | |
{ | |
area 318 64 230 42 | |
text lua "characters[currentID].name" | |
text style 'label' | |
} | |
label | |
{ | |
area 36 388 100 30 | |
text "CHAPTER_LABEL" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 724 388 100 30 | |
text "GAME_LABEL" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 36 116 418 63 | |
text lua "Infinity_FetchString(characters[currentID].Stats.bestenemy.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 488 116 336 63 | |
text lua "characters[currentID].Stats.bestenemy.current" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 36 179 418 63 | |
text lua "Infinity_FetchString(characters[currentID].Stats.timespent.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 488 179 336 63 | |
text lua "characters[currentID].Stats.timespent.current" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 36 242 418 63 | |
text lua "Infinity_FetchString(characters[currentID].Stats.favspell.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 488 242 336 63 | |
text lua "characters[currentID].Stats.favspell.current" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 36 305 418 63 | |
text lua "Infinity_FetchString(characters[currentID].Stats.favweapon.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 488 305 336 63 | |
text lua "characters[currentID].Stats.favweapon.current" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 36 440 100 43 | |
text lua "characters[currentID].Stats.partychapxp.current .. '%'" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 172 440 518 43 | |
text lua "Infinity_FetchString(characters[currentID].Stats.partychapxp.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 724 440 100 43 | |
text lua "characters[currentID].Stats.partygamexp.current .. '%'" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 36 483 100 43 | |
text lua "characters[currentID].Stats.partychapkills.current .. '%'" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 172 483 518 43 | |
text lua "Infinity_FetchString(characters[currentID].Stats.partychapkills.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 724 483 100 43 | |
text lua "characters[currentID].Stats.partygamekills.current .. '%'" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 36 526 100 43 | |
text lua "characters[currentID].Stats.chapxpvalue.current" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 172 526 518 43 | |
text lua "Infinity_FetchString(characters[currentID].Stats.chapxpvalue.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 724 526 100 43 | |
text lua "characters[currentID].Stats.gamexpvalue.current" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 36 569 100 43 | |
text lua "characters[currentID].Stats.chapkills.current" | |
text style 'normal' | |
text align center center | |
} | |
label | |
{ | |
area 172 569 518 43 | |
text lua "Infinity_FetchString(characters[currentID].Stats.chapkills.strRef)" | |
text style 'label' | |
text align center center | |
} | |
label | |
{ | |
area 724 569 100 43 | |
text lua "characters[currentID].Stats.gamekills.current" | |
text style 'normal' | |
text align center center | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BIOGRAPHY_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
else | |
Infinity_PushMenu('CHARACTER_BIO') | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BIOGRAPHY_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PushMenu('CHARACTER_BIO') | |
else | |
Infinity_PopMenu() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARACTER_BIO' | |
align center center | |
ignoreesc | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISE | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "BIOGRAPHY_TITLE" | |
text style 'title' | |
} | |
label | |
{ | |
area 318 64 230 42 | |
text lua "characters[currentID].name" | |
text style 'label' | |
} | |
text | |
{ | |
area 44 198 768 410 | |
text lua "Infinity_FetchString(characters[currentID].biography)" | |
scrollbar 'GUISCRC' | |
text style parchment | |
text color D | |
} | |
button | |
{ | |
on escape | |
bam GUIOSTCL | |
area 308 653 300 44 | |
text style "button" | |
text "DONE_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARACTER_KIT' | |
align center center | |
modal | |
ignoreesc | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISE | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "KIT_DESC_LABEL" | |
text style 'title' | |
} | |
label | |
{ | |
area 318 64 230 42 | |
text lua "characters[currentID].name" | |
text style 'label' | |
} | |
text | |
{ | |
area 44 198 768 410 | |
text lua "characters[currentID].kitDesc" | |
scrollbar 'GUISCRC' | |
text style parchment | |
text color D | |
} | |
button | |
{ | |
on escape | |
bam GUIOSTCL | |
area 308 653 300 44 | |
text style "button" | |
text "DONE_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
recBioEdit = "" | |
recBioEditBackup = "" | |
` | |
menu | |
{ | |
name 'CHARACTER_BIOGRAPHY' | |
align center center | |
ignoreesc | |
onOpen | |
" | |
recBioEditBackup = recBioEdit | |
currentPanelID = 23 | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "BIOGRAPHY_TITLE" | |
text style 'title' | |
} | |
edit | |
{ | |
area 436 128 382 478 | |
var recBioEdit | |
scrollbar 'GUISCRC' | |
text style "edit" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 192 340 32 | |
text style "button" | |
text "CLEAR_BUTTON" | |
action | |
" | |
recBioEdit = '' | |
" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 228 340 32 | |
text style "button" | |
text "REVERT_BUTTON" | |
action | |
" | |
recBioEdit = recBioEditBackup | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
characterScreen:OnCancelButtonClick() | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnDoneButtonClick() | |
else | |
characterScreen:OnCancelButtonClick() | |
end | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnCancelButtonClick() | |
else | |
characterScreen:OnDoneButtonClick() | |
end | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
} | |
` | |
scriptList_savedIdx = 0 | |
showingSmartOptions = false | |
function formatScriptName(text) | |
local i = string.find(text, ":") | |
if(i) then | |
text = string.sub(text, 1, i - 1) | |
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 | |
" | |
currentPanelID = const.SCRIPT_ID | |
Infinity_OnScriptItemSelect(scriptList_idx - 1) | |
showingSmartOptions = (scriptList_idx == 2) | |
scriptList_savedIdx = scriptList_idx | |
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 82 12 700 40 | |
text "SCRIPT_TITLE" | |
text style 'title' | |
} | |
label | |
{ | |
area 36 120 788 44 | |
text "CURRENT_SCRIPT_LABEL" | |
text style 'label' | |
} | |
text | |
{ | |
area 450 528 366 80 | |
text lua "scriptDescription" | |
scrollbar 'GUISCRC' | |
text style normal | |
enabled "showingSmartOptions == true" | |
} | |
text | |
{ | |
area 450 198 366 410 | |
text lua "scriptDescription" | |
scrollbar 'GUISCRC' | |
text style normal | |
text color D | |
enabled "showingSmartOptions == false" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= scriptList_idx and rowNumber ~= scriptList_hover" | |
area 0 0 -1 -1 | |
text lua "formatScriptName(scriptList[rowNumber])" | |
text style "normal" | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == scriptList_idx and rowNumber ~= scriptList_hover" | |
area 0 0 -1 -1 | |
text lua "formatScriptName(scriptList[rowNumber])" | |
text style "normal" | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == scriptList_hover" | |
area 0 0 -1 -1 | |
text lua "formatScriptName(scriptList[rowNumber])" | |
text style "normal" | |
text color H | |
} | |
} | |
area 46 198 354 410 | |
rowheight dynamic | |
hidehighlight | |
table "scriptList" | |
var "scriptList_idx" | |
scrollbar 'GUISCRC' | |
action | |
" | |
if scriptList[scriptList_idx] == ' ' or scriptList_idx == -1 then | |
scriptList_idx = scriptList_savedIdx | |
end | |
Infinity_OnScriptItemSelect(scriptList_idx - 1) | |
showingSmartOptions = (scriptList_idx == 2) | |
scriptList_savedIdx = scriptList_idx | |
" | |
actionEnter "scriptList_hover = mouseoverRow" | |
actionExit "scriptList_hover = 0" | |
} | |
list | |
{ | |
column | |
{ | |
width 80 | |
label | |
{ | |
enabled "rowNumber ~= selScriptOpt and rowNumber ~= hoverScriptOpt" | |
area 0 0 -1 -1 | |
text lua "t(scriptOptions[rowNumber][1])" | |
text style "normal" | |
text align right center | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == selScriptOpt and rowNumber ~= hoverScriptOpt" | |
area 0 0 -1 -1 | |
text lua "t(scriptOptions[rowNumber][1])" | |
text style "normal" | |
text align right center | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == hoverScriptOpt" | |
area 0 0 -1 -1 | |
text lua "t(scriptOptions[rowNumber][1])" | |
text style "normal" | |
text align right center | |
text color H | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 20 4 -1 -1 | |
bam ROUNDBUT | |
align left center | |
frame lua "scriptOptions[rowNumber][4]" | |
} | |
} | |
area 450 198 366 310 | |
rowheight 50 | |
hidehighlight | |
table "scriptOptions" | |
var selScriptOpt | |
scrollbar 'GUISCRC' | |
enabled "showingSmartOptions == true" | |
action | |
" | |
scriptDescription = t(scriptOptions[selScriptOpt][2]) | |
if(cellNumber == 2) then | |
handleScriptOptionChange(selScriptOpt) | |
end | |
" | |
actionEnter "hoverScriptOpt = mouseoverRow" | |
actionExit "hoverScriptOpt = 0" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
characterScreen:OnCancelButtonClick() | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
if showingSmartOptions == true then | |
for index, var in pairs(scriptOptions) do | |
characterScreen:SetTempSmartScriptLocal(var[3], var[5]) | |
end | |
end | |
characterScreen:OnDoneButtonClick() | |
else | |
characterScreen:OnCancelButtonClick() | |
end | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnCancelButtonClick() | |
else | |
if showingSmartOptions == true then | |
for index, var in pairs(scriptOptions) do | |
characterScreen:SetTempSmartScriptLocal(var[3], var[5]) | |
end | |
end | |
characterScreen:OnDoneButtonClick() | |
end | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARACTER_EXPORT' | |
align center center | |
modal | |
ignoreEsc | |
onOpen | |
" | |
currentPanelID = const.EXPORT_ID | |
characterExportCharacterEdit = characters[currentID].name | |
Infinity_FocusTextEdit('characterExportCharacterEditArea') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "EXPORT_TITLE" | |
text style title | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= list_GUIREC_13_0_idx and rowNumber ~= list_GUIREC_13_0_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUIREC_13_0[rowNumber]" | |
text style "normal" | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUIREC_13_0_idx and rowNumber ~= list_GUIREC_13_0_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUIREC_13_0[rowNumber]" | |
text style "normal" | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUIREC_13_0_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUIREC_13_0[rowNumber]" | |
text style "normal" | |
text color H | |
} | |
} | |
area 46 198 356 410 | |
rowheight dynamic | |
hidehighlight | |
table "list_GUIREC_13_0" | |
var "list_GUIREC_13_0_idx" | |
scrollbar 'GUISCRC' | |
action | |
" | |
Infinity_OnCharacterItemSelect(list_GUIREC_13_0_idx - 1) | |
" | |
actionEnter "list_GUIREC_13_0_hover = mouseoverRow" | |
actionExit "list_GUIREC_13_0_hover = 0" | |
} | |
label | |
{ | |
area 46 120 390 44 | |
text "EXPORT_FILENAME_LABEL" | |
text style "label" | |
text align right center | |
} | |
edit | |
{ | |
name "characterExportCharacterEditArea" | |
area 440 132 200 32 | |
var characterExportCharacterEdit | |
text style "edit" | |
maxlines 1 | |
action | |
" | |
if(characterExportCharacterEdit:len() > 7 and key_pressed ~= 8) then | |
return 0 | |
end | |
Infinity_UpdateCharacterRecordExportPanel() | |
return 1 | |
" | |
} | |
text | |
{ | |
area 450 198 362 410 | |
text 10962 | |
scrollbar 'GUISCRC' | |
text style normal | |
text color D | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
characterScreen:OnCancelButtonClick() | |
Infinity_PopMenu('CHARACTER_EXPORT') | |
currentPanelID = 0 | |
" | |
} | |
button | |
{ | |
clickable lua "reverseButtonPosition and characterScreen:IsDoneButtonClickable(currentID) or true" | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnDoneButtonClick() | |
else | |
characterScreen:OnCancelButtonClick() | |
Infinity_PopMenu('CHARACTER_EXPORT') | |
currentPanelID = 0 | |
end | |
" | |
} | |
button | |
{ | |
clickable lua "reverseButtonPosition and true or characterScreen:IsDoneButtonClickable(currentID)" | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnCancelButtonClick() | |
Infinity_PopMenu('CHARACTER_EXPORT') | |
currentPanelID = 0 | |
else | |
characterScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
list_GUIREC_20_5_idx = 0 | |
function compareCustomSound(s1, s2) | |
-- DEFAULT, then normal alphabetically, then AoN alphabetically (result must be strictly less than) | |
if (s1.sound == "DEFAULT" and s2.sound ~= "DEFAULT") then | |
return true | |
elseif (s2.sound == "DEFAULT" and s1.sound ~= "DEFAULT") then | |
return false | |
elseif (string.sub(s1.sound, 1, 4) == "BDTP" and string.sub(s2.sound, 1, 4) ~= "BDTP") then | |
return false | |
elseif (string.sub(s2.sound, 1, 4) == "BDTP" and string.sub(s1.sound, 1, 4) ~= "BDTP") then | |
return true | |
end | |
return s1.sound < s2.sound | |
end | |
function prepareSounds(soundTable) | |
-- preserve original indices to return as selection | |
local i; | |
for i = 1, #soundTable, 1 do | |
local s = soundTable[i]; | |
if (type(s) == "string") then | |
soundTable[i] = { | |
index = i, | |
sound = s | |
} | |
end | |
end | |
table.sort(soundTable, compareCustomSound) | |
end | |
function getSoundStringRef(rowNumber, tab) | |
if ( filenames_stringrefs[tab[rowNumber].sound] ~= nil ) then | |
return Infinity_FetchString(filenames_stringrefs[tab[rowNumber].sound][1]) | |
else | |
return tab[rowNumber].sound | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARACTER_SOUND' | |
align center center | |
ignoreesc | |
onOpen | |
" | |
currentPanelID = const.SOUND_ID | |
Infinity_OnSoundItemSelect(0) | |
prepareSounds(list_GUIREC_20_5) | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "SOUND_TITLE" | |
text style 'title' | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
button | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == list_GUIREC_20_5_idx and 2 or 0" | |
} | |
button | |
{ | |
area 0 0 340 32 | |
text lua "getSoundStringRef(rowNumber, list_GUIREC_20_5)" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
area 42 192 358 414 | |
rowheight 34 | |
hidehighlight | |
table "list_GUIREC_20_5" | |
var "list_GUIREC_20_5_idx" | |
scrollbar 'GUISCRC' | |
action | |
" | |
Infinity_OnSoundItemSelect(list_GUIREC_20_5[list_GUIREC_20_5_idx].index - 1) | |
characterScreen:OnPlayButtonClick() | |
" | |
actionEnter "list_GUIREC_20_5_hover = mouseoverRow" | |
actionExit "list_GUIREC_20_5_hover = 0" | |
} | |
text | |
{ | |
area 450 198 362 410 | |
text 11315 | |
scrollbar 'GUISCRC' | |
text style normal | |
text color D | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
characterScreen:OnCancelButtonClick() | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnDoneButtonClick() | |
else | |
characterScreen:OnCancelButtonClick() | |
end | |
Infinity_PopMenu() | |
currentPanelID = 17 | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
characterScreen:OnCancelButtonClick() | |
else | |
characterScreen:OnDoneButtonClick() | |
end | |
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 removeStoryModeOption() | |
for index = 1, #toggleTitles-1, 1 do | |
toggleTitles[index] = toggleTitles[index+1] | |
end | |
toggleTitles[#toggleTitles] = nil | |
end | |
function addStoryModeOption() | |
for index = #toggleTitles, 1, -1 do | |
toggleTitles[index+1] = toggleTitles[index] | |
end | |
toggleTitles[1] = {'DIFFICULTY_LABEL_STORYMODE', 'DIFFICULTY_DESCRIPTION_STORYMODE', 65, 0, 0} | |
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 = { | |
{"DIFFICULTY_LABEL_STORYMODE_MIXED", "DIFFICULTY_DESCRIPTION_STORYMODE", 65, 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}, | |
{"GORE_LABEL", "GORE_DESCRIPTION", 19, 0, 0}, | |
{"WEATHER_LABEL", "WEATHER_DESCRIPTION", 47, 0, 0}, | |
{"GROUP_INFRA_LABEL", "GROUP_INFRA_DESCRIPTION", 42, 0, 0}, | |
{"HEAL_ON_REST_LABEL", "HEAL_ON_REST_DESCRIPTION", 50, 0, 0}, | |
{"MAX_HP_ON_LEVEL_LABEL", "MAX_HP_ON_LEVEL_DESCRIPTION", 55, 0, 0}, | |
{"NO_DAMAGE_INCREASE_LABEL", "NO_DAMAGE_INCREASE_DESCRIPTION", 64, 0, 0}, | |
{"AUTO_USE_MAGIC_AMMO_LABEL", "AUTO_USE_MAGIC_AMMO_DESCRIPTION", 68, 0, 0}, | |
{"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}, | |
{'EQUIPMENT_COMPARISON_LABEL', 'EQUIPMENT_COMPARISON_DESCRIPTION', 46, 0, 0}, | |
{"A7_SHOW_DEBUG_CONSOLE_LABEL", "A7_SHOW_DEBUG_CONSOLE_DESCRIPTION", -167, 0, 0}, | |
{"A7_UI_EDIT_MODE_LABEL", "A7_UI_EDIT_MODE_DESCRIPTION", -168, 0, 0}, | |
{"A7_SHOW_STRREFS_LABEL", "A7_SHOW_STRREFS_DESCRIPTION", -169, 0, 0}, | |
{"A7_TOOLTIP_HOTKEYS_LABEL", "A7_TOOLTIP_HOTKEYS_DESCRIPTION", -170, 0, 0}, | |
{"A7_SHOW_TRIGGER_ICONS_LABEL", "A7_SHOW_TRIGGER_ICONS_DESCRIPTION", -171, 0, 0}, | |
{"A7_SHOW_CLERIC_RANGER_SPELLS_LABEL", "A7_SHOW_CLERIC_RANGER_SPELLS_DESCRIPTION", -173, 0, 0}, | |
{"A7_SNEAK_ATTACK_LABEL", "A7_SNEAK_ATTACK_DESCRIPTION", -174, 0, 0}, | |
{"A7_CRITICAL_HIT_SCREEN_SHAKE_LABEL", "A7_CRITICAL_HIT_SCREEN_SHAKE_DESCRIPTION", -175, 0, 0}, | |
{"A7_SHOW_EXTRA_COMBAT_INFO_LABEL", "A7_SHOW_EXTRA_COMBAT_INFO_DESCRIPTION", -176, 0, 0}, | |
{"A7_SHOW_DATE_ON_PAUSE_LABEL", "A7_SHOW_DATE_ON_PAUSE_DESCRIPTION", -177, 0, 0}, | |
{"A7_PAUSING_MAP_LABEL", "A7_PAUSING_MAP_DESCRIPTION", -180, 0, 0}, | |
{"A7_NIGHTMARE_XP_BONUS_LABEL", "A7_NIGHTMARE_XP_BONUS_DESCRIPTION", -183, 0, 0}, | |
{"A7_SHOW_AOE_LABEL", "A7_SHOW_AOE_DESCRIPTION", -186, 0, 0}, | |
{"A7_ENHANCED_PATH_SEARCH_LABEL", "A7_ENHANCED_PATH_SEARCH_DESCRIPTION", -187, 0, 0}, | |
{"A7_EXPIRE_TRAP_HIGHLIGHTS_LABEL", "A7_EXPIRE_TRAP_HIGHLIGHTS_DESCRIPTION", -188, 0, 0}, | |
{"A7_FORCE_DIALOG_PAUSE_LABEL", "A7_FORCE_DIALOG_PAUSE_DESCRIPTION", -194, 0, 0}, | |
} | |
selectedOpt = 0 | |
helpString = 0 | |
keyboardSLDR = 0 | |
mouseSLDR = 0 | |
difficultySLDR = 0 | |
panelID = 8 | |
` | |
menu | |
{ | |
name 'OPTIONS_GAMEPLAY' | |
align center center | |
modal | |
onOpen | |
" | |
panelID = 8 | |
helpString = 'GAMEPLAY_DESCRIPTION' | |
selectedOpt = 0 | |
if Infinity_GetOption(59, 8) ~= 0 and toggleTitles[1][3] == 65 then | |
removeStoryModeOption() | |
elseif Infinity_GetOption(59, 8) == 0 and toggleTitles[1][3] ~= 65 then | |
addStoryModeOption() | |
end | |
if Infinity_CanCloudSave() == false and (toggleTitles[1][3] == 60 or toggleTitles[2][3] == 60) then | |
removeOptionFromList(toggleTitles,60) | |
end | |
keyboardSLDR = Infinity_GetOption(3, panelID) | |
mouseSLDR = Infinity_GetOption(2, panelID) | |
difficultySLDR = Infinity_GetOption(12, panelID) | |
for index, var in pairs(toggleTitles) do | |
if var[1] == 'COLORED_MARKERS_LABEL' then | |
panelID = 9 | |
end | |
if (var[3] == -194) then | |
if (getDeferredOption('Game Options', 'Force Dialog Pause') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -188) then | |
if (getDeferredOption('Game Options', 'Expire Trap Highlights') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -187) then | |
if (getDeferredOption('Game Options', 'Enhanced Path Search') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -186) then | |
if (getDeferredOption('Game Options', 'Show AOE') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -183) then | |
if (getDeferredOption('Game Options', 'Nightmare Bonus XP') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -180) then | |
if (getDeferredOption('Game Options', 'Pausing Map') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -177) then | |
if (getDeferredOption('Game Options', 'Show Date On Pause') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -176) then | |
if (getDeferredOption('Game Options', 'Extra Combat Info') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -175) then | |
if (getDeferredOption('Game Options', 'Critical Hit Screen Shake') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -174) then | |
if (getDeferredOption('Game Options', '3E Thief Sneak Attack') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -173) then | |
if (getDeferredOption('Game Options', 'Cleric Ranger Spells') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -171) then | |
if (getDeferredOption('Game Options', 'Show Triggers On Tab') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -170) then | |
if (getDeferredOption('Game Options', 'Hotkeys On Tooltips') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -169) then | |
if (getDeferredOption('Program Options', 'Strref On') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -168) then | |
if (getDeferredOption('Program Options', 'UI Edit Mode') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -167) then | |
if (getDeferredOption('Program Options', 'Debug Mode') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
else | |
var[5] = Infinity_GetOption(var[3], panelID) | |
end | |
if var[5] == 0 then | |
var[4] = 0 | |
else | |
var[4] = 2 | |
end | |
end | |
panelID = 8 | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "GAMEPLAY_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 80 | |
label | |
{ | |
area 0 0 -1 50 | |
text lua "t(toggleTitles[rowNumber][1])" | |
text style "label" | |
text align right center | |
text useFontZoom 1 | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 0 0 -1 50 | |
bam ROUNDBUT | |
align center center | |
frame lua "toggleTitles[rowNumber][4]" | |
} | |
} | |
area 40 196 360 404 | |
rowheight dynamic | |
hidehighlight | |
table "toggleTitles" | |
var selectedOpt | |
scrollbar 'GUISCRC' | |
action | |
" | |
helpString = toggleTitles[selectedOpt][2] | |
if(cellNumber == 2) then | |
toggleTitles[selectedOpt][4] = toggleFrame(toggleTitles[selectedOpt][4]) | |
if toggleTitles[selectedOpt][4] == 0 then | |
toggleTitles[selectedOpt][5] = 0 | |
else | |
toggleTitles[selectedOpt][5] = 1 | |
end | |
end | |
" | |
} | |
text | |
{ | |
area 448 504 370 100 | |
text lua "t(helpString)" | |
text style normal | |
text align left top | |
text color D | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 460 200 140 40 | |
text "KEYBOARD_SCRLSPEED_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 'KEYBOARD_SCRLSPEED_DESCRIPTION' | |
" | |
} | |
slider | |
{ | |
area 610 200 200 36 | |
position "keyboardSLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 'KEYBOARD_SCRLSPEED_DESCRIPTION' | |
" | |
} | |
text | |
{ | |
area 460 250 140 40 | |
text "MOUSE_SCRLSPEED_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 'MOUSE_SCRLSPEED_DESCRIPTION' | |
" | |
} | |
slider | |
{ | |
area 610 250 200 36 | |
position "mouseSLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 'MOUSE_SCRLSPEED_DESCRIPTION' | |
" | |
} | |
text | |
{ | |
area 460 300 140 40 | |
text "DIFFICULTY_LABEL" | |
text style "label" | |
text align right center | |
text useFontZoom 1 | |
action | |
" | |
helpString = 'DIFFICULTY_DESCRIPTION' | |
" | |
} | |
slider | |
{ | |
area 610 300 200 36 | |
position "difficultySLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 5 | |
pad 8 0 10 0 | |
enabled "Infinity_GetOption(59, 8) == 0 and toggleTitles[1][4] == 0" | |
action | |
" | |
helpString = 'DIFFICULTY_DESCRIPTION' | |
" | |
} | |
label | |
{ | |
area 610 300 200 40 | |
text lua "t('DIFFICULTY_LABEL_LEGACYOFBHAAL')" | |
text style "label" | |
text align center center | |
enabled "Infinity_GetOption(59, 8) ~= 0" | |
} | |
label | |
{ | |
area 610 300 200 40 | |
text lua "t('DIFFICULTY_LABEL_STORYMODE')" | |
text style "label" | |
text align center center | |
enabled "Infinity_GetOption(59, 8) == 0 and toggleTitles[1][4] ~= 0" | |
} | |
button | |
{ | |
bam GUIOSTCL | |
area 482 352 300 44 | |
text "ASSIGN_KEYS_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('OPTIONS_KEYBINDINGS') | |
" | |
} | |
button | |
{ | |
area 482 400 300 44 | |
bam GUIOSTCL | |
text "FEEDBACK_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('OPTIONS_FEEDBACK') | |
" | |
} | |
button | |
{ | |
area 482 448 300 44 | |
bam GUIOSTCL | |
text "AUTO_PAUSE_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('OPTIONS_AUTOPAUSE') | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
panelID = 8 | |
Infinity_ChangeOption(3, keyboardSLDR, panelID) | |
Infinity_ChangeOption(2, mouseSLDR, panelID) | |
Infinity_ChangeOption(12, difficultySLDR + 1, panelID) -- cannot set story mode through slider | |
for index, var in pairs(toggleTitles) do | |
if var[1] == 'COLORED_MARKERS_LABEL' then | |
panelID = 9 | |
end | |
if (var[3] == -194) then | |
setDeferredOption('Game Options', 'Force Dialog Pause', var[5]) | |
elseif (var[3] == -188) then | |
setDeferredOption('Game Options', 'Expire Trap Highlights', var[5]) | |
elseif (var[3] == -187) then | |
setDeferredOption('Game Options', 'Enhanced Path Search', var[5]) | |
elseif (var[3] == -186) then | |
setDeferredOption('Game Options', 'Show AOE', var[5]) | |
elseif (var[3] == -183) then | |
setDeferredOption('Game Options', 'Nightmare Bonus XP', var[5]) | |
elseif (var[3] == -180) then | |
setDeferredOption('Game Options', 'Pausing Map', var[5]) | |
elseif (var[3] == -177) then | |
setDeferredOption('Game Options', 'Show Date On Pause', var[5]) | |
elseif (var[3] == -176) then | |
setDeferredOption('Game Options', 'Extra Combat Info', var[5]) | |
elseif (var[3] == -175) then | |
setDeferredOption('Game Options', 'Critical Hit Screen Shake', var[5]) | |
elseif (var[3] == -174) then | |
setDeferredOption('Game Options', '3E Thief Sneak Attack', var[5]) | |
elseif (var[3] == -173) then | |
setDeferredOption('Game Options', 'Cleric Ranger Spells', var[5]) | |
elseif (var[3] == -171) then | |
setDeferredOption('Game Options', 'Show Triggers On Tab', var[5]) | |
elseif (var[3] == -170) then | |
setDeferredOption('Game Options', 'Hotkeys On Tooltips', var[5]) | |
elseif (var[3] == -169) then | |
setDeferredOption('Program Options', 'Strref On', var[5]) | |
elseif (var[3] == -168) then | |
setDeferredOption('Program Options', 'UI Edit Mode', var[5]) | |
elseif (var[3] == -167) then | |
setDeferredOption('Program Options', 'Debug Mode', var[5]) | |
else | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
end | |
panelID = 8 | |
end | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if not reverseButtonPosition then | |
panelID = 8 | |
Infinity_ChangeOption(3, keyboardSLDR, panelID) | |
Infinity_ChangeOption(2, mouseSLDR, panelID) | |
Infinity_ChangeOption(12, difficultySLDR + 1, panelID) -- cannot set story mode through slider | |
for index, var in pairs(toggleTitles) do | |
if var[1] == 'COLORED_MARKERS_LABEL' then | |
panelID = 9 | |
end | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
panelID = 8 | |
end | |
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',engine_mode == 0 and 24432 or 31872, 31, 0, 0}, | |
{'TRAP_FOUND_LABEL',engine_mode == 0 and 24433 or 58171, 34, 0, 0} | |
} | |
characterPauseToggles = { | |
{'CENTER_MEMBER_LABEL',engine_mode == 0 and 24434 or 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} | |
} | |
` | |
menu | |
{ | |
name 'OPTIONS_AUTOPAUSE' | |
align center center | |
onOpen | |
" | |
panelID = 10 | |
selOptAP = 0 | |
selOptAPC = 0 | |
autopauseString = 18044 | |
for index, var in pairs(autoPauseToggles) do | |
var[5] = Infinity_GetOption(var[3], 10) | |
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], 10) | |
if var[5] == 0 then | |
var[4] = 0 | |
else | |
var[4] = 2 | |
end | |
end | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GOPSNDSB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "AUTO_PAUSE_TITLE" | |
text style "title" | |
} | |
text | |
{ | |
area 150 130 356 50 | |
text lua "t(characterPauseToggles[1][1])" | |
text style "label" | |
text align right center | |
text useFontZoom 1 | |
action | |
" | |
selOptAP = 0 | |
selOptAPC = 1 | |
autopauseString = characterPauseToggles[selOptAPC][2] | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 510 130 50 50 | |
bam ROUNDBUT | |
align center center | |
frame lua "characterPauseToggles[1][4]" | |
action | |
" | |
selOptAP = 0 | |
selOptAPC = 1 | |
autopauseString = characterPauseToggles[selOptAPC][2] | |
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 | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 80 | |
label | |
{ | |
enabled "rowNumber > 1" | |
area 0 0 -1 50 | |
text lua "t(characterPauseToggles[rowNumber][1])" | |
text style "label" | |
text align right center | |
text useFontZoom 1 | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
enabled "rowNumber > 1" | |
area 0 0 -1 50 | |
bam ROUNDBUT | |
align center center | |
frame lua "characterPauseToggles[rowNumber][4]" | |
} | |
} | |
area 44 190 356 272 | |
rowheight dynamic | |
hidehighlight | |
table "characterPauseToggles" | |
var selOptAPC | |
action | |
" | |
selOptAP = 0 | |
autopauseString = characterPauseToggles[selOptAPC][2] | |
if(cellNumber == 2) then | |
characterPauseToggles[selOptAPC][4] = toggleFrame(characterPauseToggles[selOptAPC][4]) | |
if characterPauseToggles[selOptAPC][4] == 0 then | |
characterPauseToggles[selOptAPC][5] = 0 | |
else | |
characterPauseToggles[selOptAPC][5] = 1 | |
end | |
end | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 80 | |
label | |
{ | |
area 0 0 -1 50 | |
text lua "t(autoPauseToggles[rowNumber][1])" | |
text style "label" | |
text align right center | |
text useFontZoom 1 | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 0 0 -1 50 | |
bam ROUNDBUT | |
align center center | |
frame lua "autoPauseToggles[rowNumber][4]" | |
} | |
} | |
area 446 190 300 272 | |
rowheight dynamic | |
hidehighlight | |
table "autoPauseToggles" | |
var selOptAP | |
action | |
" | |
selOptAPC = 0 | |
autopauseString = autoPauseToggles[selOptAP][2] | |
if(cellNumber == 2) then | |
autoPauseToggles[selOptAP][4] = toggleFrame(autoPauseToggles[selOptAP][4]) | |
if autoPauseToggles[selOptAP][4] == 0 then | |
autoPauseToggles[selOptAP][5] = 0 | |
else | |
autoPauseToggles[selOptAP][5] = 1 | |
end | |
end | |
" | |
} | |
label | |
{ | |
area 110 478 646 136 | |
text lua "Infinity_FetchString(autopauseString)" | |
text style "normal" | |
text align center center | |
text color D | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
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 | |
end | |
panelID = 8 | |
helpString = 'GAMEPLAY_DESCRIPTION' | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if not reverseButtonPosition then | |
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 | |
end | |
panelID = 8 | |
helpString = 'GAMEPLAY_DESCRIPTION' | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
graphicsToggles = { | |
{'FULL_SCREEN_LABEL',18000, 9 , 0, 0, 0}, | |
{'HARDWARE_CURSOR_LABEL',engine_mode == 0 and 32205 or 93703, 13, 0, 0, 0}, | |
{'SCALE_UI_LABEL',engine_mode == 0 and 32206 or 93704, 14, 0, 0, 0}, | |
{'ZOOM_LOCK_LABEL',engine_mode == 0 and 32712 or 103188, 36, 0, 0, 0}, | |
{'SPRITE_OUTLINE_LABEL',engine_mode == 0 and 32708 or 103189, 15, 0, 0, 0}, | |
{'GREYSCALE_ON_PAUSE_LABEL',engine_mode == 0 and 32709 or 103190, 66, 0, 0, 0}, | |
{'HIGHLIGHT_SPRITE_LABEL',engine_mode == 0 and 32710 or 103191, 67, 0, 0, 0}, | |
{'DITHER_ALWAYS_LABEL',18021, 52, 0, 0, 0}, | |
{'SHOW_HP_LABEL',engine_mode == 0 and 32715 or 103205, 53, 0, 0, 0}, | |
{'SHOW_HEALTHBAR_LABEL',engine_mode == 0 and 32718 or 103192, 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}, | |
{'AREA_MAP_ZOOM_TRANSITION_LABEL','AREA_MAP_ZOOM_TRANSITION_DESCRIPTION', 71, 0, 0, 0}, | |
{'LEUI_SIDEBAR_TOGGLE_LABEL','LEUI_SIDEBAR_TOGGLE_DESCRIPTION', 100, 0, 0, 0}, | |
{'LEUI_QUICKSAVE_LABEL','LEUI_QUICKSAVE_DESCRIPTION', 101, 0, 0, 0}, | |
{'LEUI_HIGHLIGHT_LABEL','LEUI_HIGHLIGHT_DESCRIPTION', 102, 0, 0, 0}, | |
{'LEUI_SIDEBAR_RIGHT_SMALL_BUTTONS_LABEL','LEUI_SIDEBAR_RIGHT_SMALL_BUTTONS_DESCRIPTION', 103, 0, 0, 0}, | |
{'LEUI_CLICK_TO_LEVEL_UP_LABEL','LEUI_CLICK_TO_LEVEL_UP_DESCRIPTION', 104, 0, 0, 0}, | |
{'LEUI_REVERSE_BUTTON_POSITIONS_LABEL','LEUI_REVERSE_BUTTON_POSITIONS_DESCRIPTION', 106, 0, 0, 0}, | |
{'LEUI_SINGLE_CLICK_TRAVEL_LABEL','LEUI_SINGLE_CLICK_TRAVEL_DESCRIPTION', 107, 0, 0, 0}, | |
{'LEUI_JOURNAL_COLLAPSED_LABEL','LEUI_JOURNAL_COLLAPSED_DESCRIPTION', 108, 0, 0, 0}, | |
{'A7_REVERSE_WHEEL_ZOOM_LABEL', 34005, -179, 0, 0, 0}, | |
{'A7_SHOW_ENABLE_FOG_LABEL', 34006, -181, 0, 0, 0}, | |
{'A7_DISABLE_MOVIES_LABEL', 34007, -182, 0, 0, 0}, | |
{'A7_SHOW_LEARNABLE_SPELLS_LABEL', 34008, -189, 0, 0, 0}, | |
{'A7_RENDER_SEARCH_MAP_LABEL', 34009, -190, 0, 0, 0}, | |
{'A7_RENDER_DYNAMIC_SEARCH_MAP_LABEL', 34010, -191, 0, 0, 0}, | |
} | |
LeUI_uiStrings = { | |
LEUI_SIDEBAR_TOGGLE_LABEL = "Sidebar Toggle Buttons", | |
LEUI_SIDEBAR_TOGGLE_DESCRIPTION = "Enable this option to show Toggle Buttons on left and right sidebars", | |
LEUI_QUICKSAVE_LABEL = "Show Quicksave Button", | |
LEUI_QUICKSAVE_DESCRIPTION = "Enable this option to show Quick Save button on left sidebar", | |
LEUI_HIGHLIGHT_LABEL = "Show Highlight Button", | |
LEUI_HIGHLIGHT_DESCRIPTION = "Enable this option to show Reveal Details button on right sidebar", | |
LEUI_SIDEBAR_RIGHT_SMALL_BUTTONS_LABEL = "Small Sidebar Buttons", | |
LEUI_SIDEBAR_RIGHT_SMALL_BUTTONS_DESCRIPTION = "Enable this option for small AI Toggle and Select All buttons on right sidebar", | |
LEUI_CLICK_TO_LEVEL_UP_LABEL = "Left Click to Level Up", | |
LEUI_CLICK_TO_LEVEL_UP_DESCRIPTION = "Enable this option for level up your character by clicking on portrait", | |
LEUI_REVERSE_BUTTON_POSITIONS_LABEL = "Reverse Buttons Positions", | |
LEUI_REVERSE_BUTTON_POSITIONS_DESCRIPTION = "Enable this option to reverse buttons positions", | |
LEUI_SINGLE_CLICK_TRAVEL_LABEL = "Single Click Travel", | |
LEUI_SINGLE_CLICK_TRAVEL_DESCRIPTION = "Enable this option for map traveling with single click", | |
LEUI_JOURNAL_COLLAPSED_LABEL = "Journal Collapsed", | |
LEUI_JOURNAL_COLLAPSED_DESCRIPTION = "Enable this option for journal be collapsed by default", | |
} | |
if options['LeUI'] == nil then | |
options['LeUI'] = {} | |
end | |
function LeUIquestDisplay(index) | |
if journalCollapsed then | |
return questDisplay[index].expanded | |
else | |
return not questDisplay[index].hidden | |
end | |
end | |
function LeUIGetOption(item, value) | |
if options['LeUI'][item] ~= nil then | |
return options['LeUI'][item] == '1' and true or false | |
else | |
options['LeUI'][item] = value and '1' or '0' | |
return value | |
end | |
end | |
showSidebarToggle = LeUIGetOption(LeUI_uiStrings.LEUI_SIDEBAR_TOGGLE_LABEL, true) | |
showQuickSaveButton = LeUIGetOption(LeUI_uiStrings.LEUI_QUICKSAVE_LABEL, true) | |
showHighlightButton = LeUIGetOption(LeUI_uiStrings.LEUI_HIGHLIGHT_LABEL, true) | |
rightSidebarSmallButton = LeUIGetOption(LeUI_uiStrings.LEUI_SIDEBAR_RIGHT_SMALL_BUTTONS_LABEL, false) | |
clickToLevelUp = LeUIGetOption(LeUI_uiStrings.LEUI_CLICK_TO_LEVEL_UP_LABEL, false) | |
reverseButtonPosition = LeUIGetOption(LeUI_uiStrings.LEUI_REVERSE_BUTTON_POSITIONS_LABEL, true) | |
singleClickTravel = LeUIGetOption(LeUI_uiStrings.LEUI_SINGLE_CLICK_TRAVEL_LABEL, false) | |
journalCollapsed = LeUIGetOption(LeUI_uiStrings.LEUI_JOURNAL_COLLAPSED_LABEL, false) | |
function appendNewOptions() | |
for n, v in pairs(LeUI_uiStrings) do | |
uiStrings[n] = v | |
end | |
end | |
addedDirectx = false | |
function appendDirectXOption() | |
if addedDirectx == false then | |
dxOption = {'DIRECTX_LABEL', engine_mode == 0 and 32725 or 103148, 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 | |
appendNewOptions() | |
panelID = 6 | |
helpString = 18038 | |
selectedGraphicOpt = 0 | |
fontSizeSLDR = Infinity_GetOption(22, panelID) | |
fontSizeCancel = Infinity_GetOption(22, panelID) | |
for index, var in pairs(graphicsToggles) do | |
if var[3] == 100 then | |
var[5] = showSidebarToggle and 1 or 0 | |
elseif var[3] == 101 then | |
var[5] = showQuickSaveButton and 1 or 0 | |
elseif var[3] == 102 then | |
var[5] = showHighlightButton and 1 or 0 | |
elseif var[3] == 103 then | |
var[5] = rightSidebarSmallButton and 1 or 0 | |
elseif var[3] == 104 then | |
var[5] = clickToLevelUp and 1 or 0 | |
elseif var[3] == 106 then | |
var[5] = reverseButtonPosition and 1 or 0 | |
elseif var[3] == 107 then | |
var[5] = singleClickTravel and 1 or 0 | |
elseif var[3] == 108 then | |
var[5] = journalCollapsed and 1 or 0 | |
else | |
if (var[3] == -191) then | |
if (getDeferredOption('Game Options', 'Render Dynamic Search Map') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -190) then | |
if (getDeferredOption('Game Options', 'Render Search Map') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -189) then | |
if (getDeferredOption('Game Options', 'Show Learnable Spells') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -182) then | |
if (getDeferredOption('Program Options', 'Disable Movies') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -181) then | |
if (getDeferredOption('Game Options', 'Enable Fog') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
elseif (var[3] == -179) then | |
if (getDeferredOption('Game Options', 'Reverse Mouse Wheel Zoom') == 0) then | |
var[5] = 0 | |
else | |
var[5] = 1 | |
end | |
else | |
var[5] = Infinity_GetOption(var[3], panelID) | |
end | |
end | |
var[6] = 0 | |
if var[5] == 0 then | |
var[4] = 0 | |
else | |
var[4] = 2 | |
end | |
end | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "GRAPHICS_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 80 | |
label | |
{ | |
area 0 0 -1 50 | |
text lua "t(graphicsToggles[rowNumber][1])" | |
text style "label" | |
text align right center | |
text useFontZoom 1 | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 0 0 -1 50 | |
bam ROUNDBUT | |
align center center | |
frame lua "graphicsToggles[rowNumber][4]" | |
} | |
} | |
area 40 196 360 404 | |
rowheight dynamic | |
hidehighlight | |
table "graphicsToggles" | |
var selectedGraphicOpt | |
scrollbar 'GUISCRC' | |
action | |
" | |
helpString = graphicsToggles[selectedGraphicOpt][2] | |
if(cellNumber == 2) then | |
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 | |
end | |
" | |
} | |
text | |
{ | |
area 448 212 120 40 | |
text "FONT_SIZE_LABEL" | |
text style "label" | |
text align right center | |
text useFontZoom 1 | |
action | |
" | |
helpString = 17204 | |
" | |
} | |
slider | |
{ | |
area 580 212 200 36 | |
position "fontSizeSLDR" | |
mosaic GUISLDR | |
bam SLDRSTAR | |
frame 3 | |
settings 7 | |
pad 8 0 10 0 | |
action | |
" | |
Infinity_ChangeOption(22, fontSizeSLDR, 6) | |
helpString = 17204 | |
" | |
} | |
label | |
{ | |
area 448 252 374 240 | |
text lua "formatGraphicsInfoString()" | |
text style normal | |
text align center center | |
} | |
text | |
{ | |
area 448 492 374 120 | |
text lua "getStringFromAmbiguousSource(helpString)" | |
text style normal | |
text align left top | |
text color D | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
panelID = 6 | |
if reverseButtonPosition then | |
Infinity_ChangeOption(22, fontSizeSLDR, panelID) | |
for index, var in pairs(graphicsToggles) do | |
if var[6] == 1 then | |
if var[3] == 100 then | |
showSidebarToggle = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_SIDEBAR_TOGGLE_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 101 then | |
showQuickSaveButton = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_QUICKSAVE_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 102 then | |
showHighlightButton = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_HIGHLIGHT_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 103 then | |
rightSidebarSmallButton = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_SIDEBAR_RIGHT_SMALL_BUTTONS_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 104 then | |
clickToLevelUp = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_CLICK_TO_LEVEL_UP_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 106 then | |
reverseButtonPosition = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_REVERSE_BUTTON_POSITIONS_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 107 then | |
singleClickTravel = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_SINGLE_CLICK_TRAVEL_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 108 then | |
journalCollapsed = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_JOURNAL_COLLAPSED_LABEL] = var[5] == 1 and '1' or '0' | |
else | |
if (var[3] == -191) then | |
setDeferredOption('Game Options', 'Render Dynamic Search Map', var[5]) | |
elseif (var[3] == -190) then | |
setDeferredOption('Game Options', 'Render Search Map', var[5]) | |
elseif (var[3] == -189) then | |
setDeferredOption('Game Options', 'Show Learnable Spells', var[5]) | |
elseif (var[3] == -182) then | |
setDeferredOption('Program Options', 'Disable Movies', var[5]) | |
elseif (var[3] == -181) then | |
setDeferredOption('Game Options', 'Enable Fog', var[5]) | |
elseif (var[3] == -179) then | |
setDeferredOption('Game Options', 'Reverse Mouse Wheel Zoom', var[5]) | |
else | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
end | |
end | |
end | |
else | |
Infinity_ChangeOption(22, fontSizeCancel, panelID) | |
end | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
panelID = 6 | |
if reverseButtonPosition then | |
Infinity_ChangeOption(22, fontSizeCancel, panelID) | |
else | |
Infinity_ChangeOption(22, fontSizeSLDR, panelID) | |
for index, var in pairs(graphicsToggles) do | |
if var[6] == 1 then | |
if var[3] == 100 then | |
showSidebarToggle = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_SIDEBAR_TOGGLE_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 101 then | |
showQuickSaveButton = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_QUICKSAVE_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 102 then | |
showHighlightButton = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_HIGHLIGHT_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 103 then | |
rightSidebarSmallButton = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_SIDEBAR_RIGHT_SMALL_BUTTONS_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 104 then | |
clickToLevelUp = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_CLICK_TO_LEVEL_UP_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 106 then | |
reverseButtonPosition = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_REVERSE_BUTTON_POSITIONS_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 107 then | |
singleClickTravel = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_SINGLE_CLICK_TRAVEL_LABEL] = var[5] == 1 and '1' or '0' | |
elseif var[3] == 108 then | |
journalCollapsed = var[5] == 1 and true or false | |
options['LeUI'][LeUI_uiStrings.LEUI_JOURNAL_COLLAPSED_LABEL] = var[5] == 1 and '1' or '0' | |
else | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
end | |
end | |
end | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
soundsToggles = { | |
{'CHARACTER_SUBTITLES_LABEL',18015, 5, 0, 0}, | |
{'BATTLE_CRIES_LABEL',18013, 6, 0, 0}, | |
{'MOVEMENT_SOUNDS_LABEL',18014, 7, 0, 0} | |
} | |
command = { | |
{'ALWAYS_LABEL',0, 8, 0, 0}, | |
{'SELDOM_LABEL',0, 9, 0, 0}, | |
{'NEVER_LABEL',0, 10, 0, 0} | |
} | |
selectOpt = { | |
{'ALWAYS_LABEL',0, 58, 0, 0}, | |
{'SELDOM_LABEL',0, 59, 0, 0}, | |
{'NEVER_LABEL',0, 60, 0, 0} | |
} | |
commandSel = 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 = 18040 | |
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) | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GOPGAMB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "SOUND_TITLE" | |
text style "title" | |
} | |
text | |
{ | |
area 222 160 200 40 | |
text "AMBIENT_VOLUME_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 18008 | |
" | |
} | |
slider | |
{ | |
area 425 160 200 36 | |
position "ambientSLDR" | |
mosaic GUISLDR | |
bam SLDRSTAR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 18008 | |
" | |
} | |
text | |
{ | |
area 222 215 200 40 | |
text "SFX_VOLUME_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 18009 | |
" | |
} | |
slider | |
{ | |
area 425 215 200 36 | |
mosaic GUISLDR | |
position "sfxSLDR" | |
bam SLDRSTAR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 18009 | |
" | |
} | |
text | |
{ | |
area 222 270 200 40 | |
text "VOICE_VOLUME_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 18010 | |
" | |
} | |
slider | |
{ | |
area 425 270 200 36 | |
position "voiceSLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 18010 | |
" | |
} | |
text | |
{ | |
area 222 325 200 40 | |
text "MUSIC_VOLUME_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 18011 | |
" | |
} | |
slider | |
{ | |
area 425 325 200 36 | |
position "musicSLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 18011 | |
" | |
} | |
text | |
{ | |
area 222 380 200 40 | |
text "MOVIE_VOLUME_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 18012 | |
" | |
} | |
slider | |
{ | |
area 425 380 200 36 | |
position "movieSLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 18012 | |
" | |
} | |
button | |
{ | |
bam GUIOSTCL | |
area 282 454 300 44 | |
text style "button" | |
text "CHARACTER_SOUNDS_LABEL" | |
action | |
" | |
Infinity_PushMenu('OPTIONS_CHARACTER_SOUND') | |
" | |
} | |
text | |
{ | |
area 106 518 654 100 | |
text lua "Infinity_FetchString(helpString)" | |
text style "normal" | |
text align center center | |
text color D | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
panelID = 7 | |
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) | |
end | |
panelID = 8 | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if not reverseButtonPosition then | |
panelID = 7 | |
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) | |
end | |
panelID = 8 | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'OPTIONS_CHARACTER_SOUND' | |
align center center | |
onOpen | |
" | |
panelID = 7 | |
helpString = 18041 | |
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 | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GOPSNDSB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "CHARACTER_SOUNDS_LABEL" | |
text style "title" | |
} | |
text | |
{ | |
area 64 160 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "soundsToggles[1][4]" | |
action | |
" | |
helpString = soundsToggles[1][2] | |
soundsToggles[1][4] = toggleFrame(soundsToggles[1][4]) | |
if soundsToggles[1][4] == 0 then | |
soundsToggles[1][5] = 0 | |
else | |
soundsToggles[1][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 110 160 180 46 | |
text lua "t(soundsToggles[1][1])" | |
text style "label" | |
text align left center | |
action | |
" | |
helpString = soundsToggles[1][2] | |
" | |
} | |
text | |
{ | |
area 324 160 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "soundsToggles[2][4]" | |
action | |
" | |
helpString = soundsToggles[2][2] | |
soundsToggles[2][4] = toggleFrame(soundsToggles[2][4]) | |
if soundsToggles[2][4] == 0 then | |
soundsToggles[2][5] = 0 | |
else | |
soundsToggles[2][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 370 160 180 46 | |
text lua "t(soundsToggles[2][1])" | |
text style "label" | |
text align left center | |
action | |
" | |
helpString = soundsToggles[2][2] | |
" | |
} | |
text | |
{ | |
area 570 160 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "soundsToggles[3][4]" | |
action | |
" | |
helpString = soundsToggles[3][2] | |
soundsToggles[3][4] = toggleFrame(soundsToggles[3][4]) | |
if soundsToggles[3][4] == 0 then | |
soundsToggles[3][5] = 0 | |
else | |
soundsToggles[3][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 616 160 180 46 | |
text lua "t(soundsToggles[3][1])" | |
text style "label" | |
text align left center | |
action | |
" | |
helpString = soundsToggles[3][2] | |
" | |
} | |
text | |
{ | |
area 110 250 250 44 | |
text "COMMAND_SOUNDS_BUTTON" | |
text style "button" | |
text align right center | |
action | |
" | |
helpString = 18016 | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 80 | |
label | |
{ | |
area 10 0 -1 -1 | |
text lua "t(command[rowNumber][1])" | |
text style "label" | |
text align right center | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 10 8 -1 -1 | |
bam ROUNDBUT | |
align center center | |
frame lua "command[rowNumber][4]" | |
} | |
} | |
area 110 300 250 145 | |
rowheight 46 | |
table "command" | |
var commandSel | |
hidehighlight | |
action | |
" | |
helpString = 18016 | |
command[1][4] = 0 | |
command[2][4] = 0 | |
command[3][4] = 0 | |
command[commandSel][4] = 2 | |
" | |
} | |
text | |
{ | |
area 410 250 250 44 | |
text "SELECTION_BUTTON" | |
text style "button" | |
text align right center | |
action | |
" | |
helpString = 11352 | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 80 | |
label | |
{ | |
area 10 0 -1 -1 | |
text lua "t(selectOpt[rowNumber][1])" | |
text style "label" | |
text align right center | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 10 8 -1 -1 | |
bam ROUNDBUT | |
align center center | |
frame lua "selectOpt[rowNumber][4]" | |
} | |
} | |
area 410 300 250 145 | |
rowheight 46 | |
table "selectOpt" | |
var selectSel | |
hidehighlight | |
action | |
" | |
helpString = 11352 | |
selectOpt[1][4] = 0 | |
selectOpt[2][4] = 0 | |
selectOpt[3][4] = 0 | |
selectOpt[selectSel][4] = 2 | |
" | |
} | |
text | |
{ | |
area 110 478 646 136 | |
text lua "Infinity_FetchString(helpString)" | |
text style "normal" | |
text align center center | |
text color D | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
panelID = 7 | |
for index, var in pairs(command) do | |
if var[4] == 2 then | |
Infinity_ChangeOption(var[3], 1, panelID) | |
end | |
end | |
for index, var in pairs(selectOpt) do | |
if var[4] == 2 then | |
Infinity_ChangeOption(var[3], 1, panelID) | |
end | |
end | |
for index, var in pairs(soundsToggles) do | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
end | |
helpString = 18040 | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if not reverseButtonPosition then | |
panelID = 7 | |
for index, var in pairs(command) do | |
if var[4] == 2 then | |
Infinity_ChangeOption(var[3], 1, panelID) | |
end | |
end | |
for index, var in pairs(selectOpt) do | |
if var[4] == 2 then | |
Infinity_ChangeOption(var[3], 1, panelID) | |
end | |
end | |
for index, var in pairs(soundsToggles) do | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
end | |
helpString = 18040 | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
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} | |
} | |
helpString = 0 | |
markerFeedSLDR = 0 | |
locatorFeedSLDR = 0 | |
ttDelaySLDR = 0 | |
` | |
menu | |
{ | |
name 'OPTIONS_FEEDBACK' | |
align center center | |
onOpen | |
" | |
panelID = 9 | |
helpString = 'FEEDBACK_HELP' | |
markerFeedSLDR = Infinity_GetOption(8, panelID) | |
locatorFeedSLDR = Infinity_GetOption(9, panelID) | |
ttDelaySLDR = Infinity_GetOption(1, 8) | |
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 | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GOPSNDSB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "FEEDBACK_TITLE" | |
text style "title" | |
} | |
text | |
{ | |
area 222 140 200 36 | |
text "MARKER_FEEDBACK_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 'MARKER_FEEDBACK_HELP' | |
" | |
} | |
slider | |
{ | |
area 425 140 200 36 | |
position "markerFeedSLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 6 | |
action | |
" | |
helpString = 'MARKER_FEEDBACK_HELP' | |
" | |
} | |
text | |
{ | |
area 222 195 200 40 | |
text "LOCATOR_FEEDBACK_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 'LOCATOR_FEEDBACK_HELP' | |
" | |
} | |
slider | |
{ | |
area 425 195 200 36 | |
position "locatorFeedSLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 5 | |
action | |
" | |
helpString = 'LOCATOR_FEEDBACK_HELP' | |
" | |
} | |
text | |
{ | |
area 222 250 200 40 | |
text "TOOLTIP_DELAY_LABEL" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = 'TOOLTIP_DELAY_DESCRIPTION' | |
" | |
} | |
slider | |
{ | |
area 425 250 200 36 | |
position "ttDelaySLDR" | |
bam SLDRSTAR | |
mosaic GUISLDR | |
frame 3 | |
settings 40 | |
pad 8 0 10 0 | |
action | |
" | |
helpString = 'TOOLTIP_DELAY_DESCRIPTION' | |
" | |
} | |
label | |
{ | |
area 222 300 403 40 | |
text "FEEDBACK_MESSAGES_LABEL" | |
text style "button" | |
text align center center | |
} | |
text | |
{ | |
area 70 340 180 46 | |
text lua "t(messagesToggles[1][1])" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = messagesToggles[1][2] | |
" | |
} | |
text | |
{ | |
area 250 340 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "messagesToggles[1][4]" | |
action | |
" | |
helpString = messagesToggles[1][2] | |
messagesToggles[1][4] = toggleFrame(messagesToggles[1][4]) | |
if messagesToggles[1][4] == 0 then | |
messagesToggles[1][5] = 0 | |
else | |
messagesToggles[1][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 300 340 180 46 | |
text lua "t(messagesToggles[2][1])" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = messagesToggles[2][2] | |
" | |
} | |
text | |
{ | |
area 480 340 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "messagesToggles[2][4]" | |
action | |
" | |
helpString = messagesToggles[2][2] | |
messagesToggles[2][4] = toggleFrame(messagesToggles[2][4]) | |
if messagesToggles[2][4] == 0 then | |
messagesToggles[2][5] = 0 | |
else | |
messagesToggles[2][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 530 340 180 46 | |
text lua "t(messagesToggles[3][1])" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = messagesToggles[3][2] | |
" | |
} | |
text | |
{ | |
area 710 340 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "messagesToggles[3][4]" | |
action | |
" | |
helpString = messagesToggles[3][2] | |
messagesToggles[3][4] = toggleFrame(messagesToggles[3][4]) | |
if messagesToggles[3][4] == 0 then | |
messagesToggles[3][5] = 0 | |
else | |
messagesToggles[3][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 70 400 180 46 | |
text lua "t(messagesToggles[4][1])" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = messagesToggles[4][2] | |
" | |
} | |
text | |
{ | |
area 250 400 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "messagesToggles[4][4]" | |
action | |
" | |
helpString = messagesToggles[4][2] | |
messagesToggles[4][4] = toggleFrame(messagesToggles[4][4]) | |
if messagesToggles[4][4] == 0 then | |
messagesToggles[4][5] = 0 | |
else | |
messagesToggles[4][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 300 400 180 46 | |
text lua "t(messagesToggles[5][1])" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = messagesToggles[5][2] | |
" | |
} | |
text | |
{ | |
area 480 400 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "messagesToggles[5][4]" | |
action | |
" | |
helpString = messagesToggles[5][2] | |
messagesToggles[5][4] = toggleFrame(messagesToggles[5][4]) | |
if messagesToggles[5][4] == 0 then | |
messagesToggles[5][5] = 0 | |
else | |
messagesToggles[5][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 530 400 180 46 | |
text lua "t(messagesToggles[6][1])" | |
text style "label" | |
text align right center | |
action | |
" | |
helpString = messagesToggles[6][2] | |
" | |
} | |
text | |
{ | |
area 710 400 46 46 | |
bam ROUNDBUT | |
align center center | |
frame lua "messagesToggles[6][4]" | |
action | |
" | |
helpString = messagesToggles[6][2] | |
messagesToggles[6][4] = toggleFrame(messagesToggles[6][4]) | |
if messagesToggles[6][4] == 0 then | |
messagesToggles[6][5] = 0 | |
else | |
messagesToggles[6][5] = 1 | |
end | |
Infinity_PlaySound('GAM_09') | |
" | |
} | |
text | |
{ | |
area 110 478 646 136 | |
text lua "t(helpString)" | |
text style "normal" | |
text align center center | |
text color D | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
helpString = 'GAMEPLAY_DESCRIPTION' | |
if reverseButtonPosition then | |
panelID = 9 | |
Infinity_ChangeOption(8, markerFeedSLDR, panelID) | |
Infinity_ChangeOption(9, locatorFeedSLDR, panelID) | |
Infinity_ChangeOption(1, ttDelaySLDR, 8) | |
for index, var in pairs(messagesToggles) do | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
else | |
panelID = 8 | |
end | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
helpString = 'GAMEPLAY_DESCRIPTION' | |
if reverseButtonPosition then | |
panelID = 8 | |
else | |
panelID = 9 | |
Infinity_ChangeOption(8, markerFeedSLDR, panelID) | |
Infinity_ChangeOption(9, locatorFeedSLDR, panelID) | |
Infinity_ChangeOption(1, ttDelaySLDR, 8) | |
for index, var in pairs(messagesToggles) do | |
Infinity_ChangeOption(var[3], var[5], panelID) | |
end | |
end | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
keyString = '' | |
function displayHelp() | |
if key ~= 0 and keybindings[keyCategory][key] ~= nil then | |
return Infinity_FetchString(engine_mode == 0 and 24680 or 80750) | |
end | |
return keyString | |
end | |
function formatKeyCode(number) | |
if number < 127 and number > 32 then | |
return string.format('%c', keybindings[keyCategory][rowNumber][6]) | |
end | |
return t("SDL_" .. string.format('%d', keybindings[keyCategory][rowNumber][6])) | |
end | |
function getHotkeyName(category,number) | |
local key = keybindings[category][number][4] | |
if category < 5 then | |
local ret = t(key) | |
if ret ~= key then | |
return ret | |
end | |
end | |
return Infinity_FetchString(key) | |
end | |
function setKey(newValue) | |
if newValue ~= 0 and newValue ~= 27 and keybindings[keyCategory][key] ~= nil then | |
newValue = math.max(newValue, 0) | |
--Resolve conflicts. | |
local chKey = keybindings[keyCategory][key] | |
for catIndex, cat in pairs(keybindings) do | |
for keyIndex, curKey in pairs(cat) do | |
if (curKey[6] == newValue and curKey[6] ~= chKey[6]) then | |
local str = Infinity_FetchString(engine_mode == 0 and 24682 or 80751) | |
if str:byte() ~= 32 then str = ' ' .. str end | |
keyString = getStringFromAmbiguousSource(curKey[4]) .. str | |
keybindings[catIndex][keyIndex][6] = 0 | |
Infinity_SetKey(0, curKey[1]) | |
Infinity_SetINIValue(keycategories[curKey[2]][3], curKey[3], 0) | |
end | |
end | |
end | |
keybindings[keyCategory][key][6] = newValue | |
Infinity_SetKey(newValue, chKey[1]) | |
if (newValue ~= keybindings[keyCategory][key][7]) then | |
Infinity_SetINIValue(keycategories[chKey[2]][3], chKey[3], newValue) | |
else | |
Infinity_RemoveINIEntry(keycategories[chKey[2]][3], chKey[3]) | |
end | |
end | |
key = 0 | |
end | |
function revertKeymap() | |
if key ~= 0 then | |
local newValue = keybindings[keyCategory][key][7] | |
setKey(newValue) | |
return | |
end | |
for catIndex, cat in pairs(keybindings) do | |
for keyIndex, key in pairs(cat) do | |
local default = key[7] | |
Infinity_RemoveINIEntry(keycategories[key[2]][3],key[3]) | |
keybindings[catIndex][keyIndex][6] = default --Set the key in luas memory. | |
Infinity_SetKey(default,key[1]) --Set the key in C++ memory. | |
end | |
end | |
end | |
` | |
menu | |
{ | |
name 'OPTIONS_KEYBINDINGS' | |
align center center | |
onOpen | |
" | |
key = 0 | |
keyCategory = 1 | |
keyString = '' | |
" | |
label -- Background | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label -- Title | |
{ | |
area 82 12 700 40 | |
text "ASSIGN_KEYS_TITLE" | |
text style "title" | |
} | |
label -- Instruction | |
{ | |
area 252 64 367 30 | |
text "ASSIGN_KEYS_SUBTITLE" | |
text style "label" | |
} | |
label -- Contextual instruction | |
{ | |
area 42 116 778 50 | |
text lua "displayHelp()" | |
text style "label" | |
} | |
list -- Key categories | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 360 70 | |
mosaic KEYBCKG | |
} | |
label | |
{ | |
area 20 20 32 32 | |
bam ROUNDBUT | |
frame lua "rowNumber == keyCategory and 2 or 0" | |
} | |
label | |
{ | |
area 60 0 300 70 | |
text lua "t(keycategories[rowNumber][2])" | |
text style "label" | |
text align left center | |
} | |
} | |
area 42 190 360 420 | |
rowheight 70 | |
hidehighlight | |
table "keycategories" | |
var "keyCategory" | |
action | |
" | |
keyString = '' | |
Infinity_StopKeybind() | |
key = 0 | |
" | |
} | |
list -- Key bindings | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 360 70 | |
mosaic KEYBCKG | |
} | |
label | |
{ | |
area 20 20 32 32 | |
bam ROUNDBUT | |
frame lua "rowNumber == key and 2 or 0" | |
} | |
label | |
{ | |
area 60 0 220 70 | |
text lua "getHotkeyName(keyCategory,rowNumber)" | |
text style "label" | |
text align left center | |
} | |
label | |
{ | |
area 280 0 72 70 | |
text lua "formatKeyCode(keybindings[keyCategory][rowNumber][6])" | |
text style "normal" | |
text upper | |
text align right center | |
} | |
} | |
area 444 190 378 420 | |
rowheight 70 | |
hidehighlight | |
table "keybindings[keyCategory]" | |
var key | |
scrollbar 'GUISCRC' | |
scrollbar clunkyScroll 70 | |
action | |
" | |
keyString = '' | |
if keybindings[keyCategory][key] ~= nil then | |
Infinity_StartKeybind(key) | |
end | |
" | |
actionDbl | |
" | |
if keybindings[keyCategory][key] ~= nil then | |
Infinity_StopKeybind() | |
key = 0 | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'REVERT_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
helpString = 'GAMEPLAY_DESCRIPTION' | |
Infinity_StopKeybind() | |
Infinity_PopMenu() | |
else | |
keyString = '' | |
revertKeymap() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'REVERT_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
keyString = '' | |
revertKeymap() | |
else | |
helpString = 'GAMEPLAY_DESCRIPTION' | |
Infinity_StopKeybind() | |
Infinity_PopMenu() | |
end | |
" | |
} | |
} | |
` | |
function generateMegaCredits() | |
megacredits = '' | |
for k,v in pairs(credits) do | |
megacredits = megacredits .. Infinity_FetchString(v) .. '\n\n' | |
end | |
end | |
` | |
menu | |
{ | |
name 'CREDITS' | |
align center center | |
onOpen | |
" | |
generateMegaCredits() | |
" | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic GUICREDT | |
} | |
label | |
{ | |
area 128 6 760 42 | |
text "CREDITS_TITLE" | |
text style "title" | |
} | |
text | |
{ | |
area 84 90 856 594 | |
text lua "megacredits" | |
scrollbar 'GUISCRC' | |
text style "normal" | |
text align center top | |
} | |
button | |
{ | |
area 370 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
text "DONE_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
showsubtitles = 0 | |
function languageDetails() | |
if languages[language_idx] ~= nil then | |
return Infinity_FetchString(languages[language_idx][2]) .. '\n' .. Infinity_FetchString(languages[language_idx][3]) | |
end | |
return "" | |
end | |
function findCurrentLanguage() | |
local lang = Infinity_GetINIString('Language', 'Text', '') | |
for k,v in pairs(languages) do | |
if v[1] == lang then | |
language_idx = k | |
end | |
end | |
end | |
` | |
menu | |
{ | |
name 'OPTIONS_LANGUAGE' | |
modal | |
align center center | |
onOpen | |
" | |
showsubtitles = Infinity_GetINIValue('Program Options', 'Display Subtitles', 1) | |
findCurrentLanguage() | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "LANGUAGE_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= language_idx and rowNumber ~= language_hover" | |
area 0 0 -1 -1 | |
text lua "languages[rowNumber][4]" | |
text style "normal" | |
text align center center | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == language_idx and rowNumber ~= language_hover" | |
area 0 0 -1 -1 | |
text lua "languages[rowNumber][4]" | |
text style "normal" | |
text align center center | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == language_hover" | |
area 0 0 -1 -1 | |
text lua "languages[rowNumber][4]" | |
text style "normal" | |
text align center center | |
text color H | |
} | |
} | |
area 46 192 336 368 | |
rowheight 26 | |
hidehighlight | |
table "languages" | |
var language | |
scrollbar 'GUISCRC' | |
action | |
" | |
if language ~= -1 then | |
language_idx = language | |
end | |
" | |
actionEnter "language_hover = mouseoverRow" | |
actionExit "language_hover = 0" | |
} | |
label | |
{ | |
area 46 572 210 34 | |
text "SHOW_SUBTITLES_LABEL" | |
text style "label" | |
text align right center | |
} | |
button | |
{ | |
area 270 572 34 34 | |
bam ROUNDBUT | |
toggle showsubtitles | |
} | |
label | |
{ | |
area 426 116 394 136 | |
text lua "Infinity_FetchString(engine_mode == 0 and 32208 or 102626)" | |
text style "normal" | |
text align center center | |
text color '$' | |
} | |
text | |
{ | |
area 426 260 394 304 | |
text lua "languageDetails()" | |
text style normal | |
text align center top | |
scrollbar 'GUISCRC' | |
} | |
label | |
{ | |
area 426 566 394 48 | |
text lua "Infinity_FetchString(engine_mode == 0 and 32129 or 102624)" | |
text style "normal" | |
text align center center | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_SetLanguage(languages[language_idx][1], showsubtitles) | |
end | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if not reverseButtonPosition then | |
Infinity_SetLanguage(languages[language_idx][1], showsubtitles) | |
end | |
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 677 234 | |
mosaic GUIERR6 | |
} | |
label --Title | |
{ | |
area 34 10 606 128 | |
text 20186 | |
text style "label" | |
} | |
button | |
{ | |
area 94 170 234 44 | |
bam GUIOSTUL | |
text "QUIT_GAME_BUTTON" | |
text style "button" | |
on return | |
action | |
" | |
flushDeferredOptions() | |
restoreOverlayFromQuit() | |
Infinity_ShutdownGame() | |
" | |
} | |
button | |
{ | |
area 364 170 234 44 | |
bam GUIOSTUR | |
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 or 0) > 1 then | |
selectedSlot = slotName | |
popupRequester(slot.item.count, inventorySplitStack, false) | |
end | |
end | |
function inventorySplitStack(cnt) | |
Infinity_SplitItemStack(characters[id].equipment[selectedSlot].id, cnt, 'slot_inv_' .. characters[id].equipment[selectedSlot].id) | |
end | |
function isRequesterPlusMinusButtonClickable(minus) | |
local amt = tonumber(itemRequestAmt) or 0 | |
if minus then return amt > 1 end | |
return amt < requester.requesterMax | |
end | |
function requesterPlusMinusButtonClick(minus) | |
local amt = tonumber(itemRequestAmt) or 0 | |
local delta = 1 | |
if minus then delta = -1 end | |
itemRequestAmt = amt + delta | |
end | |
requester = {} | |
requester.requesterMax = 0 | |
requester.requesterFunc = nil | |
requester.selling = false | |
` | |
menu | |
{ | |
name 'POPUP_REQUESTER' | |
align center center | |
modal | |
onOpen | |
" | |
if requester.selling == false then | |
itemRequestAmt = 1 | |
else | |
itemRequestAmt = requester.requesterMax | |
end | |
" | |
onClose | |
" | |
requester.requesterFunc(0) | |
" | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label | |
{ | |
area 70 70 264 42 | |
text "CHOOSE_AMT_LABEL" | |
text align center center | |
text style "label" | |
} | |
edit | |
{ | |
area 100 114 112 42 | |
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 | |
" | |
} | |
button | |
{ | |
bam GUIOSW | |
area 258 114 45 42 | |
clickable lua "isRequesterPlusMinusButtonClickable(not reverseButtonPosition)" | |
sequence lua "reverseButtonPosition and 0 or 4" | |
action | |
" | |
requesterPlusMinusButtonClick(not reverseButtonPosition) | |
" | |
actionHold | |
" | |
requesterPlusMinusButtonClick(not reverseButtonPosition) | |
" | |
} | |
button | |
{ | |
bam GUIOSW | |
area 212 114 45 42 | |
clickable lua "isRequesterPlusMinusButtonClickable(reverseButtonPosition)" | |
sequence lua "reverseButtonPosition and 1 or 3" | |
action | |
" | |
requesterPlusMinusButtonClick(reverseButtonPosition) | |
" | |
actionHold | |
" | |
requesterPlusMinusButtonClick(reverseButtonPosition) | |
" | |
} | |
button | |
{ | |
on return | |
area 52 218 300 44 | |
bam GUIOSTCL | |
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 | |
{ | |
on escape | |
area 52 266 300 44 | |
bam GUIOSTCL | |
text "CANCEL_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
selectedAbility = -1 | |
function initAbilities() | |
--initialize selected ability | |
for i=1, 4 do | |
local ability = characters[id].equipment[selectedSlot].abilities[i] | |
if(ability ~= nil) then | |
if(ability.selected == 1) then | |
selectedAbility = i | |
return | |
end | |
end | |
end | |
end | |
` | |
menu | |
{ | |
name 'ITEM_ABILITIES' | |
align center center | |
onOpen "initAbilities()" | |
label | |
{ | |
area 0 12 864 710 | |
fill 0 0 0 180 | |
} | |
label | |
{ | |
area 174 0 515 734 | |
mosaic GUIERR8 | |
} | |
label | |
{ | |
area 240 116 384 44 | |
text "ITEM_ABILITIES_TITLE" | |
text style "title" | |
} | |
text | |
{ | |
area 254 202 370 52 | |
enabled "characters[id].equipment[selectedSlot].abilities[1] ~= nil" | |
text lua "characters[id].equipment[selectedSlot].abilities[1].text" | |
text style "label" | |
action "selectedAbility = 1" | |
} | |
button | |
{ | |
area 254 202 52 52 | |
bam STONSLOT | |
frame lua "selectedAbility == 1 and 2 or 0" | |
enabled "characters[id].equipment[selectedSlot].abilities[1] ~= nil" | |
icon lua "characters[id].equipment[selectedSlot].abilities[1].icon" | |
action "selectedAbility = 1" | |
} | |
text | |
{ | |
area 254 266 370 52 | |
enabled "characters[id].equipment[selectedSlot].abilities[2] ~= nil" | |
text lua "characters[id].equipment[selectedSlot].abilities[2].text" | |
text style "label" | |
action "selectedAbility = 2" | |
} | |
button | |
{ | |
area 254 266 52 52 | |
bam STONSLOT | |
frame lua "selectedAbility == 2 and 2 or 0" | |
enabled "characters[id].equipment[selectedSlot].abilities[2] ~= nil" | |
icon lua "characters[id].equipment[selectedSlot].abilities[2].icon" | |
action "selectedAbility = 2" | |
} | |
text | |
{ | |
area 254 330 370 52 | |
enabled "characters[id].equipment[selectedSlot].abilities[3] ~= nil" | |
text lua "characters[id].equipment[selectedSlot].abilities[3].text" | |
text style "label" | |
action "selectedAbility = 3" | |
} | |
button | |
{ | |
area 254 330 52 52 | |
bam STONSLOT | |
frame lua "selectedAbility == 3 and 2 or 0" | |
enabled "characters[id].equipment[selectedSlot].abilities[3] ~= nil" | |
icon lua "characters[id].equipment[selectedSlot].abilities[3].icon" | |
action "selectedAbility = 3" | |
} | |
label | |
{ | |
area 288 450 292 102 | |
text 11322 | |
text style "label" | |
} | |
button | |
{ | |
area 284 552 300 44 | |
bam GUIOSTCL | |
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() | |
" | |
} | |
button | |
{ | |
area 284 598 300 44 | |
bam GUIOSTCL | |
text "CANCEL_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
TEXT_popup_info = 0 | |
` | |
menu | |
{ | |
name 'POPUP_INFO' | |
align center center | |
modal | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "getStringFromAmbiguousSource(TEXT_popup_info)" | |
text style "normal" | |
text align center center | |
} | |
button | |
{ | |
on return | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "DONE_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'POPUP_TWOBUTTON' | |
align center center | |
modal | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "getStringFromAmbiguousSource(Popup2Button.info)" | |
text style "normal" | |
text align center center | |
} | |
button | |
{ | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text lua "t(Popup2Button.okText or 'DONE_BUTTON')" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu('POPUP_TWOBUTTON') | |
if (Popup2Button.okFunc) then | |
Popup2Button.okFunc() | |
end | |
" | |
} | |
button | |
{ | |
on escape | |
area 52 266 300 44 | |
bam GUIOSTCL | |
text lua "t(Popup2Button.cancelText or 'CANCEL_BUTTON')" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu('POPUP_TWOBUTTON') | |
if (Popup2Button.cancelFunc) then | |
Popup2Button.cancelFunc() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'POPUP_THREEBUTTON' | |
align center center | |
modal | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR2 | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "getStringFromAmbiguousSource(Popup3Button.info)" | |
text style "normal" | |
text align center center | |
} | |
button | |
{ | |
area 52 218 300 44 | |
bam GUIOSTCL | |
align center center | |
text lua "t(Popup3Button.rightText)" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if (Popup3Button.rightFunc) then | |
Popup3Button.rightFunc() | |
end | |
" | |
} | |
button | |
{ | |
area 52 266 300 44 | |
bam GUIOSTCL | |
align center center | |
text lua "t(Popup3Button.midText)" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if (Popup3Button.midFunc) then | |
Popup3Button.midFunc() | |
end | |
" | |
} | |
button | |
{ | |
area 103 320 201 44 | |
bam GUIOSTLM | |
align center center | |
text lua "t(Popup3Button.leftText)" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if (Popup3Button.leftFunc) then | |
Popup3Button.leftFunc() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'POPUP_FOURBUTTON' | |
align center center | |
modal | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR7 | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "getStringFromAmbiguousSource(Popup4Button.info)" | |
text style "normal" | |
text align center center | |
} | |
button | |
{ | |
area 52 170 300 44 | |
bam GUIOSTCL | |
align center center | |
text lua "t(Popup4Button.farRightText)" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if (Popup4Button.farRightFunc) then | |
Popup4Button.farRightFunc() | |
end | |
" | |
} | |
button | |
{ | |
area 52 218 300 44 | |
bam GUIOSTCL | |
align center center | |
text lua "t(Popup4Button.rightText)" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if (Popup4Button.rightFunc) then | |
Popup4Button.rightFunc() | |
end | |
" | |
} | |
button | |
{ | |
area 52 266 300 44 | |
bam GUIOSTCL | |
align center center | |
text lua "t(Popup4Button.leftText)" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if (Popup4Button.leftFunc) then | |
Popup4Button.leftFunc() | |
end | |
" | |
} | |
button | |
{ | |
area 103 320 201 44 | |
bam GUIOSTLM | |
align center center | |
text lua "t(Popup4Button.farLeftText)" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if (Popup4Button.farLeftFunc) then | |
Popup4Button.farLeftFunc() | |
end | |
" | |
} | |
} | |
` | |
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], 0) | |
end | |
itemDesc = {} | |
function showItemDescription(item, mode) | |
if (item.item ~= nil) then | |
itemDesc = item | |
else | |
itemDesc.item = item | |
end | |
itemDesc.mode = mode | |
Infinity_PushMenu('ITEM_DESCRIPTION',0,0) | |
end | |
function itemDescLeftButtonEnabled() | |
if(itemDesc.mode == 0) then | |
return itemDesc.item.identified == 0 or itemDesc.abilityMode == 1 | |
end | |
return 0 | |
end | |
function itemDescLeftButtonText() | |
if(itemDesc.mode == 0) then | |
if(itemDesc.item.identified == 0) then | |
return t("IDENTIFY_BUTTON") .. ': ' .. t("SPELL_BUTTON") | |
end | |
return t("ABILITIES_BUTTON") | |
end | |
return "" | |
end | |
function itemDescLeftButtonAction() | |
if(itemDesc.mode == 0) then | |
if(itemDesc.item.identified == 0) then | |
Infinity_OnSpellIdentify(itemDesc.id) | |
itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item | |
computeSplitPosition(dwFilterKitDesc(dwItemDescription(itemDesc.item)), 'itemDescriptionSplit') | |
else | |
Infinity_PushMenu('ITEM_ABILITIES',0,0) | |
end | |
end | |
end | |
function itemDescRightButtonEnabled() | |
res=itemDesc.item.res | |
if dwScrollSpellMap[res] then | |
allow=dwFindLearnedSpellAllow(false) | |
block=dwFindLearnedSpellBlock(false) | |
if not dwSpellAvailable(dwScrollSpellMap[res],allow,block) then | |
return false | |
end | |
end | |
if(itemDesc.mode == 0) then | |
return itemDesc.item.identified == 0 or itemDesc.useMode ~= -1 | |
end | |
return itemDesc.mode == 1 and itemDesc.item.isBag | |
end | |
function itemDescRightButtonText() | |
if(itemDesc.mode == 0) then | |
if(itemDesc.item.identified == 0) then | |
return t("IDENTIFY_BUTTON") .. ': ' .. t("SCROLL_BUTTON") | |
end | |
return Infinity_GetUseButtonText(itemDesc.id, itemDesc.useMode) | |
elseif(itemDesc.mode == 1) then | |
return t('OPEN_CONTAINER_BUTTON') | |
end | |
return "" | |
end | |
function itemDescRightButtonAction() | |
if(itemDesc.mode == 0) then | |
if(itemDesc.item.identified == 0) then | |
Infinity_OnScrollIdentify(itemDesc.id) | |
itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item | |
computeSplitPosition(dwFilterKitDesc(dwItemDescription(itemDesc.item)), 'itemDescriptionSplit') | |
else | |
Infinity_PopMenu() | |
Infinity_OnUseButtonClick(itemDesc.id, itemDesc.useMode) | |
end | |
elseif(itemDesc.mode == 1) then | |
storeScreen:OpenBag(itemDesc.item.res) | |
Infinity_PopMenu() | |
end | |
end | |
function computeSplitPosition(str, name) | |
startPos = -1 | |
local firstChar = str:len() > 0 and str:byte() or 0 | |
if firstChar >= 65 and firstChar <= 90 then startPos = 2 | |
elseif firstChar >= 97 and firstChar <= 122 then startPos = 2 | |
elseif firstChar == 195 then startPos = 3 end | |
splitPos = startPos | |
curPos = startPos | |
local newLine = false | |
while splitPos ~= -1 do | |
local b = str:byte(curPos) | |
if b == nil then | |
splitPos = curPos | |
elseif b >= 240 then | |
curPos = curPos + 3 | |
elseif b >= 224 then | |
curPos = curPos + 2 | |
elseif b >= 194 then | |
curPos = curPos + 1 | |
elseif b == 10 then | |
splitPos = curPos | |
newLine = true | |
elseif b == 32 and not newLine then | |
splitPos = curPos | |
end | |
Infinity_ScaleToText(name) | |
local x,y,w,h = Infinity_GetArea(name) | |
if h > 50 or curPos > str:len() then break end | |
curPos = curPos + 1 | |
end | |
end | |
` | |
menu | |
{ | |
name 'ITEM_DESCRIPTION' | |
align center center | |
modal | |
onOpen | |
" | |
dwLearnChance() | |
Infinity_PlaySound('GAM_03') | |
computeSplitPosition(dwFilterKitDesc(dwItemDescription(itemDesc.item)), 'itemDescriptionSplit') | |
" | |
onClose | |
" | |
dwLearnChanceCancel() | |
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 95 70 52 52 | |
bam STONSLOT | |
icon lua "itemDesc.item.icon" | |
} | |
label | |
{ | |
area 282 67 300 50 | |
text lua "itemDesc.item.name" | |
text align center center | |
text style "label" | |
} | |
label | |
{ | |
name "itemDescriptionSplit" | |
enabled "false" | |
area 44 0 370 -1 | |
text lua "dwFilterKitDesc(dwItemDescription(itemDesc.item)):sub(startPos, curPos)" | |
text style "parchment" | |
scrollbar 'GUISBR' | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber == 1" | |
area 0 0 40 38 | |
bam INITIALS | |
sequence lua "dwFilterKitDesc(dwItemDescription(itemDesc.item)):byte(startPos - 1) - 1" | |
} | |
label | |
{ | |
enabled "rowNumber == 1" | |
area 44 0 370 -1 | |
text lua "dwFilterKitDesc(dwItemDescription(itemDesc.item)):sub(startPos, splitPos - 1)" | |
text style "parchment" | |
} | |
label | |
{ | |
enabled "rowNumber == 2" | |
area 0 0 -1 -1 | |
pad 0 0 16 0 | |
text lua "dwFilterKitDesc(dwItemDescription(itemDesc.item)):sub(splitPos + 1)" | |
text style "parchment" | |
} | |
} | |
enabled "splitPos ~= -1" | |
rowheight dynamic | |
hidehighlight | |
table "makeTable(2)" | |
area 356 185 430 340 | |
scrollbar 'GUISBR' | |
} | |
text | |
{ | |
enabled "splitPos == -1" | |
area 356 185 430 340 | |
text lua "dwFilterKitDesc(dwItemDescription(itemDesc.item))" | |
scrollbar 'GUISBR' | |
text style "parchment" | |
} | |
text | |
{ | |
area 66 185 280 28 | |
enabled "itemDesc.item.identified == 0" | |
text style "parchment" | |
text align center center | |
text lua "Infinity_FetchString(17108)" | |
} | |
label | |
{ | |
area 66 185 280 340 | |
bam lua "itemDesc.item.descPicture" | |
sequence 0 | |
frame 0 | |
align center center | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 57 638 234 44 | |
enabled "itemDescLeftButtonEnabled()" | |
clickable lua "itemDesc.item.identified == 1 or Infinity_GetSpellIdentifyEnabled(itemDesc.id)" | |
text lua "itemDescLeftButtonText()" | |
text style "button" | |
action | |
" | |
itemDescLeftButtonAction() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUM | |
area 327 638 201 44 | |
text "DONE_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 572 638 234 44 | |
enabled "itemDescRightButtonEnabled()" | |
clickable lua "itemDesc.item.identified == 1 or Infinity_GetScrollIdentifyEnabled(itemDesc.id)" | |
text lua "itemDescRightButtonText()" | |
text style "button" | |
action | |
" | |
itemDescRightButtonAction() | |
" | |
} | |
} | |
` | |
function highlightSidebarButton(engine) | |
return (engine == e:GetActiveEngine()) | |
end | |
sidebarVisible = | |
{ | |
LEFT = 1, | |
RIGHT = 1 | |
} | |
showJournal = 0 | |
wasPaused = 0 | |
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 | |
function codeId(code) | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
return | |
end | |
if code == keybindings[1][1][6] then | |
return 3 | |
elseif code == keybindings[1][2][6] then | |
return 4 | |
elseif code == keybindings[1][3][6] then | |
return 0 | |
elseif code == keybindings[1][4][6] then | |
return 2 | |
elseif code == keybindings[1][5][6] then | |
return 1 | |
elseif code == keybindings[1][6][6] then | |
return 5 | |
elseif code == keybindings[1][7][6] then | |
return 6 | |
elseif code == keybindings[1][8][6] then | |
return 7 | |
elseif code == keybindings[1][9][6] and e:IsMultiplayer() then | |
return 8 | |
end | |
return nil | |
end | |
function keyPress(code) | |
local id = codeId(code) | |
if id ~= nil then | |
if showJournal == 1 and id == 0 then | |
e:GetActiveEngine():OnLeftPanelButtonClick(2) | |
end | |
if id == 2 then e:GetActiveEngine():OnLeftPanelButtonClick(0) end | |
e:GetActiveEngine():OnLeftPanelButtonClick(id) | |
end | |
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 | |
" | |
onClose | |
" | |
Infinity_PopMenu('LEFT_SIDEBAR_BOTTOM') | |
" | |
label | |
{ | |
name 'leftSidebarBackground' | |
area 0 0 80 1536 | |
mosaic GUIWLSP | |
} | |
label | |
{ | |
area 0 1536 80 1536 | |
mosaic GUIWLSP | |
} | |
label { enabled "codeId(97) ~= nil" on A action "keyPress(97)"} | |
label { enabled "codeId(98) ~= nil" on B action "keyPress(98)"} | |
label { enabled "codeId(99) ~= nil" on C action "keyPress(99)"} | |
label { enabled "codeId(100) ~= nil" on D action "keyPress(100)"} | |
label { enabled "codeId(101) ~= nil" on E action "keyPress(101)"} | |
label { enabled "codeId(102) ~= nil" on F action "keyPress(102)"} | |
label { enabled "codeId(103) ~= nil" on G action "keyPress(103)"} | |
label { enabled "codeId(104) ~= nil" on H action "keyPress(104)"} | |
label { enabled "codeId(105) ~= nil" on I action "keyPress(105)"} | |
label { enabled "codeId(106) ~= nil" on J action "keyPress(106)"} | |
label { enabled "codeId(107) ~= nil" on K action "keyPress(107)"} | |
label { enabled "codeId(108) ~= nil" on L action "keyPress(108)"} | |
label { enabled "codeId(109) ~= nil" on M action "keyPress(109)"} | |
label { enabled "codeId(110) ~= nil" on N action "keyPress(110)"} | |
label { enabled "codeId(111) ~= nil" on O action "keyPress(111)"} | |
label { enabled "codeId(112) ~= nil" on P action "keyPress(112)"} | |
label { enabled "codeId(113) ~= nil" on Q action "keyPress(113)"} | |
label { enabled "codeId(114) ~= nil" on R action "keyPress(114)"} | |
label { enabled "codeId(115) ~= nil" on S action "keyPress(115)"} | |
label { enabled "codeId(116) ~= nil" on T action "keyPress(116)"} | |
label { enabled "codeId(117) ~= nil" on U action "keyPress(117)"} | |
label { enabled "codeId(118) ~= nil" on V action "keyPress(118)"} | |
label { enabled "codeId(119) ~= nil" on W action "keyPress(119)"} | |
label { enabled "codeId(120) ~= nil" on X action "keyPress(120)"} | |
label { enabled "codeId(121) ~= nil" on Y action "keyPress(121)"} | |
label { enabled "codeId(122) ~= nil" on Z action "keyPress(122)"} | |
button | |
{ | |
area 2 14 72 55 | |
bam GUILS10 | |
sequence 0 | |
tooltip lua "getTooltipWithHotkey(2,16313)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 1 then | |
e:GetActiveEngine():OnLeftPanelButtonClick(2) | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(0) | |
" | |
} | |
button | |
{ | |
area 2 69 72 55 | |
bam GUILS10 | |
frame lua "highlightSidebarButton(mapScreen) and 2 or 0" | |
sequence 1 | |
tooltip lua "getTooltipWithHotkey(4,16310)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 1 then | |
e:GetActiveEngine():OnLeftPanelButtonClick(2) | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(1) | |
" | |
actionalt | |
" | |
fromAreaMap = false | |
worldMapScreen:StartWorldMap(0) | |
e:SelectEngine(worldMapScreen) | |
" | |
} | |
button | |
{ | |
area 2 124 72 55 | |
bam GUILS10 | |
frame lua "showJournal == 1 and 2 or 0" | |
sequence 2 | |
tooltip lua "getTooltipWithHotkey(3,16308)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(0) | |
e:GetActiveEngine():OnLeftPanelButtonClick(2) | |
" | |
} | |
button | |
{ | |
area 2 179 72 55 | |
bam GUILS10 | |
frame lua "highlightSidebarButton(inventoryScreen) and 2 or 0" | |
sequence 3 | |
tooltip lua "getTooltipWithHotkey(0,16307)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(3) | |
" | |
} | |
button | |
{ | |
area 2 234 72 55 | |
bam GUILS10 | |
frame lua "(highlightSidebarButton(characterScreen) or portraitTable ~= nil) and 2 or 0" | |
sequence 4 | |
tooltip lua "getTooltipWithHotkey(1,16306)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(4) | |
" | |
} | |
button | |
{ | |
area 2 289 72 55 | |
bam GUILS10 | |
frame lua "highlightSidebarButton(mageScreen) and 2 or 0" | |
sequence 5 | |
tooltip lua "getTooltipWithHotkey(5,16309)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(5) | |
" | |
} | |
button | |
{ | |
area 2 344 72 55 | |
bam GUILS10 | |
frame lua "highlightSidebarButton(priestScreen) and 2 or 0" | |
sequence 6 | |
tooltip lua "getTooltipWithHotkey(6,14930)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(6) | |
" | |
} | |
button | |
{ | |
area 2 399 72 55 | |
bam GUILS10 | |
frame lua "highlightSidebarButton(optionsScreen) and 2 or 0" | |
sequence 7 | |
tooltip lua "getTooltipWithHotkey(7,16311)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(7) | |
" | |
} | |
button | |
{ | |
area 2 454 72 55 | |
enabled "e:IsMultiplayer()" | |
bam GUILS10 | |
frame lua "highlightSidebarButton(multiplayerScreen) and 2 or 0" | |
sequence 8 | |
tooltip lua "getTooltipWithHotkey(8,16312)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
if showJournal == 0 and e:GetActiveEngine() == worldScreen then | |
wasPaused = worldScreen:CheckIfPaused() | |
end | |
e:GetActiveEngine():OnLeftPanelButtonClick(8) | |
" | |
} | |
button | |
{ | |
enabled "showSidebarToggle" | |
area 6 0 67 16 | |
bam GUIPNL10 | |
action | |
" | |
toggleSidebar('LEFT') | |
" | |
} | |
} | |
menu | |
{ | |
name 'LEFT_SIDEBAR_BOTTOM' | |
align left bottom | |
offset 0 -14 | |
ignoreEsc | |
button | |
{ | |
enabled "showQuickSaveButton and worldScreen == e:GetActiveEngine() and showJournal ~= 1" | |
area 2 0 72 55 | |
bam GUILS10 | |
sequence 14 | |
tooltip lua "getTooltipWithHotkey(28, engine_mode == 0 and 31813 or 74261)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
worldScreen:OnQuickSaveButtonClick(false) | |
" | |
actionAlt | |
" | |
worldScreen:OnQuickSaveButtonClick(true) | |
" | |
} | |
button | |
{ | |
area 2 55 72 55 | |
bam GUILS10 | |
sequence 9 | |
tooltip lua "getTooltipWithHotkey(31,11942)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
e:GetActiveEngine():OnRestButtonClick() | |
" | |
} | |
--begin clock | |
label | |
{ | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0" | |
area 2 110 72 55 | |
bam CGEAR | |
frame lua "timer:GetCurrentTime() % 24" | |
} | |
label | |
{ | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0" | |
area 2 110 72 55 | |
bam CDIAL | |
frame lua "timer:GetCurrentHour() % timer.TIMESCALE_HOUR_PER_DAY" | |
} | |
label | |
{ | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0" | |
area 2 110 72 55 | |
bam CPEN | |
frame lua "timer:GetCurrentTime() % 24" | |
} | |
label | |
{ | |
area 7 115 62 44 | |
enabled "worldScreen == e:GetActiveEngine() and worldScreen:CheckIfPaused() and showJournal == 0" | |
rectangle 1 | |
rectangle opacity 150 | |
} | |
button | |
{ | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0" | |
area 2 110 72 55 | |
tooltip lua "worldScreen:GetCurrentTimeString()" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
worldScreen:TogglePauseGame(true) | |
" | |
} | |
--end clock | |
} | |
menu | |
{ | |
name 'LEFT_SIDEBAR_HIDDEN' | |
align left top | |
ignoreEsc | |
button | |
{ | |
enabled "showSidebarToggle" | |
area 6 0 67 16 | |
bam GUIPNL10 | |
action | |
" | |
toggleSidebar('LEFT') | |
" | |
} | |
} | |
` | |
mouseOverPortrait = -1 | |
draggedPortrait = nil | |
function swapPortraits(dest) | |
worldScreen:SwapPortraits(dest,draggedPortrait) | |
draggedPortrait = nil | |
end | |
function getPartyAITooltip() | |
if aiButtonToggle == 1 then | |
return Infinity_FetchString(15918) | |
end | |
return Infinity_FetchString(15917) | |
end | |
function onPortraitRClick(id) | |
if showJournal == 1 then Infinity_OnPortraitRClick(id) end | |
Infinity_OnPortraitRClick(id) | |
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 10 14 64 90 | |
portrait 0 | |
bam GUIRSP10 | |
enabled "Infinity_GetNumCharacters() > 0" | |
glow lua "draggedPortrait and mouseOverPortrait == 0" | |
action "Infinity_OnPortraitLClick(0); currentID=id" | |
actionAlt "onPortraitRClick(0)" | |
actionDbl "Infinity_OnPortraitDblClick(0)" | |
actionDrag "Infinity_SwapWithPortrait(0)" | |
actionEnter "mouseOverPortrait = 0" | |
actionExit "mouseOverPortrait = -1" | |
actionSimpleDrag "draggedPortrait = 0" | |
actionSimpleDrop "swapPortraits(0)" | |
tooltip lua "Infinity_GetPortraitTooltip(0)" | |
clickable lua "sidebarsGreyed ~= 1" | |
} | |
button | |
{ | |
area 10 106 64 90 | |
portrait 1 | |
bam GUIRSP10 | |
enabled "Infinity_GetNumCharacters() > 1" | |
glow lua "draggedPortrait and mouseOverPortrait == 1" | |
action "Infinity_OnPortraitLClick(1); currentID=id" | |
actionAlt "onPortraitRClick(1)" | |
actionDbl "Infinity_OnPortraitDblClick(1)" | |
actionDrag "Infinity_SwapWithPortrait(1)" | |
actionEnter "mouseOverPortrait = 1" | |
actionExit "mouseOverPortrait = -1" | |
actionSimpleDrag "draggedPortrait = 1" | |
actionSimpleDrop "swapPortraits(1)" | |
tooltip lua "Infinity_GetPortraitTooltip(1)" | |
clickable lua "sidebarsGreyed ~= 1" | |
} | |
button | |
{ | |
area 10 198 64 90 | |
portrait 2 | |
bam GUIRSP10 | |
enabled "Infinity_GetNumCharacters() > 2" | |
glow lua "draggedPortrait and mouseOverPortrait == 2" | |
action "Infinity_OnPortraitLClick(2); currentID=id" | |
actionAlt "onPortraitRClick(2)" | |
actionDbl "Infinity_OnPortraitDblClick(2)" | |
actionDrag "Infinity_SwapWithPortrait(2)" | |
actionEnter "mouseOverPortrait = 2" | |
actionExit "mouseOverPortrait = -1" | |
actionSimpleDrag "draggedPortrait = 2" | |
actionSimpleDrop "swapPortraits(2)" | |
tooltip lua "Infinity_GetPortraitTooltip(2)" | |
clickable lua "sidebarsGreyed ~= 1" | |
} | |
button | |
{ | |
area 10 290 64 90 | |
portrait 3 | |
bam GUIRSP10 | |
enabled "Infinity_GetNumCharacters() > 3" | |
glow lua "draggedPortrait and mouseOverPortrait == 3" | |
action "Infinity_OnPortraitLClick(3); currentID=id" | |
actionAlt "onPortraitRClick(3)" | |
actionDbl "Infinity_OnPortraitDblClick(3)" | |
actionDrag "Infinity_SwapWithPortrait(3)" | |
actionEnter "mouseOverPortrait = 3" | |
actionExit "mouseOverPortrait = -1" | |
actionSimpleDrag "draggedPortrait = 3" | |
actionSimpleDrop "swapPortraits(3)" | |
tooltip lua "Infinity_GetPortraitTooltip(3)" | |
clickable lua "sidebarsGreyed ~= 1" | |
} | |
button | |
{ | |
area 10 382 64 90 | |
portrait 4 | |
bam GUIRSP10 | |
enabled "Infinity_GetNumCharacters() > 4" | |
glow lua "draggedPortrait and mouseOverPortrait == 4" | |
action "Infinity_OnPortraitLClick(4); currentID=id" | |
actionAlt "onPortraitRClick(4)" | |
actionDbl "Infinity_OnPortraitDblClick(4)" | |
actionDrag "Infinity_SwapWithPortrait(4)" | |
actionEnter "mouseOverPortrait = 4" | |
actionExit "mouseOverPortrait = -1" | |
actionSimpleDrag "draggedPortrait = 4" | |
actionSimpleDrop "swapPortraits(4)" | |
tooltip lua "Infinity_GetPortraitTooltip(4)" | |
clickable lua "sidebarsGreyed ~= 1" | |
} | |
button | |
{ | |
area 10 474 64 90 | |
portrait 5 | |
bam GUIRSP10 | |
enabled "Infinity_GetNumCharacters() > 5" | |
glow lua "draggedPortrait and mouseOverPortrait == 5" | |
action "Infinity_OnPortraitLClick(5); currentID=id" | |
actionAlt "onPortraitRClick(5)" | |
actionDbl "Infinity_OnPortraitDblClick(5)" | |
actionDrag "Infinity_SwapWithPortrait(5)" | |
actionEnter "mouseOverPortrait = 5" | |
actionExit "mouseOverPortrait = -1" | |
actionSimpleDrag "draggedPortrait = 5" | |
actionSimpleDrop "swapPortraits(5)" | |
tooltip lua "Infinity_GetPortraitTooltip(5)" | |
clickable lua "sidebarsGreyed ~= 1" | |
} | |
button | |
{ | |
enabled "showSidebarToggle" | |
area 10 0 67 16 | |
bam GUIPNL10 | |
action | |
" | |
toggleSidebar('RIGHT') | |
" | |
} | |
} | |
menu | |
{ | |
name 'RIGHT_SIDEBAR_BOTTOM' | |
align right bottom | |
offset -2 -14 | |
ignoreEsc | |
button | |
{ | |
area 0 0 72 55 | |
enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine() and showJournal == 0 and showHighlightButton and not rightSidebarSmallButton" | |
toggle selectionButtonToggle | |
bam GUILS10 | |
sequence 14 | |
tooltip lua "Infinity_FetchString(engine_mode == 0 and 31814 or 74262)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
worldScreen:OnSelectionButtonClick() | |
" | |
} | |
button | |
{ | |
area 0 55 72 55 | |
enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine() and showJournal == 0 and showHighlightButton == rightSidebarSmallButton" | |
toggle selectionButtonToggle | |
bam GUILS10 | |
sequence 14 | |
tooltip lua "Infinity_FetchString(engine_mode == 0 and 31814 or 74262)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
worldScreen:OnSelectionButtonClick() | |
" | |
} | |
button | |
{ | |
area 0 110 72 55 | |
enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine() and showJournal == 0 and not showHighlightButton and rightSidebarSmallButton" | |
toggle selectionButtonToggle | |
bam GUILS10 | |
sequence 14 | |
tooltip lua "Infinity_FetchString(engine_mode == 0 and 31814 or 74262)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
worldScreen:OnSelectionButtonClick() | |
" | |
} | |
button | |
{ | |
area 0 55 72 55 | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and showHighlightButton and not rightSidebarSmallButton" | |
toggle highlightButtonToggle | |
bam GUILS10 | |
sequence 11 | |
tooltip lua "Infinity_FetchString(engine_mode == 0 and 32729 or 103144)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
worldScreen:SetHighlightEnabled(highlightButtonToggle == 1) | |
" | |
} | |
button | |
{ | |
area 0 110 72 55 | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and showHighlightButton and rightSidebarSmallButton" | |
toggle highlightButtonToggle | |
bam GUILS10 | |
sequence 11 | |
tooltip lua "Infinity_FetchString(engine_mode == 0 and 32729 or 103144)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
worldScreen:SetHighlightEnabled(highlightButtonToggle == 1) | |
" | |
} | |
button | |
{ | |
area 0 110 72 55 | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and not rightSidebarSmallButton" | |
toggle aiButtonToggle | |
bam GUILS10 | |
sequence 10 | |
tooltip lua "getPartyAITooltip()" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
game:ToggleAI() | |
" | |
} | |
button | |
{ | |
area 0 165 72 55 | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and not rightSidebarSmallButton" | |
bam GUILS10 | |
sequence 13 | |
tooltip lua "Infinity_FetchString(10485)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
game:SelectAll() | |
" | |
actionDbl | |
" | |
game:CenterOnGroupLeader() | |
" | |
} | |
button | |
{ | |
area 4 170 30 44 | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and rightSidebarSmallButton" | |
toggle aiButtonToggle | |
bam GUILS10 | |
sequence 16 | |
tooltip lua "getPartyAITooltip()" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
game:ToggleAI() | |
" | |
} | |
button | |
{ | |
area 36 170 30 44 | |
enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and rightSidebarSmallButton" | |
bam GUILS10 | |
sequence 17 | |
tooltip lua "Infinity_FetchString(10485)" | |
clickable lua "sidebarsGreyed ~= 1" | |
action | |
" | |
game:SelectAll() | |
" | |
actionDbl | |
" | |
game:CenterOnGroupLeader() | |
" | |
} | |
} | |
menu | |
{ | |
name 'RIGHT_SIDEBAR_HIDDEN' | |
align right top | |
ignoreEsc | |
label | |
{ | |
area 0 0 80 1 | |
} | |
button | |
{ | |
enabled "showSidebarToggle" | |
area 10 0 67 16 | |
bam GUIPNL10 | |
action | |
" | |
toggleSidebar('RIGHT') | |
" | |
} | |
} | |
` | |
function selectPortrait(nb) | |
if clickToLevelUp then | |
Infinity_ActivateRecord(nb) | |
else | |
Infinity_OnPortraitLClick(nb) | |
end | |
end | |
` | |
menu | |
{ | |
name 'WORLD_LEVEL_UP_BUTTONS' | |
align right top | |
ignoreesc | |
button | |
{ | |
enabled "draggedPortrait == nil and Infinity_CanLevelUp(0)" | |
area 11 14 64 90 | |
sequence 0 | |
action "selectPortrait(0)" | |
actionAlt "Infinity_OnPortraitRClick(0)" | |
pulse 1 | |
} | |
button | |
{ | |
enabled "draggedPortrait == nil and Infinity_CanLevelUp(1)" | |
area 11 106 64 90 | |
sequence 0 | |
action "selectPortrait(1)" | |
actionAlt "Infinity_OnPortraitRClick(1)" | |
pulse 1 | |
} | |
button | |
{ | |
enabled "draggedPortrait == nil and Infinity_CanLevelUp(2)" | |
area 11 198 64 90 | |
sequence 0 | |
action "selectPortrait(2)" | |
actionAlt "Infinity_OnPortraitRClick(2)" | |
pulse 1 | |
} | |
button | |
{ | |
enabled "draggedPortrait == nil and Infinity_CanLevelUp(3)" | |
area 11 290 64 90 | |
sequence 0 | |
action "selectPortrait(3)" | |
actionAlt "Infinity_OnPortraitRClick(3)" | |
pulse 1 | |
} | |
button | |
{ | |
enabled "draggedPortrait == nil and Infinity_CanLevelUp(4)" | |
area 11 382 64 90 | |
sequence 0 | |
action "selectPortrait(4)" | |
actionAlt "Infinity_OnPortraitRClick(4)" | |
pulse 1 | |
} | |
button | |
{ | |
enabled "draggedPortrait == nil and Infinity_CanLevelUp(5)" | |
area 11 474 64 90 | |
sequence 0 | |
action "selectPortrait(5)" | |
actionAlt "Infinity_OnPortraitRClick(5)" | |
pulse 1 | |
} | |
} | |
` | |
TEXT_inventoryError = "" | |
inventoryStats = {} | |
inventoryShow = {1,1,1,1,1,1} | |
savedID = 0 | |
savedHeight = 0 | |
forceGroundScroll = false | |
function resetStatsDisplay() | |
tempStats = {} | |
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 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 checkDoubleClickScheduled(slotName) | |
if(doubleClickEventScheduled == slotName) then | |
slotDoubleClick(doubleClickEventScheduled, true) | |
doubleClickEventScheduled = nil | |
end | |
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 scrollGroundItems() | |
if scrollDirection > 0 then | |
Infinity_OnGroundPage(-1) | |
forceGroundScroll = true | |
elseif scrollDirection < 0 then | |
Infinity_OnGroundPage(1) | |
forceGroundScroll = true | |
end | |
end | |
function formatString(value, score, coeff) | |
local str = value .. " (-)" | |
if score < 0 then | |
str = value .. " (" .. score .. ")" | |
elseif score > 0 then | |
str = value .. " (+" .. score .. ")" | |
end | |
if coeff * score < 0 then return "^R" .. str .. "^-" end | |
if coeff * score > 0 then return "^G" .. str .. "^-" end | |
return str | |
end | |
function getTempStat(old, newName, name, coeff) | |
local new = tempStats[id][newName] | |
local score = (new - old) | |
if score ~= 0 then | |
local str = formatString(new, score, coeff) | |
table.insert(inventoryStats, {3,name,str}) | |
end | |
end | |
function getTempDamage() | |
local dmgMinTemp = tempStats[id]['dmgMin'] | |
local dmgMaxTemp = tempStats[id]['dmgMax'] | |
if characters[id].damage.min ~= dmgMinTemp or characters[id].damage.max ~= dmgMaxTemp then | |
local old = (characters[id].damage.min + characters[id].damage.max) / 2 | |
local new = (dmgMinTemp + dmgMaxTemp) / 2 | |
local score = (new - old) | |
local str = formatString(dmgMinTemp .. '-' .. dmgMaxTemp, score, 1) | |
table.insert(inventoryStats, {3,t("DAMAGE_LABEL"),str}) | |
end | |
end | |
function buildInventoryStats() | |
inventoryStats = {} | |
if(tempStats[id] ~= nil) then | |
getTempStat(characters[id].AC.current,'AC',t("ARMOR_CLASS_LABEL"),-1) | |
getTempStat(characters[id].HP.max,'maxHP',t("HIT_POINTS_LABEL"),1) | |
getTempStat(characters[id].THAC0.current,'THAC0',t("THAC0_LABEL"),-1) | |
getTempDamage() | |
if length(inventoryStats) ~= 0 then | |
table.insert(inventoryStats, 1, {1,tempStats[id].tempItem}) | |
return inventoryStats | |
end | |
end | |
table.insert(inventoryStats, {1,t("ARMOR_CLASS_LABEL"),1}) | |
if inventoryShow[1] == 1 then | |
table.insert(inventoryStats, {2,characters[id].AC.details}) | |
end | |
table.insert(inventoryStats, {1,t("HIT_POINTS_LABEL"),2}) | |
if inventoryShow[2] == 1 then | |
table.insert(inventoryStats, {2,characters[id].HP.details}) | |
end | |
if (characters[id].THAC0.detailsOffhand ~= nil and characters[id].THAC0.detailsOffhand ~= "") then | |
table.insert(inventoryStats, {1,t("MAIN_HAND_THAC0"),3}) | |
if inventoryShow[3] == 1 then | |
table.insert(inventoryStats, {2,characters[id].THAC0.details}) | |
end | |
table.insert(inventoryStats, {1,t("OFF_HAND_THAC0"),4}) | |
if inventoryShow[4] == 1 then | |
table.insert(inventoryStats, {2,characters[id].THAC0.detailsOffhand}) | |
end | |
else | |
table.insert(inventoryStats, {1,t("THAC0_LABEL"),3}) | |
if inventoryShow[3] == 1 then | |
table.insert(inventoryStats, {2,characters[id].THAC0.details}) | |
end | |
end | |
if (characters[id].damage.maxOffhand) then | |
table.insert(inventoryStats, {1,t("MAIN_HAND_DAMAGE"),5}) | |
if inventoryShow[5] == 1 then | |
table.insert(inventoryStats, {2,characters[id].damage.details}) | |
end | |
table.insert(inventoryStats, {1,t("OFF_HAND_DAMAGE"),6}) | |
if inventoryShow[6] == 1 then | |
table.insert(inventoryStats, {2,characters[id].damage.detailsOffhand}) | |
end | |
else | |
table.insert(inventoryStats, {1,t("DAMAGE_LABEL"),5}) | |
if inventoryShow[5] == 1 then | |
table.insert(inventoryStats, {2,characters[id].damage.details}) | |
end | |
end | |
return inventoryStats | |
end | |
function inventoryScroll(top, height, contentHeight) | |
savedHeight = contentHeight | |
if id ~= savedID then | |
savedID = id | |
return 0 | |
end | |
return nil | |
end | |
function makeTable(length) | |
local t = {} | |
for i=1,length do | |
table.insert(t, 1, '') | |
end | |
return t | |
end | |
function groundScroll(top, height, contentHeight) | |
local curPage = Infinity_GetCurrentGroundPage() | |
if forceGroundScroll then | |
forceGroundScroll = false | |
return -curPage * 106 | |
end | |
local page = math.floor((-top + 53) / 106) | |
if page ~= curPage then | |
Infinity_OnGroundPage(page - curPage) | |
end | |
return nil | |
end | |
` | |
menu | |
{ | |
name 'INVENTORY' | |
align center center | |
ignoreEsc | |
onOpen | |
" | |
currentID=id | |
Infinity_ActivateInventory() | |
pushSidebars() | |
doubleClickEventScheduled = nil | |
" | |
onClose | |
" | |
Infinity_PopMenu('CHARACTER_COLOR') | |
Infinity_PopMenu('ITEM_DESCRIPTION') | |
popSidebars() | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic INVENTOR | |
} | |
label | |
{ | |
area 82 6 700 42 | |
text "INVENTORY_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 202 50 230 32 | |
text lua "characters[id].name" | |
text style "label" | |
} | |
label | |
{ | |
area 432 50 230 32 | |
text lua "dwFilterKitDesc(characters[id].class)" | |
text style "label" | |
} | |
label | |
{ | |
area 76 98 157 30 | |
text "QUIVER_LABEL" | |
text style "label" | |
} | |
label | |
{ | |
area 29 201 209 30 | |
text "QUICK_WEAPONS_LABEL" | |
text style "label" | |
} | |
label | |
{ | |
area 29 306 179 30 | |
text "QUICK_ITEMS_LABEL" | |
text style "label" | |
} | |
button | |
{ | |
area 304 176 128 160 | |
paperdoll 1 | |
actionDrag "Infinity_SwapWithAppearance()" | |
} | |
button | |
{ | |
area 16 578 68 100 | |
encumbrance | |
} | |
label | |
{ | |
area 392 492 118 22 | |
text lua "characters[id].gold" | |
text style "label" | |
} | |
text | |
{ | |
area 26 452 326 40 | |
text lua "TEXT_inventoryError" | |
text style normal | |
scrollbar 'GUISCRC' | |
} | |
label | |
{ | |
area 586 546 150 26 | |
text "GROUND_LABEL" | |
text style "label" | |
align left center | |
} | |
label | |
{ | |
area 739 546 41 26 | |
text lua "Infinity_GetCurrentGroundPage()+1 .. '/' .. Infinity_GetMaxGroundPage()+1" | |
text style "label" | |
align right center | |
} | |
--stat details begin | |
label | |
{ | |
area 526 138 58 52 | |
text lua "characters[id].AC.current" | |
text style "label" | |
text point 10 | |
align center center | |
} | |
button | |
{ | |
area 526 92 58 98 | |
tooltip lua "t('ARMOR_CLASS_LABEL')" | |
} | |
label | |
{ | |
area 591 138 58 52 | |
text lua "characters[id].HP.current .. '\n' .. characters[id].HP.max" | |
text style "label" | |
text point 10 | |
align center center | |
} | |
button | |
{ | |
area 591 92 58 98 | |
tooltip lua "t('HIT_POINTS_LABEL')" | |
} | |
label | |
{ | |
area 656 138 58 52 | |
text lua "getInventoryTHAC0()" | |
text style "label" | |
text point 10 | |
align center center | |
} | |
button | |
{ | |
area 656 92 58 98 | |
tooltip lua "t('THAC0_LABEL')" | |
} | |
label | |
{ | |
area 721 138 58 52 | |
text lua "getInventoryDamage()" | |
text style "label" | |
text point 10 | |
align center center | |
} | |
button | |
{ | |
area 721 92 58 98 | |
tooltip lua "t('DAMAGE_LABEL')" | |
} | |
label | |
{ | |
area 786 138 58 52 | |
text lua "characters[id].proficiencies.numAttacks.current" | |
text style "label" | |
text point 10 | |
align center center | |
} | |
button | |
{ | |
area 786 92 58 98 | |
tooltip lua "t('NUM_ATTACKS_LABEL')" | |
} | |
--stat details end | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 260 30 | |
mosaic INVSEP1 | |
respectClipping | |
enabled "inventoryStats[rowNumber][1] == 1" | |
text lua "inventoryStats[rowNumber][2]" | |
text style 'normal' | |
text color 'D' | |
text point 10 | |
text align left bottom | |
text useFontZoom 0 | |
pad 10 0 0 2 | |
} | |
label | |
{ | |
area 225 3 30 27 | |
enabled "inventoryStats[rowNumber][1] == 1 and inventoryShow[inventoryStats[rowNumber][3]] == 0" | |
text lua "'v'" | |
text style 'normal' | |
text color 'D' | |
text point 12 | |
text align center center | |
text useFontZoom 0 | |
} | |
label | |
{ | |
area 8 0 250 -1 | |
enabled "inventoryStats[rowNumber][1] == 2 or inventoryStats[rowNumber][1] == 3" | |
text lua "inventoryStats[rowNumber][2]" | |
text style 'normal' | |
text align left center | |
} | |
} | |
area 542 196 284 322 | |
enabled "savedHeight >= 322" | |
rowheight dynamic | |
hidehighlight | |
table "buildInventoryStats()" | |
var inventoryVar | |
scrollbar 'GUISCRC' | |
scrollbar func "inventoryScroll" | |
action | |
" | |
if inventoryStats[inventoryVar] ~= nil and inventoryStats[inventoryVar][1] == 1 then | |
local idx = inventoryStats[inventoryVar][3] | |
if idx ~= nil then | |
local value = 1 | |
if inventoryShow[idx] == 1 then value = 0 end | |
inventoryShow[idx] = value | |
end | |
end | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 280 30 | |
mosaic INVSEP2 | |
respectClipping | |
enabled "inventoryStats[rowNumber][1] == 1" | |
text lua "inventoryStats[rowNumber][2]" | |
text style 'normal' | |
text color 'D' | |
text point 10 | |
text align left bottom | |
text useFontZoom 0 | |
pad 10 0 0 2 | |
} | |
label | |
{ | |
area 245 3 30 27 | |
enabled "inventoryStats[rowNumber][1] == 1 and inventoryShow[inventoryStats[rowNumber][3]] == 0" | |
text lua "'v'" | |
text style 'normal' | |
text color 'D' | |
text point 12 | |
text align center center | |
text useFontZoom 0 | |
} | |
label | |
{ | |
area 8 0 250 -1 | |
enabled "inventoryStats[rowNumber][1] == 2 or inventoryStats[rowNumber][1] == 3" | |
text lua "inventoryStats[rowNumber][2]" | |
text style 'normal' | |
text align left center | |
} | |
label | |
{ | |
area 8 0 250 -1 | |
enabled "inventoryStats[rowNumber][1] == 3" | |
text lua "inventoryStats[rowNumber][3]" | |
text style 'normal' | |
text align right center | |
} | |
} | |
area 542 196 284 322 | |
enabled "savedHeight < 322" | |
rowheight dynamic | |
hidehighlight | |
table "buildInventoryStats()" | |
var inventoryVar | |
scrollbar func "inventoryScroll" | |
action | |
" | |
if inventoryStats[inventoryVar] ~= nil and inventoryStats[inventoryVar][1] == 1 then | |
local idx = inventoryStats[inventoryVar][3] | |
if idx ~= nil then | |
local value = 1 | |
if inventoryShow[idx] == 1 then value = 0 end | |
inventoryShow[idx] = value | |
end | |
end | |
" | |
} | |
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 27 347 52 52 bam STONSLOT slotinfo "characters[id].equipment.personal0"} | |
slot {name "slot_inv_6" area 80 347 52 52 bam STONSLOT slotinfo "characters[id].equipment.personal1"} | |
slot {name "slot_inv_7" area 133 347 52 52 bam STONSLOT slotinfo "characters[id].equipment.personal2"} | |
slot {name "slot_inv_11" area 243 98 52 52 bam STONSLOT slotinfo "characters[id].equipment.armor"} | |
slot {name "slot_inv_12" area 297 98 52 52 bam STONSLOT slotinfo "characters[id].equipment.gauntlets"} | |
slot {name "slot_inv_13" area 351 98 52 52 bam STONSLOT slotinfo "characters[id].equipment.helmet"} | |
slot {name "slot_inv_14" area 405 98 52 52 bam STONSLOT slotinfo "characters[id].equipment.amulet"} | |
slot {name "slot_inv_15" area 76 138 52 52 bam STONSLOT slotinfo "characters[id].equipment.quiver0"} | |
slot {name "slot_inv_16" area 129 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 90 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group0"} | |
slot {name "slot_inv_31" area 90 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group1"} | |
slot {name "slot_inv_32" area 143 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group2"} | |
slot {name "slot_inv_33" area 143 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group3"} | |
slot {name "slot_inv_34" area 196 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group4"} | |
slot {name "slot_inv_35" area 196 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group5"} | |
slot {name "slot_inv_36" area 249 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group6"} | |
slot {name "slot_inv_37" area 249 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group7"} | |
slot {name "slot_inv_38" area 302 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group8"} | |
slot {name "slot_inv_39" area 302 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group9"} | |
slot {name "slot_inv_40" area 355 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group10"} | |
slot {name "slot_inv_41" area 355 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group11"} | |
slot {name "slot_inv_42" area 408 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group12"} | |
slot {name "slot_inv_43" area 408 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group13"} | |
slot {name "slot_inv_44" area 461 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.group14"} | |
slot {name "slot_inv_45" area 461 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.group15"} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 212 106 | |
} | |
} | |
area 580 578 232 106 | |
hidehighlight | |
rowheight 106 | |
table "makeTable(Infinity_GetMaxGroundPage() + 1)" | |
scrollbar 'GUISCRC' | |
scrollbar func "groundScroll" | |
} | |
slot {name "slot_inv_68" area 580 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground0" actionScroll "scrollGroundItems()"} | |
slot {name "slot_inv_69" area 633 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground1" actionScroll "scrollGroundItems()"} | |
slot {name "slot_inv_70" area 686 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground2" actionScroll "scrollGroundItems()"} | |
slot {name "slot_inv_71" area 739 578 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground3" actionScroll "scrollGroundItems()"} | |
slot {name "slot_inv_72" area 580 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground4" actionScroll "scrollGroundItems()"} | |
slot {name "slot_inv_73" area 633 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground5" actionScroll "scrollGroundItems()"} | |
slot {name "slot_inv_74" area 686 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground6" actionScroll "scrollGroundItems()"} | |
slot {name "slot_inv_75" area 739 632 52 52 bam STONSLOT slotinfo "characters[id].equipment.ground7" actionScroll "scrollGroundItems()"} | |
button | |
{ | |
area 464 96 52 52 | |
bam INVBUT | |
colordisplay 2 | |
action | |
" | |
Infinity_PushMenu('CHARACTER_COLOR', 0, 0) | |
" | |
} | |
button | |
{ | |
area 464 153 52 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()" | |
fill 0 0 0 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() | |
dwUpdateColors() | |
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 0 0 864 710 | |
mosaic GUICHISE | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "COLOR_CHOICES_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 308 192 114 160 | |
paperdoll 0 | |
} | |
label | |
{ | |
area 442 192 114 160 | |
paperdoll 1 | |
} | |
label | |
{ | |
area 780 390 42 42 | |
colordisplay 6 | |
} | |
label | |
{ | |
area 780 436 42 42 | |
colordisplay 3 | |
} | |
label | |
{ | |
area 780 510 42 42 | |
colordisplay 2 | |
} | |
label | |
{ | |
area 780 556 42 42 | |
colordisplay 1 | |
} | |
label | |
{ | |
area 36 352 790 30 | |
text "APPEARANCE_LABEL" | |
text style "label" | |
text point 14 | |
} | |
label | |
{ | |
area 36 374 790 26 | |
text "HAIR_LABEL" | |
text style "label" | |
} | |
slider | |
{ | |
palette 6 | |
area 46 390 734 42 | |
bam SLDRSTAR | |
position "SLIDER_color_hair" | |
sequence 0 | |
frame 1 | |
settings lua "game:GetPaletteSize(6)" | |
action | |
" | |
Infinity_SetHairColor(SLIDER_color_hair) | |
" | |
} | |
label | |
{ | |
area 36 420 790 26 | |
text "SKIN_LABEL" | |
text style "label" | |
} | |
slider | |
{ | |
palette 3 | |
area 46 436 734 42 | |
bam SLDRSTAR | |
position "SLIDER_color_skin" | |
sequence 0 | |
frame 1 | |
settings lua "game:GetPaletteSize(3)" | |
action | |
" | |
Infinity_SetSkinColor(SLIDER_color_skin) | |
" | |
} | |
label | |
{ | |
area 36 472 790 30 | |
text "CLOTHING_LABEL" | |
text style "label" | |
text point 14 | |
} | |
label | |
{ | |
area 36 494 790 26 | |
text "MAJOR_LABEL" | |
text style "label" | |
} | |
slider | |
{ | |
palette 2 | |
area 46 510 734 42 | |
bam SLDRSTAR | |
position "SLIDER_color_major" | |
sequence 0 | |
frame 1 | |
settings lua "game:GetPaletteSize(2)" | |
action | |
" | |
Infinity_SetMajorColor(SLIDER_color_major) | |
" | |
} | |
label | |
{ | |
area 36 540 790 26 | |
text "MINOR_LABEL" | |
align center center | |
text style "label" | |
} | |
slider | |
{ | |
palette 1 | |
area 46 556 734 42 | |
bam SLDRSTAR | |
position "SLIDER_color_minor" | |
sequence 0 | |
frame 1 | |
settings lua "game:GetPaletteSize(1)" | |
action | |
" | |
Infinity_SetMinorColor(SLIDER_color_minor) | |
" | |
} | |
button | |
{ | |
on return | |
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') | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu('CHARACTER_COLOR') | |
" | |
} | |
button | |
{ | |
area 210 653 234 44 | |
bam GUIOSTUL | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
--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 | |
end | |
Infinity_PopMenu('CHARACTER_COLOR') | |
" | |
} | |
button | |
{ | |
area 464 653 234 44 | |
bam GUIOSTUR | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if not reverseButtonPosition then | |
--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 | |
end | |
Infinity_PopMenu('CHARACTER_COLOR') | |
" | |
} | |
} | |
menu | |
{ | |
name 'textflash' | |
opacity lua 'hoverPopup and 1 or getOpacityForInfoBlock(1000)' | |
enabled 'hoverPopup and 1 or getOpacityForInfoBlock(1000) ~= 0' | |
align center top | |
offset 0 10 | |
label | |
{ | |
area 0 0 500 140 | |
rectangle 4 | |
rectangle opacity 200 | |
} | |
label | |
{ | |
area 92 12 348 26 | |
text lua "getTitleString()" | |
text style "label" | |
text align left center | |
text point 14 | |
text color C | |
} | |
text | |
{ | |
area 92 36 350 26 | |
text lua "getSubtitleString()" | |
text style "label" | |
text align left top | |
text point 14 | |
text color D | |
scrollbar 'GUISCRC' | |
scrollbar hide lua "1" | |
} | |
text | |
{ | |
area 20 64 468 62 | |
text lua "getBodyString()" | |
text style "normal" | |
text align left top | |
scrollbar 'GUISCRC' | |
scrollbar hide lua "1" | |
action | |
" | |
if(sidebarsGreyed ~= 1) then | |
wasPaused = worldScreen:CheckIfPaused() | |
e:GetActiveEngine():OnLeftPanelButtonClick(2) | |
end | |
" | |
actionEnter "hoverPopup = true" | |
actionExit "hoverPopup = false" | |
} | |
label | |
{ | |
area 14 12 72 55 | |
bam GUILS10 | |
sequence 2 | |
frame 0 | |
} | |
button | |
{ | |
bam GUIOSW | |
on escape | |
area 440 16 45 42 | |
sequence 2 | |
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 | |
if luaEditHistory[i] ~= "" then | |
Infinity_SetINIValue("Lua Edit","String"..i-1, luaEditHistory[i]) | |
end | |
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 | |
-- Types: 0=Areas, 1=Items, 2=Spells, 3=Stores, 4=Creatures, 5=Commands | |
a7cheatListType = 0 | |
a7cheatItemCharge1 = 1 | |
a7cheatItemCharge2 = 0 | |
a7cheatItemCharge3 = 0 | |
a7commandMode = 0 | |
-- Filter strings | |
a7cheatAreaFilter = "" | |
a7cheatItemFilter = "" | |
a7cheatSpellFilter = "" | |
a7cheatStoreFilter = "" | |
a7cheatCreatureFilter = "" | |
-- Filtered results | |
a7cheatAreaList = {} | |
a7cheatItemList = {} | |
a7cheatSpellList = {} | |
a7cheatStoreList = {} | |
a7cheatCreatureList = {} | |
cheatGoldAmt = 1000000 | |
cheatXpAmt = 500000 | |
` | |
menu | |
{ | |
name 'cheatMenu' | |
ignoreEsc | |
align center top | |
offset -50 10 | |
onOpen | |
" | |
if game:GetMissionPackInfo() then | |
cheatAreaDisplayList = cheatAreasTutorial | |
elseif game:GetMissionPackInfoTBP() then | |
cheatAreaDisplayList = cheatAreasArena | |
elseif game:GetMissionPackInfo25() then | |
cheatAreaDisplayList = cheatAreasExpansion | |
else | |
cheatAreaDisplayList = cheatAreas | |
end | |
a7luaFilter(cheatAreaDisplayList, a7cheatAreaList, {1, 2}, a7cheatAreaFilter, false) | |
a7luaFilter(a7itemList, a7cheatItemList, {1, 2}, a7cheatItemFilter) | |
a7luaFilter(a7spellList, a7cheatSpellList, {1, 3}, a7cheatSpellFilter) | |
a7luaFilter(a7storeList, a7cheatStoreList, {1, 2}, a7cheatStoreFilter) | |
a7luaFilter(a7creatureList, a7cheatCreatureList, {1, 3}, a7cheatCreatureFilter) | |
" | |
label | |
{ | |
area 100 0 809 298 | |
bam 'GUWBTP30' | |
} | |
-- TOGGLE BUTTONS START | |
button | |
{ | |
enabled "a7cheatListType == 0" | |
area 615 120 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_TOGGLE_AREAS_BUTTON" | |
tooltip lua "t('A7_TOGGLE_AREAS_TOOLTIP')" | |
text style "button" | |
action "a7cheatListType = 1" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 1" | |
area 615 120 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_TOGGLE_ITEMS_BUTTON" | |
tooltip lua "t('A7_TOGGLE_ITEMS_TOOLTIP')" | |
text style "button" | |
action "a7cheatListType = 2" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 2" | |
area 615 120 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_TOGGLE_SPELLS_BUTTON" | |
tooltip lua "t('A7_TOGGLE_SPELLS_TOOLTIP')" | |
text style "button" | |
action "a7cheatListType = 3" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 3" | |
area 615 120 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_TOGGLE_STORES_BUTTON" | |
tooltip lua "t('A7_TOGGLE_STORES_TOOLTIP')" | |
text style "button" | |
action "a7cheatListType = 4" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 4" | |
area 615 120 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_TOGGLE_CREATURES_BUTTON" | |
tooltip lua "t('A7_TOGGLE_CREATURES_TOOLTIP')" | |
text style "button" | |
action "a7cheatListType = 5" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 5" | |
area 615 120 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_TOGGLE_COMMANDS_BUTTON" | |
tooltip lua "t('A7_TOGGLE_COMMANDS_TOOLTIP')" | |
text style "button" | |
action "a7cheatListType = 0" | |
} | |
-- TOGGLE BUTTONS END | |
-- ITEM LIST START | |
label | |
{ | |
enabled "a7cheatListType == 1" | |
area 122 8 65 30 | |
text "A7_FILTER_LABEL" | |
text style "label" | |
text align left center | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 1" | |
name "a7cheatItemFilterEdit" | |
area 193 14 280 24 | |
var a7cheatItemFilter | |
placeholder 'A7_FILTER_PLACEHOLDER' | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
actionAlt " | |
a7luaFilter(a7itemList, a7cheatItemList, {1, 2}, a7cheatItemFilter) | |
return 1 | |
" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 1" | |
area 480 8 120 36 | |
scaleToClip | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_CLEAR_BUTTON" | |
text style "button" | |
action " | |
a7cheatItemFilter = '' | |
a7luaFilter(a7itemList, a7cheatItemList, {1, 2}, a7cheatItemFilter) | |
Infinity_FocusTextEdit('a7cheatItemFilterEdit') | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatItemList[rowNumber][1]" | |
text style "list" | |
} | |
} | |
column | |
{ | |
width 75 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatItemList[rowNumber][2]" | |
text style "list" | |
} | |
} | |
enabled "a7cheatListType == 1" | |
area 122 46 492 200 | |
rowheight 18 | |
table "a7cheatItemList" | |
var a7cheatCreateItem | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
enabled "a7cheatListType == 1" | |
area 122 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_CREATE_BUTTON" | |
text style "button" | |
action "C:CreateItem(a7cheatItemList[a7cheatCreateItem][1],a7cheatItemCharge1,a7cheatItemCharge2,a7cheatItemCharge3)" | |
} | |
label | |
{ | |
enabled "a7cheatListType == 1" | |
area 275 246 165 42 | |
text "A7_AMOUNT_LABEL" | |
text style "label" | |
text align right center | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 1" | |
area 450 256 40 24 | |
var a7cheatItemCharge1 | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 1" | |
area 500 256 40 24 | |
var a7cheatItemCharge2 | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 1" | |
area 550 256 40 24 | |
var a7cheatItemCharge3 | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
} | |
-- ITEM LIST END | |
-- SPELL LIST START | |
label | |
{ | |
enabled "a7cheatListType == 2" | |
area 122 8 65 30 | |
text "A7_FILTER_LABEL" | |
text style "label" | |
text align left center | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 2" | |
name "a7cheatSpellFilterEdit" | |
area 193 14 280 24 | |
var a7cheatSpellFilter | |
placeholder 'A7_FILTER_PLACEHOLDER' | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
actionAlt " | |
a7luaFilter(a7spellList, a7cheatSpellList, {1, 3}, a7cheatSpellFilter) | |
return 1 | |
" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 2" | |
area 480 8 120 36 | |
scaleToClip | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_CLEAR_BUTTON" | |
text style "button" | |
action " | |
a7cheatSpellFilter = '' | |
a7luaFilter(a7spellList, a7cheatSpellList, {1, 3}, a7cheatSpellFilter) | |
Infinity_FocusTextEdit('a7cheatSpellFilterEdit') | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 23 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatSpellList[rowNumber][1]" | |
text style "list" | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7luaSpellType(a7cheatSpellList[rowNumber][2])" | |
text style "list" | |
} | |
} | |
column | |
{ | |
width 57 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatSpellList[rowNumber][3]" | |
text style "list" | |
} | |
} | |
enabled "a7cheatListType == 2" | |
area 122 46 492 200 | |
rowheight 18 | |
table "a7cheatSpellList" | |
var a7cheatAddSpell | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
enabled "a7cheatListType == 2" | |
area 122 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_COMMAND_BUTTON" | |
text style "button" | |
action "a7luaSpellCommand(a7cheatAddSpell)" | |
} | |
-- SPELL LIST END | |
-- STORE LIST START | |
label | |
{ | |
enabled "a7cheatListType == 3" | |
area 122 8 65 30 | |
text "A7_FILTER_LABEL" | |
text style "label" | |
text align left center | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 3" | |
name "a7cheatStoreFilterEdit" | |
area 193 14 280 24 | |
var a7cheatStoreFilter | |
placeholder 'A7_FILTER_PLACEHOLDER' | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
actionAlt " | |
a7luaFilter(a7storeList, a7cheatStoreList, {1, 2}, a7cheatStoreFilter) | |
return 1 | |
" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 3" | |
area 480 8 120 36 | |
scaleToClip | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_CLEAR_BUTTON" | |
text style "button" | |
action " | |
a7cheatStoreFilter = '' | |
a7luaFilter(a7storeList, a7cheatStoreList, {1, 2}, a7cheatStoreFilter) | |
Infinity_FocusTextEdit('a7cheatStoreFilterEdit') | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatStoreList[rowNumber][1]" | |
text style "list" | |
} | |
} | |
column | |
{ | |
width 75 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatStoreList[rowNumber][2]" | |
text style "list" | |
} | |
} | |
enabled "a7cheatListType == 3" | |
area 122 46 492 200 | |
rowheight 18 | |
table "a7cheatStoreList" | |
var a7cheatOpenStore | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
enabled "a7cheatListType == 3" | |
area 122 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_OPEN_BUTTON" | |
text style "button" | |
action "C:StartStore(a7cheatStoreList[a7cheatOpenStore][1])" | |
} | |
-- STORE LIST END | |
-- CREATURE LIST START | |
label | |
{ | |
enabled "a7cheatListType == 4" | |
area 122 8 65 30 | |
text "A7_FILTER_LABEL" | |
text style "label" | |
text align left center | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 4" | |
name "a7cheatCreatureFilterEdit" | |
area 193 14 280 24 | |
var a7cheatCreatureFilter | |
placeholder 'A7_FILTER_PLACEHOLDER' | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
actionAlt " | |
a7luaFilter(a7creatureList, a7cheatCreatureList, {1, 3}, a7cheatCreatureFilter) | |
return 1 | |
" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 4" | |
area 480 8 120 36 | |
scaleToClip | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_CLEAR_BUTTON" | |
text style "button" | |
action " | |
a7cheatCreatureFilter = '' | |
a7luaFilter(a7creatureList, a7cheatCreatureList, {1, 3}, a7cheatCreatureFilter) | |
Infinity_FocusTextEdit('a7cheatCreatureFilterEdit') | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 23 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatCreatureList[rowNumber][1]" | |
text style "list" | |
} | |
} | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7luaAllegiance(a7cheatCreatureList[rowNumber][2])" | |
text style "list" | |
} | |
} | |
column | |
{ | |
width 57 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatCreatureList[rowNumber][3]" | |
text style "list" | |
} | |
} | |
enabled "a7cheatListType == 4" | |
area 122 46 492 200 | |
rowheight 18 | |
table "a7cheatCreatureList" | |
var a7cheatSpawnCreature | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
enabled "a7cheatListType == 4" | |
area 122 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_CREATE_BUTTON" | |
text style "button" | |
action "C:CreateCreature(a7cheatCreatureList[a7cheatSpawnCreature][1])" | |
} | |
-- CREATURE LIST END | |
-- COMMAND LIST START | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7commandList[rowNumber][1]" | |
text style "list" | |
} | |
} | |
enabled "a7cheatListType == 5" | |
area 122 6 492 240 | |
rowheight 18 | |
table "a7commandList" | |
var a7cheatApplyCommand | |
scrollbar 'GUISCRC' | |
action "a7commandMode = a7commandList[a7cheatApplyCommand][3]" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 5 and (a7commandMode == 0 or a7commandMode == 2)" | |
area 122 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_COMMAND_BUTTON" | |
tooltip lua "t('A7_TOGGLE_CMD_LUA_TOOLTIP')" | |
text style "button" | |
action "a7luaCommand(a7cheatApplyCommand)" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 5 and not (a7commandMode == 0 or a7commandMode == 2)" | |
area 122 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_PERFORM_BUTTON" | |
tooltip lua "t('A7_TOGGLE_CMD_RUN_TOOLTIP')" | |
text style "button" | |
action "a7luaCommand(a7cheatApplyCommand)" | |
} | |
-- COMMAND LIST END | |
-- AREA LIST START | |
label | |
{ | |
enabled "a7cheatListType == 0" | |
area 122 8 65 30 | |
text "A7_FILTER_LABEL" | |
text style "label" | |
text align left center | |
} | |
edit | |
{ | |
enabled "a7cheatListType == 0" | |
name "a7cheatAreaFilterEdit" | |
area 193 14 280 24 | |
var a7cheatAreaFilter | |
placeholder 'A7_FILTER_PLACEHOLDER' | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
actionAlt " | |
a7luaFilter(cheatAreaDisplayList, a7cheatAreaList, {1, 2}, a7cheatAreaFilter) | |
return 1 | |
" | |
} | |
button | |
{ | |
enabled "a7cheatListType == 0" | |
area 480 8 120 36 | |
scaleToClip | |
bam GUIOSTSM | |
sequence 6 | |
text "A7_CLEAR_BUTTON" | |
text style "button" | |
action " | |
a7cheatAreaFilter = '' | |
a7luaFilter(cheatAreaDisplayList, a7cheatAreaList, {1, 2}, a7cheatAreaFilter) | |
Infinity_FocusTextEdit('a7cheatAreaFilterEdit') | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 20 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatAreaList[rowNumber][1]" | |
text style "list" | |
} | |
} | |
column | |
{ | |
width 80 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "a7cheatAreaList[rowNumber][2]" | |
text style "list" | |
} | |
} | |
enabled "a7cheatListType == 0" | |
area 122 46 492 200 | |
rowheight 18 | |
table "a7cheatAreaList" | |
var cheatTeleportArea | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
enabled "a7cheatListType == 0" | |
area 122 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "TRAVEL_BUTTON" | |
text style "button" | |
action "C:MoveToArea(a7cheatAreaList[cheatTeleportArea][1])" | |
} | |
-- AREA LIST END | |
button | |
{ | |
area 615 162 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "GODBOW_LABEL" | |
text style "button" | |
action "C:CreateItem('godbow')" | |
} | |
button | |
{ | |
area 615 204 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "GIVE_GOLD_LABEL" | |
text style "button" | |
action "C:AddGold(cheatGoldAmt)" | |
} | |
edit | |
{ | |
area 761 210 138 32 | |
var cheatGoldAmt | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
} | |
button | |
{ | |
area 615 246 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "GIVE_XP_LABEL" | |
text style "button" | |
action "C:SetCurrentXP(cheatXpAmt)" | |
} | |
edit | |
{ | |
area 761 252 138 32 | |
var cheatXpAmt | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
} | |
button | |
{ | |
area 761 162 140 42 | |
bam GUIOSTSM | |
sequence 6 | |
text "EXPLORE_LABEL" | |
text style "button" | |
action "C:ExploreArea()" | |
} | |
} | |
menu | |
{ | |
name "luaHistoryMenu" | |
offset 500 -32 | |
align right bottom | |
label | |
{ | |
area 0 0 808 300 | |
bam 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 | |
" | |
Infinity_PushMenu('WORLD_MESSAGES') | |
Infinity_PushMenu('cheatMenu', 0, 0) | |
luaEdit = '' | |
luaEditShowHistoryList = 0 | |
loadLuaHistory() | |
Infinity_FocusTextEdit('luaEditArea') | |
" | |
onClose | |
" | |
Infinity_PopMenu('cheatMenu', 0, 0) | |
Infinity_PopMenu('luaHistoryMenu', 0, 0) | |
" | |
label | |
{ | |
area 0 0 811 50 | |
bam 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 | |
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 406 415 | |
mosaic GUIERR | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "CheckCloudSaveStatus()" | |
text style "label" | |
} | |
button | |
{ | |
on escape | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "SKIP_BUTTON" | |
text style "button" | |
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 | |
modal | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "messages[messageBoxCurMessage]" | |
text style "label" | |
} | |
button | |
{ | |
area 52 218 300 44 | |
bam GUIOSTCL | |
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 GUICREDT | |
area 0 0 1024 768 | |
} | |
label | |
{ | |
area 128 6 760 42 | |
text "CREATE_PARTY_TITLE" | |
text style "title" | |
} | |
--portraits | |
label | |
{ | |
area 67 130 64 90 | |
bam GUIRSP10 | |
sequence 0 | |
} | |
button | |
{ | |
area 71 132 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 504 64 90 | |
bam GUIRSP10 | |
sequence 0 | |
} | |
button | |
{ | |
area 71 506 56 86 | |
bitmap lua "partyImport.character[3].portrait" | |
clickable lua "partyImport.character[3].name ~= ''" | |
action | |
" | |
createPartyScreen:OnPortraitButtonClick(2) | |
" | |
} | |
label | |
{ | |
area 557 130 64 90 | |
bam GUIRSP10 | |
sequence 0 | |
} | |
button | |
{ | |
area 561 132 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 504 64 90 | |
bam GUIRSP10 | |
sequence 0 | |
} | |
button | |
{ | |
area 561 506 56 86 | |
bitmap lua "partyImport.character[6].portrait" | |
clickable lua "partyImport.character[6].name ~= ''" | |
action | |
" | |
createPartyScreen:OnPortraitButtonClick(5) | |
" | |
} | |
button | |
{ | |
area 200 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
text "PLAY_IMPORT_BUTTON" -- Play | |
text style "button" | |
clickable lua "partyImport.playbuttonclickable" | |
action | |
" | |
createPartyScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
area 530 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
text "BACK_BUTTON" -- Back | |
text style "button" | |
action | |
" | |
createPartyScreen:OnBackButtonClick() | |
" | |
} | |
--delete/create buttons | |
button | |
{ | |
area 155 178 300 44 | |
bam GUIOSTCL | |
text lua "partyImport.character[1].createdelete" | |
text style "button" | |
action | |
" | |
createPartyScreen:OnCreateDeleteButtonClick(0) | |
" | |
} | |
button | |
{ | |
area 155 365 300 44 | |
bam GUIOSTCL | |
text lua "partyImport.character[2].createdelete" | |
text style "button" | |
action | |
" | |
createPartyScreen:OnCreateDeleteButtonClick(1) | |
" | |
} | |
button | |
{ | |
area 155 550 300 44 | |
bam GUIOSTCL | |
text lua "partyImport.character[3].createdelete" | |
text style "button" | |
action | |
" | |
createPartyScreen:OnCreateDeleteButtonClick(2) | |
" | |
} | |
button | |
{ | |
area 645 178 300 44 | |
bam GUIOSTCL | |
text lua "partyImport.character[4].createdelete" | |
text style "button" | |
action | |
" | |
createPartyScreen:OnCreateDeleteButtonClick(3) | |
" | |
} | |
button | |
{ | |
area 645 365 300 44 | |
bam GUIOSTCL | |
text lua "partyImport.character[5].createdelete" | |
text style "button" | |
action | |
" | |
createPartyScreen:OnCreateDeleteButtonClick(4) | |
" | |
} | |
button | |
{ | |
area 645 550 300 44 | |
bam GUIOSTCL | |
text lua "partyImport.character[6].createdelete" | |
text style "button" | |
action | |
" | |
createPartyScreen:OnCreateDeleteButtonClick(5) | |
" | |
} | |
-- character labels | |
label | |
{ | |
area 155 130 300 44 | |
text lua "partyImport.character[1].name" | |
text style "title" | |
} | |
label | |
{ | |
area 155 317 300 44 | |
text lua "partyImport.character[2].name" | |
text style "title" | |
} | |
label | |
{ | |
area 155 502 300 44 | |
text lua "partyImport.character[3].name" | |
text style "title" | |
} | |
label | |
{ | |
area 645 130 300 44 | |
text lua "partyImport.character[4].name" | |
text style "title" | |
} | |
label | |
{ | |
area 645 317 300 44 | |
text lua "partyImport.character[5].name" | |
text style "title" | |
} | |
label | |
{ | |
area 645 502 300 44 | |
text lua "partyImport.character[6].name" | |
text style "title" | |
} | |
} | |
` | |
eetState = 0 | |
highlight = 0 | |
logoFrame = engine_mode == 1 and 2 or 0 | |
function startThreeBookHighlight(book) | |
if book == highlight then | |
return 1 | |
else | |
return 0 | |
end | |
end | |
function onCampaignButton(buttonNum) | |
if(buttonNum == const.START_CAMPAIGN_BG1) then | |
dwLevellerCampaign('BG1') | |
startEngine:OnCampaignButtonClick('BG1',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_BG1) | |
elseif(buttonNum == const.START_CAMPAIGN_SOD) then | |
dwLevellerCampaign('SOD') | |
startEngine:OnCampaignButtonClick('SOD',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_SOD) | |
elseif(buttonNum == const.START_CAMPAIGN_SOA) then | |
dwLevellerCampaign('SOA') | |
startEngine:OnCampaignButtonClick('SOA',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_SOA) | |
elseif(buttonNum == const.START_CAMPAIGN_TOB) then | |
dwLevellerCampaign('TOB') | |
startEngine:OnCampaignButtonClick('TOB',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_TOB) | |
elseif(buttonNum == const.START_CAMPAIGN_BP1) then | |
dwLevellerCampaign('BP1') | |
startEngine:OnCampaignButtonClick('BP1',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_BP1) | |
elseif(buttonNum == const.START_CAMPAIGN_BP2) then | |
dwLevellerCampaign('BP2') | |
startEngine:OnCampaignButtonClick('BP2',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_BP2) | |
elseif(buttonNum == const.START_CAMPAIGN_TUT) then | |
dwLevellerCampaign('TUT') | |
startEngine:OnCampaignButtonClick('TUT',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_TUT) | |
else | |
buttonNum = const.START_CAMPAIGN_BG1 | |
dwLevellerCampaign('BG1') | |
startEngine:OnCampaignButtonClick('BG1',true) | |
Infinity_SetINIValue('Program Options','Active Campaign',const.START_CAMPAIGN_BG1) | |
end | |
currentCampaign = buttonNum | |
end | |
function getTutorialEnabled() | |
if eetState == 0 then | |
return logoFrame == 0 | |
end | |
return startCampaignData[currentCampaign].tutorialEnabled | |
end | |
function getCampaignImportEnabled() | |
if eetState == 0 then | |
return logoFrame ~= 0 | |
end | |
return startCampaignData[currentCampaign].importEnabled | |
end | |
` | |
menu | |
{ | |
name 'START_INSTALLATION_WARNING' | |
onOpen " | |
dwIsChargen=false;dwIsLevelling=false;dwIsDualClassing=false | |
" | |
align center center | |
modal | |
label | |
{ | |
area 0 0 672 672 | |
mosaic "RECENTEV" | |
} | |
label | |
{ | |
area 158 32 354 46 | |
text style "title" | |
text lua "eetStrings.EET_WARNING_TITLE" | |
} | |
label | |
{ | |
area 126 106 422 458 | |
text style "normal" | |
text lua "eetStrings.EET_WARNING_TEXT" | |
} | |
} | |
menu | |
{ | |
name 'BACKGROUND' | |
align center center | |
label | |
{ | |
area 0 0 2550 1800 | |
mosaic BCKGRND | |
} | |
} | |
menu | |
{ | |
name 'START' | |
align center center | |
ignoreesc | |
onOpen | |
" | |
flushDeferredOptions() | |
eetState = Infinity_GetINIValue('Program Options','EET Installation State') | |
if eetState == 0 and engine_name:find('Enhanced Edition Trilogy') ~= nil then | |
eetState = 2 | |
end | |
if eetState == 1 then --EET_end not installed | |
Infinity_PushMenu('START_INSTALLATION_WARNING') | |
elseif eetState == 2 then --EET installed | |
if (start_doOnce == nil) then | |
currentCampaign = Infinity_GetINIValue('Program Options','Active Campaign',1) | |
onCampaignButton(currentCampaign) | |
highlightedCampaign = currentCampaign | |
start_doOnce = 1 | |
return | |
end | |
end | |
e:CheckGUISong() | |
local state = startEngine:GetEngineState() | |
if lastStartMenu then | |
if lastStartMenu ~= 'START' then | |
Infinity_PushMenu(lastStartMenu) | |
end | |
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') | |
" | |
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 lua "(engine_mode == 0 and const.START_CAMPAIGN_SOD == nil) and 'START2EE' or 'START3EE'" | |
} | |
label | |
{ | |
area 200 72 620 100 | |
mosaic lua "engine_mode == 0 and 'BG1' or 'BG2'" | |
} | |
label | |
{ | |
area 442 6 134 44 | |
text lua "versionString" | |
text style "label" | |
text point 10 | |
align center center | |
} | |
button --bg (no sod) | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD == nil" | |
bam LOGOBG1 | |
frame lua "startThreeBookHighlight(1)" | |
area 186 272 232 232 | |
align center center | |
action | |
" | |
logoFrame = 0 | |
dwLevellerSoA() | |
startEngine:OnSoAButtonClick(true) | |
Infinity_PushMenu('START_MAIN') | |
" | |
actionEnter | |
" | |
highlight = 1 | |
" | |
actionExit | |
" | |
highlight = 0 | |
" | |
} | |
label --bg (no sod) | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD == nil" | |
area 190 494 240 50 | |
mosaic TITLEBG | |
} | |
button --bg | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD" | |
bam LOGOBG1 | |
frame lua "startThreeBookHighlight(1)" | |
area 88 272 232 232 | |
align center center | |
action | |
" | |
logoFrame = 0 | |
dwLevellerSoA() | |
startEngine:OnSoAButtonClick(true) | |
Infinity_PushMenu('START_MAIN') | |
" | |
actionEnter | |
" | |
highlight = 1 | |
" | |
actionExit | |
" | |
highlight = 0 | |
" | |
} | |
label --bg | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD" | |
area 92 494 240 50 | |
mosaic TITLEBG | |
} | |
text --soa | |
{ | |
enabled "engine_mode == 1" | |
bam LOGOSOA | |
frame lua "startThreeBookHighlight(1)" | |
area 98 260 207 260 | |
align center center | |
action | |
" | |
logoFrame = 2 | |
dwLevellerSoA() | |
startEngine:OnSoAButtonClick(true) | |
Infinity_PushMenu('START_MAIN') | |
" | |
actionEnter | |
" | |
highlight = 1 | |
" | |
actionExit | |
" | |
highlight = 0 | |
" | |
} | |
label --soa | |
{ | |
enabled "engine_mode == 1" | |
area 92 494 240 50 | |
mosaic TITLESOA | |
} | |
text --sod | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD" | |
bam LOGOSOD | |
frame lua "startThreeBookHighlight(2)" | |
area 398 262 232 232 | |
align center center | |
action | |
" | |
logoFrame = 1 | |
startEngine:OnCampaignButtonClick('SOD', true) | |
Infinity_PushMenu('START_MAIN') | |
" | |
actionEnter | |
" | |
highlight = 2 | |
" | |
actionExit | |
" | |
highlight = 0 | |
" | |
} | |
label --sod | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD" | |
area 388 480 250 48 | |
mosaic TITLESOD | |
} | |
text --tob | |
{ | |
enabled "engine_mode == 1" | |
bam LOGOTOB | |
frame lua "startThreeBookHighlight(2)" | |
area 381 256 261 252 | |
align center center | |
action | |
" | |
logoFrame = 3 | |
dwLevellerToB() | |
startEngine:OnToBButtonClick(true) | |
Infinity_PushMenu('START_MAIN') | |
" | |
actionEnter | |
" | |
highlight = 2 | |
" | |
actionExit | |
" | |
highlight = 0 | |
" | |
} | |
label --tob | |
{ | |
enabled "engine_mode == 1" | |
area 388 486 250 48 | |
mosaic TITLETOB | |
} | |
text --black pits (no sod) | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD == nil" | |
bam LOGOTBP | |
frame lua "startThreeBookHighlight(3)" | |
area 594 279 249 229 | |
align center center | |
action | |
" | |
logoFrame = 4 | |
dwLevellerTBP() | |
startEngine:OnTBPButtonClick(true) | |
Infinity_PushMenu('START_MAIN') | |
" | |
actionEnter | |
" | |
highlight = 3 | |
" | |
actionExit | |
" | |
highlight = 0 | |
" | |
} | |
label --black pits (no sod) | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD == nil" | |
area 594 494 240 60 | |
mosaic TITLEBP | |
} | |
text --black pits | |
{ | |
enabled "engine_mode == 1 or const.START_CAMPAIGN_SOD" | |
bam LOGOTBP | |
frame lua "startThreeBookHighlight(3)" | |
area 692 279 249 229 | |
align center center | |
action | |
" | |
logoFrame = engine_mode == 0 and 4 or 5 | |
dwLevellerTBP() | |
startEngine:OnTBPButtonClick(true) | |
Infinity_PushMenu('START_MAIN') | |
" | |
actionEnter | |
" | |
highlight = 3 | |
" | |
actionExit | |
" | |
highlight = 0 | |
" | |
} | |
label --black pits | |
{ | |
enabled "engine_mode == 0 and const.START_CAMPAIGN_SOD" | |
area 692 494 240 60 | |
mosaic TITLEBP | |
} | |
label --black pits 2 | |
{ | |
enabled "engine_mode == 1" | |
area 692 494 240 60 | |
mosaic TITLEBP2 | |
} | |
button --credits | |
{ | |
bam GUIOSTUL | |
area 170 712 234 44 | |
text style "button" | |
text "CREDITS_BUTTON" | |
action | |
" | |
Infinity_PushMenu('CREDITS') | |
" | |
} | |
button --quit | |
{ | |
bam GUIOSTUM | |
area 412 712 201 44 | |
text style "button" | |
text "QUIT_GAME_BUTTON" | |
action | |
" | |
startEngine:OnQuitButtonClick() | |
" | |
} | |
button --options | |
{ | |
bam GUIOSTUR | |
area 620 712 234 44 | |
text style "button" | |
text "OPTIONS_BUTTON" | |
action | |
" | |
Infinity_PushMenu('START_OPTIONS') | |
optionsScreen:SetEngineState(1) | |
startEngine:OnOptionsButtonClick() | |
lastStartMenu = 'START' | |
" | |
} | |
} | |
` | |
function getEETTitle(row) | |
local text = startCampaignData[row].name | |
return eetStrings[text] | |
end | |
function getEETDescription(row) | |
local text = startCampaignData[row].description | |
return eetStrings[text] | |
end | |
function getTitle() | |
if eetState == 0 then | |
return logoFrame | |
end | |
return startCampaignData[currentCampaign].title | |
end | |
function getBigLogo() | |
if eetState == 0 then | |
return logoFrame | |
end | |
return startCampaignData[currentCampaign].bigLogo | |
end | |
` | |
menu | |
{ | |
name 'START_CAMPAIGN_SELECT' | |
align center center | |
ignoreEsc | |
modal | |
label | |
{ | |
area 0 0 820 427 | |
mosaic 'STARTBG2' | |
} | |
list | |
{ | |
column | |
{ | |
width 15 | |
label | |
{ | |
area 0 0 -1 -1 | |
bam "CMPGEET" | |
sequence lua 'startCampaignData[rowNumber].icon' | |
align center center | |
} | |
} | |
column | |
{ | |
width 85 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "getEETTitle(rowNumber)" | |
text style "normal_parchment" | |
text align left center | |
} | |
} | |
area 83 25 316 384 | |
rowheight 40 | |
table "startCampaignData" | |
var selectedOpt | |
scrollbar 'GUISCRP' | |
action | |
" | |
onCampaignButton(selectedOpt) | |
selectedOpt = 0 | |
startEngine:DismissChooseCampaignPopup() | |
" | |
actionEnter | |
" | |
if mouseoverRow > 0 then | |
highlightedCampaign = mouseoverRow | |
end | |
glowTest = mouseoverRow | |
selectedOpt = mouseoverRow | |
" | |
actionExit | |
" | |
glowTest = nil | |
selectedOpt = 0 | |
" | |
} | |
text | |
{ | |
name "campaignBookDescription" | |
area 426 25 316 384 | |
text lua "getEETDescription(highlightedCampaign)" | |
text style "normal_parchment" | |
scrollbar 'GUISCRP' | |
} | |
} | |
menu | |
{ | |
name 'START_MAIN' | |
onOpen " | |
dwIsChargen=false;dwIsLevelling=false;dwIsDualClassing=false | |
" | |
align center center | |
ignoreEsc | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic START | |
} | |
label | |
{ | |
area 112 46 786 202 | |
bam TITLE | |
align center center | |
frame lua 'getTitle()' | |
} | |
label | |
{ | |
area 338 192 352 456 | |
bam BIGLOGO | |
align center center | |
frame lua 'getBigLogo()' | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 0 | |
area 113 296 262 74 | |
pad 10 8 10 8 | |
text style "button" | |
text "SINGLEPLAYER_BUTTON" | |
action | |
" | |
startEngine:SetEngineState(1) | |
Infinity_TransitionMenu('START_SP') | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 3 | |
area 645 298 266 74 | |
pad 10 8 10 8 | |
text style "button" | |
text "MULTIPLAYER_BUTTON" | |
action | |
" | |
startEngine:OnMultiPlayerButtonClick() | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 1 | |
area 112 375 236 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "CONTINUE_BUTTON" | |
clickable lua "startEngine:HasGameToContinue()" | |
action | |
" | |
startEngine:OnContinueGame() | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 4 | |
area 680 375 233 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "QUIT_GAME_BUTTON" | |
action | |
" | |
flushDeferredOptions() | |
startEngine:OnQuitButtonClick() | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 2 | |
area 114 461 262 76 | |
pad 10 8 10 8 | |
text style "button" | |
text "OPTIONS_BUTTON" | |
action | |
" | |
Infinity_PushMenu('START_OPTIONS') | |
optionsScreen:SetEngineState(1) | |
startEngine:OnOptionsButtonClick() | |
lastStartMenu = 'START_MAIN' | |
" | |
} | |
button | |
{ | |
enabled "eetState == 0" | |
area 649 463 260 76 | |
bam STARTMBT | |
sequence 5 | |
pad 10 8 10 8 | |
text style "button" | |
text "BACK_BUTTON" | |
action | |
" | |
e:GetObjectGame():SetCampaign('') | |
startEngine:SetEngineState(3) | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
enabled "eetState ~= 0" | |
area 649 463 260 76 | |
bam STARTMBT | |
sequence 5 | |
pad 10 8 10 8 | |
text style "button" | |
text "SELECT_CAMPAIGN_TITLE" | |
action | |
" | |
Infinity_PushMenu('START_CAMPAIGN_SELECT') | |
" | |
} | |
} | |
menu | |
{ | |
name 'START_SP' | |
onOpen " | |
dwIsChargen=false;dwIsLevelling=false;dwIsDualClassing=false | |
" | |
align center center | |
ignoreEsc | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic START | |
} | |
label | |
{ | |
area 112 46 786 202 | |
bam TITLE | |
align center center | |
frame lua 'getTitle()' | |
} | |
label | |
{ | |
area 338 192 352 456 | |
bam BIGLOGO | |
align center center | |
frame lua 'getBigLogo()' | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 0 | |
area 113 296 262 74 | |
pad 10 8 10 8 | |
text style "button" | |
text "NEW_GAME_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
startEngine:OnNewGameButtonClick() | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 3 | |
area 645 298 266 74 | |
pad 10 8 10 8 | |
text style "button" | |
text "LOAD_GAME_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
startEngine:OnLoadGameButtonClick() | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 1 | |
area 112 375 236 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "PREGENERATE_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
startEngine:OnPreGenerateButtonClick() | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
enabled "getTutorialEnabled()" | |
sequence 4 | |
area 680 375 233 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "TUTORIAL_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
startEngine:OnTutorialButtonClick() | |
lastStartMenu = 'START_SP' | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
enabled "getCampaignImportEnabled()" | |
sequence 4 | |
area 680 375 233 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "IMPORT_GAME_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
startEngine:OnImportCharacterButtonClick() | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 2 | |
area 114 461 262 76 | |
pad 10 8 10 8 | |
text style "button" | |
text "OPTIONS_BUTTON" | |
action | |
" | |
Infinity_PushMenu('START_OPTIONS') | |
optionsScreen:SetEngineState(1) | |
startEngine:OnOptionsButtonClick() | |
lastStartMenu = 'START_SP' | |
" | |
} | |
button | |
{ | |
area 649 463 260 76 | |
bam STARTMBT | |
sequence 5 | |
pad 10 8 10 8 | |
text style "button" | |
text "BACK_BUTTON" | |
action | |
" | |
startEngine:SetEngineState(0) | |
Infinity_TransitionMenu('START') | |
" | |
} | |
} | |
` | |
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 mageBookTitle() | |
if bookMode == 1 and mageBookStrings[contingencyResRef] then | |
return t(mageBookStrings[contingencyResRef].title) | |
end | |
return t('MAGE_SPELLS_TITLE') | |
end | |
function mageBookAction() | |
if bookMode == 1 and mageBookStrings[contingencyResRef] then | |
return t(mageBookStrings[contingencyResRef].action) | |
end | |
return characters[id].name | |
end | |
function makeBlankTable(num) | |
local out = {} | |
for i = 1,num do | |
table.insert(out, {}) | |
end | |
return out | |
end | |
function contingencyComplete() | |
if showContingency then | |
return #bottomSpells == #bottomSpellsPlaceHolder and (currentContingencyCondition or 0) > 0 and (currentContingencyTarget or 0) > 0 | |
end | |
return #bottomSpells == #bottomSpellsPlaceHolder | |
end | |
function getSpellOpacity(num) | |
if bottomSpells[num].castable == 0 then | |
return 100 | |
end | |
return 255 | |
end | |
function getSpellHighlight(num) | |
if currentSpellLevel == num then | |
return 2 | |
end | |
return 0 | |
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 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 characters[id].mageSpells ~= nil and characters[id].mageSpells[currentSpellLevel] ~= nil then | |
for k,v in pairs(characters[id].mageSpells[currentSpellLevel]) do | |
if v.castableCount > 0 and mageScreen:SpellAllowedForContingency(v.level, v.resref) then | |
tableInsert(out, v) | |
end | |
end | |
end | |
if characters[id].priestSpells ~= nil and characters[id].priestSpells[currentSpellLevel] ~= nil then | |
for k,v in pairs(characters[id].priestSpells[currentSpellLevel]) do | |
if v.castableCount > 0 and mageScreen:SpellAllowedForContingency(v.level, v.resref) then | |
tableInsert(out, v) | |
end | |
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 | |
ret = spellIndex | |
break | |
end | |
if oldList[spellIndex].icon ~= newList[spellIndex].icon then | |
ret = spellIndex | |
break | |
end | |
spellIndex = spellIndex + 1 | |
end | |
if oldList[spellIndex] == nil and newList[spellIndex] ~= nil then | |
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() | |
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, noSound) | |
currentBookSpell = 0 | |
if noSound ~= true and num ~= currentSpellLevel then | |
Infinity_PlaySound('GAM_05') | |
end | |
currentSpellLevel = num | |
mageScreen:SetSpellLevel(num - 1) | |
refreshMageBook() | |
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 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 | |
function unmemorizingMageSpell(resref) | |
createMageMemorizationSparkle(62 * (cellNumber - 1), 0, 62, 62, 'memorizedListMage', currentBottomSpell) | |
end | |
function removeMageSpell(idx) | |
showMageMemorizationFlash = false | |
mageScreen:UnmemorizeSpell(bottomSpells[idx].level, bottomSpells[idx].memorizedIndex) | |
Infinity_PlaySound('GAM_44') | |
end | |
function spellTooltip(spells, cellNumber) | |
local idx = 4 * (currentBookSpell - 1) + cellNumber | |
if spells[idx] then | |
return Infinity_FetchString(spells[idx].name) | |
end | |
return '' | |
end | |
function showSpellDetails(spell) | |
if(spell.isPlaceholder) then | |
return | |
end | |
currentSpell = spell | |
Infinity_PushMenu("SPELL_DESCRIPTION") | |
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} | |
} | |
` | |
menu | |
{ | |
name 'MAGE' | |
align center center | |
greyscale lua "mageBookEnabled == false" | |
onOpen | |
" | |
currentID=id | |
showMageMemorizationFlash = false | |
dwIsPriest=nil | |
setMageBookLevel(1, true) | |
currentAnimationID = 1 | |
updateCounterMemorizationSparkles = 1 | |
if bookMode == 1 then | |
Infinity_PopMenu() | |
Infinity_PushMenu('MAGE_CHOOSE_CONTINGENCY') | |
end | |
" | |
button | |
{ | |
enabled "CurrentlyInGame()" | |
on escape | |
action | |
" | |
--Return to world screen on escape | |
e:SelectEngine(worldScreen) | |
" | |
} | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIMGB | |
} | |
label | |
{ | |
area 82 10 700 44 | |
text lua "mageBookTitle()..dwRefreshMageHack()" | |
text style "title" | |
} | |
label | |
{ | |
area 210 59 446 30 | |
text lua "mageBookAction()" | |
text style "label" | |
} | |
button | |
{ | |
area 168 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(1)" | |
sequence 0 | |
enabled "maxMagePage > 0" | |
action "setMageBookLevel(1)" | |
} | |
button | |
{ | |
area 227 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(2)" | |
sequence 1 | |
enabled "maxMagePage > 1" | |
action "setMageBookLevel(2)" | |
} | |
button | |
{ | |
area 286 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(3)" | |
sequence 2 | |
enabled "maxMagePage > 2" | |
action "setMageBookLevel(3)" | |
} | |
button | |
{ | |
area 345 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(4)" | |
sequence 3 | |
enabled "maxMagePage > 3" | |
action "setMageBookLevel(4)" | |
} | |
button | |
{ | |
area 404 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(5)" | |
sequence 4 | |
enabled "maxMagePage > 4" | |
action "setMageBookLevel(5)" | |
} | |
button | |
{ | |
area 464 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(6)" | |
sequence 5 | |
enabled "maxMagePage > 5" | |
action "setMageBookLevel(6)" | |
} | |
button | |
{ | |
area 523 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(7)" | |
sequence 6 | |
enabled "maxMagePage > 6" | |
action "setMageBookLevel(7)" | |
} | |
button | |
{ | |
area 583 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(8)" | |
sequence 7 | |
enabled "maxMagePage > 7" | |
action "setMageBookLevel(8)" | |
} | |
button | |
{ | |
area 644 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(9)" | |
sequence 8 | |
enabled "maxMagePage > 8" | |
action "setMageBookLevel(9)" | |
} | |
button | |
{ | |
area 18 278 52 132 | |
bam GUIPRC | |
sequence 0 | |
action | |
" | |
if currentSpellLevel > 1 then | |
setMageBookLevel(currentSpellLevel - 1) | |
end | |
" | |
} | |
button | |
{ | |
area 794 278 52 132 | |
bam GUIPRC | |
sequence 1 | |
action | |
" | |
if currentSpellLevel < maxMagePage then | |
setMageBookLevel(currentSpellLevel + 1) | |
end | |
" | |
} | |
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_mageMemorizationSparkle" | |
} | |
text | |
{ | |
area 158 180 256 22 | |
text lua "Infinity_FetchString(11945)" | |
text style "normal_parchment" | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bookSpells[4 * rowNumber - 3] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bookSpells[4 * rowNumber - 3].icon" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bookSpells[4 * rowNumber - 2] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bookSpells[4 * rowNumber - 2].icon" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bookSpells[4 * rowNumber - 1] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bookSpells[4 * rowNumber - 1].icon" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bookSpells[4 * rowNumber] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bookSpells[4 * rowNumber].icon" | |
align center center | |
} | |
} | |
area 154 204 266 372 | |
name "bookListMage" | |
scrollbar 'GUISBR' | |
rowheight 62 | |
hidehighlight | |
table "makeTable(math.ceil(#bookSpells / 4))" | |
var currentBookSpell | |
sound "" | |
action | |
" | |
currentBookSpell = 4 * (currentBookSpell - 1) + cellNumber | |
if bookSpells[currentBookSpell] and #bottomSpells < #bottomSpellsPlaceHolder and dwSpellEnabled(bookSpells[currentBookSpell]) then | |
createMageMemorizationSparkle(62 * (cellNumber - 1), 0, 62, 62, 'bookListMage', -1) | |
Infinity_PlaySound('GAM_24') | |
showMageMemorizationFlash = true | |
mageScreen:MemorizeSpell(bookSpells[currentBookSpell].level, bookSpells[currentBookSpell].index) | |
end | |
" | |
actionAlt | |
" | |
local idx = 4 * (currentBookSpell - 1) + cellNumber | |
if bookSpells[idx] then | |
showSpellDetails(bookSpells[idx]) | |
end | |
" | |
actionEnter "currentBookSpell = mouseoverRow" | |
actionExit "currentBookSpell = 0" | |
} | |
text | |
{ | |
area 154 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 1)" | |
} | |
text | |
{ | |
area 216 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 2)" | |
} | |
text | |
{ | |
area 278 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 3)" | |
} | |
text | |
{ | |
area 340 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 4)" | |
} | |
text | |
{ | |
area 154 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 1)" | |
} | |
text | |
{ | |
area 216 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 2)" | |
} | |
text | |
{ | |
area 278 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 3)" | |
} | |
text | |
{ | |
area 340 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 4)" | |
} | |
text | |
{ | |
area 154 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 1)" | |
} | |
text | |
{ | |
area 216 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 2)" | |
} | |
text | |
{ | |
area 278 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 3)" | |
} | |
text | |
{ | |
area 340 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 4)" | |
} | |
text | |
{ | |
area 154 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 1)" | |
} | |
text | |
{ | |
area 216 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 2)" | |
} | |
text | |
{ | |
area 278 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 3)" | |
} | |
text | |
{ | |
area 340 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 4)" | |
} | |
text | |
{ | |
area 154 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 1)" | |
} | |
text | |
{ | |
area 216 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 2)" | |
} | |
text | |
{ | |
area 278 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 3)" | |
} | |
text | |
{ | |
area 340 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 4)" | |
} | |
text | |
{ | |
area 154 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 1)" | |
} | |
text | |
{ | |
area 216 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 2)" | |
} | |
text | |
{ | |
area 278 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 3)" | |
} | |
text | |
{ | |
area 340 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bookSpells, 4)" | |
} | |
text | |
{ | |
area 450 180 256 22 | |
text lua "Infinity_FetchString(11944)" | |
text style "normal_parchment" | |
text align right top | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber - 3] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber - 3] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber - 3].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber - 3)" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber - 2] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber - 2] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber - 2].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber - 2)" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber - 1] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber - 1] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber - 1].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber - 1)" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber)" | |
align center center | |
} | |
} | |
area 450 204 266 372 | |
name "memorizedListMage" | |
scrollbar 'GUISBR' | |
rowheight 62 | |
hidehighlight | |
table "makeTable(math.ceil(#bottomSpellsPlaceHolder / 4))" | |
var currentBottomSpell | |
sound "" | |
action | |
" | |
local idx = 4 * (currentBottomSpell - 1) + cellNumber | |
if bottomSpells[idx] then | |
if bottomSpells[idx].memorizedCount > bottomSpells[idx].castableCount or Infinity_GetOption(41, 9) == 0 then | |
removeMageSpell(idx) | |
else | |
popup2Button(11824, 'DELETE_BUTTON', function() removeMageSpell(idx) end) | |
end | |
end | |
" | |
actionAlt | |
" | |
local idx = 4 * (currentBottomSpell - 1) + cellNumber | |
if bottomSpells[idx] then | |
showSpellDetails(bottomSpells[idx]) | |
end | |
" | |
actionEnter "currentBookSpell = mouseoverRow" | |
actionExit "currentBookSpell = 0" | |
} | |
label | |
{ | |
area 294 608 276 50 | |
text lua "magePageInfo()" | |
text style "label" | |
} | |
text | |
{ | |
area 450 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 512 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 574 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 636 204 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 450 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 512 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 574 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 636 266 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 450 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 512 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 574 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 636 328 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 450 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 512 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 574 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 636 390 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 450 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 512 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 574 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 636 452 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 450 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 512 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 574 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 636 514 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
button | |
{ | |
area 46 611 234 44 | |
enabled "(#characters[id].contingencySpells > 0 or #characters[id].sequencerSpells > 0)" | |
bam GUIOSTLL | |
text "CONTINGENCY_BUTTON" | |
text style "button" | |
action "Infinity_PushMenu('MAGE_CONTINGENCY')" | |
} | |
} | |
` | |
function getCastableCount(idx) | |
local nb = bookSpells[idx].castableCount | |
if nb <= 1 then | |
return 0 | |
end | |
return nb | |
end | |
function getIconName(spell) | |
local icon = spell.icon | |
local iconB = icon:sub(1, -2) .. 'B' | |
for _, entry in ipairs(Infinity_GetFilesOfType("BAM")) do | |
if entry[1] == iconB then | |
return iconB | |
end | |
end | |
return icon | |
end | |
` | |
menu | |
{ | |
name 'MAGE_CHOOSE_CONTINGENCY' | |
align center center | |
ignoreesc | |
modal | |
onOpen | |
" | |
currentContingencyCondition = 0 | |
currentContingencyTarget = 0 | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIMGCP | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "mageBookTitle()" | |
text style "title" | |
} | |
label | |
{ | |
area 380 60 110 40 | |
text lua "t('LEVEL_LABEL') .. ' ' .. currentSpellLevel" | |
text style "label" | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
area 6 5 52 52 | |
bam GUIWDBUT | |
icon lua "getIconName(bookSpells[rowNumber])" | |
count lua "getCastableCount(rowNumber)" | |
align center center | |
} | |
} | |
column | |
{ | |
width 75 | |
label | |
{ | |
area 10 0 -1 -1 | |
text lua "Infinity_FetchString(bookSpells[rowNumber].name)" | |
text style "normal" | |
text color D | |
text align left center | |
} | |
} | |
area 54 130 256 248 | |
scrollbar 'GUISCRC' | |
rowheight 62 | |
hidehighlight | |
table "bookSpells" | |
var currentBookSpell | |
sound "" | |
action | |
" | |
contingencyDescription = mageBookStrings[contingencyResRef].tip | |
if bookSpells[currentBookSpell] then | |
if cellNumber == 1 and #bottomSpells < #bottomSpellsPlaceHolder then | |
Infinity_PlaySound('GAM_24') | |
mageScreen:SequenceSpell(bookSpells[currentBookSpell].resref, bookSpells[currentBookSpell].masterResref) | |
end | |
contingencyDescription = bookSpells[currentBookSpell].description | |
end | |
" | |
actionAlt | |
" | |
if bookSpells[currentBookSpell] then | |
contingencyDescription = bookSpells[currentBookSpell].description | |
end | |
" | |
} | |
button | |
{ | |
area 120 410 45 42 | |
bam GUIOSW | |
sequence 1 | |
clickable lua "currentSpellLevel > 1" | |
action | |
" | |
setMageBookLevel(currentSpellLevel - 1) | |
" | |
} | |
button | |
{ | |
area 166 410 45 42 | |
bam GUIOSW | |
sequence 0 | |
clickable lua "currentSpellLevel < maxMagePage" | |
action | |
" | |
setMageBookLevel(currentSpellLevel + 1) | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 -1 -1 | |
bam GUIWDBUT | |
align center center | |
} | |
} | |
area 264 402 333 60 | |
rowwidth 111 | |
hidehighlight | |
table "bottomSpellsPlaceHolder" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 -1 -1 | |
bam lua "getIconName(bottomSpells[rowNumber])" | |
align center center | |
} | |
} | |
area 264 402 333 60 | |
enabled "#bottomSpells ~= 0" | |
rowwidth 111 | |
hidehighlight | |
table "bottomSpells" | |
var currentBottomSpell | |
sound "" | |
action | |
" | |
if bottomSpells[currentBottomSpell] then | |
Infinity_PlaySound('GAM_44') | |
mageScreen:UnSequenceSpell(bottomSpells[currentBottomSpell].resref, bottomSpells[currentBottomSpell].masterResref) | |
table.remove(sequencerSpells, currentBottomSpell) | |
bottomSpells = sequencerSpells | |
end | |
" | |
} | |
label | |
{ | |
enabled "showContingency == true" | |
area 320 130 240 30 | |
text "CONDITION_NORMAL" | |
text style "label" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= currentContingencyCondition and rowNumber ~= currentContingencyCondition_hover" | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(contingencyConditions[rowNumber].strref)" | |
text style "normal" | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == currentContingencyCondition and rowNumber ~= currentContingencyCondition_hover" | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(contingencyConditions[rowNumber].strref)" | |
text style "normal" | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == currentContingencyCondition_hover" | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(contingencyConditions[rowNumber].strref)" | |
text style "normal" | |
text color H | |
} | |
} | |
enabled "showContingency == true" | |
area 320 172 240 206 | |
rowheight 40 | |
hidehighlight | |
table "contingencyConditions" | |
var currentContingencyCondition | |
scrollbar 'GUISCRC' | |
action | |
" | |
contingencyDescription = contingencyConditions[currentContingencyCondition].desc | |
" | |
actionEnter "currentContingencyCondition_hover = mouseoverRow" | |
actionExit "currentContingencyCondition_hover = 0" | |
} | |
label | |
{ | |
enabled "showContingency == true" | |
area 572 130 240 30 | |
text "TARGET_NORMAL" | |
text style "label" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= currentContingencyTarget and rowNumber ~= currentContingencyTarget_hover" | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(contingencyTargets[rowNumber].strref)" | |
text style "normal" | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == currentContingencyTarget and rowNumber ~= currentContingencyTarget_hover" | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(contingencyTargets[rowNumber].strref)" | |
text style "normal" | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == currentContingencyTarget_hover" | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(contingencyTargets[rowNumber].strref)" | |
text style "normal" | |
text color H | |
} | |
} | |
enabled "showContingency == true" | |
area 572 172 240 206 | |
rowheight 40 | |
hidehighlight | |
table "contingencyTargets" | |
var currentContingencyTarget | |
scrollbar 'GUISCRC' | |
action | |
" | |
contingencyDescription = contingencyTargets[currentContingencyTarget].desc | |
" | |
actionEnter "currentContingencyTarget_hover = mouseoverRow" | |
actionExit "currentContingencyTarget_hover = 0" | |
} | |
text | |
{ | |
area 112 492 642 116 | |
text lua "Infinity_FetchString(contingencyDescription)" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "contingencyComplete()" | |
action | |
" | |
Infinity_PopMenu() | |
mageScreen:DoneSequencingSpells() | |
e:SelectEngine(worldScreen) | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
mageScreen:CancelSequencingSpells() | |
e:SelectEngine(worldScreen) | |
" | |
} | |
button | |
{ | |
clickable lua "reverseButtonPosition and contingencyComplete() or true" | |
area 210 653 234 44 | |
bam GUIOSTUL | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
mageScreen:DoneSequencingSpells() | |
else | |
mageScreen:CancelSequencingSpells() | |
end | |
e:SelectEngine(worldScreen) | |
" | |
} | |
button | |
{ | |
clickable lua "reverseButtonPosition and true or contingencyComplete()" | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
mageScreen:CancelSequencingSpells() | |
else | |
mageScreen:DoneSequencingSpells() | |
end | |
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 | |
computeSplitPosition(Infinity_FetchString(currentSpell.description), 'spellDescriptionSplit') | |
end | |
function isWizSpellMode() | |
return e:GetActiveEngine() == e:GetEngineWizSpell() | |
end | |
function inSpellBook() | |
return e:GetActiveEngine() == e:GetEngineWizSpell() or e:GetActiveEngine() == e:GetEnginePriestSpell() | |
end | |
showEraseButton = true | |
` | |
menu | |
{ | |
name "SPELL_DESCRIPTION" | |
align center center | |
modal | |
onOpen | |
" | |
Infinity_PlaySound('GAM_03') | |
if(e:GetActiveEngine() == worldScreen) then | |
worldScreenWasPaused = worldScreen:CheckIfPaused() | |
if worldScreenWasPaused == false then | |
worldScreen:TogglePauseGame(true) | |
end | |
end | |
showEraseButton = true | |
if characters[id].hasSorcererBook then | |
showEraseButton = false | |
end | |
computeSplitPosition(Infinity_FetchString(currentSpell.description), 'spellDescriptionSplit') | |
" | |
onClose | |
" | |
if(e:GetActiveEngine() == worldScreen) then | |
if worldScreenWasPaused == false then | |
worldScreen:TogglePauseGame(true) | |
end | |
worldScreenWasPaused = false | |
end | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIINVHI | |
} | |
label | |
{ | |
area 81 11 700 44 | |
text 16189 | |
text style "title" | |
} | |
label | |
{ | |
area 95 70 52 52 | |
bam STONSLOT | |
} | |
label | |
{ | |
area 95 70 52 52 | |
icon lua "getIconName(currentSpell)" | |
sequence 0 | |
align center center | |
} | |
button | |
{ | |
enabled "inSpellBook()" | |
area 250 70 45 42 | |
bam GUIOSW | |
sequence 1 | |
action | |
" | |
incrSpellDescription(-1) | |
" | |
} | |
button | |
{ | |
enabled "inSpellBook()" | |
area 570 70 45 42 | |
bam GUIOSW | |
sequence 0 | |
action | |
" | |
incrSpellDescription(1) | |
" | |
} | |
label | |
{ | |
area 282 67 300 50 | |
text lua "Infinity_FetchString(currentSpell.name)" | |
text align center center | |
text style "label" | |
} | |
label | |
{ | |
name "spellDescriptionSplit" | |
enabled "false" | |
area 44 0 655 -1 | |
text lua "Infinity_FetchString(currentSpell.description):sub(startPos, curPos)" | |
text style "parchment" | |
scrollbar 'GUISBR' | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber == 1" | |
area 0 0 40 38 | |
bam INITIALS | |
sequence lua "Infinity_FetchString(currentSpell.description):byte(startPos - 1) - 1" | |
} | |
label | |
{ | |
enabled "rowNumber == 1" | |
area 44 0 655 -1 | |
text lua "Infinity_FetchString(currentSpell.description):sub(startPos, splitPos - 1)" | |
text style "parchment" | |
} | |
label | |
{ | |
enabled "rowNumber == 2" | |
area 0 0 -1 -1 | |
pad 0 0 16 0 | |
text lua "Infinity_FetchString(currentSpell.description):sub(splitPos + 1)" | |
text style "parchment" | |
} | |
} | |
enabled "splitPos ~= -1" | |
rowheight dynamic | |
hidehighlight | |
table "makeTable(2)" | |
area 71 185 715 340 | |
scrollbar 'GUISBR' | |
} | |
text | |
{ | |
enabled "splitPos == -1" | |
area 71 185 715 340 | |
text lua "Infinity_FetchString(currentSpell.description)" | |
text style "parchment" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on escape | |
area 327 638 201 44 | |
bam GUIOSTUM | |
text "DONE_BUTTON" | |
text style "button" | |
action "Infinity_PopMenu('SPELL_DESCRIPTION')" | |
} | |
button | |
{ | |
enabled "false" | |
area 572 638 234 44 | |
text "REMOVE_BUTTON" | |
text style "button" | |
bam GUIOSTUR | |
action "popup2Button(engine_mode == 0 and 24485 or 63745, 'REMOVE_BUTTON', function() mageScreen:EraseKnownSpell(currentSpell.resref); Infinity_PopMenu('SPELL_DESCRIPTION') end)" | |
} | |
} | |
` | |
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 GUIINVHI | |
} | |
label --Title | |
{ | |
area 81 11 700 44 | |
text "CONTINGENCY_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 254 68 360 48 | |
text "SPELLS_PREPARED_LABEL" | |
text style "label" | |
text align center center | |
} | |
label | |
{ | |
area 252 180 182 36 | |
text "CONDITION_LABEL" | |
text style "label" | |
text align left center | |
text color 5 | |
} | |
label | |
{ | |
area 434 180 182 36 | |
text "TARGET_LABEL" | |
text style "label" | |
text align left center | |
text color 5 | |
} | |
label | |
{ | |
area 616 180 182 36 | |
text "SPELL_LABEL" | |
text style "label" | |
text align left center | |
text color 5 | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "t(mageBookStrings[preparedSpells[rowNumber].resref].title)" | |
text style "label_parchment" | |
align left center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(preparedSpells[rowNumber].condition)" | |
text style "label_parchment" | |
align left center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "Infinity_FetchString(preparedSpells[rowNumber].target)" | |
text style "label_parchment" | |
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 10 | |
label | |
{ | |
area 0 0 -1 -1 | |
text lua "'X'" | |
text style "label_parchment" | |
align center center | |
enabled "preparedSpells[rowNumber].dispellable" | |
} | |
} | |
area 70 216 728 308 | |
rowheight 56 | |
hidehighlight | |
table "preparedSpells" | |
var "currentContingencySpell" | |
action | |
" | |
if cellNumber == 7 and preparedSpells[currentContingencySpell].dispellable then | |
if Infinity_GetOption(41, 9) == 1 then | |
popup2Button(engine_mode == 0 and 24398 or 32665, 'YES_BUTTON', function() mageScreen:OnDispellButtonClick(currentContingencySpell) end, 'NO_BUTTON') | |
else | |
mageScreen:OnDispellButtonClick(currentContingencySpell) | |
end | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUM | |
area 327 638 201 44 | |
text "DONE_BUTTON" | |
text style "button" | |
action "Infinity_PopMenu('MAGE_CONTINGENCY')" | |
} | |
} | |
menu | |
{ | |
name "POPUP_DETAILS" | |
align center center | |
modal | |
onOpen | |
" | |
Infinity_PlaySound('GAM_03') | |
computeSplitPosition(Infinity_FetchString(PopupDetails.description), 'popupDetailsSplit') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIINVHI | |
} | |
label | |
{ | |
area 81 11 700 44 | |
text lua "Infinity_FetchString(PopupDetails.title)" | |
text style title | |
} | |
label | |
{ | |
area 95 70 52 52 | |
bam STONSLOT | |
} | |
label | |
{ | |
area 95 70 52 52 | |
bam lua "PopupDetails.icon" | |
sequence 0 | |
align center center | |
} | |
label | |
{ | |
area 282 67 300 50 | |
text lua "Infinity_FetchString(PopupDetails.name)" | |
text align center center | |
text style "label" | |
} | |
label | |
{ | |
name "popupDetailsSplit" | |
enabled "false" | |
area 44 0 655 -1 | |
text lua "Infinity_FetchString(PopupDetails.description):sub(startPos, curPos)" | |
text style "parchment" | |
scrollbar 'GUISBR' | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber == 1" | |
area 0 0 40 38 | |
bam INITIALS | |
sequence lua "Infinity_FetchString(PopupDetails.description):byte(startPos - 1) - 1" | |
} | |
label | |
{ | |
enabled "rowNumber == 1" | |
area 44 0 655 -1 | |
text lua "Infinity_FetchString(PopupDetails.description):sub(startPos, splitPos - 1)" | |
text style "parchment" | |
} | |
label | |
{ | |
enabled "rowNumber == 2" | |
area 0 0 -1 -1 | |
pad 0 0 16 0 | |
text lua "Infinity_FetchString(PopupDetails.description):sub(splitPos + 1)" | |
text style "parchment" | |
} | |
} | |
enabled "splitPos ~= -1" | |
rowheight dynamic | |
hidehighlight | |
table "makeTable(2)" | |
area 71 185 715 340 | |
scrollbar 'GUISBR' | |
} | |
text | |
{ | |
enabled "splitPos == -1" | |
area 71 185 715 340 | |
text lua "Infinity_FetchString(PopupDetails.description)" | |
text style "parchment" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
area 327 638 201 44 | |
bam GUIOSTUM | |
text "DONE_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
Infinity_PopMenu('POPUP_DETAILS') | |
" | |
} | |
} | |
` | |
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 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 | |
table.insert(out, spell) | |
end | |
end | |
return out | |
end | |
showPriestMemorizationFlash = false | |
function refreshPriestBook() | |
if currentSpellLevel == nil then | |
currentSpellLevel = 1 | |
end | |
if (characters[id].hasClericBook and characters[id].priestDetails[currentSpellLevel].maxMemorized>0) then | |
characters[id].priestSpells[currentSpellLevel]=build_dwPriestSpell(characters[id].priestSpells[currentSpellLevel]) | |
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] | |
characters[id].priestSpells[currentSpellLevel]=build_dwPriestSpell(characters[id].priestSpells[currentSpellLevel]) | |
bottomSpells = {} | |
bottomSpellsPlaceHolder = {} | |
else | |
bookSpells = {} | |
characters[id].priestSpells[currentSpellLevel]=build_dwPriestSpell(characters[id].priestSpells[currentSpellLevel]) | |
bottomSpells = {} | |
bottomSpellsPlaceHolder = {} | |
end | |
end | |
function setPriestBookLevel(num, noSound) | |
currentBookSpell = 0 | |
if noSound ~= true and num ~= currentSpellLevel then | |
Infinity_PlaySound('GAM_06') | |
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) | |
createPriestMemorizationSparkle(62 * (cellNumber - 1), 0, 62, 62, 'memorizedListPriest', currentBottomSpell) | |
end | |
function removePriestSpell(idx) | |
showPriestMemorizationFlash = false | |
priestScreen:UnmemorizeSpell(bottomSpells[idx].level, bottomSpells[idx].memorizedIndex) | |
Infinity_PlaySound('GAM_44') | |
end | |
` | |
menu | |
{ | |
name 'PRIEST' | |
align center center | |
greyscale lua "priestBookEnabled == false" | |
onOpen | |
" | |
currentID=id | |
showPriestMemorizationFlash = false | |
dwIsPriest=true | |
pushSidebars() | |
setPriestBookLevel(1, true) | |
currentAnimationID = 1 | |
updateCounterMemorizationSparkles = 1 | |
" | |
onclose | |
" | |
popSidebars() | |
" | |
button | |
{ | |
on escape | |
action | |
" | |
--Return to world screen on escape | |
e:SelectEngine(worldScreen) | |
" | |
} | |
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 "characters[id].name..dwRefreshPriestHack()" | |
text style "label" | |
} | |
button | |
{ | |
area 168 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(1)" | |
sequence 0 | |
enabled "maxPriestPage > 0" | |
action "setPriestBookLevel(1)" | |
} | |
button | |
{ | |
area 246 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(2)" | |
sequence 1 | |
enabled "maxPriestPage > 1" | |
action "setPriestBookLevel(2)" | |
} | |
button | |
{ | |
area 328 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(3)" | |
sequence 2 | |
enabled "maxPriestPage > 2" | |
action "setPriestBookLevel(3)" | |
} | |
button | |
{ | |
area 403 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(4)" | |
sequence 3 | |
enabled "maxPriestPage > 3" | |
action "setPriestBookLevel(4)" | |
} | |
button | |
{ | |
area 484 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(5)" | |
sequence 4 | |
enabled "maxPriestPage > 4" | |
action "setPriestBookLevel(5)" | |
} | |
button | |
{ | |
area 566 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(6)" | |
sequence 5 | |
enabled "maxPriestPage > 5" | |
action "setPriestBookLevel(6)" | |
} | |
button | |
{ | |
area 642 110 54 54 | |
bam GUIPRTC | |
frame lua "getSpellHighlight(7)" | |
sequence 6 | |
enabled "maxPriestPage > 6" | |
action "setPriestBookLevel(7)" | |
} | |
button | |
{ | |
area 18 278 52 132 | |
bam GUIPRC | |
sequence 0 | |
action | |
" | |
if currentSpellLevel > 1 then | |
setPriestBookLevel(currentSpellLevel - 1) | |
end | |
" | |
} | |
button | |
{ | |
area 794 278 52 132 | |
bam GUIPRC | |
sequence 1 | |
action | |
" | |
if currentSpellLevel < maxPriestPage then | |
setPriestBookLevel(currentSpellLevel + 1) | |
end | |
" | |
} | |
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" | |
} | |
text | |
{ | |
area 138 178 256 22 | |
text lua "Infinity_FetchString(11945)" | |
text style "normal_parchment" | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "characters[id].priestSpells[currentSpellLevel][4 * rowNumber - 3] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "characters[id].priestSpells[currentSpellLevel][4 * rowNumber - 3].icon" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "characters[id].priestSpells[currentSpellLevel][4 * rowNumber - 2] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "characters[id].priestSpells[currentSpellLevel][4 * rowNumber - 2].icon" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "characters[id].priestSpells[currentSpellLevel][4 * rowNumber - 1] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "characters[id].priestSpells[currentSpellLevel][4 * rowNumber - 1].icon" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "characters[id].priestSpells[currentSpellLevel][4 * rowNumber] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "characters[id].priestSpells[currentSpellLevel][4 * rowNumber].icon" | |
align center center | |
} | |
} | |
area 138 200 266 372 | |
name "bookListPriest" | |
scrollbar 'GUISBR' | |
rowheight 62 | |
hidehighlight | |
table "makeTable(math.ceil(#characters[id].priestSpells[currentSpellLevel] / 4))" | |
var currentBookSpell | |
sound "" | |
action | |
" | |
currentBookSpell = 4 * (currentBookSpell - 1) + cellNumber | |
if characters[id].priestSpells[currentSpellLevel][currentBookSpell] and #bottomSpells < #bottomSpellsPlaceHolder and dwSpellEnabled(characters[id].priestSpells[currentSpellLevel][currentBookSpell],true) then | |
createPriestMemorizationSparkle(62 * (cellNumber - 1), 0, 62, 62, 'bookListPriest', -1) | |
Infinity_PlaySound('GAM_24') | |
showPriestMemorizationFlash = true | |
if dwSpellEnabled(characters[id].priestSpells[currentSpellLevel][currentBookSpell],true) then priestScreen:MemorizeSpell(characters[id].priestSpells[currentSpellLevel][currentBookSpell].level, characters[id].priestSpells[currentSpellLevel][currentBookSpell].index) end | |
end | |
" | |
actionAlt | |
" | |
local idx = 4 * (currentBookSpell - 1) + cellNumber | |
if characters[id].priestSpells[currentSpellLevel][idx] then | |
showSpellDetails(characters[id].priestSpells[currentSpellLevel][idx]) | |
end | |
" | |
actionEnter "currentBookSpell = mouseoverRow" | |
actionExit "currentBookSpell = 0" | |
} | |
text | |
{ | |
area 138 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 1)" | |
} | |
text | |
{ | |
area 200 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 2)" | |
} | |
text | |
{ | |
area 262 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 3)" | |
} | |
text | |
{ | |
area 324 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 4)" | |
} | |
text | |
{ | |
area 138 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 1)" | |
} | |
text | |
{ | |
area 200 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 2)" | |
} | |
text | |
{ | |
area 262 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 3)" | |
} | |
text | |
{ | |
area 324 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 4)" | |
} | |
text | |
{ | |
area 138 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 1)" | |
} | |
text | |
{ | |
area 200 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 2)" | |
} | |
text | |
{ | |
area 262 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 3)" | |
} | |
text | |
{ | |
area 324 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 4)" | |
} | |
text | |
{ | |
area 138 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 1)" | |
} | |
text | |
{ | |
area 200 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 2)" | |
} | |
text | |
{ | |
area 262 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 3)" | |
} | |
text | |
{ | |
area 324 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 4)" | |
} | |
text | |
{ | |
area 138 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 1)" | |
} | |
text | |
{ | |
area 200 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 2)" | |
} | |
text | |
{ | |
area 262 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 3)" | |
} | |
text | |
{ | |
area 324 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 4)" | |
} | |
text | |
{ | |
area 138 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 1)" | |
} | |
text | |
{ | |
area 200 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 2)" | |
} | |
text | |
{ | |
area 262 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 3)" | |
} | |
text | |
{ | |
area 324 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(characters[id].priestSpells[currentSpellLevel], 4)" | |
} | |
text | |
{ | |
area 460 178 256 22 | |
text lua "Infinity_FetchString(11944)" | |
text style "normal_parchment" | |
text align right top | |
} | |
list | |
{ | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber - 3] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber - 3] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber - 3].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber - 3)" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber - 2] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber - 2] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber - 2].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber - 2)" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber - 1] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber - 1] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber - 1].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber - 1)" | |
align center center | |
} | |
} | |
column | |
{ | |
width 25 | |
label | |
{ | |
enabled "bottomSpellsPlaceHolder[4 * rowNumber] ~= nil" | |
area 0 0 -1 -1 | |
bam SPELFRMS | |
align center center | |
} | |
label | |
{ | |
enabled "bottomSpells[4 * rowNumber] ~= nil" | |
area 0 0 -1 -1 | |
bam lua "bottomSpells[4 * rowNumber].icon" | |
opacity lua "getSpellOpacity(4 * rowNumber)" | |
align center center | |
} | |
} | |
area 460 200 266 372 | |
name "memorizedListPriest" | |
scrollbar 'GUISBR' | |
rowheight 62 | |
hidehighlight | |
table "makeTable(math.ceil(#bottomSpellsPlaceHolder / 4))" | |
var currentBottomSpell | |
sound "" | |
action | |
" | |
local idx = 4 * (currentBottomSpell - 1) + cellNumber | |
if bottomSpells[idx] then | |
if bottomSpells[idx].memorizedCount > bottomSpells[idx].castableCount or Infinity_GetOption(41, 9) == 0 then | |
removePriestSpell(idx) | |
else | |
popup2Button(11824, 'DELETE_BUTTON', function() removePriestSpell(idx) end) | |
end | |
end | |
" | |
actionAlt | |
" | |
local idx = 4 * (currentBottomSpell - 1) + cellNumber | |
if bottomSpells[idx] then | |
showSpellDetails(bottomSpells[idx]) | |
end | |
" | |
actionEnter "currentBookSpell = mouseoverRow" | |
actionExit "currentBookSpell = 0" | |
} | |
label | |
{ | |
area 294 608 276 50 | |
text lua "priestPageInfo()" | |
text style "label" | |
} | |
text | |
{ | |
area 460 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 522 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 584 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 646 200 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 460 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 522 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 584 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 646 262 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 460 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 522 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 584 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 646 324 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 460 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 522 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 584 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 646 386 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 460 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 522 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 584 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 646 448 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
text | |
{ | |
area 460 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 1)" | |
} | |
text | |
{ | |
area 522 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 2)" | |
} | |
text | |
{ | |
area 584 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 3)" | |
} | |
text | |
{ | |
area 646 510 62 62 | |
ignoreEvents | |
tooltip lua "spellTooltip(bottomSpells, 4)" | |
} | |
} | |
` | |
function canClickSaveLoad() | |
return game:IsClient() == false | |
end | |
` | |
menu | |
{ | |
name "ESC_MENU" | |
ignoreesc | |
align center center | |
onOpen | |
" | |
pushSidebars() | |
" | |
onClose | |
" | |
popSidebars() | |
" | |
label | |
{ | |
area 0 0 864 768 | |
mosaic STONEOPT | |
} | |
label | |
{ | |
area 258 114 350 44 | |
text "OPTIONS_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 244 174 378 454 | |
bam BIGLOGO | |
align center center | |
frame lua 'getBigLogo()' | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 5 | |
area 570 442 260 76 | |
pad 10 8 10 8 | |
text style "button" | |
text "GAMEPLAY_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('OPTIONS_GAMEPLAY') | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 4 | |
area 597 354 233 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "GRAPHICS_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('OPTIONS_GRAPHICS') | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 3 | |
area 564 276 266 74 | |
pad 10 8 10 8 | |
text style "button" | |
text "SOUND_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('OPTIONS_SOUND') | |
" | |
} | |
button | |
{ | |
area 278 628 301 45 | |
bam STARTMBT | |
sequence 6 | |
text "RETURN_GAME_BUTTON" | |
text style "button" | |
action | |
" | |
e:SelectEngine(worldScreen) | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 0 | |
area 32 276 262 74 | |
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 STARTMBT | |
sequence 1 | |
area 32 354 236 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "QUIT_GAME_BUTTON" | |
action | |
" | |
if e:IsTouchUI() then | |
popup3Button(16456, | |
'CANCEL_BUTTON', nil, | |
'MAIN_MENU_BUTTON', function() optionsScreen:QuitGame() end, | |
'SAVE_BUTTON', function() optionsScreen:SaveGame(0) end | |
) | |
else | |
popup4Button(16456, | |
'CANCEL_BUTTON', nil, | |
'QUIT_BUTTON', function() Infinity_ShutdownGame() end, | |
'MAIN_MENU_BUTTON', function() optionsScreen:QuitGame() end, | |
'SAVE_BUTTON', function() optionsScreen:SaveGame(0) end | |
) | |
end | |
" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 2 | |
area 32 442 262 76 | |
pad 10 8 10 8 | |
text style "button" | |
text "SAVE_GAME_BUTTON" | |
clickable lua "canClickSaveLoad()" | |
action | |
" | |
optionsScreen:SaveGame(0) | |
" | |
} | |
} | |
menu | |
{ | |
name 'START_OPTIONS' | |
align center center | |
ignoreEsc | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic START | |
} | |
label | |
{ | |
area 112 46 786 202 | |
bam TITLE | |
align center center | |
frame lua 'getTitle()' | |
} | |
label | |
{ | |
area 338 192 352 456 | |
bam BIGLOGO | |
align center center | |
frame lua 'getBigLogo()' | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 0 | |
area 113 296 262 74 | |
pad 10 8 10 8 | |
text style "button" | |
text "SOUND_BUTTON" | |
action "Infinity_PushMenu( 'OPTIONS_SOUND' )" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 3 | |
area 645 298 266 74 | |
pad 10 8 10 8 | |
text style "button" | |
text "GRAPHICS_BUTTON" | |
action "Infinity_PushMenu( 'OPTIONS_GRAPHICS' )" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 1 | |
area 112 375 236 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "LANGUAGE_BUTTON" | |
action "Infinity_PushMenu( 'OPTIONS_LANGUAGE' )" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 4 | |
area 680 375 233 84 | |
pad 10 8 10 8 | |
text style "button" | |
text "MOVIES_BUTTON" | |
action "e:SelectEngine(moviesScreen)" | |
} | |
button | |
{ | |
bam STARTMBT | |
sequence 2 | |
area 114 461 262 76 | |
pad 10 8 10 8 | |
text style "button" | |
text "GAMEPLAY_BUTTON" | |
action "Infinity_PushMenu( 'OPTIONS_GAMEPLAY' )" | |
} | |
button | |
{ | |
on escape | |
area 649 463 260 76 | |
bam STARTMBT | |
sequence 5 | |
pad 10 8 10 8 | |
text style "button" | |
text "BACK_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
e:SelectEngine(startEngine) | |
" | |
} | |
} | |
` | |
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 | |
` | |
menu | |
{ | |
name 'AREA_MAP_TITLE2' | |
align center top | |
offset 0 10 | |
ignoreesc | |
button | |
{ | |
area 0 0 300 44 | |
bam GUIOSTCL | |
text style "button" | |
text "WORLD_MAP_BUTTON" | |
action | |
" | |
fromAreaMap = true | |
worldMapScreen:StartWorldMap(0) | |
e:SelectEngine(worldMapScreen) | |
" | |
} | |
} | |
menu | |
{ | |
name 'AREA_MAP_TITLE' | |
align right bottom | |
opacity lua "notesAlpha" | |
offset -100 -10 | |
ignoreEsc | |
onOpen "Infinity_PushMenu('AREA_MAP_TITLE2')" | |
onClose "Infinity_PopMenu('AREA_MAP_TITLE2')" | |
label | |
{ | |
area 36 0 200 36 | |
action "mapScreen:ToggleDisplayExploredMap()" | |
text "WORLDMAP_HIGHLIGHT_LABEL" | |
text style "label" | |
text align left center | |
} | |
button | |
{ | |
area 0 0 236 36 | |
bam "4CHECK" | |
sequence lua "mapScreen:DisplayExploredMap() and 0 or 1" | |
action "mapScreen:ToggleDisplayExploredMap()" | |
} | |
label | |
{ | |
area 36 40 200 36 | |
toggle showNotes | |
text "WORLD_MAP_NOTES_LABEL" | |
text style "label" | |
text align left center | |
} | |
button | |
{ | |
area 0 40 236 36 | |
bam "4CHECK" | |
sequence lua "showNotes == 1 and 0 or 1" | |
toggle showNotes | |
} | |
} | |
` | |
areaMapHover = -1 | |
` | |
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" | |
tooltip force lua "areaMapHover == instanceId" | |
tooltip force top | |
tooltip lua "Infinity_FetchString(mapnoteSettings[instanceId].text)" | |
tooltip position 3 | |
actionAlt | |
" | |
mapScreen:OnColorChoice(mapnoteSettings[instanceId].sequence) | |
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 667 234 | |
mosaic GUIERR21 | |
} | |
label | |
{ | |
area 40 16 596 68 | |
rectangle 0 | |
} | |
edit | |
{ | |
name "mapNoteEditArea" | |
area 48 22 584 56 | |
var mapNoteEdit | |
scrollbar 'GUISCRC' | |
text style "edit" | |
fill 112 111 111 64 | |
} | |
button | |
{ | |
area 458 170 200 44 | |
bam GUIOSTUM | |
text style "button" | |
text "DONE_BUTTON" | |
action | |
" | |
mapScreen:OnUserNoteDoneButtonClick() | |
Infinity_PopMenu('NOTE_ADD',0,0) | |
" | |
} | |
button | |
{ | |
area 242 170 200 44 | |
bam GUIOSTUM | |
text style "button" | |
text "CANCEL_BUTTON" | |
action | |
" | |
Infinity_PopMenu('NOTE_ADD',0,0) | |
" | |
} | |
button | |
{ | |
area 22 170 200 44 | |
bam GUIOSTUM | |
text style "button" | |
text "DELETE_BUTTON" | |
action | |
" | |
mapScreen:OnUserNoteDeleteButtonClick() | |
Infinity_PopMenu('NOTE_ADD',0,0) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_0" | |
area 39 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 0 | |
action | |
" | |
mapScreen:OnColorChoice(0) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_1" | |
area 118 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 1 | |
action | |
" | |
mapScreen:OnColorChoice(1) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_2" | |
area 197 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 2 | |
action | |
" | |
mapScreen:OnColorChoice(2) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_3" | |
area 276 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 3 | |
action | |
" | |
mapScreen:OnColorChoice(3) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_4" | |
area 355 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 4 | |
action | |
" | |
mapScreen:OnColorChoice(4) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_5" | |
area 434 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 5 | |
action | |
" | |
mapScreen:OnColorChoice(5) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_6" | |
area 513 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 6 | |
action | |
" | |
mapScreen:OnColorChoice(6) | |
" | |
} | |
button | |
{ | |
name "BUTTON_mapNoteColor_7" | |
area 591 90 45 42 | |
bam FLAG1 | |
highlightgroup colorChoice | |
sequence 7 | |
action | |
" | |
mapScreen:OnColorChoice(7) | |
" | |
} | |
} | |
` | |
fromAreaMap = false | |
` | |
menu | |
{ | |
name "WORLD_MAP" | |
align center center | |
label | |
{ | |
area 0 0 1044 694 | |
fill 0 0 0 255 | |
} | |
map | |
{ | |
area 23 65 1000 564 | |
worldmap | |
action | |
" | |
worldMapScreen:OnMapMouseDown(eventXCoord,eventYCoord) | |
if singleClickTravel and worldMapScreen:IsTravelButtonClickable() then | |
worldMapScreen:TravelToSelected() | |
end | |
" | |
actionDbl | |
" | |
worldMapScreen:TravelToSelected() | |
" | |
actionDrag | |
" | |
worldMapScreen:OnMapMouseMove(eventXCoord,eventYCoord) | |
" | |
} | |
label | |
{ | |
area 0 0 1044 694 | |
mosaic GUIMAPWB | |
ignoreEvents | |
} | |
label | |
{ | |
area 222 12 600 44 | |
text "WORLD_MAP_TITLE" | |
text style "title" | |
} | |
button | |
{ | |
area 282 642 234 44 | |
bam GUIOSTUL | |
text "TRAVEL_BUTTON" | |
text style "button" | |
clickable lua "worldMapScreen:IsTravelButtonClickable()" | |
action | |
" | |
worldMapScreen:TravelToSelected() | |
" | |
} | |
button | |
{ | |
area 544 642 234 44 | |
bam GUIOSTUR | |
text "BACK_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
if worldMapScreen:IsTravelButtonVisible() or fromAreaMap then | |
worldMapScreen:OnCancelButtonClick() | |
else | |
e:GetActiveEngine():OnLeftPanelButtonClick(0) | |
end | |
fromAreaMap = false | |
" | |
} | |
} | |
` | |
chapterBackground = "" | |
chapterTitle = "" | |
text_CHAPTERSCROLL = "" | |
text_CHAPTERSCROLL_timeStart = 0 | |
text_CHAPTERSCROLL_auto = 1 | |
text_CHAPTERSCROLL_top = nil | |
function UpdateChapterScroll(top, height, contentHeight) | |
textOpacity = 255 | |
if(text_CHAPTERSCROLL_auto == 0) then | |
--defer to default scrolling | |
return nil | |
end | |
if text_CHAPTERSCROLL_top ~= nil and text_CHAPTERSCROLL_top ~= top then | |
text_CHAPTERSCROLL_auto = 0 | |
return nil | |
end | |
local dT = Infinity_GetClockTicks() - text_CHAPTERSCROLL_timeStart | |
text_CHAPTERSCROLL_top = math.floor((dT * -0.005) + height) | |
return text_CHAPTERSCROLL_top | |
end | |
function setChapterBackground(id) | |
chapter = math.max(0, Infinity_GetMaxChapterPage()) | |
chapterBackground = chapterBackgrounds[id] | |
chapterTitle = chapterText() | |
if id < 9 then | |
chapterBackground = 'GUICHP' .. id .. 'A' | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHAPTER' | |
align center center | |
ignoreEsc | |
onOpen | |
" | |
text_CHAPTERSCROLL_top = nil | |
textOpacity = 0 | |
computeSplitPosition(text_CHAPTERSCROLL, 'chapterSplit') | |
Infinity_SetBackground('BACKGROUND') | |
" | |
onClose | |
" | |
Infinity_SetBackground(nil) | |
" | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic lua "chapterBackground" | |
} | |
label | |
{ | |
area 64 4 898 44 | |
text lua "chapterTitle" | |
text style "title" | |
} | |
label | |
{ | |
name "chapterSplit" | |
enabled "false" | |
area 44 0 772 -1 | |
text lua "text_CHAPTERSCROLL:sub(startPos, curPos)" | |
text style normal | |
scrollbar 'GUISCRC' | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber == 1" | |
opacity lua "textOpacity" | |
area 0 0 40 38 | |
bam INITIALS | |
sequence lua "text_CHAPTERSCROLL:byte(startPos - 1) - 1" | |
} | |
label | |
{ | |
enabled "rowNumber == 1" | |
opacity lua "textOpacity" | |
area 44 0 772 -1 | |
text lua "text_CHAPTERSCROLL:sub(startPos, splitPos - 1)" | |
text style normal | |
} | |
label | |
{ | |
enabled "rowNumber == 2" | |
opacity lua "textOpacity" | |
area 0 0 -1 -1 | |
pad 0 0 16 0 | |
text lua "text_CHAPTERSCROLL:sub(splitPos + 1)" | |
text style normal | |
} | |
} | |
enabled "splitPos ~= -1" | |
rowheight dynamic | |
hidehighlight | |
table "makeTable(2)" | |
area 96 480 832 204 | |
scrollbar 'GUISCRC' | |
scrollbar func 'UpdateChapterScroll' | |
scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1' | |
action | |
" | |
text_CHAPTERSCROLL_auto = 0 | |
" | |
} | |
text | |
{ | |
enabled "splitPos == -1" | |
name "text_CHAPTERSCROLL_item" | |
area 96 480 832 204 | |
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 280 714 234 44 | |
bam GUIOSTUL | |
text "DONE_BUTTON" | |
text style "button" | |
clickable lua "chapterScreen:IsDoneButtonClickable()" | |
action | |
" | |
chapterScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
area 532 714 234 44 | |
bam GUIOSTUR | |
text "REPLAY_BUTTON" | |
text style "button" | |
clickable lua "chapterScreen:IsReplayButtonClickable()" | |
action | |
" | |
text_CHAPTERSCROLL_top = nil | |
chapterScreen:OnReplayButtonClick() | |
" | |
} | |
} | |
` | |
epilogueImage = "GUIOSTUR" | |
` | |
menu | |
{ | |
name 'EPILOGUE' | |
align center center | |
ignoreEsc | |
onOpen | |
" | |
text_CHAPTERSCROLL_top = nil | |
textOpacity = 0 | |
computeSplitPosition(text_CHAPTERSCROLL, 'epilogueSplit') | |
Infinity_SetBackground('BACKGROUND') | |
" | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic NPCCHAP | |
} | |
label | |
{ | |
area 106 230 210 330 | |
bitmap lua "epilogueImage" | |
} | |
label | |
{ | |
name "epilogueSplit" | |
enabled "false" | |
area 44 0 460 -1 | |
text lua "text_CHAPTERSCROLL:sub(startPos, curPos)" | |
text style normal | |
scrollbar 'GUISCRC' | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber == 1" | |
opacity lua "textOpacity" | |
area 0 0 40 38 | |
bam INITIALS | |
sequence lua "text_CHAPTERSCROLL:byte(startPos - 1) - 1" | |
} | |
label | |
{ | |
enabled "rowNumber == 1" | |
opacity lua "textOpacity" | |
area 44 0 460 -1 | |
text lua "text_CHAPTERSCROLL:sub(startPos, splitPos - 1)" | |
text style normal | |
} | |
label | |
{ | |
enabled "rowNumber == 2" | |
opacity lua "textOpacity" | |
area 0 0 -1 -1 | |
pad 0 0 16 0 | |
text lua "text_CHAPTERSCROLL:sub(splitPos + 1)" | |
text style normal | |
} | |
} | |
enabled "splitPos ~= -1" | |
rowheight dynamic | |
hidehighlight | |
table "makeTable(2)" | |
area 444 80 520 530 | |
scrollbar 'GUISCRC' | |
scrollbar func 'UpdateChapterScroll' | |
scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1' | |
action | |
" | |
text_CHAPTERSCROLL_auto = 0 | |
" | |
} | |
text | |
{ | |
enabled "splitPos == -1" | |
name "text_CHAPTERSCROLL_item" | |
area 444 80 520 530 | |
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 252 712 234 44 | |
bam GUIOSTUL | |
text "DONE_BUTTON" | |
text style "button" | |
clickable lua "chapterScreen:IsDoneButtonClickable()" | |
action | |
" | |
chapterScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
area 590 712 234 44 | |
bam GUIOSTUR | |
text "REPLAY_BUTTON" | |
text style "button" | |
clickable lua "chapterScreen:IsReplayButtonClickable()" | |
action | |
" | |
text_CHAPTERSCROLL_top = nil | |
chapterScreen:OnReplayButtonClick() | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHAPTER_WAITING_FOR_PROVIDER' | |
modal | |
align center center | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label --Title | |
{ | |
area 82 74 242 88 | |
text "WAITING_FOR_OTHER_PLAYERS" | |
text style "label" | |
} | |
} | |
` | |
store = {} | |
storeGroupItemsVar = 0 | |
storeItemsVar = 0 | |
function getStoreSlotHighlight(highlight) | |
if (highlight == 0) then | |
return 0 | |
end | |
return 2 | |
end | |
function storeSplitStack(count) | |
if (count ~= 0) then | |
storeScreen:SelectStoreItem(storeItemsVar - 1, true); | |
storeScreen:SetStoreItemCount(storeItemsVar - 1, count); | |
else | |
storeScreen:SelectStoreItem(storeItemsVar - 1, false); | |
end | |
end | |
function groupSplitStack(count) | |
if (count ~= 0) then | |
storeScreen:SelectGroupItem(storeGroupItemsVar - 1, true); | |
storeScreen:SetGroupItemCount(storeGroupItemsVar - 1, count); | |
else | |
storeScreen:SelectGroupItem(storeGroupItemsVar - 1, false); | |
end | |
end | |
function checkContainerText(normalStr, containerStr) | |
if(storeScreen:IsContainer()) then | |
return t(containerStr) | |
end | |
return t(normalStr) | |
end | |
function getItemUsages() | |
local item = store.storeItems[rowNumber].item | |
if(item.usages > 0) then | |
return item.usages | |
end | |
if(item.stackSize > 1) then | |
return item.stackSize | |
end | |
return 0 | |
end | |
function canSteal() | |
local nb = 0 | |
for _, v in pairs(store.storeItems) do | |
if v.highlight == 1 then | |
nb = nb + 1 | |
end | |
end | |
return nb > 0 and nb + #store.groupItems <= 16 | |
end | |
` | |
menu | |
{ | |
name 'STORE_BUYSELL' | |
align center center | |
offset 0 -48 | |
ignoreEsc | |
onOpen "storeScreen:UpdateBuySellPanel()" | |
label | |
{ | |
area 0 0 864 614 | |
mosaic GUISTBSC | |
} | |
label | |
{ | |
area 48 6 768 52 | |
text lua "checkContainerText('BUY_SELL_TITLE','CONTAINER_TITLE')" | |
text style "title" | |
} | |
label | |
{ | |
area 277 68 310 26 | |
text lua "Infinity_FetchString(storeScreen:GetStoreName())" | |
text style "label" | |
} | |
label | |
{ | |
area 274 103 313 31 | |
text lua "game:GetPartyGold()" | |
text style "gold" | |
} | |
label | |
{ | |
area 94 522 146 23 | |
enabled "not storeScreen:IsContainer()" | |
text "COST_LABEL" | |
text style "label" | |
align right center | |
} | |
label | |
{ | |
area 319 522 108 23 | |
enabled "not storeScreen:IsContainer()" | |
text lua "storeScreen:GetStoreCost()" | |
text style "normal" | |
align right center | |
} | |
label | |
{ | |
area 533 522 146 23 | |
enabled "not storeScreen:IsContainer()" | |
text "PRICE_LABEL" | |
text style "label" | |
align right center | |
} | |
label | |
{ | |
area 717 522 108 23 | |
enabled "not storeScreen:IsContainer()" | |
text lua "storeScreen:GetGroupCost()" | |
text style "normal" | |
align right center | |
} | |
button | |
{ | |
enabled "storeScreen:IsContainer()" | |
area 330 568 32 32 | |
bam ROUNDBUT | |
action | |
" | |
for k,v in ipairs(store.storeItems) do | |
if v.valid == 1 and v.highlight == 0 then | |
storeScreen:SelectStoreItem(k - 1, true) | |
local maxCount = v.maxCount | |
if maxCount > 1 then | |
storeScreen:SetStoreItemCount(k - 1, maxCount) | |
end | |
if not storeScreen:IsBuyItemButtonClickable() then | |
storeScreen:SelectStoreItem(k - 1, false) | |
break | |
end | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 564 568 32 32 | |
bam ROUNDBUT | |
action | |
" | |
for k,v in ipairs(store.groupItems) do | |
if v.valid == 1 and v.highlight == 0 then | |
storeScreen:SelectGroupItem(k - 1, true) | |
local count = v.item.count | |
local stock = v.numInStock or 0 | |
if count > 1 then | |
storeScreen:SetGroupItemCount(k - 1, count) | |
elseif stock > 1 then | |
storeScreen:SetGroupItemCount(k - 1, stock) | |
end | |
if not storeScreen:IsSellItemButtonClickable() then | |
storeScreen:SelectGroupItem(k - 1, false) | |
break | |
end | |
end | |
end | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 412 62 | |
mosaic GUISTBK2 | |
respectClipping | |
} | |
label | |
{ | |
area 3 0 52 62 | |
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 "getItemUsages()" | |
count lua "store.storeItems[rowNumber].amountSelected" | |
align center center | |
} | |
label | |
{ | |
area 80 0 250 62 | |
text lua "store.storeItems[rowNumber].label" | |
text style "normal" | |
text align left center | |
} | |
label | |
{ | |
area 330 0 91 62 | |
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 2 410 58 | |
rectangle 1 | |
rectangle opacity 150 | |
} | |
} | |
area 19 138 434 376 | |
hidehighlight | |
rowheight 62 | |
table "store.storeItems" | |
var "storeItemsVar" | |
scrollbar 'GUISCRC' | |
action | |
" | |
if store.storeItems[storeItemsVar] then | |
local highlight = store.storeItems[storeItemsVar].highlight ~= 1 | |
storeScreen:SelectStoreItem(storeItemsVar - 1, highlight) | |
if highlight and storeScreen:IsContainer() then | |
local maxCount = store.storeItems[storeItemsVar].maxCount | |
if maxCount > 1 then | |
storeScreen:SetStoreItemCount(storeItemsVar - 1, maxCount) | |
end | |
end | |
end | |
" | |
actionalt | |
" | |
if store.storeItems[storeItemsVar] then | |
showItemDescription(store.storeItems[storeItemsVar], 2) | |
end | |
" | |
actionDbl | |
" | |
local item = store.storeItems[storeItemsVar] | |
if item and item.valid ~= 0 then | |
local maxCount = item.maxCount | |
if maxCount > 1 then | |
popupRequester(maxCount, storeSplitStack, storeScreen:IsContainer()) | |
end | |
end | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 370 62 | |
mosaic GUISTBK1 | |
respectClipping | |
} | |
label | |
{ | |
area 3 0 52 62 | |
bam STONSLOT | |
frame lua "getStoreSlotHighlight(store.groupItems[rowNumber].highlight)" | |
tint lua "store.groupItems[rowNumber].item.tint" | |
icon lua "store.groupItems[rowNumber].item.icon" | |
usages lua "store.groupItems[rowNumber].item.usages" | |
count lua "store.groupItems[rowNumber].count" | |
align center center | |
} | |
label | |
{ | |
area 80 0 200 62 | |
text lua "store.groupItems[rowNumber].label" | |
text style "normal" | |
text align left center | |
} | |
label | |
{ | |
area 300 0 62 62 | |
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 2 368 58 | |
rectangle 1 | |
rectangle opacity 150 | |
} | |
} | |
area 462 138 392 376 | |
hidehighlight | |
rowheight 62 | |
table "store.groupItems" | |
var "storeGroupItemsVar" | |
scrollbar 'GUISCRC' | |
action | |
" | |
if store.groupItems[storeGroupItemsVar] then | |
if store.groupItems[storeGroupItemsVar].item.isBag == 1 then | |
showItemDescription(store.groupItems[storeGroupItemsVar], 1) | |
itemDescRightButtonAction() | |
elseif store.groupItems[storeGroupItemsVar].valid ~= 0 then | |
local highlight = store.groupItems[storeGroupItemsVar].highlight ~= 1 | |
storeScreen:SelectGroupItem(storeGroupItemsVar - 1, highlight) | |
if highlight then | |
local count = store.groupItems[storeGroupItemsVar].item.count | |
local stock = store.groupItems[storeGroupItemsVar].numInStock or 0 | |
if count > 1 then | |
storeScreen:SetGroupItemCount(storeGroupItemsVar - 1, count) | |
elseif stock > 1 then | |
storeScreen:SetGroupItemCount(storeGroupItemsVar - 1, stock) | |
end | |
end | |
end | |
end | |
" | |
actionalt | |
" | |
if store.groupItems[storeGroupItemsVar] then | |
showItemDescription(store.groupItems[storeGroupItemsVar], 1) | |
end | |
" | |
actionDbl | |
" | |
local item = store.groupItems[storeGroupItemsVar] | |
if item and item.valid ~= 0 then | |
local count = item.item.count | |
local stock = item.numInStock or 0 | |
if count > 1 then | |
popupRequester(count, groupSplitStack, true) | |
elseif stock > 1 then | |
popupRequester(stock, groupSplitStack, true) | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 118 560 201 44 | |
bam GUIOSTUM | |
text lua "checkContainerText('BUY_BUTTON', 'TO_BACKPACK_BUTTON')" | |
text style "button" | |
clickable lua "storeScreen:IsBuyItemButtonClickable() and storeScreen:GetStoreCost() <= game:GetPartyGold()" | |
action | |
" | |
storeScreen:OnBuyItemButtonClick() | |
" | |
} | |
button | |
{ | |
area 604 560 201 44 | |
bam GUIOSTUM | |
text lua "checkContainerText('SELL_BUTTON','TO_CONTAINER_BUTTON')" | |
text style "button" | |
clickable lua "storeScreen:IsSellItemButtonClickable()" | |
action | |
" | |
storeScreen:OnSellItemButtonClick() | |
" | |
} | |
button | |
{ | |
area 360 560 201 44 | |
enabled "(not storeScreen:IsContainer()) and storeScreen:IsStealEnabled()" | |
bam GUIOSTUM | |
text "STEAL_BUTTON" | |
text style "button" | |
clickable lua "canSteal()" | |
action | |
" | |
local toSteal = {} | |
for k, v in pairs(store.storeItems) do | |
if v.highlight == 1 then | |
table.insert(toSteal, v.item.name) | |
for i=2, v.amountSelected do table.insert(toSteal, v.item.name) end | |
storeScreen:SelectStoreItem(k - 1, false) | |
end | |
end | |
for _, name in pairs(toSteal) do | |
local steal = 0 | |
for k, v in pairs(store.storeItems) do | |
if v.highlight == 1 then | |
steal = 0 | |
break | |
end | |
if v.item.name == name then | |
steal = k | |
end | |
end | |
if steal == 0 then | |
break | |
end | |
storeScreen:SelectStoreItem(steal - 1, true) | |
storeScreen:OnStealItemButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
area 361 560 201 44 | |
enabled "storeScreen:IsCloseBagButtonClickable()" | |
bam GUIOSTUM | |
text "CLOSE_CONTAINER_BUTTON" | |
text style "button" | |
action | |
" | |
storeScreen:OnCloseBagButtonClick() | |
" | |
} | |
button | |
{ | |
area 19 520 68 90 | |
encumbrance | |
} | |
} | |
menu | |
{ | |
name 'STORE_IDENTIFY' | |
align center center | |
offset 0 -48 | |
ignoreEsc | |
onOpen | |
" | |
storeScreen:UpdateIdentifyPanel() | |
store.identifyText = '' | |
" | |
label | |
{ | |
area 0 0 864 614 | |
mosaic GUISTIDB | |
} | |
label | |
{ | |
area 48 6 768 52 | |
text "IDENTIFY_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 277 68 310 26 | |
text lua "Infinity_FetchString(storeScreen:GetStoreName())" | |
text style "label" | |
} | |
label | |
{ | |
area 274 103 313 31 | |
text lua "game:GetPartyGold()" | |
text style "gold" | |
} | |
label | |
{ | |
area 68 526 146 23 | |
text "COST_LABEL" | |
text style "label" | |
align right center | |
} | |
label | |
{ | |
area 260 526 108 23 | |
text lua "storeScreen:GetIdentifyCost()" | |
text style "normal" | |
align right center | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "store.identifyItems[rowNumber].valid" | |
area 0 0 318 62 | |
mosaic GUISTBK3 | |
respectClipping | |
} | |
label | |
{ | |
enabled "store.identifyItems[rowNumber].valid" | |
area 3 0 52 62 | |
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 | |
{ | |
enabled "store.identifyItems[rowNumber].valid" | |
area 80 0 204 62 | |
text lua "store.identifyItems[rowNumber].label" | |
text style "normal" | |
text align left center | |
} | |
} | |
area 62 138 350 384 | |
hidehighlight | |
rowheight dynamic | |
table "store.identifyItems" | |
var "identifyItemsVar" | |
scrollbar 'GUISCRC' | |
action | |
" | |
local highlight = store.identifyItems[identifyItemsVar].highlight ~= 1 | |
storeScreen:SelectIdentifyItem(identifyItemsVar - 1, highlight) | |
" | |
} | |
button | |
{ | |
area 119 554 201 44 | |
bam GUIOSTUM | |
text "IDENTIFY_BUTTON" | |
text style "button" | |
clickable lua "storeScreen:IsIdentifyItemButtonClickable() and storeScreen:GetIdentifyCost() <= game:GetPartyGold()" | |
action | |
" | |
local keys = {} | |
for k,v in pairs(store.identifyItems) do | |
if v.highlight == 1 then | |
table.insert(keys, k) | |
end | |
end | |
storeScreen:OnIdentifyItemButtonClick() | |
for k,v in pairs(keys) do | |
local item = store.identifyItems[v].item | |
local str = '^0xFF000080' .. item.name .. '^-\n' .. item.description | |
identifyText = trim(identifyText .. '\n\n' .. str) | |
end | |
" | |
} | |
text | |
{ | |
area 480 182 313 364 | |
text lua "dwFilterKitDesc(identifyText)" | |
text style "normal_parchment" | |
scrollbar 'GUISBR' | |
} | |
} | |
` | |
function getDonationFrame() | |
if(store.hasDonated ~= nil and store.hasDonated == 1) then | |
return 1 | |
else | |
return 0 | |
end | |
end | |
function isStorePlusMinusButtonClickable(minus) | |
local amt = tonumber(storeDonateAmountEdit) or 0 | |
if minus then return amt > 0 end | |
return amt < game:GetPartyGold() | |
end | |
function storePlusMinusButtonClick(minus) | |
local amt = tonumber(storeDonateAmountEdit) or 0 | |
local delta = 1 | |
if minus then delta = -1 end | |
storeDonateAmountEdit = amt + delta | |
end | |
storeDonateAmountEdit = 0 --no longer used in ui, but the engine needs it. | |
` | |
menu | |
{ | |
name 'STORE_DONATE' | |
align center center | |
offset 0 -48 | |
ignoreEsc | |
onOpen | |
" | |
storeScreen:UpdateDonatePanel() | |
store.donateText = '' | |
" | |
label | |
{ | |
area 0 0 864 614 | |
mosaic GUISTDOB | |
} | |
label | |
{ | |
area 48 6 768 52 | |
text "DONATE_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 277 68 310 26 | |
text lua "Infinity_FetchString(storeScreen:GetStoreName())" | |
text style "label" | |
} | |
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 102 48 | |
var storeDonateAmountEdit | |
text style "edit" | |
text align right 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 288 482 45 42 | |
clickable lua "isStorePlusMinusButtonClickable(not reverseButtonPosition)" | |
sequence lua "reverseButtonPosition and 0 or 4" | |
action | |
" | |
storePlusMinusButtonClick(not reverseButtonPosition) | |
" | |
actionHold | |
" | |
storePlusMinusButtonClick(not reverseButtonPosition) | |
" | |
} | |
button | |
{ | |
bam GUIOSW | |
area 244 482 45 42 | |
clickable lua "isStorePlusMinusButtonClickable(reverseButtonPosition)" | |
sequence lua "reverseButtonPosition and 1 or 3" | |
action | |
" | |
storePlusMinusButtonClick(reverseButtonPosition) | |
" | |
actionHold | |
" | |
storePlusMinusButtonClick(reverseButtonPosition) | |
" | |
} | |
button | |
{ | |
area 119 537 201 44 | |
bam GUIOSTUM | |
text "DONATE_BUTTON" | |
text style "button" | |
clickable lua "storeScreen:IsDonateButtonClickable()" | |
action | |
" | |
storeScreen:OnDonateButtonClick() | |
" | |
} | |
label | |
{ | |
area 274 103 313 31 | |
text lua "game:GetPartyGold()" | |
text style "gold" | |
} | |
text | |
{ | |
area 480 182 313 364 | |
text lua "store.donateText" | |
text style "normal_parchment" | |
scrollbar 'GUISBR' | |
} | |
} | |
` | |
function storeRest() | |
storeScreen:RestParty() | |
end | |
` | |
menu | |
{ | |
name 'STORE_ROOMS' | |
align center center | |
offset 0 -48 | |
ignoreEsc | |
onOpen | |
" | |
storeScreen:SetRoomType(0) | |
storeScreen:UpdateRentRoomPanel() | |
store.roomText = '' | |
" | |
label | |
{ | |
area 0 0 864 614 | |
mosaic GUISTROB | |
} | |
label | |
{ | |
area 48 6 768 52 | |
text "ROOMS_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 277 68 310 26 | |
text lua "Infinity_FetchString(storeScreen:GetStoreName())" | |
text style "label" | |
} | |
label | |
{ | |
area 274 103 313 31 | |
text lua "game:GetPartyGold()" | |
text style "gold" | |
} | |
button | |
{ | |
area 36 144 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 31 320 201 44 | |
bam GUIOSTUM | |
text "PEASANT_BUTTON" | |
text style "button" | |
glow lua "storeScreen:GetRoomType() == 1" | |
clickable lua "storeScreen:IsRoomTypeClickable(1)" | |
action | |
" | |
storeScreen:SetRoomType(1) | |
" | |
} | |
button | |
{ | |
area 385 144 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 385 320 201 44 | |
bam GUIOSTUM | |
text "MERCHANT_BUTTON" | |
text style "button" | |
glow lua "storeScreen:GetRoomType() == 2" | |
clickable lua "storeScreen:IsRoomTypeClickable(2)" | |
action | |
" | |
storeScreen:SetRoomType(2) | |
" | |
} | |
button | |
{ | |
area 31 382 245 161 | |
bam INNROOMS | |
sequence 2 | |
clickable lua "storeScreen:IsRoomTypeClickable(3)" | |
frame 0 | |
action | |
" | |
storeScreen:SetRoomType(3) | |
selectedRoom = Infinity_FindUIItemByName('BUTTON_room_noble') | |
" | |
} | |
button | |
{ | |
name "BUTTON_room_noble" | |
area 31 558 201 44 | |
bam GUIOSTUM | |
text "NOBLE_BUTTON" | |
text style "button" | |
glow lua "storeScreen:GetRoomType() == 3" | |
clickable lua "storeScreen:IsRoomTypeClickable(3)" | |
action | |
" | |
storeScreen:SetRoomType(3) | |
" | |
} | |
button | |
{ | |
area 385 382 245 161 | |
bam INNROOMS | |
sequence 3 | |
clickable lua "storeScreen:IsRoomTypeClickable(4)" | |
action | |
" | |
storeScreen:SetRoomType(4) | |
selectedRoom = Infinity_FindUIItemByName('BUTTON_room_royal') | |
" | |
} | |
button | |
{ | |
name "BUTTON_room_royal" | |
area 378 558 201 44 | |
bam GUIOSTUM | |
text "ROYAL_BUTTON" | |
text style "button" | |
glow lua "storeScreen:GetRoomType() == 4" | |
clickable lua "storeScreen:IsRoomTypeClickable(4)" | |
action | |
" | |
storeScreen:SetRoomType(4) | |
" | |
} | |
label | |
{ | |
area 650 482 70 40 | |
text "COST_LABEL" | |
text style "label" | |
} | |
text | |
{ | |
area 662 154 168 294 | |
text lua "store.roomText" | |
text style "normal" | |
} | |
label | |
{ | |
area 720 482 120 40 | |
text lua "storeScreen:GetRoomCost()" | |
text style "gold" | |
} | |
button | |
{ | |
area 643 532 201 44 | |
bam GUIOSTUM | |
text "RENT_BUTTON" | |
text style "button" | |
clickable lua "storeScreen:GetRoomType() > 0 and storeScreen:GetRoomCost() <= game:GetPartyGold()" | |
action | |
" | |
storeScreen:OnRentRoomButtonClick() | |
" | |
} | |
} | |
menu | |
{ | |
name 'STORE_HEALING' | |
align center center | |
offset 0 -48 | |
ignoreEsc | |
onOpen | |
" | |
storeScreen:UpdateBuySpellPanel() | |
" | |
label | |
{ | |
area 0 0 864 614 | |
mosaic GUISTIDB | |
} | |
label | |
{ | |
area 48 6 768 52 | |
text "HEALING_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 277 68 310 26 | |
text lua "Infinity_FetchString(storeScreen:GetStoreName())" | |
text style "label" | |
} | |
label | |
{ | |
area 274 103 313 31 | |
text lua "game:GetPartyGold()" | |
text style "gold" | |
} | |
label | |
{ | |
area 68 526 146 23 | |
text "COST_LABEL" | |
text style "label" | |
align right center | |
} | |
label | |
{ | |
area 260 526 108 23 | |
text lua "storeScreen:GetSpellCost()" | |
text style "normal" | |
align right center | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 318 62 | |
mosaic GUISTBK3 | |
respectClipping | |
} | |
label | |
{ | |
area 3 0 52 62 | |
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 62 | |
text lua "Infinity_FetchString(store.healingSpells[rowNumber].name)" | |
text style "normal" | |
text align left center | |
} | |
label | |
{ | |
area 260 0 54 62 | |
text style "gold" | |
text align center center | |
text lua "store.healingSpells[rowNumber].value" | |
} | |
label | |
{ | |
enabled "store.healingSpells[rowNumber].valid == 0 or store.healingSpells[rowNumber].value > game:GetPartyGold()" | |
area 0 2 312 58 | |
rectangle 1 | |
rectangle opacity 150 | |
} | |
} | |
area 62 138 350 384 | |
hidehighlight | |
rowheight 62 | |
table "store.healingSpells" | |
var "healingSpellsVar" | |
scrollbar 'GUISCRC' | |
action | |
" | |
local spell = store.healingSpells[healingSpellsVar] | |
if spell.highlight == 1 then | |
storeScreen:SelectSpellItem(healingSpellsVar - 1, false) | |
store.spellText = '' | |
elseif spell.valid == 1 and spell.value <= game:GetPartyGold() then | |
storeScreen:SelectSpellItem(healingSpellsVar - 1, true) | |
if store.spell[healingSpellsVar].valid == 0 then | |
storeScreen:SelectSpellItem(healingSpellsVar - 1, false) | |
store.spellText = '' | |
end | |
end | |
" | |
actionAlt | |
" | |
local spell = store.healingSpells[healingSpellsVar] | |
popupDetails(16189, spell.name, spell.description, spell.icon) | |
" | |
} | |
button | |
{ | |
area 119 554 201 44 | |
bam GUIOSTUM | |
text "BUY_BUTTON" | |
text style "button" | |
clickable lua "storeScreen:GetSpellCost() > 0" | |
action | |
" | |
storeScreen:OnBuySpellButtonClick() | |
store.spellText = '' | |
" | |
} | |
text | |
{ | |
area 480 182 313 364 | |
text lua "store.spellText" | |
text style "normal_parchment" | |
scrollbar 'GUISBR' | |
} | |
} | |
` | |
selectedDrinks = 0 | |
function getDrinkSlotHighlight() | |
if rowNumber == selectedDrinks then | |
return 2 | |
end | |
return 0 | |
end | |
` | |
menu | |
{ | |
name 'STORE_DRINKS' | |
align center center | |
offset 0 -48 | |
ignoreEsc | |
onOpen | |
" | |
storeScreen:UpdateBuyDrinksPanel() | |
store.drinkText = '' | |
" | |
label | |
{ | |
area 0 0 864 614 | |
mosaic GUISTIDB | |
} | |
label | |
{ | |
area 48 6 768 52 | |
text "DRINKS_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 277 68 310 26 | |
text lua "Infinity_FetchString(storeScreen:GetStoreName())" | |
text style "label" | |
} | |
label | |
{ | |
area 274 103 313 31 | |
text lua "game:GetPartyGold()" | |
text style "gold" | |
} | |
label | |
{ | |
area 68 526 146 23 | |
text "COST_LABEL" | |
text style "label" | |
align right center | |
} | |
label | |
{ | |
area 260 526 108 23 | |
enabled "store.drinks[selectedDrinks] ~= nil" | |
text lua "store.drinks[selectedDrinks].value" | |
text style "normal" | |
align right center | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 318 62 | |
mosaic GUISTBK3 | |
respectClipping | |
} | |
label | |
{ | |
area 3 0 52 62 | |
bam STONSLOT | |
frame lua "getDrinkSlotHighlight()" | |
align center center | |
} | |
label | |
{ | |
area 3 5 52 52 | |
mosaic lua "'TVRNDRK' .. (rowNumber % 3)" | |
align center center | |
} | |
label | |
{ | |
area 68 0 200 62 | |
text lua "store.drinks[rowNumber].name" | |
text style "normal" | |
text align left center | |
} | |
label | |
{ | |
area 260 0 54 62 | |
text lua "store.drinks[rowNumber].value" | |
text style "gold" | |
text align center center | |
} | |
label | |
{ | |
enabled "store.drinks[rowNumber].valid == 0 or store.drinks[rowNumber].value > game:GetPartyGold()" | |
area 0 2 312 58 | |
rectangle 1 | |
rectangle opacity 150 | |
} | |
} | |
area 62 138 350 384 | |
hidehighlight | |
rowheight 62 | |
table "store.drinks" | |
var "storeDrinksVar" | |
scrollbar 'GUISCRC' | |
action | |
" | |
local drink = store.drinks[storeDrinksVar] | |
if selectedDrinks == storeDrinksVar then | |
selectedDrinks = 0 | |
elseif drink.valid == 1 and drink.value <= game:GetPartyGold() then | |
selectedDrinks = storeDrinksVar | |
end | |
" | |
} | |
button | |
{ | |
area 119 554 201 44 | |
bam GUIOSTUM | |
text "DRINK_LABEL" | |
text style "button" | |
clickable lua "selectedDrinks ~= 0 and store.drinks[selectedDrinks].value <= game:GetPartyGold()" | |
action | |
" | |
storeScreen:OnBuyDrinkButtonClick(selectedDrinks - 1) | |
if store.drinks[selectedDrinks].value > game:GetPartyGold() then | |
selectedDrinks = 0 | |
end | |
" | |
} | |
label | |
{ | |
area 484 184 132 90 | |
mosaic lua "store.qualityIcon" | |
} | |
label | |
{ | |
area 616 184 183 90 | |
text "RUMORS_LABEL" | |
text style "label_parchment" | |
} | |
text | |
{ | |
area 484 274 315 273 | |
text lua "store.drinkText" | |
text style "normal_parchment" | |
scrollbar 'GUISBR' | |
} | |
} | |
` | |
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 | |
offset 0 307 | |
ignoreEsc | |
onOpen | |
" | |
identifyText = '' | |
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() | |
" | |
label | |
{ | |
area 0 0 864 96 | |
mosaic GUISTBBB | |
} | |
label | |
{ | |
area 66 18 63 66 | |
mosaic lua "store.icon" | |
} | |
button | |
{ | |
area 464 38 234 44 | |
bam GUIOSTUR | |
text "DONE_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
storeScreen:OnMainDoneButtonClick() | |
" | |
} | |
button | |
{ | |
name 'BUTTON_storechooser_0' | |
area 145 18 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 217 18 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 289 18 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 361 18 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 | |
` | |
menu | |
{ | |
name "WORLD_DEATH" | |
align center center | |
ignoreEsc | |
modal | |
onopen | |
" | |
Infinity_PopMenu('WORLD_MESSAGES') | |
Infinity_PushMenu('WORLD_MESSAGES') | |
" | |
label | |
{ | |
area 0 0 677 234 | |
mosaic GUIERR6 | |
} | |
label | |
{ | |
area 34 10 606 128 | |
text lua "worldDeathText()" | |
text style "label" | |
text align center center | |
} | |
button | |
{ | |
area 94 170 234 44 | |
bam GUIOSTUL | |
text "LOAD_BUTTON" | |
text style "button" | |
clickable lua "worldDeathLoadClickable()" | |
action | |
" | |
Infinity_PopMenu('WORLD_DEATH') | |
worldScreen:OnDeathLoad() | |
" | |
} | |
button | |
{ | |
area 364 170 234 44 | |
bam GUIOSTUR | |
text style "button" | |
text lua "worldDeathQuitText()" | |
clickable lua "worldDeathQuitClickable()" | |
action | |
" | |
Infinity_PopMenu('WORLD_DEATH') | |
worldScreen:OnDeathQuit() | |
" | |
} | |
} | |
` | |
actionBarTooltip = {} | |
groundItemsButtonToggle = 0 | |
function getActionBarTooltip(idx) | |
if actionBarTooltip[idx]:find(" : .") ~= nil then | |
return actionBarTooltip[idx] | |
end | |
return "" | |
end | |
` | |
menu | |
{ | |
enabled "showJournal == 0" | |
name "WORLD_ACTIONBAR" | |
align center bottom | |
onOpen | |
" | |
dwFindPortraitMatch() | |
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 700 54 | |
mosaic GUIBAR | |
} | |
button | |
{ | |
area 0 0 52 52 | |
align center center | |
bam ROUNDBUT | |
toggle groundItemsButtonToggle | |
tooltip lua "Infinity_FetchString(engine_mode == 0 and 32217 or 99897)" | |
action | |
" | |
if(groundItemsButtonToggle == 1) then | |
worldScreen:StartGroundItems() | |
else | |
worldScreen:StopGroundItems() | |
end | |
" | |
} | |
button | |
{ | |
area 54 0 52 52 | |
actionBar 0 | |
enabled "buttonArray:GetButtonEnabled(0) and not dwHideButton(0)" | |
tooltip lua "getActionBarTooltip(0)" | |
action "buttonArray:OnLButtonPressed(0)" | |
actionAlt "buttonArray:OnRButtonPressed(0)" | |
} | |
button | |
{ | |
area 108 0 52 52 | |
actionBar 1 | |
enabled "buttonArray:GetButtonEnabled(1) and not dwHideButton(1)" | |
tooltip lua "getActionBarTooltip(1)" | |
action "buttonArray:OnLButtonPressed(1)" | |
actionAlt "buttonArray:OnRButtonPressed(1)" | |
} | |
button | |
{ | |
area 162 0 52 52 | |
actionBar 2 | |
enabled "buttonArray:GetButtonEnabled(2) and not dwHideButton(2)" | |
tooltip lua "getActionBarTooltip(2)" | |
action "buttonArray:OnLButtonPressed(2)" | |
actionAlt "buttonArray:OnRButtonPressed(2)" | |
} | |
button | |
{ | |
area 216 0 52 52 | |
actionBar 3 | |
enabled "buttonArray:GetButtonEnabled(3) and not dwHideButton(3)" | |
tooltip lua "getActionBarTooltip(3)" | |
action "buttonArray:OnLButtonPressed(3)" | |
actionAlt "buttonArray:OnRButtonPressed(3)" | |
} | |
button | |
{ | |
area 270 0 52 52 | |
actionBar 4 | |
enabled "buttonArray:GetButtonEnabled(4) and not dwHideButton(4)" | |
tooltip lua "getActionBarTooltip(4)" | |
action "buttonArray:OnLButtonPressed(4)" | |
actionAlt "buttonArray:OnRButtonPressed(4)" | |
} | |
button | |
{ | |
area 324 0 52 52 | |
actionBar 5 | |
enabled "buttonArray:GetButtonEnabled(5) and not dwHideButton(5)" | |
tooltip lua "getActionBarTooltip(5)" | |
action "buttonArray:OnLButtonPressed(5)" | |
actionAlt "buttonArray:OnRButtonPressed(5)" | |
} | |
button | |
{ | |
area 378 0 52 52 | |
actionBar 6 | |
enabled "buttonArray:GetButtonEnabled(6) and not dwHideButton(6)" | |
tooltip lua "getActionBarTooltip(6)" | |
action "buttonArray:OnLButtonPressed(6)" | |
actionAlt "buttonArray:OnRButtonPressed(6)" | |
} | |
button | |
{ | |
area 432 0 52 52 | |
actionBar 7 | |
enabled "buttonArray:GetButtonEnabled(7) and not dwHideButton(7)" | |
tooltip lua "getActionBarTooltip(7)" | |
action "buttonArray:OnLButtonPressed(7)" | |
actionAlt "buttonArray:OnRButtonPressed(7)" | |
} | |
button | |
{ | |
area 486 0 52 52 | |
actionBar 8 | |
enabled "buttonArray:GetButtonEnabled(8) and not dwHideButton(8)" | |
tooltip lua "getActionBarTooltip(8)" | |
action "buttonArray:OnLButtonPressed(8)" | |
actionAlt "buttonArray:OnRButtonPressed(8)" | |
} | |
button | |
{ | |
area 540 0 52 52 | |
actionBar 9 | |
enabled "buttonArray:GetButtonEnabled(9) and not dwHideButton(9)" | |
tooltip lua "getActionBarTooltip(9)" | |
action "buttonArray:OnLButtonPressed(9)" | |
actionAlt "buttonArray:OnRButtonPressed(9)" | |
} | |
button | |
{ | |
area 594 0 52 52 | |
actionBar 10 | |
enabled "buttonArray:GetButtonEnabled(10) and not dwHideButton(10)" | |
tooltip lua "getActionBarTooltip(10)" | |
action "buttonArray:OnLButtonPressed(10)" | |
actionAlt "buttonArray:OnRButtonPressed(10)" | |
} | |
button | |
{ | |
area 648 0 52 52 | |
actionBar 11 | |
enabled "buttonArray:GetButtonEnabled(11) and not dwHideButton(11)" | |
tooltip lua "getActionBarTooltip(11)" | |
action "buttonArray:OnLButtonPressed(11)" | |
actionAlt "buttonArray:OnRButtonPressed(11)" | |
} | |
} | |
` | |
loot = | |
{ | |
containerItems = {}, | |
groupItems = {}, | |
groundItems = {} | |
} | |
forceLootScroll = false | |
forceItemScroll = false | |
lootPage = 0 | |
itemPage = 0 | |
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 and worldScreen:ContainerScrollEnabled(-1) then | |
worldScreen:OnContainerScroll(-1) | |
forceLootScroll = true | |
lootPage = math.max(lootPage - 1, 0) | |
elseif scrollDirection < 0 and worldScreen:ContainerScrollEnabled(1) then | |
worldScreen:OnContainerScroll(1) | |
forceLootScroll = true | |
lootPage = lootPage + 1 | |
end | |
end | |
function lootScroll(top, height, contentHeight) | |
if forceLootScroll then | |
forceLootScroll = false | |
return -lootPage * 106 | |
end | |
local page = math.floor((-top + 53) / 106) | |
if page ~= lootPage then | |
worldScreen:OnContainerScroll(page - lootPage) | |
lootPage = page | |
end | |
return nil | |
end | |
function scrollGroupItems() | |
if scrollDirection > 0 and itemPage > 0 then | |
worldScreen:OnGroupScroll(-1) | |
forceItemScroll = true | |
itemPage = itemPage - 1 | |
elseif scrollDirection < 0 and itemPage < 6 then | |
worldScreen:OnGroupScroll(1) | |
forceItemScroll = true | |
itemPage = itemPage + 1 | |
end | |
end | |
function groupScroll(top, height, contentHeight) | |
if forceItemScroll then | |
forceItemScroll = false | |
return -itemPage * 106 | |
end | |
local page = math.floor((-top + 53) / 106) | |
if page ~= itemPage then | |
worldScreen:OnGroupScroll(page - itemPage) | |
itemPage = page | |
end | |
return nil | |
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 | |
ignoreesc | |
onOpen | |
" | |
lootPage = 0 | |
itemPage = 0 | |
" | |
label | |
{ | |
area 0 0 653 130 | |
mosaic gmpwmsg0 | |
} | |
label | |
{ | |
area 16 10 83 100 | |
bam lua "loot.containerIcon" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 179 106 | |
} | |
} | |
area 108 8 179 106 | |
hidehighlight | |
rowheight 106 | |
table "makeTable(20)" | |
scrollbar 'GUISCRC' | |
scrollbar func "lootScroll" | |
} | |
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()" | |
} | |
label | |
{ | |
area 313 12 68 100 | |
encumbrance | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 125 106 | |
} | |
} | |
area 411 8 125 106 | |
hidehighlight | |
rowheight 106 | |
table "makeTable(7)" | |
scrollbar 'GUISCRC' | |
scrollbar func "groupScroll" | |
} | |
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()" | |
} | |
label | |
{ | |
area 560 20 78 50 | |
bam GUIGOLD | |
} | |
label | |
{ | |
area 560 76 78 28 | |
text lua "game:GetPartyGold()" | |
text style "gold" | |
} | |
button | |
{ | |
area 40 80 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) | |
mouseOverQuicklootContainer = nil | |
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 | |
function setQuickLootOffset() | |
local x,y,w,h = Infinity_GetArea('messagesRect') | |
local offset = h + 78 | |
Infinity_SetOffset('WORLD_QUICKLOOT', 0, -offset) | |
end | |
` | |
menu | |
{ | |
enabled "showJournal == 0" | |
name 'WORLD_QUICKLOOT' | |
align center bottom | |
offset 0 -192 | |
ignoreEsc | |
onOpen | |
" | |
setQuickLootOffset() | |
" | |
button | |
{ | |
area 0 0 34 52 | |
bam GUIBTACT | |
frame 44 | |
enabled "worldScreen:GroundScrollEnabled(-1)" | |
action | |
" | |
worldScreen:OnGroundScroll(-1) | |
" | |
} | |
button | |
{ | |
area 576 0 34 52 | |
bam GUIBTACT | |
frame 42 | |
enabled "worldScreen:GroundScrollEnabled(1)" | |
action | |
" | |
worldScreen:OnGroundScroll(1) | |
" | |
} | |
button | |
{ | |
area 36 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(0)" | |
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 90 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(1)" | |
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 144 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(2)" | |
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 198 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(3)" | |
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 252 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(4)" | |
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 306 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(5)" | |
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 360 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(6)" | |
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 414 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(7)" | |
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 468 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(8)" | |
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 522 0 52 52 | |
bam STONSLOT | |
enabled "getSlotContainerId(9)" | |
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 0 725 150 | |
rectangle 4 | |
} | |
label | |
{ | |
area 20 14 372 26 | |
text "REMOVE_MEMBERS_LABEL" | |
text style "label" | |
align left center | |
} | |
button | |
{ | |
area 20 40 61 91 | |
clickable lua "worldScreen:GetPickPartyPortrait(0) ~= ''" | |
bitmap lua "worldScreen:GetPickPartyPortrait(0)" | |
glow lua "worldScreen:GetPickPartyCharacterId(0) == worldScreen:GetPickPartyRemoveCharacterId()" | |
action | |
" | |
worldScreen:OnPickPartyPortraitButtonClick(0) | |
" | |
} | |
button | |
{ | |
area 82 40 61 91 | |
clickable lua "worldScreen:GetPickPartyPortrait(1) ~= ''" | |
bitmap lua "worldScreen:GetPickPartyPortrait(1)" | |
glow lua "worldScreen:GetPickPartyCharacterId(1) == worldScreen:GetPickPartyRemoveCharacterId()" | |
action | |
" | |
worldScreen:OnPickPartyPortraitButtonClick(1) | |
" | |
} | |
button | |
{ | |
area 144 40 61 91 | |
clickable lua "worldScreen:GetPickPartyPortrait(2) ~= ''" | |
bitmap lua "worldScreen:GetPickPartyPortrait(2)" | |
glow lua "worldScreen:GetPickPartyCharacterId(2) == worldScreen:GetPickPartyRemoveCharacterId()" | |
action | |
" | |
worldScreen:OnPickPartyPortraitButtonClick(2) | |
" | |
} | |
button | |
{ | |
area 206 40 61 91 | |
clickable lua "worldScreen:GetPickPartyPortrait(3) ~= ''" | |
bitmap lua "worldScreen:GetPickPartyPortrait(3)" | |
glow lua "worldScreen:GetPickPartyCharacterId(3) == worldScreen:GetPickPartyRemoveCharacterId()" | |
action | |
" | |
worldScreen:OnPickPartyPortraitButtonClick(3) | |
" | |
} | |
button | |
{ | |
area 268 40 61 91 | |
clickable lua "worldScreen:GetPickPartyPortrait(4) ~= ''" | |
bitmap lua "worldScreen:GetPickPartyPortrait(4)" | |
glow lua "worldScreen:GetPickPartyCharacterId(4) == worldScreen:GetPickPartyRemoveCharacterId()" | |
action | |
" | |
worldScreen:OnPickPartyPortraitButtonClick(4) | |
" | |
} | |
button | |
{ | |
area 330 40 61 91 | |
clickable lua "worldScreen:GetPickPartyPortrait(5) ~= ''" | |
bitmap lua "worldScreen:GetPickPartyPortrait(5)" | |
glow lua "worldScreen:GetPickPartyCharacterId(5) == worldScreen:GetPickPartyRemoveCharacterId()" | |
action | |
" | |
worldScreen:OnPickPartyPortraitButtonClick(5) | |
" | |
} | |
button | |
{ | |
area 392 40 61 91 | |
clickable lua "worldScreen:GetPickPartyPortrait(6) ~= ''" | |
bitmap lua "worldScreen:GetPickPartyPortrait(6)" | |
glow lua "worldScreen:GetPickPartyCharacterId(6) == worldScreen:GetPickPartyRemoveCharacterId()" | |
action | |
" | |
worldScreen:OnPickPartyPortraitButtonClick(6) | |
" | |
} | |
label | |
{ | |
area 392 14 61 26 | |
text lua "game:GetCharacterOverflowCount()" | |
text style "normal" | |
align center center | |
} | |
button | |
{ | |
area 480 34 201 44 | |
bam GUIOSTUM | |
text "REMOVE_BUTTON" | |
text style "button" | |
clickable lua "worldScreen:IsPickPartyRemoveButtonClickable()" | |
action | |
" | |
popup2Button(17518, 'REMOVE_BUTTON', function() worldScreen:RemoveCharacterFromParty() end) | |
" | |
} | |
button | |
{ | |
area 480 78 201 44 | |
bam GUIOSTLM | |
text "DONE_BUTTON" | |
text style "button" | |
clickable lua "worldScreen:IsPickPartyDoneButtonClickable()" | |
on esc | |
action | |
" | |
worldScreen:OnPickPartyDoneButtonClick() | |
" | |
} | |
} | |
` | |
currentPage = 0 | |
currentSave = 0 | |
forceScroll = false | |
function onScroll(nbPage) | |
if scrollDirection > 0 and currentPage > 0 then | |
currentPage = currentPage - 1 | |
forceScroll = true | |
elseif scrollDirection < 0 and currentPage < nbPage then | |
currentPage = currentPage + 1 | |
forceScroll = true | |
end | |
end | |
function scrollFunc(top, height, contentHeight) | |
if forceScroll then | |
forceScroll = false | |
return -currentPage * 134 | |
end | |
currentPage = math.floor((-top + 67) / 134) | |
return nil | |
end | |
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 | |
` | |
menu | |
{ | |
name 'LOAD' | |
align center center | |
ignoreEsc | |
onOpen | |
" | |
currentPage = 0 | |
" | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic GUISRSVB | |
} | |
label | |
{ | |
area 162 6 700 50 | |
text lua "t(gameSaves.isImporting ~= 1 and 'LOAD_TITLE' or 'IMPORT_TITLE')" | |
text style "title" | |
text point 26 | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasScreenShot" | |
area 18 136 170 128 | |
bitmap res "gameSaves.files[currentPage + 1].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 1] ~= nil" | |
area 222 138 450 26 | |
text lua "gameSaves.files[currentPage + 1].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 1] ~= nil" | |
area 222 170 450 26 | |
text lua "gameSaves.files[currentPage + 1].chapter .. ': ' .. gameSaves.files[currentPage + 1].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait0" | |
area 316 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait1" | |
area 377 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait2" | |
area 439 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait3" | |
area 500 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait4" | |
area 564 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait5" | |
area 626 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait5" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasScreenShot" | |
area 18 280 170 128 | |
bitmap res "gameSaves.files[currentPage + 2].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 2] ~= nil" | |
area 222 282 450 26 | |
text lua "gameSaves.files[currentPage + 2].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 2] ~= nil" | |
area 222 314 450 26 | |
text lua "gameSaves.files[currentPage + 2].chapter .. ': ' .. gameSaves.files[currentPage + 2].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait0" | |
area 316 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait1" | |
area 377 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait2" | |
area 439 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait3" | |
area 500 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait4" | |
area 564 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait5" | |
area 626 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait5" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasScreenShot" | |
area 18 425 170 128 | |
bitmap res "gameSaves.files[currentPage + 3].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 3] ~= nil" | |
area 222 427 450 26 | |
text lua "gameSaves.files[currentPage + 3].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 3] ~= nil" | |
area 222 459 450 26 | |
text lua "gameSaves.files[currentPage + 3].chapter .. ': ' .. gameSaves.files[currentPage + 3].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait0" | |
area 316 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait1" | |
area 377 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait2" | |
area 439 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait3" | |
area 500 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait4" | |
area 564 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait5" | |
area 626 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait5" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasScreenShot" | |
area 18 569 170 128 | |
bitmap res "gameSaves.files[currentPage + 4].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 4] ~= nil" | |
area 222 571 450 26 | |
text lua "gameSaves.files[currentPage + 4].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 4] ~= nil" | |
area 222 603 450 26 | |
text lua "gameSaves.files[currentPage + 4].chapter .. ': ' .. gameSaves.files[currentPage + 4].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait0" | |
area 316 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait1" | |
area 377 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait2" | |
area 439 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait3" | |
area 500 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait4" | |
area 564 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait5" | |
area 626 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait5" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 0 0 | |
} | |
} | |
area 0 164 1004 536 | |
rowheight 134 | |
hidehighlight | |
table "makeTable(#gameSaves.files)" | |
scrollbar 'GUISCRC' | |
scrollbar func "scrollFunc" | |
} | |
button | |
{ | |
area 712 166 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 1] ~= nil" | |
text lua "t(gameSaves.isImporting ~= 1 and 'LOAD_BUTTON' or 'IMPORT_BUTTON')" | |
text style "button" | |
action | |
" | |
loadScreen:LoadGame(gameSaves.files[currentPage + 1].fileName) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 712 214 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 1] ~= nil" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() loadScreen:DeleteGame(gameSaves.files[currentPage + 1].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 712 310 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 2] ~= nil" | |
text lua "t(gameSaves.isImporting ~= 1 and 'LOAD_BUTTON' or 'IMPORT_BUTTON')" | |
text style "button" | |
action | |
" | |
loadScreen:LoadGame(gameSaves.files[currentPage + 2].fileName) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 712 358 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 2] ~= nil" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() loadScreen:DeleteGame(gameSaves.files[currentPage + 2].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 712 455 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 3] ~= nil" | |
text lua "t(gameSaves.isImporting ~= 1 and 'LOAD_BUTTON' or 'IMPORT_BUTTON')" | |
text style "button" | |
action | |
" | |
loadScreen:LoadGame(gameSaves.files[currentPage + 3].fileName) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 712 503 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 3] ~= nil" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() loadScreen:DeleteGame(gameSaves.files[currentPage + 3].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 712 599 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 4] ~= nil" | |
text lua "t(gameSaves.isImporting ~= 1 and 'LOAD_BUTTON' or 'IMPORT_BUTTON')" | |
text style "button" | |
action | |
" | |
loadScreen:LoadGame(gameSaves.files[currentPage + 4].fileName) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 712 647 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 4] ~= nil" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() loadScreen:DeleteGame(gameSaves.files[currentPage + 4].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 668 712 300 44 | |
bam GUIOSTCL | |
text "BACK_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
loadScreen:OnMainCancelButtonClick() | |
" | |
} | |
} | |
` | |
function makeSaveTable() | |
if gameSaves.newSave == nil then | |
local newSave = {} | |
newSave.slotIndex = #gameSaves.files | |
newSave.slotName = t('NEW_SAVE_LABEL') | |
newSave.chapter = gameSaves.currentGameInfo.chapter | |
newSave.time = gameSaves.currentGameInfo.time | |
table.insert(gameSaves.files, 1, newSave) | |
gameSaves.newSave = true | |
end | |
return makeTable(#gameSaves.files) | |
end | |
` | |
menu | |
{ | |
name 'SAVE' | |
align center center | |
ignoreEsc | |
onOpen | |
" | |
currentPage = 0 | |
" | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic GUISRSVB | |
} | |
label | |
{ | |
area 162 6 700 50 | |
text "SAVE_TITLE" | |
text style "title" | |
text point 26 | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasScreenShot" | |
area 18 136 170 128 | |
bitmap res "gameSaves.files[currentPage + 1].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 1] ~= nil" | |
area 222 138 450 26 | |
text lua "gameSaves.files[currentPage + 1].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 1] ~= nil" | |
area 222 170 450 26 | |
text lua "gameSaves.files[currentPage + 1].chapter .. ': ' .. gameSaves.files[currentPage + 1].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait0" | |
area 316 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait1" | |
area 377 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait2" | |
area 439 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait3" | |
area 500 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait4" | |
area 564 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 1] and gameSaves.files[currentPage + 1].hasPortrait5" | |
area 626 206 30 48 | |
bitmap res "gameSaves.files[currentPage + 1].portrait5" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasScreenShot" | |
area 18 280 170 128 | |
bitmap res "gameSaves.files[currentPage + 2].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 2] ~= nil" | |
area 222 282 450 26 | |
text lua "gameSaves.files[currentPage + 2].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 2] ~= nil" | |
area 222 314 450 26 | |
text lua "gameSaves.files[currentPage + 2].chapter .. ': ' .. gameSaves.files[currentPage + 2].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait0" | |
area 316 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait1" | |
area 377 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait2" | |
area 439 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait3" | |
area 500 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait4" | |
area 564 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 2] and gameSaves.files[currentPage + 2].hasPortrait5" | |
area 626 350 30 48 | |
bitmap res "gameSaves.files[currentPage + 2].portrait5" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasScreenShot" | |
area 18 425 170 128 | |
bitmap res "gameSaves.files[currentPage + 3].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 3] ~= nil" | |
area 222 427 450 26 | |
text lua "gameSaves.files[currentPage + 3].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 3] ~= nil" | |
area 222 459 450 26 | |
text lua "gameSaves.files[currentPage + 3].chapter .. ': ' .. gameSaves.files[currentPage + 3].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait0" | |
area 316 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait1" | |
area 377 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait2" | |
area 439 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait3" | |
area 500 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait4" | |
area 564 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 3] and gameSaves.files[currentPage + 3].hasPortrait5" | |
area 626 495 30 48 | |
bitmap res "gameSaves.files[currentPage + 3].portrait5" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasScreenShot" | |
area 18 569 170 128 | |
bitmap res "gameSaves.files[currentPage + 4].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 4] ~= nil" | |
area 222 571 450 26 | |
text lua "gameSaves.files[currentPage + 4].slotName" | |
text style "label" | |
align left bottom | |
} | |
label | |
{ | |
enabled "gameSaves.files[currentPage + 4] ~= nil" | |
area 222 603 450 26 | |
text lua "gameSaves.files[currentPage + 4].chapter .. ': ' .. gameSaves.files[currentPage + 4].time" | |
text style "label" | |
align left bottom | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait0" | |
area 316 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait1" | |
area 377 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait2" | |
area 439 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait3" | |
area 500 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait4" | |
area 564 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentPage + 4] and gameSaves.files[currentPage + 4].hasPortrait5" | |
area 626 639 30 48 | |
bitmap res "gameSaves.files[currentPage + 4].portrait5" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 0 0 | |
} | |
} | |
area 0 164 1004 536 | |
rowheight 134 | |
hidehighlight | |
table "makeSaveTable()" | |
scrollbar 'GUISCRC' | |
scrollbar func "scrollFunc" | |
} | |
button | |
{ | |
area 708 164 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 1] ~= nil" | |
text "SAVE_BUTTON" | |
text style "button" | |
action | |
" | |
currentSave = currentPage + 1 | |
Infinity_PushMenu('SAVE_NEWSAVE') | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 708 214 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 1] ~= nil and currentPage > 0" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() saveScreen:DeleteGame(gameSaves.files[currentPage + 1].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 708 308 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 2] ~= nil" | |
text "SAVE_BUTTON" | |
text style "button" | |
action | |
" | |
currentSave = currentPage + 2 | |
Infinity_PushMenu('SAVE_NEWSAVE') | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 708 358 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 2] ~= nil" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() saveScreen:DeleteGame(gameSaves.files[currentPage + 2].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 708 453 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 3] ~= nil" | |
text "SAVE_BUTTON" | |
text style "button" | |
action | |
" | |
currentSave = currentPage + 3 | |
Infinity_PushMenu('SAVE_NEWSAVE') | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 708 503 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 3] ~= nil" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() saveScreen:DeleteGame(gameSaves.files[currentPage + 3].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 708 597 234 44 | |
bam GUIOSTUR | |
clickable lua "gameSaves.files[currentPage + 4] ~= nil" | |
text "SAVE_BUTTON" | |
text style "button" | |
action | |
" | |
currentSave = currentPage + 4 | |
Infinity_PushMenu('SAVE_NEWSAVE') | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 708 647 234 44 | |
bam GUIOSTLR | |
clickable lua "gameSaves.files[currentPage + 4] ~= nil" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
popup2Button(15305, 'DELETE_BUTTON', | |
function() saveScreen:DeleteGame(gameSaves.files[currentPage + 4].slotIndex) end) | |
" | |
actionScroll | |
" | |
onScroll(length(gameSaves.files) - 4) | |
" | |
} | |
button | |
{ | |
area 666 714 300 44 | |
bam GUIOSTCL | |
text "BACK_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
saveScreen:OnMainCancelButtonClick() | |
" | |
} | |
} | |
` | |
newSaveName = '' | |
function completeSave() | |
Infinity_PopMenu('SAVE_NEWSAVE') | |
saveScreen:SaveGame(gameSaves.files[currentSave].slotIndex,newSaveName) | |
end | |
` | |
menu | |
{ | |
name 'SAVE_NEWSAVE' | |
align center center | |
modal | |
onOpen | |
" | |
if currentSave ~= 1 then | |
newSaveName = gameSaves.files[currentSave].slotName | |
else | |
newSaveName = '' | |
Infinity_FocusTextEdit('newSaveNameArea') | |
end | |
" | |
label | |
{ | |
area 0 0 786 341 | |
mosaic GUISRRQB | |
} | |
label | |
{ | |
area 42 20 722 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('') | |
completeSave() | |
return -1 | |
end | |
return 1 | |
" | |
} | |
label | |
{ | |
area 252 110 476 34 | |
text lua "gameSaves.currentGameInfo.chapter .. ' ' .. gameSaves.currentGameInfo.time" | |
text style "label" | |
text align left center | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentSave].hasScreenShot" | |
area 47 83 170 128 | |
bitmap res "gameSaves.files[currentSave].screenshot" | |
bitmap area 10 0 170 128 | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentSave].hasPortrait0" | |
area 356 150 30 48 | |
bitmap res "gameSaves.files[currentSave].portrait0" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentSave].hasPortrait1" | |
area 418 150 30 48 | |
bitmap res "gameSaves.files[currentSave].portrait1" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentSave].hasPortrait2" | |
area 482 150 30 48 | |
bitmap res "gameSaves.files[currentSave].portrait2" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentSave].hasPortrait3" | |
area 544 150 30 48 | |
bitmap res "gameSaves.files[currentSave].portrait3" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentSave].hasPortrait4" | |
area 608 150 30 48 | |
bitmap res "gameSaves.files[currentSave].portrait4" | |
} | |
button | |
{ | |
enabled "gameSaves.files[currentSave].hasPortrait5" | |
area 670 150 30 48 | |
bitmap res "gameSaves.files[currentSave].portrait5" | |
} | |
button | |
{ | |
area 386 226 300 44 | |
bam GUIOSTCL | |
text lua "t(currentSave == 1 and 'SAVE_BUTTON' or 'OVERWRITE_BUTTON')" | |
text style "button" | |
action | |
" | |
completeSave() | |
" | |
} | |
button | |
{ | |
area 386 288 300 44 | |
bam GUIOSTCL | |
text "CANCEL_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
Infinity_PopMenu('SAVE_NEWSAVE') | |
" | |
} | |
} | |
` | |
worldMessageBoxText = "" | |
function dragMessagesY(newY) | |
local x,y,w,h = Infinity_GetArea('messagesRect') | |
local hNew = h - newY | |
--lower bound on height, sliced rects can't get too small and we don't want to make the message box invisible. | |
--also don't go too high because it looks bad. | |
if hNew > 50 and hNew < 450 then | |
adjustItemGroup({"messagesHandleY"},0,newY,0,0) | |
adjustItemGroup({"messagesRect","worldMessageBox"},0,newY,0,-newY) | |
end | |
setQuickLootOffset() | |
chatboxScrollToBottom = 1 | |
end | |
function clean(str) | |
-- remove extra space in front of innate abilities | |
str = str:gsub('(%^%-: %^0x%x%x%x%x%x%x%x%x) ', '%1') | |
-- remove empty name | |
str = str:gsub('%^0x%x%x%x%x%x%x%x%x %^%-: ', '') | |
return str | |
end | |
` | |
menu | |
{ | |
enabled "showJournal == 0" | |
name 'WORLD_MESSAGES' | |
offset 0 -66 | |
align center bottom | |
ignoreEsc | |
onOpen | |
" | |
chatboxScrollToBottom = 1 | |
" | |
label | |
{ | |
name 'messagesRect' | |
area 0 0 840 142 | |
mosaic box5 | |
} | |
label | |
{ | |
area 0 142 840 4 | |
mosaic box5B | |
} | |
button | |
{ | |
on pageup | |
action | |
" | |
dragMessagesY(-20) | |
" | |
} | |
button | |
{ | |
on pagedown | |
action | |
" | |
dragMessagesY(20) | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 816 -1 | |
text lua "clean(combatLog[rowNumber])" | |
text style "normal" | |
} | |
} | |
name "worldMessageBox" | |
area 12 8 816 130 | |
rowheight dynamic | |
table "combatLog" | |
hideHighlight | |
scrollbar 'GUISCRC' | |
scrollbar func "chatboxScroll" | |
scrollbar skipReset | |
} | |
handle | |
{ | |
name 'messagesHandleY' | |
area 0 0 840 20 | |
actionDrag | |
" | |
dragMessagesY(motionY) | |
" | |
} | |
} | |
` | |
step = 1 | |
worldNPCDialogText = "" | |
worldPlayerDialogChoices = {} | |
function dialogEntryGreyed() | |
return not worldScreen:GetInControlOfDialog() | |
end | |
function getDialogPaddingText() | |
local x,y,w,h = Infinity_GetArea("worldPlayerDialogChoicesList") | |
local zoom = tonumber(Infinity_GetINIValue('Fonts','Zoom','100')) | |
local dialogHeight = Infinity_GetContentHeight(styles.normal.font, w, getDialogText(2), styles.normal.point * zoom / 100, 0, styles.normal.useFontZoom) + 12 | |
local i = 1 | |
while i <= #worldPlayerDialogChoices do | |
dialogHeight = dialogHeight + Infinity_GetContentHeight(styles.normal.font, w, worldPlayerDialogChoices[i].text, styles.normal.point * zoom / 100, 0, styles.normal.useFontZoom) | |
i = i + 1 | |
end | |
local text = "" | |
local lineHeight = Infinity_GetContentHeight(styles.normal.font, w, text, styles.normal.point * zoom / 100, 0, styles.normal.useFontZoom) | |
while dialogHeight + lineHeight < h do | |
text = text .. "\n" | |
lineHeight = Infinity_GetContentHeight(styles.normal.font, w, text, styles.normal.point * zoom / 100, 0, styles.normal.useFontZoom) | |
end | |
return text | |
end | |
function resizeDialog() | |
buildResponsesList() | |
step = 1 | |
end | |
function dialogScroll(top, height, contentHeight) | |
if worldNPCDialogText == '' then | |
return nil | |
end | |
if step == 1 then | |
step = 2 | |
return -contentHeight | |
end | |
return nil | |
end | |
function dragDialogMessagesY(newY) | |
local x,y,w,hOld = Infinity_GetArea("worldDialogBackground") | |
h = hOld - newY | |
if h < 210 then | |
newY = hOld - 210 | |
elseif h > 700 then | |
newY = hOld - 700 | |
end | |
adjustItemGroup({"dialogHandleY","worldDialogPortraitArea"},0,newY,0,0) | |
adjustItemGroup({"worldDialogBackground","worldPlayerDialogChoicesList","worldPlayerDialogFake"},0,newY,0,-newY) | |
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 | |
function getDialogText(row) | |
local idx1 = worldMessageBoxText:len() | |
local idx2 = worldNPCDialogText:len() | |
while idx2 > 0 do | |
local c1 = worldMessageBoxText:byte(idx1) | |
local c2 = worldNPCDialogText:byte(idx2) | |
if c1 ~= c2 then | |
if c1 == 58 and worldMessageBoxText:byte(idx1 - 1) == c2 then | |
idx1 = idx1 - 1 | |
c1 = worldMessageBoxText:byte(idx1) | |
elseif c2 == 10 and worldNPCDialogText:byte(idx2 - 1) == c1 then | |
idx2 = idx2 - 1 | |
c2 = worldNPCDialogText:byte(idx2) | |
elseif c2 == 10 and worldNPCDialogText:byte(idx2 - 1) == 10 and worldNPCDialogText:byte(idx2 - 2) == c1 then | |
idx2 = idx2 - 2 | |
c2 = worldNPCDialogText:byte(idx2) | |
elseif c1 == 32 and c2 == 10 and worldMessageBoxText:byte(idx1 - 1) == 58 then | |
idx1 = idx1 - 1 | |
c1 = 10 | |
end | |
end | |
if c1 ~= c2 then | |
break | |
end | |
idx1 = idx1 - 1 | |
idx2 = idx2 - 1 | |
end | |
return clean(trim(row == 1 and worldMessageBoxText:sub(1, idx1) or worldMessageBoxText:sub(idx1 + 1))) | |
end | |
function B3Split(inputstr, sep) | |
sep = sep or "%s" | |
local t = {} | |
for field, s in string.gmatch(inputstr, "([^"..sep.."]*)("..sep.."?)") do | |
table.insert(t, field) | |
if s == "" then | |
return t | |
end | |
end | |
end | |
B3DialogTable = {} | |
B3DialogTextI = -1 | |
B3DialogResponsesStart = -1 | |
B3DialogResponsesEnd = -1 | |
function makeDialogTable() | |
B3DialogTable = B3Split(getDialogText(1), "\n") | |
B3DialogTextI = #B3DialogTable + 1 | |
B3DialogResponsesStart = B3DialogTextI + 1 | |
B3DialogResponsesEnd = B3DialogResponsesStart + #worldPlayerDialogChoices - 1 | |
if step == 2 then | |
table.insert(B3DialogTable, getDialogText(2)) | |
for _, v in pairs(worldPlayerDialogChoices) do | |
table.insert(B3DialogTable, v.text) | |
end | |
local paddingText = getDialogPaddingText() | |
table.insert(B3DialogTable, paddingText) | |
end | |
return B3DialogTable | |
end | |
function getDialogPortrait() | |
if worldNPCDialogPortrait ~= nil and worldNPCDialogPortrait:sub(-1) == 'S' then | |
for _, entry in ipairs(Infinity_GetFilesOfType("BMP")) do | |
if entry[1] == worldNPCDialogPortrait:sub(1, -2) .. 'M' then | |
return entry[1] | |
end | |
end | |
end | |
return worldNPCDialogPortrait | |
end | |
` | |
menu | |
{ | |
name 'WORLD_DIALOG' | |
offset 0 -54 | |
align center bottom | |
ignoreEsc | |
onOpen | |
" | |
step = 1 | |
Infinity_PopMenu('ITEM_DESCRIPTION') | |
Infinity_PopMenu('POPUP_DETAILS') | |
Infinity_PushMenu('WORLD_DIALOG_CONFIRM') | |
if(isTouchActionbar() and not dialogViewMode) then | |
Infinity_PushMenu('WORLD_DIALOG_LEFT') | |
Infinity_PushMenu('WORLD_DIALOG_RIGHT') | |
end | |
greySidebars() | |
" | |
onClose | |
" | |
Infinity_PopMenu('WORLD_DIALOG_CONFIRM') | |
Infinity_PopMenu('WORLD_DIALOG_LEFT') | |
Infinity_PopMenu('WORLD_DIALOG_RIGHT') | |
ungreySidebars() | |
" | |
label | |
{ | |
name "worldDialogBackground" | |
area 0 0 864 350 | |
rectangle 4 | |
} | |
button | |
{ | |
on pageup | |
action | |
" | |
dragDialogMessagesY(-20) | |
" | |
} | |
button | |
{ | |
on pagedown | |
action | |
" | |
dragDialogMessagesY(20) | |
" | |
} | |
label | |
{ | |
name "worldDialogPortraitArea" | |
area 20 20 110 170 | |
bitmap lua "getDialogPortrait()" | |
} | |
handle | |
{ | |
name "dialogHandleY" | |
area 0 0 864 20 | |
actionDrag | |
" | |
dragDialogMessagesY(motionY) | |
" | |
} | |
text | |
{ | |
name "worldPlayerDialogFake" | |
enabled "step == 1" | |
area 138 20 702 310 | |
text lua "getDialogText(2)" | |
text style "normal" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
text | |
{ | |
enabled "rowNumber < B3DialogTextI" | |
opacity lua "step == 1 and 0 or 255" | |
area 0 0 -1 -1 | |
text lua 'B3DialogTable[rowNumber]' | |
text style "normal" | |
} | |
text | |
{ | |
enabled "rowNumber == B3DialogTextI" | |
area 0 0 -1 -1 | |
pad 0 0 0 12 | |
text lua "B3DialogTable[rowNumber]" | |
text style "normal" | |
} | |
label | |
{ | |
enabled "rowNumber >= B3DialogResponsesStart and rowNumber <= B3DialogResponsesEnd and dialogEntryGreyed()" | |
area 0 0 -1 -1 | |
rectangle 1 | |
rectangle opacity 100 | |
} | |
text | |
{ | |
enabled "rowNumber >= B3DialogResponsesStart and rowNumber <= B3DialogResponsesEnd" | |
area 0 0 -1 -1 | |
text lua "getDialogEntryText(rowNumber - B3DialogResponsesStart + 1)" | |
text style "normal" | |
} | |
text | |
{ | |
enabled "rowNumber > B3DialogResponsesEnd" | |
area 0 0 -1 -1 | |
text lua 'B3DialogTable[rowNumber]' | |
text style "normal" | |
} | |
} | |
name "worldPlayerDialogChoicesList" | |
area 138 20 702 310 | |
rowheight dynamic | |
hideHighlight | |
table "makeDialogTable()" | |
var "worldPlayerDialogSelection" | |
scrollbar 'GUISCRC' | |
scrollbar func "dialogScroll" | |
actionEnter | |
" | |
if(gameOptions.m_bConfirmDialog == true) then return end | |
worldPlayerDialogSelection = mouseoverRow - B3DialogResponsesStart + 1 | |
" | |
actionExit | |
" | |
if(gameOptions.m_bConfirmDialog == true) then return end | |
worldPlayerDialogSelection = 0 | |
" | |
action | |
" | |
worldPlayerDialogSelection = mouseoverRow - B3DialogResponsesStart + 1 | |
--In confirm mode, just highlight the choice. | |
if((gameOptions.m_bConfirmDialog == true) or (worldPlayerDialogSelection <= 0) or (worldPlayerDialogSelection > #worldPlayerDialogChoices)) 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 > 0 and worldPlayerDialogSelection <= #worldPlayerDialogChoices) --no choices, or we've selected a choice. | |
else | |
return true | |
end | |
end | |
` | |
menu | |
{ | |
name 'WORLD_DIALOG_CONFIRM' | |
align center bottom | |
ignoreEsc | |
offset 0 -10 | |
button | |
{ | |
area 0 0 300 44 | |
bam GUIOSTCL | |
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 | |
onOpen | |
" | |
currentPage = 0 | |
" | |
label | |
{ | |
mosaic GUICGPR | |
area 0 0 1024 768 | |
} | |
label | |
{ | |
area 22 8 966 50 | |
text "IMPORT_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 1] ~= nil" | |
area 48 144 54 84 | |
bitmap lua "character_select[currentPage + 1].portrait" | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 1] ~= nil" | |
area 172 120 528 32 | |
text lua "dwFilterKitDesc(character_select[currentPage + 1].name)" | |
text style "label" | |
text align left center | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 1] ~= nil" | |
area 130 166 600 80 | |
text lua "character_select[currentPage + 1].desc" | |
text style "normal" | |
text align left top | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 2] ~= nil" | |
area 48 292 54 84 | |
bitmap lua "character_select[currentPage + 2].portrait" | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 2] ~= nil" | |
area 172 268 528 32 | |
text lua "dwFilterKitDesc(character_select[currentPage + 2].name)" | |
text style "label" | |
text align left center | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 2] ~= nil" | |
area 130 314 600 80 | |
text lua "character_select[currentPage + 2].desc" | |
text style "normal" | |
text align left top | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 3] ~= nil" | |
area 48 444 54 84 | |
bitmap lua "character_select[currentPage + 3].portrait" | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 3] ~= nil" | |
area 172 420 528 32 | |
text lua "dwFilterKitDesc(character_select[currentPage + 3].name)" | |
text style "label" | |
text align left center | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 3] ~= nil" | |
area 130 466 600 80 | |
text lua "character_select[currentPage + 3].desc" | |
text style "normal" | |
text align left top | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 4] ~= nil" | |
area 48 594 54 84 | |
bitmap lua "character_select[currentPage + 4].portrait" | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 4] ~= nil" | |
area 172 570 528 32 | |
text lua "dwFilterKitDesc(character_select[currentPage + 4].name)" | |
text style "label" | |
text align left center | |
} | |
label | |
{ | |
enabled "character_select[currentPage + 4] ~= nil" | |
area 130 616 600 80 | |
text lua "character_select[currentPage + 4].desc" | |
text style "normal" | |
text align left top | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 0 0 | |
} | |
} | |
area 28 150 960 536 | |
rowheight 134 | |
hidehighlight | |
table "makeTable(#character_select)" | |
scrollbar 'GUISCRC' | |
scrollbar func "scrollFunc" | |
} | |
button | |
{ | |
enabled "character_select[currentPage + 1] ~= nil" | |
area 748 202 201 44 | |
text "IMPORT_BUTTON" | |
text style "button" | |
bam GUIOSTUM | |
action | |
" | |
createCharScreen:OnPrerollCharacterPick(character_select[currentPage + 1].id) | |
Infinity_PopMenu('CHARACTER_SELECT') | |
" | |
actionScroll | |
" | |
onScroll(length(character_select) - 4) | |
" | |
} | |
button | |
{ | |
enabled "character_select[currentPage + 2] ~= nil" | |
area 748 350 201 44 | |
text "IMPORT_BUTTON" | |
text style "button" | |
bam GUIOSTUM | |
action | |
" | |
createCharScreen:OnPrerollCharacterPick(character_select[currentPage + 2].id) | |
Infinity_PopMenu('CHARACTER_SELECT') | |
" | |
actionScroll | |
" | |
onScroll(length(character_select) - 4) | |
" | |
} | |
button | |
{ | |
enabled "character_select[currentPage + 3] ~= nil" | |
area 748 502 201 44 | |
text "IMPORT_BUTTON" | |
text style "button" | |
bam GUIOSTUM | |
action | |
" | |
createCharScreen:OnPrerollCharacterPick(character_select[currentPage + 3].id) | |
Infinity_PopMenu('CHARACTER_SELECT') | |
" | |
actionScroll | |
" | |
onScroll(length(character_select) - 4) | |
" | |
} | |
button | |
{ | |
enabled "character_select[currentPage + 4] ~= nil" | |
area 748 652 201 44 | |
text "IMPORT_BUTTON" | |
text style "button" | |
bam GUIOSTUM | |
action | |
" | |
createCharScreen:OnPrerollCharacterPick(character_select[currentPage + 4].id) | |
Infinity_PopMenu('CHARACTER_SELECT') | |
" | |
actionScroll | |
" | |
onScroll(length(character_select) - 4) | |
" | |
} | |
button | |
{ | |
on escape | |
area 362 724 300 44 | |
bam GUIOSTCL | |
text "BACK_BUTTON" | |
text style "button" | |
action | |
" | |
createCharScreen:OnCancelButtonClick() | |
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 | |
` | |
menu | |
{ | |
name 'CHARGEN' | |
align center center | |
ignoreesc | |
onOpen " | |
dwIsChargen=true;dwIsLevelling=false;dwIsDualClassing=false | |
gender = 2 | |
randomCharacter = 0 | |
" | |
label | |
{ | |
area 0 0 1024 768 | |
mosaic GUICGB | |
} | |
label | |
{ | |
area 64 16 898 44 | |
text "CHARGEN_TITLE" | |
text style "title" | |
} | |
text | |
{ | |
area 414 184 286 404 | |
text lua "dwFilterKitDesc(dwChargenInformation())" | |
scrollbar 'GUISCRC' | |
text style "parchment" | |
text color D | |
} | |
label | |
{ | |
area 775 172 210 330 | |
bitmap lua "chargen.portrait" | |
} | |
button | |
{ | |
area 22 180 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 0" | |
glow lua "createCharScreen:GetCurrentStep() == 0" | |
text "GENDER_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
area 22 216 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 3" | |
glow lua "createCharScreen:GetCurrentStep() == 3" | |
text "RACE_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
area 22 252 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 4" | |
glow lua "createCharScreen:GetCurrentStep() == 4" | |
text "CLASS_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
area 22 288 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 7" | |
glow lua "createCharScreen:GetCurrentStep() == 7" | |
text "ALIGNMENT_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
area 22 324 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 8" | |
glow lua "createCharScreen:GetCurrentStep() == 8" | |
text "ABILITIES_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
area 22 360 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 9" | |
glow lua "createCharScreen:GetCurrentStep() == 9" | |
text "SKILLS_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
area 22 396 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 15" | |
glow lua "createCharScreen:GetCurrentStep() == 15" | |
text "APPEARANCE_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
area 22 432 340 32 | |
bam GUICHLNG | |
clickable lua "createCharScreen:GetCurrentStep() == 17" | |
glow lua "createCharScreen:GetCurrentStep() == 17" | |
text "NAME_BUTTON" | |
text style "button" | |
action "createCharScreen:OnMenuButtonClick()" | |
} | |
button | |
{ | |
enabled "createCharScreen:GetCurrentStep() < 15 and type(randChar) == 'function'" | |
area 22 564 340 32 | |
bam GUICHLNG | |
text lua "'???'" | |
text style "button" | |
action "randChar()" | |
} | |
button | |
{ | |
enabled "randomCharacter == 1 and createCharScreen:GetCurrentStep() == 15 and type(randChar) == 'function'" | |
area 22 564 340 32 | |
bam GUICHLNG | |
text lua "'???'" | |
text style "button" | |
action | |
" | |
randomCharacter = 0 | |
while createCharScreen:GetCurrentStep() > 0 do | |
createCharScreen:OnMainBackButtonClick() | |
end | |
randChar() | |
" | |
} | |
button | |
{ | |
area 772 548 201 44 | |
text "IMPORT_BUTTON" | |
text style "button" | |
bam GUIOSTUM | |
action "createCharScreen:OnImportCharacterButtonClick()" | |
} | |
button | |
{ | |
area 772 604 201 44 | |
text "BIOGRAPHY_BUTTON" | |
text style "button" | |
bam GUIOSTLM | |
clickable lua "createCharScreen:GetCurrentStep() >= 17" | |
action "createCharScreen:OnBiographyButtonClick()" | |
} | |
button | |
{ | |
on escape | |
area 198 718 234 44 | |
text "BACK_BUTTON" | |
text style "button" | |
bam GUIOSTUL | |
clickable lua "createCharScreen:IsMainBackButtonClickable()" | |
action "createCharScreen:OnMainBackButtonClick()" | |
} | |
button | |
{ | |
on escape | |
area 198 718 234 44 | |
text "CANCEL_BUTTON" | |
text style "button" | |
bam GUIOSTUL | |
enabled "not createCharScreen:IsMainBackButtonClickable()" | |
action "createCharScreen:OnMainCancelButtonClick()" | |
} | |
button | |
{ | |
area 438 718 201 44 | |
text lua "chargenAcceptOrExport()" | |
text style "button" | |
bam GUIOSTUM | |
clickable lua "createCharScreen:IsChargenComplete()" | |
action "dwIsChargen=false; | |
if dwUpdatedBio then | |
createCharScreen:AcceptCharacter(-1) | |
else | |
dwAutoBioSet=true | |
createCharScreen:OnBiographyButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
area 646 718 234 44 | |
text "CREATE_PARTY_BUTTON" | |
text style "button" | |
bam GUIOSTUR | |
clickable lua "createCharScreen:IsAdvancedButtonClickable() == true" | |
action "createCharScreen:OnAdvancedButtonClick()" | |
} | |
} | |
menu | |
{ | |
name 'CHARGEN_GENDER' | |
onOpen | |
" | |
if gender==1 then dwGender='male' else dwGender='female' end; createCharScreen:OnGenderSelectButtonClick(gender) | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
" | |
label | |
{ | |
area 0 0 1 1 | |
} | |
} | |
` | |
function setCurrentPortrait(idx) | |
local portrait = portraitTable[idx] | |
local curPortrait = createCharScreen:GetCurrentPortrait():upper() | |
while portrait ~= curPortrait do | |
createCharScreen:IncCurrentPortrait() | |
curPortrait = createCharScreen:GetCurrentPortrait():upper() | |
end | |
end | |
function getPortrait(idx) | |
local portrait = portraitTable[idx] | |
if portrait:sub(-1) == 'L' then | |
return portrait:sub(1, -2) | |
end | |
return portrait | |
end | |
function comparePortrait(portrait, curPortrait) | |
if portrait:sub(-1) == 'L' or portrait:sub(-1) == 'M' then | |
portrait = portrait:sub(1, -2) | |
end | |
if curPortrait:sub(-1) == 'L' or curPortrait:sub(-1) == 'M' then | |
curPortrait = curPortrait:sub(1, -2) | |
end | |
return portrait == curPortrait | |
end | |
function portraitScroll(top, height, contentHeight) | |
if scrollPortrait ~= nil then | |
top = top - 94 * scrollPortrait | |
top = math.min(top, 0) | |
top = math.max(top, height - contentHeight) | |
scrollPortrait = nil | |
return top | |
end | |
return nil | |
end | |
` | |
menu | |
{ | |
name 'CHARACTER_PORTRAIT' | |
align center center | |
modal | |
ignoreesc | |
onOpen | |
" | |
Infinity_PlaySound('GAM_03') | |
portraitTable = {} | |
selPortrait = 1 | |
local firstPortrait = createCharScreen:GetCurrentPortrait():upper() | |
local curGender = gender == 1 and 15729749 or 15729635 | |
local curPortrait = firstPortrait | |
if CurrentlyInGame() then | |
curGender = characters[currentID].gender | |
curPortrait = characters[currentID].portrait | |
end | |
local portrait = firstPortrait | |
local idx = 1 | |
while idx == 1 or portrait ~= firstPortrait do | |
local gender = nil | |
if portrait:find('M#') == 1 then | |
gender = 15729749 | |
elseif portrait:find('F#') == 1 then | |
gender = 15729635 | |
end | |
if gender == curGender or gender == nil then | |
table.insert(portraitTable, portrait) | |
end | |
if comparePortrait(portrait, curPortrait) then | |
selPortrait = idx | |
end | |
createCharScreen:IncCurrentPortrait() | |
portrait = createCharScreen:GetCurrentPortrait():upper() | |
idx = idx + 1 | |
end | |
scrollPortrait = selPortrait - 1 | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
portraitTable = nil | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIAPBR | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "APPEARANCE_TITLE" | |
text style "title" | |
} | |
button | |
{ | |
enabled "not CurrentlyInGame()" | |
area 122 545 77 68 | |
bam GUIGEND1 | |
frame lua "gender == 1 and 2 or 0" | |
sequence 0 | |
action | |
" | |
gender = 1 | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
enabled "not CurrentlyInGame()" | |
area 226 545 77 68 | |
bam GUIGEND1 | |
frame lua "gender == 2 and 2 or 0" | |
sequence 1 | |
action | |
" | |
gender = 2 | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 57 90 | |
bitmap lua "portraitTable[rowNumber]" | |
glow lua "rowNumber == mouseoverRow" | |
} | |
label | |
{ | |
area 70 0 -1 -1 | |
text lua "getPortrait(rowNumber)" | |
text style 'label' | |
glow lua "rowNumber == mouseoverRow" | |
} | |
label | |
{ | |
enabled "selPortrait ~= rowNumber" | |
area 0 0 378 94 | |
rectangle 1 | |
rectangle opacity 150 | |
} | |
} | |
actionEnter "" | |
actionExit "mouseoverRow = 0" | |
rowheight 94 | |
hidehighlight | |
area 436 130 378 470 | |
table "portraitTable" | |
var selPortrait | |
scrollbar 'GUISCRC' | |
scrollbar func "portraitScroll" | |
} | |
button | |
{ | |
enabled "not CurrentlyInGame()" | |
on "Left Shift" | |
action | |
" | |
if gender == 2 then gender = 1 else gender = 2 end | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
on "left" | |
action | |
" | |
selPortrait = selPortrait - 1 | |
if selPortrait == 0 then | |
scrollPortrait = nil | |
selPortrait = #portraitTable | |
end | |
" | |
} | |
button | |
{ | |
on "right" | |
action | |
" | |
if selPortrait == #portraitTable then | |
scrollPortrait = nil | |
selPortrait = 0 | |
end | |
selPortrait = selPortrait + 1 | |
" | |
} | |
button | |
{ | |
on up | |
action | |
" | |
scrollPortrait = -1 | |
" | |
} | |
button | |
{ | |
on down | |
action | |
" | |
scrollPortrait = 1 | |
" | |
} | |
button | |
{ | |
on pageup | |
action | |
" | |
scrollPortrait = -5 | |
" | |
} | |
button | |
{ | |
on pagedown | |
action | |
" | |
scrollPortrait = 5 | |
" | |
} | |
label | |
{ | |
area 107 200 210 330 | |
bitmap lua "portraitTable[selPortrait]" | |
} | |
label | |
{ | |
enabled "portraitTable[selPortrait]:sub(-1) == 'L'" | |
area 344 320 64 90 | |
bam GUIRSP10 | |
} | |
label | |
{ | |
enabled "portraitTable[selPortrait]:sub(-1) == 'L'" | |
area 348 322 55 85 | |
bitmap lua "portraitTable[selPortrait]:sub(1, -2) .. 'M'" | |
} | |
button | |
{ | |
on return | |
action | |
" | |
setCurrentPortrait(selPortrait) | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
if CurrentlyInGame() then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
createCharScreen:OnMainBackButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
setCurrentPortrait(selPortrait) | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
if CurrentlyInGame() then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
createCharScreen:OnMainBackButtonClick() | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 464 653 234 44 | |
bam GUIOSTUR | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
if CurrentlyInGame() then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
createCharScreen:OnMainBackButtonClick() | |
end | |
else | |
setCurrentPortrait(selPortrait) | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARGEN_PORTRAIT' | |
onOpen | |
" | |
if CurrentlyInGame() then | |
pushSidebars() | |
end | |
Infinity_PushMenu('CHARACTER_PORTRAIT') | |
Infinity_PopMenu('CHARGEN_PORTRAIT') | |
" | |
label | |
{ | |
area 0 0 1 1 | |
} | |
} | |
` | |
function raceOrGeneralHelp() | |
race = dwRaces[currentChargenRace] | |
if race then | |
subracelist=subraceList(dwRaces[currentChargenRace].id) | |
if subracelist then | |
if #subracelist==1 then | |
return Infinity_FetchString(subracelist[1].desc) | |
else | |
return Infinity_FetchString(race.desc) | |
end | |
else | |
return Infinity_FetchString(race.desc) | |
end | |
else | |
return Infinity_FetchString(17237) | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_RACE' | |
align center center | |
modal | |
ignoreesc | |
onOpen | |
" | |
dwRaces={} | |
dwRaces=dwMakeRaceList(chargen.races) | |
currentChargenRace = nil | |
currentChargenSubrace=nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "RACE_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenRace and 2 or 0" | |
} | |
label | |
{ | |
area 0 0 340 32 | |
text lua "Infinity_FetchString(dwRaces[rowNumber].name)" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
if dwRaces[currentChargenRace] then | |
dwOnRaceSelectButtonClick(dwRaces[currentChargenRace].id) | |
end | |
" | |
area 42 192 358 414 | |
rowheight 34 | |
hidehighlight | |
table "dwRaces" | |
var currentChargenRace | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "raceOrGeneralHelp()" | |
text style normal | |
text color D | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() and currentChargenRace" | |
action "dwOnRaceDoneButtonClick(dwRaces[currentChargenRace].id)" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and (createCharScreen:IsDoneButtonClickable() and currentChargenRace) or true" | |
action | |
" | |
if reverseButtonPosition then | |
dwOnRaceDoneButtonClick(dwRaces[currentChargenRace].id) | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or (createCharScreen:IsDoneButtonClickable() and currentChargenRace)" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
dwOnRaceDoneButtonClick(dwRaces[currentChargenRace].id) | |
end | |
" | |
} | |
} | |
` | |
function classOrGeneralHelp() | |
class = dwSingleClassList[currentChargenClass] | |
if class then | |
return Infinity_FetchString(class.desc) | |
end | |
--only bit that may need to change for dual class! :) | |
return Infinity_FetchString(17242) | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_CLASS' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
dwMulticlassSelect=nil | |
dwSingleClassList=dwMakeSingleClassList(chargen.class) | |
currentChargenClass = nil | |
currentChargenKit = nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "CLASS_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
button | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenClass and 2 or 0" | |
} | |
button | |
{ | |
area 0 0 340 32 | |
text lua "dwFilterKitDesc(Infinity_FetchString(dwSingleClassList[rowNumber].name))" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
createCharScreen:OnClassSelectButtonClick(0) | |
if dwSingleClassList[currentChargenClass] then | |
dwChargenClassId,dwMulticlassSelect=dwOnClassSelectButtonClick(currentChargenClass) | |
else | |
currentChargenClass = nil | |
end | |
" | |
rowheight 34 | |
hidehighlight | |
area 42 192 356 414 | |
table "dwSingleClassList" | |
var currentChargenClass | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "classOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() or dwMulticlassSelect and currentChargenClass" | |
action | |
" | |
Infinity_PopMenu() | |
if dwIsDualClassing then | |
Infinity_PushMenu('CHARGEN_KIT') | |
elseif dwMulticlassSelect then | |
Infinity_PushMenu('CHARGEN_MULTICLASS') -- go on to the multiclass menu | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
if createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS then | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and (createCharScreen:IsDoneButtonClickable() or dwMulticlassSelect and currentChargenClass) or true" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
if dwIsDualClassing then | |
Infinity_PushMenu('CHARGEN_KIT') | |
elseif dwMulticlassSelect then | |
Infinity_PushMenu('CHARGEN_MULTICLASS') -- go on to the multiclass menu | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
else | |
if createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS then | |
createCharScreen:OnCancelButtonClick() | |
end | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or (createCharScreen:IsDoneButtonClickable() or dwMulticlassSelect and currentChargenClass)" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
if createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS then | |
createCharScreen:OnCancelButtonClick() | |
end | |
else | |
if dwIsDualClassing then | |
Infinity_PushMenu('CHARGEN_KIT') | |
elseif dwMulticlassSelect then | |
Infinity_PushMenu('CHARGEN_MULTICLASS') -- go on to the multiclass menu | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
end | |
" | |
} | |
} | |
` | |
function kitOrGeneralHelp() | |
kit = dwKitList[currentChargenKit] | |
if kit then | |
return Infinity_FetchString(kit.desc) | |
end | |
if dwCurrentVirtualClass then | |
return Infinity_FetchString(dwCurrentVirtualClass.desc) | |
end | |
class = dwSingleClassList[currentChargenClass] | |
if class then | |
return Infinity_FetchString(class.desc) | |
end | |
return Infinity_FetchString(17242) | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_KIT' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
dwMenu=nil | |
dwKitList=dwMakeKitList(chargen.kit) | |
if #dwKitList==1 then | |
createCharScreen:OnKitSelectButtonClick(dwKitList[1].id) | |
currentChargenKit=1 | |
dwChargenKitId=dwKitList[1].id | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
else | |
dwChargenKitId=nil | |
if not (dwKitList[1].id==0) then | |
currentChargenKit=nil | |
end | |
end | |
currentChargenKit = 1 | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "dwChargenClassKitTitle()" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
button | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenKit and 2 or 0" | |
} | |
button | |
{ | |
area 0 0 340 32 | |
text lua "dwFilterKitDesc(Infinity_FetchString(dwKitList[rowNumber].name))" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
if dwKitList[currentChargenKit] then | |
dwChargenKitId,dwMenu=dwOnSelectKitButtonClick(currentChargenKit) | |
else | |
currentChargenKit = nil | |
end | |
" | |
rowheight 34 | |
hidehighlight | |
area 42 192 356 414 | |
table "dwKitList" | |
var currentChargenKit | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "kitOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "(createCharScreen:IsDoneButtonClickable() and currentChargenKit) and currentChargenKit" | |
action | |
" | |
Infinity_PopMenu(); createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and ((createCharScreen:IsDoneButtonClickable() and currentChargenKit) and currentChargenKit) or true" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu(); createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or ((createCharScreen:IsDoneButtonClickable() and currentChargenKit) and currentChargenKit)" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
Infinity_PopMenu(); createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
function alignmentOrGeneralHelp() | |
alignment = chargen.alignment[currentChargenAlignment] | |
if alignment then | |
return Infinity_FetchString(alignment.desc) | |
end | |
return Infinity_FetchString(9602) | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_ALIGNMENT' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
currentChargenAlignment = nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "ALIGNMENT_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
button | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenAlignment and 2 or 0" | |
} | |
button | |
{ | |
area 0 0 340 32 | |
text lua "Infinity_FetchString(chargen.alignment[rowNumber].name)" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
createCharScreen:OnAlignmentSelectButtonClick(0) | |
if chargen.alignment[currentChargenAlignment] then | |
dwChargenAlignment=chargen.alignment[currentChargenAlignment].id;createCharScreen:OnAlignmentSelectButtonClick(chargen.alignment[currentChargenAlignment].id) | |
else | |
currentChargenAlignment = nil | |
end | |
" | |
rowheight 34 | |
hidehighlight | |
area 42 192 356 414 | |
table "chargen.alignment" | |
var currentChargenAlignment | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "alignmentOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() and currentChargenAlignment" | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and (createCharScreen:IsDoneButtonClickable() and currentChargenAlignment) or true" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or (createCharScreen:IsDoneButtonClickable() and currentChargenAlignment)" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
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 dwSubraceAbilityMinMaxSub(Infinity_FetchString(ability.desc),currentChargenAbility) | |
else | |
return Infinity_FetchString(17247) | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_ABILITIES' | |
modal | |
align center center | |
ignoreesc | |
OnOpen | |
" | |
dwImposeLegalAbilityMinimums() | |
ticksPassed = 0 | |
ticksStarting = 0 | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "ABILITIES_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 45 | |
label | |
{ | |
area 0 0 -1 55 | |
text lua "t(chargen.ability[rowNumber].name)" | |
text style "normal" | |
align right center | |
} | |
} | |
column | |
{ | |
width 27 | |
label | |
{ | |
area 20 0 90 55 | |
text lua "dwShowAdjustedAbilityValue(rowNumber,dwSubraceAbilityModifier(rowNumber))" | |
text style "normal" | |
align center center | |
} | |
} | |
column | |
{ | |
width 14 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
frame lua "currentCellCheck(3)" | |
sequence lua "reverseButtonPosition and 1 or 3" | |
} | |
} | |
column | |
{ | |
width 14 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
frame lua "currentCellCheck(4)" | |
sequence lua "reverseButtonPosition and 0 or 4" | |
} | |
} | |
action | |
" | |
if ticksStarting <= 10 then | |
if cellNumber == 3 then | |
createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, not reverseButtonPosition) | |
elseif cellNumber == 4 then | |
createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, reverseButtonPosition) | |
end | |
end | |
cellNumber = nil | |
ticksPassed = 0 | |
ticksStarting = 0 | |
" | |
actionUpdate | |
" | |
ticksStarting = ticksStarting + 1 | |
if ticksStarting > 10 then | |
if cellNumber == 3 then | |
createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, not reverseButtonPosition) | |
elseif cellNumber == 4 then | |
createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, reverseButtonPosition) | |
end | |
end | |
" | |
rowheight 54 | |
hidehighlight | |
area 42 188 340 324 | |
table "chargen.ability" | |
var currentChargenAbility | |
} | |
label | |
{ | |
area 38 122 186 42 | |
text "TOTAL_ROLL_NORMAL" | |
text style "normal" | |
text align right center | |
} | |
label | |
{ | |
area 224 122 50 42 | |
text lua "chargen.totalRoll" | |
text style "normal" | |
text align center center | |
} | |
label | |
{ | |
area 288 122 94 42 | |
text lua "chargen.extraAbilityPoints" | |
text style "normal" | |
text align center center | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "abilityOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
area 42 510 340 32 | |
bam GUICHLNG | |
sequence 0 | |
text "REROLL_BUTTON" | |
text style "button" | |
on R | |
action "createCharScreen:OnAbilityReRollButtonClick()dwImposeLegalAbilityMinimums()" | |
} | |
button | |
{ | |
area 42 544 340 32 | |
bam GUICHLNG | |
sequence 0 | |
text "STORE_BUTTON" | |
text style "button" | |
on S | |
action "createCharScreen:OnAbilityStoreButtonClick()" | |
} | |
button | |
{ | |
area 42 578 340 32 | |
bam GUICHLNG | |
sequence 0 | |
text "RECALL_BUTTON" | |
text style "button" | |
on C | |
clickable lua "createCharScreen:IsAbilityRecallButtonClickable()" | |
action "createCharScreen:OnAbilityRecallButtonClick()" | |
} | |
button | |
{ | |
on '8' | |
action "createCharScreen:OnCheatyMcCheaterson()" | |
} | |
button | |
{ | |
on return | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
function proficiencyOrGeneralHelp() | |
local prof = dwProficiencyTable[currentChargenProficiency] | |
local skill = chargen.thief_skill[currentChargenThiefSkill] | |
if prof and prof.desc ~= -1 then | |
if cannotFurtherSpecialize then | |
return Infinity_FetchString(15986) | |
end | |
return Infinity_FetchString(prof.desc) | |
elseif skill and skill.desc ~= -1 then | |
return Infinity_FetchString(skill.description) | |
end | |
if(chargen.levelingUp) then | |
if(levelUpInfoToggle == 1) then | |
return chargen.charInfo | |
else | |
return chargen.levelInfo | |
end | |
else | |
return Infinity_FetchString(engine_mode == 0 and 24315 or 9588) | |
end | |
end | |
function getProficienciesTitle() | |
if(chargen.levelingUp) then | |
return t("LEVEL_UP_TITLE") | |
else | |
return t("CHARGEN_TITLE") | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_PROFICIENCIES' | |
align center center | |
modal | |
ignoreesc | |
onOpen | |
"dw_thiefskill_initialize(); | |
if (dwRangerLevelOld) then | |
dwRangerLevelNew=dwFindRangerLevel(true) | |
dwOpenRangerFavoredEnemy=dwCheckRangerFavoredEnemy(dwRangerLevelOld,dwRangerLevelNew) | |
end | |
dwPassSubraceData() | |
dwProficiencyTable,dwProficiencyLookup,dwSpendableTotal=dwBuildProficiencyTable(chargen.proficiency) | |
cannotFurtherSpecialize = false | |
currentChargenProficiency = nil | |
currentChargenThiefSkill = nil | |
levelUpInfoToggle = 0 | |
ticksPassed = 0 | |
ticksStarting = 0 | |
Infinity_PlaySound('GAM_03') | |
dwClearExcessProficiencies(dwSpendableTotal) | |
dwProficienciesTotal=chargen.extraProficiencySlots | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GOPSNDSB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "getProficienciesTitle()" | |
text style "title" | |
} | |
button | |
{ | |
enabled "chargen.levelingUp" | |
area 334 60 201 44 | |
bam GUIOSTLM | |
text "INFORMATION_BUTTON" | |
text style "button" | |
toggle "levelUpInfoToggle" | |
action | |
" | |
currentChargenProficiency = nil | |
currentChargenThiefSkill = nil | |
" | |
} | |
label | |
{ | |
area 52 128 372 44 | |
text "PROF_SLOTS_LABEL" | |
text style "label" | |
text align center center | |
} | |
label | |
{ | |
area 424 128 50 44 | |
text lua "chargen.extraProficiencySlots" | |
text style "label" | |
text align center center | |
} | |
label | |
{ | |
area 474 128 288 44 | |
text "SKILLS_LABEL" | |
text style "label" | |
text align center center | |
} | |
label | |
{ | |
area 762 128 50 44 | |
text lua "dw_thiefskill_extra_points()" | |
text style "label" | |
text align center center | |
} | |
label | |
{ | |
area 50 172 764 1 | |
fill 74 89 107 200 | |
} | |
list | |
{ | |
column | |
{ | |
width 58 | |
label | |
{ | |
area 0 0 -1 55 | |
text lua "Infinity_FetchString(dwProficiencyTable[rowNumber].name)" | |
text style "normal" | |
align right center | |
} | |
} | |
column | |
{ | |
width 4 | |
label | |
{ | |
bam GUISCRC | |
area 0 16 16 22 | |
frame 4 | |
align center center | |
enabled "chargen.proficiency[dwProficiencyLookup[rowNumber]].value > 4" | |
} | |
} | |
column | |
{ | |
width 4 | |
label | |
{ | |
bam GUISCRC | |
area 0 16 16 22 | |
frame 4 | |
align center center | |
enabled "chargen.proficiency[dwProficiencyLookup[rowNumber]].value > 3" | |
} | |
} | |
column | |
{ | |
width 4 | |
label | |
{ | |
bam GUISCRC | |
area 0 16 16 22 | |
frame 4 | |
align center center | |
enabled "chargen.proficiency[dwProficiencyLookup[rowNumber]].value > 2" | |
} | |
} | |
column | |
{ | |
width 4 | |
label | |
{ | |
bam GUISCRC | |
area 0 16 16 22 | |
frame 4 | |
align center center | |
enabled "chargen.proficiency[dwProficiencyLookup[rowNumber]].value > 1" | |
} | |
} | |
column | |
{ | |
width 4 | |
label | |
{ | |
bam GUISCRC | |
area 0 16 16 22 | |
frame 4 | |
align center center | |
enabled "chargen.proficiency[dwProficiencyLookup[rowNumber]].value > 0" | |
} | |
} | |
column | |
{ | |
width 11 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
frame lua "reverseButtonPosition and getMinusFrame(7) or getPlusFrame(7)" | |
sequence lua "reverseButtonPosition and 1 or 3" | |
} | |
} | |
column | |
{ | |
width 11 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
frame lua "reverseButtonPosition and getPlusFrame(8) or getMinusFrame(8)" | |
sequence lua "reverseButtonPosition and 0 or 4" | |
} | |
} | |
action | |
" | |
currentChargenThiefSkill = nil | |
if cellNumber ~= 7 and cellNumber ~= 8 then cannotFurtherSpecialize = false end | |
if ticksStarting <= 10 then | |
local isClickable1 = reverseButtonPosition and minusButtonClickable or plusButtonClickable | |
local isClickable2 = reverseButtonPosition and plusButtonClickable or minusButtonClickable | |
if cellNumber == 7 and isClickable1(currentChargenProficiency) then | |
local value = dwProficiencyTable[currentChargenProficiency].value | |
createCharScreen:OnProficiencyPlusMinusButtonClick(dwProficiencyTable[currentChargenProficiency].id, not reverseButtonPosition) | |
cannotFurtherSpecialize = value == dwProficiencyTable[currentChargenProficiency].value | |
elseif cellNumber == 8 and isClickable2(currentChargenProficiency) then | |
local value = dwProficiencyTable[currentChargenProficiency].value | |
createCharScreen:OnProficiencyPlusMinusButtonClick(dwProficiencyTable[currentChargenProficiency].id, reverseButtonPosition) | |
cannotFurtherSpecialize = value == dwProficiencyTable[currentChargenProficiency].value | |
end | |
end | |
cellNumber = nil | |
ticksPassed = 0 | |
ticksStarting = 0 | |
" | |
actionUpdate | |
" | |
currentChargenThiefSkill = nil | |
ticksStarting = ticksStarting + 1 | |
if ticksStarting > 10 then | |
local isClickable1 = reverseButtonPosition and minusButtonClickable or plusButtonClickable | |
local isClickable2 = reverseButtonPosition and plusButtonClickable or minusButtonClickable | |
if cellNumber == 7 and isClickable1(currentChargenProficiency) then | |
local value = dwProficiencyTable[currentChargenProficiency].value | |
createCharScreen:OnProficiencyPlusMinusButtonClick(dwProficiencyTable[currentChargenProficiency].id, not reverseButtonPosition) | |
cannotFurtherSpecialize = value == dwProficiencyTable[currentChargenProficiency].value | |
elseif cellNumber == 8 and isClickable2(currentChargenProficiency) then | |
local value = dwProficiencyTable[currentChargenProficiency].value | |
createCharScreen:OnProficiencyPlusMinusButtonClick(dwProficiencyTable[currentChargenProficiency].id, reverseButtonPosition) | |
cannotFurtherSpecialize = value == dwProficiencyTable[currentChargenProficiency].value | |
end | |
end | |
" | |
rowheight 54 | |
hidehighlight | |
area 52 178 422 276 | |
table "dwProficiencyTable" | |
var currentChargenProficiency | |
scrollbar 'GUISCRC' | |
} | |
list | |
{ | |
column | |
{ | |
width 60 | |
label | |
{ | |
area 0 0 180 54 | |
text lua "Infinity_FetchString(chargen.thief_skill[rowNumber].name)" | |
text style "normal" | |
text align right center | |
} | |
} | |
column | |
{ | |
width 12 | |
label | |
{ | |
area 0 0 60 54 | |
text lua "dw_thiefskill_value(rowNumber)" | |
text style "normal" | |
text align left center | |
} | |
} | |
column | |
{ | |
width 14 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
enabled "dw_can_press_thief_button()" | |
frame lua "currentCellCheck(3)" | |
sequence lua "reverseButtonPosition and 1 or 3" | |
} | |
} | |
column | |
{ | |
width 14 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
enabled "dw_can_press_thief_button()" | |
frame lua "currentCellCheck(4)" | |
sequence lua "reverseButtonPosition and 0 or 4" | |
} | |
} | |
action | |
" | |
currentChargenProficiency = nil | |
if ticksStarting <= 10 then | |
if dw_can_press_thief_button() then | |
local plusCell = reverseButtonPosition and 4 or 3 | |
local minusCell = reverseButtonPosition and 3 or 4 | |
if cellNumber == plusCell then | |
dw_thiefskill_add(currentChargenThiefSkill) | |
elseif cellNumber == minusCell then | |
dw_thiefskill_subtract(currentChargenThiefSkill) | |
end | |
end | |
end | |
cellNumber = nil | |
ticksPassed = 0 | |
ticksStarting = 0 | |
" | |
actionUpdate | |
" | |
currentChargenProficiency = nil | |
if dw_can_press_thief_button() then | |
ticksStarting = ticksStarting + 1 | |
if ticksStarting > 10 then | |
local plusCell = reverseButtonPosition and 4 or 3 | |
local minusCell = reverseButtonPosition and 3 or 4 | |
if cellNumber == plusCell then | |
dw_thiefskill_add(currentChargenThiefSkill) | |
elseif cellNumber == minusCell then | |
dw_thiefskill_subtract(currentChargenThiefSkill) | |
end | |
end | |
end | |
" | |
rowheight 54 | |
hidehighlight | |
area 474 178 336 276 | |
table "chargen.thief_skill" | |
var currentChargenThiefSkill | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 112 492 642 116 | |
text lua "dwFilterExcessProficiencies(proficiencyOrGeneralHelp())" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
action | |
" | |
if chargen.levelingUp and (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)>dwHLANumberOld) then | |
createCharScreen:OnHighLevelAbilitiesButtonClick() | |
elseif (createCharScreen:IsDoneButtonClickable() or (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)==dwHLANumberOld)) then | |
dwHLAClickDoneButton() | |
end | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
for k,v in pairs(dwProficiencyTable) do | |
while plusButtonClickable(k) do | |
local points = chargen.extraProficiencySlots | |
createCharScreen:OnProficiencyPlusMinusButtonClick(v.id, true) | |
if points == chargen.extraProficiencySlots then break end | |
end | |
end | |
for k,v in pairs(chargen.thief_skill) do | |
while dw_can_press_thief_button() do | |
local points = chargen.extraSkillPoints | |
createCharScreen:OnThiefSkillPlusMinusButtonClick(v.id, true) | |
if points == chargen.extraSkillPoints then break end | |
end | |
end | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and ((chargen.levelingUp and (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)>dwHLANumberOld)) and 'HIGH_LEVEL_ABILITIES_BUTTON' or 'DONE_BUTTON') or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and ((chargen.levelingUp and (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)>dwHLANumberOld)) or (createCharScreen:IsDoneButtonClickable() or (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)==dwHLANumberOld))) or true" | |
action | |
" | |
if reverseButtonPosition then | |
if chargen.levelingUp and (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)>dwHLANumberOld) then | |
createCharScreen:OnHighLevelAbilitiesButtonClick() | |
elseif (createCharScreen:IsDoneButtonClickable() or (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)==dwHLANumberOld)) then | |
dwHLAClickDoneButton() | |
end | |
else | |
for k,v in pairs(dwProficiencyTable) do | |
while plusButtonClickable(k) do | |
local points = chargen.extraProficiencySlots | |
createCharScreen:OnProficiencyPlusMinusButtonClick(v.id, true) | |
if points == chargen.extraProficiencySlots then break end | |
end | |
end | |
for k,v in pairs(chargen.thief_skill) do | |
while dw_can_press_thief_button() do | |
local points = chargen.extraSkillPoints | |
createCharScreen:OnThiefSkillPlusMinusButtonClick(v.id, true) | |
if points == chargen.extraSkillPoints then break end | |
end | |
end | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or ((chargen.levelingUp and (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)>dwHLANumberOld)) and 'HIGH_LEVEL_ABILITIES_BUTTON' or 'DONE_BUTTON'))" | |
clickable lua "reverseButtonPosition and true or ((chargen.levelingUp and (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)>dwHLANumberOld)) or (createCharScreen:IsDoneButtonClickable() or (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)==dwHLANumberOld)))" | |
action | |
" | |
if reverseButtonPosition then | |
for k,v in pairs(dwProficiencyTable) do | |
while plusButtonClickable(k) do | |
local points = chargen.extraProficiencySlots | |
createCharScreen:OnProficiencyPlusMinusButtonClick(v.id, true) | |
if points == chargen.extraProficiencySlots then break end | |
end | |
end | |
for k,v in pairs(chargen.thief_skill) do | |
while dw_can_press_thief_button() do | |
local points = chargen.extraSkillPoints | |
createCharScreen:OnThiefSkillPlusMinusButtonClick(v.id, true) | |
if points == chargen.extraSkillPoints then break end | |
end | |
end | |
createCharScreen:OnCancelButtonClick() | |
else | |
if chargen.levelingUp and (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)>dwHLANumberOld) then | |
createCharScreen:OnHighLevelAbilitiesButtonClick() | |
elseif (createCharScreen:IsDoneButtonClickable() or (createCharScreen:IsHighLevelAbilitiesButtonClickable() and dwHLANumberOld and dwNumberHLAs(true)==dwHLANumberOld)) then | |
dwHLAClickDoneButton() | |
end | |
end | |
" | |
} | |
} | |
` | |
function specialistFrame(num) | |
if spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[num].key].specialist then | |
return 3 | |
end | |
return dwSpecialistSpellExtra(num) | |
end | |
function specialistOrSelectedFrame(num) | |
if chargen.choose_spell[rowNumber].known then | |
return 4 | |
end | |
if chargen.choose_spell[rowNumber].enabled then | |
return 2 | |
end | |
return specialistFrame(num) | |
end | |
function chooseSpellOrGeneralHelp() | |
if needSpecialist then | |
return Infinity_FetchString(engine_mode == 0 and 24318 or 33381) | |
end | |
local spell = chargen.choose_spell[currentChargenChooseMageSpell] | |
if spell then | |
local desc = spellBook[chargen.currentSpellLevelChoice][spell.key].desc | |
if desc ~= -1 then | |
return Infinity_FetchString(desc) | |
end | |
end | |
return Infinity_FetchString(engine_mode == 0 and 24314 or 17250) | |
end | |
function nextOrDone() | |
if(createCharScreen:HasMoreMageLevels()) then | |
return t('NEXT_BUTTON') | |
else | |
return t('DONE_BUTTON') | |
end | |
end | |
function shouldShowSpecialistMessage() | |
return false | |
end | |
function autopickSpells() | |
local spells = {table.unpack(chargen.choose_spell)} | |
local rnd = {} | |
for k, v in pairs(spells) do | |
local spell = spellBook[chargen.currentSpellLevelChoice][v.key] | |
local nb = (spell.autopick and 2 or 0) + (spell.specialist and 1 or 0) | |
rnd[spell.name] = math.random() + nb | |
v.k = k | |
end | |
table.sort(spells, | |
function(v1, v2) | |
local s1 = spellBook[chargen.currentSpellLevelChoice][v1.key] | |
local s2 = spellBook[chargen.currentSpellLevelChoice][v2.key] | |
return rnd[s1.name] > rnd[s2.name] | |
end) | |
for _, v in pairs(spells) do | |
local spell = spellBook[chargen.currentSpellLevelChoice][v.key] | |
if not v.enabled and chargen.extraSpells > 0 then | |
createCharScreen:OnLearnMageSpellButtonClick(v.k) | |
if chargen.extraSpells == 0 and not createCharScreen:IsDoneButtonClickable() then | |
createCharScreen:OnLearnMageSpellButtonClick(v.k) | |
end | |
end | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_CHOOSE_SPELLS' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
dwUpdateChooseSpells() | |
dwLearnSpecialistSpells() | |
dwBuildChooseSpell() | |
dwMarkBonusSpellsKnown() | |
table.sort(chargen.choose_spell, sortBySpellName) | |
currentChargenChooseMageSpell = nil | |
for idx, spell in pairs(chargen.choose_spell) do | |
if spell.enabled then | |
createCharScreen:OnLearnMageSpellButtonClick(idx) | |
end | |
end | |
needSpecialist = false | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "t(chargen.title) .. ': ' .. t('LEVEL_LABEL') .. ' ' .. chargen.currentSpellLevelChoice" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 16 | |
label | |
{ | |
bam GUIBTBUT | |
area 0 0 52 52 | |
align center center | |
frame lua "specialistOrSelectedFrame(rowNumber)" | |
} | |
label | |
{ | |
area 0 0 52 52 | |
bam lua "spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].groundicon" | |
align center center | |
} | |
} | |
column | |
{ | |
width 84 | |
label | |
{ | |
area 8 0 -1 -1 | |
text lua "Infinity_FetchString(spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].name)" | |
text style "normal" | |
align left center | |
} | |
} | |
scrollbar 'GUISCRC' | |
rowheight 52 | |
hidehighlight | |
area 42 192 340 414 | |
table "chargen.choose_spell" | |
var currentChargenChooseMageSpell | |
action | |
" | |
if not chargen.choose_spell[currentChargenChooseMageSpell].known then | |
createCharScreen:OnLearnMageSpellButtonClick(currentChargenChooseMageSpell) | |
end | |
needSpecialist = false | |
if chargen.extraSpells == 0 and not createCharScreen:IsDoneButtonClickable() then | |
createCharScreen:OnLearnMageSpellButtonClick(currentChargenChooseMageSpell) | |
needSpecialist = true | |
end | |
" | |
actionAlt | |
" | |
needSpecialist = false | |
" | |
} | |
label | |
{ | |
area 274 56 336 48 | |
text lua "t('SPELLS_REMAINING_NORMAL') .. ': ' .. chargen.extraSpells" | |
text style "normal" | |
text align center center | |
} | |
label | |
{ | |
area 436 128 382 478 | |
enabled "shouldShowSpecialistMessage()" | |
text lua "dwSpecialistSpellMessage()" | |
text style "normal" | |
text align center center | |
rectangle 0 | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "chooseSpellOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
bam GUIOSTUM | |
area 111 120 201 44 | |
text style "button" | |
text lua "Infinity_FetchString(engine_mode == 0 and 24411 or 34210)" | |
clickable lua "chargen.extraSpells > 0" | |
action | |
" | |
autopickSpells() | |
" | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() and dwChargenSpecialistRequirementsSatisfied(spellBook)" | |
action | |
" | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and nextOrDone() or t('BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and createCharScreen:IsDoneButtonClickable() or true" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and t('BACK_BUTTON') or nextOrDone()" | |
clickable lua "reverseButtonPosition and true or createCharScreen:IsDoneButtonClickable()" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
function mageMemorizeSpellOrGeneralHelp() | |
if needSpecialist then | |
return Infinity_FetchString(engine_mode == 0 and 24318 or 33381) | |
end | |
local spell = chargen.choose_spell[currentChargenMemorizeMageSpell] | |
if spell then | |
local desc = mageSpells[chargen.currentSpellLevelChoice][spell.key].desc | |
if desc ~= -1 then | |
return Infinity_FetchString(desc) | |
end | |
end | |
return Infinity_FetchString(17253) | |
end | |
function spellSelectable(row) | |
if row == 1 then | |
needSpecialist = false | |
end | |
local selectable = true | |
if chargen.extraSpells == 0 then | |
selectable = false | |
elseif chargen.extraSpells == 1 then | |
createCharScreen:OnMemorizeMageSpellButtonClick(row, 1) | |
selectable = createCharScreen:IsDoneButtonClickable() | |
createCharScreen:OnMemorizeMageSpellButtonClick(row, -1) | |
if not selectable then needSpecialist = true end | |
end | |
return selectable | |
end | |
function getMageFrame(cellNum, minus) | |
if minus and chargen.choose_spell[cellNum].count > 0 then | |
return true | |
elseif not minus and spellSelectable(cellNum) then | |
return true | |
else | |
return false | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_MEMORIZE_MAGE' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
table.sort(chargen.choose_spell, sortByMageSpellName) | |
currentChargenMemorizeMageSpell = nil | |
dwIsPriest=nil | |
needSpecialist = false | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "chargen.title" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 16 | |
label | |
{ | |
bam 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 56 | |
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 14 | |
label | |
{ | |
area 0 4 45 42 | |
bam GUIOSW | |
frame lua "getMageFrame(rowNumber, reverseButtonPosition) and currentCellCheck(3) or 3" | |
sequence lua "reverseButtonPosition and 1 or 3" | |
} | |
} | |
column | |
{ | |
width 14 | |
label | |
{ | |
area 0 4 45 42 | |
bam GUIOSW | |
frame lua "getMageFrame(rowNumber, not reverseButtonPosition) and currentCellCheck(4) or 3" | |
sequence lua "reverseButtonPosition and 0 or 4" | |
} | |
} | |
scrollbar 'GUISCRC' | |
rowheight 52 | |
hidehighlight | |
area 42 192 340 414 | |
table "chargen.choose_spell" | |
var currentChargenMemorizeMageSpell | |
action | |
" | |
local delta = reverseButtonPosition and -1 or 1 | |
if cellNumber == 3 and getMageFrame(currentChargenMemorizeMageSpell, reverseButtonPosition) then | |
createCharScreen:OnMemorizeMageSpellButtonClick(currentChargenMemorizeMageSpell, delta) | |
elseif cellNumber == 4 and getMageFrame(currentChargenMemorizeMageSpell, not reverseButtonPosition) then | |
createCharScreen:OnMemorizeMageSpellButtonClick(currentChargenMemorizeMageSpell, -delta) | |
end | |
cellNumber = nil | |
" | |
} | |
label | |
{ | |
area 46 116 336 48 | |
text lua "t('SPELLS_REMAINING_NORMAL') .. ': ' .. chargen.extraSpells" | |
text style "normal" | |
text align center center | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "mageMemorizeSpellOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() and dwChargenSpecialistRequirementsSatisfied(mageSpells)" | |
action | |
" | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and nextOrDone() or t('BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and createCharScreen:IsDoneButtonClickable() or true" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and t('BACK_BUTTON') or nextOrDone()" | |
clickable lua "reverseButtonPosition and true or createCharScreen:IsDoneButtonClickable()" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
}label { | |
area 436 128 382 478 | |
enabled "chargen.extraSpells==0 and not dwChargenSpecialistRequirementsSatisfied(mageSpells)" | |
text lua "dwSpecialistMemoMessage()" | |
text style "normal" | |
text align center center | |
rectangle 0 | |
} | |
} | |
` | |
function priestMemorizeSpellOrGeneralHelp() | |
local spell = chargen.choose_spell[currentChargenMemorizePriestSpell] | |
if spell then | |
local desc = priestSpells[chargen.currentSpellLevelChoice][spell.key].desc | |
if desc ~= -1 then | |
return Infinity_FetchString(desc) | |
end | |
end | |
return Infinity_FetchString(17253) | |
end | |
function getPriestFrame(cellNum, minus) | |
if minus and chargen.choose_spell[cellNum].count > 0 then | |
return true | |
elseif not minus and chargen.extraSpells > 0 then | |
return true | |
else | |
return false | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_MEMORIZE_PRIEST' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
dwBuildChargenPriestChooseSpell() | |
table.sort(chargen.choose_spell, sortByPriestSpellName) | |
currentChargenMemorizePriestSpell = nil | |
dwIsPriest=true | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "chargen.title" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 16 | |
label | |
{ | |
bam 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 56 | |
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 14 | |
label | |
{ | |
area 0 4 45 42 | |
bam GUIOSW | |
frame lua "getPriestFrame(rowNumber, reverseButtonPosition) and currentCellCheck(3) or 3" | |
sequence lua "reverseButtonPosition and 1 or 3" | |
} | |
} | |
column | |
{ | |
width 14 | |
label | |
{ | |
area 0 4 45 42 | |
bam GUIOSW | |
frame lua "getPriestFrame(rowNumber, not reverseButtonPosition) and currentCellCheck(4) or 3" | |
sequence lua "reverseButtonPosition and 0 or 4" | |
} | |
} | |
scrollbar 'GUISCRC' | |
rowheight 52 | |
hidehighlight | |
area 42 192 340 414 | |
table "chargen.choose_spell" | |
var currentChargenMemorizePriestSpell | |
action | |
" | |
local delta = reverseButtonPosition and -1 or 1 | |
if cellNumber == 3 and getPriestFrame(currentChargenMemorizePriestSpell, reverseButtonPosition) then | |
createCharScreen:OnMemorizePriestSpellButtonClick(currentChargenMemorizePriestSpell, delta) | |
elseif cellNumber == 4 and getPriestFrame(currentChargenMemorizePriestSpell, not reverseButtonPosition) then | |
createCharScreen:OnMemorizePriestSpellButtonClick(currentChargenMemorizePriestSpell, -delta) | |
end | |
cellNumber = nil | |
" | |
} | |
label | |
{ | |
area 46 116 336 48 | |
text lua "t('SPELLS_REMAINING_NORMAL') .. ': ' .. chargen.extraSpells" | |
text style "normal" | |
text align center center | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "priestMemorizeSpellOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() and dwChargenSpecialistRequirementsSatisfied(priestSpells)" | |
action | |
" | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and nextOrDone() or t('BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and createCharScreen:IsDoneButtonClickable() or true" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and t('BACK_BUTTON') or nextOrDone()" | |
clickable lua "reverseButtonPosition and true or createCharScreen:IsDoneButtonClickable()" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
}label { | |
area 436 128 382 478 | |
enabled "chargen.extraSpells==0 and not dwChargenSpecialistRequirementsSatisfied(priestSpells)" | |
text lua "dwSpecialistMemoMessage()" | |
text style "normal" | |
text align center center | |
rectangle 0 | |
} | |
} | |
menu | |
{ | |
name 'CHARGEN_CUSTOMSOUNDS' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
currentChargenCustomSound = 1 | |
prepareSounds(chargen.customSound) | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "SOUND_TITLE" | |
text style title | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
button | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenCustomSound and 2 or 0" | |
} | |
button | |
{ | |
area 0 0 340 32 | |
text lua "getSoundStringRef(rowNumber, chargen.customSound)" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
area 42 192 358 414 | |
rowheight 34 | |
hidehighlight | |
table "chargen.customSound" | |
var "currentChargenCustomSound" | |
scrollbar 'GUISCRC' | |
action | |
" | |
createCharScreen:OnSoundItemSelect(chargen.customSound[currentChargenCustomSound].index-1) | |
createCharScreen:OnPlayButtonClick() | |
" | |
actionEnter "hoverChargenCustomSound = mouseoverRow" | |
actionExit "hoverChargenCustomSound = 0" | |
} | |
text | |
{ | |
area 450 198 362 410 | |
text "SOUND_DESCRIPTION" | |
scrollbar 'GUISCRC' | |
text style normal | |
text color D | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable()" | |
action | |
" | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and createCharScreen:IsDoneButtonClickable() or true" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or createCharScreen:IsDoneButtonClickable()" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
function hatedRaceOrGeneralHelp() | |
race = chargen.hatedRace[currentChargenHatedRace] | |
if race then | |
return Infinity_FetchString(race.desc) | |
end | |
return Infinity_FetchString(17256) | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_HATEDRACE' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
currentChargenHatedRace = nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "HATED_RACE_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenHatedRace and 2 or 0" | |
} | |
label | |
{ | |
area 0 0 340 32 | |
text lua "Infinity_FetchString(chargen.hatedRace[rowNumber].name)" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
if chargen.hatedRace[currentChargenHatedRace] then | |
createCharScreen:OnRacialEnemySelectButtonClick(chargen.hatedRace[currentChargenHatedRace].id) | |
end | |
" | |
area 42 192 358 414 | |
rowheight 34 | |
hidehighlight | |
table "chargen.hatedRace" | |
var currentChargenHatedRace | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 450 198 362 410 | |
text lua "hatedRaceOrGeneralHelp()" | |
text style normal | |
text color D | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable()" | |
action | |
" | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and createCharScreen:IsDoneButtonClickable() or true" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or createCharScreen:IsDoneButtonClickable()" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
charNameEdit = "" | |
` | |
menu | |
{ | |
name 'CHARGEN_NAME' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
Infinity_PlaySound('GAM_03') | |
charNameEdit = chargen.name or '' | |
Infinity_FocusTextEdit('charNameEditArea') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label | |
{ | |
area 70 70 264 42 | |
text "ENTER_NAME_LABEL" | |
text style "title" | |
} | |
label | |
{ | |
area 74 116 256 34 | |
fill 112 111 111 64 | |
} | |
edit | |
{ | |
name "charNameEditArea" | |
area 80 122 244 24 | |
var charNameEdit | |
text style "edit" | |
maxlines 1 | |
maxchars 20 | |
action | |
" | |
--if key_pressed is return | |
if (key_pressed == 13) then | |
return 0 | |
end | |
return 1 | |
" | |
} | |
button | |
{ | |
on return | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "DONE_BUTTON" | |
text style "button" | |
clickable lua "createCharScreen:IsDoneButtonClickable()" | |
action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" | |
} | |
button | |
{ | |
on escape | |
area 52 266 300 44 | |
bam GUIOSTCL | |
text "BACK_BUTTON" | |
text style "button" | |
action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()" | |
} | |
} | |
` | |
createBioEdit = "" | |
function generateBioText() | |
if currentChargenRace == nil or currentChargenClass == nil or currentChargenKit == nil then | |
return | |
end | |
if bioClassData == nil or bioRaceData == nil then | |
return | |
end | |
local MyRace = chargen.races[currentChargenRace].id | |
local MyClass = chargen.class[currentChargenClass].id | |
local MyKit = chargen.kit[currentChargenKit].id | |
local colClass = 2 + Infinity_GetINIValue('Program Options','Active Campaign') | |
local colRace = 1 + Infinity_GetINIValue('Program Options','Active Campaign') | |
-- Go through each row of bioClassData | |
for i=1,#bioClassData,1 do | |
-- Check chargen.class and chargen.kit to find a match against the current row | |
if MyClass == bioClassData[i][1] and MyKit == bioClassData[i][2] then | |
createBioEdit = Infinity_FetchString(bioClassData[i][colClass]) | |
end | |
end | |
-- Go through each row of bioRaceData | |
for i=1,#bioRaceData,1 do | |
-- Check chargen.race to find a match against the current row | |
if MyRace == bioRaceData[i][1] then | |
createBioEdit = createBioEdit .. '\n\n' .. Infinity_FetchString(bioRaceData[i][colRace]) | |
end | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_BIO' | |
align center center | |
modal | |
ignoreesc | |
onOpen | |
" | |
createBioEdit=dwSubraceBioSwap(createBioEdit) | |
dwUpdatedBio=true | |
if dwAutoBioSet then | |
createCharScreen:OnDoneButtonClick() | |
createCharScreen:AcceptCharacter(-1) | |
end | |
generateBioText() | |
createBioEditBackup = createBioEdit | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "BIOGRAPHY_TITLE" | |
text style 'title' | |
} | |
edit | |
{ | |
name "createBioEditArea" | |
area 436 128 382 478 | |
var createBioEdit | |
scrollbar 'GUISCRC' | |
text style "edit" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 192 340 32 | |
text style "button" | |
text "CLEAR_BUTTON" | |
action | |
" | |
createBioEdit = '' | |
" | |
} | |
button | |
{ | |
bam GUICHLNG | |
area 42 228 340 32 | |
text style "button" | |
text "REVERT_BUTTON" | |
action | |
" | |
createBioEdit = createBioEditBackup | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
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 | |
modal | |
ignoreesc | |
onOpen | |
" | |
list_GUICG_20_2_idx = 0 | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "IMPORT_TITLE" | |
text style title | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= list_GUICG_20_2_idx and rowNumber ~= list_GUICG_20_2_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUICG_20_2[rowNumber]" | |
text style "normal" | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUICG_20_2_idx and rowNumber ~= list_GUICG_20_2_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUICG_20_2[rowNumber]" | |
text style "normal" | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUICG_20_2_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUICG_20_2[rowNumber]" | |
text style "normal" | |
text color H | |
} | |
} | |
area 46 198 356 410 | |
rowheight dynamic | |
hidehighlight | |
table "list_GUICG_20_2" | |
var "list_GUICG_20_2_idx" | |
scrollbar 'GUISCRC' | |
action | |
" | |
Infinity_OnCharacterImportItemSelect(list_GUICG_20_2_idx - 1) | |
" | |
actionEnter "list_GUICG_20_2_hover = mouseoverRow" | |
actionExit "list_GUICG_20_2_hover = 0" | |
} | |
text | |
{ | |
area 450 198 362 410 | |
text 10963 | |
scrollbar 'GUISCRC' | |
text style normal | |
text color D | |
} | |
button | |
{ | |
on return | |
clickable lua "list_GUICG_20_2_idx > 0" | |
action | |
" | |
Infinity_PopMenu('CHARGEN_IMPORT') | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu('CHARGEN_IMPORT') | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and NextOrDone() or t('CANCEL_BUTTON')" | |
clickable lua "reverseButtonPosition and list_GUICG_20_2_idx > 0 or true" | |
action | |
" | |
Infinity_PopMenu('CHARGEN_IMPORT') | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "reverseButtonPosition and t('CANCEL_BUTTON') or NextOrDone()" | |
clickable lua "reverseButtonPosition and true or list_GUICG_20_2_idx > 0" | |
action | |
" | |
Infinity_PopMenu('CHARGEN_IMPORT') | |
if reverseButtonPosition then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
chargenExportCharacterEdit = "" | |
list_GUICG_21_2_idx = 0 | |
` | |
menu | |
{ | |
name 'CHARGEN_EXPORT' | |
align center center | |
modal | |
ignoreEsc | |
onOpen | |
" | |
chargenExportCharacterEdit = chargen.name | |
Infinity_FocusTextEdit('chargenExportCharacterEditArea') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "EXPORT_TITLE" | |
text style title | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= list_GUICG_21_2_idx and rowNumber ~= list_GUICG_21_2_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUICG_21_2[rowNumber]" | |
text style "normal" | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUICG_21_2_idx and rowNumber ~= list_GUICG_21_2_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUICG_21_2[rowNumber]" | |
text style "normal" | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUICG_21_2_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUICG_21_2[rowNumber]" | |
text style "normal" | |
text color H | |
} | |
} | |
area 46 198 356 410 | |
rowheight dynamic | |
hidehighlight | |
table "list_GUICG_21_2" | |
var "list_GUICG_21_2_idx" | |
scrollbar 'GUISCRC' | |
action | |
" | |
createCharScreen:OnCharacterExportItemSelect(list_GUICG_21_2_idx - 1) | |
" | |
actionEnter "list_GUICG_21_2_hover = mouseoverRow" | |
actionExit "list_GUICG_21_2_hover = 0" | |
} | |
label | |
{ | |
area 46 120 390 44 | |
text "EXPORT_FILENAME_LABEL" | |
text style "label" | |
text align right center | |
} | |
edit | |
{ | |
name "chargenExportCharacterEditArea" | |
area 440 132 200 32 | |
var chargenExportCharacterEdit | |
text style "edit" | |
maxlines 1 | |
action | |
" | |
if(chargenExportCharacterEdit:len() > 7 and key_pressed ~= 8) then | |
return 0 | |
end | |
return 1 | |
" | |
} | |
text | |
{ | |
area 450 198 362 410 | |
text 10962 | |
scrollbar 'GUISCRC' | |
text style normal | |
text color D | |
} | |
button | |
{ | |
on return | |
action | |
" | |
Infinity_PopMenu('CHARGEN_EXPORT') | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu('CHARGEN_EXPORT') | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
action | |
" | |
Infinity_PopMenu('CHARGEN_EXPORT') | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
action | |
" | |
Infinity_PopMenu('CHARGEN_EXPORT') | |
if reverseButtonPosition then | |
createCharScreen:OnCancelButtonClick() | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARGEN_DUALCLASS' | |
align center center | |
ignoreesc | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIDCX | |
} | |
label | |
{ | |
area 82 10 700 44 | |
text "DUALCLASS_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 62 130 363 36 | |
text lua "characters[currentID].name" | |
text style "label" | |
} | |
label | |
{ | |
area 459 130 363 36 | |
text lua "dwFilterKitDesc(characters[currentID].class)" | |
text style "label" | |
} | |
label | |
{ | |
area 140 191 169 266 | |
bitmap lua "characters[currentID].portrait" | |
} | |
text | |
{ | |
area 481 194 336 407 | |
text 10811 --dual class info | |
text style "parchment" | |
text color D | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
area 90 498 300 44 | |
clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_CLASS" | |
bam GUIOSTCL | |
text "CLASS_BUTTON" | |
text style "button" | |
action | |
" | |
createCharScreen:OnMenuButtonClick() | |
" | |
} | |
button | |
{ | |
area 90 546 300 44 | |
clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_PROFICIENCIES" | |
bam GUIOSTCL | |
text "SKILLS_BUTTON" | |
text style "button" | |
action | |
" | |
createCharScreen:OnMenuButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
clickable lua "reverseButtonPosition and createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_DONE or true" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'CANCEL_BUTTON')" | |
text style "button" | |
action | |
" | |
if reverseButtonPosition then | |
dwIsDualClassing=false;createCharScreen:OnDoneButtonClick() | |
else | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
clickable lua "reverseButtonPosition and true or createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_DONE" | |
text lua "t(reverseButtonPosition and 'CANCEL_BUTTON' or 'DONE_BUTTON')" | |
text style "button" | |
action | |
" | |
if reverseButtonPosition then | |
createCharScreen:OnCancelButtonClick() | |
else | |
dwIsDualClassing=false;createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
` | |
difficulties = | |
{ | |
{name = "DIFFICULTY_LABEL_STORYMODE", description = "DIFFICULTY_DESCRIPTION_STORYMODE"}, | |
{name = "DIFFICULTY_LABEL_EASY", description = "DIFFICULTY_DESCRIPTION_EASY"}, | |
{name = "DIFFICULTY_LABEL_NORMAL", description = "DIFFICULTY_DESCRIPTION_NORMAL"}, | |
{name = "DIFFICULTY_LABEL_CORERULES", description = "DIFFICULTY_DESCRIPTION_CORERULES"}, | |
{name = "DIFFICULTY_LABEL_HARD", description = "DIFFICULTY_DESCRIPTION_HARD"}, | |
{name = "DIFFICULTY_LABEL_INSANE", description = "DIFFICULTY_DESCRIPTION_INSANE"}, | |
{name = "DIFFICULTY_LABEL_LEGACYOFBHAAL", description = "DIFFICULTY_DESCRIPTION_LEGACYOFBHAAL"}, | |
} | |
fromMultiPlayer = false | |
` | |
menu | |
{ | |
name 'CHARGEN_DIFFICULTY' | |
align center center | |
ignoreesc | |
onopen | |
" | |
currentDifficulty = 3 | |
" | |
label | |
{ | |
mosaic GUICREDT | |
area 0 0 1024 768 | |
} | |
label | |
{ | |
area 128 6 760 42 | |
text "DIFFICULTY_LABEL" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 20 7 60 70 | |
bam GUIDIFFS | |
frame lua "rowNumber-1" | |
align center center | |
glow lua "rowNumber == mouseoverRow" | |
} | |
label | |
{ | |
area 110 0 64 84 | |
text lua "t(difficulties[rowNumber].name)" | |
text style "label" | |
text align center center | |
glow lua "rowNumber == mouseoverRow" | |
} | |
label | |
{ | |
area 200 0 -1 84 | |
text lua "t(difficulties[rowNumber].description)" | |
text style "label" | |
text point 12 | |
text align left center | |
glow lua "rowNumber == mouseoverRow" | |
} | |
label | |
{ | |
enabled "currentDifficulty ~= rowNumber" | |
area 0 0 946 84 | |
rectangle 1 | |
rectangle opacity 150 | |
} | |
} | |
area 84 90 856 588 | |
hidehighlight | |
rowheight 84 | |
table "difficulties" | |
var "currentDifficulty" | |
actionEnter "" | |
actionExit "mouseoverRow = 0" | |
} | |
button | |
{ | |
area 200 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
text lua "t('VENTURE_FORTH')" | |
text style "button" | |
enabled "not fromMultiPlayer" | |
action | |
" | |
Infinity_PopMenu() | |
dwIsChargen=false;createCharScreen:AcceptCharacter(currentDifficulty) | |
" | |
} | |
button | |
{ | |
area 200 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
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() | |
" | |
} | |
button | |
{ | |
on escape | |
area 530 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
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 | |
" | |
} | |
} | |
` | |
currentHLASelection = nil | |
function chargenHLADescription() | |
if currentHLASelection == nil then | |
return 34550 | |
else | |
hla=chargen.HLAs[dwHLATable[currentHLASelection].index] | |
if dwHLADescriptionOverride[hla.resref] then | |
return dwHLADescriptionOverride[hla.resref] | |
else | |
return hla.description | |
end | |
end | |
end | |
function chargenHLAPlusMinusFrame(minus, cell, rownumber) | |
if minus and chargen.HLAs[rownumber].canSubtract then | |
return currentCellCheck(cell) | |
elseif not minus and chargen.HLAs[rownumber].canAdd then | |
return currentCellCheck(cell) | |
else | |
return 3 | |
end | |
end | |
` | |
menu | |
{ | |
name 'CHARGEN_HIGH_LEVEL_ABILITIES' | |
align center center | |
ignoreesc | |
modal | |
OnOpen | |
" | |
dwHLATable=dwBuildHLATable() | |
currentHLASelection = nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISF | |
} | |
label | |
{ | |
area 74 10 716 44 | |
text "HIGH_LEVEL_ABILITIES_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 192 130 248 28 | |
text 34549 | |
text style "label" | |
text align right center | |
} | |
label | |
{ | |
area 450 130 50 28 | |
text lua "chargen.numHLAs" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 51 | |
label | |
{ | |
area 4 0 -1 -1 | |
text lua "Infinity_FetchString(dwHLAName(chargen.HLAs[dwHLATable[rowNumber].index]))" | |
text style "normal" | |
align left center | |
} | |
} | |
column | |
{ | |
width 5 | |
label | |
{ | |
bam GUIPFC | |
area 0 19 16 16 | |
align center center | |
enabled "chargen.HLAs[dwHLATable[rowNumber].index].count > 4" | |
} | |
} | |
column | |
{ | |
width 5 | |
label | |
{ | |
bam GUIPFC | |
area 0 19 16 16 | |
align center center | |
enabled "chargen.HLAs[dwHLATable[rowNumber].index].count > 3" | |
} | |
} | |
column | |
{ | |
width 5 | |
label | |
{ | |
bam GUIPFC | |
area 0 19 16 16 | |
align center center | |
enabled "chargen.HLAs[dwHLATable[rowNumber].index].count > 2" | |
} | |
} | |
column | |
{ | |
width 5 | |
label | |
{ | |
bam GUIPFC | |
area 0 19 16 16 | |
align center center | |
enabled "chargen.HLAs[dwHLATable[rowNumber].index].count > 1" | |
} | |
} | |
column | |
{ | |
width 5 | |
label | |
{ | |
bam GUIPFC | |
area 0 19 16 16 | |
align center center | |
enabled "chargen.HLAs[dwHLATable[rowNumber].index].count > 0" | |
} | |
} | |
column | |
{ | |
width 12 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
frame lua "chargenHLAPlusMinusFrame(8,dwHLATable[rowNumber].index)" | |
sequence 0 | |
} | |
} | |
column | |
{ | |
width 12 | |
label | |
{ | |
area 0 6 45 42 | |
bam GUIOSW | |
frame lua "chargenHLAPlusMinusFrame(9,dwHLATable[rowNumber].index)" | |
sequence 1 | |
} | |
} | |
scrollbar 'GUISCRC' | |
rowheight 54 | |
area 46 194 358 417 | |
table "dwHLATable" | |
var currentHLASelection | |
action | |
" | |
if cellNumber == 7 and chargenHLAPlusMinusFrame(8,dwHLATable[currentHLASelection].index) ~= 3 then | |
createCharScreen:OnHLAButtonClick(dwHLATable[currentHLASelection].index, 1) | |
dwHLATable[currentHLASelection].count = dwHLATable[currentHLASelection].count+1 | |
elseif cellNumber == 8 and chargenHLAPlusMinusFrame(9,dwHLATable[currentHLASelection].index) ~= 3 then | |
createCharScreen:OnHLAButtonClick(dwHLATable[currentHLASelection].index, -1) | |
dwHLATable[currentHLASelection].count = dwHLATable[currentHLASelection].count - 1 | |
end | |
cellNumber = nil | |
" | |
} | |
text | |
{ | |
area 446 194 378 417 | |
text lua "Infinity_FetchString(chargenHLADescription())" | |
text style "normal" | |
text color 'D' | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
area 464 653 236 44 | |
bam GUIOSTUR | |
sequence 0 | |
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 201 44 | |
bam GUIOSTUM | |
text "DONE_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
list_GUIMOVIE_0_0_idx = 0 | |
` | |
menu | |
{ | |
name 'MOVIES' | |
align center center | |
modal | |
button | |
{ | |
on escape | |
action | |
" | |
e:SelectEngine(optionsScreen) | |
" | |
} | |
label | |
{ | |
area 0 0 515 734 | |
mosaic GUIERR9 | |
} | |
label | |
{ | |
area 64 118 390 44 | |
text "MOVIES_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "rowNumber ~= list_GUIMOVIE_0_0_idx and rowNumber ~= list_GUIMOVIE_0_0_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUIMOVIE_0_0[rowNumber].description" | |
text style "normal" | |
text align left center | |
text color D | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUIMOVIE_0_0_idx and rowNumber ~= list_GUIMOVIE_0_0_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUIMOVIE_0_0[rowNumber].description" | |
text style "normal" | |
text align left center | |
text color S | |
} | |
label | |
{ | |
enabled "rowNumber == list_GUIMOVIE_0_0_hover" | |
area 0 0 -1 -1 | |
text lua "list_GUIMOVIE_0_0[rowNumber].description" | |
text style "normal" | |
text align left center | |
text color H | |
} | |
} | |
area 70 162 380 266 | |
rowheight 26 | |
hidehighlight | |
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) | |
" | |
actionEnter "list_GUIMOVIE_0_0_hover = mouseoverRow" | |
actionExit "list_GUIMOVIE_0_0_hover = 0" | |
} | |
button | |
{ | |
clickable lua "list_GUIMOVIE_0_0_idx > 0" | |
area 110 495 300 44 | |
bam GUIOSTCL | |
text "PLAY_MOVIE_BUTTON" | |
text style "button" | |
action "moviesScreen:OnPlayButtonClick()" | |
} | |
button | |
{ | |
area 110 545 300 44 | |
bam GUIOSTCL | |
text "CREDITS_MOVIE_BUTTON" | |
text style "button" | |
action "moviesScreen:OnCreditsButtonClick()" | |
} | |
button | |
{ | |
area 110 595 300 44 | |
bam GUIOSTCL | |
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"] == "bgee-main" then | |
ret = t("MAIN_GAME_LABEL") | |
elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bgee-bp" then | |
ret = t("ARENA_MODE_LABEL") | |
elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bgee-sod" then | |
ret = t("EXPANSION_LABEL") | |
elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bg2ee-main" then | |
ret = t("MAIN_GAME_BG2_LABEL") | |
elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bg2ee-bp" then | |
ret = t("ARENA_MODE_BG2_LABEL") | |
elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bg2ee-tob" then | |
ret = t("EXPANSION_BG2_LABEL") | |
end | |
end | |
return ret | |
end | |
function matchMultiplayerGameType(gameVersion) | |
if gameVersion == "bgee-main" then | |
startEngine:OnCampaignButtonClick('BG1',false) | |
e:CheckGUISong() | |
elseif gameVersion == "bgee-bp" then | |
startEngine:OnCampaignButtonClick('BP1',false) | |
e:CheckGUISong() | |
elseif gameVersion == "bgee-sod" then | |
startEngine:OnCampaignButtonClick('SOD',false) | |
e:CheckGUISong() | |
elseif gameVersion == "bg2ee-main" then | |
startEngine:OnCampaignButtonClick('SOA',false) | |
e:CheckGUISong() | |
elseif gameVersion == "bg2ee-bp" then | |
startEngine:OnCampaignButtonClick('BP2',false) | |
e:CheckGUISong() | |
elseif gameVersion == "bg2ee-tob" then | |
startEngine:OnCampaignButtonClick('TOB',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 40 | |
text "JOIN_GAME_TITLE" | |
text style title | |
} | |
label | |
{ | |
area 66 190 506 22 | |
text lua "t('GAME_NAME_LABEL')" | |
text style "label_parchment" | |
align center center | |
} | |
label | |
{ | |
area 572 190 88 22 | |
text lua "t('PASSWORD_LABEL')" | |
text style "label_parchment" | |
align center center | |
} | |
label | |
{ | |
area 660 190 77 22 | |
text lua "t('PLAYERS_LABEL')" | |
text style "label_parchment" | |
align center center | |
} | |
label | |
{ | |
area 737 190 179 22 | |
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 66 208 888 376 | |
rowheight 44 | |
table "mp_shownSessions" | |
var selectedMp | |
scrollbar 'GUISCRC' | |
action | |
" | |
selectedIndex = mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['sessionIDString'] | |
" | |
} | |
label -- player name | |
{ | |
area 300 68 210 40 | |
text "PLAYER_NAME_LABEL" | |
text style "label" | |
} | |
label | |
{ | |
area 308 104 218 34 | |
fill 112 111 111 64 | |
} | |
edit | |
{ | |
area 312 110 210 24 | |
var connectionPlayerNameEdit | |
text style "edit" | |
text align center center | |
maxlines 1 | |
maxchars 32 | |
} | |
label -- filter options | |
{ | |
area 572 69 165 45 | |
text style 'label' | |
text "CONNECTION_NOT_PASSWORD_PROTECTED_LABEL" | |
align left center | |
tooltip lua "t('CONNECTION_NO_PASSWORDS_TOOLTIP')" | |
} | |
button | |
{ | |
area 527 69 45 45 | |
bam ROUNDBUT | |
glow lua "connectionFilterNoPasswords" | |
align center center | |
tooltip lua "t('CONNECTION_NO_PASSWORDS_TOOLTIP')" | |
action | |
" | |
connectionFilterNoPasswords = 1 - connectionFilterNoPasswords | |
connectionBuildGameList() | |
" | |
} | |
label | |
{ | |
area 572 114 165 44 | |
text style 'label' | |
text "CONNECTION_NOT_FULL_LABEL" | |
align left center | |
tooltip lua "t('CONNECTION_NO_FULL_GAMES_TOOLTIP')" | |
} | |
button | |
{ | |
area 527 114 45 45 | |
bam ROUNDBUT | |
glow lua "connectionFilterNoFullGames" | |
align center center | |
tooltip lua "t('CONNECTION_NO_FULL_GAMES_TOOLTIP')" | |
action | |
" | |
connectionFilterNoFullGames = 1 - connectionFilterNoFullGames | |
connectionBuildGameList() | |
" | |
} | |
button -- Create game | |
{ | |
area 52 128 206 44 | |
bam GUIOSTUM | |
sequence 6 | |
text "CONNECTION_CREATE_NEW_GAME_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PushMenu('CONNECTION_CREATE') | |
" | |
} | |
button -- Direct Connect | |
{ | |
area 408 614 206 44 | |
bam GUIOSTUM | |
sequence 6 | |
text "CONNECTION_DIRECT_CONNECTION_BUTTON" | |
text style "button" | |
tooltip lua "t('CONNECTION_DIRECT_CONNECT_TOOLTIP')" | |
action | |
" | |
selectedMp = 0 | |
mp_shownSessions = {} | |
mp_sessions = {} | |
connectionIsHosting = false | |
chooseNetworkProtocol(2) | |
" | |
} | |
button -- refresh | |
{ | |
area 904 69 94 95 | |
bam GUMPBUTX | |
sequence 2 | |
align center center | |
tooltip lua "t('CONNECTION_REFRESH_TOOLTIP')" | |
action | |
" | |
selectedMp = 0 | |
mp_shownSessions = {} | |
mp_sessions = {} | |
connectionScreen:ClearSessions() | |
" | |
} | |
button -- Join game | |
{ | |
area 264 670 234 44 | |
bam GUIOSTUL | |
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 536 670 234 44 | |
bam GUIOSTUR | |
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 677 234 | |
mosaic GUIERR6 | |
} | |
label --Title | |
{ | |
area 38 10 592 64 | |
text 20681 | |
text style "label" | |
} | |
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 | |
} | |
button | |
{ | |
area 94 170 234 44 | |
bam GUIOSTUL | |
text "DONE_BUTTON" | |
text style "button" | |
on return | |
clickable lua "connectionScreen:IsValidAddress(connectionTCPIPEdit)" | |
action | |
" | |
Infinity_PopMenu() | |
connectionScreen:JoinGameIPAddress(connectionTCPIPEdit) | |
" | |
} | |
button | |
{ | |
area 364 170 234 44 | |
bam GUIOSTUR | |
text "CANCEL_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
chooseNetworkProtocol(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) | |
Infinity_SetINIValue('Multiplayer', 'Player Name', connectionPlayerNameEdit) | |
end | |
if connectionSessionPasswordEdit == "" then | |
connectionSessionPasswordEdit = Infinity_GetINIString('Multiplayer', 'Session Password', pass) | |
Infinity_SetINIValue('Multiplayer', 'Session Password', connectionSessionPasswordEdit) | |
end | |
if connectionSessionNameEdit == "" then | |
connectionSessionNameEdit = Infinity_GetINIString('Multiplayer', 'Session Name', game) | |
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 100 10 302 24 | |
text style 'title' | |
text "CREATEGAME_TITLE" | |
} | |
label -- player | |
{ | |
area 80 69 340 45 | |
text style 'label' | |
text "PLAYER_NAME_LABEL" | |
} | |
edit | |
{ | |
area 100 114 298 30 | |
var connectionPlayerNameEdit | |
text style "edit" | |
maxlines 1 | |
maxchars 32 | |
fill 112 111 111 64 | |
} | |
label -- session | |
{ | |
area 80 159 340 45 | |
text style 'label' | |
text "SESSION_NAME_LABEL" | |
} | |
edit | |
{ | |
name "connectionSessionNameEditArea" | |
area 100 204 304 30 | |
var connectionSessionNameEdit | |
text style "edit" | |
maxlines 1 | |
fill 112 111 111 64 | |
} | |
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 45 45 | |
bam ROUNDBUT | |
glow lua "connectionPasswordProtected" | |
align center center | |
tooltip lua "t('CONNECTION_PASSWORD_PROTECTED_TOOLTIP')" | |
action | |
" | |
connectionPasswordProtected = 1 - connectionPasswordProtected | |
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 45 45 | |
bam ROUNDBUT | |
glow lua "connectionLocalNetworkGame" | |
align center center | |
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 404 304 30 | |
var connectionSessionPasswordEdit | |
text style "edit" | |
maxlines 1 | |
enabled connectionPasswordProtected | |
fill 112 111 111 64 | |
} | |
button | |
{ | |
clickable lua "connectionCreateGameClickable()" | |
area 152 530 201 44 | |
bam GUIOSTUM | |
text style "button" | |
text "CREATEGAME_BUTTON" | |
action | |
" | |
connectionPlayerNameEdit = trim(connectionPlayerNameEdit) | |
connectionSessionNameEdit = trim(connectionSessionNameEdit) | |
connectionSessionPasswordEdit = trim(connectionSessionPasswordEdit) | |
if connectionPasswordProtected == 0 then | |
connectionSessionPasswordEdit = '' | |
end | |
Infinity_PushMenu('CONNECTION_NEWORSAVED') | |
" | |
} | |
button | |
{ | |
area 152 578 201 44 | |
bam GUIOSTUM | |
text style "button" | |
text "BACK_BUTTON" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'CONNECTION_NEWORSAVED' | |
align center center | |
modal | |
label | |
{ | |
area 0 0 677 234 | |
mosaic GUIERR6 | |
} | |
label | |
{ | |
area 40 18 600 38 | |
text style 'title' | |
text "CONNECTION_NEW_OR_SAVED_GAME_TITLE" | |
} | |
label | |
{ | |
area 36 88 600 45 | |
text style 'label' | |
text "CONNECTION_SELECT_GAME_TYPE_LABEL" | |
} | |
button | |
{ | |
bam GUIOSW | |
on escape | |
area 592 12 45 42 | |
sequence 2 | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
area 94 170 234 44 | |
bam GUIOSTUL | |
text style "button" | |
text "NEW_GAME_BUTTON" | |
tooltip lua "t('CONNECTION_NEW_GAME_TOOLTIP')" | |
action | |
" | |
fromMultiPlayer = true | |
Infinity_PushMenu('CHARGEN_DIFFICULTY') | |
" | |
} | |
button | |
{ | |
area 364 170 234 44 | |
bam GUIOSTUR | |
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() | |
" | |
} | |
} | |
` | |
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 677 234 | |
mosaic GUIERR6 | |
} | |
label | |
{ | |
area 34 16 604 54 | |
text style 'title' | |
text "PASSWORD_REQUIRED_LABEL" | |
} | |
label | |
{ | |
area 34 70 604 38 | |
text style 'label' | |
text "ENTER_PASSWORD_LABEL" | |
} | |
edit | |
{ | |
name "connectionPasswordPasswordEditArea" | |
area 36 108 600 34 | |
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 94 170 234 44 | |
bam GUIOSTUL | |
text style "button" | |
text "DONE_BUTTON" | |
clickable lua "connectionPasswordPasswordEdit ~='' and string.find(connectionPasswordPasswordEdit, '%S') ~= nil" | |
on return | |
action | |
" | |
Infinity_PopMenu() | |
mp_sessions[selectedMp]['password'] = trim(connectionPasswordPasswordEdit) | |
Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex']) | |
" | |
} | |
button | |
{ | |
area 364 170 234 44 | |
bam GUIOSTUR | |
text "BACK_BUTTON" | |
text style"button" | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
connectionNameNameEdit = "" | |
` | |
menu | |
{ | |
name 'CONNECTION_NAME' | |
align center center | |
modal | |
onOpen | |
" | |
connectionNameNameEdit = '' | |
Infinity_FocusTextEdit('connectionNameNameEditArea') | |
" | |
label | |
{ | |
area 0 0 677 234 | |
mosaic GUIERR6 | |
} | |
label | |
{ | |
area 38 20 592 64 | |
text style 'title' | |
text "PLAYER_NAME_LABEL" | |
} | |
edit | |
{ | |
name "connectionNameNameEditArea" | |
area 62 88 532 32 | |
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 94 170 234 44 | |
bam GUIOSTUL | |
text "DONE_BUTTON" | |
text style "button" | |
on return | |
clickable lua "connectionNameNameEdit ~='' and string.find(connectionNameNameEdit, '%S') ~= nil" | |
action | |
" | |
Infinity_PopMenu() | |
connectionPlayerNameEdit = trim(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 364 170 234 44 | |
bam GUIOSTUR | |
text "BACK_BUTTON" | |
text style "button" | |
on escape | |
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 83 59 338 32 | |
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 | |
} | |
} | |
hidehighlight | |
rowheight 50 | |
area 83 99 338 338 | |
table "connection.currentPlayers" | |
} | |
edit | |
{ | |
name "connectionPlayerNameEditArea" | |
area 110 479 280 35 | |
var connectionPlayerNameEdit | |
text style "edit" | |
text align center center | |
maxlines 1 | |
maxchars 32 | |
} | |
button | |
{ | |
clickable lua "connectionPlayerNameEdit ~= ''" | |
area 154 538 201 44 | |
bam GUIOSTUM | |
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 406 415 | |
mosaic GUIERR | |
} | |
label --Title | |
{ | |
area 82 74 242 88 | |
text 20274 | |
text style "label" | |
} | |
button | |
{ | |
on escape | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "CANCEL_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'CONNECTION_ERROR' | |
modal | |
align center center | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label --Title | |
{ | |
area 82 74 242 88 | |
text lua "Infinity_FetchString(CONNECTION_ERROR_MESSAGE)" | |
text style "label" | |
} | |
button | |
{ | |
on escape | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "CANCEL_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'CONNECTION_WAITING_FOR_PROVIDER' | |
modal | |
align center center | |
label | |
{ | |
area 0 0 677 234 | |
mosaic GUIERR6 | |
} | |
label --Title | |
{ | |
area 34 10 606 128 | |
text "CONNECTION_FINDING_DEVICES" | |
text style "label" | |
} | |
button | |
{ | |
area 94 170 234 44 | |
bam GUIOSTUL | |
text "CONNECTION_LOCAL_NETWORK_GAME" | |
text style "button" | |
on return | |
action | |
" | |
Infinity_PopMenu('CONNECTION_WAITING_FOR_PROVIDER') | |
connectionScreen:StopConnectingToProvider() | |
" | |
} | |
button | |
{ | |
area 364 170 234 44 | |
bam GUIOSTUR | |
text "CANCEL_BUTTON" | |
text style "button" | |
on escape | |
action | |
" | |
Infinity_PopMenu('CONNECTION_WAITING_FOR_PROVIDER') | |
Infinity_PopMenu('CONNECTION') | |
connectionScreen:OnMainCancelButtonClick() | |
" | |
} | |
} | |
menu | |
{ | |
name 'CONNECTION_WAITING_FOR_SERVER' | |
modal | |
align center center | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label --Title | |
{ | |
area 82 74 242 88 | |
text "CONNECTION_WAITING_FOR_SERVER" | |
text style "label" | |
} | |
button | |
{ | |
on escape | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "CANCEL_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu('CONNECTION_WAITING_FOR_SERVER') | |
connectionScreen:CancelJoinGame() | |
" | |
} | |
} | |
` | |
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 = "" | |
multiplayerDifficultyImage = 0 | |
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 = "0x7a7aFF"}, | |
{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("<PLAYER_NAME_1>",getMultiplayerPlayerName(mpaCharacters[slot]["player"], false, true)) | |
setStringTokenLua("<SEPERATOR>",separator) | |
ret = t("MULTIPLAYER_CREATING_CHARACTER_MESSAGE") | |
removeStringTokenLua("<SEPERATOR>") | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
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, chapterText, 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"..chapterText.."^-" | |
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).."^-" | |
multiplayerDifficultyImage = difficulty - 1 | |
end | |
else | |
multiplayerSaveName = gold..t("MULTIPLAYER_NEW_GAME_LABEL").."^- ^0xffffffff"..saveName.."^-" | |
multiplayerChapter = gold..t("MULTIPLAYER_CHAPTER_LABEL").."^- ^0xffffffff"..chapterText.."^-" | |
multiplayerTimePlayed = gold..t("MULTIPLAYER_TIME_PLAYED_NEW_GAME").."^-" | |
if difficulty > 0 then | |
multiplayerDifficultyLabel = gold..t("MULTIPLAYER_DIFFICULTY_LABEL").."^-^0xffffffff"..t(difficulties[difficulty].name).."^-" | |
multiplayerDifficultyImage = difficulty - 1 | |
end | |
end | |
end | |
function broadcastCharacterControlChange(slot, newPlayer) | |
if mpaCharacters[slot]["player"] ~= newPlayer then | |
local host = getMultiplayerPlayerName(1,false,false) | |
local player = getMultiplayerPlayerName(newPlayer,false,false) | |
setStringTokenLua("<PLAYER_NAME_1>",host) | |
setStringTokenLua("<PLAYER_NAME_2>",player) | |
local message = t("MULTIPLAYER_SLOT_"..slot.."_ASSIGNED_TO") | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
removeStringTokenLua("<PLAYER_NAME_2>") | |
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_NAME_1>",player) | |
setStringTokenLua("<CHARACTER_NAME_1>",character) | |
local message = t("MULTIPLAYER_HAS_ADDED") | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
removeStringTokenLua("<CHARACTER_NAME_1>") | |
Infinity_SendChatMessage(message, true) | |
end | |
function broadcastCharacterRemoved(slot) | |
local player = getMultiplayerPlayerName(mpaCharacters[slot]["player"],false,false) | |
local character = getMultiplayerCharacterName(slot, false, true) | |
setStringTokenLua("<PLAYER_NAME_1>",player) | |
setStringTokenLua("<CHARACTER_NAME_1>",character) | |
local message = t("MULTIPLAYER_HAS_REMOVED") | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
removeStringTokenLua("<CHARACTER_NAME_1>") | |
Infinity_SendChatMessage(message, true) | |
end | |
function broadcastCharacterReady(slot) | |
local character = getMultiplayerCharacterName(slot, false, false) | |
setStringTokenLua("<CHARACTER_NAME_1>",character) | |
local message = t("MULTIPLAYER_IS_READY_TO_START") | |
removeStringTokenLua("<CHARACTER_NAME_1>") | |
Infinity_SendChatMessage(message, true) | |
end | |
function broadcastCharacterNotReady(slot) | |
local character = getMultiplayerCharacterName(slot, false, false) | |
setStringTokenLua("<CHARACTER_NAME_1>",character) | |
local message = t("MULTIPLAYER_IS_NO_LONGER_READY") | |
removeStringTokenLua("<CHARACTER_NAME_1>") | |
Infinity_SendChatMessage(message, true) | |
end | |
function broadcastPlayerAdded(slot) | |
local player = getMultiplayerPlayerName(slot,false,false) | |
setStringTokenLua("<PLAYER_NAME_1>",player) | |
local message = t("MULTIPLAYER_HAS_JOINED_THE_GAME") | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
Infinity_SendChatMessage(message, true) | |
end | |
function broadcastPlayerRemoved(slot) | |
local player = getMultiplayerPlayerName(slot,false,false) | |
setStringTokenLua("<PLAYER_NAME_1>",player) | |
local message = t("MULTIPLAYER_HAS_LEFT_THE_GAME") | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
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 | |
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) | |
if mpaCharacters[slot]['ready'] == true then | |
return 0 | |
end | |
return 1 | |
end | |
function is4CheckEnabled(slot) | |
return getMultiplayerCharacterReadyText(slot) ~= '' and mpaCharacters[slot]['player'] == multiplayerLocalPlayerID | |
end | |
` | |
menu | |
{ | |
name 'MULTIPLAYER' | |
align center center | |
ignoreesc | |
onOpen | |
" | |
existingDifficulty = Infinity_GetOption(12, 8) + 1; | |
multiplayerFromInGame = multiplayerScreen:GetEngineState() == 2 | |
" | |
label | |
{ | |
mosaic GUICREDT | |
area 0 0 1024 768 | |
} | |
label | |
{ | |
area 128 6 760 42 | |
text "ARBITRATION_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 510 96 136 22 | |
text lua "t('PLAYER_LABEL')" | |
text style "label" | |
align center center | |
} | |
label | |
{ | |
area 646 96 232 22 | |
text lua "t('CHARACTER_LABEL')" | |
text style "label" | |
align center center | |
} | |
label | |
{ | |
area 878 96 112 22 | |
text lua "t('READY_TO_PLAY_LABEL')" | |
text style "label" | |
align center center | |
} | |
list -- character list | |
{ | |
column --player | |
{ | |
width 33 | |
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 140 95 | |
text lua "getMultiplayerPlayerName(mpaCharacters[rowNumber]['player'],true,true)" | |
text style "label" | |
enabled "multiplayerLocalPlayerID ~= 1 or rowNumber == 1" | |
} | |
label | |
{ | |
area 7 50 140 42 | |
bam GUIOSTSM | |
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 14 | |
label | |
{ | |
area 0 0 -1 -1 | |
bam GUIRSP10 | |
sequence 1 | |
align center center | |
} | |
label | |
{ | |
area 5 5 56 84 | |
bitmap lua 'mpaCharacters[rowNumber]["portrait"]' | |
sequence 1 | |
align center center | |
} | |
} | |
column --character | |
{ | |
width 46 | |
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 201 44 | |
bam GUIOSTUM | |
sequence 1 | |
frame lua "currentCellCheck(3)" | |
align center center | |
enabled "getMultiplayerCharacterButtonText(rowNumber) ~= ''" | |
} | |
label | |
{ | |
area 8 45 195 44 | |
text lua "getMultiplayerCharacterButtonText(rowNumber)" | |
text style "button" | |
} | |
} | |
column --ready | |
{ | |
width 12 | |
label | |
{ | |
area 0 50 50 44 | |
text lua "getMultiplayerCharacterReadyText(rowNumber)" | |
text style "label" | |
} | |
} | |
area 510 124 480 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 124 50 50 | |
bam "4CHECK" | |
enabled "is4CheckEnabled(1)" | |
sequence lua "get4CheckFrame(1)" | |
align center center | |
tooltip lua "getMultiplayerReadyTooltip(1)" | |
action | |
" | |
if multiplayerFromInGame == false then | |
if multiplayerLocalPlayerID == mpaCharacters[1]['player'] then | |
multiplayerScreen:OnReadyButtonClick(1-1) | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 942 219 50 50 | |
bam "4CHECK" | |
enabled "is4CheckEnabled(2)" | |
sequence lua "get4CheckFrame(2)" | |
align center center | |
tooltip lua "getMultiplayerReadyTooltip(2)" | |
action | |
" | |
if multiplayerFromInGame == false then | |
if multiplayerLocalPlayerID == mpaCharacters[2]['player'] then | |
multiplayerScreen:OnReadyButtonClick(2-1) | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 942 314 50 50 | |
bam "4CHECK" | |
enabled "is4CheckEnabled(3)" | |
sequence lua "get4CheckFrame(3)" | |
align center center | |
tooltip lua "getMultiplayerReadyTooltip(3)" | |
action | |
" | |
if multiplayerFromInGame == false then | |
if multiplayerLocalPlayerID == mpaCharacters[3]['player'] then | |
multiplayerScreen:OnReadyButtonClick(3-1) | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 942 409 50 50 | |
bam "4CHECK" | |
enabled "is4CheckEnabled(4)" | |
sequence lua "get4CheckFrame(4)" | |
align center center | |
tooltip lua "getMultiplayerReadyTooltip(4)" | |
action | |
" | |
if multiplayerFromInGame == false then | |
if multiplayerLocalPlayerID == mpaCharacters[4]['player'] then | |
multiplayerScreen:OnReadyButtonClick(4-1) | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 942 504 50 50 | |
bam "4CHECK" | |
enabled "is4CheckEnabled(5)" | |
sequence lua "get4CheckFrame(5)" | |
align center center | |
tooltip lua "getMultiplayerReadyTooltip(5)" | |
action | |
" | |
if multiplayerFromInGame == false then | |
if multiplayerLocalPlayerID == mpaCharacters[5]['player'] then | |
multiplayerScreen:OnReadyButtonClick(5-1) | |
end | |
end | |
" | |
} | |
button | |
{ | |
area 942 599 50 50 | |
bam "4CHECK" | |
enabled "is4CheckEnabled(6)" | |
sequence lua "get4CheckFrame(6)" | |
align center center | |
tooltip lua "getMultiplayerReadyTooltip(6)" | |
action | |
" | |
if multiplayerFromInGame == false then | |
if multiplayerLocalPlayerID == mpaCharacters[6]['player'] then | |
multiplayerScreen:OnReadyButtonClick(6-1) | |
end | |
end | |
" | |
} | |
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 | |
} | |
label | |
{ | |
area 52 339 195 51 | |
text lua "getMultiplayerPlayerName(1, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(1) == 0" | |
} | |
label | |
{ | |
area 97 339 150 51 | |
text lua "getMultiplayerPlayerName(1, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(1) ~= 0" | |
} | |
label | |
{ | |
area 52 390 195 51 | |
text lua "getMultiplayerPlayerName(2, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(2) == 0" | |
} | |
label | |
{ | |
area 97 390 150 51 | |
text lua "getMultiplayerPlayerName(2, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(2) ~= 0" | |
} | |
label | |
{ | |
area 52 441 195 51 | |
text lua "getMultiplayerPlayerName(3, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(3) == 0" | |
} | |
label | |
{ | |
area 97 441 150 51 | |
text lua "getMultiplayerPlayerName(3, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(3) ~= 0" | |
} | |
label | |
{ | |
area 52 492 195 51 | |
text lua "getMultiplayerPlayerName(4, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(4) == 0" | |
} | |
label | |
{ | |
area 97 492 150 51 | |
text lua "getMultiplayerPlayerName(4, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(4) ~= 0" | |
} | |
label | |
{ | |
area 52 543 195 51 | |
text lua "getMultiplayerPlayerName(5, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(5) == 0" | |
} | |
label | |
{ | |
area 97 543 150 51 | |
text lua "getMultiplayerPlayerName(5, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(5) ~= 0" | |
} | |
label | |
{ | |
area 52 594 195 51 | |
text lua "getMultiplayerPlayerName(6, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(6) == 0" | |
} | |
label | |
{ | |
area 97 594 150 51 | |
text lua "getMultiplayerPlayerName(6, false, true)" | |
text style "label" | |
align left center | |
enabled "getPlayerKickWidth(6) ~= 0" | |
} | |
--kick | |
button | |
{ | |
area 44 390 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 44 441 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 44 492 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 44 543 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 44 594 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 390 46 45 | |
bam GUMPBUTX | |
sequence 3 | |
enabled "mpaPlayers[2]['name'] ~= ''" | |
clickable lua "multiplayerLocalPlayerID == 1 or multiplayerLocalPlayerID == 2" | |
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 441 46 45 | |
bam GUMPBUTX | |
sequence 3 | |
enabled "mpaPlayers[3]['name'] ~= ''" | |
clickable lua "multiplayerLocalPlayerID == 1 or multiplayerLocalPlayerID == 3" | |
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 492 46 45 | |
bam GUMPBUTX | |
sequence 3 | |
enabled "mpaPlayers[4]['name'] ~= ''" | |
clickable lua "multiplayerLocalPlayerID == 1 or multiplayerLocalPlayerID == 4" | |
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 543 46 45 | |
bam GUMPBUTX | |
sequence 3 | |
enabled "mpaPlayers[5]['name'] ~= ''" | |
clickable lua "multiplayerLocalPlayerID == 1 or multiplayerLocalPlayerID == 5" | |
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 594 46 45 | |
bam GUMPBUTX | |
sequence 3 | |
enabled "mpaPlayers[6]['name'] ~= ''" | |
clickable lua "multiplayerLocalPlayerID == 1 or multiplayerLocalPlayerID == 6" | |
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 343 180 38 | |
actionSimpleDrop | |
" | |
multiplayerStopSwapPortraits(1) | |
" | |
} | |
button | |
{ | |
area 247 343 25 38 | |
bitmap lua 'getMultiplayerPlayerControlledCharacter(1,1)' | |
sequence 1 | |
align center center | |
-- No changing control of character 1 | |
} | |
button | |
{ | |
area 278 343 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 343 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 343 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 343 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 343 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 394 180 38 | |
actionSimpleDrop | |
" | |
multiplayerStopSwapPortraits(2) | |
" | |
} | |
button | |
{ | |
area 247 394 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 394 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 394 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 394 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 394 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 394 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 444 180 38 | |
actionSimpleDrop | |
" | |
multiplayerStopSwapPortraits(3) | |
" | |
} | |
button | |
{ | |
area 247 444 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 444 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 444 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 444 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 444 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 444 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 495 180 38 | |
actionSimpleDrop | |
" | |
multiplayerStopSwapPortraits(4) | |
" | |
} | |
button | |
{ | |
area 247 495 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 495 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 495 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 495 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 495 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 495 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 546 180 38 | |
actionSimpleDrop | |
" | |
multiplayerStopSwapPortraits(5) | |
" | |
} | |
button | |
{ | |
area 247 546 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 546 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 546 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 546 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 546 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 546 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 597 180 38 | |
actionSimpleDrop | |
" | |
multiplayerStopSwapPortraits(6) | |
" | |
} | |
button | |
{ | |
area 247 597 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 597 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 597 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 597 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 597 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 597 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 74 454 56 | |
text lua "multiplayerSessionName" | |
text style 'label' | |
} | |
label -- new game type/save name | |
{ | |
area 206 130 288 44 | |
text lua "multiplayerSaveName" | |
text style 'label' | |
align left center | |
} | |
label -- chapter | |
{ | |
area 206 170 288 44 | |
text lua "multiplayerChapter" | |
text style 'label' | |
align left center | |
} | |
label -- time played | |
{ | |
area 206 210 288 44 | |
text lua "multiplayerTimePlayed" | |
text style 'label' | |
align left center | |
} | |
label -- difficulty | |
{ | |
area 206 250 288 44 | |
text lua "multiplayerDifficultyLabel" | |
text style 'label' | |
align left center | |
} | |
label -- other difficulty | |
{ | |
area 40 130 166 164 | |
bam GUIDIFF | |
frame lua "multiplayerDifficultyImage" | |
sequence 0 | |
align center center | |
} | |
button | |
{ | |
area 200 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
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 200 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
text "DONE_BUTTON" -- Done | |
text style 'button' | |
clickable lua "multiplayer.donebuttonclickable" | |
enabled "multiplayerFromInGame" | |
tooltip lua "getStartGameButtonTooltip()" | |
action | |
" | |
multiplayerScreen:OnMainDoneButtonClick(mulitplayerPreexistingDifficulty) | |
" | |
} | |
button | |
{ | |
area 530 712 301 45 | |
bam STARTMBT | |
sequence 6 | |
text "LOGOUT_BUTTON" -- Logout | |
text style 'button' | |
action | |
" | |
multiplayerScreen:OnLogoutButtonClick() | |
" | |
} | |
button | |
{ | |
area 200 646 201 44 | |
bam GUIOSTUM | |
sequence 0 | |
text "MULTIPLAYER_GAME_OPTIONS_BUTTON" | |
text style 'button' | |
enabled "multiplayerLocalPlayerID == 1" | |
action | |
" | |
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_NAME_1>",player) | |
setStringTokenLua("<PERMISSION>",todo) | |
if setting == true then | |
message = t("MULTIPLAYER_IS_NOW_PERMITTED") | |
else | |
message = t("MULTIPLAYER_IS_NOT_PERMITTED") | |
end | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
removeStringTokenLua("<PERMISSION>") | |
Infinity_SendChatMessage(message, true) | |
end | |
function getMultiplayerPlayerPermissionDescription() | |
local player = getMultiplayerPlayerName(multiplayerInPermissionForPlayer,false,false) | |
setStringTokenLua("<PLAYER_NAME_1>",player) | |
local canPerform = t("MULTIPLAYER_CAN_PERFORM") | |
removeStringTokenLua("<PLAYER_NAME_1>") | |
return canPerform | |
end | |
` | |
menu | |
{ | |
name 'MP_PERMISSIONS' | |
align center center | |
modal | |
onOpen | |
" | |
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 | |
multiplayerPermissions[luaIndex][3] = multiplayer.player[multiplayerInPermissionForPlayer].permissions[index] | |
multiplayerPermissions[luaIndex][4] = multiplayerPermissions[luaIndex][3] | |
end | |
end | |
" | |
label | |
{ | |
area 0 0 512 651 | |
mosaic GUICONNB | |
} | |
label | |
{ | |
area 82 70 340 44 | |
text "PERMISSIONS_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 86 114 330 48 | |
text lua "getMultiplayerPlayerPermissionDescription()" | |
text style "title" | |
} | |
--bottom buttons | |
button | |
{ | |
on return | |
area 152 532 201 44 | |
bam GUIOSTUM | |
sequence 1 | |
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() | |
" | |
} | |
button | |
{ | |
on escape | |
area 152 584 201 44 | |
bam GUIOSTUM | |
text "CANCEL_BUTTON" -- Back | |
text style 'button' | |
action | |
" | |
multiplayerScreen:OnCancelButtonClick() | |
Infinity_PopMenu() | |
" | |
} | |
--permissions | |
button | |
{ | |
area 165 176 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerPermissions[1][3] == true" | |
tooltip lua "t(multiplayerPermissions[1][2])" | |
align center center | |
action | |
" | |
if multiplayerLocalPlayerID == 1 then | |
multiplayerPermissions[1][3] = not multiplayerPermissions[1][3] | |
end | |
" | |
} | |
text | |
{ | |
area 210 170 212 56 | |
text lua "t(multiplayerPermissions[1][1])" | |
tooltip lua "t(multiplayerPermissions[1][2])" | |
text style "normal" | |
align left center | |
} | |
button | |
{ | |
area 165 232 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerPermissions[2][3] == true" | |
tooltip lua "t(multiplayerPermissions[2][2])" | |
align center center | |
action | |
" | |
if multiplayerLocalPlayerID == 1 then | |
multiplayerPermissions[2][3] = not multiplayerPermissions[2][3] | |
end | |
" | |
} | |
text | |
{ | |
area 210 226 212 56 | |
text lua "t(multiplayerPermissions[2][1])" | |
tooltip lua "t(multiplayerPermissions[2][2])" | |
text style "normal" | |
align left center | |
} | |
button | |
{ | |
area 165 286 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerPermissions[3][3] == true" | |
tooltip lua "t(multiplayerPermissions[3][2])" | |
align center center | |
action | |
" | |
if multiplayerLocalPlayerID == 1 then | |
multiplayerPermissions[3][3] = not multiplayerPermissions[3][3] | |
end | |
" | |
} | |
text | |
{ | |
area 210 282 212 56 | |
text lua "t(multiplayerPermissions[3][1])" | |
tooltip lua "t(multiplayerPermissions[3][2])" | |
text style "normal" | |
align left center | |
} | |
button | |
{ | |
area 165 338 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerPermissions[4][3] == true" | |
tooltip lua "t(multiplayerPermissions[4][2])" | |
align center center | |
action | |
" | |
if multiplayerLocalPlayerID == 1 then | |
multiplayerPermissions[4][3] = not multiplayerPermissions[4][3] | |
end | |
" | |
} | |
text | |
{ | |
area 210 334 212 56 | |
text lua "t(multiplayerPermissions[4][1])" | |
tooltip lua "t(multiplayerPermissions[4][2])" | |
text style "normal" | |
align left center | |
} | |
button | |
{ | |
area 165 394 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerPermissions[5][3] == true" | |
tooltip lua "t(multiplayerPermissions[5][2])" | |
align center center | |
action | |
" | |
if multiplayerLocalPlayerID == 1 then | |
multiplayerPermissions[5][3] = not multiplayerPermissions[5][3] | |
end | |
" | |
} | |
text | |
{ | |
area 210 390 212 56 | |
text lua "t(multiplayerPermissions[5][1])" | |
tooltip lua "t(multiplayerPermissions[5][2])" | |
text style "normal" | |
align left center | |
} | |
button | |
{ | |
area 165 450 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerPermissions[6][3] == true" | |
tooltip lua "t(multiplayerPermissions[6][2])" | |
align center center | |
action | |
" | |
if multiplayerLocalPlayerID == 1 then | |
multiplayerPermissions[6][3] = not multiplayerPermissions[6][3] | |
end | |
" | |
} | |
text | |
{ | |
area 210 446 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("<SESSION_RULES>",setting) | |
if onOff == true then | |
message = t("MULTIPLAYER_GAME_WILL_NOW") | |
else | |
message = t("MULTIPLAYER_GAME_WILL_NO_LONGER") | |
end | |
removeStringTokenLua("<SESSION_RULES>") | |
else | |
local setting = t(multiplayerImportOptions[slot-2][1]) | |
setStringTokenLua("<IMPORT_RULES>",setting) | |
message = t("MULTIPLAYER_IMPORT_SETTINGS_CHANGE") | |
removeStringTokenLua("<IMPORT_RULES>") | |
end | |
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 512 651 | |
mosaic GUICONNB | |
} | |
label | |
{ | |
area 82 70 340 44 | |
text "OPTIONS_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 82 262 340 44 | |
text "MULTIPLAYER_IMPORT_CHARACTER_RULES_LABEL" | |
text style "title" | |
} | |
button | |
{ | |
area 133 132 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerGameOptions[1][3] == true" | |
tooltip lua "t(multiplayerGameOptions[1][2])" | |
align center center | |
action | |
" | |
multiplayerGameOptions[1][3] = not multiplayerGameOptions[1][3] | |
" | |
} | |
text | |
{ | |
area 178 126 212 55 | |
text lua "t(multiplayerGameOptions[1][1])" | |
text style "normal" | |
tooltip lua "t(multiplayerGameOptions[1][2])" | |
align left center | |
} | |
button | |
{ | |
area 133 196 45 42 | |
bam ROUNDBUT | |
glow lua "multiplayerGameOptions[2][3] == true" | |
tooltip lua "t(multiplayerGameOptions[2][2])" | |
align center center | |
action | |
" | |
multiplayerGameOptions[2][3] = not multiplayerGameOptions[2][3] | |
" | |
} | |
text | |
{ | |
area 178 190 212 55 | |
text lua "t(multiplayerGameOptions[2][1])" | |
text style "normal" | |
tooltip lua "t(multiplayerGameOptions[2][2])" | |
align left center | |
} | |
button | |
{ | |
area 133 336 45 42 | |
bam ROUNDBUT | |
frame lua "currentCellCheck(3)" | |
glow lua "multiplayerImportOption == 1" | |
tooltip lua "t('IMPORT_RULES_TOOLTIP')" | |
align center center | |
action | |
" | |
multiplayerImportOption = 1 | |
" | |
} | |
text | |
{ | |
area 178 330 212 55 | |
text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_SEI')" | |
tooltip lua "t('IMPORT_RULES_TOOLTIP')" | |
text style "normal" | |
align left center | |
} | |
button | |
{ | |
area 133 400 45 42 | |
bam ROUNDBUT | |
frame lua "currentCellCheck(3)" | |
glow lua "multiplayerImportOption == 2" | |
tooltip lua "t('IMPORT_RULES_TOOLTIP')" | |
align center center | |
action | |
" | |
multiplayerImportOption = 2 | |
" | |
} | |
text | |
{ | |
area 178 394 212 55 | |
text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_SE')" | |
tooltip lua "t('IMPORT_RULES_TOOLTIP')" | |
text style "normal" | |
align left center | |
} | |
button | |
{ | |
area 133 460 45 42 | |
bam ROUNDBUT | |
frame lua "currentCellCheck(3)" | |
glow lua "multiplayerImportOption == 3" | |
tooltip lua "t('IMPORT_RULES_TOOLTIP')" | |
align center center | |
action | |
" | |
multiplayerImportOption = 3 | |
" | |
} | |
text | |
{ | |
area 178 456 212 56 | |
text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_S')" | |
tooltip lua "t('IMPORT_RULES_TOOLTIP')" | |
text style "normal" | |
align left center | |
} | |
--bottom buttons | |
button | |
{ | |
on return | |
area 152 530 201 44 | |
bam GUIOSTUM | |
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 152 580 201 44 | |
bam GUIOSTUM | |
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 GUICONN1 | |
area 0 0 512 551 | |
} | |
label | |
{ | |
area 100 10 302 24 | |
text "SELECT_PLAYER_TITLE" | |
text style "title" | |
} | |
label | |
{ | |
area 84 60 334 44 | |
text "SELECT_PLAYER_DESCRIPTION" | |
text style "title" | |
} | |
-- list | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 340 32 | |
text lua "getMultiplayerPlayerName(getActivePlayerIndex(rowNumber), false, true)" | |
text style "normal" | |
align left center | |
} | |
} | |
rowheight 32 | |
area 124 116 258 288 | |
table "multiplayer.player" | |
var currentMultiplayerSelectPlayer | |
} | |
button | |
{ | |
on enter | |
area 152 434 201 44 | |
text "DONE_BUTTON" | |
text style "button" | |
bam GUIOSTUM | |
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() | |
" | |
} | |
button | |
{ | |
on escape | |
area 152 482 201 44 | |
text "CANCEL_BUTTON" | |
text style "button" | |
bam GUIOSTUM | |
action | |
" | |
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 677 234 | |
} | |
label | |
{ | |
area 34 10 606 128 | |
text lua "getModifyConfirmationLabel()" | |
text style "title" | |
align center center | |
} | |
button | |
{ | |
area 94 170 234 44 | |
bam GUIOSTUR | |
text lua "multiplayerIsDelete()" | |
text style "button" | |
align center center | |
on return | |
action | |
" | |
Infinity_PopMenu() | |
multiplayerScreen:SetModifiedCharacterSlot(mpModifyingCharacter) | |
if (multiplayer.character[mpModifyingCharacter+1].portrait ~= '') then | |
multiplayerScreen:OnModifyCharacterDelete() | |
else | |
multiplayerScreen:UpdateModifyCharacterPanel() | |
end | |
" | |
} | |
button | |
{ | |
area 364 170 234 44 | |
bam GUIOSTUL | |
text "CANCEL_BUTTON" -- cancel | |
text style "button" | |
align center center | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'MP_ERRORONE' | |
align center center | |
modal | |
label | |
{ | |
area 0 0 406 415 | |
mosaic GUIERR | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "Infinity_FetchString(mpErrorText)" | |
text style "normal" | |
align center center | |
} | |
button | |
{ | |
on return | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "DONE_BUTTON" | |
text style "button" | |
align center center | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
} | |
menu | |
{ | |
name 'MP_ERRORTWO' | |
align center center | |
modal | |
label | |
{ | |
mosaic GUIERR | |
area 0 0 406 415 | |
} | |
label | |
{ | |
area 82 74 242 88 | |
text lua "Infinity_FetchString(mpErrorText)" | |
text style "normal" | |
align center center | |
} | |
button | |
{ | |
on return | |
enabled "mpErrorState == 2" | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "MODIFY_BUTTON" -- modify | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
multiplayerScreen:ModifyCharacters() | |
" | |
} | |
button | |
{ | |
on return | |
enabled "mpErrorState == 3" | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "KICK_BUTTON" -- kick player | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
multiplayerScreen:KickPlayer() | |
" | |
} | |
button | |
{ | |
on return | |
enabled "mpErrorState == 4" | |
area 52 218 300 44 | |
bam GUIOSTCL | |
text "LOGOUT_BUTTON" -- log out | |
text style "button" | |
action | |
" | |
local index = 1 | |
Infinity_PopMenu() | |
multiplayerScreen:Logout() | |
" | |
} | |
button | |
{ | |
on escape | |
area 52 266 300 44 | |
bam GUIOSTCL | |
text "CANCEL_BUTTON" -- cancel | |
text style "button" | |
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() | |
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 33 | |
text style "normal" | |
text lua "getMPMessage()" | |
pad 8 8 8 8 | |
rectangle 1 | |
ignoreEvents | |
} | |
text | |
{ | |
name "mpChatDisplay" | |
enabled "showMpChat" | |
area 18 46 264 276 | |
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 22 | |
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 reinitQuests() | |
for questIdx, quest in pairs(quests) do | |
local noquest = true | |
for objIdx,objective in pairs(quest.objectives) do | |
local noobjective = true | |
for entryIdx,entry in pairs(objective.entries) do | |
if quests[questIdx].objectives[objIdx].entries[entryIdx].stateType ~= const.ENTRY_TYPE_NONE and quests[questIdx].objectives[objIdx].entries[entryIdx].stateType ~= nil then | |
noobjective = false | |
end | |
end | |
if noobjective then | |
quests[questIdx].objectives[objIdx].stateType = const.ENTRY_TYPE_NONE | |
end | |
if quests[questIdx].objectives[objIdx].stateType ~= const.ENTRY_TYPE_NONE and quests[questIdx].objectives[objIdx].stateType ~= nil then | |
noquest = false | |
end | |
end | |
if noquest then | |
quests[questIdx].stateType = const.ENTRY_TYPE_NONE | |
end | |
end | |
end | |
function initQuests() | |
--instead of always searching the quests, just map entry ids to their quests | |
entryToQuest = {} | |
buildQuestsTable() | |
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(o1 == nil) then return false end | |
if(o2 == nil) then return true end | |
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 | |
function createEntry(questId, objectiveId, entryId, previousObjectives, subGroup) | |
local quest = findQuest(questId) | |
if(not quest) then | |
Infinity_Log("Failed to create entry: " .. entryId .. "for quest: " .. questId) | |
return | |
end | |
--parse the entry out into an objective and entry | |
local entry = {} | |
local objective = {} | |
entry.text = "" | |
entry.previousObjectives = {} --this feature will be unused for now. | |
entry.id = entryId | |
--set up this entry's subgroup | |
entry.subGroup = subGroup | |
if(subGroup) then | |
if(not subGroups[subGroup]) then subGroups[subGroup] = {} end | |
table.insert(subGroups[subGroup],entry) | |
end | |
local lineCount = 1 | |
local fullStr = Infinity_FetchString(entryId) | |
for line in string.gmatch(fullStr, "[^\r\n]+") do | |
if(lineCount == 1) then | |
--objective text is first line. | |
objective.text = line | |
else | |
--entry text is everything after first | |
entry.text = entry.text .. line .. "\n" | |
end | |
lineCount = lineCount + 1 | |
if(line:sub(-1) == ".") then break end | |
end | |
if(lineCount == 2) then | |
--it looks like sometimes entries are just an unbroken paragraph | |
--in this case the entry should get the paragraph and the objective gets nothing | |
entry.text = fullStr | |
objective.text = Infinity_FetchString(quest.text) | |
end | |
objective.entries = {entry} | |
table.insert(quest.objectives,objective) | |
end | |
function setSelectedQuest(id) | |
--set to the correct state | |
local quest = quests[entryToQuest[id]] | |
journalMode = 2 | |
if(not quest) then return end | |
journalMode = 0 | |
for k,objective in pairs(quest.objectives) do | |
for k2,entry in pairs(objective.entries) do | |
if(entry.id == id) then | |
if entry.stateType == const.ENTRY_TYPE_COMPLETE then | |
journalMode = 1 | |
end | |
if entry.stateType == const.ENTRY_TYPE_INFO then | |
journalMode = 2 | |
end | |
if entry.stateType == const.ENTRY_TYPE_USER then | |
journalMode = 3 | |
end | |
break | |
end | |
end | |
end | |
updateDisplayJournal() | |
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_r("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 | |
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 | |
--this should maybe be done recursively, but i kinda want direct control over each level | |
function buildQuestDisplay() | |
--this is basically just a flatten | |
questDisplay = {} | |
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 = {} | |
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 | |
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 | |
table.sort(looseEntries, compareByRecvTime) | |
journalDisplay = {} | |
for k,entry in pairs(looseEntries) do | |
local title = {} | |
title.title = 1 | |
title.text = entry.timeStamp | |
title.chapters = entry.chapters | |
table.insert(journalDisplay,title) | |
entry.entry = 1 | |
table.insert(journalDisplay,entry) | |
end | |
--add the user entries to the user display | |
table.sort(userNotes, compareByRecvTime) | |
userDisplay = {} | |
for k,entry in pairs(userNotes) do | |
local title = {} | |
title.title = 1 | |
title.text = entry.timeStamp | |
title.chapters = entry.chapters | |
table.insert(userDisplay,title) | |
entry.entry = 1 | |
table.insert(userDisplay,entry) | |
end | |
end | |
function containsChapter(tab, chapter) | |
if(not tab) then return nil end | |
return tab[chapter] | |
end | |
function childrenContainsChapter(children) | |
for k,v in pairs(children) do | |
if containsChapter(questDisplay[v].chapters,chapter) then | |
return questDisplay[v].chapters | |
end | |
end | |
return nil | |
end | |
function getFinished(row) | |
local rowTab = questDisplay[row] | |
if rowTab.parent ~= nil then return getFinished(rowTab.parent) end | |
if rowTab.stateType == const.ENTRY_TYPE_COMPLETE then return 1 else return 0 end | |
end | |
function questEnabled(row) | |
return questDisplay[row] and questDisplay[row].quest and containsChapter(questDisplay[row].chapters,chapter) and childrenContainsChapter(questDisplay[row].children) | |
end | |
function getQuestText(row) | |
local rowTab = questDisplay[row] | |
if (rowTab == nil) then return nil end | |
return Infinity_FetchString(rowTab.text) | |
end | |
function objectiveEnabled(row) | |
local rowTab = questDisplay[row] | |
if(rowTab == nil or rowTab.objective == nil or not containsChapter(rowTab.chapters,chapter)) then return nil end | |
if(questEnabled(rowTab.parent) and LeUIquestDisplay(rowTab.parent)) then return 1 else return nil end | |
end | |
function getObjectiveText(row) | |
local rowTab = questDisplay[row] | |
if (rowTab == nil) then return nil end | |
local text = rowTab.text | |
if rowTab.entries[1].timeStamp ~= nil then | |
text = text .. '\n' .. rowTab.entries[1].timeStamp | |
end | |
return text | |
end | |
function entryEnabled(row) | |
local rowTab = questDisplay[row] | |
if(rowTab == nil or rowTab.entry == nil or not containsChapter(rowTab.chapters,chapter)) then return nil end | |
if(objectiveEnabled(rowTab.parent)) then return 1 else return nil end | |
end | |
function getEntryText(row) | |
local text = questDisplay[row].text | |
if text:byte(#text) ~= 10 then | |
text = text .. '\n' | |
end | |
return text | |
end | |
function getTitleEnabled(display, row) | |
return display[row].title and containsChapter(display[row].chapters,chapter) | |
end | |
function getTitleText(display, row) | |
return display[row].text | |
end | |
function getJournalEnabled(display, row) | |
return display[row].entry and containsChapter(display[row].chapters,chapter) | |
end | |
function getJournalText(display, row) | |
local text = Infinity_FetchString(display[row].text) | |
if(text == nil or text == "") then | |
text = display[row].text | |
end | |
return text | |
end | |
function getJournalEntryRef(display, row) | |
local entry = display[row] | |
if(not entry) then return end | |
if(entry.title) then | |
return display[row + 1].text | |
else | |
return entry.text | |
end | |
end | |
function pauseJournal() | |
if not worldScreen:CheckIfPaused() then | |
worldScreen:TogglePauseGame(true) | |
end | |
end | |
journalMode = 0 | |
editMode = 0 | |
` | |
menu | |
{ | |
name 'JOURNAL' | |
align center center | |
modal | |
onOpen | |
" | |
reinitQuests() | |
buildQuestDisplay() | |
chapter = math.max(0, Infinity_GetMaxChapterPage()) | |
journalMode = 0 | |
local tf = next(textflashes) | |
if tf then | |
setSelectedQuest(textflashes[tf][5]) | |
textflashes[tf] = nil | |
end | |
pushSidebars() | |
" | |
onClose | |
" | |
showJournal = 0 | |
if not wasPaused then | |
worldScreen:TogglePauseGame(true) | |
end | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIJRNL | |
} | |
label | |
{ | |
area 82 12 700 40 | |
mosaic lua "pauseJournal()" | |
text "JOURNAL_LABEL" | |
text style title | |
} | |
button | |
{ | |
area 24 132 52 132 | |
bam GUIPRC | |
sequence 0 | |
action | |
" | |
incrChapter(-1) | |
" | |
} | |
button | |
{ | |
area 788 132 52 132 | |
bam GUIPRC | |
sequence 1 | |
action | |
" | |
incrChapter(1) | |
" | |
} | |
label -- Initial | |
{ | |
enabled "chapterText():byte() < 194" | |
area 152 190 40 38 | |
bam INITIALS | |
sequence lua "chapterText():byte() - 1" | |
} | |
label -- Chapter | |
{ | |
enabled "chapterText():byte() < 194" | |
area 195 190 200 38 | |
text lua "chapterText():sub(2)" | |
text style "parchment" | |
text point 14 | |
} | |
label -- Chapter | |
{ | |
enabled "chapterText():byte() >= 194" | |
area 152 190 243 38 | |
text lua "chapterText()" | |
text style "parchment" | |
text point 14 | |
} | |
list --quest | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "questEnabled(rowNumber) and getFinished(rowNumber) == journalMode" | |
area 0 0 -1 -1 | |
text lua "LeUIquestDisplay(rowNumber) and '-' or '+'" | |
text style "edit" | |
text color 5 | |
} | |
label | |
{ | |
enabled "questEnabled(rowNumber) and getFinished(rowNumber) == journalMode" | |
area 8 0 -1 -1 | |
pad 0 0 0 10 | |
text lua "getQuestText(rowNumber)" | |
text style "parchment" | |
text color M | |
} | |
label | |
{ | |
enabled "questEnabled(rowNumber) and getFinished(rowNumber) == journalMode and LeUIquestDisplay(rowNumber)" | |
area 16 24 536 2 | |
fill 0 0 0 180 | |
} | |
label | |
{ | |
enabled "objectiveEnabled(rowNumber) and getFinished(rowNumber) == journalMode" | |
area 16 0 -1 -1 | |
text lua "getObjectiveText(rowNumber)" | |
text style "parchment" | |
text color 0 64 0 255 | |
} | |
label | |
{ | |
enabled "entryEnabled(rowNumber) and getFinished(rowNumber) == journalMode" | |
area 16 0 -1 -1 | |
text lua "getEntryText(rowNumber)" | |
text style "parchment" | |
} | |
} | |
enabled "journalMode == 0 or journalMode == 1" | |
rowheight dynamic | |
hidehighlight | |
table "questDisplay" | |
var selectedQuest | |
scrollbar 'GUISBR' | |
area 152 236 582 346 | |
action | |
" | |
if questDisplay[selectedQuest].quest then | |
if journalCollapsed then | |
if(questDisplay[selectedQuest].expanded) then | |
questDisplay[selectedQuest].expanded = nil | |
else | |
questDisplay[selectedQuest].expanded = 1 | |
end | |
else | |
if(questDisplay[selectedQuest].hidden) then | |
questDisplay[selectedQuest].hidden = nil | |
else | |
questDisplay[selectedQuest].hidden = 1 | |
end | |
end | |
end | |
" | |
} | |
list --journal | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "getTitleEnabled(journalDisplay, rowNumber)" | |
area 0 0 -1 -1 | |
pad 0 16 0 0 | |
text lua "getTitleText(journalDisplay, rowNumber)" | |
text style "parchment" | |
text color 0 64 0 255 | |
} | |
label | |
{ | |
enabled "getJournalEnabled(journalDisplay, rowNumber)" | |
area 0 0 -1 -1 | |
pad 0 16 0 0 | |
text lua "getJournalText(journalDisplay, rowNumber)" | |
text style "parchment" | |
} | |
} | |
enabled "journalMode == 2" | |
rowheight dynamic | |
hidehighlight | |
table "journalDisplay" | |
var selectedJournal | |
scrollbar 'GUISBR' | |
area 152 236 582 346 | |
action | |
" | |
journalNoteEditRef = getJournalEntryRef(journalDisplay, selectedJournal) | |
journalNoteEdit = Infinity_FetchString(journalNoteEditRef) | |
Infinity_PushMenu('EDIT_JOURNAL') | |
" | |
} | |
list --user | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
enabled "getTitleEnabled(userDisplay, rowNumber)" | |
area 0 0 -1 -1 | |
pad 0 16 0 0 | |
text lua "getTitleText(userDisplay, rowNumber)" | |
text style "parchment" | |
text color 0 64 0 255 | |
} | |
label | |
{ | |
enabled "getJournalEnabled(userDisplay, rowNumber)" | |
area 0 0 -1 -1 | |
pad 0 16 0 0 | |
text lua "getJournalText(userDisplay, rowNumber)" | |
text style "parchment" | |
} | |
} | |
enabled "journalMode == 3" | |
rowheight dynamic | |
hidehighlight | |
table "userDisplay" | |
var selectedUser | |
scrollbar 'GUISBR' | |
area 152 236 582 346 | |
action | |
" | |
journalNoteEditRef = getJournalEntryRef(userDisplay, selectedUser) | |
journalNoteEdit = Infinity_FetchString(journalNoteEditRef) | |
Infinity_PushMenu('EDIT_JOURNAL') | |
" | |
} | |
button | |
{ | |
area 72 94 234 44 | |
bam GUIOSTUL | |
glow lua "journalMode == 0" | |
text "QUESTS_BUTTON" | |
text style "button" | |
action | |
" | |
journalMode = 0 | |
" | |
} | |
button | |
{ | |
area 556 94 234 44 | |
bam GUIOSTUR | |
glow lua "journalMode == 1" | |
text "DONE_QUESTS_BUTTON" | |
text style "button" | |
action | |
" | |
journalMode = 1 | |
" | |
} | |
button | |
{ | |
area 58 604 234 44 | |
bam GUIOSTLL | |
glow lua "journalMode == 2" | |
text "JOURNAL_BUTTON" | |
text style "button" | |
action | |
" | |
journalMode = 2 | |
" | |
} | |
button | |
{ | |
area 332 610 201 44 | |
bam GUIOSTLM | |
enabled "journalMode == 3" | |
clickable lua "chapter == Infinity_GetMaxChapterPage()" | |
text 'ADD_BUTTON' | |
text style "button" | |
action | |
" | |
journalNoteEdit = '' | |
journalNoteEditRef = nil | |
Infinity_PushMenu('EDIT_JOURNAL') | |
" | |
} | |
button | |
{ | |
area 572 604 234 44 | |
glow lua "journalMode == 3" | |
bam GUIOSTLR | |
text "USER_BUTTON" | |
text style "button" | |
action | |
" | |
journalMode = 3 | |
" | |
} | |
} | |
menu | |
{ | |
name 'EDIT_JOURNAL' | |
align center center | |
modal | |
onOpen | |
" | |
editMode = 1 | |
Infinity_FocusTextEdit('journalNoteEditArea') | |
" | |
onClose | |
" | |
editMode = 0 | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUIJRNL | |
} | |
label | |
{ | |
area 82 12 700 40 | |
mosaic lua "pauseJournal()" | |
text "JOURNAL_LABEL" | |
text style title | |
} | |
edit | |
{ | |
name "journalNoteEditArea" | |
area 152 236 582 346 | |
text style "edit_parchment" | |
var journalNoteEdit | |
scrollbar 'GUISBR' | |
} | |
button | |
{ | |
area 72 94 234 44 | |
bam GUIOSTUL | |
text "DONE_BUTTON" | |
text style "button" | |
action | |
" | |
if journalNoteEditRef == nil then | |
Infinity_OnAddUserEntry(journalNoteEdit) | |
else | |
Infinity_OnEditUserEntry(journalNoteEditRef, journalNoteEdit) | |
end | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
area 556 94 234 44 | |
bam GUIOSTUR | |
text "CANCEL_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_PopMenu() | |
" | |
} | |
button | |
{ | |
area 332 610 201 44 | |
bam GUIOSTLM | |
clickable lua "journalNoteEditRef and journalMode == 3" | |
text "DELETE_BUTTON" | |
text style "button" | |
action | |
" | |
Infinity_OnEditUserEntry(journalNoteEditRef, nil) | |
Infinity_PopMenu() | |
" | |
} | |
} | |
` | |
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 677 234 | |
mosaic GUIERR6 | |
} | |
label | |
{ | |
area 34 10 606 128 | |
text lua "Infinity_FetchString(messageScreenText)" | |
text style "label" | |
} | |
} | |
` | |
dialogTable = {} | |
dialogOverflowTable = {} | |
hasDialogResponse = nil | |
chatboxScrollToBottom = nil | |
chatboxScrollTimeLast = 0 | |
chatboxJumpToBottom = nil | |
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 showDialogButtonChoices() | |
return not (not hasDialogResponse or dialogViewMode or #dialogOverflowTable > 0) | |
end | |
function triggerChatboxScroll() | |
chatboxScrollToBottom = 1 | |
chatboxScrollTimeLast = Infinity_GetClockTicks() | |
end | |
function chatboxScroll(top, height, contentHeight) | |
if(chatboxScrollToBottom and contentHeight > height) then | |
chatboxScrollToBottom = nil | |
return height-contentHeight | |
end | |
--defer to default | |
return nil | |
end | |
function displayOverflowResponses() | |
for k,v in pairs(dialogOverflowTable) do | |
table.insert(dialogTable,v) | |
end | |
dialogOverflowTable = {} | |
triggerChatboxScroll() | |
buildResponsesList() | |
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 | |
else | |
-- no choices, just step. | |
worldScreen:StepDialog() | |
end | |
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) | |
return val ~= 0 | |
end | |
` | |
menu | |
{ | |
name 'WORLD_DIALOG_LEFT' | |
align left center | |
ignoreEsc | |
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 | |
button | |
{ | |
area 12 25 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'...'" | |
text style "button" | |
enabled "not showDialogButtonChoices()" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
onDialogButtonClick() | |
" | |
} | |
button | |
{ | |
area 12 25 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'1'" | |
text style "button" | |
enabled "canShowDialogButton(1)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[1].marker) | |
" | |
} | |
button | |
{ | |
area 12 100 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'2'" | |
text style "button" | |
enabled "canShowDialogButton(2)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[2].marker) | |
" | |
} | |
button | |
{ | |
area 12 175 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'3'" | |
text style "button" | |
enabled "canShowDialogButton(3)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[3].marker) | |
" | |
} | |
button | |
{ | |
area 12 250 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'4'" | |
text style "button" | |
enabled "canShowDialogButton(4)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[4].marker) | |
" | |
} | |
button | |
{ | |
area 12 325 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'5'" | |
text style "button" | |
enabled "canShowDialogButton(5)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[5].marker) | |
" | |
} | |
button | |
{ | |
area 12 400 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'6'" | |
text style "button" | |
enabled "canShowDialogButton(6)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[6].marker) | |
" | |
} | |
button | |
{ | |
area 12 475 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'7'" | |
text style "button" | |
enabled "canShowDialogButton(7)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[7].marker) | |
" | |
} | |
button | |
{ | |
area 12 550 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'8'" | |
text style "button" | |
enabled "canShowDialogButton(8)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[8].marker) | |
" | |
} | |
button | |
{ | |
area 12 625 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'9'" | |
text style "button" | |
enabled "canShowDialogButton(9)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[9].marker) | |
" | |
} | |
button | |
{ | |
area 12 700 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'10'" | |
text style "button" | |
enabled "canShowDialogButton(10)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[10].marker) | |
" | |
} | |
} | |
menu | |
{ | |
name 'WORLD_DIALOG_RIGHT' | |
align right center | |
ignoreEsc | |
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 | |
enabled "canShowDialogButton(11)" | |
button | |
{ | |
area 8 25 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'11'" | |
text style "button" | |
enabled "canShowDialogButton(11)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[11].marker) | |
" | |
} | |
button | |
{ | |
area 8 100 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'12'" | |
text style "button" | |
enabled "canShowDialogButton(12)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[12].marker) | |
" | |
} | |
button | |
{ | |
area 8 175 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'13'" | |
text style "button" | |
enabled "canShowDialogButton(13)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[13].marker) | |
" | |
} | |
button | |
{ | |
area 8 250 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'14'" | |
text style "button" | |
enabled "canShowDialogButton(14)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[14].marker) | |
" | |
} | |
button | |
{ | |
area 8 325 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'15'" | |
text style "button" | |
enabled "canShowDialogButton(15)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[15].marker) | |
" | |
} | |
button | |
{ | |
area 8 400 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'16'" | |
text style "button" | |
enabled "canShowDialogButton(16)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[16].marker) | |
" | |
} | |
button | |
{ | |
area 8 475 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'17'" | |
text style "button" | |
enabled "canShowDialogButton(17)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[17].marker) | |
" | |
} | |
button | |
{ | |
area 8 550 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'18'" | |
text style "button" | |
enabled "canShowDialogButton(18)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[18].marker) | |
" | |
} | |
button | |
{ | |
area 8 625 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'19'" | |
text style "button" | |
enabled "canShowDialogButton(19)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[19].marker) | |
" | |
} | |
button | |
{ | |
area 8 700 54 54 | |
bam CBUTT | |
scaleToClip | |
text lua "'20'" | |
text style "button" | |
enabled "canShowDialogButton(20)" | |
clickable lua "not dialogEntryGreyed()" | |
action | |
" | |
worldScreen:OnDialogReplyClick(dialogResponses[20].marker) | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARGEN_SUBRACE' | |
align center center | |
modal | |
ignoreesc | |
onOpen | |
" | |
currentChargenSubrace = nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "RACE_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenSubrace and 2 or 0" | |
} | |
label | |
{ | |
area 0 0 340 32 | |
text lua "Infinity_FetchString(subraceList(dwRaces[currentChargenRace].id)[rowNumber].name)" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
if subraceList(dwRaces[currentChargenRace].id)[currentChargenSubrace] then | |
end | |
" | |
area 42 192 358 414 | |
rowheight 34 | |
hidehighlight | |
table "subraceList(dwRaces[currentChargenRace].id)" | |
var currentChargenSubrace | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "subraceOrGeneralHelp()" | |
text style normal | |
text color D | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "subraceDoneButtonClickable() and currentChargenSubrace" | |
action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
currentChargenRace=nil; currentChargenSubrace=nil | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and (subraceDoneButtonClickable() and currentChargenSubrace) or true" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu(); createCharScreen:OnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
currentChargenRace=nil; currentChargenSubrace=nil | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or (subraceDoneButtonClickable() and currentChargenSubrace)" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
currentChargenRace=nil; currentChargenSubrace=nil | |
else | |
Infinity_PopMenu(); createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARGEN_MULTICLASS' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
dwMultiClassList=dwMakeMultiClassList(chargen.class) | |
currentChargenClass = nil | |
currentChargenKit = nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "CLASS_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
button | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenClass and 2 or 0" | |
} | |
button | |
{ | |
area 0 0 340 32 | |
text lua "dwFilterKitDesc(Infinity_FetchString(dwMultiClassList[rowNumber].name))" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
createCharScreen:OnClassSelectButtonClick(0) | |
if dwMultiClassList[currentChargenClass] then | |
dwChargenClassId=dwOnMultiClassSelectButtonClick(currentChargenClass) | |
else | |
currentChargenClass = nil | |
end | |
" | |
rowheight 34 | |
hidehighlight | |
area 42 192 356 414 | |
table "dwMultiClassList" | |
var currentChargenClass | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "multiclassOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() and currentChargenClass" | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
if createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS then | |
currentChargenClass=nil; | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and (createCharScreen:IsDoneButtonClickable() and currentChargenClass) or true" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
if createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS then | |
currentChargenClass=nil; | |
end | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or (createCharScreen:IsDoneButtonClickable() and currentChargenClass)" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
if createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS then | |
currentChargenClass=nil; | |
end | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'CHARGEN_KIT_SECONDARY' | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
dwKitSecList=dwMakeKitSecList(chargen.kit,currentChargenKit) | |
currentChargenKit = 1 | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICUSTB | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text lua "Infinity_FetchString(dwMenu.title)" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
button | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenKit and 2 or 0" | |
} | |
button | |
{ | |
area 0 0 340 32 | |
text lua "dwFilterKitDesc(Infinity_FetchString(dwKitSecList[rowNumber].name))" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
if dwKitSecList[currentChargenKit] then | |
dwChargenKitId=dwOnSelectKitSecButtonClick(currentChargenKit) | |
else | |
currentChargenKit = nil | |
end | |
" | |
rowheight 34 | |
hidehighlight | |
area 42 192 356 414 | |
table "dwKitSecList" | |
var currentChargenKit | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 436 128 382 478 | |
text lua "kitSecOrGeneralHelp()" | |
text style "normal" | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "createCharScreen:IsDoneButtonClickable() and currentChargenKit and currentChargenKit" | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
currentChargenKitSec=nil; | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and (createCharScreen:IsDoneButtonClickable() and currentChargenKit and currentChargenKit) or true" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
createCharScreen:OnDoneButtonClick() | |
else | |
currentChargenKitSec=nil; | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or (createCharScreen:IsDoneButtonClickable() and currentChargenKit and currentChargenKit)" | |
action | |
" | |
Infinity_PopMenu() | |
if reverseButtonPosition then | |
currentChargenKitSec=nil; | |
else | |
createCharScreen:OnDoneButtonClick() | |
end | |
" | |
} | |
} | |
menu | |
{ | |
name 'DW_HATEDRACE' | |
onOpen" | |
dwRacialEnemyOnOpen() | |
" | |
modal | |
align center center | |
ignoreesc | |
onOpen | |
" | |
currentChargenHatedRace = nil | |
Infinity_PlaySound('GAM_03') | |
" | |
onClose | |
" | |
Infinity_PlaySound('GAM_04') | |
" | |
label | |
{ | |
area 0 0 864 710 | |
mosaic GUICHISD | |
} | |
label | |
{ | |
area 82 12 700 40 | |
text "HATED_RACE_TITLE" | |
text style "title" | |
} | |
list | |
{ | |
column | |
{ | |
width 100 | |
label | |
{ | |
area 0 0 356 32 | |
bam GUICHLNG | |
frame lua "rowNumber == currentChargenHatedRace and 2 or 0" | |
} | |
label | |
{ | |
area 0 0 340 32 | |
text lua "Infinity_FetchString(dwHatedRace[rowNumber].name)" | |
text style "button" | |
pad 8 8 8 8 | |
} | |
} | |
action | |
" | |
if dwHatedRace[currentChargenHatedRace] then | |
dwOnRacialEnemySelectButtonClick(dwHatedRace[currentChargenHatedRace].id) | |
end | |
" | |
area 42 192 358 414 | |
rowheight 34 | |
hidehighlight | |
table "dwHatedRace" | |
var currentChargenHatedRace | |
scrollbar 'GUISCRC' | |
} | |
text | |
{ | |
area 450 198 362 410 | |
text lua "dwHatedRaceOrGeneralHelp()" | |
text style normal | |
text color D | |
scrollbar 'GUISCRC' | |
} | |
button | |
{ | |
on return | |
clickable lua "dwRacialEnemyDoneButtonClickable()" | |
action | |
" | |
dwRacialEnemyOnDoneButtonClick() | |
" | |
} | |
button | |
{ | |
on escape | |
action | |
" | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
" | |
} | |
button | |
{ | |
bam GUIOSTUL | |
area 210 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'DONE_BUTTON' or 'BACK_BUTTON')" | |
clickable lua "reverseButtonPosition and dwRacialEnemyDoneButtonClickable() or true" | |
action | |
" | |
if reverseButtonPosition then | |
dwRacialEnemyOnDoneButtonClick() | |
else | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
end | |
" | |
} | |
button | |
{ | |
bam GUIOSTUR | |
area 464 653 234 44 | |
text style "button" | |
text lua "t(reverseButtonPosition and 'BACK_BUTTON' or 'DONE_BUTTON')" | |
clickable lua "reverseButtonPosition and true or dwRacialEnemyDoneButtonClickable()" | |
action | |
" | |
if reverseButtonPosition then | |
Infinity_PopMenu() | |
createCharScreen:OnCancelButtonClick() | |
else | |
dwRacialEnemyOnDoneButtonClick() | |
end | |
" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Log of Currently Installed WeiDU Mods | |
// The top of the file is the 'oldest' mod | |
// ~TP2_File~ #language_number #component_number // [Subcomponent Name -> ] Component Name [ : Version] | |
~LEUI-BG1EE/LEUI-BG1EE.TP2~ #0 #0 // lefreut's Enhanced UI (BG1EE skin) - Core component: 4.7 | |
~HIDDENGAMEPLAYOPTIONS/HIDDENGAMEPLAYOPTIONS.TP2~ #0 #0 // Install all Hidden Gameplay Options at once: 4.6 | |
~CDTWEAKS/SETUP-CDTWEAKS.TP2~ #0 #182 // Unique Containers [Miloch] -> Unique icons and names: v16 | |
~CDTWEAKS/SETUP-CDTWEAKS.TP2~ #0 #3290 // Personalize Automatic Save Names -> Use scheme: 000000000-Protagonist-Save-Name: v16 | |
~CDTWEAKS/SETUP-CDTWEAKS.TP2~ #0 #3300 // Death Cam: v16 | |
~CDTWEAKS/SETUP-CDTWEAKS.TP2~ #0 #3355 // Create Interval Saves [argent77] -> Every 30 minutes (cycle through four saves): v16 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #1500 // Include arcane spells from Icewind Dale: Enhanced Edition: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #1510 // Include divine spells from Icewind Dale: Enhanced Edition: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #1520 // Include bard songs from Icewind Dale: Enhanced Edition: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #2000 // Install all spell tweaks (if you don't select this, you will be given a chance to choose by category): Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #2500 // Add 9 new arcane spells: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #2510 // Add 6 new divine spells (some borrowed from Divine Remix): Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #2520 // Revised Elementals: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #20000 // Introduce new races and subraces: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40100 // Revised class alignment rules: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40200 // Icewind Dale-style paladins: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40300 // Revised Smite Evil: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40470 // Rebalanced thief and bounty hunter traps at low levels: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40500 // Revised favored enemy for rangers: new enemy groups, and rangers reselect their favored enemy at 4th level and every third level thereafter: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40650 // Revised speciality priests of Lathander/Helm/Talos/Tempus/Tyr: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40700 // Allow monks to use staffs: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40800 // Require speciality mages to memorize at least one spell per level from their speciality school: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40850 // Speciality mages automatically get one speciality spell at each level (where possible): Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40900 // Allow multiclassed and dual-classed mages to become specialists and wild mages: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40925 // Bloodlines for sorcerers: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #40950 // Dragon Disciples can be disciples of any chromatic dragon (Red/Blue/Green/Black/White): Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #41000 // Rebalanced and revised kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #50000 // New wizard specializations: elemental specialists: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #50100 // New wizard specialization: Force Mage: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #50200 // New wizard kits: Militant Wizards: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #50300 // New sorcerer kit: Bloodrager: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #50400 // New choices of god / goddess for speciality priests: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #50500 // New class: Favored Soul: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55000 // Allow druids to multiclass as mages, rangers, and thieves: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55100 // Multiclass/dual-class fighter/cleric kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55200 // Multiclass/dual-class fighter/druid kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55300 // Multiclass/dual-class fighter/mage kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55400 // Multiclass/dual-class fighter/thief kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55500 // Multiclass/dual-class cleric/mage kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55600 // Multiclass/dual-class cleric/ranger and druid/ranger kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55700 // Multiclass/dual-class cleric/thief and druid/thief kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55800 // Multiclass/dual-class mage/thief kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #55900 // Multiclass fighter/mage/cleric kits: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #60100 // Characters choose minor new abilities every three levels: Beta 7 | |
~DW_TALENTS/DW_TALENTS.TP2~ #0 #60300 // Improved NPC customisation and management: Beta 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment