Advertisement
Guest User

UI.menu

a guest
Feb 14th, 2020
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 457.60 KB | None | 0 0
  1. `
  2. --reload language
  3. if(uiTranslationFile) then
  4. Infinity_DoFile("L_" .. uiTranslationFile)
  5. else
  6. Infinity_DoFile("L_en_us")
  7. end
  8. listMetaInfo = {}
  9. combatLog = {}
  10.  
  11.  
  12. currentPanelID = 0
  13.  
  14. function displayTHAC()
  15. thactxt = ''
  16. thactxt = characters[currentID].THAC0.current
  17.  
  18. if (characters[currentID].THAC0.offhand ) then
  19. thactxt = thactxt .. '\n' .. characters[currentID].THAC0.offhand
  20. end
  21.  
  22. return thactxt
  23. end
  24.  
  25. function displayCompiledAC()
  26. local compiledAC = characters[currentID].AC.current
  27.  
  28. if characters[currentID].AC.crushing ~= 0 or characters[currentID].AC.missile ~= 0 or characters[currentID].AC.piercing ~= 0 or characters[currentID].AC.slashing ~= 0 then
  29. compiledAC = compiledAC .. " (" .. t("MODIFIERS_LABEL") .. ": "
  30.  
  31. local numMods = 0
  32. if characters[currentID].AC.crushing > 0 then
  33. numMods = numMods + 1
  34. setStringTokenLua("<ACTOKEN>","+"..characters[currentID].AC.crushing)
  35. compiledAC = compiledAC .. " " .. t("ACMOD_VS_CRUSHING")
  36. removeStringTokenLua("<ACTOKEN>")
  37. elseif characters[currentID].AC.crushing < 0 then
  38. numMods = numMods + 1
  39. setStringTokenLua("<ACTOKEN>",characters[currentID].AC.crushing)
  40. compiledAC = compiledAC .. " " .. t("ACMOD_VS_CRUSHING")
  41. removeStringTokenLua("<ACTOKEN>")
  42. end
  43.  
  44. if characters[currentID].AC.missile > 0 then
  45. if numMods > 0 then
  46. compiledAC = compiledAC .. ", "
  47. end
  48. numMods = numMods + 1
  49. setStringTokenLua("<ACTOKEN>","+"..characters[currentID].AC.missile)
  50. compiledAC = compiledAC .. " " .. t("ACMOD_VS_MISSILE")
  51. removeStringTokenLua("<ACTOKEN>")
  52. elseif characters[currentID].AC.missile < 0 then
  53. if numMods > 0 then
  54. compiledAC = compiledAC .. ", "
  55. end
  56. numMods = numMods + 1
  57. setStringTokenLua("<ACTOKEN>",characters[currentID].AC.missile)
  58. compiledAC = compiledAC .. " " .. t("ACMOD_VS_MISSILE")
  59. removeStringTokenLua("<ACTOKEN>")
  60. end
  61.  
  62. if characters[currentID].AC.piercing > 0 then
  63. if numMods > 0 then
  64. compiledAC = compiledAC .. ", "
  65. end
  66. numMods = numMods + 1
  67. setStringTokenLua("<ACTOKEN>","+"..characters[currentID].AC.piercing)
  68. compiledAC = compiledAC .. " " .. t("ACMOD_VS_PIERCING")
  69. removeStringTokenLua("<ACTOKEN>")
  70. elseif characters[currentID].AC.piercing < 0 then
  71. if numMods > 0 then
  72. compiledAC = compiledAC .. ", "
  73. end
  74. numMods = numMods + 1
  75. setStringTokenLua("<ACTOKEN>",characters[currentID].AC.piercing)
  76. compiledAC = compiledAC .. " " .. t("ACMOD_VS_PIERCING")
  77. removeStringTokenLua("<ACTOKEN>")
  78. end
  79.  
  80. if characters[currentID].AC.slashing > 0 then
  81. if numMods > 0 then
  82. compiledAC = compiledAC .. ", "
  83. end
  84. numMods = numMods + 1
  85. setStringTokenLua("<ACTOKEN>","+"..characters[currentID].AC.slashing)
  86. compiledAC = compiledAC .. " " .. t("ACMOD_VS_SLASHING")
  87. removeStringTokenLua("<ACTOKEN>")
  88. elseif characters[currentID].AC.slashing < 0 then
  89. if numMods > 0 then
  90. compiledAC = compiledAC .. ", "
  91. end
  92. numMods = numMods + 1
  93. setStringTokenLua("<ACTOKEN>",characters[currentID].AC.slashing)
  94. compiledAC = compiledAC .. " " .. t("ACMOD_VS_SLASHING")
  95. removeStringTokenLua("<ACTOKEN>")
  96. end
  97.  
  98. compiledAC = compiledAC .. ")"
  99. end
  100.  
  101. return compiledAC
  102. end
  103.  
  104. function displaySTR()
  105. strtxt = characters[currentID].attr.str.current
  106.  
  107. if characters[currentID].attr.str.current == 18 and characters[currentID].attr.str.extra > 0 then
  108. if characters[currentID].attr.str.extra == 100 then
  109. strtxt = strtxt .. '/00'
  110. elseif characters[currentID].attr.str.extra > 9 then
  111. strtxt = strtxt .. '/' .. characters[currentID].attr.str.extra
  112. elseif characters[currentID].attr.str.extra > 0 then
  113. strtxt = strtxt .. '/0' .. characters[currentID].attr.str.extra
  114. end
  115. end
  116. if(characters[currentID].attr.str.current > characters[currentID].attr.str.base or characters[currentID].attr.str.extra > characters[currentID].attr.str.extraBase) then
  117. strtxt = '^G' .. strtxt .. '^-'
  118. end
  119. if(characters[currentID].attr.str.current < characters[currentID].attr.str.base or characters[currentID].attr.str.extra < characters[currentID].attr.str.extraBase) then
  120. strtxt = '^R' .. strtxt .. '^-'
  121. end
  122. return strtxt
  123. end
  124.  
  125. function updateAttrTable()
  126.  
  127. statusEffects = { }
  128. for k, v in pairs(characters[currentID].statusEffects) do
  129. table.insert(statusEffects, v)
  130.  
  131. end
  132.  
  133. listItems = { }
  134. listTest = { }
  135.  
  136. lastID = currentID
  137. helpTextString = ''
  138. showClassInfo = 0
  139. showJustText = 0
  140. showMemorized = 0
  141. showBothLists = 0
  142. showStats = 1
  143. showAbilityBonuses = 0
  144.  
  145. otherlist = { }
  146.  
  147. attributeItems = {
  148. { characters[currentID].attr.str, 9582 },
  149. { characters[currentID].attr.dex, 9584 },
  150. { characters[currentID].attr.con, 9583 },
  151. { characters[currentID].attr.int, 9585 },
  152. { characters[currentID].attr.wis, 9586 },
  153. { characters[currentID].attr.cha, 9587 }
  154. }
  155.  
  156.  
  157. if currentTab == 1 then
  158. showJustText = 1
  159. showStats = 0
  160. helpTextString = characters[currentID].proficiencies.details
  161. elseif currentTab == 2 then
  162. showClassInfo = 1
  163. showStats = 0
  164.  
  165. listItems = {
  166. { characters[currentID].classlevel.first, characters[currentID].classlevel.first },
  167. { characters[currentID].classlevel.second, characters[currentID].classlevel.second },
  168. { characters[currentID].classlevel.third, characters[currentID].classlevel.third },
  169. }
  170. elseif currentTab == 3 then
  171.  
  172. listItems = {
  173. { characters[currentID].proficiencies.lore.strRef, characters[currentID].proficiencies.lore.current },
  174. { characters[currentID].proficiencies.reputation.strRef, characters[currentID].proficiencies.reputation.current, characters[currentID].proficiencies.reputation.helpStrRef },
  175.  
  176. }
  177. for k, v in ipairs(characters[currentID].proficiencies.class_skills) do
  178. table.insert(listItems, {v.strRef, v.current})
  179. --table.insert(listItems, {v.helpStrRef, ''})
  180. end
  181.  
  182. showJustText = 1
  183. showStats = 0
  184. helpTextString = ''
  185. for k, v in ipairs(listItems) do
  186. if (v[3] == nil or v[3] == '') then
  187. helpTextString = helpTextString .. Infinity_FetchString( v[1]) .. ': ' .. v[2] .. '^-' .. '\n'
  188. else
  189. helpTextString = helpTextString .. Infinity_FetchString( v[1]) .. ': ' .. v[2] .. '^-' .. '\n' .. Infinity_FetchString(v[3]) ..'\n \n'
  190. end
  191. end
  192.  
  193. elseif currentTab == 4 then
  194. listItems = { }
  195. showJustText = 1
  196. showStats = 0
  197. if openAdvance == 0 then
  198. for k, v in ipairs(listItems) do
  199. --Infinity_Log( 'v[2]'.. v[2])
  200. helpTextString = helpTextString .. '^M' .. Infinity_FetchString( v[1]) .. ': '.. v[2] .. '^-' .. '\n' .. Infinity_FetchString(v[3]) ..'\n \n'
  201. end
  202. else
  203. for k, v in ipairs(listItems) do
  204. helpTextString = helpTextString .. '^M' .. Infinity_FetchString( v[1]) .. ': '.. v[2] .. '^-' ..'\n'
  205. end
  206. end
  207. elseif currentTab == 8 then
  208. listItems = { }
  209. for k, v in ipairs(characters[currentID].proficiencies.ability) do
  210. table.insert(listItems, {v.strRef, v.current, v.helpStrRef})
  211. --table.insert(listItems, {v.helpStrRef, ''})
  212. end
  213.  
  214. showAbilityBonuses = 1
  215. showJustText = 0
  216. showStats = 0
  217. for k, v in ipairs(listItems) do
  218. helpTextString = helpTextString .. '^M' .. v[2] .. '\n \n'
  219. end
  220.  
  221. elseif currentTab == 9 then
  222. showJustText = 1
  223. showStats = 0
  224. helpTextString = ''
  225. table.insert(listItems, { 'HP_LABEL', characters[currentID].HP.current .. '/' .. characters[currentID].HP.max , characters[currentID].HP.details })
  226. table.insert(listItems, { 'AC_LABEL', displayCompiledAC(), characters[currentID].AC.details })
  227. table.insert(listItems, { 'NUM_ATTACKS_LABEL', characters[currentID].proficiencies.numAttacks.current, '' })
  228.  
  229. if characters[currentID].proficiencies.weapons.current ~= "" then
  230. table.insert(listItems, { 'PROFICIENCIES_LABEL', '', characters[currentID].proficiencies.weapons.current })
  231. end
  232. if characters[currentID].proficiencies.fightingstyles.current ~= "" then
  233. table.insert(listItems, { 'FIGHTING_STYLES_LABEL', '', characters[currentID].proficiencies.fightingstyles.current })
  234. end
  235.  
  236. if ( characters[currentID].THAC0.detailsOffhand ~= nil and characters[currentID].THAC0.detailsOffhand ~= "" ) then
  237. table.insert(listItems, { 'MAIN_HAND_THAC0', characters[currentID].THAC0.current .. '\n' .. characters[currentID].THAC0.details .. '\n\n' .. t('OFF_HAND_THAC0')..': '..characters[currentID].THAC0.offhand .. '\n' .. characters[currentID].THAC0.detailsOffhand, '' })
  238. else
  239. table.insert(listItems, { 'THAC0_LABEL', characters[currentID].THAC0.current, characters[currentID].THAC0.details })
  240. end
  241.  
  242. if ( characters[currentID].damage.maxOffhand ) then
  243. table.insert(listItems, { 'MAIN_HAND_DAMAGE', characters[currentID].damage.min .. '-' .. characters[currentID].damage.max .. '\n' .. characters[currentID].damage.details .. '\n\n' .. t('OFF_HAND_DAMAGE') .. ': ' .. characters[currentID].damage.minOffhand .. '-' .. characters[currentID].damage.maxOffhand .. '\n' .. characters[currentID].damage.detailsOffhand, ''})
  244. else
  245. table.insert(listItems, { 'DAMAGE_LABEL', characters[currentID].damage.min .. '-' .. characters[currentID].damage.max, characters[currentID].damage.details})
  246. end
  247. table.insert(listItems, { 'SAVING_THROWS_LABEL', '', characters[currentID].proficiencies.savingThrows })
  248. table.insert(listItems, { 'RESISTANCES_LABEL', '', characters[currentID].proficiencies.resistances })
  249. table.insert(listItems, { 'CURRENT_SCRIPT_LABEL', '', characters[currentID].proficiencies.currentScript })
  250.  
  251. for k, v in ipairs(listItems) do
  252. if (v[3] == '' or v[3] == nil) then
  253. helpTextString = helpTextString .. t(v[1]) .. ': '.. v[2] .. '^-' .. '\n\n'
  254. else
  255. helpTextString = helpTextString .. t(v[1]) .. ': '.. v[2] .. '^-' .. '\n' .. v[3] ..'\n\n'
  256. end
  257. end
  258.  
  259. elseif currentTab == 6 then
  260. otherlist = {
  261. { characters[currentID].Stats.bestenemy.strRef, characters[currentID].Stats.bestenemy.current, ' ' },
  262. { characters[currentID].Stats.timespent.strRef, characters[currentID].Stats.timespent.current, ' '},
  263. { characters[currentID].Stats.favspell.strRef, characters[currentID].Stats.favspell.current, ' '},
  264. { characters[currentID].Stats.favweapon.strRef, characters[currentID].Stats.favweapon.current, ' '},
  265. }
  266. listItems = {
  267. { characters[currentID].Stats.partychapxp.strRef, characters[currentID].Stats.partychapxp.current .. '%', characters[currentID].Stats.partygamexp.current .. '%'},
  268. { characters[currentID].Stats.partychapkills.strRef, characters[currentID].Stats.partychapkills.current .. '%', characters[currentID].Stats.partygamekills.current .. '%'},
  269. { characters[currentID].Stats.chapxpvalue.strRef, characters[currentID].Stats.chapxpvalue.current, characters[currentID].Stats.gamexpvalue.current},
  270. { characters[currentID].Stats.chapkills.strRef, characters[currentID].Stats.chapkills.current, characters[currentID].Stats.gamekills.current},
  271. }
  272. elseif currentTab == 7 then
  273. listItems = { }
  274. showJustText = 1
  275. showStats = 0
  276. helpTextString = Infinity_FetchString(characters[currentID].biography)
  277. elseif currentTab == 5 then
  278. listItems = { }
  279. showJustText = 1
  280. showStats = 0
  281. helpTextString = characters[currentID].kitDesc
  282. else
  283. listItems = { }
  284. end
  285.  
  286. characterViewable = characterScreen:IsCharacterViewable()
  287. showClassInfo = showClassInfo == 1 and characterViewable == true
  288. showJustText = showJustText == 1 and characterViewable == true
  289. showMemorized = showMemorized == 1 and characterViewable == true
  290. showBothLists = showBothLists == 1 and characterViewable == true
  291. showStats = showStats == 1 and characterViewable == true
  292. showAbilityBonuses = showAbilityBonuses == 1 and characterViewable == true
  293.  
  294. end
  295.  
  296. characters = {}
  297. statusEffects = { }
  298.  
  299. currentID = 16974083
  300. canLevelUp = 0
  301. openAdvance = 0
  302. notrealValue = 0
  303.  
  304. function trunc(str, len)
  305. if str:len() < len then
  306. return str
  307. else
  308. return str:sub(1,len) .. "..."
  309. end
  310. end
  311.  
  312. function characterDescString(char)
  313. return Infinity_FetchString(char.gender) .. "\n" .. Infinity_FetchString(char.race) .. "\n" .. char.class .. "\n" .. Infinity_FetchString(char.alignment) .. ""
  314. end
  315.  
  316. function isStatModified(index)
  317. if (index == 1 ) then
  318. --strength
  319. return (characters[currentID].attr.str.current ~= characters[currentID].attr.str.base or characters[currentID].attr.str.extra ~= characters[currentID].attr.str.extraBase)
  320. else
  321. return attributeItems[index][1].current ~= attributeItems[index][1].base
  322. end
  323. end
  324.  
  325. function displayAttr(index)
  326. str = 0
  327. if (index == 1 ) then
  328. str = displaySTR()
  329. else
  330. str = displayBuff( attributeItems[index][1].current, attributeItems[index][1].base, 1)
  331. end
  332. return str
  333. end
  334.  
  335. function getPercent(first, second)
  336. tempNumber = ( first/second ) *100
  337. return tempNumber
  338. end
  339.  
  340. function displayBuff( current, base, highisbetter)
  341.  
  342. tmpstr = ''
  343. --Infinity_Log( current .. ' - '.. base )
  344. if(highisbetter) then
  345. if(current > base) then
  346. tmpstr = '^G' .. current .. '^-'
  347. elseif (current < base) then
  348. tmpstr = '^R' .. current .. '^-'
  349. end
  350. else
  351. if(current > base) then
  352. tmpstr = '^R' .. current .. '^-'
  353. elseif (current < base) then
  354. tmpstr = '^G' .. current .. '^-'
  355. end
  356. end
  357. if(current == base) then
  358. tmpstr = current
  359. end
  360. return tmpstr
  361. end
  362.  
  363. function getNextLevelString()
  364. local nextLevelXp = characters[currentID].level.nextLvlXp - characters[currentID].level.xp
  365. local str = ""
  366. if(nextLevelXp > 0) then
  367. str = t("NEXT_LEVEL_LABEL")
  368. str = str .. " "
  369. str = str .. nextLevelXp
  370. str = str .. " "
  371. str = str .. t("XP_LABEL")
  372. else
  373. str = t("READY_TO_LEVEL_LABEL")
  374. end
  375. return str
  376.  
  377. end
  378.  
  379. function CurrentlyInGame()
  380. if characterScreen:IsInGame() == true then
  381. return true
  382. else
  383. return false
  384. end
  385. end
  386. function getClassString()
  387. local out = characters[currentID].classlevel.first.details
  388. if ( characters[currentID].classlevel.second ) then
  389. out = out .. '\n\n' .. characters[currentID].classlevel.second.details
  390. end
  391. if ( characters[currentID].classlevel.third ) then
  392. out = out .. '\n\n' .. characters[currentID].classlevel.third.details
  393. end
  394.  
  395. out = out .. '\n\n' .. characters[currentID].kitDesc
  396.  
  397. return out
  398. end
  399. listItems = { }
  400. listTest = { }
  401.  
  402. helpTextString = ''
  403. currentTabIndex = 0
  404. currentTab = 0
  405. currentItem = 0
  406. ShowClassInfo = 0
  407. showStats = 0
  408. showJustText = 0
  409. showMemorized = 0
  410. showBothLists = 0
  411. characterViewable = true
  412. `
  413. menu
  414. {
  415. name 'CHARACTER'
  416. modal lua "not CurrentlyInGame()"
  417. align center center
  418. ignoreEsc
  419. onopen
  420. "
  421. currentTab = 1
  422. currentTabIndex = 1
  423. currentItem = 0
  424. showStats = 0
  425. showJustText = 0
  426. showClassInfo = 0
  427. showAbilityBonuses = 0
  428. showMemorized = 0
  429. showBothLists = 0
  430. characterViewable = true
  431.  
  432. if(CurrentlyInGame()) then
  433. pushSidebars()
  434. end
  435. updateAttrTable()
  436.  
  437. if(currentPanelID == const.EXPORT_ID) then
  438. Infinity_PushMenu('CHARACTER_EXPORT')
  439. else
  440. if(currentPanelID == const.CUSTOMIZE_ID) then
  441. Infinity_PushMenu('CHARACTER_CUSTOMIZE')
  442. else
  443. currentPanelID = 0
  444. end
  445. end
  446. "
  447. onclose
  448. "
  449. Infinity_PopMenu('CHARACTER_CUSTOMIZE')
  450. Infinity_PopMenu('CHARACTER_BIOGRAPHY')
  451. Infinity_PopMenu('CHARACTER_SHOW_BIOGRAPHY')
  452. Infinity_PopMenu('CHARACTER_INFO')
  453. Infinity_PopMenu('CHARACTER_SCRIPT')
  454. Infinity_PopMenu('CHARACTER_EXPORT')
  455. Infinity_PopMenu('CHARACTER_SOUND')
  456. Infinity_PopMenu('CHARACTER_COLOR')
  457. Infinity_PopMenu('CHARACTER_SHOW_CLASSINFO')
  458. Infinity_PopMenu('CHARGEN_PORTRAIT')
  459. popSidebars()
  460. "
  461.  
  462. label
  463. {
  464. area 0 0 941 756
  465. mosaic "GUIREC2"
  466. }
  467.  
  468.  
  469. label
  470. {
  471. name "LABEL_2_268435495"
  472. area 244 34 454 42
  473. text lua "characters[currentID].name"
  474. text style 'title'
  475. text align center center
  476. enabled "characterViewable"
  477. }
  478.  
  479. label
  480. {
  481. area 654 476 174 20
  482. progressbar lua "getPercent(characters[currentID].level.xp, characters[currentID].level.nextLvlXp)" --progress percentage, number 0-100
  483. greyscale 0 --display greyscale or not, number 0-1
  484. progressbar color 128 0 0 255 --color when percentage != 100
  485. progressbar full 128 0 0 255 --color when percentage == 100
  486. enabled "characterViewable"
  487. }
  488. label
  489. {
  490. area 654 476 174 20
  491. text lua "getNextLevelString()"
  492. text style 'normal'
  493. text align center center
  494. text shadow 1
  495. enabled "characterViewable"
  496. }
  497.  
  498.  
  499.  
  500. button
  501. {
  502. area 117 88 140 32
  503. bam 'GUIBUTNS'
  504. text 'INFORMATION_BUTTON'
  505. text style "button"
  506. pad 10 4 10 4
  507. action "currentTab = 1; updateAttrTable()"
  508. }
  509. button
  510. {
  511. area 257 88 140 32
  512. bam 'GUIBUTNS'
  513. text 'CLASS_LABEL'
  514. text style "button"
  515. pad 10 4 10 4
  516. action "currentTab = 2; updateAttrTable()"
  517. }
  518. button
  519. {
  520. area 397 88 140 32
  521. bam 'GUIBUTNS'
  522. text 'COMBAT_STATS_LABEL'
  523. text style "button"
  524. pad 10 4 10 4
  525. action "currentTab = 9; updateAttrTable()"
  526. }
  527. button
  528. {
  529. area 537 88 140 32
  530. bam 'GUIBUTNS'
  531. text 'SKILLS_LABEL'
  532. text style "button"
  533. pad 10 4 10 4
  534. action "currentTab = 3; updateAttrTable()"
  535. }
  536.  
  537. button
  538. {
  539. area 677 88 140 32
  540. bam 'GUIBUTNS'
  541. text 'ABILITIES_BUTTON'
  542. text style "button"
  543. pad 10 4 10 4
  544. action "currentTab = 8; updateAttrTable()"
  545. }
  546.  
  547. button
  548. {
  549. area 110 158 140 32
  550. bam 'GUIBUTNS'
  551. text 'STATS_LABEL'
  552. text style "button"
  553. pad 10 4 10 4
  554. action "currentTab = 6; updateAttrTable()"
  555. }
  556.  
  557. button
  558. {
  559. area 274 158 140 32
  560. bam 'GUIBUTNS'
  561. text 'BIOGRAPHY_LABEL'
  562. text style "button"
  563. pad 10 4 10 4
  564. action "currentTab = 7; updateAttrTable()"
  565. }
  566.  
  567. list
  568. {
  569. column
  570. {
  571. width 65
  572. label
  573. {
  574. area 0 0 -1 36
  575. text lua "Infinity_FetchString( attributeItems[rowNumber][1].strRef)"
  576. text style 'normal'
  577. text align left center
  578. }
  579. }
  580. column
  581. {
  582. width 35
  583. label
  584. {
  585. area 0 0 -1 36
  586. text lua "displayAttr(rowNumber)" --"listItems[rowNumber][1].current"
  587. text style 'label'
  588. text align right center
  589. text shadow lua "isStatModified(rowNumber)"
  590.  
  591. }
  592. }
  593.  
  594. area 456 162 162 218
  595.  
  596. rowheight 36
  597. table "attributeItems"
  598. var currentItem
  599. hidehighlight
  600. enabled "characterViewable"
  601. action
  602. "
  603. helpTextString = Infinity_FetchString( attributeItems[currentItem][2])
  604. "
  605. }
  606.  
  607. list
  608. {
  609. column
  610. {
  611. width 13
  612. label
  613. {
  614. area 0 0 22 -1
  615. bam lua "statusEffects[rowNumber].bam"
  616. sequence lua "statusEffects[rowNumber].current"
  617. text align center center
  618. }
  619. }
  620. column
  621. {
  622. width 87
  623. label
  624. {
  625. area 0 0 -1 -1
  626. text lua "Infinity_FetchString(statusEffects[rowNumber].strRef)"
  627. text style 'normal'
  628. text align left center
  629. }
  630. }
  631.  
  632. area 450 504 172 108
  633. rowheight dynamic
  634. table "statusEffects"
  635. var notrealValue
  636. scrollbar 'GUISCRC'
  637. enabled "characterViewable"
  638. hidehighlight
  639. }
  640.  
  641. button
  642. {
  643. name "BUTTON_2_2"
  644. area 654 172 180 279
  645. --text lua "characters[currentID].portrait"
  646. text align center center
  647. text point 10
  648. text color B
  649. bitmap lua "characters[currentID].portrait"
  650. action
  651. "
  652. Infinity_Log(dump(characters, 0))
  653. "
  654. }
  655. label
  656. {
  657. area 644 512 194 92
  658. text lua "characterDescString(characters[currentID])"
  659. text style 'normal'
  660. text align center center
  661. enabled "characterViewable"
  662. }
  663.  
  664. -- class section
  665.  
  666. text
  667. {
  668. enabled "showClassInfo"
  669. area 92 208 342 412
  670. text lua "getClassString()"
  671. text style 'normal'
  672. scrollbar 'GUISCRC'
  673. }
  674.  
  675. -- ability bonus stuff
  676.  
  677. list
  678. {
  679. column
  680. {
  681. width 100
  682. label
  683. {
  684. area 0 0 -1 -1
  685. text lua "listItems[rowNumber][2]"
  686. text style 'normal'
  687. text align left center
  688.  
  689. }
  690. }
  691.  
  692. area 92 208 342 418
  693.  
  694. enabled "showAbilityBonuses"
  695. rowheight 45
  696. table "listItems"
  697. var currentItem
  698. scrollbar 'GUISCRC'
  699. hidehighlight
  700. action
  701. "
  702. --helpTextString = Infinity_FetchString( listItems[currentItem][1].helpStrRef)
  703. "
  704. }
  705.  
  706. -- Stats screen stuff
  707. list
  708. {
  709. column
  710. {
  711. width 65
  712. label
  713. {
  714. area 0 0 -1 -1
  715. text lua "Infinity_FetchString(otherlist[rowNumber][1])"
  716. text style 'normal'
  717. text align left center
  718.  
  719. }
  720. }
  721. column
  722. {
  723. width 35
  724. label
  725. {
  726. area 0 0 -1 -1
  727. text lua " otherlist[rowNumber][2]"
  728. text style 'normal'
  729. text align center center
  730. }
  731. }
  732.  
  733. area 92 204 346 186
  734.  
  735. enabled "showStats"
  736. rowheight 45
  737. table "otherlist"
  738. var currentItem
  739. scrollbar 'GUISCRC'
  740. hidehighlight
  741. action
  742. "
  743. --helpTextString = Infinity_FetchString( listItems[currentItem][1].helpStrRef)
  744. "
  745. }
  746.  
  747. label
  748. {
  749. enabled "showStats"
  750. area 370 402 64 28
  751. text "GAME_LABEL"
  752. text style 'label'
  753. text align center center
  754. }
  755. label
  756. {
  757. enabled "showStats"
  758. area 300 402 70 28
  759. text "CHAPTER_LABEL"
  760. text style 'label'
  761. text align center center
  762. }
  763.  
  764. list
  765. {
  766. column
  767. {
  768. width 65
  769. label
  770. {
  771. area 0 0 -1 -1
  772. text lua "Infinity_FetchString(listItems[rowNumber][1])" --lua " '^M' .. Infinity_FetchString(listItems[rowNumber][1]) .. '^-' .. '\n' .. trunc(Infinity_FetchString( listItems[rowNumber][3]), 140)"
  773. text style 'normal'
  774. text align left center
  775.  
  776. }
  777. }
  778. column
  779. {
  780. width 20
  781. label
  782. {
  783. area 0 0 -1 -1
  784. text lua " listItems[rowNumber][2]"
  785. text style 'normal'
  786. text align center center
  787.  
  788. }
  789. }
  790. column
  791. {
  792. width 15
  793. label
  794. {
  795. area 0 0 -1 -1
  796. text lua " listItems[rowNumber][3]"
  797. text style 'normal'
  798. text align center center
  799.  
  800. }
  801. }
  802.  
  803. area 92 430 350 196
  804.  
  805. enabled "showStats"
  806. rowheight 45
  807. table "listItems"
  808. var currentItem
  809. scrollbar 'GUISCRC'
  810. hidehighlight
  811. action
  812. "
  813. --helpTextString = Infinity_FetchString( listItems[currentItem][1].helpStrRef)
  814. "
  815. }
  816.  
  817.  
  818. -- Biography section
  819.  
  820. text
  821. {
  822. enabled "showJustText"
  823. area 92 208 342 412
  824. text lua "helpTextString"
  825. text style 'normal'
  826. text align left top
  827. scrollbar 'GUISCRC'
  828. }
  829.  
  830. button
  831. {
  832. enabled "CurrentlyInGame()"
  833. name "BUTTON_2_50"
  834. area 142 656 200 40
  835. text "CUSTOMIZE_BUTTON"
  836. text style "button"
  837. bam GUIBUTNT
  838. sequence 0
  839. clickable lua "characterScreen:IsMultiPlayerModifyable()"
  840. action
  841. "
  842. characterScreen:OnCustomizeButtonClick();
  843. "
  844. }
  845. button
  846. {
  847. enabled "CurrentlyInGame()"
  848. name "BUTTON_2_36"
  849. area 588 656 200 40
  850. text "EXPORT_BUTTON"
  851. text style "button"
  852. bam GUIBUTNT
  853. sequence 0
  854. clickable lua "characterScreen:IsExportButtonClickable()"
  855. action
  856. "
  857. characterScreen:OnExportButtonClick();
  858. "
  859. }
  860.  
  861. button
  862. {
  863. enabled "CurrentlyInGame()"
  864. clickable lua "characterScreen:IsReformPartyButtonClickable()"
  865. name "BUTTON_2_51"
  866. area 366 656 200 40
  867. text "REFORM_PARTY_BUTTON"
  868. text style "button"
  869. bam GUIBUTNT
  870. sequence 3
  871. action "characterScreen:OnReformPartyButtonClick();"
  872. }
  873. button
  874. {
  875. enabled "CurrentlyInGame()"
  876. name "BUTTON_2_0"
  877. area 466 410 140 32
  878. text "DUAL_CLASS_BUTTON"
  879. text style "button"
  880. pad 10 4 10 4
  881. bam GUIBUTNS
  882. sequence 2
  883. clickable lua "characterScreen:IsDualClassButtonClickable()"
  884. action
  885. "
  886. popup2Button('DUALCLASS_CONFIRMATION', 'YES_BUTTON', function() characterScreen:OnDualClassButtonClick() end, 'NO_BUTTON')
  887. "
  888. }
  889. button
  890. {
  891. enabled "CurrentlyInGame()"
  892. name "BUTTON_2_37"
  893. area 466 454 140 32
  894. text "LEVEL_UP_BUTTON"
  895. text style "button"
  896. pad 10 4 10 4
  897. bam GUIBUTNS
  898. sequence 3
  899. clickable lua "characterScreen:IsLevelUpButtonClickable()"
  900. action " characterScreen:OnLevelUpButtonClick();"
  901. }
  902.  
  903. button
  904. {
  905. enabled "CurrentlyInGame()"
  906. on escape
  907. area 813 2 53 44
  908. action
  909. "
  910. e:SelectEngine(worldScreen)
  911. "
  912. }
  913.  
  914. button
  915. {
  916. enabled "not CurrentlyInGame()"
  917. area 388 664 200 40
  918. text "DONE_BUTTON"
  919. text style "button"
  920. bam GUIBUTNT
  921. sequence 3
  922. action "Infinity_PopMenu()"
  923. }
  924. }
  925. menu
  926. {
  927. name 'CHARACTER_CUSTOMIZE'
  928. align center center
  929. modal
  930. ignoreesc
  931. onOpen
  932. "
  933. currentPanelID = const.CUSTOMIZE_ID
  934. "
  935. label
  936. {
  937. area 0 0 864 710
  938. mosaic GUICGWDE
  939. }
  940.  
  941. text
  942. {
  943. area 380 100 446 490
  944. text 11327 --Customize help text
  945. scrollbar 'GUISCRC'
  946. text style normal
  947. }
  948. label
  949. {
  950. area 234 38 396 44
  951. text "CUSTOMIZE_TITLE"
  952. text style title
  953. }
  954. button
  955. {
  956. bam 'GUIBUTWS'
  957. sequence 0
  958. area 23 100 340 32
  959. text style "button"
  960. text "APPEARANCE_BUTTON"
  961. clickable lua
  962. "
  963. characterScreen:IsAppearanceButtonClickable();
  964. "
  965. action
  966. "
  967. characterScreen:OnAppearanceButtonClick()
  968. "
  969. }
  970. button
  971. {
  972. bam 'GUIBUTWS'
  973. sequence 0
  974. area 23 133 340 32
  975. text style "button"
  976. text "SOUNDS_BUTTON"
  977. clickable lua
  978. "
  979. characterScreen:IsAppearanceButtonClickable();
  980. "
  981. action
  982. "
  983. characterScreen:OnSoundsButtonClick()
  984. "
  985. }
  986. button
  987. {
  988. bam 'GUIBUTWS'
  989. sequence 0
  990. area 23 165 340 32
  991. text style "button"
  992. text "COLORS_BUTTON"
  993. clickable lua
  994. "
  995. characterScreen:IsAppearanceButtonClickable();
  996. "
  997. action
  998. "
  999. characterScreen:OnHairSkinButtonClick()
  1000. "
  1001. }
  1002. button
  1003. {
  1004. bam 'GUIBUTWS'
  1005. sequence 0
  1006. area 23 198 340 32
  1007. text style "button"
  1008. text "SCRIPT_BUTTON"
  1009. action
  1010. "
  1011. characterScreen:OnScriptButtonClick()
  1012. "
  1013. }
  1014. button
  1015. {
  1016. bam 'GUIBUTWS'
  1017. sequence 0
  1018. area 23 231 340 32
  1019. text style "button"
  1020. text "BIOGRAPHY_BUTTON"
  1021. clickable lua
  1022. "
  1023. characterScreen:IsAppearanceButtonClickable();
  1024. "
  1025. action
  1026. "
  1027. characterScreen:OnCusomizeBiographyButtonClick()
  1028. "
  1029. }
  1030. button
  1031. {
  1032. on escape
  1033. bam 'GUIBUTMT'
  1034. sequence 0
  1035. area 196 653 230 40
  1036. text style "button"
  1037. text "CANCEL_BUTTON"
  1038. action
  1039. "
  1040. characterScreen:OnCancelButtonClick()
  1041. currentPanelID = 0
  1042. Infinity_PopMenu('CHARACTER_CUSTOMIZE')
  1043. "
  1044. }
  1045. button
  1046. {
  1047. bam 'GUIBUTMT'
  1048. sequence 0
  1049. area 438 653 230 40
  1050. text style "button"
  1051. text "DONE_BUTTON"
  1052. action
  1053. "
  1054. characterScreen:OnDoneButtonClick()
  1055. currentPanelID = 0
  1056. Infinity_PopMenu('CHARACTER_CUSTOMIZE')
  1057. "
  1058. }
  1059. }
  1060. `
  1061. recBioEdit = ""
  1062. recBioEditBackup = ""
  1063. `
  1064. menu
  1065. {
  1066. name 'CHARACTER_BIOGRAPHY'
  1067. align center center
  1068. ignoreesc
  1069. onOpen
  1070. "
  1071. recBioEditBackup = recBioEdit
  1072. currentPanelID = 23
  1073. "
  1074. label
  1075. {
  1076. area 0 0 864 710
  1077. mosaic GUICGWDE
  1078. }
  1079. label
  1080. {
  1081. area 82 37 700 44
  1082. text "BIOGRAPHY_TITLE"
  1083. text style 'title'
  1084. }
  1085. label
  1086. {
  1087. area 372 92 466 498
  1088. fill 112 111 111 64
  1089. }
  1090. edit
  1091. {
  1092. name "recBioEditArea"
  1093. area 372 92 466 498
  1094. var recBioEdit
  1095. scrollbar 'GUISCRC'
  1096. text style "edit"
  1097. }
  1098.  
  1099. button
  1100. {
  1101. bam 'GUIBUTWS'
  1102. sequence 0
  1103. area 23 100 340 32
  1104. text style "button"
  1105. text "CLEAR_BUTTON"
  1106. action
  1107. "
  1108. recBioEdit = ''
  1109. "
  1110. }
  1111. button
  1112. {
  1113. bam 'GUIBUTWS'
  1114. sequence 0
  1115. area 23 133 340 32
  1116. text style "button"
  1117. text "REVERT_BUTTON"
  1118. action
  1119. "
  1120. recBioEdit = recBioEditBackup
  1121. "
  1122. }
  1123. button
  1124. {
  1125. on escape
  1126. bam 'GUIBUTMT'
  1127. sequence 0
  1128. area 196 653 230 40
  1129. text style "button"
  1130. text "CANCEL_BUTTON"
  1131. action
  1132. "
  1133. characterScreen:OnCancelButtonClick()
  1134. Infinity_PopMenu()
  1135. currentPanelID = 17
  1136. "
  1137. }
  1138. button
  1139. {
  1140. bam 'GUIBUTMT'
  1141. sequence 0
  1142. area 438 653 230 40
  1143. text style "button"
  1144. text "DONE_BUTTON"
  1145. action
  1146. "
  1147. characterScreen:OnDoneButtonClick()
  1148. Infinity_PopMenu()
  1149. currentPanelID = 17
  1150. "
  1151. }
  1152. }
  1153.  
  1154.  
  1155. `
  1156. scriptList_idx = 0
  1157. showingSmartOptions = false
  1158. function formatScriptName(text)
  1159. local i = string.find(text, ":", #text)
  1160. if(i) then
  1161. text = string.sub(text,1, i - 1)
  1162. end
  1163. if(#text > 35) then
  1164. text = string.sub(text,1, 35)
  1165. text = text .. "..."
  1166. end
  1167. return text
  1168. end
  1169.  
  1170. scriptOptions =
  1171. {
  1172. {'SCRIPT_ATTACK_ENEMIES_LABEL', 'SCRIPT_ATTACK_ENEMIES_DESCRIPTION', 1, 0, 0},
  1173. {'SCRIPT_USE_MELEE_WEAPONS_LABEL', 'SCRIPT_USE_MELEE_WEAPONS_DESCRIPTION', 2, 0, 0},
  1174. {'SCRIPT_USE_RANGED_WEAPONS_LABEL', 'SCRIPT_USE_RANGED_WEAPONS_DESCRIPTION', 3, 0, 0},
  1175. {'SCRIPT_USE_ITEMS_LABEL', 'SCRIPT_USE_ITEMS_DESCRIPTION', 4, 0, 0},
  1176. {'SCRIPT_USE_SPECIAL_ABILITIES_LABEL', 'SCRIPT_USE_SPECIAL_ABILITIES_DESCRIPTION', 5, 0, 0},
  1177. {'SCRIPT_USE_OFFENSIVE_SPELLS_LABEL', 'SCRIPT_USE_OFFENSIVE_SPELLS_DESCRIPTION', 6, 0, 0},
  1178. {'SCRIPT_USE_DEFENSIVE_SPELLS_LABEL', 'SCRIPT_USE_DEFENSIVE_SPELLS_DESCRIPTION', 7, 0, 0},
  1179. {'SCRIPT_FIND_TRAPS_LABEL', 'SCRIPT_FIND_TRAPS_DESCRIPTION', 8, 0, 0},
  1180. {'SCRIPT_HIDE_IN_SHADOWS_LABEL', 'SCRIPT_HIDE_IN_SHADOWS_DESCRIPTION', 9, 0, 0},
  1181. {'SCRIPT_SING_BATTLESONG_LABEL', 'SCRIPT_SING_BATTLESONG_DESCRIPTION', 10, 0, 0},
  1182. {'SCRIPT_TURN_UNDEAD_LABEL', 'SCRIPT_TURN_UNDEAD_DESCRIPTION', 11, 0, 0}
  1183. }
  1184.  
  1185. function handleScriptOptionChange(option)
  1186. local wasOn = scriptOptions[option][4] == 2
  1187.  
  1188. if option == 2 then --Melee
  1189. if wasOn == true then
  1190. scriptOptions[option][4] = 0
  1191. scriptOptions[option][5] = false
  1192. else
  1193. scriptOptions[option][4] = 2
  1194. scriptOptions[option][5] = true
  1195. scriptOptions[option+1][4] = 0
  1196. scriptOptions[option+1][5] = false
  1197. end
  1198. elseif option == 3 then --Ranged
  1199. if wasOn == true then
  1200. scriptOptions[option][4] = 0
  1201. scriptOptions[option][5] = false
  1202. else
  1203. scriptOptions[option][4] = 2
  1204. scriptOptions[option][5] = true
  1205. scriptOptions[option-1][4] = 0
  1206. scriptOptions[option-1][5] = false
  1207. end
  1208. elseif option == 8 then --Find Traps
  1209. if wasOn == true then
  1210. scriptOptions[option][4] = 0
  1211. scriptOptions[option][5] = false
  1212. else
  1213. scriptOptions[option][4] = 2
  1214. scriptOptions[option][5] = true
  1215. scriptOptions[option+1][4] = 0
  1216. scriptOptions[option+1][5] = false
  1217. scriptOptions[option+2][4] = 0
  1218. scriptOptions[option+2][5] = false
  1219. scriptOptions[option+3][4] = 0
  1220. scriptOptions[option+3][5] = false
  1221. end
  1222. elseif option == 9 then --Hide
  1223. if wasOn == true then
  1224. scriptOptions[option][4] = 0
  1225. scriptOptions[option][5] = false
  1226. else
  1227. scriptOptions[option][4] = 2
  1228. scriptOptions[option][5] = true
  1229. scriptOptions[option-1][4] = 0
  1230. scriptOptions[option-1][5] = false
  1231. scriptOptions[option+1][4] = 0
  1232. scriptOptions[option+1][5] = false
  1233. scriptOptions[option+2][4] = 0
  1234. scriptOptions[option+2][5] = false
  1235. end
  1236. elseif option == 10 then --Sing
  1237. if wasOn == true then
  1238. scriptOptions[option][4] = 0
  1239. scriptOptions[option][5] = false
  1240. else
  1241. scriptOptions[option][4] = 2
  1242. scriptOptions[option][5] = true
  1243. scriptOptions[option-2][4] = 0
  1244. scriptOptions[option-2][5] = false
  1245. scriptOptions[option-1][4] = 0
  1246. scriptOptions[option-1][5] = false
  1247. scriptOptions[option+1][4] = 0
  1248. scriptOptions[option+1][5] = false
  1249. end
  1250. elseif option == 11 then --Turn
  1251. if wasOn == true then
  1252. scriptOptions[option][4] = 0
  1253. scriptOptions[option][5] = false
  1254. else
  1255. scriptOptions[option][4] = 2
  1256. scriptOptions[option][5] = true
  1257. scriptOptions[option-3][4] = 0
  1258. scriptOptions[option-3][5] = false
  1259. scriptOptions[option-2][4] = 0
  1260. scriptOptions[option-2][5] = false
  1261. scriptOptions[option-1][4] = 0
  1262. scriptOptions[option-1][5] = false
  1263. end
  1264. else
  1265. scriptOptions[option][4] = toggleFrame(scriptOptions[option][4])
  1266. if scriptOptions[option][4] == 0 then
  1267. scriptOptions[option][5] = false
  1268. else
  1269. scriptOptions[option][5] = true
  1270. end
  1271. end
  1272. end
  1273. `
  1274. menu
  1275. {
  1276. name 'CHARACTER_SCRIPT'
  1277. align center center
  1278. ignoreesc
  1279. onOpen
  1280. "
  1281. doneEnabled = characterScreen:IsDoneButtonClickable(currentID)
  1282. currentPanelID = const.SCRIPT_ID
  1283.  
  1284. showingSmartOptions = (scriptList_idx == 2)
  1285. scriptDescription = t(scriptOptions[scriptList_idx][2])
  1286.  
  1287. for index, var in pairs(scriptOptions) do
  1288. var[5] = characterScreen:GetTempSmartScriptLocal(var[3])
  1289. if var[5] == false then
  1290. var[4] = 0
  1291. else
  1292. var[4] = 2
  1293. end
  1294. end
  1295. "
  1296. label
  1297. {
  1298. area 0 0 864 710
  1299. mosaic GUIPOP55
  1300. }
  1301. label
  1302. {
  1303. area 94 32 690 54
  1304. text "SCRIPTS_TITLE"
  1305. text style "title"
  1306. }
  1307.  
  1308. label
  1309. {
  1310. area 426 468 414 168
  1311. mosaic GUINOTE
  1312. enabled "showingSmartOptions == true"
  1313. }
  1314.  
  1315. text
  1316. {
  1317. area 444 478 376 110
  1318. text lua "scriptDescription"
  1319. scrollbar 'GUISCRC'
  1320. text style normal
  1321. enabled "showingSmartOptions == true"
  1322. }
  1323.  
  1324. text
  1325. {
  1326. area 444 102 376 486
  1327. text lua "scriptDescription"
  1328. scrollbar 'GUISCRC'
  1329. text style normal
  1330. enabled "showingSmartOptions == false"
  1331. }
  1332.  
  1333. list
  1334. {
  1335. column
  1336. {
  1337. width 100
  1338. label
  1339. {
  1340. area 0 0 -1 -1
  1341. enabled "scriptList[rowNumber] ~= ''"
  1342. text lua "formatScriptName(scriptList[rowNumber])"
  1343. text style "normal"
  1344. pad 8 0 0 0
  1345. }
  1346. label
  1347. {
  1348. area -10 -10 10000 10000
  1349. enabled "scriptList[rowNumber] == ''"
  1350. rectangle 1
  1351. }
  1352. }
  1353. area 44 102 376 492
  1354. rowheight 18
  1355. table "scriptList"
  1356. var "scriptList_idx"
  1357. scrollbar 'GUISCRC'
  1358. action
  1359. "
  1360. showingSmartOptions = (scriptList_idx == 2)
  1361. if scriptList[scriptList_idx] ~= '' then
  1362. Infinity_OnScriptItemSelect(scriptList_idx - 1)
  1363. doneEnabled = characterScreen:IsDoneButtonClickable(currentID)
  1364. else
  1365. scriptList_idx = 0
  1366. scriptDescription = ''
  1367. doneEnabled = false
  1368. end
  1369. "
  1370. }
  1371.  
  1372. list
  1373. {
  1374.  
  1375. column
  1376. {
  1377. width 80
  1378. label
  1379. {
  1380. area 10 0 -1 -1
  1381. text lua "t( scriptOptions[rowNumber][1])"
  1382. text style "normal"
  1383. text align right center
  1384. }
  1385. }
  1386. column
  1387. {
  1388. width 20
  1389. label
  1390. {
  1391. area 10 12 32 32
  1392. bam ROUNDBUT
  1393. scaleToClip
  1394. frame lua "scriptOptions[rowNumber][4]"
  1395. }
  1396. }
  1397.  
  1398. area 444 102 376 358
  1399.  
  1400. rowheight 50
  1401. table "scriptOptions"
  1402. var selScriptOpt
  1403. scrollbar 'GUISCRC'
  1404. enabled "showingSmartOptions == true"
  1405.  
  1406. action
  1407. "
  1408. scriptDescription = t(scriptOptions[selScriptOpt][2])
  1409. selectedSL = 0
  1410. selFeedOpt = 0
  1411.  
  1412. if(cellNumber == 2) then
  1413. Infinity_PlaySound('GAM_09')
  1414. handleScriptOptionChange(selScriptOpt)
  1415. end
  1416. "
  1417. }
  1418.  
  1419. button
  1420. {
  1421. on escape
  1422. bam 'GUIBUTMT'
  1423. sequence 0
  1424. area 196 653 230 40
  1425. text style "button"
  1426. text "CANCEL_BUTTON"
  1427. action
  1428. "
  1429. characterScreen:OnCancelButtonClick()
  1430. Infinity_PopMenu()
  1431. currentPanelID = 17
  1432. "
  1433. }
  1434. button
  1435. {
  1436. clickable lua "doneEnabled"
  1437. bam 'GUIBUTMT'
  1438. sequence 0
  1439. area 438 653 230 40
  1440. text style "button"
  1441. text "DONE_BUTTON"
  1442. action
  1443. "
  1444. if showingSmartOptions == true then
  1445. for index, var in pairs(scriptOptions) do
  1446. characterScreen:SetTempSmartScriptLocal(var[3], var[5])
  1447. end
  1448. end
  1449.  
  1450. characterScreen:OnDoneButtonClick()
  1451. Infinity_PopMenu()
  1452. currentPanelID = 17
  1453.  
  1454. "
  1455. }
  1456. }
  1457. `
  1458. list_GUIREC_13_0_idx = 0
  1459. characterExportCharacterEdit = ""
  1460. `
  1461. menu
  1462. {
  1463. name 'CHARACTER_EXPORT'
  1464. align center center
  1465. modal
  1466. ignoreEsc
  1467. onOpen
  1468. "
  1469. currentPanelID = const.EXPORT_ID;
  1470. Infinity_FocusTextEdit('characterExportCharacterEditArea');
  1471. "
  1472. label
  1473. {
  1474. area 0 0 864 710
  1475. mosaic GUICGSND
  1476. }
  1477. label
  1478. {
  1479. area 220 34 426 44
  1480. text "EXPORT_TITLE"
  1481. text style title
  1482. }
  1483.  
  1484. list
  1485. {
  1486. column
  1487. {
  1488. width 100
  1489. label
  1490. {
  1491. area 0 0 -1 -1
  1492. text lua "list_GUIREC_13_0[rowNumber]"
  1493. text style "list"
  1494. pad 8 0 0 0
  1495. }
  1496. }
  1497. area 28 88 340 290
  1498. rowheight 18
  1499. table "list_GUIREC_13_0"
  1500. var "list_GUIREC_13_0_idx"
  1501. scrollbar 'GUISCRC'
  1502. action
  1503. "
  1504. Infinity_OnCharacterItemSelect(list_GUIREC_13_0_idx - 1)
  1505. "
  1506. }
  1507. label
  1508. {
  1509. area 35 382 332 23
  1510. text "EXPORT_FILENAME_LABEL"
  1511. text style "label"
  1512. text color 3
  1513. }
  1514. edit
  1515. {
  1516. name "characterExportCharacterEditArea"
  1517. area 35 405 332 31
  1518. var characterExportCharacterEdit
  1519. text style "edit"
  1520. maxlines 1
  1521. fill 112 111 111 64
  1522. action
  1523. "
  1524. if(characterExportCharacterEdit:len() > 7 and key_pressed ~= 8) then
  1525. return 0
  1526. else
  1527. Infinity_UpdateCharacterRecordExportPanel()
  1528. return 1
  1529. end
  1530. "
  1531.  
  1532. }
  1533. text
  1534. {
  1535. area 404 88 420 500
  1536. text 10962
  1537. text style normal
  1538. scrollbar 'GUISCRC'
  1539. }
  1540. button
  1541. {
  1542. bam 'GUIBUTMT'
  1543. on escape
  1544. sequence 0
  1545. area 196 653 230 40
  1546. text style "button"
  1547. text "CANCEL_BUTTON"
  1548. action
  1549. "
  1550. characterScreen:OnCancelButtonClick()
  1551. Infinity_PopMenu('CHARACTER_EXPORT')
  1552. currentPanelID = 0
  1553. "
  1554. }
  1555. button
  1556. {
  1557. clickable lua "characterScreen:IsDoneButtonClickable(currentID)"
  1558. bam 'GUIBUTMT'
  1559. sequence 0
  1560. area 438 653 230 40
  1561. text style "button"
  1562. text "DONE_BUTTON"
  1563. action
  1564. "
  1565. characterScreen:OnDoneButtonClick()
  1566. "
  1567. }
  1568. }
  1569. `
  1570. list_GUIREC_20_5_idx = 0
  1571. doneEnabled = 0
  1572. `
  1573. menu
  1574. {
  1575. name 'CHARACTER_SOUND'
  1576. align center center
  1577. ignoreesc
  1578. onOpen
  1579. "
  1580. currentPanelID = const.SOUND_ID
  1581. Infinity_OnSoundItemSelect(0)
  1582. doneEnabled = characterScreen:IsDoneButtonClickable(currentID)
  1583. "
  1584. label
  1585. {
  1586. area 0 0 864 710
  1587. mosaic GUICGSND
  1588. }
  1589. list
  1590. {
  1591. column
  1592. {
  1593. width 100
  1594. label
  1595. {
  1596. area 0 0 -1 -1
  1597. text lua "getFileNameStringRef(rowNumber, list_GUIREC_20_5)"
  1598. text style "list"
  1599. pad 8 0 0 0
  1600. }
  1601. }
  1602. area 46 86 312 346
  1603. rowheight 18
  1604. table "list_GUIREC_20_5"
  1605. var "list_GUIREC_20_5_idx"
  1606. scrollbar 'GUISCRC'
  1607. action
  1608. "
  1609. Infinity_OnSoundItemSelect(list_GUIREC_20_5_idx - 1)
  1610. doneEnabled = characterScreen:IsDoneButtonClickable(currentID)
  1611. "
  1612. }
  1613. text
  1614. {
  1615. area 398 90 420 505
  1616. text 11315
  1617. scrollbar 'GUISCRC'
  1618. text style normal
  1619. }
  1620. button
  1621. {
  1622. clickable lua "list_GUIREC_20_5_idx"
  1623. bam 'GUIBUTWT'
  1624. sequence 0
  1625. area 45 462 300 40
  1626. text style "button"
  1627. text "PLAY_SOUND_BUTTON"
  1628. action
  1629. "
  1630. characterScreen:OnPlayButtonClick();
  1631. "
  1632. }
  1633. button
  1634. {
  1635. on escape
  1636. bam 'GUIBUTMT'
  1637. sequence 0
  1638. area 196 653 230 40
  1639. text style "button"
  1640. text "CANCEL_BUTTON"
  1641. action
  1642. "
  1643. characterScreen:OnCancelButtonClick()
  1644. Infinity_PopMenu()
  1645. currentPanelID = 17
  1646. "
  1647. }
  1648. button
  1649. {
  1650. clickable lua "doneEnabled"
  1651. bam 'GUIBUTMT'
  1652. sequence 0
  1653. area 438 653 230 40
  1654. text style "button"
  1655. text "DONE_BUTTON"
  1656. action
  1657. "
  1658. characterScreen:OnDoneButtonClick()
  1659. Infinity_PopMenu()
  1660. currentPanelID = 17
  1661. "
  1662. }
  1663. }
  1664. `
  1665. function toggleFrame(curFrame)
  1666. if curFrame == 0 then
  1667. return 2
  1668. else
  1669. return 0
  1670. end
  1671. end
  1672. function getSelected(cur, my)
  1673. if cur == my then
  1674. return 1
  1675. else
  1676. return 0
  1677. end
  1678. end
  1679. function removeStoryModeOption()
  1680. for index = 1, #toggleTitles-1, 1 do
  1681. toggleTitles[index] = toggleTitles[index+1]
  1682. end
  1683. toggleTitles[#toggleTitles] = nil
  1684. end
  1685. function addStoryModeOption()
  1686. for index = #toggleTitles, 1, -1 do
  1687. toggleTitles[index+1] = toggleTitles[index]
  1688. end
  1689. toggleTitles[1] = {'DIFFICULTY_LABEL_STORYMODE', 'DIFFICULTY_DESCRIPTION_STORYMODE', 65, 0, 0}
  1690. end
  1691.  
  1692. function removeOptionFromList(list, option)
  1693. local startingPoint = 1
  1694. local found = false
  1695. for index = 1, #list-1, 1 do
  1696. if list[index][3] == option then
  1697. startingPoint = index
  1698. found = true
  1699. break
  1700. end
  1701. end
  1702. if found == true then
  1703. for index = startingPoint, #list-1, 1 do
  1704. list[index] = list[index+1]
  1705. end
  1706. list[#list] = nil
  1707. end
  1708. end
  1709.  
  1710. toggleTitles = {
  1711. {"DIFFICULTY_LABEL_STORYMODE_MIXED", "DIFFICULTY_DESCRIPTION_STORYMODE", 65, 0, 0},
  1712. {"ENABLE_CLOUD_LABEL", "ENABLE_CLOUD_DESCRIPTION", 60, 0, 0},
  1713. {"WORLDMAP_HIGHLIGHT_LABEL", "WORLDMAP_HIGHLIGHT_DESCRIPTION", 66, 0, 0},
  1714. {"MP_CHAT_LABEL", "MP_CHAT_DESCRIPTION", 67, 0, 0},
  1715. {"GORE_LABEL", "GORE_DESCRIPTION", 19, 0, 0},
  1716. {"WEATHER_LABEL", "WEATHER_DESCRIPTION", 47, 0, 0},
  1717. {"GROUP_INFRA_LABEL", "GROUP_INFRA_DESCRIPTION", 42, 0, 0},
  1718. {"HEAL_ON_REST_LABEL", "HEAL_ON_REST_DESCRIPTION", 50, 0, 0},
  1719. {"MAX_HP_ON_LEVEL_LABEL", "MAX_HP_ON_LEVEL_DESCRIPTION", 55, 0, 0},
  1720. {"NO_DAMAGE_INCREASE_LABEL", "NO_DAMAGE_INCREASE_DESCRIPTION", 64, 0, 0},
  1721. {"AUTO_USE_MAGIC_AMMO_LABEL", "AUTO_USE_MAGIC_AMMO_DESCRIPTION", 68, 0, 0},
  1722. }
  1723.  
  1724. selectedOpt = 0
  1725. helpString = 0
  1726.  
  1727. ttDelaySLDR = 0
  1728. keyboardSLDR = 0
  1729. mouseSLDR = 0
  1730. difficultySLDR = 0
  1731.  
  1732. panelID = 8
  1733.  
  1734. function getDifficulty(d)
  1735. local text = ""
  1736. if ( d ==0 ) then
  1737. text = t("DIFFICULTY_LABEL_EASY")
  1738. elseif (d == 1) then
  1739. text = t("DIFFICULTY_LABEL_NORMAL")
  1740. elseif (d == 2) then
  1741. text = t("DIFFICULTY_LABEL_CORERULES")
  1742. elseif (d == 3) then
  1743. text = t("DIFFICULTY_LABEL_HARD")
  1744. elseif (d == 4) then
  1745. text = t("DIFFICULTY_LABEL_INSANE")
  1746. elseif (d == 5) then
  1747. text = string.upper(t("MULTIPLAYER_DIFFICULTY_LABEL")).." "..t("DIFFICULTY_LABEL_LEGACYOFBHAAL")
  1748. end
  1749. return text
  1750. end
  1751. `
  1752.  
  1753. menu
  1754. {
  1755. name 'OPTIONS_GAMEPLAY'
  1756. align center center
  1757. modal
  1758. onOpen
  1759. "
  1760. panelID = 8
  1761. helpString = 'GAMEPLAY_DESCRIPTION'
  1762. selectedOpt = 0
  1763. selectedSL = 0
  1764.  
  1765. if Infinity_GetOption(59, 8) ~= 0 and toggleTitles[1][3] == 65 then
  1766. removeStoryModeOption()
  1767. elseif Infinity_GetOption(59, 8) == 0 and toggleTitles[1][3] ~= 65 then
  1768. addStoryModeOption()
  1769. end
  1770.  
  1771. ttDelaySLDR = Infinity_GetOption(1, panelID)
  1772. keyboardSLDR = Infinity_GetOption(3, panelID)
  1773. mouseSLDR = Infinity_GetOption(2, panelID)
  1774. difficultySLDR = Infinity_GetOption(12, panelID)
  1775.  
  1776. for index, var in pairs(toggleTitles) do
  1777. var[5] = Infinity_GetOption(var[3], panelID)
  1778. if var[5] == 0 then
  1779. var[4] = 0
  1780. else
  1781. var[4] = 2
  1782. end
  1783. end
  1784.  
  1785. if Infinity_CanCloudSave() == false and (toggleTitles[1][3] == 60 or toggleTitles[2][3] == 60) then
  1786. removeOptionFromList(toggleTitles,60)
  1787. end
  1788. "
  1789.  
  1790. button
  1791. {
  1792. area 0 0 1024 768
  1793. mosaic GUITUTB
  1794. action
  1795. "
  1796. helpString = 'GAMEPLAY_DESCRIPTION'
  1797. selectedOpt = 0
  1798. selectedSL = 0
  1799. "
  1800. }
  1801. label
  1802. {
  1803. area 450 40 150 44
  1804. text "GAMEPLAY_TITLE"
  1805. text style title
  1806. }
  1807.  
  1808. list
  1809. {
  1810.  
  1811. column
  1812. {
  1813. width 85
  1814. label
  1815. {
  1816. area 10 0 -1 -1
  1817. text lua "t( toggleTitles[rowNumber][1])"
  1818. text style "normal"
  1819. text align left center
  1820. }
  1821. }
  1822. column
  1823. {
  1824. width 15
  1825. label
  1826. {
  1827. area 20 12 32 32
  1828. bam ROUNDBUT
  1829. scaleToClip
  1830. frame lua "toggleTitles[rowNumber][4]"
  1831. }
  1832. }
  1833.  
  1834. area 570 132 400 362
  1835.  
  1836. rowheight 46
  1837. table "toggleTitles"
  1838. var selectedOpt
  1839. scrollbar 'GUISCRC'
  1840.  
  1841. action
  1842. "
  1843. panelID = 8
  1844. selectedSL = 0
  1845. helpString = toggleTitles[selectedOpt][2]
  1846.  
  1847. if(cellNumber == 2) then
  1848. Infinity_PlaySound('GAM_09')
  1849.  
  1850. toggleTitles[selectedOpt][4] = toggleFrame(toggleTitles[selectedOpt][4])
  1851.  
  1852. if toggleTitles[selectedOpt][4] == 0 then
  1853. toggleTitles[selectedOpt][5] = 0
  1854. else
  1855. toggleTitles[selectedOpt][5] = 1
  1856. end
  1857. end
  1858. if selectedOpt == 1 and toggleTitles[1][5] == 1 then
  1859. groundItemsButtonToggle = 1
  1860. highlightButtonToggle = 1
  1861. end
  1862. "
  1863. }
  1864.  
  1865. label
  1866. {
  1867. area 560 508 425 144
  1868. mosaic GUINOTE
  1869. }
  1870.  
  1871. text
  1872. {
  1873. area 574 516 402 110
  1874. text lua "t(helpString)"
  1875. text style normal
  1876. text align left top
  1877. text point 12
  1878. scrollbar 'GUISCRC'
  1879. }
  1880.  
  1881. text
  1882. {
  1883. area 112 150 188 34
  1884. text "TOOLTIP_DELAY_LABEL"
  1885. text style "label"
  1886. text align right center
  1887. text upper
  1888. text highlight lua "getSelected(selectedSL, 1)"
  1889. action
  1890. "
  1891. helpString = 'TOOLTIP_DELAY_DESCRIPTION'
  1892. selectedOpt = 0
  1893. selectedSL = 1
  1894. "
  1895. }
  1896. slider
  1897. {
  1898. area 304 150 200 39
  1899. position "ttDelaySLDR"
  1900. bam 'SLDRSTAR'
  1901. sliderBackground 'SLDRBACK'
  1902. scaleToClip
  1903. sequence 0
  1904. frame 1
  1905. settings 40
  1906. pad 5 0 4 0
  1907. action
  1908. "
  1909. helpString = 'TOOLTIP_DELAY_DESCRIPTION'
  1910. selectedOpt = 0
  1911. selectedSL = 1
  1912. "
  1913. }
  1914.  
  1915. text
  1916. {
  1917. area 112 216 188 35
  1918. text "KEYBOARD_SCRLSPEED_LABEL"
  1919. text style "label"
  1920. text align right center
  1921. text upper
  1922. text highlight lua "getSelected(selectedSL, 2)"
  1923. enabled "not e:IsTouchUI()"
  1924. action
  1925. "
  1926. helpString = 'KEYBOARD_SCRLSPEED_DESCRIPTION'
  1927. selectedOpt = 0
  1928. selectedSL = 2
  1929. "
  1930. }
  1931. slider
  1932. {
  1933. area 304 216 200 40
  1934. position "keyboardSLDR"
  1935. bam 'SLDRSTAR'
  1936. sliderBackground 'SLDRBACK'
  1937. scaleToClip
  1938. sequence 0
  1939. frame 1
  1940. settings 40
  1941. pad 5 0 4 0
  1942. enabled "not e:IsTouchUI()"
  1943. action
  1944. "
  1945. helpString = 'KEYBOARD_SCRLSPEED_DESCRIPTION'
  1946. selectedOpt = 0
  1947. selectedSL = 2
  1948. "
  1949. }
  1950.  
  1951. text
  1952. {
  1953. area 112 284 188 36
  1954. text "MOUSE_SCRLSPEED_LABEL"
  1955. text style "label"
  1956. text align right center
  1957. text upper
  1958. text highlight lua "getSelected(selectedSL, 3)"
  1959. enabled "not e:IsTouchUI()"
  1960. action
  1961. "
  1962. helpString = 'MOUSE_SCRLSPEED_DESCRIPTION'
  1963. selectedOpt = 0
  1964. selectedSL = 3
  1965. "
  1966. }
  1967. slider
  1968. {
  1969. area 304 284 200 40
  1970. position "mouseSLDR"
  1971. bam 'SLDRSTAR'
  1972. sliderBackground 'SLDRBACK'
  1973. scaleToClip
  1974. sequence 0
  1975. frame 1
  1976. settings 40
  1977. pad 5 0 4 0
  1978. enabled "not e:IsTouchUI()"
  1979. action
  1980. "
  1981. helpString = 'MOUSE_SCRLSPEED_DESCRIPTION'
  1982. selectedOpt = 0
  1983. selectedSL = 3
  1984. "
  1985. }
  1986.  
  1987. text
  1988. {
  1989. area 112 384 188 35
  1990. text "DIFFICULTY_LABEL"
  1991. text style "label"
  1992. text align right center
  1993. text upper
  1994. text highlight lua "getSelected(selectedSL, 4)"
  1995. enabled "Infinity_GetOption(59, 8) == 0"
  1996. action
  1997. "
  1998. helpString = 'DIFFICULTY_DESCRIPTION'
  1999. selectedOpt = 0
  2000. selectedSL = 4
  2001. "
  2002. }
  2003. slider
  2004. {
  2005. area 304 384 200 39
  2006. position "difficultySLDR"
  2007. bam 'SLDRSTAR'
  2008. sliderBackground 'SLDRBACK'
  2009. scaleToClip
  2010. sequence 0
  2011. frame 1
  2012. settings 5
  2013. pad 5 0 4 0
  2014. enabled "Infinity_GetOption(59, 8) == 0 and toggleTitles[1][4] == 0"
  2015. action
  2016. "
  2017. helpString = 'DIFFICULTY_DESCRIPTION'
  2018. selectedOpt = 0
  2019. selectedSL = 4
  2020. "
  2021. }
  2022. label
  2023. {
  2024. area 304 423 200 35
  2025. text lua "getDifficulty(difficultySLDR)"
  2026. text style "label"
  2027. text align center center
  2028. enabled "Infinity_GetOption(59, 8) == 0 and toggleTitles[1][4] == 0"
  2029. }
  2030. label
  2031. {
  2032. area 112 384 392 39
  2033. text lua "getDifficulty(5)"
  2034. text style "label"
  2035. text align center center
  2036. enabled "Infinity_GetOption(59, 8) ~= 0"
  2037. }
  2038. --fakes for story mode
  2039. slider
  2040. {
  2041. area 304 384 200 39
  2042. position "0"
  2043. bam 'SLDRSTAR'
  2044. sliderBackground 'SLDRBACK'
  2045. scaleToClip
  2046. sequence 0
  2047. frame 1
  2048. settings 5
  2049. pad 5 0 4 0
  2050. enabled "Infinity_GetOption(59, 8) == 0 and toggleTitles[1][4] ~= 0"
  2051. action
  2052. "
  2053. helpString = 'DIFFICULTY_DESCRIPTION'
  2054. selectedOpt = 0
  2055. selectedSL = 4
  2056. "
  2057. }
  2058. label
  2059. {
  2060. area 304 423 200 35
  2061. text lua "getDifficulty(0)"
  2062. text style "label"
  2063. text align center center
  2064. enabled "Infinity_GetOption(59, 8) == 0 and toggleTitles[1][4] ~= 0"
  2065. }
  2066. label
  2067. {
  2068. area 304 384 200 35
  2069. enabled "Infinity_GetOption(59, 8) == 0 and toggleTitles[1][4] ~= 0"
  2070. rectangle 0
  2071. rectangle opacity 150
  2072. }
  2073.  
  2074. button
  2075. {
  2076. bam GUIBUTNT
  2077. sequence 0
  2078. area 202 500 200 40
  2079. text "ASSIGN_KEYS_BUTTON"
  2080. text style "button"
  2081. enabled "not e:IsTouchUI()"
  2082. action
  2083. "
  2084. Infinity_PushMenu( 'OPTIONS_KEYBINDINGS' );
  2085. selectedOpt = 0
  2086. "
  2087. }
  2088. button
  2089. {
  2090. area 202 550 200 40
  2091. bam GUIBUTNT
  2092. sequence 2
  2093. text "FEEDBACK_BUTTON"
  2094. text style "button"
  2095. action
  2096. "
  2097.  
  2098. Infinity_PushMenu( 'OPTIONS_FEEDBACK' );
  2099. selectedOpt = 0
  2100. "
  2101. }
  2102. button
  2103. {
  2104. area 202 600 200 40
  2105. bam GUIBUTNT
  2106. sequence 2
  2107. text "AUTO_PAUSE_BUTTON"
  2108. text style "button"
  2109. action
  2110. "
  2111. selectedOpt = 0
  2112. Infinity_PushMenu( 'OPTIONS_AUTOPAUSE' );
  2113. "
  2114. }
  2115. button
  2116. {
  2117. on escape
  2118. area 188 700 200 40
  2119. bam GUIBUTNT
  2120. sequence 2
  2121. text "CANCEL_BUTTON"
  2122. text style "button"
  2123. action
  2124. "
  2125. Infinity_PopMenu()
  2126. "
  2127. }
  2128. button
  2129. {
  2130. area 638 700 200 40
  2131. bam GUIBUTNT
  2132. sequence 2
  2133. text "DONE_BUTTON" -- Done
  2134. text style "button"
  2135. action
  2136. "
  2137. panelID = 8
  2138. Infinity_ChangeOption( 1, ttDelaySLDR, panelID)
  2139. Infinity_ChangeOption( 3, keyboardSLDR, panelID )
  2140. Infinity_ChangeOption( 2, mouseSLDR, panelID )
  2141. Infinity_ChangeOption( 12, difficultySLDR + 1, panelID) -- cannot set story mode through slider
  2142.  
  2143. selectedOpt = 0
  2144. selectedSL = 0
  2145.  
  2146. for index, var in pairs(toggleTitles) do
  2147.  
  2148. Infinity_ChangeOption( var[3], var[5], panelID)
  2149.  
  2150. end
  2151.  
  2152. panelID = 8
  2153. Infinity_PopMenu()
  2154. "
  2155. }
  2156.  
  2157. }
  2158.  
  2159. `
  2160. autoPauseToggles = {
  2161. {'WEAPON_UNUSABLE_LABEL',18036, 5 , 0, 0},
  2162. {'END_OF_ROUND_LABEL',10640, 25, 0, 0},
  2163. {'ENEMY_SIGHTED_LABEL',23514, 26, 0, 0},
  2164. {'SPELL_CAST_LABEL',24432, 31, 0, 0},
  2165. {'TRAP_FOUND_LABEL',24433, 34, 0, 0}
  2166. }
  2167.  
  2168. characterPauseToggles = {
  2169. {'CENTER_MEMBER_LABEL',24434, 37, 0, 0},
  2170. {'CHARACTER_HIT_LABEL',18032, 1 , 0, 0},
  2171. {'CHARACTER_INJURED_LABEL',18033, 2 , 0, 0},
  2172. {'CHARACTER_DEATH_LABEL',18034, 3 , 0, 0},
  2173. {'CHARACTER_ATTACKED_LABEL',18035, 4 , 0, 0},
  2174. {'CHARACTER_TARGET_DESTROYED',18037, 13, 0, 0},
  2175. }
  2176.  
  2177. selOptAP = 0
  2178.  
  2179. `
  2180.  
  2181. menu
  2182. {
  2183. name 'OPTIONS_AUTOPAUSE'
  2184. modal
  2185. align center center
  2186. onOpen
  2187. "
  2188. panelID = 10
  2189. selOptAP = 0
  2190. autopauseString = 18044
  2191.  
  2192. for index, var in pairs(autoPauseToggles) do
  2193. var[5] = Infinity_GetOption(var[3], panelID)
  2194. if var[5] == 0 then
  2195. var[4] = 0
  2196. else
  2197. var[4] = 2
  2198. end
  2199. end
  2200.  
  2201. for index, var in pairs(characterPauseToggles) do
  2202. var[5] = Infinity_GetOption(var[3], panelID)
  2203. if var[5] == 0 then
  2204. var[4] = 0
  2205. else
  2206. var[4] = 2
  2207. end
  2208. end
  2209. "
  2210.  
  2211. button
  2212. {
  2213. area 0 0 864 710
  2214. mosaic GUICHISD
  2215. action
  2216. "
  2217. autopauseString = 18044
  2218. selOptAP = 0
  2219. "
  2220. }
  2221. label
  2222. {
  2223. area 94 8 674 44
  2224. text "AUTO_PAUSE_TITLE"
  2225. text style title
  2226. }
  2227. list
  2228. {
  2229.  
  2230. column
  2231. {
  2232. width 85
  2233. label
  2234. {
  2235. area 10 0 -1 -1
  2236. text lua "t( autoPauseToggles[rowNumber][1])"
  2237. text style "normal"
  2238. text align left center
  2239. }
  2240. }
  2241. column
  2242. {
  2243. width 15
  2244. label
  2245. {
  2246. area 20 12 32 32
  2247. bam ROUNDBUT
  2248. scaleToClip
  2249. frame lua "autoPauseToggles[rowNumber][4]"
  2250. }
  2251. }
  2252.  
  2253. area 448 186 372 428
  2254.  
  2255. rowheight 50
  2256. table "autoPauseToggles"
  2257. var selOptAP
  2258. scrollbar 'GUISCRC'
  2259.  
  2260. action
  2261. "
  2262. selOptAPC = 0
  2263. autopauseString = autoPauseToggles[selOptAP][2]
  2264.  
  2265. if(cellNumber == 2) then
  2266. Infinity_PlaySound('GAM_09')
  2267.  
  2268. autoPauseToggles[selOptAP][4] = toggleFrame(autoPauseToggles[selOptAP][4])
  2269.  
  2270. if autoPauseToggles[selOptAP][4] == 0 then
  2271. autoPauseToggles[selOptAP][5] = 0
  2272. else
  2273. autoPauseToggles[selOptAP][5] = 1
  2274. end
  2275. end
  2276. "
  2277. }
  2278. list
  2279. {
  2280.  
  2281. column
  2282. {
  2283. width 85
  2284. label
  2285. {
  2286. area 10 0 -1 -1
  2287. text lua "t( characterPauseToggles[rowNumber][1])"
  2288. text style "normal"
  2289. text align left center
  2290. }
  2291. }
  2292. column
  2293. {
  2294. width 15
  2295. label
  2296. {
  2297. area 20 12 32 32
  2298. bam ROUNDBUT
  2299. scaleToClip
  2300. frame lua "characterPauseToggles[rowNumber][4]"
  2301. }
  2302. }
  2303.  
  2304. area 34 186 372 428
  2305.  
  2306. rowheight 50
  2307. table "characterPauseToggles"
  2308. var selOptAPC
  2309. scrollbar 'GUISCRC'
  2310.  
  2311. action
  2312. "
  2313. selOptAP = 0
  2314. autopauseString = characterPauseToggles[selOptAPC][2]
  2315.  
  2316. if(cellNumber == 2) then
  2317. Infinity_PlaySound('GAM_09')
  2318.  
  2319. characterPauseToggles[selOptAPC][4] = toggleFrame(characterPauseToggles[selOptAPC][4])
  2320.  
  2321. if characterPauseToggles[selOptAPC][4] == 0 then
  2322. characterPauseToggles[selOptAPC][5] = 0
  2323. else
  2324. characterPauseToggles[selOptAPC][5] = 1
  2325. end
  2326.  
  2327. --Infinity_ChangeOption(characterPauseToggles[selOptAPC][3], characterPauseToggles[selOptAPC][5], panelID )
  2328. end
  2329. "
  2330. }
  2331.  
  2332. text
  2333. {
  2334. area 54 118 758 44
  2335. text lua "Infinity_FetchString(autopauseString)"
  2336. text style normal
  2337. scrollbar 'GUISCRC'
  2338. }
  2339.  
  2340.  
  2341. button
  2342. {
  2343. on escape
  2344. area 102 634 230 40
  2345. bam GUIBUTMT
  2346. sequence 2
  2347. text "CANCEL_BUTTON"
  2348. text style "button"
  2349. action
  2350. "
  2351. panelID = 8
  2352. helpString = 'GAMEPLAY_DESCRIPTION'
  2353. Infinity_PopMenu()
  2354. "
  2355. }
  2356. button
  2357. {
  2358. area 514 634 230 40
  2359. bam GUIBUTMT
  2360. sequence 2
  2361. text "DONE_BUTTON" --Done
  2362. text style "button"
  2363. action
  2364. "
  2365. panelID = 10
  2366.  
  2367. for index, var in pairs(autoPauseToggles) do
  2368. Infinity_ChangeOption( var[3], var[5], panelID)
  2369. end
  2370. for index, var in pairs(characterPauseToggles) do
  2371. Infinity_ChangeOption( var[3], var[5], panelID)
  2372. end
  2373.  
  2374. panelID = 8
  2375. Infinity_PopMenu()
  2376. "
  2377. }
  2378. }
  2379.  
  2380. `
  2381. graphicsToggles = {
  2382. {'FULL_SCREEN_LABEL',18000, 9 , 0, 0, 0},
  2383. {'HARDWARE_CURSOR_LABEL',32205, 13, 0, 0, 0},
  2384. {'SCALE_UI_LABEL',32206, 14, 0, 0, 0},
  2385. {'ZOOM_LOCK_LABEL',66654, 36, 0, 0, 0},
  2386. {'SPRITE_OUTLINE_LABEL',65909, 15, 0, 0, 0},
  2387. {'GREYSCALE_ON_PAUSE_LABEL',32709, 66, 0, 0, 0},
  2388. {'HIGHLIGHT_SPRITE_LABEL',32710, 67, 0, 0, 0},
  2389. {'DITHER_ALWAYS_LABEL',18021, 52, 0, 0, 0},
  2390. {'SHOW_HP_LABEL',66657, 53, 0, 0, 0},
  2391. {'SHOW_HEALTHBAR_LABEL',69567, 65, 0, 0, 0},
  2392. {'SHOW_BLACK_SPACE_LABEL','SHOW_BLACK_SPACE_DESCRIPTION', 69, 0, 0, 0},
  2393. {'NEAREST_NEIGHBOUR_LABEL','NEAREST_NEIGHBOUR_DESCRIPTION', 70, 0, 0, 0},
  2394. }
  2395.  
  2396. addedDirectx = false
  2397. function appendDirectXOption()
  2398. if addedDirectx == false then
  2399. dxOption = {'DIRECTX_LABEL', 32725, 68, 0, 0, 0}
  2400. table.insert(graphicsToggles, dxOption)
  2401. addedDirectx = true
  2402. end
  2403. end
  2404.  
  2405. selectedGraphicOpt = 0
  2406.  
  2407. fontSizeSLDR = 0
  2408. fontSizeCancel = 0
  2409. function formatGraphicsInfoString()
  2410. return options['Graphics']['version'] .. "\nrunning on " .. options['Graphics']['renderer'] .. "\ndriver provided by " .. options['Graphics']['vendor']
  2411. end
  2412. `
  2413.  
  2414. menu
  2415. {
  2416. name 'OPTIONS_GRAPHICS'
  2417. modal
  2418. align center center
  2419. onOpen
  2420. "
  2421. if e:HasDirectX() then
  2422. appendDirectXOption()
  2423. end
  2424. panelID = 6
  2425. helpString = 18042
  2426. selectedGraphicOpt = 0
  2427. selectedSL = 0
  2428. fontSizeSLDR = Infinity_GetOption(22, panelID)
  2429. fontSizeCancel = Infinity_GetOption(22, panelID)
  2430.  
  2431. for index, var in pairs(graphicsToggles) do
  2432. var[5] = Infinity_GetOption(var[3], panelID)
  2433. var[6] = 0
  2434. if var[5] == 0 then
  2435. var[4] = 0
  2436. else
  2437. var[4] = 2
  2438. end
  2439. end
  2440.  
  2441. if e:IsTouchUI() then
  2442. removeOptionFromList(graphicsToggles, 9)
  2443. removeOptionFromList(graphicsToggles, 13)
  2444. end
  2445. "
  2446.  
  2447.  
  2448. button
  2449. {
  2450. area 0 0 864 710
  2451. mosaic GUICHISD
  2452. action
  2453. "
  2454. helpString = 18042
  2455. selectedSL = 0
  2456. "
  2457. }
  2458.  
  2459. label
  2460. {
  2461. area 92 10 680 44
  2462. text "GRAPHICS_TITLE"
  2463. text style title
  2464. }
  2465.  
  2466. label
  2467. {
  2468. area 446 186 376 264
  2469. text lua "formatGraphicsInfoString()"
  2470. text style normal
  2471. text align center center
  2472. }
  2473.  
  2474. text
  2475. {
  2476. area 32 272 366 44
  2477. text "DISPLAY_OPTIONS_LABEL"
  2478. text style "button"
  2479. text align right center
  2480. text highlight lua "getSelected(selectedSL, 1)"
  2481. action
  2482. "
  2483. selectedGraphicOpt = 0
  2484. selectedSL = 1
  2485. "
  2486. }
  2487.  
  2488. list
  2489. {
  2490.  
  2491. column
  2492. {
  2493. width 90
  2494. label
  2495. {
  2496. area 0 0 -1 -1
  2497. text lua "t( graphicsToggles[rowNumber][1])"
  2498. text style "normal"
  2499. text align right center
  2500. }
  2501. }
  2502. column
  2503. {
  2504. width 10
  2505. label
  2506. {
  2507. area 2 2 32 32
  2508. bam ROUNDBUT
  2509. scaleToClip
  2510. frame lua "graphicsToggles[rowNumber][4]"
  2511. }
  2512. }
  2513.  
  2514. area 32 316 366 300
  2515.  
  2516. rowheight 36
  2517. table "graphicsToggles"
  2518. var selectedGraphicOpt
  2519. scrollbar 'GUISCRC'
  2520.  
  2521. action
  2522. "
  2523. panelID = 6
  2524. helpString = graphicsToggles[selectedGraphicOpt][2]
  2525. selectedSL = 0
  2526. if(cellNumber == 2) then
  2527. Infinity_PlaySound('GAM_09')
  2528. graphicsToggles[selectedGraphicOpt][4] = toggleFrame(graphicsToggles[selectedGraphicOpt][4])
  2529.  
  2530. if graphicsToggles[selectedGraphicOpt][4] == 0 then
  2531. graphicsToggles[selectedGraphicOpt][5] = 0
  2532. else
  2533. graphicsToggles[selectedGraphicOpt][5] = 1
  2534. end
  2535. graphicsToggles[selectedGraphicOpt][6] = 1
  2536. --Infinity_ChangeOption(graphicsToggles[selectedGraphicOpt][3], graphicsToggles[selectedGraphicOpt][5], panelID )
  2537. end
  2538. "
  2539. }
  2540.  
  2541. label
  2542. {
  2543. area 446 468 380 144
  2544. mosaic GUINOTE
  2545. }
  2546.  
  2547. text
  2548. {
  2549. area 458 476 364 120
  2550. text lua "getStringFromAmbiguousSource(helpString)"
  2551. text style normal
  2552. scrollbar 'GUISCRC'
  2553. }
  2554.  
  2555. text
  2556. {
  2557. area 28 212 155 36
  2558. text "FONT_SIZE_LABEL"
  2559. text style "label"
  2560. text align right center
  2561. text upper
  2562. text useFontZoom 1
  2563. text highlight lua "getSelected(selectedSL, 2)"
  2564. action
  2565. "
  2566. helpString = 17204
  2567. selectedGraphicOpt = 0
  2568. selectedSL = 2
  2569. "
  2570. }
  2571.  
  2572. slider
  2573. {
  2574. area 194 212 200 36
  2575. position "fontSizeSLDR"
  2576. bam 'SLDRSTAR'
  2577. sliderBackground 'SLDRBACK'
  2578. scaleToClip
  2579. sequence 0
  2580. frame 1
  2581. settings 7
  2582. pad 5 0 4 0
  2583. action
  2584. "
  2585. Infinity_ChangeOption( 22, fontSizeSLDR, 6)
  2586. helpString = 17204
  2587. selectedGraphicOpt = 0
  2588. selectedSL = 1
  2589. "
  2590. }
  2591.  
  2592.  
  2593. button
  2594. {
  2595. on escape
  2596. area 102 634 230 40
  2597. bam GUIBUTMT
  2598. sequence 2
  2599. text "CANCEL_BUTTON"
  2600. text style "button"
  2601. action
  2602. "
  2603. panelID = 6
  2604. Infinity_ChangeOption( 22, fontSizeCancel, panelID)
  2605.  
  2606. selectedSL = 0
  2607. Infinity_PopMenu()
  2608. "
  2609. }
  2610. button
  2611. {
  2612. area 514 634 230 40
  2613. bam GUIBUTMT
  2614. sequence 2
  2615. text "DONE_BUTTON" --Done
  2616. text style "button"
  2617. action
  2618. "
  2619. panelID = 6
  2620. Infinity_ChangeOption( 22, fontSizeSLDR, panelID)
  2621.  
  2622. for index, var in pairs(graphicsToggles) do
  2623.  
  2624. if ( var[6] == 1 ) then
  2625. Infinity_ChangeOption( var[3], var[5], panelID)
  2626. end
  2627. end
  2628.  
  2629. selectedSL = 0
  2630. Infinity_PopMenu()
  2631. "
  2632. }
  2633. }
  2634.  
  2635.  
  2636. `
  2637. soundsToggles = {
  2638. {'CHARACTER_SUBTITLES_LABEL',18015, 5, 0, 0},
  2639. {'BATTLE_CRIES_LABEL',18013, 6, 0, 0},
  2640. {'MOVEMENT_SOUNDS_LABEL',18014, 7, 0, 0}
  2641. }
  2642. selectedsoundOpt = 0
  2643. command = {
  2644. {'ALWAYS_LABEL',0, 8, 0, 0},
  2645. {'SELDOM_LABEL',0, 9, 0, 0},
  2646. {'NEVER_LABEL',0, 10, 0, 0}
  2647. }
  2648. commandSel = 0
  2649. selectOpt = {
  2650. {'ALWAYS_LABEL',0, 58, 0, 0},
  2651. {'SELDOM_LABEL',0, 59, 0, 0},
  2652. {'NEVER_LABEL',0, 60, 0, 0}
  2653. }
  2654. selectSel = 0
  2655. ambientSLDR = 0
  2656. sfxSLDR = 0
  2657. voiceSLDR = 0
  2658. musicSLDR = 0
  2659. movieSLDR = 0
  2660.  
  2661. `
  2662.  
  2663. menu
  2664. {
  2665. name 'OPTIONS_SOUND'
  2666. align center center
  2667. modal
  2668. onOpen
  2669. "
  2670. panelID = 7
  2671. helpString = 18042
  2672. selectedsoundOpt = 0
  2673. selectedSL = 0
  2674.  
  2675. ambientSLDR = Infinity_GetOption(1, panelID)
  2676. sfxSLDR = Infinity_GetOption(2, panelID)
  2677. voiceSLDR = Infinity_GetOption(3, panelID)
  2678. musicSLDR = Infinity_GetOption(4, panelID)
  2679. movieSLDR = Infinity_GetOption(22, panelID)
  2680.  
  2681. for index, var in pairs(command) do
  2682. var[5] = Infinity_GetOption(var[3], panelID)
  2683. if var[5] == 0 then
  2684. var[4] = 0
  2685. else
  2686. var[4] = 2
  2687. commandSel = index
  2688. end
  2689. end
  2690. for index, var in pairs(selectOpt) do
  2691. var[5] = Infinity_GetOption(var[3], panelID)
  2692. if var[5] == 0 then
  2693. var[4] = 0
  2694. else
  2695. var[4] = 2
  2696. selectSel = index
  2697. end
  2698. end
  2699. for index, var in pairs(soundsToggles) do
  2700. var[5] = Infinity_GetOption(var[3], panelID)
  2701. if var[5] == 0 then
  2702. var[4] = 0
  2703. else
  2704. var[4] = 2
  2705. selectSel = index
  2706. end
  2707. end
  2708. "
  2709.  
  2710. button
  2711. {
  2712. area 14 -2 1024 768
  2713. mosaic GUITUTB
  2714. action
  2715. "
  2716. helpString = 18042
  2717. "
  2718. }
  2719. label
  2720. {
  2721. area 136 40 766 44
  2722. text "SOUND_TITLE"
  2723. text style title
  2724. }
  2725.  
  2726. text
  2727. {
  2728. area 122 450 394 44
  2729. text "CHARACTER_SOUNDS_LABEL"
  2730. text style "button"
  2731. text align right center
  2732. text highlight lua "getSelected(selectedSL, 3)"
  2733. }
  2734.  
  2735. list
  2736. {
  2737.  
  2738. column
  2739. {
  2740. width 85
  2741. label
  2742. {
  2743. area 0 0 -1 -1
  2744. text lua "t( soundsToggles[rowNumber][1])"
  2745. text style "normal"
  2746. text align right center
  2747. }
  2748. }
  2749. column
  2750. {
  2751. width 15
  2752. label
  2753. {
  2754. area 20 8 32 32
  2755. bam ROUNDBUT
  2756. scaleToClip
  2757. frame lua "soundsToggles[rowNumber][4]"
  2758. }
  2759. }
  2760.  
  2761. area 122 500 395 150
  2762.  
  2763. rowheight 46
  2764. table "soundsToggles"
  2765. var selectedsoundOpt
  2766. scrollbar 'GUISCRC'
  2767.  
  2768. action
  2769. "
  2770. panelID = 7
  2771. helpString = soundsToggles[selectedsoundOpt][2]
  2772. selectedSL = 0
  2773. if(cellNumber == 2) then
  2774. Infinity_PlaySound('GAM_09')
  2775. soundsToggles[selectedsoundOpt][4] = toggleFrame(soundsToggles[selectedsoundOpt][4])
  2776.  
  2777. if soundsToggles[selectedsoundOpt][4] == 0 then
  2778. soundsToggles[selectedsoundOpt][5] = 0
  2779. else
  2780. soundsToggles[selectedsoundOpt][5] = 1
  2781. end
  2782.  
  2783. end
  2784. "
  2785. }
  2786.  
  2787. text
  2788. {
  2789. area 580 136 400 44
  2790. text "COMMAND_SOUNDS_BUTTON"
  2791. text style "button"
  2792. text align right center
  2793. text highlight lua "getSelected(selectedSL, 1)"
  2794. action
  2795. "
  2796. helpString = 18016
  2797. selectedsoundOpt = 0
  2798. selectedSL = 1
  2799. "
  2800. }
  2801.  
  2802.  
  2803. list
  2804. {
  2805.  
  2806. column
  2807. {
  2808. width 85
  2809. label
  2810. {
  2811. area 10 0 -1 -1
  2812. text lua "t( command[rowNumber][1])"
  2813. text style "normal"
  2814. text align right center
  2815. }
  2816. }
  2817. column
  2818. {
  2819. width 15
  2820. label
  2821. {
  2822. area 20 8 32 32
  2823. bam ROUNDBUT
  2824. scaleToClip
  2825. frame lua "command[rowNumber][4]"
  2826. }
  2827. }
  2828.  
  2829. area 580 180 400 145
  2830.  
  2831. rowheight 46
  2832. table "command"
  2833. var commandSel
  2834. scrollbar 'GUISCRC'
  2835. hidehighlight
  2836.  
  2837. action
  2838. "
  2839. panelID = 7
  2840. helpString = 18016
  2841. selectedSL = 1
  2842. selectedsoundOpt = 0
  2843. opt = commandSel
  2844. command[1][4] = 0
  2845. command[2][4] = 0
  2846. command[3][4] = 0
  2847.  
  2848. Infinity_PlaySound('GAM_09')
  2849. command[opt][4] = 2
  2850. "
  2851. }
  2852.  
  2853. text
  2854. {
  2855. area 580 317 400 44
  2856. text "SELECTION_BUTTON"
  2857. text style "button"
  2858. text align right center
  2859. text highlight lua "getSelected(selectedSL, 2)"
  2860. action
  2861. "
  2862. helpString = 11352
  2863. selectedsoundOpt = 0
  2864. selectedSL = 2
  2865. "
  2866. }
  2867.  
  2868. list
  2869. {
  2870.  
  2871. column
  2872. {
  2873. width 85
  2874. label
  2875. {
  2876. area 10 0 -1 -1
  2877. text lua "t( selectOpt[rowNumber][1])"
  2878. text style "normal"
  2879. text align right center
  2880. }
  2881. }
  2882. column
  2883. {
  2884. width 15
  2885. label
  2886. {
  2887. area 20 8 32 32
  2888. bam ROUNDBUT
  2889. scaleToClip
  2890. frame lua "selectOpt[rowNumber][4]"
  2891. }
  2892. }
  2893.  
  2894. area 580 360 400 145
  2895.  
  2896. rowheight 46
  2897. table "selectOpt"
  2898. var selectSel
  2899. scrollbar 'GUISCRC'
  2900. hidehighlight
  2901. action
  2902. "
  2903. panelID = 7
  2904. helpString = 11352
  2905. selectedSL = 2
  2906. opt = selectSel
  2907. selectOpt[1][4] = 0
  2908. selectOpt[2][4] = 0
  2909. selectOpt[3][4] = 0
  2910. selectedsoundOpt = 0
  2911.  
  2912. Infinity_PlaySound('GAM_09')
  2913. selectOpt[opt][4] = 2
  2914. "
  2915. }
  2916.  
  2917. label
  2918. {
  2919. area 576 505 425 200
  2920. mosaic GUINOTE
  2921. }
  2922.  
  2923. text
  2924. {
  2925. area 590 515 390 110
  2926. text lua "Infinity_FetchString(helpString)"
  2927. text style normal
  2928. scrollbar 'GUISCRC'
  2929. }
  2930.  
  2931. text
  2932. {
  2933. area 122 136 394 44
  2934. text "VOLUME_CONTROLS_LABEL"
  2935. text style "button"
  2936. text align right center
  2937. }
  2938.  
  2939. text
  2940. {
  2941. area 122 185 173 40
  2942. text "AMBIENT_VOLUME_LABEL"
  2943. text style "label"
  2944. text align right center
  2945. text upper
  2946. text highlight lua "getSelected(selectedSL, 4)"
  2947. action
  2948. "
  2949. helpString = 18008
  2950. selectedsoundOpt = 0
  2951. selectedSL = 4
  2952. "
  2953. }
  2954. slider
  2955. {
  2956. area 304 185 200 36
  2957. position "ambientSLDR"
  2958. sliderBackground 'SLDRBACK'
  2959. scaleToClip
  2960. bam 'SLDRSTAR'
  2961. sequence 0
  2962. frame 1
  2963. settings 40
  2964. pad 5 0 4 0
  2965. action
  2966. "
  2967. helpString = 18008
  2968. selectedsoundOpt = 0
  2969. selectedSL = 4
  2970. "
  2971. }
  2972.  
  2973. text
  2974. {
  2975. area 122 240 173 40
  2976. text "SFX_VOLUME_LABEL"
  2977. text style "label"
  2978. text align right center
  2979. text upper
  2980. text highlight lua "getSelected(selectedSL, 5)"
  2981. action
  2982. "
  2983. helpString = 18009
  2984. selectedsoundOpt = 0
  2985. selectedSL = 5
  2986. "
  2987.  
  2988. }
  2989. slider
  2990. {
  2991. area 304 240 200 36
  2992. sliderBackground 'SLDRBACK'
  2993. scaleToClip
  2994. position "sfxSLDR"
  2995. bam 'SLDRSTAR'
  2996. sequence 0
  2997. frame 1
  2998. settings 40
  2999. pad 5 0 4 0
  3000. action
  3001. "
  3002. helpString = 18009
  3003. selectedsoundOpt = 0
  3004. selectedSL = 5
  3005. "
  3006. }
  3007.  
  3008. text
  3009. {
  3010. area 122 295 173 40
  3011. text "VOICE_VOLUME_LABEL"
  3012. text style "label"
  3013. text align right center
  3014. text upper
  3015. text highlight lua "getSelected(selectedSL, 6)"
  3016. action
  3017. "
  3018. helpString = 18010
  3019. selectedsoundOpt = 0
  3020. selectedSL = 6
  3021. "
  3022. }
  3023. slider
  3024. {
  3025. area 304 295 200 36
  3026. position "voiceSLDR"
  3027. bam 'SLDRSTAR'
  3028. sliderBackground 'SLDRBACK'
  3029. scaleToClip
  3030. sequence 0
  3031. frame 1
  3032. settings 40
  3033. pad 5 0 4 0
  3034. action
  3035. "
  3036. helpString = 18010
  3037. selectedsoundOpt = 0
  3038. selectedSL = 6
  3039. "
  3040. }
  3041.  
  3042. text
  3043. {
  3044. area 122 350 173 40
  3045. text "MUSIC_VOLUME_LABEL"
  3046. text style "label"
  3047. text align right center
  3048. text upper
  3049. text highlight lua "getSelected(selectedSL, 7)"
  3050. action
  3051. "
  3052. helpString = 18011
  3053. selectedsoundOpt = 0
  3054. selectedSL = 7
  3055. "
  3056.  
  3057. }
  3058. slider
  3059. {
  3060. area 304 350 200 36
  3061. position "musicSLDR"
  3062. bam 'SLDRSTAR'
  3063. sliderBackground 'SLDRBACK'
  3064. scaleToClip
  3065. sequence 0
  3066. frame 1
  3067. settings 40
  3068. pad 5 0 4 0
  3069. action
  3070. "
  3071. helpString = 18011
  3072. selectedsoundOpt = 0
  3073. selectedSL = 7
  3074. "
  3075. }
  3076.  
  3077. text
  3078. {
  3079. area 122 405 173 40
  3080. text "MOVIE_VOLUME_LABEL"
  3081. text style "label"
  3082. text align right center
  3083. text upper
  3084. text highlight lua "getSelected(selectedSL, 8)"
  3085. action
  3086. "
  3087. helpString = 18012
  3088. selectedsoundOpt = 0
  3089. selectedSL = 8
  3090. "
  3091. }
  3092. slider
  3093. {
  3094. area 304 405 200 40
  3095. position "movieSLDR"
  3096. bam 'SLDRSTAR'
  3097. sliderBackground 'SLDRBACK'
  3098. scaleToClip
  3099. sequence 0
  3100. frame 1
  3101. settings 40
  3102. pad 5 0 4 0
  3103. action
  3104. "
  3105. helpString = 18012
  3106. selectedsoundOpt = 0
  3107. selectedSL = 8
  3108. "
  3109. }
  3110.  
  3111. button
  3112. {
  3113. on escape
  3114. area 188 700 200 40
  3115. bam GUIBUTNT
  3116. sequence 2
  3117. text "CANCEL_BUTTON"
  3118. text style "button"
  3119. action
  3120. "
  3121. selectedSL = 0
  3122. panelID = 8
  3123. Infinity_PopMenu()
  3124. "
  3125. }
  3126. button
  3127. {
  3128. area 638 700 200 40
  3129. bam GUIBUTNT
  3130. sequence 2
  3131. text "DONE_BUTTON"
  3132. text style "button"
  3133. action
  3134. "
  3135. panelID = 7
  3136.  
  3137. for index, var in pairs(command) do
  3138. Infinity_Log('Com var[4] #' .. index .. ': ' .. var[4])
  3139. if var[4] == 2 then
  3140. Infinity_ChangeOption( var[3], 1, panelID)
  3141. end
  3142. end
  3143. for index, var in pairs(selectOpt) do
  3144. Infinity_Log('Sel var[4] #' .. index .. ': ' .. var[4])
  3145. if var[4] == 2 then
  3146. Infinity_ChangeOption( var[3], 1, panelID)
  3147. end
  3148. end
  3149. Infinity_ChangeOption( 1, ambientSLDR, panelID)
  3150. Infinity_ChangeOption( 2, sfxSLDR, panelID )
  3151. Infinity_ChangeOption( 3, voiceSLDR, panelID )
  3152. Infinity_ChangeOption( 4, musicSLDR, panelID)
  3153. Infinity_ChangeOption( 22, movieSLDR, panelID)
  3154.  
  3155. selectedOpt = 0
  3156. selectedSL = 0
  3157.  
  3158. for index, var in pairs(soundsToggles) do
  3159. Infinity_ChangeOption( var[3], var[5], panelID)
  3160. end
  3161.  
  3162. panelID = 8
  3163. Infinity_PopMenu()
  3164. "
  3165. }
  3166. }
  3167.  
  3168.  
  3169. `
  3170.  
  3171. feedbackToggles = {
  3172. {'COLORED_MARKERS_LABEL', 'COLORED_MARKERS_HELP', 38, 0, 0},
  3173. {'CLASSIC_MARKERS_LABEL', 'CLASSIC_MARKERS_HELP', 45, 0, 0},
  3174. {'ENABLE_CONFIRMATION_LABEL', 'ENABLE_CONFIRMATION_HELP', 41, 0, 0},
  3175. {'DISABLE_COSMETIC_ATTACKS_LABEL', 'DISABLE_COSMETIC_ATTACKS_HELP', 43, 0, 0},
  3176. {'JOURNAL_POPUPS_LABEL', 'JOURNAL_POPUPS_HELP', 44, 0, 0}
  3177. }
  3178.  
  3179. messagesToggles = {
  3180. {'TO_HIT_ROLLS_LABEL', 'TO_HIT_ROLLS_HELP', 10, 0, 0},
  3181. {'ACTIONS_LABEL', 'ACTIONS_HELP', 12, 0, 0},
  3182. {'STATE_CHANGES_LABEL', 'STATE_CHANGES_HELP', 13, 0, 0},
  3183. {'COMBAT_INFO_LABEL', 'COMBAT_INFO_HELP', 11, 0, 0},
  3184. {'SELECTION_TEXT_LABEL', 'SELECTION_TEXT_HELP', 14, 0, 0},
  3185. {'MISC_LABEL', 'MISC_HELP', 15, 0, 0}
  3186. }
  3187.  
  3188. selFeedOpt = 0
  3189. selMessageOpt = 0
  3190. helpString = 0
  3191.  
  3192. markerFeedSLDR = 0
  3193. locatorFeedSLDR = 0
  3194.  
  3195. function getFrequency(d,includeHighter)
  3196. strref = ""
  3197. if ( d ==0 ) then
  3198. strref = "MINIMUM"
  3199. elseif (d == 1) then
  3200. strref = "LOW"
  3201. elseif (d == 2) then
  3202. strref = "MEDIUM"
  3203. elseif (d == 3) then
  3204. strref = "HIGH"
  3205. elseif (d == 4 and includeHighter == true) then
  3206. strref = "HIGHER"
  3207. elseif (d == 4 and includeHighter == false) then
  3208. strref = "MAXIMUM"
  3209. elseif (d == 5) then
  3210. strref = "MAXIMUM"
  3211. end
  3212. return t(strref)
  3213. end
  3214.  
  3215. `
  3216.  
  3217. menu
  3218. {
  3219. name 'OPTIONS_FEEDBACK'
  3220. align center center
  3221. modal
  3222. onOpen
  3223. "
  3224. panelID = 9
  3225.  
  3226. helpString = 'FEEDBACK_HELP'
  3227. selFeedOpt = 0
  3228. selMessageOpt = 0
  3229. selectedSL = 0
  3230.  
  3231. markerFeedSLDR = Infinity_GetOption(8, panelID)
  3232. locatorFeedSLDR = Infinity_GetOption(9, panelID)
  3233.  
  3234. for index, var in pairs(feedbackToggles) do
  3235. var[5] = Infinity_GetOption(var[3], panelID)
  3236. if var[5] == 0 then
  3237. var[4] = 0
  3238. else
  3239. var[4] = 2
  3240. end
  3241. end
  3242.  
  3243. for index, var in pairs(messagesToggles) do
  3244. var[5] = Infinity_GetOption(var[3], panelID)
  3245. if var[5] == 0 then
  3246. var[4] = 0
  3247. else
  3248. var[4] = 2
  3249. end
  3250. end
  3251.  
  3252. "
  3253.  
  3254. button
  3255. {
  3256. area 0 0 1024 768
  3257. mosaic GUITUTB
  3258. action
  3259. "
  3260. helpString = 'FEEDBACK_HELP'
  3261. selFeedOpt = 0
  3262. selMessageOpt = 0
  3263. selectedSL = 0
  3264. "
  3265. }
  3266. label
  3267. {
  3268. area 130 18 768 54
  3269. text "FEEDBACK_TITLE"
  3270. text style title
  3271. }
  3272.  
  3273.  
  3274.  
  3275. label
  3276. {
  3277. area 100 404 407 44
  3278. text "VISUAL_FEEDBACK_LABEL"
  3279. text style "button"
  3280. text align right center
  3281. }
  3282.  
  3283. list
  3284. {
  3285.  
  3286. column
  3287. {
  3288. width 85
  3289. label
  3290. {
  3291. area 0 0 -1 -1
  3292. text lua "t( feedbackToggles[rowNumber][1])"
  3293. text style "normal"
  3294. text align right center
  3295. }
  3296. }
  3297. column
  3298. {
  3299. width 15
  3300. label
  3301. {
  3302. area 20 8 32 32
  3303. bam ROUNDBUT
  3304. scaleToClip
  3305. frame lua "feedbackToggles[rowNumber][4]"
  3306. }
  3307. }
  3308.  
  3309. area 100 448 407 202
  3310.  
  3311. rowheight 50
  3312. table "feedbackToggles"
  3313. var selFeedOpt
  3314. scrollbar 'GUISCRC'
  3315.  
  3316. action
  3317. "
  3318. selectedSL = 0
  3319. selMessageOpt = 0
  3320. helpString = feedbackToggles[selFeedOpt][2]
  3321.  
  3322. if(cellNumber == 2) then
  3323. Infinity_PlaySound('GAM_09')
  3324. feedbackToggles[selFeedOpt][4] = toggleFrame(feedbackToggles[selFeedOpt][4])
  3325.  
  3326. if feedbackToggles[selFeedOpt][4] == 0 then
  3327. feedbackToggles[selFeedOpt][5] = 0
  3328. else
  3329. feedbackToggles[selFeedOpt][5] = 1
  3330. end
  3331. end
  3332. "
  3333. }
  3334.  
  3335. label
  3336. {
  3337. area 568 128 416 44
  3338. text "FEEDBACK_MESSAGES_LABEL"
  3339. text style "button"
  3340. text align right center
  3341. }
  3342.  
  3343. list
  3344. {
  3345.  
  3346. column
  3347. {
  3348. width 85
  3349. label
  3350. {
  3351. area 10 0 -1 -1
  3352. text lua "t( messagesToggles[rowNumber][1])"
  3353. text style "normal"
  3354. text align right center
  3355. }
  3356. }
  3357. column
  3358. {
  3359. width 15
  3360. label
  3361. {
  3362. area 20 8 32 32
  3363. bam ROUNDBUT
  3364. scaleToClip
  3365. frame lua "messagesToggles[rowNumber][4]"
  3366. }
  3367. }
  3368.  
  3369. area 568 172 422 328
  3370.  
  3371. rowheight 50
  3372. table "messagesToggles"
  3373. var selMessageOpt
  3374. scrollbar 'GUISCRC'
  3375.  
  3376. action
  3377. "
  3378.  
  3379. helpString = messagesToggles[selMessageOpt][2]
  3380. selectedSL = 0
  3381. selFeedOpt = 0
  3382.  
  3383. if(cellNumber == 2) then
  3384. Infinity_PlaySound('GAM_09')
  3385. messagesToggles[selMessageOpt][4] = toggleFrame(messagesToggles[selMessageOpt][4])
  3386.  
  3387. if messagesToggles[selMessageOpt][4] == 0 then
  3388. messagesToggles[selMessageOpt][5] = 0
  3389. else
  3390. messagesToggles[selMessageOpt][5] = 1
  3391. end
  3392. end
  3393. "
  3394. }
  3395.  
  3396. label
  3397. {
  3398. area 559 508 425 142
  3399. mosaic GUINOTE
  3400. }
  3401.  
  3402. text
  3403. {
  3404. area 572 516 402 110
  3405. text lua "t(helpString)"
  3406. text style normal
  3407. scrollbar 'GUISCRC'
  3408. }
  3409.  
  3410. text
  3411. {
  3412. area 110 165 186 36
  3413. text "MARKER_FEEDBACK_LABEL"
  3414. text style "label"
  3415. text align right center
  3416. text upper
  3417. text highlight lua "getSelected(selectedSL, 1)"
  3418. action
  3419. "
  3420. helpString = 'MARKER_FEEDBACK_HELP'
  3421. selFeedOpt = 0
  3422. selMessageOpt = 0
  3423. selectedSL = 1
  3424. "
  3425.  
  3426. }
  3427. slider
  3428. {
  3429. area 300 165 200 36
  3430. position "markerFeedSLDR"
  3431. bam 'SLDRSTAR'
  3432. sliderBackground 'SLDRBACK'
  3433. scaleToClip
  3434. sequence 0
  3435. frame 1
  3436. settings 6
  3437. pad 5 0 5 0
  3438. action
  3439. "
  3440. helpString = 'MARKER_FEEDBACK_HELP'
  3441. selFeedOpt = 0
  3442. selMessageOpt = 0
  3443. selectedSL = 1
  3444. "
  3445. }
  3446. label
  3447. {
  3448. area 300 201 200 36
  3449. text lua "getFrequency(markerFeedSLDR,true)"
  3450. text style "label"
  3451. text align center center
  3452. }
  3453.  
  3454. text
  3455. {
  3456. area 110 300 186 36
  3457. text "LOCATOR_FEEDBACK_LABEL"
  3458. text style "label"
  3459. text align right center
  3460. text upper
  3461. text highlight lua "getSelected(selectedSL, 2)"
  3462. action
  3463. "
  3464. helpString = 'LOCATOR_FEEDBACK_HELP'
  3465. selFeedOpt = 0
  3466. selMessageOpt = 0
  3467. selectedSL = 2
  3468. "
  3469. }
  3470. slider
  3471. {
  3472. area 300 300 200 36
  3473. position "locatorFeedSLDR"
  3474. bam 'SLDRSTAR'
  3475. sliderBackground 'SLDRBACK'
  3476. scaleToClip
  3477. sequence 0
  3478. frame 1
  3479. settings 5
  3480. pad 5 0 5 0
  3481. action
  3482. "
  3483. helpString = 'LOCATOR_FEEDBACK_HELP'
  3484. selFeedOpt = 0
  3485. selMessageOpt = 0
  3486. selectedSL = 2
  3487. "
  3488. }
  3489. label
  3490. {
  3491. area 300 336 200 36
  3492. text lua "getFrequency(locatorFeedSLDR,false)"
  3493. text style "label"
  3494. text align center center
  3495. }
  3496. button
  3497. {
  3498. on escape
  3499. area 188 700 200 40
  3500. bam GUIBUTNT
  3501. sequence 2
  3502. text "CANCEL_BUTTON"
  3503. text style "button"
  3504. action
  3505. "
  3506. helpString = 'GAMEPLAY_DESCRIPTION'
  3507. selectedSL = 0
  3508. panelID = 8
  3509. Infinity_PopMenu()
  3510. "
  3511. }
  3512. button
  3513. {
  3514. area 638 700 200 40
  3515. bam GUIBUTNT
  3516. sequence 2
  3517. text "DONE_BUTTON" --Done
  3518. text style "button"
  3519. action
  3520. "
  3521. helpString = 'GAMEPLAY_DESCRIPTION'
  3522. panelID = 9
  3523. Infinity_ChangeOption( 8, markerFeedSLDR, panelID)
  3524. Infinity_ChangeOption( 9, locatorFeedSLDR, panelID )
  3525.  
  3526. selectedOpt = 0
  3527. selectedSL = 0
  3528.  
  3529. for index, var in pairs(messagesToggles) do
  3530.  
  3531. Infinity_ChangeOption( var[3], var[5], panelID)
  3532.  
  3533. end
  3534.  
  3535. for index, var in pairs(feedbackToggles) do
  3536.  
  3537. Infinity_ChangeOption( var[3], var[5], panelID)
  3538.  
  3539. end
  3540. Infinity_PopMenu()
  3541. "
  3542. }
  3543. }
  3544.  
  3545. `
  3546. function getGooglePlaySignInText()
  3547. if(Infinity_GooglePlaySignedIn() == 1) then
  3548. return t("SIGN_OUT_BUTTON")
  3549. else
  3550. return t("SIGN_IN_BUTTON")
  3551. end
  3552. end
  3553.  
  3554. keyCategory = 1
  3555. key = 0
  3556.  
  3557. function displayHelp()
  3558. if not (key == 0) then
  3559. return 24680
  3560. end
  3561. return 0
  3562. end
  3563.  
  3564. function formatKeyCode(number)
  3565. local ret = ""
  3566.  
  3567. if number < 127 and number > 32 then
  3568. return string.format('%c', keybindings[keyCategory][rowNumber][6])
  3569. end
  3570. ret = t("SDL_" .. string.format('%d', keybindings[keyCategory][rowNumber][6]))
  3571.  
  3572. return ret
  3573. end
  3574.  
  3575. function getHotkeyName(category,number)
  3576. local ret = ""
  3577. if category < 5 then
  3578. ret = t(keybindings[category][number][4])
  3579. if ret == keybindings[category][number][4] then
  3580. ret = Infinity_FetchString(keybindings[category][number][4])
  3581. end
  3582. else
  3583. ret = Infinity_FetchString(keybindings[category][number][4])
  3584. end
  3585. return ret
  3586. end
  3587. `
  3588. menu
  3589. {
  3590. name 'OPTIONS_KEYBINDINGS'
  3591. modal
  3592. align center center
  3593.  
  3594. button -- Background
  3595. {
  3596. area 0 0 864 710
  3597. mosaic GUICHISD
  3598. }
  3599.  
  3600. label -- Title
  3601. {
  3602. area 82 12 700 40
  3603. text "ASSIGN_KEYS_TITLE"
  3604. text style "title"
  3605. }
  3606.  
  3607. label -- Instruction
  3608. {
  3609. area 252 60 367 42
  3610. text "ASSIGN_KEYS_SUBTITLE"
  3611. text style "label"
  3612. }
  3613. label -- Contextual instruction
  3614. {
  3615. area 42 112 778 50
  3616. text lua "Infinity_FetchString(displayHelp())"
  3617. text style "label"
  3618. }
  3619.  
  3620. list -- Key categories
  3621. {
  3622. column
  3623. {
  3624. width 100
  3625. label
  3626. {
  3627. area 0 0 -1 -1
  3628. text lua "t(keycategories[rowNumber][2])"
  3629. text style "normal"
  3630. text align center center
  3631. }
  3632. }
  3633. area 42 190 360 420
  3634.  
  3635. rowheight 24
  3636. table "keycategories"
  3637. var keyCategory
  3638. scrollbar 'GUISCRC'
  3639. action
  3640. "
  3641. Infinity_StopKeybind()
  3642. key = 0
  3643. "
  3644. }
  3645.  
  3646.  
  3647. list -- Key bindings
  3648. {
  3649. column
  3650. {
  3651. width 90
  3652. label
  3653. {
  3654. area 0 0 -1 -1
  3655. text lua "getHotkeyName(keyCategory,rowNumber)"
  3656. text style "normal"
  3657. align left center
  3658. }
  3659. }
  3660. column
  3661. {
  3662. width 10
  3663. label
  3664. {
  3665. area 0 0 -1 -1
  3666. text lua "formatKeyCode(keybindings[keyCategory][rowNumber][6])"
  3667. text style "normal"
  3668. text upper
  3669. text align right center
  3670. }
  3671. }
  3672.  
  3673. area 448 190 372 420
  3674. rowheight 24
  3675. table "keybindings[keyCategory]"
  3676. var key
  3677. scrollbar 'GUISCRC'
  3678. action
  3679. "
  3680. if(key > 0) then
  3681. Infinity_StartKeybind(key);
  3682. keybindings[keyCategory][key][6] = 0
  3683. end
  3684. "
  3685. }
  3686.  
  3687. button
  3688. {
  3689. area 514 634 230 40
  3690. bam GUIBUTMT
  3691. sequence 6
  3692. text "DONE_BUTTON"
  3693. text style "button"
  3694. action
  3695. "
  3696. Infinity_StopKeybind()
  3697. key = 0
  3698. Infinity_PopMenu();
  3699. "
  3700. }
  3701. button
  3702. {
  3703. area 102 634 230 40
  3704. bam GUIBUTMT
  3705. sequence 6
  3706. text "REVERT_BUTTON"
  3707. text style "button"
  3708.  
  3709. action
  3710. "
  3711. revertKeymap();
  3712. "
  3713. }
  3714. }
  3715. `
  3716. function generateMegaCredits()
  3717. megacredits = ''
  3718. for k,v in pairs(credits) do
  3719. megacredits = megacredits .. Infinity_FetchString(v)..'\n'
  3720. end
  3721. end
  3722. `
  3723. menu
  3724. {
  3725. name 'SODCREDIT'
  3726. align center center
  3727. onOpen
  3728. "
  3729. generateMegaCredits()
  3730. chapterScreen:OnReplayButtonClick()
  3731. "
  3732. label
  3733. {
  3734. area 0 0 1024 768
  3735. mosaic "NPCCHAP"
  3736. }
  3737. text
  3738. {
  3739. area 100 50 828 36
  3740. text style "title"
  3741. text "MAIN_GAME_LABEL"
  3742. enabled "not e:IsTouchUI()"
  3743. }
  3744. text
  3745. {
  3746. area 100 86 828 34
  3747. text style "title"
  3748. text "EXPANSION_LABEL"
  3749. enabled "not e:IsTouchUI()"
  3750. }
  3751. text
  3752. {
  3753. area 100 50 828 78
  3754. text style "title"
  3755. text "EXPANSION_LABEL"
  3756. enabled "e:IsTouchUI()"
  3757. }
  3758. label
  3759. {
  3760. area 110 176 274 430
  3761. mosaic "credi_02"
  3762. }
  3763. text
  3764. {
  3765. name "text_CHAPTERSCROLL_item"
  3766. area 440 148 492 482
  3767. text lua "megacredits"
  3768. text style normal
  3769. text align center top
  3770. scrollbar 'GUISCRC'
  3771. scrollbar func 'UpdateChapterScroll'
  3772. scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1'
  3773. action
  3774. "
  3775. text_CHAPTERSCROLL_auto = 0
  3776. "
  3777. }
  3778. button
  3779. {
  3780. area 526 662 230 40
  3781. bam GUIBUTMT
  3782. text "DONE_BUTTON"
  3783. text style "button"
  3784. on escape
  3785. clickable lua "chapterScreen:IsDoneButtonClickable()"
  3786. action
  3787. "
  3788. megacredits = ''
  3789. Infinity_PopMenu()
  3790. "
  3791. }
  3792. button
  3793. {
  3794. area 284 662 230 40
  3795. bam GUIBUTMT
  3796. text "REPLAY_BUTTON"
  3797. text style "button"
  3798. clickable lua "chapterScreen:IsReplayButtonClickable()"
  3799. action
  3800. "
  3801. chapterScreen:OnReplayButtonClick()
  3802. "
  3803. }
  3804. }
  3805.  
  3806. menu
  3807. {
  3808. name 'CREDITS'
  3809. align center center
  3810. onOpen
  3811. "
  3812. generateMegaCredits()
  3813. "
  3814. label
  3815. {
  3816. area 0 0 1024 768
  3817. mosaic GUISMBM
  3818. }
  3819.  
  3820. label
  3821. {
  3822. area 30 18 970 36
  3823. text "CREDITS_TITLE"
  3824. text style "title"
  3825. }
  3826.  
  3827. text
  3828. {
  3829. area 30 64 974 632
  3830. text lua "megacredits"
  3831. scrollbar 'GUISCRC'
  3832. scrollbar func "resetScrollbar"
  3833. text style "normal"
  3834. text align center top
  3835. }
  3836.  
  3837. button
  3838. {
  3839. area 774 706 230 40
  3840. bam GUIBUTMT
  3841. sequence 6
  3842. text "DONE_BUTTON"
  3843. text style "button"
  3844. action
  3845. "
  3846. Infinity_PopMenu();
  3847. "
  3848. }
  3849. }
  3850.  
  3851. `
  3852. language = 0
  3853. showsubtitles = 0
  3854. displayLanguages = {}
  3855. function languageDetails()
  3856. if displayLanguages[language] ~= nil then
  3857. return Infinity_FetchString(displayLanguages[language][2]) .. '\n' .. Infinity_FetchString(displayLanguages[language][3])
  3858. else
  3859. return ""
  3860. end
  3861. end
  3862. function findCurrentLanguage()
  3863. local lang = Infinity_GetINIString('Language', 'Text', '')
  3864. for k,v in pairs(displayLanguages) do
  3865. if v[1] == lang then
  3866. language = k
  3867. end
  3868. end
  3869. end
  3870. `
  3871. menu
  3872. {
  3873. name 'OPTIONS_LANGUAGE'
  3874. modal
  3875. align center center
  3876. onOpen
  3877. "
  3878. if e:IsTouchUI() then
  3879. displayLanguages = tabletLanguages
  3880. else
  3881. displayLanguages = languages
  3882. end
  3883. showsubtitles = Infinity_GetINIValue('Program Options', 'Display Subtitles', 1)
  3884. findCurrentLanguage()
  3885. "
  3886.  
  3887. button
  3888. {
  3889. area 0 0 864 710
  3890. mosaic 'GUIPOP46'
  3891. }
  3892.  
  3893. label
  3894. {
  3895. area 34 28 796 56
  3896. text "LANGUAGE_TITLE"
  3897. text style "title"
  3898. }
  3899. list
  3900. {
  3901. column {
  3902. width 100
  3903. label
  3904. {
  3905. area 0 0 -1 -1
  3906. text lua "displayLanguages[rowNumber][4]"
  3907. text style "normal"
  3908. text align center center
  3909. }
  3910. }
  3911.  
  3912. area 34 94 318 410
  3913. rowheight 24
  3914. table "displayLanguages"
  3915. var language
  3916. scrollbar 'GUISCRC'
  3917. }
  3918. text
  3919. {
  3920. area 360 94 470 410
  3921. text lua "languageDetails()"
  3922. text style normal
  3923. text align center top
  3924. scrollbar 'GUISCRC'
  3925. }
  3926.  
  3927. label
  3928. {
  3929. area 70 512 170 34
  3930. text "SHOW_SUBTITLES_LABEL"
  3931. text style "label"
  3932. text align right center
  3933. text upper
  3934. }
  3935. label
  3936. {
  3937. area 34 552 318 46
  3938. text lua "Infinity_FetchString(32129)"
  3939. text style "normal"
  3940. text align center center
  3941. text upper
  3942. }
  3943. label
  3944. {
  3945. area 360 508 470 90
  3946. text lua "Infinity_FetchString(71374)"
  3947. text style "normal"
  3948. text align center center
  3949. text color '$'
  3950. }
  3951.  
  3952. button
  3953. {
  3954. area 288 512 32 34
  3955. bam ROUNDBUT
  3956. scaleToClip
  3957. toggle showsubtitles
  3958. }
  3959.  
  3960. button
  3961. {
  3962. on escape
  3963. area 134 630 230 40
  3964. bam GUIBUTMT
  3965. text "CANCEL_BUTTON"
  3966. text style "button"
  3967. sequence 1
  3968. action
  3969. "
  3970. -- cancel
  3971. for index, var in pairs(displayLanguages) do
  3972. Infinity_Log(var[3])
  3973. end
  3974. Infinity_PopMenu();
  3975. "
  3976. }
  3977.  
  3978. button
  3979. {
  3980. area 532 630 230 40
  3981. bam GUIBUTMT
  3982. text "DONE_BUTTON"
  3983. text style "button"
  3984. action
  3985. "
  3986. -- done
  3987. Infinity_SetLanguage(displayLanguages[language][1],showsubtitles)
  3988. Infinity_PopMenu()
  3989. "
  3990. }
  3991.  
  3992. }
  3993. `
  3994. function restoreOverlayFromQuit()
  3995. --restore the old overlay if applicable
  3996. if(oldOverlayMenuName) then
  3997. Infinity_SetOverlay(oldOverlayMenuName)
  3998. else
  3999. Infinity_SetOverlay(nil)
  4000. end
  4001. end
  4002. `
  4003. menu
  4004. {
  4005. name 'QuitMenu'
  4006. modal
  4007. align center center
  4008. label -- Background
  4009. {
  4010. area 0 0 657 234
  4011. mosaic GUIERR6
  4012. }
  4013. label --Title
  4014. {
  4015. area 40 20 600 120
  4016. text 20186
  4017. text style "label"
  4018. }
  4019. button
  4020. {
  4021. area 370 170 230 40
  4022. bam GUIBUTMT
  4023. sequence 0
  4024. text "QUIT_GAME_BUTTON"
  4025. text style "button"
  4026. on return
  4027. enabled "not e:IsAndroid()"
  4028. action
  4029. "
  4030. restoreOverlayFromQuit()
  4031. Infinity_ShutdownGame()
  4032. "
  4033. }
  4034. button
  4035. {
  4036. area 370 170 230 40
  4037. bam GUIBUTMT
  4038. sequence 0
  4039. text "QUIT_GAME_BUTTON"
  4040. text style "button"
  4041. on escape
  4042. enabled "e:IsAndroid()"
  4043. action
  4044. "
  4045. restoreOverlayFromQuit()
  4046. Infinity_ShutdownGame()
  4047. "
  4048. }
  4049. button
  4050. {
  4051. area 88 170 230 40
  4052. bam GUIBUTMT
  4053. sequence 0
  4054. text "CANCEL_BUTTON"
  4055. text style "button"
  4056. on escape
  4057. action
  4058. "
  4059. restoreOverlayFromQuit()
  4060. Infinity_PopMenu('QuitMenu')
  4061. "
  4062. }
  4063. }
  4064.  
  4065. `
  4066. selectedSlot = nil
  4067. itemRequestAmt = 0
  4068.  
  4069. function showItemAmountRequester(slotName)
  4070. local slot = characters[id].equipment[slotName]
  4071. if(slot.item.count == nil) then
  4072. Infinity_Log("Nil count in requester!")
  4073. return
  4074. end
  4075. if(slot.item.count > 1) then
  4076. selectedSlot = slotName
  4077. popupRequester(slot.item.count, inventorySplitStack, false)
  4078. end
  4079. end
  4080. function inventorySplitStack(cnt)
  4081. Infinity_SplitItemStack(characters[id].equipment[selectedSlot].id, cnt,'slot_inv_' .. characters[id].equipment[selectedSlot].id)
  4082. end
  4083.  
  4084. function GetAbilityIdentifyString()
  4085. if(characters[id].equipment[selectedSlot].item.identified == 0) then
  4086. return t("IDENTIFY_BUTTON")
  4087. end
  4088.  
  4089. if(characters[id].equipment[selectedSlot].abilityMode == 1) then
  4090. return t("ABILITIES_BUTTON")
  4091. end
  4092.  
  4093. return ""
  4094. end
  4095. requester = {}
  4096. requester.requesterMax = 0
  4097. requester.requesterFunc = nil
  4098. requester.selling = false
  4099. `
  4100. menu
  4101. {
  4102. name 'POPUP_REQUESTER'
  4103. align center center
  4104. modal
  4105. onOpen
  4106. "
  4107. if requester.selling == false then
  4108. itemRequestAmt = 1
  4109. else
  4110. itemRequestAmt = requester.requesterMax
  4111. end
  4112. "
  4113.  
  4114. label
  4115. {
  4116. area 0 0 465 500
  4117. mosaic GUIERR
  4118. }
  4119. label
  4120. {
  4121. area 132 134 208 47
  4122. text "CHOOSE_AMT_LABEL"
  4123. text align center center
  4124. text style "label"
  4125. }
  4126. edit
  4127. {
  4128. area 156 196 86 48
  4129. var itemRequestAmt
  4130. text style "edit"
  4131. align center center
  4132. maxlines 1
  4133. fill 112 111 111 64
  4134. action
  4135. "
  4136. -- only permit numbers as letters.
  4137. -- character limit of 4
  4138. if((tonumber(letter_pressed) ~= nil and #tostring(itemRequestAmt) < 4) or not letter_pressed) then
  4139. return 1
  4140. else
  4141. return 0
  4142. end
  4143. "
  4144. }
  4145. button
  4146. {
  4147. on escape
  4148. bam GUIBUTNT
  4149. sequence 6
  4150. area 138 314 201 40
  4151. text "CANCEL_BUTTON"
  4152. text style "button"
  4153. action
  4154. "
  4155. Infinity_PopMenu()
  4156. "
  4157. }
  4158. button
  4159. {
  4160. bam GUIBUTWT
  4161. sequence 6
  4162. area 84 266 299 40
  4163. text "DONE_BUTTON"
  4164. text style "button"
  4165. action
  4166. "
  4167. local cnt = tonumber(itemRequestAmt)
  4168. Infinity_PopMenu()
  4169. if(cnt and cnt > 0 and cnt <= requester.requesterMax) then
  4170. requester.requesterFunc(cnt)
  4171. end
  4172. "
  4173. }
  4174. button
  4175. {
  4176. bam GUIOSW
  4177. area 251 200 44 44
  4178. sequence 0
  4179. action
  4180. "
  4181. local amt = tonumber(itemRequestAmt)
  4182. if(amt < requester.requesterMax) then
  4183. itemRequestAmt = amt + 1
  4184. end
  4185. "
  4186. actionHold
  4187. "
  4188. local amt = tonumber(itemRequestAmt)
  4189. if(amt < requester.requesterMax) then
  4190. itemRequestAmt = amt + 1
  4191. end
  4192. "
  4193. }
  4194. button
  4195. {
  4196. bam GUIOSW
  4197. area 296 200 44 44
  4198. sequence 1
  4199. action
  4200. "
  4201. local amt = tonumber(itemRequestAmt)
  4202. if(amt > 1) then
  4203. itemRequestAmt = amt - 1
  4204. end
  4205. "
  4206. actionHold
  4207. "
  4208. local amt = tonumber(itemRequestAmt)
  4209. if(amt > 1) then
  4210. itemRequestAmt = amt - 1
  4211. end
  4212. "
  4213. }
  4214. }
  4215. `
  4216. selectedAbility = -1
  4217. function initAbilities()
  4218. --initialize selected ability
  4219. local i = 1
  4220. while ( i < 4 ) do
  4221. local ability = characters[id].equipment[selectedSlot].abilities[i]
  4222. if(ability ~= nil) then
  4223. if(ability.selected == 1) then
  4224. selectedAbility = i
  4225. return
  4226. end
  4227. end
  4228. i = i + 1
  4229. end
  4230. end
  4231. `
  4232. menu
  4233. {
  4234. name 'ITEM_ABILITIES'
  4235. align center center
  4236. onOpen "initAbilities()"
  4237.  
  4238. label
  4239. {
  4240. area 0 0 539 668
  4241. mosaic GUICGGEN
  4242. }
  4243. label
  4244. {
  4245. area 0 16 539 44
  4246. text "ITEM_ABILITIES_TITLE"
  4247. text style "title"
  4248. }
  4249. text
  4250. {
  4251. area 22 74 496 52
  4252. text highlight lua "selectedAbility == 1"
  4253. enabled "characters[id].equipment[selectedSlot].abilities[1] ~= nil"
  4254. text lua "characters[id].equipment[selectedSlot].abilities[1].text"
  4255. text style "label"
  4256. action "selectedAbility = 1"
  4257. }
  4258. button
  4259. {
  4260. area 22 74 52 52
  4261. bam "STONSLOT"
  4262. enabled "characters[id].equipment[selectedSlot].abilities[1] ~= nil"
  4263. icon lua "characters[id].equipment[selectedSlot].abilities[1].icon"
  4264. action "selectedAbility = 1"
  4265. }
  4266.  
  4267.  
  4268. text
  4269. {
  4270. area 22 138 496 52
  4271. text highlight lua "selectedAbility == 2"
  4272. enabled "characters[id].equipment[selectedSlot].abilities[2] ~= nil"
  4273. text lua "characters[id].equipment[selectedSlot].abilities[2].text"
  4274. text style "label"
  4275. action "selectedAbility = 2"
  4276. }
  4277. button
  4278. {
  4279. area 22 138 52 52
  4280. bam "STONSLOT"
  4281. enabled "characters[id].equipment[selectedSlot].abilities[2] ~= nil"
  4282. icon lua "characters[id].equipment[selectedSlot].abilities[2].icon"
  4283. action "selectedAbility = 2"
  4284. }
  4285.  
  4286. text
  4287. {
  4288. area 22 202 496 52
  4289. text highlight lua "selectedAbility == 3"
  4290. enabled "characters[id].equipment[selectedSlot].abilities[3] ~= nil"
  4291. text lua "characters[id].equipment[selectedSlot].abilities[3].text"
  4292. text style "label"
  4293. action "selectedAbility = 3"
  4294. }
  4295. button
  4296. {
  4297. area 22 202 52 52
  4298. bam "STONSLOT"
  4299. enabled "characters[id].equipment[selectedSlot].abilities[3] ~= nil"
  4300. icon lua "characters[id].equipment[selectedSlot].abilities[3].icon"
  4301. action "selectedAbility = 3"
  4302. }
  4303.  
  4304. label
  4305. {
  4306. area 32 397 470 158
  4307. text 11322
  4308. text style "label"
  4309. }
  4310.  
  4311. button
  4312. {
  4313. area 278 607 232 40
  4314. bam GUIBUTMT
  4315. text "DONE_BUTTON"
  4316. text style "button"
  4317. action
  4318. "
  4319. local itemNum = characters[id].equipment[selectedSlot].abilities[selectedAbility].itemNum
  4320. Infinity_SelectItemAbility(selectedAbility - 1, itemNum, characters[id].equipment[selectedSlot].id)
  4321. Infinity_PopMenu()
  4322. "
  4323. }
  4324.  
  4325. button
  4326. {
  4327. on escape
  4328. area 50 607 232 40
  4329. bam GUIBUTMT
  4330. text "CANCEL_BUTTON"
  4331. text style "button"
  4332. action
  4333. "
  4334. Infinity_PopMenu()
  4335. "
  4336. }
  4337.  
  4338. }
  4339. `
  4340. TEXT_popup_info = 0
  4341. `
  4342. menu
  4343. {
  4344. name 'POPUP_INFO'
  4345. align center center
  4346. modal
  4347. label
  4348. {
  4349. area 0 0 657 234
  4350. mosaic GUIERR6
  4351. }
  4352. label
  4353. {
  4354. area 29 21 580 126
  4355. text lua "getStringFromAmbiguousSource(TEXT_popup_info)"
  4356. text style "label"
  4357. }
  4358. button
  4359. {
  4360. area 213 170 200 40
  4361. bam GUIBUTNT
  4362. text "DONE_BUTTON"
  4363. text style "button"
  4364. action
  4365. "
  4366. Infinity_PopMenu()
  4367. "
  4368. }
  4369. }
  4370. menu
  4371. {
  4372. name 'POPUP_TWOBUTTON'
  4373. align center center
  4374. modal
  4375. label
  4376. {
  4377. area 0 0 657 234
  4378. mosaic GUIERR6
  4379. }
  4380. label
  4381. {
  4382. area 29 21 580 126
  4383. text lua "getStringFromAmbiguousSource(Popup2Button.info)"
  4384. text style "label"
  4385. text align center center
  4386. }
  4387. button
  4388. {
  4389. on escape
  4390. area 79 170 230 40
  4391. bam GUIBUTMT
  4392. text lua "t(Popup2Button.cancelText or 'CANCEL_BUTTON')"
  4393. text style "button"
  4394. action
  4395. "
  4396. Infinity_PopMenu('POPUP_TWOBUTTON')
  4397. if (Popup2Button.cancelFunc) then
  4398. Popup2Button.cancelFunc()
  4399. end
  4400. "
  4401. }
  4402. button
  4403. {
  4404. area 343 170 230 40
  4405. bam GUIBUTMT
  4406. text style "button"
  4407. text lua "t(Popup2Button.okText or 'DONE_BUTTON')"
  4408. action
  4409. "
  4410. Infinity_PopMenu('POPUP_TWOBUTTON')
  4411. if (Popup2Button.okFunc) then
  4412. Popup2Button.okFunc()
  4413. end
  4414. "
  4415. }
  4416. }
  4417.  
  4418. menu
  4419. {
  4420. name 'POPUP_THREEBUTTON'
  4421. align center center
  4422. modal
  4423. label
  4424. {
  4425. area 0 0 657 234
  4426. mosaic GUIERR6
  4427. }
  4428. label
  4429. {
  4430. area 29 21 580 126
  4431. text lua "getStringFromAmbiguousSource(Popup3Button.info)"
  4432. text style "label"
  4433. text align center center
  4434. }
  4435. button
  4436. {
  4437. area 440 170 200 40
  4438. bam GUIBUTNT
  4439. text lua "t(Popup3Button.rightText)"
  4440. text style "button"
  4441. action
  4442. "
  4443. Infinity_PopMenu()
  4444. if (Popup3Button.rightFunc) then
  4445. Popup3Button.rightFunc()
  4446. end
  4447. "
  4448. }
  4449. button
  4450. {
  4451. area 228 170 200 40
  4452. bam GUIBUTNT
  4453. text style "button"
  4454. text lua "t(Popup3Button.midText)"
  4455. action
  4456. "
  4457. Infinity_PopMenu()
  4458. if (Popup3Button.midFunc) then
  4459. Popup3Button.midFunc()
  4460. end
  4461. "
  4462. }
  4463. button
  4464. {
  4465. area 18 170 200 40
  4466. bam GUIBUTNT
  4467. text style "button"
  4468. text lua "t(Popup3Button.leftText)"
  4469. action
  4470. "
  4471. Infinity_PopMenu()
  4472. if (Popup3Button.leftFunc) then
  4473. Popup3Button.leftFunc()
  4474. end
  4475. "
  4476. }
  4477. }
  4478.  
  4479. menu
  4480. {
  4481. name 'POPUP_FOURBUTTON'
  4482. align center center
  4483. modal
  4484. label
  4485. {
  4486. area 0 0 900 234
  4487. mosaic GUIERR7
  4488. }
  4489. label
  4490. {
  4491. area 55 21 789 126
  4492. text lua "getStringFromAmbiguousSource(Popup4Button.info)"
  4493. text style "label"
  4494. text align center center
  4495. }
  4496. button
  4497. {
  4498. area 668 170 200 40
  4499. bam GUIBUTNT
  4500. text lua "t(Popup4Button.farRightText)"
  4501. text style "button"
  4502. action
  4503. "
  4504. Infinity_PopMenu()
  4505. if (Popup4Button.farRightFunc) then
  4506. Popup4Button.farRightFunc()
  4507. end
  4508. "
  4509. }
  4510. button
  4511. {
  4512. area 458 170 200 40
  4513. bam GUIBUTNT
  4514. text style "button"
  4515. text lua "t(Popup4Button.rightText)"
  4516. action
  4517. "
  4518. Infinity_PopMenu()
  4519. if (Popup4Button.rightFunc) then
  4520. Popup4Button.rightFunc()
  4521. end
  4522. "
  4523. }
  4524. button
  4525. {
  4526. area 248 170 200 40
  4527. bam GUIBUTNT
  4528. text style "button"
  4529. text lua "t(Popup4Button.leftText)"
  4530. action
  4531. "
  4532. Infinity_PopMenu()
  4533. if (Popup4Button.leftFunc) then
  4534. Popup4Button.leftFunc()
  4535. end
  4536. "
  4537. }
  4538. button
  4539. {
  4540. area 38 170 200 40
  4541. bam GUIBUTNT
  4542. text style "button"
  4543. text lua "t(Popup4Button.farLeftText)"
  4544. action
  4545. "
  4546. Infinity_PopMenu()
  4547. if (Popup4Button.farLeftFunc) then
  4548. Popup4Button.farLeftFunc()
  4549. end
  4550. "
  4551. }
  4552. }
  4553.  
  4554. menu
  4555. {
  4556. name 'ITEM_IDENTIFY'
  4557. align center center
  4558. label
  4559. {
  4560. area 0 0 657 234
  4561. mosaic GUIERR6
  4562. }
  4563. text
  4564. {
  4565. area 29 21 580 126
  4566. text 19394
  4567. text style "label"
  4568. align center center
  4569. }
  4570. button
  4571. {
  4572. area 440 170 200 40
  4573. bam GUIBUTNT
  4574. text style "button"
  4575. text "SPELL_BUTTON"
  4576.  
  4577. clickable lua "Infinity_GetSpellIdentifyEnabled(characters[id].equipment[selectedSlot].id)"
  4578. action
  4579. "
  4580. Infinity_OnSpellIdentify(characters[id].equipment[selectedSlot].id);
  4581. Infinity_PopMenu()
  4582. itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item
  4583. "
  4584. }
  4585. button
  4586. {
  4587. on escape
  4588. area 228 170 200 40
  4589. bam GUIBUTNT
  4590. text style "button"
  4591. text "CANCEL_BUTTON"
  4592. action
  4593. "
  4594. Infinity_PopMenu()
  4595. "
  4596. }
  4597. button
  4598. {
  4599. area 18 170 200 40
  4600. bam GUIBUTNT
  4601. text style "button"
  4602. text "SCROLL_BUTTON"
  4603.  
  4604. clickable lua "Infinity_GetScrollIdentifyEnabled(characters[id].equipment[selectedSlot].id)"
  4605. action
  4606. "
  4607. Infinity_OnScrollIdentify(characters[id].equipment[selectedSlot].id)
  4608. Infinity_PopMenu()
  4609. itemDesc.item = characters[id].equipment[selectedSlot].item --update itemDesc item
  4610. "
  4611. }
  4612.  
  4613.  
  4614. }
  4615. `
  4616. function showItemDescriptionInventory(slotName)
  4617. if(characters[id].equipment[slotName].empty ~= 0) then
  4618. return
  4619. end
  4620.  
  4621. selectedSlot = slotName
  4622.  
  4623. Infinity_CheckItemIdentify(characters[id].equipment[slotName].id)
  4624. showItemDescription(characters[id].equipment[slotName].item, 0)
  4625. end
  4626.  
  4627. itemDesc = {}
  4628. function showItemDescription(item, mode)
  4629. itemDesc.item = item
  4630. itemDesc.mode = mode
  4631. Infinity_PushMenu('ITEM_DESCRIPTION',0,0)
  4632. end
  4633.  
  4634. function itemDescLeftButtonEnabled()
  4635. if(itemDesc.mode == 0) then
  4636. return GetAbilityIdentifyString() ~= ""
  4637. elseif(itemDesc.mode == 1) then
  4638. return itemDesc.item.isBag
  4639. end
  4640. return 0
  4641. end
  4642. function itemDescLeftButtonText()
  4643. if(itemDesc.mode == 0) then
  4644. return GetAbilityIdentifyString()
  4645. elseif(itemDesc.mode == 1) then
  4646. return t('OPEN_CONTAINER_BUTTON')
  4647. end
  4648. return ""
  4649. end
  4650. function itemDescLeftButtonAction()
  4651. if(itemDesc.mode == 0) then
  4652. if(characters[id].equipment[selectedSlot].item.identified == 0) then
  4653. Infinity_PushMenu('ITEM_IDENTIFY',0,0)
  4654. else
  4655. Infinity_PushMenu('ITEM_ABILITIES',0,0)
  4656. end
  4657. elseif(itemDesc.mode == 1) then
  4658. storeScreen:OpenBag(itemDesc.item.res)
  4659. Infinity_PopMenu()
  4660. end
  4661. end
  4662.  
  4663. function itemDescRightButtonEnabled()
  4664. if(itemDesc.mode == 0) then
  4665. return characters[id].equipment[selectedSlot].useMode ~= -1
  4666. else
  4667. return 0
  4668. end
  4669. end
  4670. function itemDescRightButtonText()
  4671. return Infinity_GetUseButtonText(characters[id].equipment[selectedSlot].id, characters[id].equipment[selectedSlot].useMode)
  4672. end
  4673. function itemDescRightButtonAction()
  4674. Infinity_PopMenu()
  4675. Infinity_OnUseButtonClick(characters[id].equipment[selectedSlot].id, characters[id].equipment[selectedSlot].useMode)
  4676. end
  4677. `
  4678. menu
  4679. {
  4680. name 'ITEM_DESCRIPTION'
  4681. align center center
  4682. modal
  4683. label
  4684. {
  4685. area 0 0 864 710
  4686. mosaic GUIINVHI
  4687. }
  4688. label
  4689. {
  4690. area 81 11 700 44
  4691. text "ITEM_TITLE"
  4692. text style title
  4693. }
  4694. label
  4695. {
  4696. area 95 70 52 52
  4697. icon lua "itemDesc.item.icon"
  4698. }
  4699. label
  4700. {
  4701. area 282 67 300 50
  4702. text lua "itemDesc.item.name"
  4703. text align center center
  4704. text style "label"
  4705. }
  4706. text
  4707. {
  4708. area 356 182 430 351
  4709. text lua "itemDesc.item.description"
  4710. scrollbar 'GUISCRC'
  4711. text style "normal_parchment"
  4712. }
  4713. label
  4714. {
  4715. area 66 201 280 336
  4716. bam lua "itemDesc.item.descPicture"
  4717. sequence 0
  4718. frame 0
  4719. align center center
  4720. }
  4721. button
  4722. {
  4723. bam GUIBUTMT
  4724. sequence 6
  4725. area 57 653 230 40
  4726. enabled "itemDescLeftButtonEnabled()"
  4727. text lua "itemDescLeftButtonText()"
  4728. text style "button"
  4729. action
  4730. "
  4731. itemDescLeftButtonAction()
  4732. "
  4733. }
  4734. button
  4735. {
  4736. bam GUIBUTMT
  4737. sequence 6
  4738. area 328 653 230 40
  4739. text "DONE_BUTTON"
  4740. text style "button"
  4741. action
  4742. "
  4743. Infinity_PopMenu( );
  4744. "
  4745. }
  4746. button
  4747. {
  4748. bam GUIBUTMT
  4749. sequence 6
  4750. area 572 653 230 40
  4751. enabled "itemDescRightButtonEnabled()"
  4752. text lua "itemDescRightButtonText()"
  4753. text style "button"
  4754. action
  4755. "
  4756. itemDescRightButtonAction()
  4757. "
  4758. }
  4759. }
  4760. `
  4761. function highlightSidebarButton(engine)
  4762. return (engine == e:GetActiveEngine())
  4763. end
  4764. sidebarVisible =
  4765. {
  4766. LEFT = 1,
  4767. RIGHT = 1
  4768. }
  4769. function toggleSidebar(side)
  4770. local show = side .. "_SIDEBAR"
  4771. local hide = show .. "_HIDDEN"
  4772. if(sidebarVisible[side] == 1) then
  4773. local temp = show
  4774. show = hide
  4775. hide = temp
  4776. sidebarVisible[side] = 0
  4777. else
  4778. sidebarVisible[side] = 1
  4779. end
  4780. Infinity_PushMenu(show)
  4781. Infinity_PopMenu(hide)
  4782. end
  4783. sidebarForceTooltips = 0
  4784. `
  4785. menu
  4786. {
  4787. name 'LEFT_SIDEBAR'
  4788. align left top
  4789. ignoreEsc
  4790. onOpen
  4791. "
  4792. if(sidebarVisible.LEFT == 1) then
  4793. Infinity_PushMenu('LEFT_SIDEBAR_BOTTOM')
  4794. else
  4795. Infinity_PopMenu('LEFT_SIDEBAR')
  4796. Infinity_PushMenu('LEFT_SIDEBAR_HIDDEN')
  4797. end
  4798. if(showJournal == 1) then
  4799. Infinity_PushMenu('JOURNAL')
  4800. end
  4801. sidebarForceTooltips = 0
  4802. "
  4803. onClose
  4804. "
  4805. Infinity_PopMenu('LEFT_SIDEBAR_BOTTOM')
  4806. Infinity_PopMenu('JOURNAL')
  4807. "
  4808. label
  4809. {
  4810. name 'leftSidebarBackground'
  4811. area 0 0 80 1536
  4812. mosaic GUIWLSP
  4813. }
  4814. label
  4815. {
  4816.  
  4817. area 0 1536 80 1536
  4818. mosaic GUIWLSP
  4819. }
  4820. button
  4821. {
  4822. area 3 14 73 55
  4823. bam GUILS10
  4824. sequence 0
  4825. tooltip lua "getTooltipWithHotkey(2,24364)"
  4826. tooltip force lua "sidebarForceTooltips == 1"
  4827. tooltip force top
  4828. -- glow lua "highlightSidebarButton(worldScreen)"
  4829. clickable lua "sidebarsGreyed ~= 1"
  4830. action
  4831. "
  4832. e:GetActiveEngine():OnLeftPanelButtonClick(0)
  4833. "
  4834. }
  4835. button
  4836. {
  4837. area 3 69 73 55
  4838. bam GUILS10
  4839. sequence 1
  4840. tooltip lua "getTooltipWithHotkey(4,15418)"
  4841. tooltip force lua "sidebarForceTooltips == 1"
  4842. tooltip force top
  4843. glow lua "highlightSidebarButton(mapScreen)"
  4844. clickable lua "sidebarsGreyed ~= 1"
  4845. action
  4846. "
  4847. e:GetActiveEngine():OnLeftPanelButtonClick(1)
  4848. "
  4849. }
  4850. button
  4851. {
  4852. area 3 124 73 55
  4853. bam GUILS10
  4854. sequence 2
  4855. tooltip lua "getTooltipWithHotkey(3,24359)"
  4856. tooltip force lua "sidebarForceTooltips == 1"
  4857. tooltip force top
  4858. glow lua "showJournal == 1"
  4859. clickable lua "sidebarsGreyed ~= 1 and game:GetJournalOpenable()"
  4860. action
  4861. "
  4862. e:GetActiveEngine():OnLeftPanelButtonClick(2)
  4863. "
  4864. }
  4865. button
  4866. {
  4867. area 3 179 73 55
  4868. bam GUILS10
  4869. sequence 3
  4870. tooltip lua "getTooltipWithHotkey(0,24358)"
  4871. tooltip force lua "sidebarForceTooltips == 1"
  4872. tooltip force top
  4873. glow lua "highlightSidebarButton(inventoryScreen)"
  4874. clickable lua "sidebarsGreyed ~= 1"
  4875. action
  4876. "
  4877. e:GetActiveEngine():OnLeftPanelButtonClick(3)
  4878. "
  4879. }
  4880. button
  4881. {
  4882. area 3 234 73 55
  4883. bam GUILS10
  4884. sequence 4
  4885. tooltip lua "getTooltipWithHotkey(1,24356)"
  4886. tooltip force lua "sidebarForceTooltips == 1"
  4887. tooltip force top
  4888. glow lua "highlightSidebarButton(characterScreen)"
  4889. clickable lua "sidebarsGreyed ~= 1"
  4890. action
  4891. "
  4892. e:GetActiveEngine():OnLeftPanelButtonClick(4)
  4893. "
  4894. }
  4895. button
  4896. {
  4897. area 3 289 73 55
  4898. bam GUILS10
  4899. sequence 5
  4900. tooltip lua "getTooltipWithHotkey(5,24360)"
  4901. tooltip force lua "sidebarForceTooltips == 1"
  4902. tooltip force top
  4903. glow lua "highlightSidebarButton(mageScreen)"
  4904. clickable lua "sidebarsGreyed ~= 1"
  4905. action
  4906. "
  4907. e:GetActiveEngine():OnLeftPanelButtonClick(5)
  4908. "
  4909. }
  4910. button
  4911. {
  4912. area 3 344 73 55
  4913. bam GUILS10
  4914. sequence 6
  4915. tooltip lua "getTooltipWithHotkey(6,24357)"
  4916. tooltip force lua "sidebarForceTooltips == 1"
  4917. tooltip force top
  4918. glow lua "highlightSidebarButton(priestScreen)"
  4919. clickable lua "sidebarsGreyed ~= 1"
  4920. action
  4921. "
  4922. e:GetActiveEngine():OnLeftPanelButtonClick(6)
  4923. "
  4924. }
  4925. button
  4926. {
  4927. area 3 399 73 55
  4928. bam GUILS10
  4929. sequence 7
  4930. tooltip lua "getTooltipWithHotkey(7,24362)"
  4931. tooltip force lua "sidebarForceTooltips == 1"
  4932. tooltip force top
  4933. glow lua "highlightSidebarButton(optionsScreen)"
  4934. clickable lua "sidebarsGreyed ~= 1"
  4935. action
  4936. "
  4937. e:GetActiveEngine():OnLeftPanelButtonClick(7)
  4938. "
  4939. }
  4940. button
  4941. {
  4942. area 3 454 73 55
  4943. enabled "e:IsMultiplayer()"
  4944. bam GUILS10
  4945. sequence 8
  4946. tooltip lua "getTooltipWithHotkey(8,24363)"
  4947. tooltip force lua "sidebarForceTooltips == 1"
  4948. tooltip force top
  4949. glow lua "highlightSidebarButton(multiplayerScreen)"
  4950. clickable lua "sidebarsGreyed ~= 1"
  4951. action
  4952. "
  4953. e:GetActiveEngine():OnLeftPanelButtonClick(8)
  4954. "
  4955. }
  4956.  
  4957. button
  4958. {
  4959. area 6 0 67 16
  4960. bam GUIPNL10
  4961. action
  4962. "
  4963. toggleSidebar('LEFT')
  4964. "
  4965. }
  4966. }
  4967. menu
  4968. {
  4969. name 'LEFT_SIDEBAR_BOTTOM'
  4970. align left bottom
  4971. offset 0 -22
  4972. --combined height of these buttons makes a menu with height = 231, menu is placed into lower left. y pos is offset from top of this menu.
  4973. ignoreEsc
  4974. button
  4975. {
  4976. area 3 0 73 55
  4977. enabled "worldScreen == e:GetActiveEngine()"
  4978. bam GUILS10
  4979. sequence 15
  4980. tooltip lua "getTooltipWithHotkey(28,31813)"
  4981. tooltip force lua "sidebarForceTooltips == 1"
  4982. tooltip force top
  4983. clickable lua "sidebarsGreyed ~= 1"
  4984. action
  4985. "
  4986. worldScreen:OnQuickSaveButtonClick(false)
  4987. "
  4988. actionAlt
  4989. "
  4990. worldScreen:OnQuickSaveButtonClick(true)
  4991. "
  4992. }
  4993. button
  4994. {
  4995. area 3 56 73 55
  4996. enabled "worldScreen == e:GetActiveEngine()"
  4997. bam GUILS10
  4998. sequence 16
  4999. tooltip lua "Infinity_FetchString(31827)" --"getTooltipWithHotkey(16,31827)"
  5000. tooltip force lua "sidebarForceTooltips == 1"
  5001. tooltip force top
  5002. clickable lua "sidebarsGreyed ~= 1"
  5003. action
  5004. "
  5005. Infinity_PushMenu('HELP')
  5006. "
  5007. }
  5008. button
  5009. {
  5010. area 3 110 73 55
  5011. bam GUILS10
  5012. sequence 9
  5013. tooltip lua "getTooltipWithHotkey(31,11942)"
  5014. tooltip force lua "sidebarForceTooltips == 1"
  5015. tooltip force top
  5016. clickable lua "sidebarsGreyed ~= 1"
  5017. action
  5018. "
  5019. e:GetActiveEngine():OnRestButtonClick()
  5020. "
  5021. }
  5022.  
  5023.  
  5024. --begin clock
  5025. label
  5026. {
  5027. enabled "worldScreen == e:GetActiveEngine()"
  5028. area 0 182 73 55
  5029. bam "CGEAR"
  5030. frame lua "timer:GetCurrentTime() % 24"
  5031. useOverlayTint "worldScreen:CheckIfPaused()"
  5032. overlayTint 180 180 180
  5033. }
  5034. label
  5035. {
  5036. enabled "worldScreen == e:GetActiveEngine()"
  5037. area 0 182 73 55
  5038. bam "CDIAL"
  5039. frame lua "timer:GetCurrentHour() % timer.TIMESCALE_HOUR_PER_DAY"
  5040. useOverlayTint "worldScreen:CheckIfPaused()"
  5041. overlayTint 180 180 180
  5042. }
  5043. label
  5044. {
  5045. enabled "worldScreen == e:GetActiveEngine()"
  5046. area 0 182 73 55
  5047. bam "CPEN"
  5048. frame lua "timer:GetCurrentTime() % 24"
  5049. useOverlayTint "worldScreen:CheckIfPaused()"
  5050. overlayTint 180 180 180
  5051. }
  5052. button
  5053. {
  5054. enabled "worldScreen == e:GetActiveEngine()"
  5055. area 0 182 73 55
  5056. tooltip lua "worldScreen:GetCurrentTimeString()"
  5057. tooltip force lua "sidebarForceTooltips == 1"
  5058. tooltip force top
  5059. clickable lua "sidebarsGreyed ~= 1"
  5060. action
  5061. "
  5062. worldScreen:TogglePauseGame(true)
  5063. "
  5064. }
  5065. --end clock
  5066. label
  5067. {
  5068. --area is preset
  5069. enabled "gameOptions.m_bRenderFrameTimes"
  5070. frameTimes
  5071. }
  5072. }
  5073. menu
  5074. {
  5075. name 'LEFT_SIDEBAR_HIDDEN'
  5076. align left top
  5077. ignoreEsc
  5078. button
  5079. {
  5080. area 6 0 67 16
  5081. bam GUIPNL10
  5082. action
  5083. "
  5084. toggleSidebar('LEFT')
  5085. "
  5086. }
  5087. }
  5088. `
  5089. mouseOverPortrait = -1
  5090. draggedPortrait = nil
  5091. function swapPortraits(dest)
  5092. worldScreen:SwapPortraits(dest,draggedPortrait)
  5093. draggedPortrait = nil
  5094. end
  5095.  
  5096. function getPartyAITooltip()
  5097. if aiButtonToggle == 1 then
  5098. return Infinity_FetchString(15918)
  5099. else
  5100. return Infinity_FetchString(15917)
  5101. end
  5102. end
  5103. `
  5104. menu
  5105. {
  5106. name 'RIGHT_SIDEBAR'
  5107. align right top
  5108. ignoreEsc
  5109. onOpen
  5110. "
  5111. if(sidebarVisible.RIGHT == 1) then
  5112. Infinity_PushMenu('RIGHT_SIDEBAR_BOTTOM')
  5113. else
  5114. Infinity_PopMenu('RIGHT_SIDEBAR')
  5115. Infinity_PushMenu('RIGHT_SIDEBAR_HIDDEN')
  5116. end
  5117. if(worldScreen == e:GetActiveEngine() and game:GetPartyAI()) then aiButtonToggle = 1 end
  5118. if(worldScreen == e:GetActiveEngine()) then Infinity_PushMenu('WORLD_LEVEL_UP_BUTTONS') end
  5119. "
  5120. onClose
  5121. "
  5122. Infinity_PopMenu('RIGHT_SIDEBAR_BOTTOM')
  5123. Infinity_PopMenu('WORLD_LEVEL_UP_BUTTONS')
  5124. "
  5125. label
  5126. {
  5127. name 'rightSidebarBackground'
  5128. area 0 0 80 1536
  5129. mosaic GUIWRSP
  5130. }
  5131. label
  5132. {
  5133. area 0 1536 80 1536
  5134. mosaic GUIWRSP
  5135. }
  5136. button
  5137. {
  5138. area 11 14 64 90
  5139. portrait 0
  5140. bam GUIRSP10
  5141. enabled "Infinity_GetNumCharacters() > 0"
  5142. glow lua "draggedPortrait and draggedPortrait ~= 0"
  5143. action "Infinity_OnPortraitLClick(0)"
  5144. actionAlt "Infinity_OnPortraitRClick(0)"
  5145. actionDbl "Infinity_OnPortraitDblClick(0)"
  5146. actiondrag "Infinity_SwapWithPortrait(0)"
  5147. actionEnter "mouseOverPortrait = 0"
  5148. actionExit "mouseOverPortrait = -1"
  5149. actionSimpleDrag "draggedPortrait = 0"
  5150. actionSimpleDrop "swapPortraits(0)"
  5151. tooltip lua "Infinity_GetPortraitTooltip(0)"
  5152. clickable lua "sidebarsGreyed ~= 1"
  5153. }
  5154. button
  5155. {
  5156. area 11 106 64 90
  5157. portrait 1
  5158. bam GUIRSP10
  5159. enabled "Infinity_GetNumCharacters() > 1"
  5160. glow lua "draggedPortrait and draggedPortrait ~= 1"
  5161. action "Infinity_OnPortraitLClick(1)"
  5162. actionAlt "Infinity_OnPortraitRClick(1)"
  5163. actionDbl "Infinity_OnPortraitDblClick(1)"
  5164. actiondrag "Infinity_SwapWithPortrait(1)"
  5165. actionEnter "mouseOverPortrait = 1"
  5166. actionExit "mouseOverPortrait = -1"
  5167. actionSimpleDrag "draggedPortrait = 1"
  5168. actionSimpleDrop "swapPortraits(1)"
  5169. tooltip lua "Infinity_GetPortraitTooltip(1)"
  5170. clickable lua "sidebarsGreyed ~= 1"
  5171. }
  5172. button
  5173. {
  5174. area 11 198 64 90
  5175. portrait 2
  5176. bam GUIRSP10
  5177. enabled "Infinity_GetNumCharacters() > 2"
  5178. glow lua "draggedPortrait and draggedPortrait ~= 2"
  5179. action "Infinity_OnPortraitLClick(2)"
  5180. actionAlt "Infinity_OnPortraitRClick(2)"
  5181. actionDbl "Infinity_OnPortraitDblClick(2)"
  5182. actiondrag "Infinity_SwapWithPortrait(2)"
  5183. actionEnter "mouseOverPortrait = 2"
  5184. actionExit "mouseOverPortrait = -1"
  5185. actionSimpleDrag "draggedPortrait = 2"
  5186. actionSimpleDrop "swapPortraits(2)"
  5187. tooltip lua "Infinity_GetPortraitTooltip(2)"
  5188. clickable lua "sidebarsGreyed ~= 1"
  5189. }
  5190. button
  5191. {
  5192. area 11 290 64 90
  5193. portrait 3
  5194. bam GUIRSP10
  5195. enabled "Infinity_GetNumCharacters() > 3"
  5196. glow lua "draggedPortrait and draggedPortrait ~= 3"
  5197. action "Infinity_OnPortraitLClick(3)"
  5198. actionAlt "Infinity_OnPortraitRClick(3)"
  5199. actionDbl "Infinity_OnPortraitDblClick(3)"
  5200. actiondrag "Infinity_SwapWithPortrait(3)"
  5201. actionEnter "mouseOverPortrait = 3"
  5202. actionExit "mouseOverPortrait = -1"
  5203. actionSimpleDrag "draggedPortrait = 3"
  5204. actionSimpleDrop "swapPortraits(3)"
  5205. tooltip lua "Infinity_GetPortraitTooltip(3)"
  5206. clickable lua "sidebarsGreyed ~= 1"
  5207. }
  5208. button
  5209. {
  5210. area 11 382 64 90
  5211. portrait 4
  5212. bam GUIRSP10
  5213. enabled "Infinity_GetNumCharacters() > 4"
  5214. glow lua "draggedPortrait and draggedPortrait ~= 4"
  5215. action "Infinity_OnPortraitLClick(4)"
  5216. actionAlt "Infinity_OnPortraitRClick(4)"
  5217. actionDbl "Infinity_OnPortraitDblClick(4)"
  5218. actiondrag "Infinity_SwapWithPortrait(4)"
  5219. actionEnter "mouseOverPortrait = 4"
  5220. actionExit "mouseOverPortrait = -1"
  5221. actionSimpleDrag "draggedPortrait = 4"
  5222. actionSimpleDrop "swapPortraits(4)"
  5223. tooltip lua "Infinity_GetPortraitTooltip(4)"
  5224. clickable lua "sidebarsGreyed ~= 1"
  5225. }
  5226. button
  5227. {
  5228. area 11 474 64 90
  5229. portrait 5
  5230. bam GUIRSP10
  5231. enabled "Infinity_GetNumCharacters() > 5"
  5232. glow lua "draggedPortrait and draggedPortrait ~= 5"
  5233. action "Infinity_OnPortraitLClick(5)"
  5234. actionAlt "Infinity_OnPortraitRClick(5)"
  5235. actionDbl "Infinity_OnPortraitDblClick(5)"
  5236. actiondrag "Infinity_SwapWithPortrait(5)"
  5237. actionEnter "mouseOverPortrait = 5"
  5238. actionExit "mouseOverPortrait = -1"
  5239. actionSimpleDrag "draggedPortrait = 5"
  5240. actionSimpleDrop "swapPortraits(5)"
  5241. tooltip lua "Infinity_GetPortraitTooltip(5)"
  5242. clickable lua "sidebarsGreyed ~= 1"
  5243. }
  5244. button
  5245. {
  5246. area 10 0 67 16
  5247. bam GUIPNL10
  5248. action
  5249. "
  5250. toggleSidebar('RIGHT')
  5251. "
  5252. }
  5253. }
  5254. menu
  5255. {
  5256. name 'RIGHT_SIDEBAR_BOTTOM'
  5257. align right bottom
  5258. ignoreEsc
  5259. --Buttons form a menu aligned bottom right, with height = 197, y is offset from top of that menu.
  5260. button
  5261. {
  5262. area 6 0 71 48
  5263. enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine()"
  5264. toggle selectionButtonToggle
  5265. bam GUILS10
  5266. sequence 14
  5267. clickable lua "sidebarsGreyed ~= 1"
  5268. action
  5269. "
  5270. worldScreen:OnSelectionButtonClick()
  5271. "
  5272. }
  5273. button
  5274. {
  5275. area 6 49 71 48
  5276. enabled "worldScreen == e:GetActiveEngine()"
  5277. toggle highlightButtonToggle
  5278. tooltip lua "Infinity_FetchString(32729)"
  5279. bam GUILS10
  5280. sequence 11
  5281. clickable lua "sidebarsGreyed ~= 1"
  5282. action
  5283. "
  5284. worldScreen:SetHighlightEnabled(highlightButtonToggle == 1)
  5285. "
  5286. }
  5287. button
  5288. {
  5289. area 6 99 71 48
  5290. enabled "worldScreen == e:GetActiveEngine()"
  5291. tooltip lua "getPartyAITooltip()"
  5292. toggle aiButtonToggle
  5293. bam GUILS10
  5294. sequence 10
  5295. clickable lua "sidebarsGreyed ~= 1"
  5296. action
  5297. "
  5298. game:ToggleAI()
  5299. "
  5300. }
  5301. button
  5302. {
  5303. area 6 149 71 48
  5304. enabled "worldScreen == e:GetActiveEngine()"
  5305. tooltip lua "Infinity_FetchString(10485)"
  5306. bam GUILS10
  5307. sequence 13
  5308. clickable lua "sidebarsGreyed ~= 1"
  5309. action
  5310. "
  5311. game:SelectAll()
  5312. "
  5313. actionDbl
  5314. "
  5315. game:CenterOnGroupLeader()
  5316. "
  5317. }
  5318. }
  5319. menu
  5320. {
  5321. name 'RIGHT_SIDEBAR_HIDDEN'
  5322. align right top
  5323. ignoreEsc
  5324. button
  5325. {
  5326. area 10 0 67 16
  5327. bam GUIPNL10
  5328. action
  5329. "
  5330. toggleSidebar('RIGHT')
  5331. "
  5332. }
  5333. }
  5334. `
  5335. TEXT_inventoryError = ""
  5336.  
  5337. function resetStatsDisplay()
  5338. tempStats = {}
  5339. end
  5340. function getTempDamage()
  5341. local str = ""
  5342. local dmgMinTemp = getTempStat(characters[id].damage.min,'dmgMin',1)
  5343. local dmgMaxTemp = getTempStat(characters[id].damage.max,'dmgMax',1)
  5344. if(dmgMinTemp == "-" and dmgMaxTemp == "-") then
  5345. return "-"
  5346. end
  5347. if(dmgMinTemp == "-") then
  5348. str = characters[id].damage.min
  5349. else
  5350. str = dmgMinTemp
  5351. end
  5352. str = str .. " - "
  5353. if(dmgMaxTemp == "-") then
  5354. str = str .. characters[id].damage.max
  5355. else
  5356. str = str .. dmgMaxTemp
  5357. end
  5358.  
  5359. return str
  5360. end
  5361. function getStat(old, newName, coeff)
  5362. return old
  5363. end
  5364. function getTempStat(old, newName, coeff)
  5365. if(tempStats[id] == nil) then
  5366. return "-"
  5367. end
  5368. local new = tempStats[id][newName]
  5369. local score = coeff * (new - old)
  5370. if(score == 0) then
  5371. return "-"
  5372. end
  5373. if(score < 0) then
  5374. return "^R" .. new .. "^-"
  5375. end
  5376. if(score > 0) then
  5377. return "^G" .. new .. "^-"
  5378. end
  5379. end
  5380. function getStatsTitle()
  5381. if(tempStats[id] ~= nil) then
  5382. return tempStats[id].tempItem
  5383. else
  5384. return ""
  5385. end
  5386. end
  5387. function slotDoubleClick(slotName, force)
  5388. local slot = characters[id].equipment[slotName]
  5389.  
  5390. if(string.sub(slotName,1,6) == "ground" and force == nil) then
  5391. --this hack is needed because the unlike other slots, ground item add/remove is a message (doesnt get executed immediately)
  5392. --since the double click removes the item before re-adding it, we need to wait for that re-add to complete before continuing.
  5393. doubleClickEventScheduled = slotName
  5394. return
  5395. end
  5396.  
  5397. if(slot ~= nil) then
  5398. if(slot.item.isBag ~= 0) then
  5399. Infinity_OpenInventoryContainer(slot.item.res)
  5400. else
  5401. showItemAmountRequester(slotName)
  5402. end
  5403. end
  5404. end
  5405. function checkDoubleClickScheduled(slotName)
  5406. if(doubleClickEventScheduled == slotName) then
  5407. slotDoubleClick(doubleClickEventScheduled, true)
  5408. doubleClickEventScheduled = nil
  5409. end
  5410. end
  5411. function checkDoubleClickScheduled(slotName)
  5412. if(doubleClickEventScheduled == slotName) then
  5413. slotDoubleClick(doubleClickEventScheduled, true)
  5414. doubleClickEventScheduled = nil
  5415. end
  5416. end
  5417. function getTempHP()
  5418. local maxHP = getTempStat(characters[id].HP.max,'maxHP',1)
  5419. local currentHP = getTempStat(characters[id].HP.current, 'currentHP',1)
  5420. if(maxHP == "-" and currentHP == "-") then
  5421. --nothing changed.
  5422. return "-"
  5423. end
  5424. if(maxHP == "-") then
  5425. --only current HP changed.
  5426. maxHP = characters[id].HP.max
  5427. end
  5428. if(currentHP == "-") then
  5429. --only max HP changed.
  5430. currentHP = characters[id].HP.current
  5431. end
  5432.  
  5433. return currentHP .. '/' .. maxHP
  5434. end
  5435. function shouldGreyOutInventory()
  5436. return characters[id].HP.current <= 0 or inventoryScreen:IsSpriteOrderable() == false
  5437. end
  5438. function getInventoryTHAC0()
  5439. local str = characters[id].THAC0.current
  5440. if(characters[id].THAC0.offhand) then
  5441. str = str .. "\n" .. characters[id].THAC0.offhand
  5442. end
  5443. return str
  5444. end
  5445. function getInventoryDamage()
  5446. local str = characters[id].damage.min .. ' - ' .. characters[id].damage.max
  5447. if(characters[id].damage.minOffhand and characters[id].damage.maxOffhand) then
  5448. str = str .. "\n" .. characters[id].damage.minOffhand .. ' - ' .. characters[id].damage.maxOffhand
  5449. end
  5450. return str
  5451. end
  5452. function getInventoryDamageDetails()
  5453. if characters[id].damage.detailsOffhand == nil or characters[id].damage.detailsOffhand == "" then
  5454. return characters[id].damage.details
  5455. else
  5456. return characters[id].damage.details.."\n\n"..characters[id].damage.detailsOffhand
  5457. end
  5458. end
  5459. function getInventoryTHAC0Details()
  5460. if characters[id].THAC0.detailsOffhand == nil or characters[id].THAC0.detailsOffhand == "" then
  5461. return characters[id].THAC0.details
  5462. else
  5463. return characters[id].THAC0.details.."\n\n"..characters[id].THAC0.detailsOffhand
  5464. end
  5465. end
  5466. function scrollGroundItems()
  5467. if scrollDirection > 0 then
  5468. Infinity_OnGroundPage(-1)
  5469. elseif scrollDirection < 0 then
  5470. Infinity_OnGroundPage(1)
  5471. end
  5472. end
  5473. `
  5474. menu
  5475. {
  5476. name 'INVENTORY'
  5477. align center center
  5478. ignoreEsc
  5479.  
  5480. onOpen
  5481. "
  5482. Infinity_ActivateInventory()
  5483. pushSidebars()
  5484. doubleClickEventScheduled = nil
  5485. "
  5486. onClose
  5487. "
  5488. Infinity_PopMenu('CHARACTER_COLOR')
  5489. Infinity_PopMenu('ITEM_DESCRIPTION')
  5490. Infinity_PopMenu('ITEM_IDENTIFY')
  5491. popSidebars()
  5492. "
  5493. label
  5494. {
  5495. area 0 0 864 710
  5496. mosaic INVENTOR
  5497. }
  5498.  
  5499. label
  5500. {
  5501. area 524 50 330 56
  5502. text lua "getStatsTitle()"
  5503. text style "label"
  5504. text color 'D'
  5505. }
  5506.  
  5507. label
  5508. {
  5509. enabled "tempStats[id] ~= nil"
  5510. area 674 110 84 28
  5511. text "CURRENT_LABEL"
  5512. text style "label"
  5513. text color 'D'
  5514. text point 10
  5515. }
  5516. label
  5517. {
  5518. enabled "tempStats[id] ~= nil"
  5519. area 758 110 84 28
  5520. text "NEW_LABEL"
  5521. text style "label"
  5522. text color 'D'
  5523. text point 10
  5524. }
  5525. text
  5526. {
  5527. area 534 148 134 58
  5528. text "ARMOR_CLASS_LABEL"
  5529. text style "label"
  5530. enabled "tempStats[id] ~= nil"
  5531. tooltip lua "characters[id].AC.details"
  5532. text align left center
  5533. }
  5534. label
  5535. {
  5536. area 674 143 84 63
  5537. text lua "getStat(characters[id].AC.current,'AC',-1)"
  5538. text style "label"
  5539. align center center
  5540. }
  5541. label
  5542. {
  5543. enabled "tempStats[id] ~= nil"
  5544. area 762 143 80 63
  5545. text lua "getTempStat(characters[id].AC.current,'AC',-1)"
  5546. text style "label"
  5547. align center center
  5548. }
  5549.  
  5550. text
  5551. {
  5552. area 534 216 134 76
  5553. text "HIT_POINTS_LABEL"
  5554. text style "label"
  5555. enabled "tempStats[id] ~= nil"
  5556. tooltip lua "characters[id].HP.details"
  5557. text align left center
  5558. }
  5559. label
  5560. {
  5561. area 674 216 84 71
  5562. text lua "characters[id].HP.current .. '/' .. getStat(characters[id].HP.max, 'HP', 1) "
  5563. text style "label"
  5564. align center center
  5565. }
  5566. label
  5567. {
  5568. enabled "tempStats[id] ~= nil"
  5569. area 762 216 80 71
  5570. text lua "getTempHP()"
  5571. text style "label"
  5572. align center center
  5573. }
  5574.  
  5575. text
  5576. {
  5577. area 534 290 134 74
  5578. text "THAC0_LABEL"
  5579. text style "label"
  5580. enabled "tempStats[id] ~= nil"
  5581. tooltip lua "characters[id].THAC0.details"
  5582. text align left center
  5583. }
  5584. label
  5585. {
  5586. area 674 290 84 77
  5587. text lua "getStat(characters[id].THAC0.current,'THAC0', -1)"
  5588. text style "label"
  5589. align center center
  5590. }
  5591. label
  5592. {
  5593. enabled "tempStats[id] ~= nil"
  5594. area 762 290 80 77
  5595. text lua "getTempStat(characters[id].THAC0.current,'THAC0',-1)"
  5596. text style "label"
  5597. align center center
  5598. }
  5599.  
  5600. text
  5601. {
  5602. area 534 367 134 70
  5603. text "DAMAGE_LABEL"
  5604. text style "label"
  5605. enabled "tempStats[id] ~= nil"
  5606. tooltip lua "characters[id].damage.details"
  5607. text align left center
  5608. }
  5609. label
  5610. {
  5611. area 674 367 84 70
  5612. text lua "getStat(characters[id].damage.min,'dmgMin',1) .. ' - ' .. getStat(characters[id].damage.max, 'dmgMax', 1)"
  5613. text style "label"
  5614. align center center
  5615. }
  5616. label
  5617. {
  5618. enabled "tempStats[id] ~= nil"
  5619. area 762 367 80 70
  5620. text lua "getTempDamage()"
  5621. text style "label"
  5622. align center center
  5623. }
  5624.  
  5625. --stat details begin
  5626. label
  5627. {
  5628. enabled "tempStats[id] == nil"
  5629. area 509 40 355 461
  5630. mosaic "INVSTATS"
  5631. }
  5632. label
  5633. {
  5634. enabled "tempStats[id] == nil"
  5635. area 534 82 38 40
  5636. text lua "characters[id].AC.current"
  5637. text style "label"
  5638. align center center
  5639. }
  5640. text
  5641. {
  5642. enabled "tempStats[id] == nil"
  5643. area 598 55 244 95
  5644. text lua "characters[id].AC.details"
  5645. text style "normal"
  5646. scrollbar 'GUISCRC'
  5647. }
  5648. label
  5649. {
  5650. enabled "tempStats[id] == nil"
  5651. area 534 194 38 42
  5652. text lua "characters[id].HP.current .. '/' .. characters[id].HP.max"
  5653. text style "label"
  5654. align center center
  5655. }
  5656. text
  5657. {
  5658. enabled "tempStats[id] == nil"
  5659. area 598 160 244 104
  5660. text lua "characters[id].HP.details"
  5661. text style "normal"
  5662. scrollbar 'GUISCRC'
  5663. }
  5664.  
  5665. label
  5666. {
  5667. enabled "tempStats[id] == nil"
  5668. area 538 312 34 35
  5669. text lua "getInventoryTHAC0()"
  5670. text style "label"
  5671. align center center
  5672. }
  5673. text
  5674. {
  5675. enabled "tempStats[id] == nil"
  5676. area 598 272 244 106
  5677. text lua "getInventoryTHAC0Details()"
  5678. text style "normal"
  5679. scrollbar 'GUISCRC'
  5680. }
  5681.  
  5682. label
  5683. {
  5684. enabled "tempStats[id] == nil"
  5685. area 534 424 44 38
  5686. text lua "getInventoryDamage()"
  5687. text style "label"
  5688. align center center
  5689. }
  5690. text
  5691. {
  5692. enabled "tempStats[id] == nil"
  5693. area 598 386 244 98
  5694. text lua "getInventoryDamageDetails()"
  5695. text style "normal"
  5696. scrollbar 'GUISCRC'
  5697. }
  5698.  
  5699. --stat details end
  5700.  
  5701. button
  5702. {
  5703. area 299 177 128 160
  5704. paperdoll 1
  5705. actiondrag "Infinity_SwapWithAppearance()"
  5706. }
  5707.  
  5708. button
  5709. {
  5710. area 13 570 68 100
  5711. encumbrance
  5712. }
  5713.  
  5714. label
  5715. {
  5716. area 84 55 210 32
  5717. text lua "characters[id].name"
  5718. text style "label"
  5719. }
  5720. label
  5721. {
  5722. area 82 6 700 44
  5723. text "INVENTORY_TITLE"
  5724. text style "title"
  5725. }
  5726. label
  5727. {
  5728. area 29 201 200 30
  5729. text "QUICK_WEAPONS_LABEL"
  5730. text style "label"
  5731. }
  5732. label
  5733. {
  5734. area 29 306 162 30
  5735. text "QUICK_ITEMS_LABEL"
  5736. text style "label"
  5737. }
  5738. label
  5739. {
  5740. area 83 98 150 28
  5741. text "QUIVER_LABEL"
  5742. text style "label"
  5743. }
  5744. label
  5745. {
  5746. area 612 531 83 24
  5747. text "GROUND_LABEL"
  5748. text style "label"
  5749. align left center
  5750. }
  5751. label
  5752. {
  5753. area 695 531 75 24
  5754. text lua "Infinity_GetCurrentGroundPage()+1 .. '/' .. Infinity_GetMaxGroundPage()+1"
  5755. text style "label"
  5756. align right center
  5757. }
  5758. label
  5759. {
  5760. area 390 473 112 23
  5761. text lua "characters[id].gold"
  5762. text style "label"
  5763. }
  5764. label
  5765. {
  5766. area 302 55 210 32
  5767. text lua "characters[id].class"
  5768. text style "label"
  5769. }
  5770. text
  5771. {
  5772. area 32 436 290 52
  5773. text lua "TEXT_inventoryError"
  5774. scrollbar 'GUISCRC'
  5775. text style normal
  5776. }
  5777.  
  5778.  
  5779. slot {name "slot_inv_1" area 26 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon0" }
  5780. slot {name "slot_inv_2" area 78 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon1" }
  5781. slot {name "slot_inv_3" area 130 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon2" }
  5782. slot {name "slot_inv_4" area 182 243 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.weapon3" }
  5783.  
  5784. slot {name "slot_inv_5" area 26 347 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.personal0" }
  5785. slot {name "slot_inv_6" area 78 347 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.personal1" }
  5786. slot {name "slot_inv_7" area 130 347 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.personal2" }
  5787.  
  5788. slot {name "slot_inv_11" area 242 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.armor" }
  5789. slot {name "slot_inv_12" area 294 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.gauntlets" }
  5790. slot {name "slot_inv_13" area 346 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.helmet" }
  5791. slot {name "slot_inv_14" area 398 98 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.amulet" }
  5792. slot {name "slot_inv_15" area 78 138 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.quiver0" }
  5793. slot {name "slot_inv_16" area 130 138 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.quiver1" }
  5794. slot {name "slot_inv_17" area 182 138 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.quiver2" }
  5795. slot {name "slot_inv_21" area 393 361 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.belt" }
  5796. slot {name "slot_inv_22" area 218 302 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ringleft" }
  5797. slot {name "slot_inv_23" area 462 302 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ringright" }
  5798. slot {name "slot_inv_24" area 282 361 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.cloak" }
  5799. slot {name "slot_inv_25" area 338 361 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.boots" }
  5800. slot {name "slot_inv_26" area 461 244 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.shield" }
  5801.  
  5802. slot {name "slot_inv_30" area 87 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group0" }
  5803. slot {name "slot_inv_31" area 87 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group1" }
  5804. slot {name "slot_inv_32" area 140 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group2" }
  5805. slot {name "slot_inv_33" area 140 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group3" }
  5806. slot {name "slot_inv_34" area 193 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group4" }
  5807. slot {name "slot_inv_35" area 193 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group5" }
  5808. slot {name "slot_inv_36" area 246 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group6" }
  5809. slot {name "slot_inv_37" area 246 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group7" }
  5810. slot {name "slot_inv_38" area 299 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group8" }
  5811. slot {name "slot_inv_39" area 299 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group9" }
  5812. slot {name "slot_inv_40" area 352 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group10" }
  5813. slot {name "slot_inv_41" area 352 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group11" }
  5814. slot {name "slot_inv_42" area 405 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group12" }
  5815. slot {name "slot_inv_43" area 405 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group13" }
  5816. slot {name "slot_inv_44" area 458 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group14" }
  5817. slot {name "slot_inv_45" area 458 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.group15" }
  5818.  
  5819. button
  5820. {
  5821. area 587 571 215 108
  5822. actionScroll "scrollGroundItems()"
  5823. }
  5824.  
  5825. slot {name "slot_inv_68" area 587 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground0" actionScroll "scrollGroundItems()" }
  5826. slot {name "slot_inv_69" area 641 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground1" actionScroll "scrollGroundItems()" }
  5827. slot {name "slot_inv_70" area 695 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground2" actionScroll "scrollGroundItems()" }
  5828. slot {name "slot_inv_71" area 750 571 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground3" actionScroll "scrollGroundItems()" }
  5829. slot {name "slot_inv_72" area 587 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground4" actionScroll "scrollGroundItems()" }
  5830. slot {name "slot_inv_73" area 641 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground5" actionScroll "scrollGroundItems()" }
  5831. slot {name "slot_inv_74" area 695 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground6" actionScroll "scrollGroundItems()" }
  5832. slot {name "slot_inv_75" area 750 626 52 52 bam "STONSLOT" slotinfo "characters[id].equipment.ground7" actionScroll "scrollGroundItems()" }
  5833.  
  5834. button
  5835. {
  5836. area 802 590 40 61
  5837. bam GUIPRC
  5838. sequence 2
  5839. action
  5840. "
  5841. Infinity_OnGroundPage(1)
  5842. "
  5843. }
  5844. button
  5845. {
  5846. area 547 590 40 61
  5847. bam GUIPRC
  5848. sequence 3
  5849. action
  5850. "
  5851. Infinity_OnGroundPage(-1)
  5852. "
  5853. }
  5854. button
  5855. {
  5856. area 458 98 50 52
  5857. bam INVBUT
  5858. colordisplay 1
  5859. action
  5860. "
  5861. Infinity_PushMenu('CHARACTER_COLOR', 0, 0)
  5862. "
  5863. }
  5864. label --this has to be last so it draws over top of everything.
  5865. {
  5866. area 0 0 864 710
  5867. enabled "shouldGreyOutInventory()"
  5868. rectangle 0
  5869. rectangle opacity 200
  5870. }
  5871. }
  5872. `
  5873. SLIDER_color_hair_start = 1
  5874. SLIDER_color_skin_start = 1
  5875. SLIDER_color_major_start = 1
  5876. SLIDER_color_minor_start = 1
  5877.  
  5878. SLIDER_color_hair = 1
  5879. SLIDER_color_skin = 1
  5880. SLIDER_color_major = 1
  5881. SLIDER_color_minor = 1
  5882. `
  5883. menu
  5884. {
  5885. name 'CHARACTER_COLOR'
  5886. align center center
  5887. ignoreesc
  5888. modal
  5889.  
  5890. onOpen
  5891. "
  5892. Infinity_UpdateLuaStats()
  5893.  
  5894. SLIDER_color_hair = characters[id].colors.hair
  5895. SLIDER_color_skin = characters[id].colors.skin
  5896. SLIDER_color_major = characters[id].colors.major
  5897. SLIDER_color_minor = characters[id].colors.minor
  5898.  
  5899. SLIDER_color_hair_start = SLIDER_color_hair
  5900. SLIDER_color_skin_start = SLIDER_color_skin
  5901. SLIDER_color_major_start = SLIDER_color_major
  5902. SLIDER_color_minor_start = SLIDER_color_minor
  5903. "
  5904. onClose
  5905. "
  5906. if(SLIDER_color_hair_start ~= -1) then Infinity_SetHairColor(SLIDER_color_hair_start) end
  5907. if(SLIDER_color_skin_start ~= -1) then Infinity_SetSkinColor(SLIDER_color_skin_start) end
  5908. if(SLIDER_color_major_start ~= -1) then Infinity_SetMajorColor(SLIDER_color_major_start) end
  5909. if(SLIDER_color_minor_start ~= -1) then Infinity_SetMinorColor(SLIDER_color_minor_start) end
  5910. "
  5911. label
  5912. {
  5913. area 0 0 864 710
  5914. mosaic GUIPOPF
  5915. }
  5916. label
  5917. {
  5918. area 36 36 798 44
  5919. text "COLOR_CHOICES_TITLE"
  5920. text style "title"
  5921. }
  5922.  
  5923. button
  5924. {
  5925. area 318 92 114 160
  5926. paperdoll 0
  5927. }
  5928. button
  5929. {
  5930. area 432 92 114 160
  5931. paperdoll 1
  5932. }
  5933.  
  5934. label
  5935. {
  5936. enabled "characters[id].PC == 1"
  5937. area 786 310 42 42
  5938. colordisplay 6
  5939. }
  5940. label
  5941. {
  5942. enabled "characters[id].PC == 1"
  5943. area 786 380 42 42
  5944. colordisplay 3
  5945. }
  5946. label
  5947. {
  5948. area 786 480 42 42
  5949. colordisplay 2
  5950. }
  5951. label
  5952. {
  5953. area 786 554 42 42
  5954. colordisplay 1
  5955. }
  5956.  
  5957. label
  5958. {
  5959. area 36 252 792 30
  5960. text "APPEARANCE_LABEL"
  5961. text style "label"
  5962. text point 14
  5963. }
  5964.  
  5965. label
  5966. {
  5967. enabled "characters[id].PC == 1"
  5968. area 36 282 792 26
  5969. text "HAIR_LABEL"
  5970. text style "label"
  5971. }
  5972. slider
  5973. {
  5974. palette 6
  5975. enabled "characters[id].PC == 1"
  5976. area 36 308 754 44
  5977. bam 'SLDRSTAR'
  5978. scaleToClip
  5979. position "SLIDER_color_hair"
  5980. sequence 0
  5981. frame 1
  5982. settings lua "game:GetPaletteSize(6)"
  5983. action
  5984. "
  5985. Infinity_SetHairColor(SLIDER_color_hair)
  5986. "
  5987. }
  5988.  
  5989. label
  5990. {
  5991. enabled "characters[id].PC == 1"
  5992. area 36 352 792 26
  5993. text "SKIN_LABEL"
  5994. text style "label"
  5995. }
  5996. slider
  5997. {
  5998. palette 3
  5999. enabled "characters[id].PC == 1"
  6000. area 36 378 754 44
  6001. bam 'SLDRSTAR'
  6002. scaleToClip
  6003. position "SLIDER_color_skin"
  6004. sequence 0
  6005. frame 1
  6006. settings lua "game:GetPaletteSize(3)"
  6007. action
  6008. "
  6009. Infinity_SetSkinColor(SLIDER_color_skin)
  6010. "
  6011. }
  6012.  
  6013. label
  6014. {
  6015. area 36 422 792 30
  6016. text "CLOTHING_LABEL"
  6017. text style "label"
  6018. text point 14
  6019. }
  6020.  
  6021. label
  6022. {
  6023. area 36 452 792 26
  6024. text "MAJOR_LABEL"
  6025. text style "label"
  6026. }
  6027. slider
  6028. {
  6029. palette 2
  6030. area 36 478 754 44
  6031. bam 'SLDRSTAR'
  6032. scaleToClip
  6033. position "SLIDER_color_major"
  6034. sequence 0
  6035. frame 1
  6036. settings lua "game:GetPaletteSize(2)"
  6037. action
  6038. "
  6039. Infinity_SetMajorColor(SLIDER_color_major)
  6040. "
  6041. }
  6042.  
  6043. label
  6044. {
  6045. area 36 522 792 30
  6046. text "MINOR_LABEL"
  6047. align center center
  6048. text style "label"
  6049. }
  6050. slider
  6051. {
  6052. palette 1
  6053. area 36 552 754 44
  6054. bam 'SLDRSTAR'
  6055. scaleToClip
  6056. position "SLIDER_color_minor"
  6057. sequence 0
  6058. frame 1
  6059. settings lua "game:GetPaletteSize(1)"
  6060. action
  6061. "
  6062. Infinity_SetMinorColor(SLIDER_color_minor)
  6063. "
  6064. }
  6065. button
  6066. {
  6067. on escape
  6068. area 196 653 230 40
  6069. bam GUIBUTMT
  6070. sequence 2
  6071. text "CANCEL_BUTTON"
  6072. text style "button"
  6073. action
  6074. "
  6075. Infinity_PopMenu('CHARACTER_COLOR',0,0)
  6076. "
  6077. }
  6078. button
  6079. {
  6080. on return
  6081. area 438 653 230 40
  6082. bam GUIBUTMT
  6083. sequence 2
  6084. text "DONE_BUTTON"
  6085. text style "button"
  6086. action
  6087. "
  6088. --save settings
  6089. SLIDER_color_hair_start = SLIDER_color_hair
  6090. SLIDER_color_skin_start = SLIDER_color_skin
  6091. SLIDER_color_major_start = SLIDER_color_major
  6092. SLIDER_color_minor_start = SLIDER_color_minor
  6093.  
  6094. if (e:GetActiveEngine() == createCharScreen) then
  6095. createCharScreen:OnDoneButtonClick()
  6096. end
  6097.  
  6098. Infinity_PopMenu('CHARACTER_COLOR',0,0)
  6099. "
  6100. }
  6101. }
  6102.  
  6103. menu
  6104. {
  6105. name 'WORLD_LEVEL_UP_BUTTONS'
  6106. align right top
  6107. offset -65 0
  6108. ignoreesc
  6109. enabled "0" --disable this menu for now.
  6110. button
  6111. {
  6112. enabled "Infinity_CanLevelUp(0)"
  6113. bam GUIOSW
  6114. area 0 14 44 44
  6115. sequence 0
  6116. action "Infinity_ActivateRecord(0)"
  6117. pulse 1
  6118. }
  6119. button
  6120. {
  6121. enabled "Infinity_CanLevelUp(1)"
  6122. bam GUIOSW
  6123. area 0 106 44 44
  6124. sequence 0
  6125. action "Infinity_ActivateRecord(1)"
  6126. pulse 1
  6127. }
  6128. button
  6129. {
  6130. enabled "Infinity_CanLevelUp(2)"
  6131. bam GUIOSW
  6132. area 0 198 44 44
  6133. sequence 0
  6134. action "Infinity_ActivateRecord(2)"
  6135. pulse 1
  6136. }
  6137. button
  6138. {
  6139. enabled "Infinity_CanLevelUp(3)"
  6140. bam GUIOSW
  6141. area 0 290 44 44
  6142. sequence 0
  6143. action "Infinity_ActivateRecord(3)"
  6144. pulse 1
  6145. }
  6146. button
  6147. {
  6148. enabled "Infinity_CanLevelUp(4)"
  6149. bam GUIOSW
  6150. area 0 382 44 44
  6151. sequence 0
  6152. action "Infinity_ActivateRecord(4)"
  6153. pulse 1
  6154. }
  6155. button
  6156. {
  6157. enabled "Infinity_CanLevelUp(5)"
  6158. bam GUIOSW
  6159. area 0 474 44 44
  6160. sequence 0
  6161. action "Infinity_ActivateRecord(5)"
  6162. pulse 1
  6163. }
  6164.  
  6165. }
  6166. menu
  6167. {
  6168. name 'textflash'
  6169. opacity lua 'getOpacityForInfoBlock(1000)'
  6170. enabled 'getOpacityForInfoBlock(1000) ~= 0'
  6171. align center top
  6172. offset 0 10
  6173.  
  6174. label
  6175. {
  6176. area 0 0 500 140
  6177. mosaic 'GUINOTE'
  6178. }
  6179. label
  6180. {
  6181. area 92 10 348 26
  6182. text lua "getTitleString()"
  6183. text style "label"
  6184. text align left center
  6185. text point 14
  6186. text color C
  6187. }
  6188. label
  6189. {
  6190. area 92 36 348 26
  6191. text lua "getSubtitleString()"
  6192. text style "label"
  6193. text align left center
  6194. text point 14
  6195. text color D
  6196. }
  6197.  
  6198. label
  6199. {
  6200. area 20 64 472 62
  6201. text lua "getBodyString()"
  6202. text style "normal"
  6203. text align left center
  6204. }
  6205. label
  6206. {
  6207. area 16 9 72 55
  6208. bam 'GUILS10'
  6209. sequence 2
  6210. frame 0
  6211. }
  6212. button
  6213. {
  6214. area 0 0 500 140
  6215. action
  6216. "
  6217. if(sidebarsGreyed ~= 1) then
  6218. e:GetActiveEngine():OnLeftPanelButtonClick(2)
  6219. local tf = next(textflashes)
  6220. setSelectedQuest(textflashes[tf][5])
  6221. end
  6222. "
  6223. }
  6224. button
  6225. {
  6226. bam GUIOSW
  6227. on esc
  6228. area 448 4 44 44
  6229. sequence 2
  6230. action
  6231. "
  6232. --end the animation
  6233. local tf = next(textflashes)
  6234. textflashes[tf] = nil
  6235. "
  6236. }
  6237. }
  6238.  
  6239.  
  6240. `
  6241. luaEdit = ""
  6242. luaEditDebugDump = 0
  6243. luaEditHistory = {}
  6244. luaEditMaxHistory = 10
  6245. luaEditHistoryIndex = 0
  6246. luaEditShowHistoryList = 0
  6247. luaEditHistoryListSelected = 0
  6248. function updateLuaHistory()
  6249. local i = 2
  6250. local tempTab = {}
  6251. tempTab[1] = luaEdit
  6252. while ( i <= luaEditMaxHistory ) do
  6253. tempTab[i] = luaEditHistory[i-1]
  6254. i = i + 1
  6255. end
  6256. luaEditHistory = tempTab
  6257. end
  6258. function loadLuaHistory()
  6259. local i = 1
  6260. while (i <= luaEditMaxHistory ) do
  6261. luaEditHistory[i] = Infinity_GetINIString("Lua Edit","String"..i-1, "")
  6262. i = i + 1
  6263. end
  6264. end
  6265. function saveLuaHistory()
  6266. local i = 1
  6267. while (i <= luaEditMaxHistory ) do
  6268. Infinity_SetINIValue("Lua Edit","String"..i-1, luaEditHistory[i])
  6269. i = i + 1
  6270. end
  6271. end
  6272. function luaEditHistoryUp()
  6273. if(luaEditHistoryIndex <= 1) then return end
  6274. luaEditHistoryIndex = luaEditHistoryIndex - 1
  6275. luaEdit = luaEditHistory[luaEditHistoryIndex]
  6276. end
  6277. function luaEditHistoryDown()
  6278. if(luaEditHistoryIndex == luaEditMaxHistory) then return end
  6279. if(luaEditHistory[luaEditHistoryIndex + 1] == "") then return end
  6280. luaEditHistoryIndex = luaEditHistoryIndex + 1
  6281. luaEdit = luaEditHistory[luaEditHistoryIndex]
  6282. end
  6283.  
  6284. cheatGoldAmt = 1000000
  6285. cheatXpAmt = 500000
  6286.  
  6287. cheatAreaDisplayList = {}
  6288.  
  6289. `
  6290. menu
  6291. {
  6292. name 'cheatMenu'
  6293. ignoreEsc
  6294.  
  6295. onOpen
  6296. "
  6297. if game:GetMissionPackInfo() then
  6298. cheatAreaDisplayList = cheatAreasTutorial
  6299. elseif game:GetMissionPackInfoTBP() then
  6300. cheatAreaDisplayList = cheatAreasArena
  6301. elseif startEngine:GetCampaign() == 3 then
  6302. cheatAreaDisplayList = cheatAreasExpansion
  6303. else
  6304. cheatAreaDisplayList = cheatAreas
  6305. end
  6306. "
  6307.  
  6308. label
  6309. {
  6310. area 100 0 809 298
  6311. mosaic 'GUWBTP30'
  6312. }
  6313. list
  6314. {
  6315. column
  6316. {
  6317. width 20
  6318. label
  6319. {
  6320. area 0 0 -1 -1
  6321. text lua "cheatAreaDisplayList[rowNumber][1]"
  6322. text style "list"
  6323. }
  6324. }
  6325. column
  6326. {
  6327. width 80
  6328. label
  6329. {
  6330. area 0 0 -1 -1
  6331. text lua "cheatAreaDisplayList[rowNumber][2]"
  6332. text style "list"
  6333. }
  6334. }
  6335.  
  6336. area 122 6 492 240
  6337.  
  6338. rowheight 18
  6339. table "cheatAreaDisplayList"
  6340. var cheatTeleportArea
  6341. scrollbar 'GUISCRC'
  6342. }
  6343. button
  6344. {
  6345. area 122 252 140 30
  6346. bam GUIBUTNS
  6347. sequence 6
  6348. text "TRAVEL_BUTTON"
  6349. text style "button"
  6350. action "C:MoveToArea(cheatAreaDisplayList[cheatTeleportArea][1])"
  6351. }
  6352. button
  6353. {
  6354. area 620 186 140 30
  6355. bam GUIBUTNS
  6356. sequence 6
  6357. text "GODBOW_LABEL"
  6358. text style "button"
  6359. action "C:CreateItem('godbow')"
  6360. }
  6361. button
  6362. {
  6363. area 620 216 140 30
  6364. bam GUIBUTNS
  6365. sequence 6
  6366. text "GIVE_GOLD_LABEL"
  6367. text style "button"
  6368. action "C:AddGold(cheatGoldAmt)"
  6369. }
  6370. edit
  6371. {
  6372. area 766 222 138 30
  6373. var cheatGoldAmt
  6374. text style "edit"
  6375. maxlines 1
  6376. fill 112 111 111 64
  6377. }
  6378.  
  6379. button
  6380. {
  6381. area 620 252 140 30
  6382. bam GUIBUTNS
  6383. sequence 6
  6384. text "GIVE_XP_LABEL"
  6385. text style "button"
  6386. action "C:SetCurrentXP(cheatXpAmt)"
  6387. }
  6388. edit
  6389. {
  6390. area 766 258 138 30
  6391. var cheatXpAmt
  6392. text style "edit"
  6393. maxlines 1
  6394. fill 112 111 111 64
  6395. }
  6396.  
  6397. button
  6398. {
  6399. area 766 186 140 30
  6400. bam GUIBUTNS
  6401. sequence 6
  6402. text "EXPLORE_LABEL"
  6403. text style "button"
  6404. action "C:ExploreArea()"
  6405. }
  6406.  
  6407. }
  6408. menu
  6409. {
  6410. name "luaHistoryMenu"
  6411. offset 500 -32
  6412. align right bottom
  6413. label
  6414. {
  6415. area 0 0 809 300
  6416. mosaic 'GUWBTP30'
  6417. }
  6418. list
  6419. {
  6420. column
  6421. {
  6422. width 100
  6423. label
  6424. {
  6425. area 0 0 -1 -1
  6426. text lua "luaEditHistory[rowNumber]"
  6427. text style "list"
  6428. }
  6429. }
  6430. area 20 10 400 298
  6431. rowheight 24
  6432. var luaEditHistoryListSelected
  6433. table "luaEditHistory"
  6434. scrollbar 'GUISCRC'
  6435. action
  6436. "
  6437. luaEdit = luaEditHistory[luaEditHistoryListSelected]
  6438. "
  6439. }
  6440. }
  6441. menu
  6442. {
  6443. name 'cheatConsole'
  6444. align center bottom
  6445. ignoreEsc
  6446.  
  6447. onOpen
  6448. "
  6449. toolbarTop = 50
  6450. Infinity_PushMenu('WORLD_MESSAGES')
  6451. Infinity_PushMenu('cheatMenu', 0, 0);
  6452. Infinity_FocusTextEdit('luaEditArea');
  6453. luaEdit = trim(luaEdit)
  6454. loadLuaHistory()
  6455. "
  6456. onClose
  6457. "
  6458. Infinity_PopMenu('cheatMenu', 0, 0);
  6459. Infinity_PopMenu('luaHistoryMenu', 0, 0);
  6460. "
  6461. label
  6462. {
  6463. area 0 0 809 50
  6464. mosaic GUWBTP20
  6465. }
  6466. edit
  6467. {
  6468. name "luaEditArea"
  6469. area 12 8 790 24
  6470. var luaEdit
  6471. scrollbar 'GUISCRC'
  6472. text style "edit"
  6473. fill 112 111 111 64
  6474. text useFontZoom 0
  6475. action
  6476. "
  6477. --if key_pressed is return
  6478. if (key_pressed == 13) then
  6479. updateLuaHistory()
  6480. saveLuaHistory()
  6481. Infinity_LuaConsoleInput(luaEditObjectId,luaEditDebugDump)
  6482. return -1
  6483. end
  6484. if (key_pressed == 27) then
  6485. return 0
  6486. end
  6487. return 1
  6488. "
  6489. }
  6490. button
  6491. {
  6492. area 816 6 32 32
  6493. bam ROUNDBUT
  6494. scaleToClip
  6495. toggle luaEditShowHistoryList
  6496. action
  6497. "
  6498. if(luaEditShowHistoryList == 0) then
  6499. Infinity_PopMenu('luaHistoryMenu',0,0)
  6500. else
  6501. Infinity_PushMenu('luaHistoryMenu',0,0)
  6502. end
  6503. "
  6504. }
  6505. button
  6506. {
  6507. enabled "Infinity_TextEditHasFocus()"
  6508. on up
  6509. action
  6510. "
  6511. luaEditHistoryUp()
  6512. "
  6513. }
  6514. button
  6515. {
  6516. enabled "Infinity_TextEditHasFocus()"
  6517. on down
  6518. action
  6519. "
  6520. luaEditHistoryDown()
  6521. "
  6522. }
  6523.  
  6524. }
  6525. `
  6526. cloudLoadState=0
  6527. function CheckCloudSaveStatus()
  6528. Infinity_UpdateCloudSaveState()
  6529. if(cloudLoadState == 0) then
  6530. Infinity_PopMenu()
  6531. end
  6532. return GetCloudLoadingText()
  6533. end
  6534. function GetCloudLoadingText()
  6535. if(cloudLoadState == 1 or cloudLoadState == 0) then
  6536. return t('DOWNLOADING_SAVE_NORMAL')
  6537. end
  6538. if(cloudLoadState == 2) then
  6539. return t('SEARCHING_SAVE_NORMAL')
  6540. end
  6541. return t('CLOUD_STATE_UNDEFINED_NORMAL')
  6542. end
  6543. `
  6544. menu
  6545. {
  6546. name 'CloudSaveUpdateMenu'
  6547. modal
  6548. label -- Background
  6549. {
  6550. area 174 267 677 234
  6551. mosaic GUIERR6
  6552. }
  6553. label
  6554. {
  6555. area 214 287 600 120
  6556. text lua "CheckCloudSaveStatus()"
  6557. text style "label"
  6558. }
  6559. button
  6560. {
  6561. area 544 437 232 44
  6562. bam GUIOSTUR
  6563. sequence 0
  6564. text "SKIP_BUTTON"
  6565. text style "button"
  6566. on escape
  6567. action
  6568. "
  6569. Infinity_PopMenu()
  6570. "
  6571. }
  6572. }
  6573. `
  6574. messageBoxCurMessage = nil
  6575. messageBoxMessages = {}
  6576. function initMessageBox(message)
  6577. messageBoxMessages[message] = 1
  6578. if(messageBoxCurMessage ~= nil) then
  6579. --message box already active
  6580. return
  6581. end
  6582. getNextMessage()
  6583. Infinity_PushMenu('LuaMessageBox',0,0)
  6584. end
  6585.  
  6586. function getNextMessage()
  6587. i = 1
  6588. while ( i <= messageBoxMessageCount ) do
  6589. showMessage = messageBoxMessages[i]
  6590. if ( showMessage ~= nil ) then
  6591. messageBoxCurMessage = i
  6592. return 1
  6593. end
  6594. i = i + 1
  6595. end
  6596. --whole table scanned, all messages have been displayed
  6597. return 0
  6598. end
  6599. `
  6600. menu
  6601. {
  6602. name 'LuaMessageBox'
  6603. align center center
  6604. modal
  6605. label
  6606. {
  6607. area 0 0 657 234
  6608. mosaic GUIERR6
  6609. }
  6610. label
  6611. {
  6612. area 29 21 580 126
  6613. text lua "messages[messageBoxCurMessage]"
  6614. text style "label"
  6615. }
  6616. button
  6617. {
  6618. area 213 170 230 40
  6619. bam GUIBUTNT
  6620. text "DONE_BUTTON"
  6621. text style "button"
  6622. action
  6623. "
  6624. messageBoxMessages[messageBoxCurMessage] = nil
  6625. if(getNextMessage() == 0) then
  6626. messageBoxCurMessage = nil
  6627. Infinity_PopMenu()
  6628. end
  6629. "
  6630. }
  6631. }
  6632.  
  6633. `
  6634. partyImport = {}
  6635. `
  6636. menu
  6637. {
  6638. name 'IMPORTPARTY'
  6639. align center center
  6640. label
  6641. {
  6642. mosaic 'GMPCARBD'
  6643. area 0 0 1024 768
  6644. }
  6645. label
  6646. {
  6647. area 162 16 700 44
  6648. text "CREATE_PARTY_TITLE"
  6649. text style "title"
  6650. }
  6651. label
  6652. {
  6653. enabled "game:GetMissionPackInfoTBP()"
  6654. area 54 584 902 62
  6655. scrollbar 'GUISCRC'
  6656. text style "normal"
  6657. text 69563
  6658. }
  6659.  
  6660. --portraits
  6661. label
  6662. {
  6663. area 67 180 64 90
  6664. bam 'GUIRSP10'
  6665. sequence 0
  6666. }
  6667. button
  6668. {
  6669. area 71 182 56 86
  6670. bitmap lua "partyImport.character[1].portrait"
  6671. clickable lua "partyImport.character[1].name ~= ''"
  6672. action
  6673. "
  6674. createPartyScreen:OnPortraitButtonClick(0)
  6675. "
  6676. }
  6677. label
  6678. {
  6679. area 67 315 64 90
  6680. bam 'GUIRSP10'
  6681. sequence 0
  6682. }
  6683. button
  6684. {
  6685. area 71 317 56 86
  6686. bitmap lua "partyImport.character[2].portrait"
  6687. clickable lua "partyImport.character[2].name ~= ''"
  6688. action
  6689. "
  6690. createPartyScreen:OnPortraitButtonClick(1)
  6691. "
  6692. }
  6693. label
  6694. {
  6695. area 67 454 64 90
  6696. bam 'GUIRSP10'
  6697. sequence 0
  6698. }
  6699. button
  6700. {
  6701. area 71 456 56 86
  6702. bitmap lua "partyImport.character[3].portrait"
  6703. clickable lua "partyImport.character[3].name ~= ''"
  6704. action
  6705. "
  6706. createPartyScreen:OnPortraitButtonClick(2)
  6707. "
  6708. }
  6709. label
  6710. {
  6711. area 557 180 64 90
  6712. bam 'GUIRSP10'
  6713. sequence 0
  6714. }
  6715. button
  6716. {
  6717. area 561 182 56 86
  6718. bitmap lua "partyImport.character[4].portrait"
  6719. clickable lua "partyImport.character[4].name ~= ''"
  6720. action
  6721. "
  6722. createPartyScreen:OnPortraitButtonClick(3)
  6723. "
  6724. }
  6725. label
  6726. {
  6727. area 557 315 64 90
  6728. bam 'GUIRSP10'
  6729. sequence 0
  6730. }
  6731. button
  6732. {
  6733. area 561 317 56 86
  6734. bitmap lua "partyImport.character[5].portrait"
  6735. clickable lua "partyImport.character[5].name ~= ''"
  6736. action
  6737. "
  6738. createPartyScreen:OnPortraitButtonClick(4)
  6739. "
  6740. }
  6741. label
  6742. {
  6743. area 557 454 64 90
  6744. bam 'GUIRSP10'
  6745. sequence 0
  6746. }
  6747. button
  6748. {
  6749. area 561 456 56 86
  6750. bitmap lua "partyImport.character[6].portrait"
  6751. clickable lua "partyImport.character[6].name ~= ''"
  6752. action
  6753. "
  6754. createPartyScreen:OnPortraitButtonClick(5)
  6755. "
  6756. }
  6757.  
  6758. button
  6759. {
  6760. area 527 710 200 40
  6761. bam 'GUIBUTNT'
  6762. sequence 1
  6763. text "PLAY_IMPORT_BUTTON" -- Play
  6764. text style 'button'
  6765. clickable lua "partyImport.playbuttonclickable"
  6766. action
  6767. "
  6768. createPartyScreen:OnDoneButtonClick()
  6769. "
  6770. }
  6771. button
  6772. {
  6773. on escape
  6774. area 305 710 200 40
  6775. bam 'GUIBUTNT'
  6776. sequence 0
  6777. text "BACK_BUTTON" -- Back
  6778. text style 'button'
  6779. action
  6780. "
  6781. createPartyScreen:OnBackButtonClick()
  6782. "
  6783. }
  6784.  
  6785. --delete/create buttons
  6786. button
  6787. {
  6788. area 155 180 300 40
  6789. bam 'GUIBUTWT'
  6790. sequence 0
  6791. text lua "partyImport.character[1].createdelete"
  6792. text style "button"
  6793. action
  6794. "
  6795. createPartyScreen:OnCreateDeleteButtonClick(0)
  6796. "
  6797. }
  6798. button
  6799. {
  6800. area 155 317 300 40
  6801. bam 'GUIBUTWT'
  6802. sequence 2
  6803. text lua "partyImport.character[2].createdelete"
  6804. text style "button"
  6805. action
  6806. "
  6807. createPartyScreen:OnCreateDeleteButtonClick(1)
  6808. "
  6809. }
  6810. button
  6811. {
  6812. area 155 452 300 40
  6813. bam 'GUIBUTWT'
  6814. sequence 1
  6815. text lua "partyImport.character[3].createdelete"
  6816. text style "button"
  6817. action
  6818. "
  6819. createPartyScreen:OnCreateDeleteButtonClick(2)
  6820. "
  6821. }
  6822. button
  6823. {
  6824. area 645 180 300 40
  6825. bam 'GUIBUTWT'
  6826. sequence 0
  6827. text lua "partyImport.character[4].createdelete"
  6828. text style "button"
  6829. action
  6830. "
  6831. createPartyScreen:OnCreateDeleteButtonClick(3)
  6832. "
  6833. }
  6834. button
  6835. {
  6836. area 645 317 300 40
  6837. bam 'GUIBUTWT'
  6838. sequence 2
  6839. text lua "partyImport.character[5].createdelete"
  6840. text style "button"
  6841. action
  6842. "
  6843. createPartyScreen:OnCreateDeleteButtonClick(4)
  6844. "
  6845. }
  6846. button
  6847. {
  6848. area 645 452 300 40
  6849. bam 'GUIBUTWT'
  6850. sequence 1
  6851. text lua "partyImport.character[6].createdelete"
  6852. text style "button"
  6853. action
  6854. "
  6855. createPartyScreen:OnCreateDeleteButtonClick(5)
  6856. "
  6857. }
  6858.  
  6859. -- character labels
  6860. label
  6861. {
  6862. area 155 228 314 50
  6863. text lua "partyImport.character[1].name"
  6864. text style "title"
  6865. }
  6866. label
  6867. {
  6868. area 155 365 314 50
  6869. text lua "partyImport.character[2].name"
  6870. text style "title"
  6871. }
  6872. label
  6873. {
  6874. area 155 500 314 50
  6875. text lua "partyImport.character[3].name"
  6876. text style "title"
  6877. }
  6878. label
  6879. {
  6880. area 645 228 314 50
  6881. text lua "partyImport.character[4].name"
  6882. text style "title"
  6883. }
  6884. label
  6885. {
  6886. area 645 365 314 50
  6887. text lua "partyImport.character[5].name"
  6888. text style "title"
  6889. }
  6890. label
  6891. {
  6892. area 645 500 314 50
  6893. text lua "partyImport.character[6].name"
  6894. text style "title"
  6895. }
  6896. }
  6897.  
  6898. menu
  6899. {
  6900. name 'START_CAMPAIGN_SELECT'
  6901. align center center
  6902. ignoreEsc
  6903. modal
  6904. onOpen
  6905. "
  6906. if e:IsTouchUI() then
  6907. startEngine:DismissChooseCampaignPopup()
  6908. end
  6909. "
  6910.  
  6911. label
  6912. {
  6913. area 0 0 672 672
  6914. mosaic "RECENTEV"
  6915. enabled "not e:IsTouchUI()"
  6916. }
  6917. label
  6918. {
  6919. area 158 52 354 46
  6920. text style "title"
  6921. text "SELECT_CAMPAIGN_TITLE"
  6922. enabled "not e:IsTouchUI()"
  6923. }
  6924. label
  6925. {
  6926. area 136 120 406 258
  6927. text style "normal"
  6928. text "WELCOME_NORMAL"
  6929. enabled "not e:IsTouchUI()"
  6930. }
  6931. button
  6932. {
  6933. area 198 408 300 40
  6934. bam GUIBUTWT
  6935. text style "button"
  6936. text "SIEGE_OF_DRAGONSPEAR_BUTTON"
  6937. enabled "not e:IsTouchUI()"
  6938. action
  6939. "
  6940. startEngine:DismissChooseCampaignPopup()
  6941. startEngine:OnCampaignButtonClick('SOD',true)
  6942. "
  6943. }
  6944. button
  6945. {
  6946. area 198 458 300 40
  6947. bam GUIBUTWT
  6948. text style "button"
  6949. text "BALDURS_GATE_BUTTON"
  6950. enabled "not e:IsTouchUI()"
  6951. action
  6952. "
  6953. --selected by default, just close this menu.
  6954. startEngine:DismissChooseCampaignPopup()
  6955. "
  6956. }
  6957. button
  6958. {
  6959. area 198 508 300 40
  6960. bam GUIBUTWT
  6961. text style "button"
  6962. text "BLACK_PITS_BUTTON"
  6963. enabled "not e:IsTouchUI()"
  6964. action
  6965. "
  6966. startEngine:DismissChooseCampaignPopup()
  6967. startEngine:OnTBPButtonClick(true)
  6968. "
  6969. }
  6970.  
  6971. }
  6972.  
  6973. `
  6974. highlightedCampaign = nil
  6975.  
  6976. --obviously theres some redundancy in this data but I dislike the idea of assuming what our frame/sequence will be.
  6977. startCampaignData = {
  6978. {bigLogo = 0, icon = 0, tooltip = "TOOLTIP_CAMPAIGN_BG", background = 2, button = 2, sidebar = 2, importEnabled = false, tutorialEnabled = true},
  6979. {bigLogo = 2, icon = 1, tooltip = "TOOLTIP_CAMPAIGN_TBP", background = 2, button = 2, sidebar = 2, importEnabled = false, tutorialEnabled = false},
  6980. {bigLogo = 1, icon = 2, tooltip = "TOOLTIP_CAMPAIGN_SOD", background = 2, button = 2, sidebar = 2, importEnabled = true, tutorialEnabled = false}
  6981. }
  6982. startButtons =
  6983. {
  6984. {const.START_CAMPAIGN_SOD, const.START_CAMPAIGN_BP}, --bg
  6985. {const.START_CAMPAIGN_BG, const.START_CAMPAIGN_SOD}, --bp
  6986. {const.START_CAMPAIGN_BG,const.START_CAMPAIGN_BP}, --sod
  6987. }
  6988.  
  6989. function getCampaignHighlight(selected)
  6990. return selected == highlightedCampaign
  6991. end
  6992.  
  6993. function getBigLogo()
  6994. local campaign = startEngine:GetCampaign()
  6995. return startCampaignData[campaign].bigLogo
  6996. end
  6997.  
  6998. function getCampaignIcon(buttonNum)
  6999. local campaign = startEngine:GetCampaign()
  7000. return startCampaignData[startButtons[campaign][buttonNum]].icon
  7001. end
  7002.  
  7003. function getCampaignTooltip(buttonNum)
  7004. local campaign = startEngine:GetCampaign()
  7005. return t(startCampaignData[startButtons[campaign][buttonNum]].tooltip)
  7006. end
  7007.  
  7008. function getCampaignButtonSequence()
  7009. local campaign = startEngine:GetCampaign()
  7010. return startCampaignData[campaign].button
  7011. end
  7012.  
  7013. function onCampaignButton(buttonNum)
  7014. local campaign = startEngine:GetCampaign()
  7015. local clickedCampaign = startButtons[campaign][buttonNum]
  7016. if(clickedCampaign == const.START_CAMPAIGN_SOD) then
  7017. startEngine:OnCampaignButtonClick('SOD',true)
  7018. elseif(clickedCampaign == const.START_CAMPAIGN_BP) then
  7019. startEngine:OnTBPButtonClick(true)
  7020. elseif(clickedCampaign == const.START_CAMPAIGN_BG) then
  7021. startEngine:OnSoAButtonClick(true)
  7022. end
  7023. end
  7024. function getCampaignImportEnabled()
  7025. local campaign = startEngine:GetCampaign()
  7026. return startCampaignData[campaign].importEnabled
  7027. end
  7028. function getTutorialEnabled()
  7029. --Tutorial and campaign import should never be enabled for the same campaign - the button uses the same space
  7030. local campaign = startEngine:GetCampaign()
  7031. return startCampaignData[campaign].tutorialEnabled
  7032. end
  7033. function getSidebarFrame()
  7034. local campaign = startEngine:GetCampaign()
  7035. return startCampaignData[campaign].sidebar
  7036. end
  7037.  
  7038. usingSODStartMenu = 1
  7039. `
  7040. menu
  7041. {
  7042. name 'START'
  7043. align center center
  7044. size 1024 768
  7045. ignoreesc
  7046. onOpen "
  7047. if e:IsTouchUI() and startEngine:GetCampaign() ~= 3 then
  7048. startEngine:OnCampaignButtonClick('SOD',false)
  7049. end
  7050.  
  7051. versionString = CBaldurChitin:GetVersionString()
  7052. canContinue = startEngine:HasGameToContinue()
  7053. Infinity_PlayMovie('flames','flames')
  7054. e:CheckGUISong()
  7055. local state = startEngine:GetEngineState()
  7056. if lastStartMenu and lastStartMenu ~= 'START' then
  7057. Infinity_PopMenu('START')
  7058. Infinity_PushMenu(lastStartMenu)
  7059. lastStartMenu = nil
  7060. elseif state == 1 or state == 3 then
  7061. Infinity_PopMenu('START')
  7062. Infinity_PushMenu('START_SP')
  7063. elseif state == 2 then
  7064. Infinity_PopMenu('START')
  7065. Infinity_PushMenu('START_MP')
  7066. end
  7067. Infinity_SetBackground('BACKGROUND')
  7068.  
  7069. --If we're coming back from the tutorial make sure we're set to our actual campaign.
  7070. if(startEngine:GetCampaign() == const.START_CAMPAIGN_BG) then
  7071. startEngine:OnSoAButtonClick(false)
  7072. end
  7073. "
  7074. onClose "
  7075. local state = startEngine:GetEngineState()
  7076. if state == 1 then
  7077. Infinity_PopMenu('START_SP')
  7078. elseif state == 2 then
  7079. Infinity_PopMenu('START_MP')
  7080. end
  7081.  
  7082. "
  7083. label
  7084. {
  7085. area 0 0 1024 768
  7086. }
  7087. label
  7088. {
  7089. --center this under the menu
  7090. --(2160/2) - (768/2) = 696
  7091. area 660 -696 390 2160
  7092. bam "STRTSIDE"
  7093. frame lua "getSidebarFrame()"
  7094. }
  7095.  
  7096. label
  7097. {
  7098. area 152 252 378 376
  7099. bam "BIGLOGO"
  7100. sequence 0
  7101. frame lua "getBigLogo()"
  7102. }
  7103.  
  7104.  
  7105. label
  7106. {
  7107. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_BG"
  7108. area 90 78 510 130
  7109. bam 'TITLE'
  7110. sequence 0
  7111. frame 0
  7112. }
  7113. label
  7114. {
  7115. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_SOD"
  7116. area 94 40 494 194
  7117. bam 'TITLE'
  7118. sequence 0
  7119. frame 1
  7120. }
  7121. label
  7122. {
  7123. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_BP"
  7124. area 94 127 504 62
  7125. bam 'TITLE'
  7126. sequence 0
  7127. frame 2
  7128. }
  7129.  
  7130. label
  7131. {
  7132. area 210 692 271 30
  7133. bam "DNDLOGO"
  7134. scaleToClip
  7135. }
  7136. button
  7137. {
  7138. bam 'STARTBUT'
  7139. sequence lua "getCampaignButtonSequence()"
  7140. area 732 144 249 45
  7141. pad 10 8 10 8
  7142. text style "button"
  7143. --text 9372
  7144. text "CONTINUE_BUTTON"
  7145. clickable lua "canContinue"
  7146. action "startEngine:OnContinueGame()"
  7147. }
  7148. button
  7149. {
  7150. bam 'STARTBUT'
  7151. sequence lua "getCampaignButtonSequence()"
  7152. area 732 216 249 45
  7153. pad 10 8 10 8
  7154. text style "button"
  7155. text "SINGLEPLAYER_BUTTON"
  7156. --text 15413
  7157. action
  7158. "
  7159. startEngine:SetEngineState(1)
  7160. Infinity_TransitionMenu('START_SP')
  7161. "
  7162. }
  7163. button
  7164. {
  7165. bam 'STARTBUT'
  7166. sequence lua "getCampaignButtonSequence()"
  7167. area 732 286 249 45
  7168. pad 10 8 10 8
  7169. text style "button"
  7170. text "MULTIPLAYER_BUTTON"
  7171. action
  7172. "
  7173. startEngine:OnMultiPlayerButtonClick()
  7174. "
  7175. }
  7176. button
  7177. {
  7178. bam 'STARTBUT'
  7179. sequence lua "getCampaignButtonSequence()"
  7180. area 732 356 249 45
  7181. pad 10 8 10 8
  7182. text style "button"
  7183. text "OPTIONS_BUTTON"
  7184. action "
  7185. Infinity_TransitionMenu('START_OPTIONS')
  7186. optionsScreen:SetEngineState(1)
  7187. startEngine:OnOptionsButtonClick()
  7188. lastStartMenu = 'START'
  7189. "
  7190. }
  7191. button
  7192. {
  7193. area 732 426 249 45
  7194. bam 'STARTBUT'
  7195. sequence lua "getCampaignButtonSequence()"
  7196. pad 10 8 10 8
  7197. text style "button"
  7198. text "QUIT_GAME_BUTTON"
  7199. enabled "not e:IsTouchUI()"
  7200. on escape
  7201. action
  7202. "
  7203. startEngine:OnQuitButtonClick()
  7204. "
  7205. }
  7206. button
  7207. {
  7208. area 0 0 1 1
  7209. enabled "e:IsTouchUI()"
  7210. on escape
  7211. action
  7212. "
  7213. startEngine:OnQuitButtonClick()
  7214. "
  7215. }
  7216.  
  7217. text
  7218. {
  7219. bam "CMPGSML"
  7220. sequence lua 'getCampaignIcon(1)'
  7221. frame lua "getCampaignHighlight(1)"
  7222. area 732 490 116 116
  7223. align center center
  7224. tooltip lua "getCampaignTooltip(1)"
  7225. enabled "not e:IsTouchUI()"
  7226. action
  7227. "
  7228. onCampaignButton(1)
  7229. "
  7230. actionEnter
  7231. "
  7232. highlightedCampaign = 1
  7233. "
  7234. actionExit
  7235. "
  7236. highlightedCampaign = nil
  7237. "
  7238. }
  7239. text
  7240. {
  7241. bam "CMPGSML"
  7242. sequence lua 'getCampaignIcon(2)'
  7243. frame lua "getCampaignHighlight(2)"
  7244. area 865 490 116 116
  7245. align center center
  7246. tooltip lua "getCampaignTooltip(2)"
  7247. enabled "not e:IsTouchUI()"
  7248. action
  7249. "
  7250. onCampaignButton(2)
  7251. "
  7252. actionEnter
  7253. "
  7254. highlightedCampaign = 2
  7255. "
  7256. actionExit
  7257. "
  7258. highlightedCampaign = nil
  7259. "
  7260. }
  7261. movie
  7262. {
  7263. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_SOD"
  7264. name "flames"
  7265. area 86 222 512 512
  7266. loop
  7267. }
  7268. label
  7269. {
  7270. area 816 692 94 47
  7271. text style "normal"
  7272. text align center center
  7273. text lua "CBaldurChitin:GetVersionString()"
  7274. }
  7275. }
  7276.  
  7277. menu
  7278. {
  7279. name 'START_SP'
  7280. align center center
  7281. size 1024 768
  7282. ignoreEsc
  7283. onopen "Infinity_PlayMovie('flames','flames2')"
  7284.  
  7285.  
  7286. label
  7287. {
  7288. --center this under the menu
  7289. --(2160/2) - (768/2) = 696
  7290. area 660 -696 390 2160
  7291. bam "STRTSIDE"
  7292. frame lua "getSidebarFrame()"
  7293. }
  7294.  
  7295. label
  7296. {
  7297. area 152 252 378 376
  7298. bam "BIGLOGO"
  7299. sequence 0
  7300. frame lua "getBigLogo()"
  7301. }
  7302.  
  7303.  
  7304. label
  7305. {
  7306. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_BG"
  7307. area 90 78 510 130
  7308. bam 'TITLE'
  7309. sequence 0
  7310. frame 0
  7311. }
  7312. label
  7313. {
  7314. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_SOD"
  7315. area 94 40 494 194
  7316. bam 'TITLE'
  7317. sequence 0
  7318. frame 1
  7319. }
  7320. label
  7321. {
  7322. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_BP"
  7323. area 94 127 504 62
  7324. bam 'TITLE'
  7325. sequence 0
  7326. frame 2
  7327. }
  7328.  
  7329. label
  7330. {
  7331. area 210 692 271 30
  7332. bam "DNDLOGO"
  7333. scaleToClip
  7334. }
  7335.  
  7336. button
  7337. {
  7338. bam 'STARTBUT'
  7339. enabled "getTutorialEnabled()"
  7340. sequence lua "getCampaignButtonSequence()"
  7341. area 732 146 249 45
  7342. pad 10 8 10 8
  7343. text style "button"
  7344. text "TUTORIAL_BUTTON"
  7345. action
  7346. "
  7347. Infinity_PopMenu();
  7348. startEngine:OnTutorialButtonClick()
  7349. "
  7350. }
  7351. button
  7352. {
  7353. bam 'STARTBUT'
  7354. enabled "getCampaignImportEnabled()"
  7355. sequence lua "getCampaignButtonSequence()"
  7356. area 732 146 249 45
  7357. pad 10 8 10 8
  7358. text style "button"
  7359. text "IMPORT_GAME_BUTTON"
  7360. action
  7361. "
  7362. Infinity_PopMenu();
  7363. startEngine:OnImportCharacterButtonClick();
  7364. "
  7365. }
  7366. button
  7367. {
  7368. bam 'STARTBUT'
  7369. sequence lua "getCampaignButtonSequence()"
  7370. area 732 216 249 45
  7371. pad 10 8 10 8
  7372. text style "button"
  7373. text "NEW_GAME_BUTTON"
  7374. action "Infinity_PopMenu(); startEngine:OnNewGameButtonClick();"
  7375. }
  7376. button
  7377. {
  7378. bam 'STARTBUT'
  7379. sequence lua "getCampaignButtonSequence()"
  7380. area 732 286 249 45
  7381. pad 10 8 10 8
  7382. text style "button"
  7383. text "LOAD_GAME_BUTTON"
  7384. action "Infinity_PopMenu(); startEngine:OnLoadGameButtonClick()"
  7385. }
  7386. button
  7387. {
  7388. bam 'STARTBUT'
  7389. sequence lua "getCampaignButtonSequence()"
  7390. area 732 356 249 45
  7391. pad 10 8 10 8
  7392. text style "button"
  7393. text "PREGENERATE_BUTTON"
  7394. action "Infinity_PopMenu(); startEngine:OnPreGenerateButtonClick()"
  7395. }
  7396. button
  7397. {
  7398. bam 'STARTBUT'
  7399. sequence lua "getCampaignButtonSequence()"
  7400. area 732 426 249 45
  7401. pad 10 8 10 8
  7402. text style "button"
  7403. text "OPTIONS_BUTTON"
  7404. action "
  7405. Infinity_TransitionMenu('START_OPTIONS')
  7406. optionsScreen:SetEngineState(1)
  7407. startEngine:OnOptionsButtonClick()
  7408. lastStartMenu = 'START_SP'
  7409. "
  7410. }
  7411. button
  7412. {
  7413. on escape
  7414. bam 'STARTBUT'
  7415. sequence lua "getCampaignButtonSequence()"
  7416. area 732 496 249 45
  7417. pad 10 8 10 8
  7418. text style "button"
  7419. text "BACK_BUTTON"
  7420. action "startEngine:SetEngineState(0); Infinity_TransitionMenu('START')"
  7421. }
  7422. movie
  7423. {
  7424. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_SOD"
  7425. name "flames2"
  7426. area 86 222 512 512
  7427. loop
  7428. }
  7429. label
  7430. {
  7431. area 816 692 94 47
  7432. text style "normal"
  7433. text align center center
  7434. text lua "CBaldurChitin:GetVersionString()"
  7435. }
  7436.  
  7437. }
  7438. `
  7439. OptionsButtons =
  7440. {
  7441. {text = "CREDITS_BUTTON", menu = "CREDITS", sequence = 0},
  7442. {text = "GAMEPLAY_BUTTON", menu = "OPTIONS_GAMEPLAY", sequence = 0},
  7443. {text = "GRAPHICS_BUTTON", menu = "OPTIONS_GRAPHICS", sequence = 1},
  7444. {text = "LANGUAGE_BUTTON", menu = "OPTIONS_LANGUAGE", sequence = 0},
  7445. {text = "MOVIES_BUTTON", menu = "", sequence = 2},
  7446. {text = "SOUND_BUTTON", menu = "OPTIONS_SOUND", sequence = 1},
  7447. }
  7448. function onStartOptionClick()
  7449. Infinity_PlaySound('GAM_09')
  7450. if(selectedMenuOpt == 1 and startEngine:GetCampaign() == const.START_CAMPAIGN_SOD) then
  7451. Infinity_PushMenu( 'SODCREDIT' )
  7452. --If in SOD, display the end credits
  7453. --Infinity_PopMenu('START_OPTIONS')
  7454. --chapterScreen:StartTextScreen( "25ecred" )
  7455. --e:SelectEngine(chapterScreen)
  7456. selectedMenuOpt = NIL
  7457. return
  7458. end
  7459.  
  7460. if OptionsButtons[selectedMenuOpt].menu ~= '' then
  7461. Infinity_PushMenu( OptionsButtons[selectedMenuOpt].menu )
  7462. else
  7463. e:SelectEngine(moviesScreen)
  7464. end
  7465. selectedMenuOpt = NIL
  7466. end
  7467. `
  7468. menu
  7469. {
  7470. name 'START_OPTIONS'
  7471. align center center
  7472. ignoreEsc
  7473. onopen
  7474. "
  7475. Infinity_PlayMovie('flames','flames3')
  7476. "
  7477. size 1024 768
  7478.  
  7479. label
  7480. {
  7481. --center this under the menu
  7482. --(2160/2) - (768/2) = 696
  7483. area 660 -696 390 2160
  7484. bam "STRTSIDE"
  7485. frame lua "getSidebarFrame()"
  7486. }
  7487.  
  7488. label
  7489. {
  7490. area 152 252 378 376
  7491. bam "BIGLOGO"
  7492. sequence 0
  7493. frame lua "getBigLogo()"
  7494. }
  7495.  
  7496.  
  7497. label
  7498. {
  7499. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_BG"
  7500. area 90 78 510 130
  7501. bam 'TITLE'
  7502. sequence 0
  7503. frame 0
  7504. }
  7505. label
  7506. {
  7507. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_SOD"
  7508. area 94 40 494 194
  7509. bam 'TITLE'
  7510. sequence 0
  7511. frame 1
  7512. }
  7513. label
  7514. {
  7515. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_BP"
  7516. area 94 127 504 62
  7517. bam 'TITLE'
  7518. sequence 0
  7519. frame 2
  7520. }
  7521.  
  7522. label
  7523. {
  7524. area 210 692 271 42
  7525. mosaic "DNDLOGO"
  7526. }
  7527.  
  7528.  
  7529. list
  7530. {
  7531.  
  7532. column
  7533. {
  7534. width 100
  7535. label
  7536. {
  7537. area 0 0 -1 45
  7538. text lua "t( OptionsButtons[rowNumber].text )"
  7539. text style "button"
  7540. bam STARTBUT
  7541. sequence lua "getCampaignButtonSequence()"
  7542. frame lua "selectedMenuOpt == rowNumber"
  7543. align center center
  7544. }
  7545. }
  7546.  
  7547. area 732 240 268 332
  7548.  
  7549. rowheight 54
  7550. table "OptionsButtons"
  7551. var selectedMenuOpt
  7552. scrollbar 'GUISCRC'
  7553. hidehighlight
  7554.  
  7555. action
  7556. "
  7557. onStartOptionClick()
  7558. "
  7559. }
  7560.  
  7561. button
  7562. {
  7563. on escape
  7564. sequence lua "getCampaignButtonSequence()"
  7565. area 732 578 249 45
  7566. bam STARTBUT
  7567. pad 10 8 10 8
  7568. text style "button"
  7569. text "BACK_BUTTON"
  7570. action
  7571. "
  7572. Infinity_PopMenu()
  7573. e:SelectEngine(startEngine)
  7574. "
  7575. }
  7576. movie
  7577. {
  7578. enabled "startEngine:GetCampaign() == const.START_CAMPAIGN_SOD"
  7579. name "flames3"
  7580. area 86 222 512 512
  7581. loop
  7582. }
  7583. label
  7584. {
  7585. area 816 692 94 47
  7586. text style "normal"
  7587. text align center center
  7588. text lua "CBaldurChitin:GetVersionString()"
  7589. }
  7590. }
  7591.  
  7592. `
  7593.  
  7594. function magePageInfo()
  7595. if bookMode == 0 then -- Regular
  7596. if characters[id].hasSorcererBook then
  7597. return t("SPELLS_CAN_CAST_LABEL") .. ": " .. characters[id].mageDetails[currentSpellLevel].slotsRemaining .. "/" .. characters[id].mageDetails[currentSpellLevel].maxMemorized
  7598. else
  7599. return t("MEMORIZED_LABEL") .. ": " .. #bottomSpells .. "/" .. characters[id].mageDetails[currentSpellLevel].maxMemorized
  7600. end
  7601. elseif bookMode == 1 then -- Sequencer/Contingency
  7602. return t("SPELLS_LABEL") .. " :" .. #bottomSpells .. "/" .. #bottomSpellsPlaceHolder
  7603.  
  7604. end
  7605. return ""
  7606. end
  7607.  
  7608. contingencyDescription = 0
  7609.  
  7610. function mageBookDescription()
  7611. if mageBookEnabled == true then
  7612. if bookMode == 0 then
  7613. if characters[id].mageSpells[currentSpellLevel][currentBookSpell] then
  7614. return Infinity_FetchString(characters[id].mageSpells[currentSpellLevel][currentBookSpell].description)
  7615. else
  7616. return t('SPELL_MEMORIZATION_HELP')
  7617. end
  7618. elseif bookMode == 1 then
  7619. if contingencyDescription == 0 and currentBookSpell ~= 0 then
  7620. return Infinity_FetchString(bookSpells[currentBookSpell].description)
  7621. else
  7622. lastCurrentBookSpell = 0
  7623. if contingencyDescription == 0 then
  7624. contingencyDescription = mageBookStrings[contingencyResRef].tip
  7625. end
  7626. return Infinity_FetchString(contingencyDescription)
  7627. end
  7628. end
  7629. end
  7630. return ""
  7631. end
  7632. function mageBookTitle()
  7633. if bookMode == 1 and mageBookStrings[contingencyResRef] then
  7634. return t(mageBookStrings[contingencyResRef].title)
  7635. else
  7636. return t('MAGE_SPELLS_TITLE')
  7637. end
  7638. end
  7639. function mageBookAction()
  7640. if bookMode == 1 and mageBookStrings[contingencyResRef] then
  7641. return t(mageBookStrings[contingencyResRef].action)
  7642. else
  7643. return t("MAGE_BOOK_LABEL")
  7644. end
  7645. end
  7646.  
  7647.  
  7648. function makeBlankTable(num)
  7649. local out = {}
  7650. for i = 1,num do
  7651. table.insert(out, {})
  7652. end
  7653. return out
  7654. end
  7655.  
  7656. function contingencyComplete()
  7657. if showContingency then
  7658. return #bottomSpells == #bottomSpellsPlaceHolder and (currentContingencyCondition or 0) > 0 and (currentContingencyTarget or 0) > 0
  7659. else
  7660. return #bottomSpells == #bottomSpellsPlaceHolder
  7661. end
  7662. end
  7663.  
  7664. function contingencyDoneButtonText()
  7665. if contingencyComplete() then
  7666. return t("DONE_BUTTON")
  7667. else
  7668. return t("CANCEL_BUTTON")
  7669. end
  7670. end
  7671.  
  7672. function filterMemorizedMageSpells()
  7673. local out = {}
  7674. currentSpellLevel = math.min(currentSpellLevel, 9)
  7675. for k,v in pairs(characters[id].mageSpells[currentSpellLevel]) do
  7676. for i=v.memorizedCount, 1, -1 do
  7677. local spell = deepcopy(v)
  7678. if(i <= v.castableCount) then
  7679. spell.castable = 1
  7680. else
  7681. spell.castable = 0
  7682. end
  7683. table.insert(out, spell)
  7684. end
  7685. end
  7686. return out
  7687. end
  7688.  
  7689. function tableInsert(out, v)
  7690. if mageScreen:SpellSwappedInContingency(v.resref) then
  7691. for key,value in pairs(contingencySwapTable) do
  7692. value.castableCount = v.castableCount
  7693. table.insert(out, value)
  7694. end
  7695. else
  7696. table.insert(out, v)
  7697. end
  7698. end
  7699.  
  7700. function filterContingencyMageSpells()
  7701. local out = {}
  7702. if characters[id].mageSpells ~= nil and characters[id].mageSpells[currentSpellLevel] ~= nil then
  7703. for k,v in pairs(characters[id].mageSpells[currentSpellLevel]) do
  7704. if v.castableCount > 0 and mageScreen:SpellAllowedForContingency(v.level, v.resref) then
  7705. tableInsert(out, v)
  7706. end
  7707. end
  7708. end
  7709. if characters[id].priestSpells ~= nil and characters[id].priestSpells[currentSpellLevel] ~= nil then
  7710. for k,v in pairs(characters[id].priestSpells[currentSpellLevel]) do
  7711. if v.castableCount > 0 and mageScreen:SpellAllowedForContingency(v.level, v.resref) then
  7712. tableInsert(out, v)
  7713. end
  7714. end
  7715. end
  7716. return out
  7717. end
  7718.  
  7719. function findFirstDifferenceInSpellList(oldList, newList)
  7720. local ret = -1
  7721. local spellIndex = 1
  7722.  
  7723. if oldList ~= nil and newList ~= nil then
  7724. while oldList[spellIndex] ~= nil do
  7725. if newList[spellIndex] == nil then
  7726. print("New list empty at point "..spellIndex)
  7727. ret = spellIndex
  7728. break
  7729. end
  7730. if oldList[spellIndex].icon ~= newList[spellIndex].icon then
  7731. print("Lists differ at point "..spellIndex.." "..oldList[spellIndex].icon.." vs "..newList[spellIndex].icon)
  7732. ret = spellIndex
  7733. break
  7734. end
  7735. spellIndex = spellIndex + 1
  7736. end
  7737. if oldList[spellIndex] == nil and newList[spellIndex] ~= nil then
  7738. print("New list has a new spell at point "..spellIndex)
  7739. ret = spellIndex
  7740. end
  7741. end
  7742.  
  7743. return ret
  7744. end
  7745.  
  7746. showMageMemorizationFlash = false
  7747.  
  7748. function refreshMageBook()
  7749. if currentSpellLevel == nil then
  7750. currentSpellLevel = 1
  7751. end
  7752. if bookMode == 0 then
  7753. if characters[id].hasMageBook then
  7754. bookSpells = characters[id].mageSpells[currentSpellLevel]
  7755. newBottomSpells = filterMemorizedMageSpells()
  7756.  
  7757. if showMageMemorizationFlash == true then
  7758. createMageMemorizationSparkle(0,0,36,36,"memorizedListMage", findFirstDifferenceInSpellList(bottomSpells, newBottomSpells))
  7759. showMageMemorizationFlash = false
  7760. end
  7761. bottomSpells = newBottomSpells
  7762. bottomSpellsPlaceHolder = makeBlankTable(characters[id].mageDetails[currentSpellLevel].maxMemorized)
  7763. else
  7764. bookSpells = characters[id].mageSpells[currentSpellLevel]
  7765. bottomSpells = {}
  7766. bottomSpellsPlaceHolder = {}
  7767. end
  7768. elseif bookMode == 1 then
  7769. bookSpells = filterContingencyMageSpells()
  7770. bottomSpells = sequencerSpells
  7771. bottomSpellsPlaceHolder = makeBlankTable(contingencyMaxSpells)
  7772. contingencyDescription = mageBookStrings[contingencyResRef].tip
  7773. end
  7774. end
  7775.  
  7776. function setMageBookLevel(num)
  7777. lastCurrentBookSpell = 0
  7778. currentBookSpell = 0
  7779. currentSpellLevel = num
  7780. mageScreen:SetSpellLevel(num-1)
  7781. refreshMageBook()
  7782. end
  7783.  
  7784. currentAnimationID = 1
  7785. updateCounterMemorizationSparkles = 1
  7786.  
  7787. function updateMemorizationSparkles()
  7788. local sparkleNumber = 1
  7789. updateCounterMemorizationSparkles = updateCounterMemorizationSparkles + 1
  7790. if updateCounterMemorizationSparkles > 2 then
  7791. updateCounterMemorizationSparkles = 1
  7792. for sparkleNumber = 1, #(memorizationFlashes), 1 do
  7793. if memorizationFlashes[sparkleNumber][1] == true then
  7794. memorizationFlashes[sparkleNumber][2] = memorizationFlashes[sparkleNumber][2] + 1
  7795. if memorizationFlashes[sparkleNumber][2] > 7 then
  7796. memorizationFlashes[sparkleNumber][1] = false
  7797. memorizationFlashes[sparkleNumber][2] = 0
  7798. memorizationFlashes[sparkleNumber][3] = true
  7799. end
  7800. end
  7801. end
  7802. end
  7803. end
  7804.  
  7805. function destroyMemorizationSparkle(instanceId)
  7806. local ret = memorizationFlashes[instanceId][3]
  7807. memorizationFlashes[instanceId][3] = false
  7808. return ret
  7809. end
  7810.  
  7811. function showMemorizationSparkle(instanceId)
  7812. updateMemorizationSparkles()
  7813. return memorizationFlashes[instanceId][1]
  7814. end
  7815.  
  7816. function createMageMemorizationSparkle(x,y,w,h, fromList, listIndex)
  7817. Infinity_InstanceAnimation("TEMPLATE_mageMemorizationSparkle","FLASHBR",x,y,w,h,fromList,listIndex)
  7818. memorizationFlashes[currentAnimationID][1] = true
  7819. memorizationFlashes[currentAnimationID][3] = false
  7820. currentAnimationID = currentAnimationID + 1
  7821. if currentAnimationID > #(memorizationFlashes) then
  7822. currentAnimationID = 1
  7823. end
  7824. end
  7825.  
  7826. function findMemorizedUncastable(resref)
  7827. local index = 1
  7828. local sparkle = -1
  7829. for index = 1, #(bottomSpells), 1 do
  7830. if bottomSpells[index].resref == resref then
  7831. if bottomSpells[index].castable == 0 then
  7832. sparkle = index
  7833. break
  7834. end
  7835. end
  7836. end
  7837.  
  7838. return sparkle
  7839. end
  7840.  
  7841. function unmemorizingMageSpell(resref)
  7842. local index = 1
  7843. local sparkle = -1
  7844. for index = 1, #(bottomSpells), 1 do
  7845. if bottomSpells[index].resref == resref then
  7846. sparkle = index
  7847. if bottomSpells[index].castable == 0 then
  7848. break
  7849. end
  7850. end
  7851. end
  7852.  
  7853. createMageMemorizationSparkle(0, 0, 36, 36, 'memorizedListMage', sparkle)
  7854. end
  7855.  
  7856. function unmemorizeMageSpell(slot)
  7857. showMageMemorizationFlash = false
  7858. mageScreen:UnmemorizeSpell( bottomSpells[slot].level, bottomSpells[slot].memorizedIndex )
  7859. Infinity_PlaySound('GAM_44')
  7860. end
  7861.  
  7862. memorizationFlashes =
  7863. {
  7864. {false, 0, false},
  7865. {false, 0, false},
  7866. {false, 0, false},
  7867. {false, 0, false},
  7868. {false, 0, false},
  7869. {false, 0, false},
  7870. {false, 0, false},
  7871. {false, 0, false},
  7872. {false, 0, false},
  7873. {false, 0, false}
  7874. }
  7875.  
  7876. `
  7877.  
  7878.  
  7879. menu
  7880. {
  7881. name 'MAGE'
  7882. align center center
  7883. modal lua "bookMode == 1"
  7884.  
  7885. onopen "
  7886. showMageMemorizationFlash = false
  7887. mgpage = nil
  7888. setMageBookLevel(1)
  7889. if showContingency then
  7890. Infinity_SetArea('bookListMage', nil, 374, nil, 200)
  7891. Infinity_SetArea('bookDescription', nil, 374, nil, 200)
  7892. else
  7893. Infinity_SetArea('bookListMage', nil, 174, nil, 400)
  7894. Infinity_SetArea('bookDescription', nil, 174, nil, 400)
  7895. end
  7896. if bookMode == 1 then
  7897. contingencyDescription = mageBookStrings[contingencyResRef].tip
  7898. end
  7899. currentContingencyCondition = 0
  7900. currentContingencyTarget = 0
  7901. currentAnimationID = 1
  7902. updateCounterMemorizationSparkles = 1
  7903. "
  7904. onclose "
  7905. "
  7906.  
  7907. button
  7908. {
  7909. enabled "CurrentlyInGame()"
  7910. on escape
  7911. action
  7912. "
  7913. --Return to world screen on escape
  7914. e:SelectEngine(worldScreen)
  7915. "
  7916. }
  7917.  
  7918. template
  7919. {
  7920. label
  7921. {
  7922. enabled "showMemorizationSparkle(instanceId)"
  7923. ignoreEvents
  7924. area 0 0 45 42
  7925. bam "FLASHBR"
  7926. usealpha lua "true"
  7927. frame lua "memorizationFlashes[instanceId][2]"
  7928. align center center
  7929. }
  7930. name "TEMPLATE_mageMemorizationSparkle"
  7931. }
  7932.  
  7933.  
  7934. label
  7935. {
  7936. area 0 0 864 710
  7937. mosaic "GUIMGB2"
  7938. }
  7939. label
  7940. {
  7941. area 82 10 700 44
  7942. text lua "mageBookTitle()"
  7943. text style "title"
  7944. }
  7945. label
  7946. {
  7947. area 210 59 446 30
  7948. text lua "mageBookAction()"
  7949. text style "label"
  7950. }
  7951. button
  7952. {
  7953. area 168 110 54 54
  7954. bam GUIPRTC
  7955. highlightgroup mgpage
  7956. sequence 0
  7957. enabled "maxMagePage > 0"
  7958. action "setMageBookLevel(1)"
  7959. }
  7960. button
  7961. {
  7962. area 227 110 54 54
  7963. bam GUIPRTC
  7964. highlightgroup mgpage
  7965. sequence 1
  7966. enabled "maxMagePage > 1"
  7967. action "setMageBookLevel(2)"
  7968. }
  7969. button
  7970. {
  7971. area 286 110 54 54
  7972. bam GUIPRTC
  7973. highlightgroup mgpage
  7974. sequence 2
  7975. enabled "maxMagePage > 2"
  7976. action "setMageBookLevel(3)"
  7977. }
  7978. button
  7979. {
  7980. area 345 110 54 54
  7981. bam GUIPRTC
  7982. highlightgroup mgpage
  7983. sequence 3
  7984. enabled "maxMagePage > 3"
  7985. action "setMageBookLevel(4)"
  7986. }
  7987. button
  7988. {
  7989. area 404 110 54 54
  7990. bam GUIPRTC
  7991. highlightgroup mgpage
  7992. sequence 4
  7993. enabled "maxMagePage > 4"
  7994. action "setMageBookLevel(5)"
  7995. }
  7996. button
  7997. {
  7998. area 464 110 54 54
  7999. bam GUIPRTC
  8000. highlightgroup mgpage
  8001. sequence 5
  8002. enabled "maxMagePage > 5"
  8003. action "setMageBookLevel(6)"
  8004. }
  8005. button
  8006. {
  8007. area 523 110 54 54
  8008. bam GUIPRTC
  8009. highlightgroup mgpage
  8010. sequence 6
  8011. enabled "maxMagePage > 6"
  8012. action "setMageBookLevel(7)"
  8013. }
  8014. button
  8015. {
  8016. area 583 110 54 54
  8017. bam GUIPRTC
  8018. highlightgroup mgpage
  8019. sequence 7
  8020. enabled "maxMagePage > 7"
  8021. action "setMageBookLevel(8)"
  8022. }
  8023. button
  8024. {
  8025. area 644 110 54 54
  8026. bam GUIPRTC
  8027. highlightgroup mgpage
  8028. sequence 8
  8029. enabled "maxMagePage > 8"
  8030. action "setMageBookLevel(9)"
  8031. }
  8032.  
  8033. list
  8034. {
  8035. column
  8036. {
  8037. width 15
  8038. label
  8039. {
  8040. area 0 0 -1 -1
  8041. bam lua "bookSpells[rowNumber].icon"
  8042. align center center
  8043. }
  8044. }
  8045. column
  8046. {
  8047. width 85
  8048. label
  8049. {
  8050. area 0 0 -1 -1
  8051. text lua "Infinity_FetchString( bookSpells[rowNumber].name)"
  8052. text style "normal_parchment"
  8053. text align left center
  8054. }
  8055. }
  8056.  
  8057. area 94 174 316 400
  8058.  
  8059. name "bookListMage"
  8060. rowheight 40
  8061. table "bookSpells"
  8062. var currentBookSpell
  8063. scrollbar 'GUISCRC'
  8064. action
  8065. "
  8066. contingencyDescription = 0
  8067. if cellNumber == 1 then
  8068. if bookMode == 0 then
  8069. if #bottomSpells < #bottomSpellsPlaceHolder then
  8070. createMageMemorizationSparkle(1, 0, 40, 40, 'bookListMage', -1)
  8071. Infinity_PlaySound('GAM_24')
  8072. showMageMemorizationFlash = true
  8073. end
  8074. mageScreen:MemorizeSpell( bookSpells[currentBookSpell].level, bookSpells[currentBookSpell].index )
  8075. elseif bookMode == 1 and #bottomSpells < #bottomSpellsPlaceHolder then
  8076. mageScreen:SequenceSpell( bookSpells[currentBookSpell].resref, bookSpells[currentBookSpell].masterResref )
  8077. end
  8078. end
  8079. if lastCurrentBookSpell == currentBookSpell and cellNumber == 2 then
  8080. currentBookSpell = 0
  8081. contingencyDescription = mageBookStrings[contingencyResRef].tip
  8082. else
  8083. lastCurrentBookSpell = currentBookSpell
  8084. end
  8085. "
  8086. actionalt
  8087. "
  8088. if cellNumber == 1 and bookMode == 0 and characters[id].hasSorcererBook == false then
  8089. popup2Button(24485, 'REMOVE_BUTTON', function() mageScreen:EraseKnownSpell(bookSpells[currentBookSpell].resref) end)
  8090. end
  8091. "
  8092.  
  8093. }
  8094. label
  8095. {
  8096. area 100 178 314 192
  8097. rectangle 1
  8098. rectangle opacity 200
  8099. enabled "showContingency"
  8100. }
  8101.  
  8102. label
  8103. {
  8104. area 104 182 310 48
  8105. enabled "showContingency"
  8106. text "CONDITION_NORMAL"
  8107. text style "normal"
  8108. }
  8109. list
  8110. {
  8111. column
  8112. {
  8113. width 100
  8114. label
  8115. {
  8116. area 10 0 -1 -1
  8117. text lua "Infinity_FetchString( contingencyConditions[rowNumber].strref)"
  8118. text style "normal"
  8119. text align left center
  8120. }
  8121. }
  8122.  
  8123. area 104 224 310 141
  8124.  
  8125. enabled "showContingency"
  8126. rowheight 40
  8127. table "contingencyConditions"
  8128. var currentContingencyCondition
  8129. scrollbar 'GUISCRC'
  8130. action
  8131. "
  8132. contingencyDescription = contingencyConditions[currentContingencyCondition].desc
  8133. "
  8134.  
  8135. }
  8136. label
  8137. {
  8138. area 452 176 322 193
  8139. rectangle 1
  8140. rectangle opacity 200
  8141. enabled "showContingency"
  8142. }
  8143. label
  8144. {
  8145. area 464 176 310 48
  8146. enabled "showContingency"
  8147. text "TARGET_NORMAL"
  8148. text style "normal"
  8149. }
  8150. list
  8151. {
  8152. column
  8153. {
  8154. width 100
  8155. label
  8156. {
  8157. area 10 0 -1 -1
  8158. text lua "Infinity_FetchString( contingencyTargets[rowNumber].strref)"
  8159. text style "normal"
  8160. text align left center
  8161. }
  8162. }
  8163.  
  8164. area 458 228 316 141
  8165.  
  8166. enabled "showContingency"
  8167. rowheight 40
  8168. table "contingencyTargets"
  8169. var currentContingencyTarget
  8170. scrollbar 'GUISCRC'
  8171. action
  8172. "
  8173. contingencyDescription = contingencyTargets[currentContingencyTarget].desc
  8174. "
  8175. }
  8176.  
  8177. text
  8178. {
  8179. name "bookDescription"
  8180. area 452 174 316 400
  8181. text lua "mageBookDescription()"
  8182. text style "normal_parchment"
  8183. scrollbar 'GUISCRC'
  8184. }
  8185.  
  8186. list
  8187. {
  8188. column
  8189. {
  8190. width 100
  8191. label
  8192. {
  8193. area 0 0 -1 -1
  8194. bam "SPELFRMS"
  8195. sequence 0
  8196. align center center
  8197. }
  8198. }
  8199.  
  8200. area 72 658 714 36
  8201.  
  8202. enabled "#bottomSpellsPlaceHolder ~= 0 or bookMode == 1"
  8203. rowwidth 36
  8204. table "bottomSpellsPlaceHolder"
  8205. }
  8206. list
  8207. {
  8208. column
  8209. {
  8210. width 100
  8211. label
  8212. {
  8213. area 0 0 -1 -1
  8214. bam lua "bottomSpells[rowNumber].icon"
  8215. align center center
  8216. greyscale lua "bottomSpells[rowNumber].castable == 0"
  8217. }
  8218. }
  8219.  
  8220. area 72 658 718 36
  8221.  
  8222. name "memorizedListMage"
  8223. enabled "#bottomSpells ~= 0"
  8224. rowwidth 36
  8225. table "bottomSpells"
  8226. var currentBottomSpell
  8227. action
  8228. "
  8229. if bookMode == 0 then
  8230. if findMemorizedUncastable(bottomSpells[currentBottomSpell].resref) == -1 and Infinity_GetOption(41, 9) ~= 0 then
  8231. popup2Button(11824, 'REMOVE_BUTTON', function() unmemorizeMageSpell(currentBottomSpell) end, 'CANCEL_BUTTON')
  8232. else
  8233. unmemorizeMageSpell(currentBottomSpell)
  8234. end
  8235. elseif bookMode == 1 then
  8236. mageScreen:UnSequenceSpell( bottomSpells[currentBottomSpell].resref, bottomSpells[currentBottomSpell].masterResref )
  8237. table.remove(sequencerSpells, currentBottomSpell)
  8238. bottomSpells = sequencerSpells
  8239. currentBottomSpell = 0
  8240. end
  8241. "
  8242. }
  8243.  
  8244.  
  8245. label
  8246. {
  8247. area 282 594 300 40
  8248. text lua "magePageInfo()"
  8249. text style "label"
  8250. rectangle 0
  8251. }
  8252.  
  8253. button
  8254. {
  8255. area 582 594 230 40
  8256. enabled "bookMode == 0 and (#characters[id].contingencySpells > 0 or #characters[id].sequencerSpells > 0)"
  8257. bam GUIBUTMT
  8258. text "CONTINGENCY_BUTTON"
  8259. text style "button"
  8260. action "Infinity_PushMenu('MAGE_CONTINGENCY')"
  8261.  
  8262. }
  8263. button
  8264. {
  8265. area 52 594 230 40
  8266. bam GUIBUTMT
  8267. enabled "bookMode == 1 or characters[id].hasMageBook"
  8268. clickable lua "#bottomSpells < #bottomSpellsPlaceHolder and currentBookSpell ~= 0"
  8269. text "MEMORIZE_BUTTON"
  8270. text style "button"
  8271. action
  8272. "
  8273. if bookMode == 0 then
  8274. createMageMemorizationSparkle(1, 0, 40, 40, 'bookListMage', -1)
  8275. showMageMemorizationFlash = true
  8276. Infinity_PlaySound('GAM_24')
  8277. mageScreen:MemorizeSpell( characters[id].mageSpells[currentSpellLevel][currentBookSpell].level, characters[id].mageSpells[currentSpellLevel][currentBookSpell].index )
  8278. elseif bookMode == 1 then
  8279. mageScreen:SequenceSpell( bookSpells[currentBookSpell].resref, bookSpells[currentBookSpell].masterResref )
  8280. end
  8281.  
  8282. "
  8283.  
  8284. }
  8285.  
  8286. button
  8287. {
  8288. area 582 594 230 40
  8289. enabled "bookMode == 1"
  8290. bam GUIBUTMT
  8291. text lua "contingencyDoneButtonText()"
  8292.  
  8293. text style "button"
  8294. action
  8295. "
  8296. if contingencyComplete() then
  8297. mageScreen:DoneSequencingSpells()
  8298. else
  8299. mageScreen:CancelSequencingSpells()
  8300. end
  8301. e:SelectEngine(worldScreen)
  8302. "
  8303.  
  8304. }
  8305.  
  8306. label
  8307. {
  8308. area 0 0 865 710
  8309. fill 0 0 0 176
  8310. enabled "mageBookEnabled == false"
  8311. }
  8312.  
  8313. }
  8314.  
  8315. `
  8316. function refreshMageContingency()
  8317. preparedSpells = {}
  8318. for k, v in pairs(characters[id].contingencySpells) do
  8319. table.insert(preparedSpells, v)
  8320. end
  8321. for k, v in pairs(characters[id].sequencerSpells) do
  8322. table.insert(preparedSpells, v)
  8323. end
  8324.  
  8325. end
  8326. `
  8327.  
  8328. menu
  8329. {
  8330. name 'MAGE_CONTINGENCY'
  8331.  
  8332. align center center
  8333. modal
  8334.  
  8335. onopen "refreshMageContingency()"
  8336.  
  8337. label
  8338. {
  8339. area 0 0 864 710
  8340. mosaic "GUIPOPF"
  8341. }
  8342. label --Title
  8343. {
  8344. area 40 104 790 106
  8345. text "SPELLS_PREPARED_LABEL"
  8346. text style "label"
  8347. text align left top
  8348. }
  8349. label
  8350. {
  8351. area 60 37 744 44
  8352. text "CONTINGENCY_TITLE"
  8353. text style "title"
  8354. }
  8355. label
  8356. {
  8357. area 238 258 190 36
  8358. text "CONDITION_LABEL"
  8359. text style "label"
  8360. text align left center
  8361. }
  8362. label
  8363. {
  8364. area 428 258 200 36
  8365. text "TARGET_LABEL"
  8366. text style "label"
  8367. text align left center
  8368. }
  8369.  
  8370. label
  8371. {
  8372. area 628 258 196 36
  8373. text "SPELL_LABEL"
  8374. text style "label"
  8375. text align left center
  8376. }
  8377.  
  8378. list
  8379. {
  8380. column
  8381. {
  8382. width 25
  8383. label
  8384. {
  8385. area 0 0 -1 -1
  8386. text lua "t(mageBookStrings[preparedSpells[rowNumber].resref].title)"
  8387. text style "label"
  8388. align left center
  8389. }
  8390.  
  8391. }
  8392. column
  8393. {
  8394. width 25
  8395. label
  8396. {
  8397. area 0 0 -1 -1
  8398. text lua "Infinity_FetchString(preparedSpells[rowNumber].condition)"
  8399. text style "label"
  8400. align left center
  8401. }
  8402.  
  8403. }
  8404. column
  8405. {
  8406. width 25
  8407. label
  8408. {
  8409. area 0 0 -1 -1
  8410. text lua "Infinity_FetchString(preparedSpells[rowNumber].target)"
  8411. text style "label"
  8412. align left center
  8413. }
  8414.  
  8415. }
  8416.  
  8417. column
  8418. {
  8419. width 5
  8420. label
  8421. {
  8422. enabled "preparedSpells[rowNumber].spells[1] ~= nil"
  8423. area 0 0 -1 -1
  8424. bam lua "preparedSpells[rowNumber].spells[1].icon"
  8425. align center center
  8426. }
  8427. }
  8428. column
  8429. {
  8430. width 5
  8431. label
  8432. {
  8433. enabled "preparedSpells[rowNumber].spells[2] ~= nil"
  8434. area 0 0 -1 -1
  8435. bam lua "preparedSpells[rowNumber].spells[2].icon"
  8436. align center center
  8437. }
  8438. }
  8439. column
  8440. {
  8441. width 5
  8442. label
  8443. {
  8444. enabled "preparedSpells[rowNumber].spells[3] ~= nil"
  8445. area 0 0 -1 -1
  8446. bam lua "preparedSpells[rowNumber].spells[3].icon"
  8447. align center center
  8448. }
  8449. }
  8450. column
  8451. {
  8452. width 5
  8453. label
  8454. {
  8455. area 0 0 -1 -1
  8456. bam "GUISTMPC"
  8457. sequence 2
  8458. align center center
  8459. enabled "preparedSpells[rowNumber].dispellable"
  8460. }
  8461. }
  8462.  
  8463. area 44 294 780 300
  8464.  
  8465. rowheight 56
  8466. table "preparedSpells"
  8467. var "currentContingencySpell"
  8468. action "
  8469. if (cellNumber == 7) and preparedSpells[currentContingencySpell].dispellable then
  8470. popup2Button(24398, 'YES_BUTTON', function() mageScreen:OnDispellButtonClick(currentContingencySpell) end, 'NO_BUTTON')
  8471. end
  8472. "
  8473. }
  8474.  
  8475.  
  8476. button
  8477. {
  8478. area 316 650 230 40
  8479. bam GUIBUTMT
  8480. text "DONE_BUTTON"
  8481. text style "button"
  8482. action "Infinity_PopMenu('MAGE_CONTINGENCY')"
  8483. }
  8484. }
  8485.  
  8486. menu
  8487. {
  8488. name "POPUP_DETAILS"
  8489. align center center
  8490. modal
  8491.  
  8492. label
  8493. {
  8494. area 0 0 864 710
  8495. mosaic "GUIINVHI"
  8496. }
  8497. label
  8498. {
  8499. area 82 10 700 44
  8500. text lua "Infinity_FetchString(PopupDetails.title)"
  8501. text style "title"
  8502. }
  8503. label
  8504. {
  8505. area 278 67 310 50
  8506. text lua "Infinity_FetchString(PopupDetails.name)"
  8507. text style "label"
  8508. }
  8509. text
  8510. {
  8511. area 62 178 736 348
  8512. text lua "Infinity_FetchString(PopupDetails.description)"
  8513. text style "parchment"
  8514. scrollbar 'GUISCRC'
  8515. }
  8516. label
  8517. {
  8518. area 95 70 52 52
  8519. bam lua "PopupDetails.icon"
  8520. align center center
  8521. sequence 0
  8522. }
  8523. button
  8524. {
  8525. area 317 653 230 40
  8526. bam GUIBUTMT
  8527. text "DONE_BUTTON"
  8528. text style "button"
  8529.  
  8530. on escape
  8531. action
  8532. "
  8533. Infinity_PopMenu('POPUP_DETAILS')
  8534. "
  8535. }
  8536.  
  8537. }
  8538.  
  8539.  
  8540. `
  8541. function priestPageInfo()
  8542. if characters[id].hasShamanBook then
  8543. return t("SPELLS_CAN_CAST_LABEL") .. ": " .. characters[id].priestDetails[currentSpellLevel].slotsRemaining .. "/" .. characters[id].priestDetails[currentSpellLevel].maxMemorized
  8544. else
  8545. return t("MEMORIZED_LABEL") .. ": " .. #bottomSpells .. "/" .. characters[id].priestDetails[currentSpellLevel].maxMemorized
  8546. end
  8547. end
  8548.  
  8549. function priestBookDescription()
  8550. if priestBookEnabled == true then
  8551. if characters[id].priestSpells[currentSpellLevel][currentBookSpell] then
  8552. return Infinity_FetchString(characters[id].priestSpells[currentSpellLevel][currentBookSpell].description)
  8553. else
  8554. return t('SPELL_MEMORIZATION_HELP')
  8555. end
  8556. end
  8557. return ""
  8558. end
  8559.  
  8560. function filterMemorizedPriestSpells()
  8561. local out = {}
  8562. currentSpellLevel = math.min(currentSpellLevel, 7)
  8563. for k,v in pairs(characters[id].priestSpells[currentSpellLevel]) do
  8564. for i=v.memorizedCount, 1, -1 do
  8565. local spell = deepcopy(v)
  8566. if(i <= v.castableCount) then
  8567. spell.castable = 1
  8568. else
  8569. spell.castable = 0
  8570. end
  8571. table.insert(out, spell)
  8572. end
  8573. end
  8574. return out
  8575. end
  8576.  
  8577.  
  8578. showPriestMemorizationFlash = false
  8579.  
  8580. function refreshPriestBook()
  8581. if currentSpellLevel == nil then
  8582. currentSpellLevel = 1
  8583. end
  8584. if characters[id].hasClericBook then
  8585. newBottomSpells = filterMemorizedPriestSpells()
  8586.  
  8587. if showPriestMemorizationFlash == true then
  8588. createPriestMemorizationSparkle(0,0,36,36,"memorizedListPriest", findFirstDifferenceInSpellList(bottomSpells, newBottomSpells))
  8589. showPriestMemorizationFlash = false
  8590. end
  8591. bottomSpells = newBottomSpells
  8592. bottomSpellsPlaceHolder = makeBlankTable(characters[id].priestDetails[currentSpellLevel].maxMemorized)
  8593. else
  8594. bottomSpells = {}
  8595. bottomSpellsPlaceHolder = {}
  8596. end
  8597. end
  8598.  
  8599. function setPriestBookLevel(num)
  8600. lastCurrentBookSpell = 0
  8601. currentBookSpell = 0
  8602. currentSpellLevel = num
  8603. refreshPriestBook()
  8604. end
  8605.  
  8606. function createPriestMemorizationSparkle(x,y,w,h, fromList, listIndex)
  8607. Infinity_InstanceAnimation("TEMPLATE_priestMemorizationSparkle","FLASHBR",x,y,w,h,fromList,listIndex)
  8608. memorizationFlashes[currentAnimationID][1] = true
  8609. memorizationFlashes[currentAnimationID][3] = false
  8610. currentAnimationID = currentAnimationID + 1
  8611. if currentAnimationID > #(memorizationFlashes) then
  8612. currentAnimationID = 1
  8613. end
  8614. end
  8615.  
  8616. function unmemorizingPriestSpell(resref)
  8617. local index = 1
  8618. local sparkle = -1
  8619. for index = 1, #(bottomSpells), 1 do
  8620. if bottomSpells[index].resref == resref then
  8621. sparkle = index
  8622. if bottomSpells[index].castable == 0 then
  8623. break
  8624. end
  8625. end
  8626. end
  8627.  
  8628. createPriestMemorizationSparkle(0, 0, 36, 36, 'memorizedListPriest', sparkle)
  8629. end
  8630.  
  8631. function unmemorizePriestSpell(slot)
  8632. showPriestMemorizationFlash = false
  8633. priestScreen:UnmemorizeSpell( bottomSpells[slot].level, bottomSpells[slot].memorizedIndex )
  8634. Infinity_PlaySound('GAM_44')
  8635. end
  8636.  
  8637. `
  8638. menu
  8639. {
  8640. name 'PRIEST'
  8641. align center center
  8642.  
  8643. onopen
  8644. "
  8645. showPriestMemorizationFlash = false
  8646. pushSidebars()
  8647. prpage = nil
  8648. setPriestBookLevel(1)
  8649. currentAnimationID = 1
  8650. updateCounterMemorizationSparkles = 1
  8651. "
  8652. onclose
  8653. "
  8654. popSidebars()
  8655. "
  8656.  
  8657. button
  8658. {
  8659. on escape
  8660. action
  8661. "
  8662. --Return to world screen on escape
  8663. e:SelectEngine(worldScreen)
  8664. "
  8665. }
  8666.  
  8667. template
  8668. {
  8669. label
  8670. {
  8671. enabled "showMemorizationSparkle(instanceId)"
  8672. ignoreEvents
  8673. area 0 0 45 42
  8674. bam "FLASHBR"
  8675. usealpha lua "true"
  8676. frame lua "memorizationFlashes[instanceId][2]"
  8677. align center center
  8678. }
  8679. name "TEMPLATE_priestMemorizationSparkle"
  8680. }
  8681.  
  8682.  
  8683. label
  8684. {
  8685. area 0 0 864 710
  8686. mosaic "GUIPRB2"
  8687. }
  8688. label
  8689. {
  8690. area 82 10 700 44
  8691. text "PRIEST_SCROLL_TITLE"
  8692. text style "title"
  8693. }
  8694. label
  8695. {
  8696. area 210 59 446 30
  8697. text lua "priestName"
  8698. text style "label"
  8699. }
  8700. button
  8701. {
  8702. area 168 110 54 54
  8703. bam GUIPRTC
  8704. highlightgroup prpage
  8705. sequence 0
  8706. enabled "maxPriestPage > 0"
  8707. action "setPriestBookLevel(1)"
  8708. }
  8709. button
  8710. {
  8711. area 244 110 54 54
  8712. bam GUIPRTC
  8713. highlightgroup prpage
  8714. sequence 1
  8715. enabled "maxPriestPage > 1"
  8716. action "setPriestBookLevel(2)"
  8717. }
  8718. button
  8719. {
  8720. area 322 110 54 54
  8721. bam GUIPRTC
  8722. highlightgroup prpage
  8723. sequence 2
  8724. enabled "maxPriestPage > 2"
  8725. action "setPriestBookLevel(3)"
  8726. }
  8727. button
  8728. {
  8729. area 403 110 54 54
  8730. bam GUIPRTC
  8731. highlightgroup prpage
  8732. sequence 3
  8733. enabled "maxPriestPage > 3"
  8734. action "setPriestBookLevel(4)"
  8735. }
  8736. button
  8737. {
  8738. area 485 110 54 54
  8739. bam GUIPRTC
  8740. highlightgroup prpage
  8741. sequence 4
  8742. enabled "maxPriestPage > 4"
  8743. action "setPriestBookLevel(5)"
  8744. }
  8745. button
  8746. {
  8747. area 564 110 54 54
  8748. bam GUIPRTC
  8749. highlightgroup prpage
  8750. sequence 5
  8751. enabled "maxPriestPage > 5"
  8752. action "setPriestBookLevel(6)"
  8753. }
  8754. button
  8755. {
  8756. area 639 110 54 54
  8757. bam GUIPRTC
  8758. highlightgroup prpage
  8759. sequence 6
  8760. enabled "maxPriestPage > 6"
  8761. action "setPriestBookLevel(7)"
  8762. }
  8763.  
  8764. list
  8765. {
  8766. column
  8767. {
  8768. width 15
  8769. label
  8770. {
  8771. area 0 0 -1 -1
  8772. bam lua "characters[id].priestSpells[currentSpellLevel][rowNumber].icon"
  8773. align center center
  8774. }
  8775. }
  8776. column
  8777. {
  8778. width 85
  8779. label
  8780. {
  8781. area 0 0 -1 -1
  8782. text lua "Infinity_FetchString( characters[id].priestSpells[currentSpellLevel][rowNumber].name)"
  8783. text style "normal_parchment"
  8784. text align left center
  8785. }
  8786. }
  8787.  
  8788. area 56 168 347 416
  8789.  
  8790. name "bookListPriest"
  8791. rowheight 40
  8792. table "characters[id].priestSpells[currentSpellLevel]"
  8793. var currentBookSpell
  8794. scrollbar 'GUISCRC'
  8795. action "
  8796. if cellNumber == 1 then
  8797. if #bottomSpells < #bottomSpellsPlaceHolder then
  8798. createPriestMemorizationSparkle(3, 0, 40, 40, 'bookListPriest', -1)
  8799. Infinity_PlaySound('GAM_24')
  8800. showPriestMemorizationFlash = true
  8801. end
  8802. priestScreen:MemorizeSpell( characters[id].priestSpells[currentSpellLevel][currentBookSpell].level, characters[id].priestSpells[currentSpellLevel][currentBookSpell].index )
  8803. end
  8804. if lastCurrentBookSpell == currentBookSpell and cellNumber == 2 then
  8805. currentBookSpell = 0
  8806. else
  8807. lastCurrentBookSpell = currentBookSpell
  8808. end
  8809. "
  8810.  
  8811. }
  8812.  
  8813. text
  8814. {
  8815. area 408 174 400 388
  8816. text lua "priestBookDescription()"
  8817. text style "normal_parchment"
  8818. scrollbar 'GUISCRC'
  8819. }
  8820.  
  8821. list
  8822. {
  8823. column
  8824. {
  8825. width 100
  8826. label
  8827. {
  8828. area 0 0 -1 -1
  8829. bam "SPELFRMS"
  8830. sequence 0
  8831. align center center
  8832. }
  8833. }
  8834.  
  8835. area 74 658 608 36
  8836.  
  8837. rowwidth 36
  8838. table "bottomSpellsPlaceHolder"
  8839. }
  8840. list
  8841. {
  8842. column
  8843. {
  8844. width 100
  8845. label
  8846. {
  8847. area 0 0 -1 -1
  8848. bam lua "bottomSpells[rowNumber].icon"
  8849. align center center
  8850. greyscale lua "bottomSpells[rowNumber].castable == 0"
  8851. }
  8852. }
  8853.  
  8854. area 74 658 608 36
  8855.  
  8856. name "memorizedListPriest"
  8857. enabled "#bottomSpells ~= 0"
  8858. rowwidth 36
  8859. table "bottomSpells"
  8860. var currentBottomSpell
  8861. action
  8862. "
  8863. if bottomSpells[currentBottomSpell] then
  8864. if findMemorizedUncastable(bottomSpells[currentBottomSpell].resref) == -1 and Infinity_GetOption(41, 9) ~= 0 then
  8865. popup2Button(11824, 'REMOVE_BUTTON', function() unmemorizePriestSpell(currentBottomSpell) end, 'CANCEL_BUTTON')
  8866. else
  8867. unmemorizePriestSpell(currentBottomSpell)
  8868. end
  8869. end
  8870. "
  8871.  
  8872. }
  8873.  
  8874.  
  8875. label
  8876. {
  8877. area 430 592 300 40
  8878. text lua "priestPageInfo()"
  8879. text style "label"
  8880. rectangle 0
  8881. }
  8882.  
  8883. button
  8884. {
  8885. area 132 588 230 40
  8886. bam GUIBUTMT
  8887. enabled "characters[id].hasClericBook"
  8888. clickable lua "#bottomSpells < characters[id].priestDetails[currentSpellLevel].maxMemorized and currentBookSpell ~= 0"
  8889. text "MEMORIZE_LABEL"
  8890. text style "button"
  8891. action
  8892. "
  8893. createPriestMemorizationSparkle(3, 0, 40, 40, 'bookListPriest', -1)
  8894. showPriestMemorizationFlash = true
  8895. Infinity_PlaySound('GAM_24')
  8896. priestScreen:MemorizeSpell( characters[id].priestSpells[currentSpellLevel][currentBookSpell].level, characters[id].priestSpells[currentSpellLevel][currentBookSpell].index )
  8897.  
  8898. "
  8899.  
  8900. }
  8901.  
  8902. label
  8903. {
  8904. area 0 0 865 710
  8905. fill 0 0 0 176
  8906. enabled "priestBookEnabled == false"
  8907. }
  8908. }
  8909. `
  8910. versionString = ""
  8911. function canClickSaveLoad()
  8912. return game:IsClient() == false
  8913. end
  8914. `
  8915. menu
  8916. {
  8917. name "ESC_MENU"
  8918. ignoreesc
  8919. align center center
  8920. onOpen "
  8921. versionString = CBaldurChitin:GetVersionString()
  8922. pushSidebars()
  8923. "
  8924. onClose "popSidebars()"
  8925. label
  8926. {
  8927. area 0 0 864 768
  8928. mosaic STONEOPT
  8929. }
  8930. label
  8931. {
  8932. area 260 92 350 44
  8933. text "OPTIONS_TITLE"
  8934. text style "title"
  8935. }
  8936. label
  8937. {
  8938. area 360 131 145 29
  8939. text lua "versionString"
  8940. text style "normal"
  8941. text align center center
  8942. }
  8943. button
  8944. {
  8945.  
  8946. area 644 476 200 40
  8947. bam GUIBUTNT
  8948. sequence 2
  8949. text "GAMEPLAY_BUTTON"
  8950. text style "button"
  8951.  
  8952. action
  8953. "
  8954. Infinity_PushMenu( 'OPTIONS_GAMEPLAY' )
  8955.  
  8956. "
  8957. }
  8958. button
  8959. {
  8960.  
  8961. area 644 378 200 40
  8962. bam GUIBUTNT
  8963. sequence 2
  8964. text "GRAPHICS_BUTTON"
  8965. text style "button"
  8966.  
  8967. action
  8968. "
  8969. Infinity_PushMenu( 'OPTIONS_GRAPHICS' )
  8970.  
  8971. "
  8972. }
  8973. button
  8974. {
  8975.  
  8976. area 644 280 200 40
  8977. bam GUIBUTNT
  8978. sequence 2
  8979. text "SOUND_BUTTON"
  8980. text style "button"
  8981.  
  8982. action
  8983. "
  8984. Infinity_PushMenu( 'OPTIONS_SOUND' )
  8985.  
  8986. "
  8987. }
  8988. button
  8989. {
  8990. area 284 615 300 40
  8991. bam GUIBUTWT
  8992. text "RETURN_GAME_BUTTON"
  8993. text style "button"
  8994. action
  8995. "
  8996. e:SelectEngine( worldScreen );
  8997. "
  8998. }
  8999. button
  9000. {
  9001. area 21 279 200 40
  9002. bam GUIBUTNT
  9003. text style "button"
  9004. text "LOAD_GAME_BUTTON"
  9005. clickable lua "canClickSaveLoad()"
  9006. action
  9007. "
  9008. popup2Button(19531, 'LOAD_BUTTON', function() optionsScreen:LoadGame() end)
  9009. "
  9010. }
  9011. button
  9012. {
  9013. area 21 378 200 40
  9014. bam GUIBUTNT
  9015. text style "button"
  9016. text "QUIT_GAME_BUTTON"
  9017. action
  9018. "
  9019. if e:IsTouchUI() then
  9020. popup3Button(16456,
  9021. 'CANCEL_BUTTON', nil,
  9022. 'MAIN_MENU_BUTTON', function() optionsScreen:QuitGame() end,
  9023. 'SAVE_BUTTON', function() optionsScreen:SaveGame(0) end
  9024. )
  9025. else
  9026. popup4Button(16456,
  9027. 'CANCEL_BUTTON', nil,
  9028. 'MAIN_MENU_BUTTON', function() optionsScreen:QuitGame() end,
  9029. 'QUIT_BUTTON', function() Infinity_ShutdownGame() end,
  9030. 'SAVE_BUTTON', function() optionsScreen:SaveGame(0) end
  9031. )
  9032. end
  9033. "
  9034. }
  9035. button
  9036. {
  9037. area 21 477 200 40
  9038. bam GUIBUTNT
  9039. text style "button"
  9040. text "SAVE_GAME_BUTTON"
  9041. clickable lua "canClickSaveLoad()"
  9042. action
  9043. "
  9044. optionsScreen:SaveGame(0)
  9045. "
  9046. }
  9047.  
  9048. label
  9049. {
  9050. area 240 208 378 376
  9051. bam BIGLOGO
  9052. frame 1
  9053. }
  9054. }
  9055.  
  9056. `
  9057. mapnoteSettings = {}
  9058. showNotes = 1
  9059. function showNote(instanceId)
  9060. if(mapScreen:IsNoteVisible(mapnoteSettings[instanceId].worldCoord.x, mapnoteSettings[instanceId].worldCoord.y)
  9061. and mapnoteSettings[instanceId].screenCoord.x >= 0
  9062. and mapnoteSettings[instanceId].screenCoord.y >= 0) then
  9063. return showNotes
  9064. else
  9065. return false
  9066. end
  9067. end
  9068. notesAlpha = 0
  9069. function getAndIncrementNotesAlpha()
  9070. if(notesAlpha < .99) then
  9071. notesAlpha = notesAlpha + 0.075
  9072. end
  9073. if(notesAlpha > 1) then
  9074. notesAlpha = 1
  9075. end
  9076. return notesAlpha
  9077. end
  9078. `
  9079. menu
  9080. {
  9081. name 'AREA_MAP_TITLE'
  9082. align center top
  9083. opacity lua "notesAlpha"
  9084. ignoreEsc
  9085. label
  9086. {
  9087. name "AREA_MAP_BACKGROUND"
  9088. area 66 0 662 92
  9089. rectangle 0
  9090. }
  9091. label
  9092. {
  9093. area 74 8 184 74
  9094. name "AREA_MAP_TITLE"
  9095. text "AREA_MAP_TITLE"
  9096. text style title
  9097. }
  9098. label
  9099. {
  9100. area 300 8 170 36
  9101. action "mapScreen:ToggleDisplayExploredMap()"
  9102. text "WORLDMAP_HIGHLIGHT_LABEL"
  9103. text style "label"
  9104. text align left center
  9105.  
  9106. }
  9107. button
  9108. {
  9109. area 264 8 206 36
  9110. bam "4CHECK"
  9111. sequence lua "mapScreen:DisplayExploredMap() and 0 or 1"
  9112. action "mapScreen:ToggleDisplayExploredMap()"
  9113. }
  9114.  
  9115. label
  9116. {
  9117. area 300 42 170 40
  9118. toggle showNotes
  9119. text "WORLD_MAP_NOTES_LABEL"
  9120. text style "label"
  9121. text align left center
  9122.  
  9123. }
  9124. button
  9125. {
  9126. area 264 42 206 40
  9127. bam "4CHECK"
  9128. sequence lua "showNotes == 1 and 0 or 1"
  9129. toggle showNotes
  9130. }
  9131.  
  9132. button
  9133. {
  9134. area 478 24 230 40
  9135. bam GUIBUTMT
  9136. sequence 0
  9137. text style "button"
  9138. text "WORLD_MAP_BUTTON"
  9139. action
  9140. "
  9141. worldMapScreen:StartWorldMap(0)
  9142. e:SelectEngine(worldMapScreen)
  9143. "
  9144. }
  9145.  
  9146. }
  9147. `
  9148. areaMapHover = -1
  9149. function showAreaMapNoteTooltip(id)
  9150. if id == areaMapHover then
  9151. return true
  9152. else
  9153. return false
  9154. end
  9155. end
  9156. `
  9157. menu
  9158. {
  9159. name 'AREA_MAP'
  9160. align left top
  9161. ignoreesc
  9162. onOpen "pushSidebars(); Infinity_PushMenu('AREA_MAP_TITLE'); notesAlpha = 0"
  9163. onClose "popSidebars(); Infinity_PopMenu('AREA_MAP_TITLE');"
  9164. opacity lua "getAndIncrementNotesAlpha()"
  9165. template
  9166. {
  9167. button
  9168. {
  9169. enabled "showNote(instanceId)"
  9170. area 0 0 45 42
  9171. bam "FLAG1"
  9172. sequence lua "mapnoteSettings[instanceId].sequence"
  9173. tooltip force lua "showAreaMapNoteTooltip(instanceId)"
  9174. tooltip force top
  9175. tooltip lua "Infinity_FetchString(mapnoteSettings[instanceId].text)"
  9176. tooltip position 3
  9177. actionAlt
  9178. "
  9179. mapScreen:OnUserNoteClick(instanceId, mapnoteSettings[instanceId].worldCoord.x, mapnoteSettings[instanceId].worldCoord.y)
  9180. Infinity_PushMenu('NOTE_ADD',0,0)
  9181. "
  9182. actionEnter
  9183. "
  9184. areaMapHover = instanceId
  9185. "
  9186. actionExit
  9187. "
  9188. areaMapHover = -1
  9189. "
  9190. }
  9191. name "TEMPLATE_mapnote"
  9192. }
  9193. }
  9194. `
  9195. colorChoice = nil
  9196. `
  9197. menu
  9198. {
  9199. name 'NOTE_ADD'
  9200. align center center
  9201. onOpen
  9202. "
  9203. if colorChoice == nil then
  9204. colorChoice = Infinity_FindUIItemByName('BUTTON_mapNoteColor_' .. mapScreen:GetColorChoice())
  9205. end
  9206. "
  9207. onClose
  9208. "
  9209. colorChoice = nil
  9210. "
  9211. modal
  9212. label
  9213. {
  9214. area 0 0 657 234
  9215. mosaic GUIERR6
  9216. }
  9217. label
  9218. {
  9219. area 32 24 596 68
  9220. rectangle 0
  9221. }
  9222. edit
  9223. {
  9224. name "mapNoteEditArea"
  9225. area 40 32 584 56
  9226. var mapNoteEdit
  9227. scrollbar 'GUISCRC'
  9228. text style "edit"
  9229. fill 112 111 111 64
  9230. }
  9231. button
  9232. {
  9233. area 440 170 200 40
  9234. bam GUIBUTNT
  9235. text style "button"
  9236. text "DONE_BUTTON"
  9237. action
  9238. "
  9239. mapScreen:OnUserNoteDoneButtonClick()
  9240. Infinity_PopMenu('NOTE_ADD',0,0)
  9241. "
  9242. }
  9243. button
  9244. {
  9245. on escape
  9246. area 228 170 200 40
  9247. bam GUIBUTNT
  9248. text style "button"
  9249. text "CANCEL_BUTTON"
  9250. action
  9251. "
  9252. Infinity_PopMenu('NOTE_ADD',0,0)
  9253. "
  9254. }
  9255. button
  9256. {
  9257. area 18 170 200 40
  9258. bam GUIBUTNT
  9259. text style "button"
  9260. text "DELETE_BUTTON"
  9261. action
  9262. "
  9263. mapScreen:OnUserNoteDeleteButtonClick()
  9264. Infinity_PopMenu('NOTE_ADD',0,0)
  9265. "
  9266. }
  9267.  
  9268. button
  9269. {
  9270. name "BUTTON_mapNoteColor_0"
  9271. area 29 98 45 42
  9272. bam "FLAG1"
  9273. highlightgroup colorChoice
  9274. sequence 0
  9275. action
  9276. "
  9277. mapScreen:OnColorChoice(0)
  9278. "
  9279. }
  9280. button
  9281. {
  9282. name "BUTTON_mapNoteColor_1"
  9283. area 108 98 45 42
  9284. bam "FLAG1"
  9285. highlightgroup colorChoice
  9286. sequence 1
  9287. action
  9288. "
  9289. mapScreen:OnColorChoice(1)
  9290. "
  9291. }
  9292. button
  9293. {
  9294. name "BUTTON_mapNoteColor_2"
  9295. area 187 98 45 42
  9296. bam "FLAG1"
  9297. highlightgroup colorChoice
  9298. sequence 2
  9299. action
  9300. "
  9301. mapScreen:OnColorChoice(2)
  9302. "
  9303. }
  9304. button
  9305. {
  9306. name "BUTTON_mapNoteColor_3"
  9307. area 266 98 45 42
  9308. bam "FLAG1"
  9309. highlightgroup colorChoice
  9310. sequence 3
  9311. action
  9312. "
  9313. mapScreen:OnColorChoice(3)
  9314. "
  9315. }
  9316. button
  9317. {
  9318. name "BUTTON_mapNoteColor_4"
  9319. area 345 98 45 42
  9320. bam "FLAG1"
  9321. highlightgroup colorChoice
  9322. sequence 4
  9323. action
  9324. "
  9325. mapScreen:OnColorChoice(4)
  9326. "
  9327. }
  9328. button
  9329. {
  9330. name "BUTTON_mapNoteColor_5"
  9331. area 424 98 45 42
  9332. bam "FLAG1"
  9333. highlightgroup colorChoice
  9334. sequence 5
  9335. action
  9336. "
  9337. mapScreen:OnColorChoice(5)
  9338. "
  9339. }
  9340. button
  9341. {
  9342. name "BUTTON_mapNoteColor_6"
  9343. area 503 98 45 42
  9344. bam "FLAG1"
  9345. highlightgroup colorChoice
  9346. sequence 6
  9347. action
  9348. "
  9349. mapScreen:OnColorChoice(6)
  9350. "
  9351. }
  9352. button
  9353. {
  9354. name "BUTTON_mapNoteColor_7"
  9355. area 582 98 45 42
  9356. bam "FLAG1"
  9357. highlightgroup colorChoice
  9358. sequence 7
  9359. action
  9360. "
  9361. mapScreen:OnColorChoice(7)
  9362. "
  9363. }
  9364. }
  9365.  
  9366.  
  9367. menu
  9368. {
  9369. name "WORLD_MAP"
  9370. align center center
  9371. label
  9372. {
  9373. area 0 0 1024 768
  9374. mosaic GUIMAPWB
  9375. }
  9376. label
  9377. {
  9378. area 211 22 583 44
  9379. text "WORLD_MAP_TITLE"
  9380. text style "title"
  9381. }
  9382. button
  9383. {
  9384. area 51 35 66 58
  9385. bam "MAPBUT"
  9386. action
  9387. "
  9388. worldMapScreen:OnCancelButtonClick()
  9389. "
  9390. }
  9391. map
  9392. {
  9393. area 13 195 1000 564
  9394. worldmap
  9395. action
  9396. "
  9397. worldMapScreen:OnMapMouseDown(eventXCoord,eventYCoord)
  9398. "
  9399. actionDbl
  9400. "
  9401. worldMapScreen:TravelToSelected()
  9402. "
  9403. actionDrag
  9404. "
  9405. worldMapScreen:OnMapMouseMove(eventXCoord,eventYCoord)
  9406. "
  9407. }
  9408. button
  9409. {
  9410. area 783 715 230 40
  9411. enabled "worldMapScreen:IsTravelButtonVisible()"
  9412. bam GUIBUTMT
  9413. text "TRAVEL_BUTTON"
  9414. text style "button"
  9415. clickable lua "worldMapScreen:IsTravelButtonClickable()"
  9416. action "
  9417. worldMapScreen:TravelToSelected()
  9418. "
  9419. }
  9420. }
  9421. `
  9422.  
  9423. chapterBackground = ""
  9424.  
  9425. text_CHAPTERSCROLL = ""
  9426. text_CHAPTERSCROLL_timeStart = 0
  9427. text_CHAPTERSCROLL_auto = 1
  9428. function UpdateChapterScroll(top, height, contentHeight)
  9429. if(text_CHAPTERSCROLL_auto == 0) then
  9430. --defer to default scrolling
  9431. return nil
  9432. end
  9433. local dT = Infinity_GetClockTicks() - text_CHAPTERSCROLL_timeStart
  9434. local timerCrawl = dT * -0.006
  9435. if megacredits ~= '' then
  9436. timerCrawl = dT * -0.06
  9437. end
  9438. local newTop = timerCrawl + height
  9439. if(newTop + contentHeight + height < height) then
  9440. return top
  9441. end
  9442. return newTop
  9443. end
  9444. function setChapterBackground(id)
  9445. chapterBackground = chapterBackgrounds[id]
  9446. end
  9447. `
  9448. menu
  9449. {
  9450. name 'CHAPTER'
  9451. align center center
  9452. ignoreEsc
  9453.  
  9454. label
  9455. {
  9456. area 0 0 1024 768
  9457. mosaic lua "chapterBackground"
  9458. }
  9459. text
  9460. {
  9461. name "text_CHAPTERSCROLL_item"
  9462. area 36 460 956 226
  9463. text lua "text_CHAPTERSCROLL"
  9464. text style normal
  9465. scrollbar 'GUISCRC'
  9466. scrollbar func 'UpdateChapterScroll'
  9467. scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1'
  9468. action
  9469. "
  9470. text_CHAPTERSCROLL_auto = 0
  9471. "
  9472. }
  9473. button
  9474. {
  9475. area 524 706 230 40
  9476. bam GUIBUTMT
  9477. text "DONE_BUTTON"
  9478. text style "button"
  9479. clickable lua "chapterScreen:IsDoneButtonClickable()"
  9480. action
  9481. "
  9482. chapterScreen:OnDoneButtonClick()
  9483. "
  9484. }
  9485. button
  9486. {
  9487. area 286 706 230 40
  9488. bam GUIBUTMT
  9489. text "REPLAY_BUTTON"
  9490. text style "button"
  9491. clickable lua "chapterScreen:IsReplayButtonClickable()"
  9492. action
  9493. "
  9494. chapterScreen:OnReplayButtonClick()
  9495. "
  9496. }
  9497. }
  9498. menu
  9499. {
  9500. name 'CHAPTER_WAITING_FOR_PROVIDER'
  9501. modal
  9502. align center center
  9503.  
  9504. label
  9505. {
  9506. area 0 0 465 500
  9507. mosaic GUIERR
  9508. }
  9509. label --Title
  9510. {
  9511. area 124 134 224 112
  9512. text "WAITING_FOR_OTHER_PLAYERS"
  9513. text style "label"
  9514. }
  9515. }
  9516. `
  9517. store = {}
  9518. storeGroupItemsVar = 0
  9519. storeItemsVar = 0
  9520. function getStoreSlotHighlight(highlight)
  9521. if(highlight == 0) then
  9522. return 0
  9523. else
  9524. return 2
  9525. end
  9526. end
  9527. function storeSplitStack(count)
  9528. storeScreen:SelectStoreItem(storeItemsVar-1, true);
  9529. storeScreen:SetStoreItemCount(storeItemsVar-1, count);
  9530. end
  9531. function groupSplitStack(count)
  9532. storeScreen:SelectGroupItem(storeGroupItemsVar-1, true);
  9533. storeScreen:SetGroupItemCount(storeGroupItemsVar-1, count);
  9534. end
  9535. function checkContainerText(normalStr, containerStr)
  9536. if(storeScreen:IsContainer()) then
  9537. return t(containerStr)
  9538. else
  9539. return t(normalStr)
  9540. end
  9541. end
  9542. function getStoreItemCount(row)
  9543. local count = store.storeItems[rowNumber].item.count
  9544. if(count ~= 0xFFFF) then
  9545. return count
  9546. else
  9547. -- maxword, infinite count.
  9548. return nil
  9549. end
  9550. end
  9551. `
  9552. menu
  9553. {
  9554. name 'STORE_BUYSELL'
  9555. align center top
  9556. onOpen "storeScreen:UpdateBuySellPanel()"
  9557. ignoreEsc
  9558. label
  9559. {
  9560. area 0 0 864 598
  9561. mosaic GUISTBSC
  9562. }
  9563. label
  9564. {
  9565. area 48 16 768 44
  9566. text lua "checkContainerText('BUY_SELL_TITLE','CONTAINER_TITLE')"
  9567. text style "title"
  9568. }
  9569. label
  9570. {
  9571. area 267 76 330 29
  9572. text lua "Infinity_FetchString(storeScreen:GetStoreName())"
  9573. text style "label"
  9574. }
  9575. label
  9576. {
  9577. area 719 112 108 30
  9578. enabled "not storeScreen:IsContainer()"
  9579. text lua "game:GetPartyGold()"
  9580. text style "gold"
  9581. align right center
  9582. }
  9583. label
  9584. {
  9585. area 94 499 146 23
  9586. enabled "not storeScreen:IsContainer()"
  9587. text "COST_LABEL"
  9588. text style "label"
  9589. align right center
  9590. }
  9591. label
  9592. {
  9593. area 319 499 108 23
  9594. enabled "not storeScreen:IsContainer()"
  9595. text lua "storeScreen:GetStoreCost()"
  9596. text style "normal"
  9597. align right center
  9598. }
  9599. label
  9600. {
  9601. area 533 499 146 23
  9602. enabled "not storeScreen:IsContainer()"
  9603. text "PRICE_LABEL"
  9604. text style "label"
  9605. align right center
  9606. }
  9607. label
  9608. {
  9609. area 717 499 108 23
  9610. enabled "not storeScreen:IsContainer()"
  9611. text lua "storeScreen:GetGroupCost()"
  9612. text style "normal"
  9613. align right center
  9614. }
  9615.  
  9616. label
  9617. {
  9618. area 26 112 349 30
  9619. text lua "checkContainerText('STORE_LABEL',Infinity_FetchString(storeScreen:GetStoreName()))"
  9620. text style "label"
  9621. align left center
  9622. }
  9623. list
  9624. {
  9625. column
  9626. {
  9627. width 100
  9628. label
  9629. {
  9630. area 5 0 64 60
  9631. bam STONSLOT
  9632. frame lua "getStoreSlotHighlight(store.storeItems[rowNumber].highlight)"
  9633. icon lua "store.storeItems[rowNumber].item.icon"
  9634. tint lua "store.storeItems[rowNumber].item.tint"
  9635. usages lua "store.storeItems[rowNumber].amountSelected" --how many selected
  9636. count lua "store.storeItems[rowNumber].item.stackSize" --How many to a stack
  9637. align center center
  9638. }
  9639. label
  9640. {
  9641. area 80 0 250 60
  9642. text lua "store.storeItems[rowNumber].label"
  9643. text style "normal"
  9644. text align left center
  9645. }
  9646. label
  9647. {
  9648. area 310 0 91 60
  9649. enabled "not storeScreen:IsContainer()"
  9650. text lua "store.storeItems[rowNumber].value"
  9651. text style "gold"
  9652. }
  9653. label
  9654. {
  9655. enabled "store.storeItems[rowNumber].valid == 0 and store.storeItems[rowNumber].highlight == 0"
  9656. area 0 0 436 60
  9657. rectangle 1
  9658. rectangle opacity 150
  9659. }
  9660. }
  9661. area 26 142 408 348
  9662. hidehighlight
  9663. rowheight 60
  9664. table "store.storeItems"
  9665. var "storeItemsVar"
  9666. rowbackground GUISTBK2
  9667. scrollbar 'GUISCRC'
  9668. action
  9669. "
  9670. if store.storeItems[storeItemsVar].clickable == 1 then
  9671. if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then
  9672. local highlight = true
  9673. if(store.storeItems[storeItemsVar].highlight == 1) then highlight = false end
  9674. storeScreen:SelectStoreItem( storeItemsVar - 1, highlight)
  9675. end
  9676. end
  9677. "
  9678. actionalt
  9679. "
  9680. showItemDescription(store.storeItems[storeItemsVar].item, 1)
  9681. "
  9682. actionDbl
  9683. "
  9684. if store.storeItems[storeItemsVar].clickable == 1 then
  9685. if not storeScreen:IsCloseBagButtonClickable() or store.storeItems[storeItemsVar].valid == 1 then
  9686. local maxCount = store.storeItems[storeItemsVar].maxCount
  9687. if(maxCount > 1) then
  9688. popupRequester(maxCount, storeSplitStack, false)
  9689. end
  9690. end
  9691. end
  9692. "
  9693. }
  9694.  
  9695. label
  9696. {
  9697. area 469 112 250 30
  9698. text lua "Infinity_GetSelectedCharacterName()"
  9699. text style "label"
  9700. align left center
  9701. }
  9702. list
  9703. {
  9704. column
  9705. {
  9706. width 100
  9707. label
  9708. {
  9709. area 8 0 64 60
  9710. bam STONSLOT
  9711. frame lua "getStoreSlotHighlight(store.groupItems[rowNumber].highlight)"
  9712. tint lua "store.groupItems[rowNumber].item.tint"
  9713. icon lua "store.groupItems[rowNumber].item.icon"
  9714. count lua "store.groupItems[rowNumber].count"
  9715. usages lua "store.groupItems[rowNumber].item.usages"
  9716. align center center
  9717. }
  9718. label
  9719. {
  9720. area 80 0 200 60
  9721. text lua "store.groupItems[rowNumber].label"
  9722. text style "normal"
  9723. text align left center
  9724. }
  9725. label
  9726. {
  9727. area 300 0 62 60
  9728. enabled "not storeScreen:IsContainer()"
  9729. text lua "store.groupItems[rowNumber].value"
  9730. text style "gold"
  9731. }
  9732. label
  9733. {
  9734. --#21242 We don't grey out bags, even though they're not selectable, because we can open them.
  9735. enabled "store.groupItems[rowNumber].valid == 0 and store.groupItems[rowNumber].item.isBag ~= 1"
  9736. area 0 0 436 60
  9737. rectangle 1
  9738. rectangle opacity 150
  9739. }
  9740. }
  9741. area 462 142 378 348
  9742. enabled "not storeScreen:IsCloseBagButtonClickable()"
  9743. hidehighlight
  9744. rowheight 60
  9745. table "store.groupItems"
  9746. var "storeGroupItemsVar"
  9747. rowbackground GUISTBK2
  9748. scrollbar 'GUISCRC'
  9749. action
  9750. "
  9751. if store.groupItems[storeGroupItemsVar].valid ~= 0 then
  9752. local selected = true
  9753. if(store.groupItems[storeGroupItemsVar].highlight == 1) then selected = false end
  9754. storeScreen:SelectGroupItem( storeGroupItemsVar - 1, selected)
  9755. end
  9756. "
  9757. actionalt
  9758. "
  9759. showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
  9760. "
  9761. actionDbl
  9762. "
  9763. if(store.groupItems[storeGroupItemsVar].item.isBag == 1) then
  9764. showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
  9765. itemDescLeftButtonAction()
  9766. else
  9767. if store.groupItems[storeGroupItemsVar].valid ~= 0 then
  9768. local count = store.groupItems[storeGroupItemsVar].item.count
  9769. local stock = store.groupItems[storeGroupItemsVar].numInStock
  9770. if(count > 1) then
  9771. popupRequester(count, groupSplitStack, true)
  9772. elseif stock > 1 then
  9773. popupRequester(stock, groupSplitStack, true)
  9774. end
  9775. end
  9776. end
  9777. "
  9778. }
  9779.  
  9780. list
  9781. {
  9782. column
  9783. {
  9784. width 100
  9785. label
  9786. {
  9787. area 8 0 64 60
  9788. bam STONSLOT
  9789. frame lua "getStoreSlotHighlight(store.groupItems[rowNumber].highlight)"
  9790. tint lua "store.groupItems[rowNumber].item.tint"
  9791. icon lua "store.groupItems[rowNumber].item.icon"
  9792. count lua "store.groupItems[rowNumber].item.count"
  9793. usages lua "store.groupItems[rowNumber].count"
  9794. align center center
  9795. }
  9796. label
  9797. {
  9798. area 80 0 200 60
  9799. text lua "store.groupItems[rowNumber].label"
  9800. text style "normal"
  9801. text align left center
  9802. }
  9803. label
  9804. {
  9805. area 300 0 62 60
  9806. enabled "not storeScreen:IsContainer()"
  9807. text lua "store.groupItems[rowNumber].value"
  9808. text style "gold"
  9809. }
  9810. label
  9811. {
  9812. enabled "store.groupItems[rowNumber].valid == 0"
  9813. area 0 0 436 60
  9814. rectangle 1
  9815. rectangle opacity 150
  9816. }
  9817. }
  9818. area 462 142 370 348
  9819. enabled "storeScreen:IsCloseBagButtonClickable()"
  9820. hidehighlight
  9821. rowheight 60
  9822. table "store.groupItems"
  9823. var "storeGroupItemsVar"
  9824. rowbackground GUISTBK2
  9825. scrollbar 'GUISCRC'
  9826. action
  9827. "
  9828. if store.groupItems[storeGroupItemsVar].valid ~= 0 then
  9829. local selected = true
  9830. if(store.groupItems[storeGroupItemsVar].highlight == 1) then selected = false end
  9831. storeScreen:SelectGroupItem( storeGroupItemsVar - 1, selected)
  9832. end
  9833. "
  9834. actionalt
  9835. "
  9836. showItemDescription(store.groupItems[storeGroupItemsVar].item, 1)
  9837. "
  9838. actionDbl
  9839. "
  9840. if store.groupItems[storeGroupItemsVar].valid ~= 0 then
  9841. local count = store.groupItems[storeGroupItemsVar].item.count
  9842. local stock = store.groupItems[storeGroupItemsVar].numInStock
  9843. if(count > 1) then
  9844. popupRequester(count, groupSplitStack, true)
  9845. elseif stock > 1 then
  9846. popupRequester(stock, groupSplitStack, true)
  9847. end
  9848. end
  9849. "
  9850. }
  9851.  
  9852.  
  9853. button
  9854. {
  9855. area 94 534 201 40
  9856. bam GUIBUTNT
  9857. text lua "checkContainerText('BUY_BUTTON', 'TO_BACKPACK_BUTTON')"
  9858. text style "button"
  9859. clickable lua "storeScreen:IsBuyItemButtonClickable()"
  9860. action
  9861. "
  9862. storeScreen:OnBuyItemButtonClick()
  9863. "
  9864. }
  9865. button
  9866. {
  9867. area 624 534 201 40
  9868. bam GUIBUTNT
  9869. text lua "checkContainerText('SELL_BUTTON','TO_CONTAINER_BUTTON')"
  9870. text style "button"
  9871. clickable lua "storeScreen:IsSellItemButtonClickable()"
  9872. action
  9873. "
  9874. storeScreen:OnSellItemButtonClick()
  9875. "
  9876. }
  9877. button
  9878. {
  9879. area 360 534 201 40
  9880. enabled "(not storeScreen:IsContainer()) and storeScreen:IsStealEnabled()"
  9881. bam GUIBUTNT
  9882. text "STEAL_BUTTON"
  9883. text style "button"
  9884. clickable lua "storeScreen:IsStealItemButtonClickable()"
  9885. action
  9886. "
  9887. storeScreen:OnStealItemButtonClick()
  9888. "
  9889. }
  9890. button
  9891. {
  9892. area 360 534 201 40
  9893. enabled "storeScreen:IsCloseBagButtonClickable()"
  9894. bam GUIBUTNT
  9895. text "CLOSE_CONTAINER_BUTTON"
  9896. text style "button"
  9897. action
  9898. "
  9899. storeScreen:OnCloseBagButtonClick()
  9900. "
  9901. }
  9902. button
  9903. {
  9904. area 14 496 68 90
  9905. encumbrance
  9906. }
  9907.  
  9908. label
  9909. {
  9910. area 10 142 442 348
  9911. enabled "storeScreen:IsSpriteOrderable() == false"
  9912. rectangle 0
  9913. rectangle opacity 200
  9914. ignoreEvents
  9915. }
  9916.  
  9917. label
  9918. {
  9919. area 456 142 398 348
  9920. enabled "storeScreen:IsSpriteOrderable() == false"
  9921. rectangle 0
  9922. rectangle opacity 200
  9923. ignoreEvents
  9924. }
  9925.  
  9926. }
  9927. `
  9928. identifyItemsVar = 0
  9929. `
  9930. menu
  9931. {
  9932. name 'STORE_IDENTIFY'
  9933. align center top
  9934. onOpen
  9935. "
  9936. storeScreen:UpdateIdentifyPanel()
  9937. store.identifyText = ''
  9938.  
  9939. "
  9940. ignoreEsc
  9941.  
  9942. label
  9943. {
  9944. area 0 0 864 598
  9945. mosaic GUISTIDB
  9946. }
  9947. label
  9948. {
  9949. area 48 6 768 44
  9950. text "IDENTIFY_TITLE"
  9951. text style "title"
  9952. }
  9953. label
  9954. {
  9955. area 276 50 310 32
  9956. text lua "Infinity_FetchString(storeScreen:GetStoreName())"
  9957. text style "label"
  9958. }
  9959. label
  9960. {
  9961. area 719 70 110 48
  9962. text lua "game:GetPartyGold()"
  9963. text style "gold"
  9964. }
  9965. label
  9966. {
  9967. area 68 126 144 32
  9968. text "COST_LABEL"
  9969. text style "label"
  9970. text align left center
  9971. }
  9972. label
  9973. {
  9974. area 282 126 90 36
  9975. text lua "storeScreen:GetIdentifyCost()"
  9976. text style "gold"
  9977. }
  9978. list
  9979. {
  9980. column
  9981. {
  9982. width 100
  9983. label
  9984. {
  9985. area 5 0 64 60
  9986. bam STONSLOT
  9987. frame lua "getStoreSlotHighlight(store.identifyItems[rowNumber].highlight)"
  9988. icon lua "store.identifyItems[rowNumber].item.icon"
  9989. tint lua "store.identifyItems[rowNumber].item.tint"
  9990. align center center
  9991. }
  9992. label
  9993. {
  9994. area 80 0 204 60
  9995. text lua "store.identifyItems[rowNumber].label"
  9996. text style "normal"
  9997. text align left center
  9998. }
  9999. label
  10000. {
  10001. enabled "store.identifyItems[rowNumber].valid == 0"
  10002. area 0 0 308 60
  10003. rectangle 1
  10004. rectangle opacity 150
  10005. }
  10006. }
  10007. area 68 166 304 384
  10008. hidehighlight
  10009. rowheight 60
  10010. table "store.identifyItems"
  10011. var "identifyItemsVar"
  10012. rowbackground GUISTBK2
  10013. scrollbar 'GUISCRC'
  10014. action
  10015. "
  10016. local highlight = true
  10017. if(store.identifyItems[identifyItemsVar].highlight == 1) then highlight = false end
  10018. if(highlight == true and store.identifyItems[identifyItemsVar].valid == 0) then return end
  10019. storeScreen:SelectIdentifyItem( identifyItemsVar - 1, highlight)
  10020. "
  10021. }
  10022. button
  10023. {
  10024. area 119 545 200 40
  10025. bam GUIBUTNT
  10026. text "IDENTIFY_BUTTON"
  10027. text style "button"
  10028. clickable lua "storeScreen:IsIdentifyItemButtonClickable()"
  10029. action
  10030. "
  10031. storeScreen:OnIdentifyItemButtonClick()
  10032. "
  10033. }
  10034. text
  10035. {
  10036. area 461 150 365 412
  10037. text lua "store.identifyText"
  10038. text style "normal_parchment"
  10039. scrollbar 'GUISCRC'
  10040. }
  10041. }
  10042. `
  10043. function getDonationFrame()
  10044. if(store.hasDonated ~= nil and store.hasDonated == 1) then
  10045. return 1
  10046. else
  10047. return 0
  10048. end
  10049. end
  10050. storeDonateAmountEdit = 0 --no longer used in ui, but the engine needs it.
  10051. function changeDonationAmount(amount)
  10052. if (amt == nil) then
  10053. amt = 0
  10054. end
  10055. amt = amt + amount
  10056.  
  10057. if (amt > 0) then
  10058. storeDonateAmountEdit = tostring(amt)
  10059. else
  10060. storeDonateAmountEdit = '0'
  10061. end
  10062. end
  10063. `
  10064. menu
  10065. {
  10066. name 'STORE_DONATE'
  10067. align center top
  10068. ignoreEsc
  10069. onOpen
  10070. "
  10071. storeScreen:UpdateDonatePanel()
  10072. store.donateText = ''
  10073. "
  10074.  
  10075. label
  10076. {
  10077. area 0 0 864 598
  10078. mosaic GUISTDOB
  10079. }
  10080. label
  10081. {
  10082. area 48 6 768 44
  10083. text "DONATE_TITLE"
  10084. text style "title"
  10085. }
  10086. label
  10087. {
  10088. area 277 64 310 30
  10089. text lua "Infinity_FetchString(storeScreen:GetStoreName())"
  10090. text style "label"
  10091. }
  10092. label
  10093. {
  10094. area 73 151 311 267
  10095. bam "DONATE"
  10096. frame lua "getDonationFrame()"
  10097. }
  10098. label
  10099. {
  10100. area 51 431 346 38
  10101. text "ENTER_DONATION_LABEL"
  10102. text style "label"
  10103. }
  10104. edit
  10105. {
  10106. name "storeDonateAmountEditArea"
  10107. area 106 476 122 48
  10108. var storeDonateAmountEdit
  10109. text style "edit"
  10110. text align left center
  10111. maxlines 1
  10112. fill 112 111 111 64
  10113. }
  10114. button
  10115. {
  10116. bam GUIOSW
  10117. area 244 481 44 44
  10118. sequence 0
  10119. action
  10120. "
  10121. changeDonationAmount(1)
  10122. "
  10123. actionHold
  10124. "
  10125. changeDonationAmount(1)
  10126. "
  10127. }
  10128. button
  10129. {
  10130. bam GUIOSW
  10131. area 288 481 44 44
  10132. sequence 1
  10133. clickable lua "tonumber(storeDonateAmountEdit) > 0"
  10134. action
  10135. "
  10136. changeDonationAmount(-1)
  10137. "
  10138. actionHold
  10139. "
  10140. changeDonationAmount(-1)
  10141. "
  10142. }
  10143. button
  10144. {
  10145. area 119 537 200 40
  10146. bam GUIBUTNT
  10147. text "DONATE_BUTTON"
  10148. text style "button"
  10149. clickable lua "storeScreen:IsDonateButtonClickable()"
  10150. action
  10151. "
  10152. storeScreen:OnDonateButtonClick()
  10153. "
  10154. }
  10155. label
  10156. {
  10157. area 700 73 110 48
  10158. text lua "game:GetPartyGold()"
  10159. text style "gold"
  10160. }
  10161. text
  10162. {
  10163. area 473 182 320 364
  10164. text lua "store.donateText"
  10165. text style "normal_parchment"
  10166. scrollbar 'GUISCRC'
  10167. }
  10168. }
  10169. `
  10170. function storeRest()
  10171. storeScreen:RestParty()
  10172. end
  10173. `
  10174. menu
  10175. {
  10176. name 'STORE_ROOMS'
  10177. align center top
  10178. onOpen
  10179. "
  10180. storeScreen:SetRoomType(0)
  10181. storeScreen:UpdateRentRoomPanel()
  10182. "
  10183. ignoreEsc
  10184.  
  10185. label
  10186. {
  10187. area 0 0 864 598
  10188. mosaic GUISTROB
  10189. }
  10190. label
  10191. {
  10192. area 48 6 768 44
  10193. text "ROOMS_TITLE"
  10194. text style "title"
  10195. }
  10196. label
  10197. {
  10198. area 255 62 360 37
  10199. text lua "Infinity_FetchString(storeScreen:GetStoreName())"
  10200. text style "label"
  10201. }
  10202. label
  10203. {
  10204. area 724 67 110 48
  10205. text lua "game:GetPartyGold()"
  10206. text style "gold"
  10207. }
  10208.  
  10209. button
  10210. {
  10211. area 31 128 245 161
  10212. bam "INNROOMS"
  10213. sequence 0
  10214. clickable lua "storeScreen:IsRoomTypeClickable(1)"
  10215. action
  10216. "
  10217. storeScreen:SetRoomType(1)
  10218. selectedRoom = Infinity_FindUIItemByName('BUTTON_room_peasant')
  10219. "
  10220. }
  10221. button
  10222. {
  10223. name "BUTTON_room_peasant"
  10224. area 38 304 230 40
  10225. bam GUIBUTMT
  10226. text "PEASANT_BUTTON"
  10227. text style "button"
  10228. glow lua "storeScreen:GetRoomType() == 1"
  10229. clickable lua "storeScreen:IsRoomTypeClickable(1)"
  10230. action
  10231. "
  10232. storeScreen:SetRoomType(1)
  10233. "
  10234. }
  10235.  
  10236. button
  10237. {
  10238. area 385 128 245 161
  10239. bam "INNROOMS"
  10240. sequence 1
  10241. clickable lua "storeScreen:IsRoomTypeClickable(2)"
  10242. action
  10243. "
  10244. storeScreen:SetRoomType(2)
  10245. selectedRoom = Infinity_FindUIItemByName('BUTTON_room_merchant')
  10246. "
  10247. }
  10248. button
  10249. {
  10250. name "BUTTON_room_merchant"
  10251. area 392 304 230 40
  10252. bam GUIBUTMT
  10253. text "MERCHANT_BUTTON"
  10254. text style "button"
  10255. glow lua "storeScreen:GetRoomType() == 2"
  10256. clickable lua "storeScreen:IsRoomTypeClickable(2)"
  10257. action
  10258. "
  10259. storeScreen:SetRoomType(2)
  10260. "
  10261. }
  10262.  
  10263. button
  10264. {
  10265. area 31 367 245 161
  10266. bam "INNROOMS"
  10267. sequence 2
  10268. clickable lua "storeScreen:IsRoomTypeClickable(3)"
  10269. frame 0
  10270. action
  10271. "
  10272. storeScreen:SetRoomType(3)
  10273. selectedRoom = Infinity_FindUIItemByName('BUTTON_room_noble')
  10274. "
  10275. }
  10276. button
  10277. {
  10278. name "BUTTON_room_noble"
  10279. area 38 540 230 40
  10280. bam GUIBUTMT
  10281. text "NOBLE_BUTTON"
  10282. text style "button"
  10283. glow lua "storeScreen:GetRoomType() == 3"
  10284. clickable lua "storeScreen:IsRoomTypeClickable(3)"
  10285. action
  10286. "
  10287. storeScreen:SetRoomType(3)
  10288. "
  10289. }
  10290.  
  10291. button
  10292. {
  10293. area 385 367 245 161
  10294. bam "INNROOMS"
  10295. sequence 3
  10296. clickable lua "storeScreen:IsRoomTypeClickable(4)"
  10297. action
  10298. "
  10299. storeScreen:SetRoomType(4)
  10300. selectedRoom = Infinity_FindUIItemByName('BUTTON_room_royal')
  10301. "
  10302. }
  10303. button
  10304. {
  10305. name "BUTTON_room_royal"
  10306. area 392 540 230 40
  10307. bam GUIBUTMT
  10308. text "ROYAL_BUTTON"
  10309. text style "button"
  10310. glow lua "storeScreen:GetRoomType() == 4"
  10311. clickable lua "storeScreen:IsRoomTypeClickable(4)"
  10312. action
  10313. "
  10314. storeScreen:SetRoomType(4)
  10315. "
  10316. }
  10317. label
  10318. {
  10319. area 654 464 70 40
  10320. text "COST_LABEL"
  10321. text style "label"
  10322. }
  10323. text
  10324. {
  10325. area 662 137 160 298
  10326. text lua "store.roomText"
  10327. text style "normal"
  10328. }
  10329. label
  10330. {
  10331. area 727 464 120 40
  10332. text lua "storeScreen:GetRoomCost()"
  10333. text style "gold"
  10334. }
  10335. button
  10336. {
  10337. area 650 518 200 40
  10338. bam GUIBUTNT
  10339. text "RENT_BUTTON"
  10340. text style "button"
  10341. action
  10342. "
  10343. storeScreen:OnRentRoomButtonClick()
  10344. "
  10345. }
  10346. }
  10347. menu
  10348. {
  10349. name 'STORE_HEALING'
  10350. align center top
  10351. onOpen "storeScreen:UpdateBuySpellPanel()"
  10352. ignoreEsc
  10353. label
  10354. {
  10355. area 0 0 864 598
  10356. mosaic GUISTIDB
  10357. }
  10358. label
  10359. {
  10360. area 48 6 768 44
  10361. text "HEALING_TITLE"
  10362. text style "title"
  10363. }
  10364. label
  10365. {
  10366. area 276 50 310 32
  10367. text lua "Infinity_FetchString(storeScreen:GetStoreName())"
  10368. text style "label"
  10369. }
  10370. label
  10371. {
  10372. area 719 70 110 48
  10373. text lua "game:GetPartyGold()"
  10374. text style "gold"
  10375. }
  10376. label
  10377. {
  10378. area 68 126 144 32
  10379. text "COST_LABEL"
  10380. text style "label"
  10381. align left center
  10382. }
  10383. label
  10384. {
  10385. area 282 126 90 32
  10386. text lua "storeScreen:GetSpellCost()"
  10387. text style "gold"
  10388. }
  10389. list
  10390. {
  10391. column
  10392. {
  10393. width 100
  10394. label
  10395. {
  10396. area 5 0 64 60
  10397. bam STONSLOT
  10398. frame lua "getStoreSlotHighlight(store.healingSpells[rowNumber].highlight)"
  10399. icon lua "store.healingSpells[rowNumber].icon"
  10400. tint lua "store.healingSpells[rowNumber].tint"
  10401. align center center
  10402. }
  10403. label
  10404. {
  10405. area 80 0 150 60
  10406. text lua "Infinity_FetchString(store.healingSpells[rowNumber].name)"
  10407. text style "normal"
  10408. text align left center
  10409. }
  10410. label
  10411. {
  10412. area 230 0 54 60
  10413. text style "gold"
  10414. text align center center
  10415. text lua "store.healingSpells[rowNumber].value"
  10416. }
  10417. label
  10418. {
  10419. enabled "store.healingSpells[rowNumber].valid == 0"
  10420. area 0 0 308 60
  10421. rectangle 1
  10422. rectangle opacity 150
  10423. }
  10424. }
  10425. area 64 164 308 386
  10426. hidehighlight
  10427. rowheight 60
  10428. table "store.healingSpells"
  10429. var "healingSpellsVar"
  10430. rowbackground GUISTBK2
  10431. scrollbar 'GUISCRC'
  10432. action
  10433. "
  10434. local highlight = true
  10435. if(store.healingSpells[healingSpellsVar].highlight == 1) then highlight = false end
  10436. if(highlight == true and store.healingSpells[healingSpellsVar].valid == 0) then return end
  10437. storeScreen:SelectSpellItem( healingSpellsVar - 1, highlight)
  10438. "
  10439. actionAlt
  10440. "
  10441. local spell = store.healingSpells[healingSpellsVar]
  10442. popupDetails(16189, spell.name, spell.description,spell.icon)
  10443. "
  10444. }
  10445. button
  10446. {
  10447. area 119 545 200 40
  10448. bam GUIBUTNT
  10449. text "BUY_BUTTON"
  10450. text style "button"
  10451. action
  10452. "
  10453. storeScreen:OnBuySpellButtonClick()
  10454. "
  10455. }
  10456. text
  10457. {
  10458. area 461 150 359 412
  10459. text lua "store.spellText"
  10460. text style "normal_parchment"
  10461. scrollbar 'GUISCRC'
  10462. }
  10463. }
  10464.  
  10465. menu
  10466. {
  10467. name 'STORE_DRINKS'
  10468. align center top
  10469. ignoreEsc
  10470. onOpen
  10471. "
  10472. storeScreen:UpdateBuyDrinksPanel()
  10473. store.drinkText = ''
  10474. "
  10475.  
  10476. label
  10477. {
  10478. area 0 0 864 598
  10479. mosaic GUISTIDB
  10480. }
  10481. label
  10482. {
  10483. area 48 6 768 44
  10484. text "DRINKS_TITLE"
  10485. text style "title"
  10486. }
  10487. label
  10488. {
  10489. area 277 54 310 29
  10490. text lua "Infinity_FetchString(storeScreen:GetStoreName())"
  10491. text style "label"
  10492. }
  10493. label
  10494. {
  10495. area 719 70 110 48
  10496. text lua "game:GetPartyGold()"
  10497. text style "gold"
  10498. }
  10499. label
  10500. {
  10501. area 64 127 202 31
  10502. text "DRINK_LABEL"
  10503. text style "label"
  10504. }
  10505. label
  10506. {
  10507. area 266 127 111 31
  10508. text "COST_LABEL"
  10509. text style "label"
  10510. text align center center
  10511. }
  10512. label
  10513. {
  10514. area 64 158 308 420
  10515. rectangle 1
  10516. }
  10517. list
  10518. {
  10519. column
  10520. {
  10521. width 100
  10522. label
  10523. {
  10524. area 5 0 200 60
  10525. text lua "store.drinks[rowNumber].name"
  10526. text style "normal"
  10527. text align left center
  10528. }
  10529. label
  10530. {
  10531. area 210 0 64 60
  10532. text lua "store.drinks[rowNumber].value"
  10533. text style "gold"
  10534. text align center center
  10535. }
  10536. label
  10537. {
  10538. enabled "store.drinks[rowNumber].valid == 0"
  10539. area 0 0 308 60
  10540. rectangle 1
  10541. rectangle opacity 150
  10542. }
  10543. }
  10544. area 64 158 308 420
  10545. rowheight 60
  10546. table "store.drinks"
  10547. var "storeDrinksVar"
  10548. scrollbar 'GUISCRC'
  10549. }
  10550. button
  10551. {
  10552. area 119 545 200 40
  10553. bam GUIBUTNT
  10554. text "BUY_BUTTON"
  10555. text style "button"
  10556. clickable lua "storeDrinksVar ~= nil and storeDrinksVar ~= 0"
  10557. action
  10558. "
  10559. storeScreen:OnBuyDrinkButtonClick(storeDrinksVar - 1)
  10560. "
  10561. }
  10562. label
  10563. {
  10564. area 650 155 127 93
  10565. bam lua "store.qualityIcon"
  10566. }
  10567. label
  10568. {
  10569. area 489 155 155 93
  10570. text "RUMORS_LABEL"
  10571. text style "label_parchment"
  10572. }
  10573. text
  10574. {
  10575. area 489 251 310 296
  10576. text lua "store.drinkText"
  10577. text style "normal_parchment"
  10578. scrollbar 'GUISCRC'
  10579. }
  10580. }
  10581. `
  10582. storePanelButtonHighlightGroup = nil
  10583. function setStoreMainPanel(buttonId)
  10584. local oldMenu = storeScreen:GetMenuName(storeCurMenuId)
  10585. Infinity_PopMenu(oldMenu)
  10586. storeCurMenuId = storeScreen:GetPanelButtonPanelId(buttonId)
  10587. Infinity_PushMenu(storeScreen:GetMenuName(storeCurMenuId))
  10588. end
  10589. function getBuySellTooltip()
  10590. if(storeScreen:IsContainer()) then
  10591. return t('TRANSFER_ITEMS_TOOLTIP')
  10592. else
  10593. return Infinity_FetchString(storeScreen:GetPanelButtonToolTip(0))
  10594. end
  10595. end
  10596. `
  10597. menu
  10598. {
  10599. name 'STORE_CHOOSER'
  10600. align center bottom
  10601. onOpen
  10602. "
  10603. local menuName = storeScreen:GetMenuName(storeCurMenuId)
  10604. Infinity_PushMenu(menuName)
  10605. pushSidebars()
  10606. local buttonId = storeScreen:GetPanelButtonId(storeCurMenuId)
  10607. storePanelButtonHighlightGroup = Infinity_FindUIItemByName('BUTTON_storechooser_' .. buttonId)
  10608. "
  10609. onClose
  10610. "
  10611. local menuName = storeScreen:GetMenuName(storeCurMenuId)
  10612. Infinity_PopMenu(menuName)
  10613. popSidebars()
  10614. "
  10615. ignoreEsc
  10616.  
  10617. label
  10618. {
  10619. area 0 0 864 112
  10620. mosaic GUISTBBB
  10621. }
  10622. label
  10623. {
  10624. area 22 18 80 70
  10625. bam lua "store.icon"
  10626. }
  10627. button
  10628. {
  10629. area 638 60 200 40
  10630. bam GUIBUTNT
  10631. text "DONE_BUTTON"
  10632. text style "button"
  10633. action
  10634. "
  10635. storeScreen:OnMainDoneButtonClick()
  10636. "
  10637. }
  10638. button
  10639. {
  10640. name 'BUTTON_storechooser_0'
  10641. area 110 18 62 64
  10642. enabled "storeScreen:GetPanelButtonEnabled(0)"
  10643. bam GUISTBBC
  10644. highlightgroup storePanelButtonHighlightGroup
  10645. sequence lua "storeScreen:GetPanelButtonSequence(0)"
  10646. tooltip lua "getBuySellTooltip()"
  10647. action
  10648. "
  10649. setStoreMainPanel(0)
  10650. "
  10651. }
  10652. button
  10653. {
  10654. name 'BUTTON_storechooser_1'
  10655. area 182 18 62 64
  10656. enabled "storeScreen:GetPanelButtonEnabled(1)"
  10657. bam GUISTBBC
  10658. highlightgroup storePanelButtonHighlightGroup
  10659. sequence lua "storeScreen:GetPanelButtonSequence(1)"
  10660. tooltip lua "Infinity_FetchString(storeScreen:GetPanelButtonToolTip(1))"
  10661. action
  10662. "
  10663. setStoreMainPanel(1)
  10664. "
  10665. }
  10666. button
  10667. {
  10668. name 'BUTTON_storechooser_2'
  10669. area 254 18 62 64
  10670. enabled "storeScreen:GetPanelButtonEnabled(2)"
  10671. bam GUISTBBC
  10672. highlightgroup storePanelButtonHighlightGroup
  10673. sequence lua "storeScreen:GetPanelButtonSequence(2)"
  10674. tooltip lua "Infinity_FetchString(storeScreen:GetPanelButtonToolTip(2))"
  10675. action
  10676. "
  10677. setStoreMainPanel(2)
  10678. "
  10679. }
  10680. button
  10681. {
  10682. name 'BUTTON_storechooser_3'
  10683. area 326 18 62 64
  10684. enabled "storeScreen:GetPanelButtonEnabled(3)"
  10685. bam GUISTBBC
  10686. highlightgroup storePanelButtonHighlightGroup
  10687. sequence lua "storeScreen:GetPanelButtonSequence(3)"
  10688. tooltip lua "Infinity_FetchString(storeScreen:GetPanelButtonToolTip(3))"
  10689. action
  10690. "
  10691. setStoreMainPanel(3)
  10692. "
  10693. }
  10694. }
  10695.  
  10696. `
  10697. function worldDeathLoadClickable()
  10698. if(e:IsMultiplayer() and not e:IsHosting()) then
  10699. return false
  10700. end
  10701. return not worldScreen:GetHardPaused()
  10702. end
  10703. function worldDeathQuitClickable()
  10704. return not worldScreen:GetHardPaused()
  10705. end
  10706. function worldDeathText()
  10707. if(e:IsMultiplayer()) then
  10708. if(e:IsHosting()) then
  10709. return Infinity_FetchString(19377)
  10710. else
  10711. return Infinity_FetchString(11331)
  10712. end
  10713. else
  10714. if(worldDeathStr == nil) then
  10715. return Infinity_FetchString(16498)
  10716. else
  10717. return Infinity_FetchString(worldDeathStr)
  10718. end
  10719. end
  10720. end
  10721. function worldDeathQuitText()
  10722. if(e:IsMultiplayer()) then
  10723. return t('LOGOUT_BUTTON')
  10724. else
  10725. return t('QUIT_BUTTON')
  10726. end
  10727. end
  10728. groundItemsButtonToggle = 0
  10729. highlightButtonToggle = 0
  10730. worldChatEdit = ""
  10731. `
  10732. menu
  10733. {
  10734. name "WORLD_DEATH"
  10735. align center center
  10736. ignoreEsc
  10737. modal
  10738. label
  10739. {
  10740. area 0 0 657 234
  10741. mosaic GUIERR6
  10742. }
  10743. label
  10744. {
  10745. area 29 21 580 126
  10746. text lua "worldDeathText()"
  10747. text style "label"
  10748. text align center center
  10749. }
  10750. button
  10751. {
  10752. area 79 170 230 40
  10753. bam GUIBUTMT
  10754. text "LOAD_BUTTON"
  10755. text style "button"
  10756. clickable lua "worldDeathLoadClickable()"
  10757. action
  10758. "
  10759. Infinity_PopMenu()
  10760. worldScreen:OnDeathLoad()
  10761. "
  10762. }
  10763. button
  10764. {
  10765. area 343 170 230 40
  10766. bam GUIBUTMT
  10767. text style "button"
  10768. text lua "worldDeathQuitText()"
  10769. clickable lua "worldDeathQuitClickable()"
  10770. action
  10771. "
  10772. Infinity_PopMenu()
  10773. worldScreen:OnDeathQuit()
  10774. "
  10775. }
  10776. }
  10777. `
  10778. actionBarTooltip = {}
  10779. `
  10780. menu
  10781. {
  10782. name "WORLD_ACTIONBAR"
  10783. align center bottom
  10784. onOpen
  10785. "
  10786. toolbarTop = 50
  10787. Infinity_PushMenu('WORLD_MESSAGES')
  10788. if(groundItemsButtonToggle == 1) then
  10789. worldScreen:StartGroundItems()
  10790. end
  10791. worldScreen:SetHighlightEnabled(highlightButtonToggle == 1)
  10792. "
  10793. onClose
  10794. "
  10795. Infinity_PopMenu('WORLD_QUICKLOOT');
  10796. Infinity_PopMenu('WORLD_MESSAGES');
  10797. "
  10798. ignoreEsc
  10799. label
  10800. {
  10801. area 0 0 746 57
  10802. mosaic GUWBTP10
  10803. }
  10804. button
  10805. {
  10806. area 21 12 32 32
  10807. bam ROUNDBUT
  10808. scaleToClip
  10809. toggle groundItemsButtonToggle
  10810. tooltip lua "Infinity_FetchString(32217)"
  10811. action
  10812. "
  10813. if(groundItemsButtonToggle == 1) then
  10814. worldScreen:StartGroundItems()
  10815. else
  10816. worldScreen:StopGroundItems()
  10817. end
  10818. "
  10819. actionAlt
  10820. "
  10821. if(groundItemsButtonToggle == 1) then
  10822. worldScreen:StartGroundItems()
  10823. else
  10824. worldScreen:StopGroundItems()
  10825. end
  10826. "
  10827. }
  10828. button
  10829. {
  10830. area 68 1 52 52
  10831. actionBar 0
  10832. enabled "buttonArray:GetButtonEnabled(0)"
  10833. tooltip lua "actionBarTooltip[0]"
  10834. action "buttonArray:OnLButtonPressed(0)"
  10835. actionAlt "buttonArray:OnRButtonPressed(0)"
  10836. }
  10837. button
  10838. {
  10839. area 122 1 52 52
  10840. actionBar 1
  10841. enabled "buttonArray:GetButtonEnabled(1)"
  10842. tooltip lua "actionBarTooltip[1]"
  10843. action "buttonArray:OnLButtonPressed(1)"
  10844. actionAlt "buttonArray:OnRButtonPressed(1)"
  10845. }
  10846. button
  10847. {
  10848. area 177 1 52 52
  10849. actionBar 2
  10850. enabled "buttonArray:GetButtonEnabled(2)"
  10851. tooltip lua "actionBarTooltip[2]"
  10852. action "buttonArray:OnLButtonPressed(2)"
  10853. actionAlt "buttonArray:OnRButtonPressed(2)"
  10854. }
  10855. button
  10856. {
  10857. area 231 1 52 52
  10858. actionBar 3
  10859. enabled "buttonArray:GetButtonEnabled(3)"
  10860. tooltip lua "actionBarTooltip[3]"
  10861. action "buttonArray:OnLButtonPressed(3)"
  10862. actionAlt "buttonArray:OnRButtonPressed(3)"
  10863. }
  10864. button
  10865. {
  10866. area 299 1 52 52
  10867. actionBar 4
  10868. enabled "buttonArray:GetButtonEnabled(4)"
  10869. tooltip lua "actionBarTooltip[4]"
  10870. action "buttonArray:OnLButtonPressed(4)"
  10871. actionAlt "buttonArray:OnRButtonPressed(4)"
  10872. }
  10873. button
  10874. {
  10875. area 353 1 52 52
  10876. actionBar 5
  10877. enabled "buttonArray:GetButtonEnabled(5)"
  10878. tooltip lua "actionBarTooltip[5]"
  10879. action "buttonArray:OnLButtonPressed(5)"
  10880. actionAlt "buttonArray:OnRButtonPressed(5)"
  10881. }
  10882. button
  10883. {
  10884. area 407 1 52 52
  10885. actionBar 6
  10886. enabled "buttonArray:GetButtonEnabled(6)"
  10887. tooltip lua "actionBarTooltip[6]"
  10888. action "buttonArray:OnLButtonPressed(6)"
  10889. actionAlt "buttonArray:OnRButtonPressed(6)"
  10890. }
  10891. button
  10892. {
  10893. area 461 1 52 52
  10894. actionBar 7
  10895. enabled "buttonArray:GetButtonEnabled(7)"
  10896. tooltip lua "actionBarTooltip[7]"
  10897. action "buttonArray:OnLButtonPressed(7)"
  10898. actionAlt "buttonArray:OnRButtonPressed(7)"
  10899. }
  10900.  
  10901. button
  10902. {
  10903. area 528 1 52 52
  10904. actionBar 8
  10905. enabled "buttonArray:GetButtonEnabled(8)"
  10906. tooltip lua "actionBarTooltip[8]"
  10907. action "buttonArray:OnLButtonPressed(8)"
  10908. actionAlt "buttonArray:OnRButtonPressed(8)"
  10909. }
  10910. button
  10911. {
  10912. area 582 1 52 52
  10913. actionBar 9
  10914. enabled "buttonArray:GetButtonEnabled(9)"
  10915. tooltip lua "actionBarTooltip[9]"
  10916. action "buttonArray:OnLButtonPressed(9)"
  10917. actionAlt "buttonArray:OnRButtonPressed(9)"
  10918. }
  10919. button
  10920. {
  10921. area 636 1 52 52
  10922. actionBar 10
  10923. enabled "buttonArray:GetButtonEnabled(10)"
  10924. tooltip lua "actionBarTooltip[10]"
  10925. action "buttonArray:OnLButtonPressed(10)"
  10926. actionAlt "buttonArray:OnRButtonPressed(10)"
  10927. }
  10928. button
  10929. {
  10930. area 689 1 52 52
  10931. actionBar 11
  10932. enabled "buttonArray:GetButtonEnabled(11)"
  10933. tooltip lua "actionBarTooltip[11]"
  10934. action "buttonArray:OnLButtonPressed(11)"
  10935. actionAlt "buttonArray:OnRButtonPressed(11)"
  10936. }
  10937. }
  10938. `
  10939. loot =
  10940. {
  10941. containerItems = {},
  10942. groupItems = {},
  10943. groundItems = {}
  10944. }
  10945. function getContainerItemProperty(index, property)
  10946. local idxScrolled = index + worldScreen:GetTopContainerItem()
  10947. if(loot.containerItems[idxScrolled] == nil or loot.containerItems[idxScrolled].item == nil) then
  10948. return nil
  10949. end
  10950. return loot.containerItems[idxScrolled].item[property]
  10951. end
  10952. function getGroupItemProperty(index, property)
  10953. local idxScrolled = index + worldScreen:GetTopGroupItem()
  10954. if(loot.groupItems[idxScrolled] == nil or loot.groupItems[idxScrolled].item == nil) then
  10955. return nil
  10956. end
  10957. return loot.groupItems[idxScrolled].item[property]
  10958. end
  10959. function scrollContainerItems()
  10960. if scrollDirection > 0 then
  10961. if worldScreen:ContainerScrollEnabled(-1) then
  10962. worldScreen:OnContainerScroll(-1)
  10963. end
  10964. elseif scrollDirection < 0 then
  10965. if worldScreen:ContainerScrollEnabled(1) then
  10966. worldScreen:OnContainerScroll(1)
  10967. end
  10968. end
  10969. end
  10970. function scrollGroupItems()
  10971. if scrollDirection > 0 then
  10972. if worldScreen:GroupScrollEnabled(-1) then
  10973. worldScreen:OnGroupScroll(-1)
  10974. end
  10975. elseif scrollDirection < 0 then
  10976. if worldScreen:GroupScrollEnabled(1) then
  10977. worldScreen:OnGroupScroll(1)
  10978. end
  10979. end
  10980. end
  10981. function showContainerItemDescription(index)
  10982. local idxScrolled = index + worldScreen:GetTopContainerItem()
  10983. if(loot.containerItems[idxScrolled] == nil or loot.containerItems[idxScrolled].item == nil) then
  10984. return nil
  10985. end
  10986. Infinity_GetContainerItemDescription(idxScrolled)
  10987. showItemDescription(loot.containerItems[idxScrolled].item, 2)
  10988. end
  10989. function showGroupItemDescription(index)
  10990. local idxScrolled = index + worldScreen:GetTopGroupItem()
  10991. if(loot.groupItems[idxScrolled] == nil or loot.groupItems[idxScrolled].item == nil) then
  10992. return nil
  10993. end
  10994. Infinity_GetGroupItemDescription(idxScrolled)
  10995. showItemDescription(loot.groupItems[idxScrolled].item, 2)
  10996. end
  10997. `
  10998. menu
  10999. {
  11000. name "WORLD_CONTAINER"
  11001. align center bottom
  11002. offset -24 0
  11003. ignoreesc
  11004. label
  11005. {
  11006. area 0 0 653 130
  11007. mosaic gmpwmsg0
  11008. }
  11009. label
  11010. {
  11011. area 16 10 83 100
  11012. bam lua "loot.containerIcon"
  11013. }
  11014. button
  11015. {
  11016. area 104 2 209 116
  11017. actionScroll "scrollContainerItems()"
  11018. }
  11019. button
  11020. {
  11021. area 108 8 52 52
  11022. bam STONSLOT
  11023. tooltip lua "getContainerItemProperty(0,'name')"
  11024. tint lua "getContainerItemProperty(0,'tint')"
  11025. icon lua "getContainerItemProperty(0,'icon')"
  11026. count lua "getContainerItemProperty(0,'count')"
  11027. usages lua "getContainerItemProperty(0,'usages')"
  11028. action "worldScreen:OnContainerButtonClick(0)"
  11029. actionAlt "showContainerItemDescription(0)"
  11030. actionScroll "scrollContainerItems()"
  11031. }
  11032. button
  11033. {
  11034. area 162 8 52 52
  11035. bam STONSLOT
  11036. tooltip lua "getContainerItemProperty(1,'name')"
  11037. tint lua "getContainerItemProperty(1,'tint')"
  11038. icon lua "getContainerItemProperty(1,'icon')"
  11039. count lua "getContainerItemProperty(1,'count')"
  11040. usages lua "getContainerItemProperty(1,'usages')"
  11041. action "worldScreen:OnContainerButtonClick(1)"
  11042. actionAlt "showContainerItemDescription(1)"
  11043. actionScroll "scrollContainerItems()"
  11044. }
  11045. button
  11046. {
  11047. area 216 8 52 52
  11048. bam STONSLOT
  11049. tooltip lua "getContainerItemProperty(2,'name')"
  11050. tint lua "getContainerItemProperty(2,'tint')"
  11051. icon lua "getContainerItemProperty(2,'icon')"
  11052. count lua "getContainerItemProperty(2,'count')"
  11053. usages lua "getContainerItemProperty(2,'usages')"
  11054. action "worldScreen:OnContainerButtonClick(2)"
  11055. actionAlt "showContainerItemDescription(2)"
  11056. actionScroll "scrollContainerItems()"
  11057. }
  11058. button
  11059. {
  11060. area 108 62 52 52
  11061. bam STONSLOT
  11062. tooltip lua "getContainerItemProperty(3,'name')"
  11063. tint lua "getContainerItemProperty(3,'tint')"
  11064. icon lua "getContainerItemProperty(3,'icon')"
  11065. count lua "getContainerItemProperty(3,'count')"
  11066. usages lua "getContainerItemProperty(3,'usages')"
  11067. action "worldScreen:OnContainerButtonClick(3)"
  11068. actionAlt "showContainerItemDescription(3)"
  11069. actionScroll "scrollContainerItems()"
  11070. }
  11071. button
  11072. {
  11073. area 162 62 52 52
  11074. bam STONSLOT
  11075. tooltip lua "getContainerItemProperty(4,'name')"
  11076. tint lua "getContainerItemProperty(4,'tint')"
  11077. icon lua "getContainerItemProperty(4,'icon')"
  11078. count lua "getContainerItemProperty(4,'count')"
  11079. usages lua "getContainerItemProperty(4,'usages')"
  11080. action "worldScreen:OnContainerButtonClick(4)"
  11081. actionAlt "showContainerItemDescription(4)"
  11082. actionScroll "scrollContainerItems()"
  11083. }
  11084. button
  11085. {
  11086. area 216 62 52 52
  11087. bam STONSLOT
  11088. tooltip lua "getContainerItemProperty(5,'name')"
  11089. tint lua "getContainerItemProperty(5,'tint')"
  11090. icon lua "getContainerItemProperty(5,'icon')"
  11091. count lua "getContainerItemProperty(5,'count')"
  11092. usages lua "getContainerItemProperty(5,'usages')"
  11093. action "worldScreen:OnContainerButtonClick(5)"
  11094. actionAlt "showContainerItemDescription(5)"
  11095. actionScroll "scrollContainerItems()"
  11096. }
  11097. button
  11098. {
  11099. area 268 8 44 44
  11100. enabled "worldScreen:ContainerScrollEnabled(-1)"
  11101. bam guisv10
  11102. sequence 0
  11103. action
  11104. "
  11105. worldScreen:OnContainerScroll(-1)
  11106. "
  11107. actionScroll "scrollContainerItems()"
  11108. }
  11109. button
  11110. {
  11111. area 268 70 44 44
  11112. enabled "worldScreen:ContainerScrollEnabled(1)"
  11113. bam guisv10
  11114. sequence 1
  11115. action
  11116. "
  11117. worldScreen:OnContainerScroll(1)
  11118. "
  11119. actionScroll "scrollContainerItems()"
  11120. }
  11121. label
  11122. {
  11123. area 313 12 68 100
  11124. encumbrance
  11125. }
  11126. button
  11127. {
  11128. area 406 2 162 116
  11129. actionScroll "scrollGroupItems()"
  11130. }
  11131. button
  11132. {
  11133. area 411 8 52 52
  11134. bam STONSLOT
  11135. tooltip lua "getGroupItemProperty(0,'name')"
  11136. tint lua "getGroupItemProperty(0,'tint')"
  11137. icon lua "getGroupItemProperty(0,'icon')"
  11138. count lua "getGroupItemProperty(0,'count')"
  11139. usages lua "getGroupItemProperty(0,'usages')"
  11140. action "worldScreen:OnContainerButtonClick(10)"
  11141. actionAlt "showGroupItemDescription(0)"
  11142. actionScroll "scrollGroupItems()"
  11143. }
  11144. button
  11145. {
  11146. area 465 8 52 52
  11147. bam STONSLOT
  11148. tooltip lua "getGroupItemProperty(1,'name')"
  11149. tint lua "getGroupItemProperty(1,'tint')"
  11150. icon lua "getGroupItemProperty(1,'icon')"
  11151. count lua "getGroupItemProperty(1,'count')"
  11152. usages lua "getGroupItemProperty(1,'usages')"
  11153. action "worldScreen:OnContainerButtonClick(11)"
  11154. actionAlt "showGroupItemDescription(1)"
  11155. actionScroll "scrollGroupItems()"
  11156. }
  11157. button
  11158. {
  11159. area 411 62 52 52
  11160. bam STONSLOT
  11161. tooltip lua "getGroupItemProperty(2,'name')"
  11162. tint lua "getGroupItemProperty(2,'tint')"
  11163. icon lua "getGroupItemProperty(2,'icon')"
  11164. count lua "getGroupItemProperty(2,'count')"
  11165. usages lua "getGroupItemProperty(2,'usages')"
  11166. action "worldScreen:OnContainerButtonClick(12)"
  11167. actionAlt "showGroupItemDescription(2)"
  11168. actionScroll "scrollGroupItems()"
  11169. }
  11170. button
  11171. {
  11172. area 465 62 52 52
  11173. bam STONSLOT
  11174. tooltip lua "getGroupItemProperty(3,'name')"
  11175. tint lua "getGroupItemProperty(3,'tint')"
  11176. icon lua "getGroupItemProperty(3,'icon')"
  11177. count lua "getGroupItemProperty(3,'count')"
  11178. usages lua "getGroupItemProperty(3,'usages')"
  11179. action "worldScreen:OnContainerButtonClick(13)"
  11180. actionAlt "showGroupItemDescription(3)"
  11181. actionScroll "scrollGroupItems()"
  11182. }
  11183. button
  11184. {
  11185. area 517 8 44 44
  11186. enabled "worldScreen:GroupScrollEnabled(-1)"
  11187. bam guisv10
  11188. sequence 0
  11189. action
  11190. "
  11191. worldScreen:OnGroupScroll(-1)
  11192. "
  11193. actionScroll "scrollGroupItems()"
  11194. }
  11195. button
  11196. {
  11197. area 517 70 44 44
  11198. enabled "worldScreen:GroupScrollEnabled(1)"
  11199. bam guisv10
  11200. sequence 1
  11201. action
  11202. "
  11203. worldScreen:OnGroupScroll(1)
  11204. "
  11205. }
  11206. label
  11207. {
  11208. area 568 20 78 50
  11209. bam GUIGOLD
  11210. }
  11211. label
  11212. {
  11213. area 575 76 71 28
  11214. text lua "game:GetPartyGold()"
  11215. text style "gold"
  11216. }
  11217. button
  11218. {
  11219. area 40 82 32 32
  11220. bam "ROUNDBUT"
  11221. scaleToClip
  11222. action
  11223. "
  11224. worldScreen:TakeAllFromContainer()
  11225. "
  11226. }
  11227. }
  11228. `
  11229. function getSlotContainerId(index)
  11230. local idxScrolled = index + worldScreen:GetTopGroundItem()
  11231. if(loot.groundItems[idxScrolled] == nil) then
  11232. return nil
  11233. end
  11234. return loot.groundItems[idxScrolled].containerId
  11235. end
  11236. function getGroundItemProperty(index, property)
  11237. local idxScrolled = index + worldScreen:GetTopGroundItem()
  11238. if(loot.groundItems[idxScrolled] == nil or loot.groundItems[idxScrolled].item == nil) then
  11239. return nil
  11240. end
  11241. return loot.groundItems[idxScrolled].item[property]
  11242. end
  11243.  
  11244. function groundItemClick(slotId)
  11245. local slot = loot.groundItems[slotId + worldScreen:GetTopGroundItem()]
  11246. if(slot and slot.item) then
  11247. worldScreen:OnGroundButtonClick(slot.slotId, slot.containerId, slot.item.res)
  11248. end
  11249. end
  11250.  
  11251. function showGroundItemDescription(slotId)
  11252. local slot = loot.groundItems[slotId + worldScreen:GetTopGroundItem()]
  11253. if(slot and slot.item) then
  11254. Infinity_GetGroundItemDescription(slotId + worldScreen:GetTopGroundItem(), slot.slotId, slot.containerId)
  11255. showItemDescription(slot.item, 2)
  11256. end
  11257. end
  11258. `
  11259. menu
  11260. {
  11261. name 'WORLD_QUICKLOOT'
  11262. align center bottom
  11263. ignoreEsc
  11264. onOpen
  11265. "
  11266. Infinity_SetOffset('WORLD_QUICKLOOT',0, -toolbarTop)
  11267. "
  11268. button
  11269. {
  11270. area 2 4 38 53
  11271. bam GUIBTACT
  11272. frame 44
  11273. enabled "worldScreen:GroundScrollEnabled(-1) or worldScreen:GroundScrollEnabled(1)"
  11274. action
  11275. "
  11276. worldScreen:OnGroundScroll(-1)
  11277. "
  11278. }
  11279. button
  11280. {
  11281. area 610 4 40 53
  11282. bam GUIBTACT
  11283. frame 42
  11284. enabled "worldScreen:GroundScrollEnabled(-1) or worldScreen:GroundScrollEnabled(1)"
  11285. action
  11286. "
  11287. worldScreen:OnGroundScroll(1)
  11288. "
  11289. }
  11290. button
  11291. {
  11292. area 46 5 52 52
  11293. bam STONSLOT
  11294. tooltip lua "getGroundItemProperty(0,'name')"
  11295. tint lua "getGroundItemProperty(0,'tint')"
  11296. icon lua "getGroundItemProperty(0,'icon')"
  11297. count lua "getGroundItemProperty(0,'count')"
  11298. usages lua "getGroundItemProperty(0,'usages')"
  11299. action "groundItemClick(0)"
  11300. actionAlt "showGroundItemDescription(0)"
  11301. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(0,'containerId')"
  11302. actionExit "mouseOverQuicklootContainer = nil"
  11303. }
  11304. button
  11305. {
  11306. area 102 5 52 52
  11307. bam STONSLOT
  11308. tooltip lua "getGroundItemProperty(1,'name')"
  11309. tint lua "getGroundItemProperty(1,'tint')"
  11310. icon lua "getGroundItemProperty(1,'icon')"
  11311. count lua "getGroundItemProperty(1,'count')"
  11312. usages lua "getGroundItemProperty(1,'usages')"
  11313. action "groundItemClick(1)"
  11314. actionAlt "showGroundItemDescription(1)"
  11315. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(1,'containerId')"
  11316. actionExit "mouseOverQuicklootContainer = nil"
  11317. }
  11318. button
  11319. {
  11320. area 158 5 52 52
  11321. bam STONSLOT
  11322. tooltip lua "getGroundItemProperty(2,'name')"
  11323. tint lua "getGroundItemProperty(2,'tint')"
  11324. icon lua "getGroundItemProperty(2,'icon')"
  11325. count lua "getGroundItemProperty(2,'count')"
  11326. usages lua "getGroundItemProperty(2,'usages')"
  11327. action "groundItemClick(2)"
  11328. actionAlt "showGroundItemDescription(2)"
  11329. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(2,'containerId')"
  11330. actionExit "mouseOverQuicklootContainer = nil"
  11331. }
  11332. button
  11333. {
  11334. area 214 5 52 52
  11335. bam STONSLOT
  11336. tooltip lua "getGroundItemProperty(3,'name')"
  11337. tint lua "getGroundItemProperty(3,'tint')"
  11338. icon lua "getGroundItemProperty(3,'icon')"
  11339. count lua "getGroundItemProperty(3,'count')"
  11340. usages lua "getGroundItemProperty(3,'usages')"
  11341. action "groundItemClick(3)"
  11342. actionAlt "showGroundItemDescription(3)"
  11343. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(3,'containerId')"
  11344. actionExit "mouseOverQuicklootContainer = nil"
  11345. }
  11346. button
  11347. {
  11348. area 270 5 52 52
  11349. bam STONSLOT
  11350. tooltip lua "getGroundItemProperty(4,'name')"
  11351. tint lua "getGroundItemProperty(4,'tint')"
  11352. icon lua "getGroundItemProperty(4,'icon')"
  11353. count lua "getGroundItemProperty(4,'count')"
  11354. usages lua "getGroundItemProperty(4,'usages')"
  11355. action "groundItemClick(4)"
  11356. actionAlt "showGroundItemDescription(4)"
  11357. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(4,'containerId')"
  11358. actionExit "mouseOverQuicklootContainer = nil"
  11359. }
  11360. button
  11361. {
  11362. area 326 5 52 52
  11363. bam STONSLOT
  11364. tooltip lua "getGroundItemProperty(5,'name')"
  11365. tint lua "getGroundItemProperty(5,'tint')"
  11366. icon lua "getGroundItemProperty(5,'icon')"
  11367. count lua "getGroundItemProperty(5,'count')"
  11368. usages lua "getGroundItemProperty(5,'usages')"
  11369. action "groundItemClick(5)"
  11370. actionAlt "showGroundItemDescription(5)"
  11371. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(5,'containerId')"
  11372. actionExit "mouseOverQuicklootContainer = nil"
  11373. }
  11374. button
  11375. {
  11376. area 383 5 52 52
  11377. bam STONSLOT
  11378. tooltip lua "getGroundItemProperty(6,'name')"
  11379. tint lua "getGroundItemProperty(6,'tint')"
  11380. icon lua "getGroundItemProperty(6,'icon')"
  11381. count lua "getGroundItemProperty(6,'count')"
  11382. usages lua "getGroundItemProperty(6,'usages')"
  11383. action "groundItemClick(6)"
  11384. actionAlt "showGroundItemDescription(6)"
  11385. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(6,'containerId')"
  11386. actionExit "mouseOverQuicklootContainer = nil"
  11387. }
  11388. button
  11389. {
  11390. area 439 5 52 52
  11391. bam STONSLOT
  11392. tooltip lua "getGroundItemProperty(7,'name')"
  11393. tint lua "getGroundItemProperty(7,'tint')"
  11394. icon lua "getGroundItemProperty(7,'icon')"
  11395. count lua "getGroundItemProperty(7,'count')"
  11396. usages lua "getGroundItemProperty(7,'usages')"
  11397. action "groundItemClick(7)"
  11398. actionAlt "showGroundItemDescription(7)"
  11399. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(7,'containerId')"
  11400. actionExit "mouseOverQuicklootContainer = nil"
  11401. }
  11402. button
  11403. {
  11404. area 495 5 52 52
  11405. bam STONSLOT
  11406. tooltip lua "getGroundItemProperty(8,'name')"
  11407. tint lua "getGroundItemProperty(8,'tint')"
  11408. icon lua "getGroundItemProperty(8,'icon')"
  11409. count lua "getGroundItemProperty(8,'count')"
  11410. usages lua "getGroundItemProperty(8,'usages')"
  11411. action "groundItemClick(8)"
  11412. actionAlt "showGroundItemDescription(8)"
  11413. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(8,'containerId')"
  11414. actionExit "mouseOverQuicklootContainer = nil"
  11415. }
  11416. button
  11417. {
  11418. area 551 5 52 52
  11419. bam STONSLOT
  11420. tooltip lua "getGroundItemProperty(9,'name')"
  11421. tint lua "getGroundItemProperty(9,'tint')"
  11422. icon lua "getGroundItemProperty(9,'icon')"
  11423. count lua "getGroundItemProperty(9,'count')"
  11424. usages lua "getGroundItemProperty(9,'usages')"
  11425. action "groundItemClick(9)"
  11426. actionAlt "showGroundItemDescription(9)"
  11427. actionEnter "mouseOverQuicklootContainer = getSlotContainerId(9,'containerId')"
  11428. actionExit "mouseOverQuicklootContainer = nil"
  11429. }
  11430. }
  11431. menu
  11432. {
  11433. name 'WORLD_PICKPARTY'
  11434. align center bottom
  11435. ignoreEsc
  11436. label
  11437. {
  11438. area 0 0 845 160
  11439. mosaic GUWPKPC0
  11440. }
  11441. label
  11442. {
  11443. area 14 11 431 32
  11444. text "REMOVE_MEMBERS_LABEL"
  11445. text style "label"
  11446. align left center
  11447. }
  11448. button
  11449. {
  11450. area 13 54 61 91
  11451. bitmap lua "worldScreen:GetPickPartyPortrait(0)"
  11452. glow lua "worldScreen:GetPickPartyCharacterId(0) == worldScreen:GetPickPartyRemoveCharacterId()"
  11453. action
  11454. "
  11455. worldScreen:OnPickPartyPortraitButtonClick(0)
  11456. "
  11457. }
  11458. button
  11459. {
  11460. area 75 54 61 91
  11461. bitmap lua "worldScreen:GetPickPartyPortrait(1)"
  11462. glow lua "worldScreen:GetPickPartyCharacterId(1) == worldScreen:GetPickPartyRemoveCharacterId()"
  11463. action
  11464. "
  11465. worldScreen:OnPickPartyPortraitButtonClick(1)
  11466. "
  11467. }
  11468. button
  11469. {
  11470. area 137 54 61 91
  11471. bitmap lua "worldScreen:GetPickPartyPortrait(2)"
  11472. glow lua "worldScreen:GetPickPartyCharacterId(2) == worldScreen:GetPickPartyRemoveCharacterId()"
  11473. action
  11474. "
  11475. worldScreen:OnPickPartyPortraitButtonClick(2)
  11476. "
  11477. }
  11478. button
  11479. {
  11480. area 199 54 61 91
  11481. bitmap lua "worldScreen:GetPickPartyPortrait(3)"
  11482. glow lua "worldScreen:GetPickPartyCharacterId(3) == worldScreen:GetPickPartyRemoveCharacterId()"
  11483. action
  11484. "
  11485. worldScreen:OnPickPartyPortraitButtonClick(3)
  11486. "
  11487. }
  11488. button
  11489. {
  11490. area 261 54 61 91
  11491. bitmap lua "worldScreen:GetPickPartyPortrait(4)"
  11492. glow lua "worldScreen:GetPickPartyCharacterId(4) == worldScreen:GetPickPartyRemoveCharacterId()"
  11493. action
  11494. "
  11495. worldScreen:OnPickPartyPortraitButtonClick(4)
  11496. "
  11497. }
  11498. button
  11499. {
  11500. area 323 54 61 91
  11501. bitmap lua "worldScreen:GetPickPartyPortrait(5)"
  11502. glow lua "worldScreen:GetPickPartyCharacterId(5) == worldScreen:GetPickPartyRemoveCharacterId()"
  11503. action
  11504. "
  11505. worldScreen:OnPickPartyPortraitButtonClick(5)
  11506. "
  11507. }
  11508. button
  11509. {
  11510. area 385 54 61 91
  11511. bitmap lua "worldScreen:GetPickPartyPortrait(6)"
  11512. glow lua "worldScreen:GetPickPartyCharacterId(6) == worldScreen:GetPickPartyRemoveCharacterId()"
  11513. action
  11514. "
  11515. worldScreen:OnPickPartyPortraitButtonClick(6)
  11516. "
  11517. }
  11518. label
  11519. {
  11520. area 747 11 91 32
  11521. text lua "game:GetCharacterOverflowCount()"
  11522. text style "normal"
  11523. align center center
  11524. }
  11525. button
  11526. {
  11527. area 638 54 200 40
  11528. bam guibutnt
  11529. text "REMOVE_BUTTON"
  11530. text style "button"
  11531. clickable lua "worldScreen:IsPickPartyRemoveButtonClickable()"
  11532. action
  11533. "
  11534. popup2Button(17518, 'REMOVE_BUTTON', function() worldScreen:RemoveCharacterFromParty() end)
  11535. "
  11536. }
  11537. button
  11538. {
  11539. area 638 101 200 40
  11540. bam guibutnt
  11541. text "DONE_BUTTON"
  11542. text style "button"
  11543. clickable lua "worldScreen:IsPickPartyDoneButtonClickable()"
  11544. on esc
  11545. action
  11546. "
  11547. worldScreen:OnPickPartyDoneButtonClick()
  11548. "
  11549. }
  11550. }
  11551. `
  11552. currentSave = 0
  11553. function getSaveBackground(row)
  11554. if(row == currentSave) then
  11555. return "GUISAVEC"
  11556. else
  11557. return "GUISAVEB"
  11558. end
  11559. end
  11560. function getLoadMenuTitle()
  11561. if (gameSaves.isImporting~=1) then
  11562. return t('LOAD_TITLE')
  11563. end
  11564. return t('IMPORT_TITLE')
  11565. end
  11566. `
  11567.  
  11568. menu
  11569. {
  11570. name 'LOAD'
  11571. align center center
  11572. ignoreEsc
  11573. onOpen
  11574. "
  11575. if gameSaves.isImporting == 1 and e:IsIOS() and (gameSaves.files == nil or #(gameSaves.files) == 0) then
  11576. popupInfo(Infinity_FetchString(71373))
  11577. end
  11578. "
  11579.  
  11580. button
  11581. {
  11582. area 0 0 1024 768
  11583. mosaic GUISMBM --GUISRSVB
  11584. action
  11585. "
  11586. currentSave = nil
  11587. "
  11588. }
  11589. label
  11590. {
  11591. area 162 16 700 44
  11592. text lua "getLoadMenuTitle()"
  11593. text style "title"
  11594. }
  11595.  
  11596. list
  11597. {
  11598. column
  11599. {
  11600. width 75
  11601. label
  11602. {
  11603. area 0,0,928,-1
  11604. mosaic lua 'getSaveBackground(rowNumber)'
  11605. respectClipping
  11606. align center center
  11607. }
  11608. button
  11609. {
  11610. enabled "gameSaves.files[rowNumber].hasScreenShot"
  11611. area 0 5 60 60
  11612. bitmap res "gameSaves.files[rowNumber].screenshot"
  11613. bitmap area 8 8 160 120
  11614. align center center
  11615. }
  11616.  
  11617. label
  11618. {
  11619. area 190 15 300 30
  11620. text lua "gameSaves.files[rowNumber].slotName"
  11621. text style "label"
  11622. align left top
  11623. }
  11624.  
  11625. label
  11626. {
  11627. area 190 45 300 30
  11628. text lua "gameSaves.files[rowNumber].chapter .. ' ' .. gameSaves.files[rowNumber].time"
  11629. text style "label"
  11630. align left top
  11631. pad 0 0 -200 0
  11632. }
  11633. button
  11634. {
  11635. enabled "gameSaves.files[rowNumber].hasPortrait0"
  11636. area 255 82 60 60
  11637. bitmap res "gameSaves.files[rowNumber].portrait0"
  11638. bitmap area 0 0 30 48
  11639. align center center
  11640. }
  11641. button
  11642. {
  11643. enabled "gameSaves.files[rowNumber].hasPortrait1"
  11644. area 317 82 60 60
  11645. bitmap res "gameSaves.files[rowNumber].portrait1"
  11646. bitmap area 0 0 30 48
  11647. align center center
  11648. }
  11649. button
  11650. {
  11651. enabled "gameSaves.files[rowNumber].hasPortrait2"
  11652. area 379 82 60 60
  11653. bitmap res "gameSaves.files[rowNumber].portrait2"
  11654. bitmap area 0 0 30 48
  11655. align center center
  11656. }
  11657. button
  11658. {
  11659. enabled "gameSaves.files[rowNumber].hasPortrait3"
  11660. area 441 82 60 60
  11661. bitmap res "gameSaves.files[rowNumber].portrait3"
  11662. bitmap area 0 0 30 48
  11663. align center center
  11664. }
  11665. button
  11666. {
  11667. enabled "gameSaves.files[rowNumber].hasPortrait4"
  11668. area 506 82 60 60
  11669. bitmap res "gameSaves.files[rowNumber].portrait4"
  11670. bitmap area 0 0 30 48
  11671. align center center
  11672. }
  11673. button
  11674. {
  11675. enabled "gameSaves.files[rowNumber].hasPortrait5"
  11676. area 565 82 60 60
  11677. bitmap res "gameSaves.files[rowNumber].portrait5"
  11678. bitmap area 0 0 30 48
  11679. align center center
  11680. }
  11681. }
  11682. column
  11683. {
  11684. width 25
  11685. label
  11686. {
  11687. area -684,0,928,-1
  11688. mosaic lua 'getSaveBackground(rowNumber)'
  11689. respectClipping
  11690. align center center
  11691. }
  11692. label
  11693. {
  11694. area 8 20 195 100
  11695. text lua "gameSaves.files[rowNumber].sName "
  11696. text style "label_loadname"
  11697. align center center
  11698. }
  11699. }
  11700.  
  11701. actionDbl
  11702. "
  11703. Infinity_PlaySound('GAM_09')
  11704. loadScreen:LoadGame(gameSaves.files[currentSave].fileName)
  11705. "
  11706.  
  11707. area 50 108 928 588
  11708. rowheight 145
  11709. hidehighlight
  11710. table "gameSaves.files"
  11711. var currentSave
  11712. scrollbar 'GUISCRC'
  11713. }
  11714.  
  11715. button
  11716. {
  11717. area 720 708 230 40
  11718. bam GUIBUTMT
  11719. clickable lua "currentSave"
  11720. text "LOAD_BUTTON"
  11721. text style "button"
  11722. action
  11723. "
  11724. loadScreen:LoadGame(gameSaves.files[currentSave].fileName)
  11725. "
  11726. }
  11727. button
  11728. {
  11729. enabled "gameSaves.isImporting ~= 1"
  11730. area 412 708 230 40
  11731. bam GUIBUTMT
  11732. clickable lua "currentSave"
  11733. text "DELETE_BUTTON"
  11734. text style "button"
  11735. action
  11736. "
  11737. popup2Button(15305, 'DELETE_BUTTON',
  11738. function() loadScreen:DeleteGame(gameSaves.files[currentSave].slotIndex) end)
  11739. "
  11740. }
  11741. button
  11742. {
  11743. area 104 708 230 40
  11744. bam GUIBUTMT
  11745. text "BACK_BUTTON"
  11746. text style "button"
  11747. on escape
  11748. action
  11749. "
  11750. loadScreen:OnMainCancelButtonClick()
  11751. "
  11752. }
  11753. }
  11754. `
  11755. function compareSaves(s1,s2)
  11756. --return true if s1 comes before s2
  11757. --show the most recent saves first
  11758. return s1.fileTime > s2.fileTime
  11759. end
  11760. function sortSaves()
  11761. table.sort(gameSaves.files,compareSaves)
  11762. end
  11763. `
  11764. menu
  11765. {
  11766. name 'SAVE'
  11767. align center center
  11768. ignoreEsc
  11769. label
  11770. {
  11771. area 0 0 1024 768
  11772. mosaic GUISMBM --GUISRSVB
  11773. action
  11774. "
  11775. currentSave = nil
  11776. "
  11777. }
  11778. label
  11779. {
  11780. area 162 16 700 44
  11781. text "SAVE_TITLE"
  11782. text style "title"
  11783. }
  11784.  
  11785. list
  11786. {
  11787. column
  11788. {
  11789. width 75
  11790. label
  11791. {
  11792. area 0,0,928,-1
  11793. mosaic lua 'getSaveBackground(rowNumber)'
  11794. respectClipping
  11795. align center center
  11796. }
  11797. button
  11798. {
  11799. enabled "gameSaves.files[rowNumber].hasScreenShot"
  11800. area 0 5 60 60
  11801. bitmap res "gameSaves.files[rowNumber].screenshot"
  11802. bitmap area 8 8 160 120
  11803. align center center
  11804. }
  11805.  
  11806. label
  11807. {
  11808. area 190 15 300 30
  11809. text lua "gameSaves.files[rowNumber].slotName"
  11810. text style "label"
  11811. align left top
  11812. }
  11813.  
  11814. label
  11815. {
  11816. area 190 45 300 30
  11817. text lua "gameSaves.files[rowNumber].chapter .. ' ' .. gameSaves.files[rowNumber].time"
  11818. text style "label"
  11819. align left top
  11820. pad 0 0 -200 0
  11821. }
  11822. button
  11823. {
  11824. enabled "gameSaves.files[rowNumber].hasPortrait0"
  11825. area 255 82 60 60
  11826. bitmap res "gameSaves.files[rowNumber].portrait0"
  11827. bitmap area 0 0 30 48
  11828. align center center
  11829. }
  11830. button
  11831. {
  11832. enabled "gameSaves.files[rowNumber].hasPortrait1"
  11833. area 317 82 60 60
  11834. bitmap res "gameSaves.files[rowNumber].portrait1"
  11835. bitmap area 0 0 30 48
  11836. align center center
  11837. }
  11838. button
  11839. {
  11840. enabled "gameSaves.files[rowNumber].hasPortrait2"
  11841. area 379 82 60 60
  11842. bitmap res "gameSaves.files[rowNumber].portrait2"
  11843. bitmap area 0 0 30 48
  11844. align center center
  11845. }
  11846. button
  11847. {
  11848. enabled "gameSaves.files[rowNumber].hasPortrait3"
  11849. area 441 82 60 60
  11850. bitmap res "gameSaves.files[rowNumber].portrait3"
  11851. bitmap area 0 0 30 48
  11852. align center center
  11853. }
  11854. button
  11855. {
  11856. enabled "gameSaves.files[rowNumber].hasPortrait4"
  11857. area 506 82 60 60
  11858. bitmap res "gameSaves.files[rowNumber].portrait4"
  11859. bitmap area 0 0 30 48
  11860. align center center
  11861. }
  11862. button
  11863. {
  11864. enabled "gameSaves.files[rowNumber].hasPortrait5"
  11865. area 565 82 60 60
  11866. bitmap res "gameSaves.files[rowNumber].portrait5"
  11867. bitmap area 0 0 30 48
  11868. align center center
  11869. }
  11870. }
  11871. column
  11872. {
  11873. width 25
  11874. label
  11875. {
  11876. area -684,0,928,-1
  11877. mosaic lua 'getSaveBackground(rowNumber)'
  11878. respectClipping
  11879. align center center
  11880. }
  11881. label
  11882. {
  11883. area 8 0 195 100
  11884. text lua "gameSaves.files[rowNumber].sName "
  11885. text style "label"
  11886. align center center
  11887. }
  11888. label
  11889. {
  11890. area 8 70 200 40
  11891. bam GUIBUTNT
  11892. frame lua "currentCellCheck(2)"
  11893. sequence 0
  11894. text "SAVE_BUTTON"
  11895. text style "button"
  11896. }
  11897. }
  11898.  
  11899. action
  11900. "
  11901. if cellNumber == 1 then
  11902. cellNumber = nil
  11903. elseif cellNumber == 2 then
  11904. cellNumber = nil
  11905. Infinity_PlaySound('GAM_09')
  11906. Infinity_PushMenu( 'SAVE_NEWSAVE' );
  11907. end
  11908. "
  11909.  
  11910. actionDbl
  11911. "
  11912. Infinity_PlaySound('GAM_09')
  11913. Infinity_PushMenu( 'SAVE_NEWSAVE' );
  11914. "
  11915.  
  11916. area 48 252 928 444
  11917. rowheight 145
  11918. table "gameSaves.files"
  11919. hidehighlight
  11920. var currentSave
  11921. scrollbar 'GUISCRC'
  11922. }
  11923. button
  11924. {
  11925. area 48 108 928 148
  11926. mosaic GUISAVEB
  11927. }
  11928. label
  11929. {
  11930. area 248 120 300 30
  11931. text 'NEW_SAVE_LABEL'
  11932. text style "label"
  11933. text align left center
  11934. }
  11935. button
  11936. {
  11937. area 740 148 200 40
  11938. bam GUIBUTNT
  11939. text "SAVE_BUTTON"
  11940. text style "button"
  11941. action
  11942. "
  11943. --saveScreen:SaveGame(#saveFiles, 'Test Save ' .. #saveFiles)
  11944. currentSave = 0
  11945. Infinity_PushMenu( 'SAVE_NEWSAVE' );
  11946. "
  11947. }
  11948.  
  11949. button
  11950. {
  11951. area 104 708 230 40
  11952. bam GUIBUTMT
  11953. clickable lua "currentSave"
  11954. text "DELETE_BUTTON"
  11955. text style "button"
  11956. action
  11957. "
  11958. popup2Button(15305, 'DELETE_BUTTON',
  11959. function() saveScreen:DeleteGame(gameSaves.files[currentSave].slotIndex) end)
  11960. "
  11961. }
  11962. button
  11963. {
  11964. on escape
  11965. area 720 708 230 40
  11966. bam GUIBUTMT
  11967. text "BACK_BUTTON"
  11968. text style "button"
  11969. action
  11970. "
  11971. saveScreen:OnMainCancelButtonClick()
  11972. "
  11973. }
  11974. }
  11975. `
  11976. newSaveName = ''
  11977. function completeSave()
  11978. Infinity_Log('not overwrite')
  11979. Infinity_PopMenu('SAVE_NEWSAVE')
  11980. saveScreen:SaveGame(#gameSaves.files, newSaveName)
  11981. end
  11982. function completeOverwrite()
  11983. Infinity_Log('overwrite')
  11984. Infinity_PopMenu('SAVE_NEWSAVE')
  11985. saveScreen:SaveGame(gameSaves.files[currentSave].slotIndex,newSaveName)
  11986. end
  11987.  
  11988. `
  11989. menu
  11990. {
  11991. name 'SAVE_NEWSAVE'
  11992. align center center
  11993. modal
  11994. onOpen
  11995. "
  11996. bitmapbools =
  11997. {
  11998. hasScreenShot = 0,
  11999. hasPortrait0 = 0,
  12000. hasPortrait1 = 0,
  12001. hasPortrait2 = 0,
  12002. hasPortrait3 = 0,
  12003. hasPortrait4 = 0,
  12004. hasPortrait5 = 0,
  12005. }
  12006. newSaveName = ''
  12007. if currentSave ~= 0 then
  12008. newSaveName = gameSaves.files[currentSave].slotName
  12009. bitmapbools =
  12010. {
  12011. hasScreenShot = gameSaves.files[currentSave].hasScreenShot,
  12012. hasPortrait0 = gameSaves.files[currentSave].hasPortrait0,
  12013. hasPortrait1 = gameSaves.files[currentSave].hasPortrait1,
  12014. hasPortrait2 = gameSaves.files[currentSave].hasPortrait2,
  12015. hasPortrait3 = gameSaves.files[currentSave].hasPortrait3,
  12016. hasPortrait4 = gameSaves.files[currentSave].hasPortrait4,
  12017. hasPortrait5 = gameSaves.files[currentSave].hasPortrait5,
  12018. }
  12019. end
  12020. Infinity_FocusTextEdit('newSaveNameArea')
  12021. "
  12022. label
  12023. {
  12024. area 0 0 786 341
  12025. mosaic GUISRRQB
  12026. }
  12027. label
  12028. {
  12029. area 42 20 300 30
  12030. text "ENTER_SAVE_LABEL"
  12031. text style "label"
  12032. text align left center
  12033. }
  12034. edit
  12035. {
  12036. name "newSaveNameArea"
  12037. area 246 66 466 32
  12038. var newSaveName
  12039. text style "edit"
  12040. maxlines 1
  12041. fill 112 111 111 64
  12042. action
  12043. "
  12044. --On return pressed
  12045. if (key_pressed == 13) then
  12046. if(currentSave ~= 0) then
  12047. completeOverwrite()
  12048. else
  12049. completeSave()
  12050. end
  12051. Infinity_FocusTextEdit('')
  12052. return -1
  12053. end
  12054. return 1
  12055. "
  12056. }
  12057. label
  12058. {
  12059. area 252 110 424 34
  12060. text lua "gameSaves.currentGameInfo.chapter .. ' ' .. gameSaves.currentGameInfo.time"
  12061. text style "label"
  12062. text align left center
  12063. }
  12064. button
  12065. {
  12066. enabled "bitmapbools.hasScreenShot"
  12067. area 64 70 160 138
  12068. bitmap res "gameSaves.files[currentSave].screenshot"
  12069. align center center
  12070. }
  12071. button
  12072. {
  12073. enabled "bitmapbools.hasPortrait0"
  12074. area 338 164 30 48
  12075. bitmap res "gameSaves.files[currentSave].portrait0"
  12076. align center center
  12077. }
  12078. button
  12079. {
  12080. enabled "bitmapbools.hasPortrait1"
  12081. area 402 164 30 48
  12082. bitmap res "gameSaves.files[currentSave].portrait1"
  12083. align center center
  12084. }
  12085. button
  12086. {
  12087. enabled "bitmapbools.hasPortrait2"
  12088. area 462 164 30 48
  12089. bitmap res "gameSaves.files[currentSave].portrait2"
  12090. align center center
  12091. }
  12092. button
  12093. {
  12094. enabled "bitmapbools.hasPortrait3"
  12095. area 524 164 30 48
  12096. bitmap res "gameSaves.files[currentSave].portrait3"
  12097. align center center
  12098. }
  12099. button
  12100. {
  12101. enabled "bitmapbools.hasPortrait4"
  12102. area 592 164 30 48
  12103. bitmap res "gameSaves.files[currentSave].portrait4"
  12104. align center center
  12105. }
  12106. button
  12107. {
  12108. enabled "bitmapbools.hasPortrait5"
  12109. area 654 164 30 48
  12110. bitmap res "gameSaves.files[currentSave].portrait5"
  12111. align center center
  12112. }
  12113. button
  12114. {
  12115. area 528 254 200 40
  12116. bam GUIBUTNT
  12117. text "SAVE_BUTTON"
  12118. text style "button"
  12119. action
  12120. "
  12121. completeSave()
  12122. "
  12123. }
  12124. button
  12125. {
  12126. enabled currentSave
  12127. area 528 254 200 40
  12128. bam GUIBUTNT
  12129. text "OVERWRITE_BUTTON"
  12130. text style "button"
  12131. action
  12132. "
  12133. completeOverwrite()
  12134. "
  12135. }
  12136. button
  12137. {
  12138. on escape
  12139. area 228 254 200 40
  12140. bam GUIBUTNT
  12141. text "CANCEL_BUTTON"
  12142. text style "button"
  12143. action
  12144. "
  12145. Infinity_PopMenu('SAVE_NEWSAVE')
  12146. "
  12147. }
  12148. }
  12149. `
  12150. worldMessageBoxText = ""
  12151. worldMessageBoxLines = 0
  12152. worldMessageBoxClickedOnce = 0
  12153. function dragMessagesY(newY)
  12154. setMessagesY(newY)
  12155. worldMessageBoxClickedOnce = 1
  12156. end
  12157. function clampMessageBoxHeight(hNew, hOld)
  12158. if(hNew <= 64) then
  12159. --lower bound on height, sliced rects can't get too small and we don't want to make the message box invisible.
  12160. return hOld - 64
  12161. end
  12162. if(hNew >= 500) then
  12163. --also don't go too high because it looks bad.
  12164. return hOld - 500
  12165. end
  12166. return hOld - hNew
  12167. end
  12168. function setMessagesY(newY)
  12169. local x,y,w,hOld = Infinity_GetArea('messagesRect')
  12170. h = hOld - newY
  12171. newY = clampMessageBoxHeight(h,hOld)
  12172.  
  12173. adjustItemGroup({"messagesHandleY"},0,newY,0,0)
  12174. adjustItemGroup({"messagesRect","worldMessageBox"},0,newY,0,-newY)
  12175.  
  12176. toolbarTop = toolbarTop - newY
  12177. Infinity_SetOffset('WORLD_QUICKLOOT',0, -toolbarTop)
  12178.  
  12179. chatboxScrollToBottom = 1
  12180. worldMessageBoxTop = y + newY
  12181. end
  12182.  
  12183. `
  12184. menu
  12185. {
  12186. name 'WORLD_MESSAGES'
  12187. align center bottom
  12188. ignoreEsc
  12189. onOpen
  12190. "
  12191. Infinity_SetOffset('WORLD_MESSAGES', 0, -toolbarTop)
  12192. local x,y,w,h = Infinity_GetArea('messagesRect')
  12193. toolbarTop = toolbarTop + h
  12194. setMessagesY(worldMessageBoxTop - y)
  12195. "
  12196. onClose
  12197. "
  12198. local x,y,w,h = Infinity_GetArea('messagesRect')
  12199. toolbarTop = toolbarTop - h
  12200. "
  12201. label
  12202. {
  12203. name 'messagesRect'
  12204. area 0 42 863 211
  12205. rectangle 4
  12206. }
  12207. button
  12208. {
  12209. area 28 152 1 1
  12210. on pageup
  12211. action
  12212. "
  12213. dragMessagesY(-20)
  12214. "
  12215. }
  12216. button
  12217. {
  12218. area 28 152 1 1
  12219. on pagedown
  12220. action
  12221. "
  12222. dragMessagesY(20)
  12223. "
  12224. }
  12225. list
  12226. {
  12227. column
  12228. {
  12229. width 100
  12230. label
  12231. {
  12232. area 0 0 810 -1
  12233. text lua "getNPCDialogEntryText(combatLog[rowNumber])"
  12234. text style "gamelog"
  12235. }
  12236. }
  12237. name "worldMessageBox"
  12238. area 28 66 816 171
  12239. rowheight dynamic
  12240. table "combatLog"
  12241. hideHighlight
  12242. scrollbar 'GUISCRC'
  12243. scrollbar func "chatboxScroll"
  12244. scrollbar skipReset
  12245. }
  12246. handle
  12247. {
  12248. name 'messagesHandleY'
  12249. area 0 42 863 22
  12250. pulse lua "worldMessageBoxClickedOnce == 0"
  12251. actionDrag
  12252. "
  12253. dragMessagesY(motionY)
  12254. "
  12255. }
  12256. }
  12257. `
  12258. worldNPCDialogText = ""
  12259. worldPlayerDialogChoices = {}
  12260. glowTest = nil
  12261. startingDialogHeight = 0
  12262.  
  12263. function dialogEntryGreyed()
  12264. return not worldScreen:GetInControlOfDialog()
  12265. end
  12266.  
  12267. function getDesiredDialogHeight()
  12268. --get npc area
  12269. local npcX,npcY,npcW,npcH = Infinity_GetArea('worldNPCDialog')
  12270.  
  12271. --get dialog choices height
  12272. local choicesHeight = Infinity_GetListHeight('worldPlayerDialogChoicesList')
  12273.  
  12274. return (20 + choicesHeight + npcH + 20)
  12275. end
  12276.  
  12277. function getCurrentDialogHeight()
  12278. local x,y,w,contentHeight = Infinity_GetArea('worldDialogBackground')
  12279. local npcX,npcY,npcW,npcH = Infinity_GetArea('worldNPCDialog')
  12280.  
  12281. if(showWorldMessages == 1) then
  12282. --Don't include the height of the message log (and its offset) if its active
  12283. local xM,yM,wM,hM = Infinity_GetArea('worldDialogMessageBox')
  12284. local xD,yD,wD,hD = Infinity_GetArea('worldDialogMessageDivider')
  12285. Infinity_Log("yD - y = " .. yD - y)
  12286. contentHeight = contentHeight - (yD - y)
  12287. end
  12288.  
  12289. return contentHeight
  12290. end
  12291.  
  12292. function resizeDialog()
  12293. buildResponsesList()
  12294.  
  12295. --fit the npc text area to the text height.
  12296. Infinity_ScaleToText("worldNPCDialog")
  12297.  
  12298. --get npc area
  12299. local npcX,npcY,npcW,npcH = Infinity_GetArea('worldNPCDialog')
  12300.  
  12301. if(npcH > 250) then
  12302. --limit the npc text height to 250
  12303. npcH = 250
  12304. Infinity_SetArea('worldNPCDialog',nil,nil,nil,npcH)
  12305. end
  12306.  
  12307. --Get available height to work in
  12308. local contentHeight = getCurrentDialogHeight()
  12309.  
  12310. local desiredHeight = getDesiredDialogHeight()
  12311.  
  12312. --make enough room for the choices and dialog
  12313. if(contentHeight < desiredHeight) then
  12314. resizeDialogContent(contentHeight - desiredHeight)
  12315. else
  12316. local xD,yD,wD,hD = Infinity_GetArea('worldDialogMessageDivider')
  12317.  
  12318. --resize the choices list based on the dialog height
  12319. cH = contentHeight - npcH - (npcY - yD) - 32
  12320. cY = npcY + npcH + 16
  12321.  
  12322. if cH > 50 then
  12323. --set the new list area.
  12324. Infinity_SetArea('worldPlayerDialogChoicesList',nil,cY,nil,cH)
  12325. else
  12326. local heightDifference = 50 - cH
  12327. cY = cY - heightDifference
  12328. cH = cH + heightDifference
  12329. Infinity_SetArea('worldPlayerDialogChoicesList',nil,cY,nil,cH)
  12330.  
  12331. npcH = npcH - heightDifference
  12332. Infinity_SetArea('worldNPCDialog',nil,nil,nil,npcH)
  12333. end
  12334. end
  12335.  
  12336. end
  12337. function resizeDialogContent(newY)
  12338. local x,y,w,hOld = Infinity_GetArea('worldDialogBackground')
  12339. local h = hOld - newY
  12340.  
  12341. local contentHeight = getCurrentDialogHeight() - newY
  12342.  
  12343. if(contentHeight <= 150) then
  12344. --lower bound on height, should leave plenty of room for portrait.
  12345. -- also don't push our toolbar top out of view.
  12346. return
  12347. end
  12348. if(contentHeight >= 500) then
  12349. -- upper bound as well because too high looks bad.
  12350. return
  12351. end
  12352.  
  12353. y = y + newY
  12354. Infinity_SetArea('worldDialogBackground',x,y,w,h)
  12355.  
  12356. adjustItemGroup({'dialogHandleY', 'worldNPCDialog', 'worldDialogShowMessagesButton', 'worldDialogPortraitArea','worldDialogMessageBox','worldDialogMessageDivider'},0,newY,0,0)
  12357.  
  12358. toolbarTop = toolbarTop - newY
  12359.  
  12360. resizeDialog()
  12361. end
  12362. function dragDialogMessagesY(newY)
  12363. local x,y,w,hOld = Infinity_GetArea('worldDialogMessageBox')
  12364. local h = hOld - newY
  12365. newY = clampMessageBoxHeight(h,hOld)
  12366.  
  12367. --different behavior if the message log is visible.
  12368. adjustItemGroup({'dialogHandleY','worldDialogShowMessagesButton'},0,newY,0,0)
  12369. adjustItemGroup({'worldDialogBackground','worldDialogMessageBox'},0,newY,0,-newY)
  12370. toolbarTop = toolbarTop - newY
  12371. return
  12372. end
  12373. function showMessagesButtonFrame()
  12374. if(showWorldMessages == 1) then return 1 else return 0 end
  12375. end
  12376. function toggleDialogShowMessages()
  12377. if(showWorldMessages == 1) then showWorldMessages = 0 else showWorldMessages = 1 end
  12378.  
  12379. local xM,yM,wM,hM = Infinity_GetArea('worldDialogMessageBox')
  12380. local xD,yD,wD,hD = Infinity_GetArea('worldDialogMessageDivider')
  12381. local xB,yB,wB,hB = Infinity_GetArea('worldDialogBackground')
  12382.  
  12383. local bgAdjust
  12384. if(showWorldMessages == 1) then
  12385. Infinity_SetArea('worldDialogMessageBox',nil,yB - hM - hD + 8,nil,nil)
  12386. Infinity_SetArea('worldDialogMessageDivider',nil,yB,nil,nil)
  12387.  
  12388. bgAdjust = hM + 16 + hD
  12389. else
  12390. bgAdjust = -hM - 16 - hD
  12391. end
  12392.  
  12393. adjustItemGroup({'worldDialogBackground'},0,-bgAdjust,0,bgAdjust)
  12394. adjustItemGroup({'dialogHandleY','worldDialogShowMessagesButton'}, 0, -bgAdjust, 0, 0)
  12395. toolbarTop = toolbarTop - bgAdjust
  12396. end
  12397. function getNPCDialogEntryText(t)
  12398. local text = string.gsub(t, "%^0xff......", "^0xFF719571")
  12399. return text
  12400. end
  12401. function getDialogEntryText(row)
  12402. local text = worldPlayerDialogChoices[row].text
  12403. if (row == worldPlayerDialogSelection) then
  12404. --Color the text white when selected
  12405. text = string.gsub(text, "%^0xff212eff", "^0xFFC1C6FF")
  12406. else
  12407. text = string.gsub(text, "%^0xff212eff", "^0xFF7276B7")
  12408. end
  12409. return text
  12410. end
  12411. `
  12412. menu
  12413. {
  12414. name 'WORLD_DIALOG'
  12415. offset 0 -57
  12416. align center bottom
  12417. ignoreEsc
  12418. onOpen
  12419. "
  12420. local x,y,w,h = Infinity_GetArea('worldDialogBackground')
  12421. toolbarTop = toolbarTop + h
  12422. Infinity_PushMenu('WORLD_DIALOG_CONFIRM')
  12423. if(isTouchActionbar() and not dialogViewMode) then
  12424. Infinity_PushMenu('WORLD_DIALOG_LEFT')
  12425. Infinity_PushMenu('WORLD_DIALOG_RIGHT')
  12426. end
  12427.  
  12428. greySidebars()
  12429. "
  12430. onClose
  12431. "
  12432.  
  12433. local x,y,w,h = Infinity_GetArea('worldDialogBackground')
  12434. toolbarTop = toolbarTop - h
  12435. resizeDialogContent(h - 253)
  12436. Infinity_PopMenu('WORLD_DIALOG_CONFIRM')
  12437.  
  12438. Infinity_PopMenu('WORLD_DIALOG_LEFT')
  12439. Infinity_PopMenu('WORLD_DIALOG_RIGHT')
  12440. ungreySidebars()
  12441. "
  12442. label
  12443. {
  12444. name "worldDialogBackground"
  12445. area 0 -47 863 300
  12446. rectangle 4
  12447. }
  12448. button
  12449. {
  12450. enabled "showWorldMessages"
  12451. area 28 152 816 85
  12452. on pageup
  12453. action
  12454. "
  12455. local x,y,w,h = Infinity_GetArea('worldDialogBackground')
  12456. dragDialogMessagesY(-20)
  12457. "
  12458. }
  12459. button
  12460. {
  12461. enabled "showWorldMessages"
  12462. area 28 152 816 85
  12463. on pagedown
  12464. action
  12465. "
  12466. local x,y,w,h = Infinity_GetArea('worldDialogBackground')
  12467. dragDialogMessagesY(20)
  12468. "
  12469. }
  12470. label
  12471. {
  12472. name "worldDialogPortraitArea"
  12473. area 22 -25 54 84
  12474. bitmap lua "worldNPCDialogPortrait"
  12475. }
  12476. text
  12477. {
  12478. name "worldNPCDialog"
  12479. area 86 -25 758 111
  12480. text lua "getNPCDialogEntryText(worldNPCDialogText)"
  12481. text style "gamelog"
  12482. scrollbar 'GUISCRC'
  12483. }
  12484.  
  12485. text
  12486. {
  12487. name "worldDialogMessageBox"
  12488. enabled "showWorldMessages"
  12489. area 20 -175 824 124
  12490. text lua "getNPCDialogEntryText(worldMessageBoxText)"
  12491. text style "gamelog"
  12492. scrollbar 'GUISCRC'
  12493. scrollbar func "chatboxScroll"
  12494. }
  12495. handle
  12496. {
  12497. enabled "showWorldMessages"
  12498. name "dialogHandleY"
  12499. area 0 -47 863 32
  12500. actionDrag
  12501. "
  12502. dragDialogMessagesY(motionY)
  12503. "
  12504. }
  12505. text
  12506. {
  12507. name "worldDialogShowMessagesButton"
  12508. area 764 -39 62 31
  12509. tooltip lua "t('LOG_HISTORY_TOOLTIP')"
  12510. bam "CHATHIST"
  12511. frame lua "showMessagesButtonFrame()"
  12512. action
  12513. "
  12514. toggleDialogShowMessages()
  12515. "
  12516. }
  12517. text
  12518. {
  12519. name "worldDialogMessageDivider"
  12520. enabled "showWorldMessages"
  12521. area 33 -47 800 8
  12522. mosaic "DLGDIVI"
  12523. }
  12524. list
  12525. {
  12526. column
  12527. {
  12528. width 100
  12529. label
  12530. {
  12531. area 0 0 -1 -1
  12532. enabled "dialogEntryGreyed()"
  12533. rectangle 1
  12534. rectangle opacity 100
  12535. }
  12536. text
  12537. {
  12538. area 0 0 -1 -1
  12539. text lua "getDialogEntryText(rowNumber)"
  12540. text style "gamelog"
  12541. }
  12542. }
  12543. name "worldPlayerDialogChoicesList"
  12544. area 86 86 758 151
  12545. rowheight dynamic
  12546. hideHighlight
  12547. table "worldPlayerDialogChoices"
  12548. var "worldPlayerDialogSelection"
  12549. scrollbar 'GUISCRC'
  12550. actionEnter
  12551. "
  12552. if(gameOptions.m_bConfirmDialog == true) then return end
  12553. glowTest = mouseoverRow
  12554. worldPlayerDialogSelection = mouseoverRow
  12555. "
  12556. actionExit
  12557. "
  12558. if(gameOptions.m_bConfirmDialog == true) then return end
  12559. glowTest = nil
  12560. worldPlayerDialogSelection = 0
  12561. "
  12562. action
  12563. "
  12564. --In confirm mode, just highlight the choice.
  12565. if(gameOptions.m_bConfirmDialog == true) then return end
  12566. worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
  12567. worldPlayerDialogSelection = 0
  12568. "
  12569. }
  12570. }
  12571. `
  12572. function getDialogButtonEnabled()
  12573. if(gameOptions.m_bConfirmDialog == true) then
  12574. return true
  12575. else
  12576. return (#worldPlayerDialogChoices == 0)
  12577. end
  12578. end
  12579.  
  12580. function getDialogButtonClickable()
  12581. local ret = worldScreen:GetInControlOfDialog()
  12582. if(gameOptions.m_bConfirmDialog == true) then
  12583. return ret and ((#worldPlayerDialogChoices == 0) or (worldPlayerDialogSelection and worldPlayerDialogSelection > 0)) --no choices, or we've selected a choice.
  12584. else
  12585. return ret
  12586. end
  12587. end
  12588. `
  12589. menu
  12590. {
  12591. name 'WORLD_DIALOG_CONFIRM'
  12592. align center bottom
  12593. ignoreEsc
  12594. button
  12595. {
  12596. area 0 0 300 40
  12597. bam GUIBUTWT
  12598. text lua "dialogButtonText"
  12599. enabled "getDialogButtonEnabled()"
  12600. clickable lua "getDialogButtonClickable()"
  12601. text style "button"
  12602. action
  12603. "
  12604. if(gameOptions.m_bConfirmDialog == true and (#worldPlayerDialogChoices > 0)) then
  12605. -- if confirm dialog and choices available.
  12606. worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection].marker)
  12607. worldPlayerDialogSelection = 0
  12608. else
  12609. -- no choices, just step.
  12610. worldScreen:StepDialog()
  12611. end
  12612. "
  12613. }
  12614. }
  12615.  
  12616. menu
  12617. {
  12618. name 'CHARACTER_SELECT'
  12619. align center center
  12620. onopen "selectedCharacter = 0"
  12621. ignoreesc
  12622. label
  12623. {
  12624. mosaic GUICGPR
  12625. area 0 0 1024 768
  12626. }
  12627. label
  12628. {
  12629. area 170 16 690 44
  12630. text "CHARGEN_TITLE"
  12631. text style "title"
  12632. }
  12633. label
  12634. {
  12635. area 26 64 978 622
  12636. rectangle 3
  12637. }
  12638. list
  12639. {
  12640. column
  12641. {
  12642. width 8
  12643. label
  12644. {
  12645. area 0 0 0 100 --hack to pad the portrait on the bottom by forcing a min rowheight
  12646. }
  12647. label
  12648. {
  12649. area 10 8 54 84
  12650. bitmap lua "character_select[rowNumber].portrait"
  12651. }
  12652. }
  12653. column
  12654. {
  12655. width 92
  12656. label
  12657. {
  12658. area 20 4 -1 -1
  12659. text lua "character_select[rowNumber].name .. '\n' .. character_select[rowNumber].desc"
  12660. text style "label"
  12661. text align left top
  12662. }
  12663. }
  12664.  
  12665. area 50 84 932 586
  12666. rowheight dynamic
  12667. table "character_select"
  12668. var selectedCharacter
  12669. scrollbar GUISCRC
  12670. }
  12671. button
  12672. {
  12673. area 520 686 237 66
  12674. text "DONE_BUTTON"
  12675. text style "button"
  12676. bam GUIBUTST
  12677. clickable lua "selectedCharacter ~= 0"
  12678. action
  12679. "
  12680. Infinity_OnCharacterImportItemSelect(selectedCharacter - 1)
  12681. createCharScreen:OnDoneButtonClick()
  12682. Infinity_PopMenu('CHARACTER_SELECT')
  12683. "
  12684. }
  12685. button
  12686. {
  12687. on escape
  12688. bam GUIBUTST
  12689. area 268 686 237 66
  12690. text "BACK_BUTTON"
  12691. text style "button"
  12692. action
  12693. "
  12694. createCharScreen:OnCancelButtonClick()
  12695. Infinity_PopMenu('CHARACTER_SELECT')
  12696. "
  12697. }
  12698.  
  12699. }
  12700.  
  12701. `
  12702. chargen = {
  12703.  
  12704. races = {},
  12705. kits = {},
  12706.  
  12707. }
  12708. function chargenAcceptOrExport()
  12709. if createCharScreen:GetEngineState() == 4 then
  12710. return t("EXPORT_BUTTON")
  12711. else
  12712. return t("ACCEPT_BUTTON")
  12713.  
  12714. end
  12715. end
  12716.  
  12717.  
  12718. `
  12719. menu
  12720. {
  12721. name 'CHARGEN'
  12722. align center center
  12723. ignoreesc
  12724. label
  12725. {
  12726. area 0 0 1024 768
  12727. mosaic 'GUICGB'
  12728. }
  12729. label
  12730. {
  12731. area 170 16 690 44
  12732. text "CHARGEN_TITLE"
  12733. text style "title"
  12734. }
  12735. text
  12736. {
  12737. area 425 177 297 422
  12738. text lua "chargen.information"
  12739. scrollbar 'GUISCRC'
  12740. text style "normal"
  12741. }
  12742. label
  12743. {
  12744. area 775 171 210 330
  12745. bitmap lua "chargen.portrait"
  12746. }
  12747.  
  12748. button
  12749. {
  12750. area 36 176 340 30
  12751. bam GUIBUTWS
  12752. sequence 0
  12753. clickable lua "createCharScreen:GetCurrentStep() == 0"
  12754. glow lua "createCharScreen:GetCurrentStep() == 0"
  12755. text "GENDER_BUTTON"
  12756. text style "button"
  12757. pad 8 2 8 2
  12758. action "createCharScreen:OnMenuButtonClick()"
  12759. }
  12760. button
  12761. {
  12762. area 36 206 340 30
  12763. bam GUIBUTWS
  12764. sequence 1
  12765. clickable lua "createCharScreen:GetCurrentStep() == 3"
  12766. glow lua "createCharScreen:GetCurrentStep() == 3"
  12767. text "RACE_BUTTON"
  12768. text style "button"
  12769. pad 8 2 8 2
  12770. action "createCharScreen:OnMenuButtonClick()"
  12771. }
  12772. button
  12773. {
  12774. area 36 236 340 30
  12775. bam GUIBUTWS
  12776. sequence 2
  12777. clickable lua "createCharScreen:GetCurrentStep() == 4"
  12778. glow lua "createCharScreen:GetCurrentStep() == 4"
  12779. text "CLASS_BUTTON"
  12780. text style "button"
  12781. pad 8 2 8 2
  12782. action "createCharScreen:OnMenuButtonClick()"
  12783. }
  12784. button
  12785. {
  12786. area 36 266 340 30
  12787. bam GUIBUTWS
  12788. sequence 1
  12789. clickable lua "createCharScreen:GetCurrentStep() == 7"
  12790. glow lua "createCharScreen:GetCurrentStep() == 7"
  12791. text "ALIGNMENT_BUTTON"
  12792. text style "button"
  12793. pad 8 2 8 2
  12794. action "createCharScreen:OnMenuButtonClick()"
  12795. }
  12796.  
  12797. button
  12798. {
  12799. area 36 296 340 30
  12800. bam GUIBUTWS
  12801. sequence 0
  12802. clickable lua "createCharScreen:GetCurrentStep() == 8"
  12803. glow lua "createCharScreen:GetCurrentStep() == 8"
  12804. text "ABILITIES_BUTTON"
  12805. text style "button"
  12806. pad 8 2 8 2
  12807. action "createCharScreen:OnMenuButtonClick()"
  12808. }
  12809. button
  12810. {
  12811. area 36 326 340 30
  12812. bam GUIBUTWS
  12813. sequence 1
  12814. clickable lua "createCharScreen:GetCurrentStep() == 9"
  12815. glow lua "createCharScreen:GetCurrentStep() == 9"
  12816. text "SKILLS_BUTTON"
  12817. text style "button"
  12818. pad 8 2 8 2
  12819. action "createCharScreen:OnMenuButtonClick()"
  12820. }
  12821. button
  12822. {
  12823. area 36 356 340 30
  12824. bam GUIBUTWS
  12825. sequence 2
  12826. clickable lua "createCharScreen:GetCurrentStep() == 15"
  12827. glow lua "createCharScreen:GetCurrentStep() == 15"
  12828. text "APPEARANCE_BUTTON"
  12829. text style "button"
  12830. pad 8 2 8 2
  12831. action "createCharScreen:OnMenuButtonClick()"
  12832. }
  12833. button
  12834. {
  12835. area 36 386 340 30
  12836. bam GUIBUTWS
  12837. sequence 1
  12838. clickable lua "createCharScreen:GetCurrentStep() == 17"
  12839. glow lua "createCharScreen:GetCurrentStep() == 17"
  12840. text "NAME_BUTTON"
  12841. text style "button"
  12842. pad 8 2 8 2
  12843. action "createCharScreen:OnMenuButtonClick()"
  12844. }
  12845.  
  12846. button
  12847. {
  12848. area 781 520 200 40
  12849. text "IMPORT_BUTTON"
  12850. text style "button"
  12851. bam GUIBUTNT
  12852. action "createCharScreen:OnImportCharacterButtonClick()"
  12853. }
  12854. button
  12855. {
  12856. area 781 570 200 40
  12857. text "BIOGRAPHY_BUTTON"
  12858. text style "button"
  12859. bam GUIBUTNT
  12860. clickable lua "createCharScreen:GetCurrentStep() >= 17"
  12861. action "createCharScreen:OnBiographyButtonClick()"
  12862. }
  12863. button
  12864. {
  12865. on escape
  12866. area 155 688 230 40
  12867. text "BACK_BUTTON"
  12868. text style "button"
  12869. bam GUIBUTMT
  12870. clickable lua "createCharScreen:IsMainBackButtonClickable()"
  12871. action "createCharScreen:OnMainBackButtonClick()"
  12872. }
  12873. button
  12874. {
  12875. on escape
  12876. area 155 688 232 40
  12877. text "CANCEL_BUTTON"
  12878. text style "button"
  12879. bam GUIBUTMT
  12880. enabled "not createCharScreen:IsMainBackButtonClickable()"
  12881. action "createCharScreen:OnMainCancelButtonClick()"
  12882. }
  12883. button
  12884. {
  12885. area 397 688 230 40
  12886. text lua "chargenAcceptOrExport()"
  12887. text style "button"
  12888. bam GUIBUTMT
  12889. clickable lua "createCharScreen:IsChargenComplete()"
  12890. action "createCharScreen:AcceptCharacter(-1)"
  12891. }
  12892. button
  12893. {
  12894. area 639 688 230 40
  12895. text "CREATE_PARTY_BUTTON"
  12896. text style "button"
  12897. bam GUIBUTMT
  12898. clickable lua "createCharScreen:IsAdvancedButtonClickable() == true"
  12899. action "createCharScreen:OnAdvancedButtonClick()"
  12900. }
  12901. }
  12902.  
  12903. `
  12904. createCharGenderHelp = 24313
  12905. `
  12906. menu
  12907. {
  12908. name 'CHARGEN_GENDER'
  12909. modal
  12910. align center center
  12911. ignoreesc
  12912. onOpen "toggleMale = 0; toggleFemale = 0"
  12913.  
  12914. label
  12915. {
  12916. area 0 0 539 668
  12917. mosaic 'GUICGGEN'
  12918. }
  12919. label
  12920. {
  12921. area 20 16 500 44
  12922. text "GENDER_TITLE"
  12923. text style "title"
  12924. }
  12925. label
  12926. {
  12927. area 30 388 460 170
  12928. text lua "Infinity_FetchString(createCharGenderHelp)"
  12929. text style "normal"
  12930. }
  12931. button
  12932. {
  12933. area 76 136 188 166
  12934. bam GUIGEND1
  12935. sequence 0
  12936. toggle toggleMale
  12937. action "toggleFemale = 0; createCharScreen:OnGenderSelectButtonClick(1)"
  12938. }
  12939. button
  12940. {
  12941. area 276 136 188 166
  12942. bam GUIGEND1
  12943. sequence 1
  12944. toggle toggleFemale
  12945. action "toggleMale = 0; createCharScreen:OnGenderSelectButtonClick(2)"
  12946. }
  12947.  
  12948. button
  12949. {
  12950. on escape
  12951. area 36 610 230 40
  12952. bam GUIBUTMT
  12953. text "BACK_BUTTON"
  12954. text style "button"
  12955. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  12956. }
  12957. button
  12958. {
  12959. on return
  12960. area 278 610 230 40
  12961. bam GUIBUTMT
  12962. text "DONE_BUTTON"
  12963. text style "button"
  12964. clickable lua "createCharScreen:IsDoneButtonClickable()"
  12965. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  12966. }
  12967. }
  12968.  
  12969. menu
  12970. {
  12971. name 'CHARGEN_PORTRAIT'
  12972. modal
  12973. align center center
  12974. ignoreesc
  12975. label
  12976. {
  12977. area 0 0 539 668
  12978. mosaic 'GUICGAPP'
  12979. }
  12980. label
  12981. {
  12982. area 20 16 500 44
  12983. text "APPEARANCE_TITLE"
  12984. text style "title"
  12985. }
  12986. button
  12987. {
  12988. area 108 217 52 132
  12989. bam GUIPRC
  12990. sequence 0
  12991. action "createCharScreen:DecCurrentPortrait()"
  12992. }
  12993. button
  12994. {
  12995. area 390 217 52 132
  12996. bam GUIPRC
  12997. sequence 1
  12998. action "createCharScreen:IncCurrentPortrait()"
  12999. }
  13000.  
  13001. label
  13002. {
  13003. area 170 150 212 330
  13004. bitmap lua "createCharScreen:GetCurrentPortrait()"
  13005. }
  13006.  
  13007. button
  13008. {
  13009. area 122 490 300 40
  13010. bam GUIBUTWT
  13011. text "CUSTOM_BUTTON"
  13012. text style "button"
  13013. enabled "not e:IsTouchUI()"
  13014. action "
  13015. TEXT_popup_big = 17188
  13016. Infinity_PushMenu('POPUP_BIG')
  13017. "
  13018. }
  13019.  
  13020. button
  13021. {
  13022. on escape
  13023. area 36 610 230 40
  13024. bam GUIBUTMT
  13025. text "BACK_BUTTON"
  13026. text style "button"
  13027. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  13028. }
  13029. button
  13030. {
  13031. on return
  13032. area 278 610 230 40
  13033. bam GUIBUTMT
  13034. text "DONE_BUTTON"
  13035. text style "button"
  13036. clickable lua "createCharScreen:IsDoneButtonClickable()"
  13037. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  13038. }
  13039.  
  13040. }
  13041.  
  13042. `
  13043. function raceOrGeneralHelp()
  13044. race = chargen.races[currentChargenRace]
  13045. if race then
  13046. return Infinity_FetchString(race.desc)
  13047. else
  13048. return Infinity_FetchString(17237)
  13049. end
  13050. end
  13051. `
  13052. menu
  13053. {
  13054. name 'CHARGEN_RACE'
  13055. modal
  13056. align center center
  13057. ignoreesc
  13058. onopen "currentChargenRace = nil"
  13059. label
  13060. {
  13061. area 0 0 864 710
  13062. mosaic GUICGWDE
  13063. }
  13064. label
  13065. {
  13066. area 60 37 744 44
  13067. text "RACE_TITLE"
  13068. text style "title"
  13069. }
  13070. list
  13071. {
  13072. column
  13073. {
  13074. width 100
  13075. label
  13076. {
  13077. area 0 0 340 44
  13078. text lua "Infinity_FetchString(chargen.races[rowNumber].name)"
  13079. text style "list"
  13080. pad 8 0 0 0
  13081. text lower
  13082.  
  13083. }
  13084. }
  13085. action "
  13086. if chargen.races[currentChargenRace] then
  13087. createCharScreen:OnRaceSelectButtonClick(chargen.races[currentChargenRace].id)
  13088. end
  13089. "
  13090. rowheight 44
  13091. area 22 100 340 490
  13092. table "chargen.races"
  13093. var currentChargenRace
  13094. scrollbar 'GUISCRC'
  13095. }
  13096. text
  13097. {
  13098. area 380 100 456 490
  13099. text lua "raceOrGeneralHelp()"
  13100. text style "normal"
  13101. scrollbar 'GUISCRC'
  13102. }
  13103. button
  13104. {
  13105. on escape
  13106. area 196 653 230 40
  13107. bam GUIBUTMT
  13108. text "BACK_BUTTON"
  13109. text style "button"
  13110. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  13111. }
  13112. button
  13113. {
  13114. on return
  13115. area 438 653 230 40
  13116. bam GUIBUTMT
  13117. text "DONE_BUTTON"
  13118. text style "button"
  13119. clickable lua "createCharScreen:IsDoneButtonClickable()"
  13120. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  13121. }
  13122.  
  13123. }
  13124. `
  13125. function classOrGeneralHelp()
  13126. class = chargen.class[currentChargenClass]
  13127. if class then
  13128. return Infinity_FetchString(class.desc)
  13129. else
  13130. --only bit that may need to change for dual class! :)
  13131. return Infinity_FetchString(17242)
  13132. end
  13133. end
  13134. `
  13135. menu
  13136. {
  13137. name 'CHARGEN_CLASS'
  13138. modal
  13139. align center center
  13140. ignoreesc
  13141. onopen "currentChargenClass = nil"
  13142. label
  13143. {
  13144. area 0 0 864 710
  13145. mosaic GUICGWDE
  13146. }
  13147. label
  13148. {
  13149. area 60 37 744 44
  13150. text "CLASS_TITLE"
  13151. text style "title"
  13152. }
  13153. list
  13154. {
  13155. column
  13156. {
  13157. width 100
  13158. label
  13159. {
  13160. area 0 0 340 44
  13161. text lua "Infinity_FetchString(chargen.class[rowNumber].name)"
  13162. text style "list"
  13163. pad 8 0 0 0
  13164. text lower
  13165.  
  13166. }
  13167. }
  13168. action "
  13169. if chargen.class[currentChargenClass] then
  13170. createCharScreen:OnClassSelectButtonClick(chargen.class[currentChargenClass].id)
  13171. end
  13172. "
  13173. rowheight 44
  13174. area 22 100 340 490
  13175. table "chargen.class"
  13176. var currentChargenClass
  13177. scrollbar 'GUISCRC'
  13178. }
  13179. text
  13180. {
  13181. area 380 100 456 490
  13182. text lua "classOrGeneralHelp()"
  13183. text style "normal"
  13184. scrollbar 'GUISCRC'
  13185. }
  13186. button
  13187. {
  13188. on escape
  13189. area 196 653 230 40
  13190. bam GUIBUTMT
  13191. text "BACK_BUTTON"
  13192. text style "button"
  13193. clickable lua "createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_CLASS"
  13194. action "createCharScreen:OnCancelButtonClick(); Infinity_PopMenu('CHARGEN_CLASS');"
  13195. }
  13196. button
  13197. {
  13198. on return
  13199. area 438 653 230 40
  13200. bam GUIBUTMT
  13201. text "DONE_BUTTON"
  13202. text style "button"
  13203. clickable lua "createCharScreen:IsDoneButtonClickable()"
  13204. action "createCharScreen:OnDoneButtonClick(); Infinity_PopMenu('CHARGEN_CLASS'); "
  13205. }
  13206.  
  13207. }
  13208. `
  13209. function kitOrGeneralHelp()
  13210. kit = chargen.kit[currentChargenKit]
  13211. if kit then
  13212. return Infinity_FetchString(kit.desc)
  13213. else
  13214. return Infinity_FetchString(17242)
  13215. end
  13216. end
  13217. `
  13218. menu
  13219. {
  13220. name 'CHARGEN_KIT'
  13221. modal
  13222. align center center
  13223. ignoreesc
  13224. label
  13225. {
  13226. area 0 0 864 710
  13227. mosaic GUICGWDE
  13228. }
  13229. label
  13230. {
  13231. area 60 37 744 44
  13232. text "CLASS_KIT_TITLE"
  13233. text style "title"
  13234. }
  13235. list
  13236. {
  13237. column
  13238. {
  13239. width 100
  13240. label
  13241. {
  13242. area 0 0 340 44
  13243. text lua "Infinity_FetchString(chargen.kit[rowNumber].name)"
  13244. text style "list"
  13245. pad 8 0 0 0
  13246. text lower
  13247.  
  13248. }
  13249. }
  13250. action "
  13251. if chargen.kit[currentChargenKit] then
  13252. createCharScreen:OnKitSelectButtonClick(chargen.kit[currentChargenKit].id)
  13253. end
  13254. "
  13255.  
  13256. rowheight 44
  13257. area 22 100 340 490
  13258. table "chargen.kit"
  13259. var currentChargenKit
  13260. }
  13261. text
  13262. {
  13263. area 380 100 456 490
  13264. text lua "kitOrGeneralHelp()"
  13265. text style "normal"
  13266. scrollbar 'GUISCRC'
  13267. }
  13268. button
  13269. {
  13270. on escape
  13271. area 196 653 230 40
  13272. bam GUIBUTMT
  13273. text "BACK_BUTTON"
  13274. text style "button"
  13275. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  13276. }
  13277. button
  13278. {
  13279. on return
  13280. area 438 653 230 40
  13281. bam GUIBUTMT
  13282. text "DONE_BUTTON"
  13283. text style "button"
  13284. clickable lua "createCharScreen:IsDoneButtonClickable()"
  13285. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  13286. }
  13287.  
  13288. }
  13289. `
  13290. function alignmentOrGeneralHelp()
  13291. alignment = chargen.alignment[currentChargenAlignment]
  13292. if alignment then
  13293. return Infinity_FetchString(alignment.desc)
  13294. else
  13295. return Infinity_FetchString(9602)
  13296. end
  13297. end
  13298. `
  13299. menu
  13300. {
  13301. name 'CHARGEN_ALIGNMENT'
  13302. modal
  13303. align center center
  13304. ignoreesc
  13305. onopen "currentChargenAlignment = nil"
  13306. label
  13307. {
  13308. area 0 0 864 710
  13309. mosaic GUICGWDE
  13310. }
  13311. label
  13312. {
  13313. area 60 37 744 44
  13314. text "ALIGNMENT_TITLE"
  13315. text style "title"
  13316. }
  13317. list
  13318. {
  13319. column
  13320. {
  13321. width 100
  13322. label
  13323. {
  13324. area 0 0 340 44
  13325. text lua "Infinity_FetchString(chargen.alignment[rowNumber].name)"
  13326. text style "list"
  13327. pad 8 0 0 0
  13328. text lower
  13329.  
  13330. }
  13331. }
  13332. action "
  13333. if chargen.alignment[currentChargenAlignment] then
  13334. createCharScreen:OnAlignmentSelectButtonClick(chargen.alignment[currentChargenAlignment].id)
  13335. end
  13336. "
  13337. rowheight 44
  13338. area 22 100 340 490
  13339. table "chargen.alignment"
  13340. var currentChargenAlignment
  13341. scrollbar 'GUISCRC'
  13342. }
  13343. text
  13344. {
  13345. area 380 100 456 490
  13346. text lua "alignmentOrGeneralHelp()"
  13347. text style "normal"
  13348. scrollbar 'GUISCRC'
  13349. }
  13350. button
  13351. {
  13352. on escape
  13353. area 196 653 230 40
  13354. bam GUIBUTMT
  13355. text "BACK_BUTTON"
  13356. text style "button"
  13357. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  13358. }
  13359. button
  13360. {
  13361. on return
  13362. area 438 653 230 40
  13363. bam GUIBUTMT
  13364. text "DONE_BUTTON"
  13365. text style "button"
  13366. clickable lua "createCharScreen:IsDoneButtonClickable()"
  13367. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  13368. }
  13369.  
  13370. }
  13371. `
  13372. chargen.ability = {
  13373. {name = 'STRENGTH_LABEL', desc = 9582},
  13374. {name = 'DEXTERITY_LABEL', desc = 9584},
  13375. {name = 'CONSTITUTION_LABEL', desc = 9583},
  13376. {name = 'INTELLIGENCE_LABEL', desc = 9585},
  13377. {name = 'WISDOM_LABEL', desc = 9586},
  13378. {name = 'CHARISMA_LABEL', desc = 9587},
  13379. }
  13380.  
  13381. function abilityOrGeneralHelp()
  13382. ability = chargen.ability[currentChargenAbility]
  13383. if ability and ability.desc ~= -1 then
  13384. createCharScreen:SetAbilityHelpInfo(currentChargenAbility)
  13385. return Infinity_FetchString(ability.desc)
  13386. else
  13387. return Infinity_FetchString(17247)
  13388. end
  13389. end
  13390.  
  13391. `
  13392.  
  13393. menu
  13394. {
  13395. name 'CHARGEN_ABILITIES'
  13396. modal
  13397. align center center
  13398. ignoreesc
  13399. onopen "ticksPassed = 0; ticksStarting = 0"
  13400. label
  13401. {
  13402. area 0 0 864 710
  13403. mosaic GUICGROL
  13404. }
  13405. label
  13406. {
  13407. area 220 22 426 44
  13408. text "ABILITIES_TITLE"
  13409. text style "title"
  13410. }
  13411. list
  13412. {
  13413. column
  13414. {
  13415. width 52
  13416. label
  13417. {
  13418. area 0 0 180 55
  13419. text lua "t(chargen.ability[rowNumber].name)"
  13420. text style "normal"
  13421. align right center
  13422.  
  13423. }
  13424. }
  13425. column
  13426. {
  13427. width 13
  13428. label
  13429. {
  13430. area 0 0 50 55
  13431. text lua "chargen.ability[rowNumber].roll"
  13432. text style "normal"
  13433. align center center
  13434. }
  13435. }
  13436. column
  13437. {
  13438. width 22
  13439. label
  13440. {
  13441. area 36 6 45 42
  13442. bam GUIOSW
  13443. frame lua "currentCellCheck(3)"
  13444. sequence 0
  13445. }
  13446. }
  13447. column
  13448. {
  13449. width 15
  13450. label
  13451. {
  13452. area 0 6 45 42
  13453. bam GUIOSW
  13454. frame lua "currentCellCheck(4)"
  13455. sequence 1
  13456.  
  13457. }
  13458. }
  13459. action
  13460. "
  13461. if ticksStarting < 10 then
  13462. if cellNumber == 3 then
  13463. createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, true)
  13464. elseif cellNumber == 4 then
  13465. createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, false)
  13466. end
  13467. end
  13468. cellNumber = nil
  13469. ticksPassed = 0
  13470. ticksStarting = 0
  13471. "
  13472. actionUpdate
  13473. "
  13474. ticksStarting = ticksStarting + 1
  13475. if ticksStarting > 10 then
  13476. ticksPassed = ticksPassed + 1
  13477. if ticksPassed > 2 then
  13478. if cellNumber == 3 then
  13479. createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, true)
  13480. elseif cellNumber == 4 then
  13481. createCharScreen:OnAbilityPlusMinusButtonClick(currentChargenAbility, false)
  13482. end
  13483. ticksPassed = 0
  13484. end
  13485. end
  13486. "
  13487.  
  13488. rowheight 54
  13489. hidehighlight
  13490. area 34 85 386 325
  13491. table "chargen.ability"
  13492. var currentChargenAbility
  13493. }
  13494. label
  13495. {
  13496. area 34 410 186 54
  13497. text "TOTAL_ROLL_NORMAL"
  13498. text style "normal"
  13499. text align right center
  13500. }
  13501. label
  13502. {
  13503. area 234 410 50 54
  13504. text lua "chargen.totalRoll"
  13505. text style "normal"
  13506. text align center center
  13507. }
  13508. label
  13509. {
  13510. area 322 410 94 54
  13511. text lua "chargen.extraAbilityPoints"
  13512. text style "normal"
  13513. text align center center
  13514. }
  13515.  
  13516.  
  13517. text
  13518. {
  13519. area 442 91 394 505
  13520. text lua "abilityOrGeneralHelp()"
  13521. text style "normal"
  13522. scrollbar 'GUISCRC'
  13523. }
  13524.  
  13525. button
  13526. {
  13527. area 26 480 200 40
  13528. bam GUIBUTNT
  13529. sequence 0
  13530. text "REROLL_BUTTON"
  13531. text style "button"
  13532. action "createCharScreen:OnAbilityReRollButtonClick()"
  13533. }
  13534. button
  13535. {
  13536. area 26 531 200 40
  13537. bam GUIBUTNT
  13538. sequence 0
  13539. text "STORE_BUTTON"
  13540. text style "button"
  13541. action "createCharScreen:OnAbilityStoreButtonClick()"
  13542. }
  13543. button
  13544. {
  13545. area 26 582 200 40
  13546. bam GUIBUTNT
  13547. sequence 0
  13548. text "RECALL_BUTTON"
  13549. text style "button"
  13550. clickable lua "createCharScreen:IsAbilityRecallButtonClickable()"
  13551. action "createCharScreen:OnAbilityRecallButtonClick()"
  13552. }
  13553.  
  13554. button
  13555. {
  13556. on '8'
  13557. action "createCharScreen:OnCheatyMcCheaterson()"
  13558.  
  13559.  
  13560. }
  13561.  
  13562. button
  13563. {
  13564. on escape
  13565. area 196 653 230 40
  13566. bam GUIBUTMT
  13567. text "BACK_BUTTON"
  13568. text style "button"
  13569. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  13570. }
  13571. button
  13572. {
  13573. on return
  13574. area 438 653 230 40
  13575. bam GUIBUTMT
  13576. text "DONE_BUTTON"
  13577. text style "button"
  13578. clickable lua "createCharScreen:IsDoneButtonClickable()"
  13579. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  13580. }
  13581.  
  13582. }
  13583.  
  13584. `
  13585. function proficiencyOrGeneralHelp()
  13586. local prof = chargen.proficiency[currentChargenProficiency]
  13587. local skill = chargen.thief_skill[currentChargenThiefSkill]
  13588. if prof and prof.desc ~= -1 then
  13589. return Infinity_FetchString(prof.desc)
  13590. elseif skill and skill.desc ~= -1 then
  13591. return Infinity_FetchString(skill.description)
  13592. else
  13593. if(chargen.levelingUp) then
  13594. if(levelUpInfoToggle == 1) then
  13595. return chargen.charInfo
  13596. else
  13597. return chargen.levelInfo
  13598. end
  13599. else
  13600. return Infinity_FetchString(24315)
  13601. end
  13602. end
  13603. end
  13604.  
  13605. function getProficienciesTitle()
  13606. if(chargen.levelingUp) then
  13607. return t("LEVEL_UP_TITLE")
  13608. else
  13609. return t("CHARGEN_TITLE")
  13610. end
  13611. end
  13612.  
  13613. function isChargenProficienciesBackButtonClickable()
  13614. return ((not chargen.levelingUp) and createCharScreen:GetCurrentStep() ~= const.STEP_DUALCLASS_PROFICIENCIES)
  13615. end
  13616. `
  13617.  
  13618. menu
  13619. {
  13620. name 'CHARGEN_PROFICIENCIES'
  13621. modal
  13622. align center center
  13623. ignoreesc
  13624. onopen "currentChargenProficiency = nil; currentChargenThiefSkill = nil; ticksPassed = 0; ticksStarting = 0"
  13625. label
  13626. {
  13627. area 0 0 1024 768
  13628. mosaic GUILUPB
  13629. }
  13630. label
  13631. {
  13632. area 162 16 700 44
  13633. text lua "getProficienciesTitle()"
  13634. text style "title"
  13635. }
  13636. label
  13637. {
  13638. area 58 172 398 44
  13639. text "PROF_SLOTS_LABEL"
  13640. text style "label"
  13641. }
  13642. label
  13643. {
  13644. area 460 172 50 44
  13645. text lua "chargen.extraProficiencySlots"
  13646. text style "label"
  13647. }
  13648. label
  13649. {
  13650. area 510 172 398 44
  13651. text "SKILLS_LABEL"
  13652. text style "label"
  13653. }
  13654. label
  13655. {
  13656. area 900 172 50 44
  13657. text lua "chargen.extraSkillPoints"
  13658. text style "label"
  13659. }
  13660.  
  13661. list
  13662. {
  13663. column
  13664. {
  13665. width 64
  13666. label
  13667. {
  13668. area 0 0 280 55
  13669. text lua "Infinity_FetchString(chargen.proficiency[rowNumber].name)"
  13670. text style "normal"
  13671. align right center
  13672.  
  13673. }
  13674. }
  13675. column
  13676. {
  13677. width 3
  13678. label
  13679. {
  13680. bam GUIPFC
  13681. area 0 19 16 16
  13682. align center center
  13683. enabled "chargen.proficiency[rowNumber].value > 4"
  13684. }
  13685. }
  13686. column
  13687. {
  13688. width 3
  13689. label
  13690. {
  13691. bam GUIPFC
  13692. area 0 19 16 16
  13693. align center center
  13694. enabled "chargen.proficiency[rowNumber].value > 3"
  13695. }
  13696. }
  13697. column
  13698. {
  13699. width 3
  13700. label
  13701. {
  13702. bam GUIPFC
  13703. area 0 19 16 16
  13704. align center center
  13705. enabled "chargen.proficiency[rowNumber].value > 2"
  13706. }
  13707. }
  13708. column
  13709. {
  13710. width 3
  13711. label
  13712. {
  13713. bam GUIPFC
  13714. area 0 19 16 16
  13715. align center center
  13716. enabled "chargen.proficiency[rowNumber].value > 1"
  13717. }
  13718. }
  13719. column
  13720. {
  13721. width 3
  13722. label
  13723. {
  13724. bam GUIPFC
  13725. area 0 19 16 16
  13726. align center center
  13727. enabled "chargen.proficiency[rowNumber].value > 0"
  13728. }
  13729. }
  13730.  
  13731. column
  13732. {
  13733. width 10
  13734. label
  13735. {
  13736. area 0 6 45 42
  13737. bam GUIOSW
  13738. frame lua "getPlusFrame(7)"
  13739. sequence 0
  13740. align center center
  13741. }
  13742. }
  13743. column
  13744. {
  13745. width 10
  13746. label
  13747. {
  13748. area 0 6 45 42
  13749. bam GUIOSW
  13750. sequence 1
  13751. frame lua "getMinusFrame(8)"
  13752.  
  13753. align center center
  13754. }
  13755. }
  13756.  
  13757. action
  13758. "
  13759. currentChargenThiefSkill = nil
  13760. if ticksStarting < 10 then
  13761. if cellNumber == 7 and plusButtonClickable(currentChargenProficiency) then
  13762. createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, true)
  13763. elseif cellNumber == 8 and minusButtonClickable(currentChargenProficiency) then
  13764. createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, false)
  13765. end
  13766. end
  13767. cellNumber = nil
  13768. ticksPassed = 0
  13769. ticksStarting = 0
  13770. "
  13771. actionUpdate
  13772. "
  13773. currentChargenThiefSkill = nil
  13774. ticksStarting = ticksStarting + 1
  13775. if ticksStarting > 10 then
  13776. ticksPassed = ticksPassed + 1
  13777. if ticksPassed > 7 then
  13778. if cellNumber == 7 and plusButtonClickable(currentChargenProficiency) then
  13779. createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, true)
  13780. elseif cellNumber == 8 and minusButtonClickable(currentChargenProficiency) then
  13781. createCharScreen:OnProficiencyPlusMinusButtonClick(chargen.proficiency[currentChargenProficiency].id, false)
  13782. end
  13783. ticksPassed = 0
  13784. end
  13785. end
  13786. "
  13787.  
  13788. rowheight 54
  13789. area 37 248 497 432
  13790. table "chargen.proficiency"
  13791. var currentChargenProficiency
  13792. scrollbar 'GUISCRC'
  13793.  
  13794. }
  13795. list
  13796. {
  13797. column
  13798. {
  13799. width 60
  13800. label
  13801. {
  13802. area 0 0 180 54
  13803. text lua "Infinity_FetchString(chargen.thief_skill[rowNumber].name)"
  13804. text style "normal"
  13805. text align right center
  13806.  
  13807. }
  13808. }
  13809. column
  13810. {
  13811. width 10
  13812. label
  13813. {
  13814. area 0 0 40 54
  13815. text lua "chargen.thief_skill[rowNumber].value"
  13816. text style "normal"
  13817. text align left center
  13818.  
  13819. }
  13820. }
  13821. column
  13822. {
  13823. width 18
  13824. label
  13825. {
  13826. area 24 6 45 42
  13827. bam GUIOSW
  13828. enabled "createCharScreen:IsThiefSkillPlusMinusButtonClickable()"
  13829. frame lua "currentCellCheck(3)"
  13830. sequence 0
  13831. }
  13832. }
  13833. column
  13834. {
  13835. width 12
  13836. label
  13837. {
  13838. area 0 6 45 42
  13839. bam GUIOSW
  13840. enabled "createCharScreen:IsThiefSkillPlusMinusButtonClickable()"
  13841. frame lua "currentCellCheck(4)"
  13842. sequence 1
  13843.  
  13844. }
  13845. }
  13846.  
  13847. action
  13848. "
  13849. currentChargenProficiency = nil
  13850. if ticksStarting < 10 then
  13851. if createCharScreen:IsThiefSkillPlusMinusButtonClickable() then
  13852. if cellNumber == 3 then
  13853. createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, true)
  13854. elseif cellNumber == 4 then
  13855. createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, false)
  13856. end
  13857. end
  13858. end
  13859. cellNumber = nil
  13860. ticksPassed = 0
  13861. ticksStarting = 0
  13862. "
  13863. actionUpdate
  13864. "
  13865. currentChargenProficiency = nil
  13866. if createCharScreen:IsThiefSkillPlusMinusButtonClickable() then
  13867. ticksStarting = ticksStarting + 1
  13868. if ticksStarting > 10 then
  13869. ticksPassed = ticksPassed + 1
  13870. if ticksPassed > 2 then
  13871. if cellNumber == 3 then
  13872. createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, true)
  13873. elseif cellNumber == 4 then
  13874. createCharScreen:OnThiefSkillPlusMinusButtonClick(chargen.thief_skill[currentChargenThiefSkill].id, false)
  13875. end
  13876. ticksPassed = 0
  13877. end
  13878. end
  13879. end
  13880. "
  13881.  
  13882. rowheight 54
  13883. area 574 262 418 210
  13884. table "chargen.thief_skill"
  13885. var currentChargenThiefSkill
  13886. scrollbar 'GUISCRC'
  13887. }
  13888.  
  13889. text
  13890. {
  13891. area 568 484 424 200
  13892. text lua "proficiencyOrGeneralHelp()"
  13893. text style "normal"
  13894. scrollbar 'GUISCRC'
  13895. }
  13896.  
  13897. button
  13898. {
  13899. enabled "chargen.levelingUp"
  13900. area 438 704 230 40
  13901. bam GUIBUTMT
  13902. text "INFORMATION_BUTTON"
  13903. text style "button"
  13904. toggle "levelUpInfoToggle"
  13905. action
  13906. "
  13907. currentChargenProficiency = nil
  13908. "
  13909. }
  13910. button
  13911. {
  13912. on escape
  13913. area 37 704 230 40
  13914. bam GUIBUTMT
  13915. text "BACK_BUTTON"
  13916. text style "button"
  13917. clickable lua "isChargenProficienciesBackButtonClickable()"
  13918. action "createCharScreen:OnCancelButtonClick();"
  13919. }
  13920. button
  13921. {
  13922. on return
  13923. area 762 704 230 40
  13924. bam GUIBUTMT
  13925. text "DONE_BUTTON"
  13926. text style "button"
  13927. clickable lua "createCharScreen:IsDoneButtonClickable()"
  13928. action "createCharScreen:OnDoneButtonClick();"
  13929. }
  13930.  
  13931. }
  13932. `
  13933. function specialistFrame(num)
  13934. if spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[num].key].specialist then
  13935. return 3
  13936. end
  13937. return 0
  13938. end
  13939. function spellLearnOrUnlearnText()
  13940. if currentChargenChooseMageSpell == nil or not chargen.choose_spell[currentChargenChooseMageSpell].enabled then
  13941. return t("BUTTON_LEARN")
  13942. else
  13943. return t("BUTTON_UNLEARN")
  13944. end
  13945. end
  13946. function spellLearnOrUnlearnClickable()
  13947. spl = chargen.choose_spell[currentChargenChooseMageSpell]
  13948. if chargen.extraSpells == 0 and spl ~= nil and spl.enabled == false or spl == nil or spl.known then
  13949. return false
  13950. else
  13951. return true
  13952. end
  13953. end
  13954.  
  13955.  
  13956. function chooseSpellOrGeneralHelp()
  13957. local helpText = chargen.helpText
  13958. spl = chargen.choose_spell[currentChargenChooseMageSpell]
  13959. if spl == nil then
  13960. return helpText
  13961. end
  13962.  
  13963. local desc = spellBook[chargen.currentSpellLevelChoice][spl.key].desc
  13964. if currentChargenChooseMageSpell and desc ~= -1 then
  13965. return Infinity_FetchString(desc)
  13966. else
  13967. return helpText
  13968. end
  13969. end
  13970.  
  13971. function nextOrDone()
  13972. if(createCharScreen:HasMoreMageLevels()) then
  13973. return t('NEXT_BUTTON')
  13974. else
  13975. return t('DONE_BUTTON')
  13976. end
  13977. end
  13978. function shouldShowSpecialistMessage()
  13979. local ret = false
  13980.  
  13981. if chargen.extraSpells == 0 and not createCharScreen:IsDoneButtonClickable() then
  13982. ret = true
  13983. end
  13984.  
  13985. return ret
  13986. end
  13987. `
  13988. menu
  13989. {
  13990. name 'CHARGEN_CHOOSE_SPELLS'
  13991. modal
  13992. align center center
  13993. ignoreesc
  13994. onOpen
  13995. "
  13996. table.sort(chargen.choose_spell, sortBySpellName)
  13997. currentChargenChooseMageSpell = nil
  13998.  
  13999. if currentChargenKit == nil then
  14000. currentChargenKit = 0
  14001. end
  14002.  
  14003. local currentKitName = ''
  14004.  
  14005. --gnome illusionists
  14006. if currentChargenRace ~= 6 and chargen.kit then
  14007. currentKitName = Infinity_FetchString(chargen.kit[currentChargenKit].name)
  14008. else
  14009. currentKitName = Infinity_FetchString(25323)
  14010. end
  14011.  
  14012. if currentKitName == Infinity_FetchString(25319) then
  14013. setStringTokenLua('<SCHOOLTOKEN>',t('ABJURATION_SCHOOL_TOKEN'))
  14014. elseif currentKitName == Infinity_FetchString(25320) then
  14015. setStringTokenLua('<SCHOOLTOKEN>',t('CONJURATION_SCHOOL_TOKEN'))
  14016. elseif currentKitName == Infinity_FetchString(25321) then
  14017. setStringTokenLua('<SCHOOLTOKEN>',t('DIVINATION_SCHOOL_TOKEN'))
  14018. elseif currentKitName == Infinity_FetchString(25322) then
  14019. setStringTokenLua('<SCHOOLTOKEN>',t('ENCHANTMENT_SCHOOL_TOKEN'))
  14020. elseif currentKitName == Infinity_FetchString(25323) then
  14021. setStringTokenLua('<SCHOOLTOKEN>',t('ILLUSION_SCHOOL_TOKEN'))
  14022. elseif currentKitName == Infinity_FetchString(25324) then
  14023. setStringTokenLua('<SCHOOLTOKEN>',t('EVOCATION_SCHOOL_TOKEN'))
  14024. elseif currentKitName == Infinity_FetchString(25325) then
  14025. setStringTokenLua('<SCHOOLTOKEN>',t('NECROMANCY_SCHOOL_TOKEN'))
  14026. elseif currentKitName == Infinity_FetchString(25326) then
  14027. setStringTokenLua('<SCHOOLTOKEN>',t('TRANSMUTATION_SCHOOL_TOKEN'))
  14028. elseif currentKitName == Infinity_FetchString(25327) then
  14029. setStringTokenLua('<SCHOOLTOKEN>',Infinity_FetchString(25327))
  14030. end
  14031. "
  14032. label
  14033. {
  14034. area 0 0 864 710
  14035. mosaic GUIPO64D
  14036. }
  14037. label
  14038. {
  14039. area 108 34 686 52
  14040. text lua "t(chargen.title) .. ': ' .. t('LEVEL_LABEL') .. ' ' .. chargen.currentSpellLevelChoice"
  14041. text style "title"
  14042. }
  14043. list
  14044. {
  14045. column
  14046. {
  14047. width 16
  14048.  
  14049. label
  14050. {
  14051. bam GUIPFC
  14052. area 4 19 16 16
  14053. align center center
  14054. enabled "chargen.choose_spell[rowNumber].enabled or chargen.choose_spell[rowNumber].known"
  14055. }
  14056. label
  14057. {
  14058. bam GUIBTBUT
  14059. area 20 0 52 52
  14060. align center center
  14061. frame lua "specialistFrame(rowNumber)"
  14062. }
  14063. label
  14064. {
  14065. area 20 0 52 52
  14066. greyscale lua "chargen.choose_spell[rowNumber].enabled == false"
  14067. bam lua "spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].groundicon"
  14068. align center center
  14069. }
  14070. }
  14071. column
  14072. {
  14073. width 84
  14074. label
  14075. {
  14076. area 4 0 -1 -1
  14077. text lua "Infinity_FetchString(spellBook[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].name)"
  14078. text style "normal"
  14079.  
  14080. glow lua "chargen.choose_spell[rowNumber].enabled"
  14081. align left center
  14082.  
  14083. }
  14084. }
  14085.  
  14086. scrollbar 'GUISCRC'
  14087. rowheight 52
  14088. area 36 102 466 438
  14089. table "chargen.choose_spell"
  14090. var currentChargenChooseMageSpell
  14091. action "
  14092. if cellNumber == 1 and not chargen.choose_spell[currentChargenChooseMageSpell].known then
  14093. createCharScreen:OnLearnMageSpellButtonClick(currentChargenChooseMageSpell)
  14094. end
  14095. "
  14096. }
  14097. text
  14098. {
  14099. area 514 102 316 494
  14100. text lua "chooseSpellOrGeneralHelp()"
  14101. text style "normal"
  14102. scrollbar 'GUISCRC'
  14103. }
  14104.  
  14105. label
  14106. {
  14107. area 270 548 192 48
  14108. text "SPELLS_REMAINING_NORMAL"
  14109. text style "normal"
  14110. text align right center
  14111. }
  14112. label
  14113. {
  14114. area 462 548 36 48
  14115. text lua "chargen.extraSpells"
  14116. text style "normal"
  14117. text align center center
  14118. }
  14119. label
  14120. {
  14121. area 40 612 790 39
  14122. enabled "shouldShowSpecialistMessage()"
  14123. text lua "t('SPECIALIST_SPELL_REQ')"
  14124. text style "normal"
  14125. text align center center
  14126. rectangle 0
  14127. }
  14128.  
  14129. button
  14130. {
  14131. area 40 552 230 40
  14132. bam GUIBUTMT
  14133. text lua "spellLearnOrUnlearnText()"
  14134. text style "button"
  14135. clickable lua "spellLearnOrUnlearnClickable()"
  14136. action "createCharScreen:OnLearnMageSpellButtonClick(currentChargenChooseMageSpell)"
  14137. }
  14138.  
  14139. button
  14140. {
  14141. on escape
  14142. area 196 653 230 40
  14143. bam GUIBUTMT
  14144. text "BACK_BUTTON"
  14145. text style "button"
  14146. clickable lua "not chargen.levelingUp"
  14147. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  14148. }
  14149. button
  14150. {
  14151. on return
  14152. area 438 653 230 40
  14153. bam GUIBUTMT
  14154. text lua "nextOrDone()"
  14155. text style "button"
  14156. clickable lua "createCharScreen:IsDoneButtonClickable()"
  14157. action "createCharScreen:OnDoneButtonClick()"
  14158. }
  14159.  
  14160. }
  14161. `
  14162.  
  14163. function mageMemorizeSpellOrGeneralHelp()
  14164. spl = chargen.choose_spell[currentChargenMemorizeMageSpell]
  14165. if spl == nil then
  14166. return Infinity_FetchString(17253)
  14167. end
  14168.  
  14169. local desc = mageSpells[chargen.currentSpellLevelChoice][spl.key].desc
  14170. if currentChargenMemorizeMageSpell and desc ~= -1 then
  14171. return Infinity_FetchString(desc)
  14172. else
  14173. return Infinity_FetchString(17253)
  14174. end
  14175. end
  14176.  
  14177. `
  14178. menu
  14179. {
  14180. name 'CHARGEN_MEMORIZE_MAGE'
  14181. modal
  14182. align center center
  14183. ignoreesc
  14184. onOpen "
  14185. table.sort(chargen.choose_spell, sortByMageSpellName)
  14186. currentChargenMemorizeMageSpell = nil
  14187. "
  14188. label
  14189. {
  14190. area 0 0 864 710
  14191. mosaic GUIPO64D
  14192. }
  14193. label
  14194. {
  14195. area 108 34 686 52
  14196. text lua "chargen.title"
  14197. text style "title"
  14198. }
  14199. list
  14200. {
  14201. column
  14202. {
  14203. width 12
  14204.  
  14205. label
  14206. {
  14207. bam GUIBTBUT
  14208. area 0 0 52 52
  14209. align center center
  14210. icon lua "mageSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].groundicon"
  14211. frame lua "specialistFrame(rowNumber)"
  14212. count lua "chargen.choose_spell[rowNumber].count"
  14213. }
  14214. }
  14215. column
  14216. {
  14217. width 68
  14218. label
  14219. {
  14220. area 4 0 -1 -1
  14221. text lua "Infinity_FetchString(mageSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].name)"
  14222. text style "normal"
  14223.  
  14224. glow lua "chargen.choose_spell[rowNumber].enabled"
  14225. align left center
  14226.  
  14227. }
  14228. }
  14229. column
  14230. {
  14231. width 10
  14232. label
  14233. {
  14234. area 0 4 45 42
  14235. bam GUIOSW
  14236. frame lua "currentCellCheck(3)"
  14237. sequence 0
  14238. }
  14239. }
  14240. column
  14241. {
  14242. width 10
  14243. label
  14244. {
  14245. area 0 4 45 42
  14246. bam GUIOSW
  14247. frame lua "currentCellCheck(4)"
  14248. sequence 1
  14249.  
  14250. }
  14251. }
  14252.  
  14253.  
  14254. scrollbar 'GUISCRC'
  14255. rowheight 52
  14256. area 36 102 466 438
  14257. table "chargen.choose_spell"
  14258. var currentChargenMemorizeMageSpell
  14259. action "
  14260. if cellNumber == 3 then
  14261. createCharScreen:OnMemorizeMageSpellButtonClick(currentChargenMemorizeMageSpell, 1)
  14262. elseif cellNumber == 4 then
  14263. createCharScreen:OnMemorizeMageSpellButtonClick(currentChargenMemorizeMageSpell, -1)
  14264. end
  14265. cellNumber = nil
  14266. "
  14267. }
  14268. text
  14269. {
  14270. area 514 102 316 494
  14271. text lua "mageMemorizeSpellOrGeneralHelp()"
  14272. text style "normal"
  14273. scrollbar 'GUISCRC'
  14274. }
  14275.  
  14276. label
  14277. {
  14278. area 36 548 426 48
  14279. text "SPELLS_REMAINING_NORMAL"
  14280. text style "normal"
  14281. text align right center
  14282. }
  14283. label
  14284. {
  14285. area 462 548 36 48
  14286. text lua "chargen.extraSpells"
  14287. text style "normal"
  14288. text align center center
  14289. }
  14290.  
  14291. button
  14292. {
  14293. on escape
  14294. area 196 653 230 40
  14295. bam GUIBUTMT
  14296. text "BACK_BUTTON"
  14297. text style "button"
  14298. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  14299. }
  14300. button
  14301. {
  14302. on return
  14303. area 438 653 230 40
  14304. bam GUIBUTMT
  14305. text lua "nextOrDone()"
  14306. text style "button"
  14307. clickable lua "createCharScreen:IsDoneButtonClickable()"
  14308. action "createCharScreen:OnDoneButtonClick()"
  14309. }
  14310.  
  14311. }
  14312. `
  14313.  
  14314. function priestMemorizeSpellOrGeneralHelp()
  14315. spl = chargen.choose_spell[currentChargenMemorizePriestSpell]
  14316. if spl == nil then
  14317. return Infinity_FetchString(17253)
  14318. end
  14319.  
  14320. local desc = priestSpells[chargen.currentSpellLevelChoice][spl.key].desc
  14321. if currentChargenMemorizePriestSpell and desc ~= -1 then
  14322. return Infinity_FetchString(desc)
  14323. else
  14324. return Infinity_FetchString(17253)
  14325. end
  14326. end
  14327.  
  14328. `
  14329. menu
  14330. {
  14331. name 'CHARGEN_MEMORIZE_PRIEST'
  14332. modal
  14333. align center center
  14334. ignoreesc
  14335. onOpen "
  14336. table.sort(chargen.choose_spell, sortByPriestSpellName)
  14337. currentChargenMemorizePriestSpell = nil
  14338. "
  14339. label
  14340. {
  14341. area 0 0 864 710
  14342. mosaic GUIPO64D
  14343. }
  14344. label
  14345. {
  14346. area 108 34 686 52
  14347. text lua "chargen.title"
  14348. text style "title"
  14349. }
  14350. list
  14351. {
  14352. column
  14353. {
  14354. width 12
  14355.  
  14356. label
  14357. {
  14358. bam GUIBTBUT
  14359. area 0 0 52 52
  14360. align center center
  14361. icon lua "priestSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].groundicon"
  14362. frame 0
  14363. count lua "chargen.choose_spell[rowNumber].count"
  14364. }
  14365. }
  14366. column
  14367. {
  14368. width 68
  14369. label
  14370. {
  14371. area 4 0 -1 -1
  14372. text lua "Infinity_FetchString(priestSpells[chargen.currentSpellLevelChoice][chargen.choose_spell[rowNumber].key].name)"
  14373. text style "normal"
  14374.  
  14375. glow lua "chargen.choose_spell[rowNumber].enabled"
  14376. align left center
  14377.  
  14378. }
  14379. }
  14380. column
  14381. {
  14382. width 10
  14383. label
  14384. {
  14385. area 0 4 45 42
  14386. bam GUIOSW
  14387. sequence 0
  14388. }
  14389. }
  14390. column
  14391. {
  14392. width 10
  14393. label
  14394. {
  14395. area 0 4 45 42
  14396. bam GUIOSW
  14397. sequence 1
  14398.  
  14399. }
  14400. }
  14401.  
  14402.  
  14403. scrollbar 'GUISCRC'
  14404. rowheight 52
  14405. area 36 102 466 438
  14406. table "chargen.choose_spell"
  14407. var currentChargenMemorizePriestSpell
  14408. action "
  14409. if cellNumber == 3 then
  14410. createCharScreen:OnMemorizePriestSpellButtonClick(currentChargenMemorizePriestSpell, 1)
  14411. elseif cellNumber == 4 then
  14412. createCharScreen:OnMemorizePriestSpellButtonClick(currentChargenMemorizePriestSpell, -1)
  14413. end
  14414. "
  14415. }
  14416. text
  14417. {
  14418. area 514 102 316 494
  14419. text lua "priestMemorizeSpellOrGeneralHelp()"
  14420. text style "normal"
  14421. scrollbar 'GUISCRC'
  14422. }
  14423.  
  14424. label
  14425. {
  14426. area 36 548 426 48
  14427. text "SPELLS_REMAINING_NORMAL"
  14428. text style "normal"
  14429. text align right center
  14430. }
  14431. label
  14432. {
  14433. area 462 548 36 48
  14434. text lua "chargen.extraSpells"
  14435. text style "normal"
  14436. text align center center
  14437. }
  14438.  
  14439. button
  14440. {
  14441. on escape
  14442. area 196 653 230 40
  14443. bam GUIBUTMT
  14444. text "BACK_BUTTON"
  14445. text style "button"
  14446. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  14447. }
  14448. button
  14449. {
  14450. on return
  14451. area 438 653 230 40
  14452. bam GUIBUTMT
  14453. text lua "nextOrDone()"
  14454. text style "button"
  14455. clickable lua "createCharScreen:IsDoneButtonClickable()"
  14456. action "createCharScreen:OnDoneButtonClick()"
  14457. }
  14458.  
  14459. }
  14460. `
  14461. currentChargenCustomSound = 0
  14462.  
  14463. `
  14464. menu
  14465. {
  14466. name 'CHARGEN_CUSTOMSOUNDS'
  14467. modal
  14468. align center center
  14469. ignoreesc
  14470. label
  14471. {
  14472. area 0 0 864 710
  14473. mosaic 'GUICGSND'
  14474. }
  14475. label
  14476. {
  14477. area 220 34 426 44
  14478. text "SOUND_TITLE"
  14479. text style title
  14480. }
  14481. list
  14482. {
  14483. column
  14484. {
  14485. width 100
  14486. label
  14487. {
  14488. area 0 0 384 18
  14489. text lua "getFileNameStringRef(rowNumber, chargen.customSound)"
  14490. text style "list"
  14491. pad 8 0 0 0
  14492. }
  14493. }
  14494. area 46 86 312 346
  14495. rowheight 18
  14496. table "chargen.customSound"
  14497. var "currentChargenCustomSound"
  14498. scrollbar 'GUISCRC'
  14499. action
  14500. "
  14501. createCharScreen:OnSoundItemSelect(currentChargenCustomSound-1)
  14502. "
  14503. }
  14504. text
  14505. {
  14506. area 398 90 434 505
  14507. text "SOUND_DESCRIPTION"
  14508. scrollbar 'GUISCRC'
  14509. text style normal
  14510. }
  14511. button
  14512. {
  14513. area 84 452 230 40
  14514. bam GUIBUTMT
  14515. text "PLAY_SOUND_BUTTON"
  14516. text style "button"
  14517. action "createCharScreen:OnPlayButtonClick()"
  14518. }
  14519. button
  14520. {
  14521. on escape
  14522. area 196 653 230 40
  14523. bam GUIBUTMT
  14524. text "BACK_BUTTON"
  14525. text style "button"
  14526. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  14527. }
  14528. button
  14529. {
  14530. on return
  14531. area 438 653 230 40
  14532. bam GUIBUTMT
  14533. text "DONE_BUTTON"
  14534. text style "button"
  14535. clickable lua "createCharScreen:IsDoneButtonClickable()"
  14536. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  14537. }
  14538. }
  14539.  
  14540. `
  14541. function hatedRaceOrGeneralHelp()
  14542. race = chargen.hatedRace[currentChargenHatedRace]
  14543. if race then
  14544. return Infinity_FetchString(race.desc)
  14545. else
  14546. return Infinity_FetchString(17256)
  14547. end
  14548. end
  14549. `
  14550. menu
  14551. {
  14552. name 'CHARGEN_HATEDRACE'
  14553. modal
  14554. align center center
  14555. ignoreesc
  14556. label
  14557. {
  14558. area 0 0 864 710
  14559. mosaic GUICGWDE
  14560. }
  14561. label
  14562. {
  14563. area 60 37 744 44
  14564. text "HATED_RACE_TITLE"
  14565. text style "title"
  14566. }
  14567. list
  14568. {
  14569. column
  14570. {
  14571. width 100
  14572. label
  14573. {
  14574. area 0 0 340 44
  14575. text lua "Infinity_FetchString(chargen.hatedRace[rowNumber].name)"
  14576. text style "list"
  14577. pad 8 0 0 0
  14578. }
  14579. }
  14580. action "
  14581. if chargen.hatedRace[currentChargenHatedRace] then
  14582. createCharScreen:OnRacialEnemySelectButtonClick(chargen.hatedRace[currentChargenHatedRace].id)
  14583. end
  14584. "
  14585. rowheight 44
  14586. area 22 100 340 490
  14587. table "chargen.hatedRace"
  14588. var currentChargenHatedRace
  14589. scrollbar 'GUISCRC'
  14590. }
  14591. text
  14592. {
  14593. area 380 100 456 490
  14594. text lua "hatedRaceOrGeneralHelp()"
  14595. text style "normal"
  14596. scrollbar 'GUISCRC'
  14597. }
  14598. button
  14599. {
  14600. on escape
  14601. area 196 653 230 40
  14602. bam GUIBUTMT
  14603. text "BACK_BUTTON"
  14604. text style "button"
  14605. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  14606. }
  14607. button
  14608. {
  14609. on return
  14610. area 438 653 230 40
  14611. bam GUIBUTMT
  14612. text "DONE_BUTTON"
  14613. text style "button"
  14614. clickable lua "createCharScreen:IsDoneButtonClickable()"
  14615. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  14616. }
  14617.  
  14618. }
  14619. `
  14620. charNameEdit = ""
  14621. `
  14622. menu
  14623. {
  14624. name 'CHARGEN_NAME'
  14625. modal
  14626. align center center
  14627. ignoreesc
  14628. onopen
  14629. "
  14630. if chargen.name then
  14631. charNameEdit = chargen.name
  14632. else
  14633. charNameEdit = ''
  14634. end
  14635. Infinity_FocusTextEdit('charNameEditArea')
  14636. "
  14637. label
  14638. {
  14639. area 0 0 657 234
  14640. mosaic 'GUIERR6'
  14641.  
  14642. }
  14643. label
  14644. {
  14645. area 28 14 598 38
  14646. text "ENTER_NAME_LABEL"
  14647. text style "label"
  14648. }
  14649. label
  14650. {
  14651. area 28 62 598 36
  14652. fill 112 111 111 64
  14653. }
  14654. edit
  14655. {
  14656. name "charNameEditArea"
  14657. area 36 66 586 28
  14658. var charNameEdit
  14659. text style "edit"
  14660. maxlines 1
  14661. maxchars 20
  14662. }
  14663. button
  14664. {
  14665. on escape
  14666. area 58 164 230 40
  14667. bam GUIBUTMT
  14668. text "BACK_BUTTON"
  14669. text style "button"
  14670. action "Infinity_PopMenu(); createCharScreen:OnCancelButtonClick()"
  14671. }
  14672. button
  14673. {
  14674. on return
  14675. area 318 164 230 40
  14676. bam GUIBUTMT
  14677. text "DONE_BUTTON"
  14678. text style "button"
  14679. clickable lua "createCharScreen:IsDoneButtonClickable()"
  14680. action "Infinity_PopMenu(); createCharScreen:OnDoneButtonClick()"
  14681. }
  14682.  
  14683. }
  14684. `
  14685. createBioEdit = ""
  14686. `
  14687. menu
  14688. {
  14689. name 'CHARGEN_BIO'
  14690. modal
  14691. align center center
  14692. ignoreesc
  14693. label
  14694. {
  14695. area 0 0 864 710
  14696. mosaic 'GUIPOPF'
  14697. }
  14698. label
  14699. {
  14700. area 60 37 744 44
  14701. text "BIOGRAPHY_TITLE"
  14702. text style "title"
  14703. }
  14704. label
  14705. {
  14706. area 44 106 776 480
  14707. fill 112 111 111 64
  14708. }
  14709. edit
  14710. {
  14711. name "createBioEditArea"
  14712. area 52 114 760 464
  14713. var createBioEdit
  14714. scrollbar 'GUISCRC'
  14715. text style "edit"
  14716. }
  14717. button
  14718. {
  14719. on escape
  14720. area 67 653 230 40
  14721. text "BACK_BUTTON"
  14722. text style "button"
  14723. bam GUIBUTMT
  14724. action "createCharScreen:OnCancelButtonClick()"
  14725. }
  14726. button
  14727. {
  14728. area 317 653 230 40
  14729. text "CLEAR_BUTTON"
  14730. text style "button"
  14731. bam GUIBUTMT
  14732. action "createBioEdit = ''"
  14733. }
  14734. button
  14735. {
  14736. on return
  14737. area 567 653 230 40
  14738. text "DONE_BUTTON"
  14739. text style "button"
  14740. bam GUIBUTMT
  14741. action "createCharScreen:OnDoneButtonClick()"
  14742. }
  14743.  
  14744. }
  14745. `
  14746. list_GUICG_20_2_idx = 0
  14747. function NextOrDone()
  14748. if createCharScreen:GetImportState() == 1 then
  14749. return t("NEXT_BUTTON")
  14750. else
  14751. return t("DONE_BUTTON")
  14752. end
  14753. end
  14754. `
  14755. menu
  14756. {
  14757. name 'CHARGEN_IMPORT'
  14758. modal
  14759. align center center
  14760. ignoreesc
  14761. onOpen
  14762. "
  14763. list_GUICG_20_2_idx = 0
  14764. "
  14765. label
  14766. {
  14767. area 0 0 864 710
  14768. mosaic 'GUIPOP46'
  14769. }
  14770. list
  14771. {
  14772. column
  14773. {
  14774. width 100
  14775. label
  14776. {
  14777. area 0 0 -1 -1
  14778. text lua "list_GUICG_20_2[rowNumber]"
  14779. text style "list"
  14780. pad 8 0 0 0
  14781. }
  14782. }
  14783. area 36 96 312 498
  14784. rowheight 34
  14785. table "list_GUICG_20_2"
  14786. var "list_GUICG_20_2_idx"
  14787. scrollbar 'GUISCRC'
  14788. action
  14789. "
  14790. Infinity_OnCharacterImportItemSelect(list_GUICG_20_2_idx - 1)
  14791. "
  14792. }
  14793. text
  14794. {
  14795. area 364 96 440 490
  14796. text 10963
  14797. text style normal
  14798. scrollbar 'GUISCRC'
  14799. }
  14800. button
  14801. {
  14802. on escape
  14803. area 196 650 230 40
  14804. bam GUIBUTMT
  14805. text "BACK_BUTTON"
  14806. text style "button"
  14807. action "Infinity_PopMenu('CHARGEN_IMPORT'); createCharScreen:OnCancelButtonClick()"
  14808. }
  14809. button
  14810. {
  14811. on return
  14812. area 438 650 230 40
  14813. bam GUIBUTMT
  14814. text lua "NextOrDone()"
  14815. text style "button"
  14816. clickable lua "list_GUICG_20_2_idx ~= 0"
  14817. action "Infinity_PopMenu('CHARGEN_IMPORT'); createCharScreen:OnDoneButtonClick()"
  14818. }
  14819.  
  14820. }
  14821.  
  14822. `
  14823. chargenExportCharacterEdit = ""
  14824. list_GUICG_21_2_idx = 0
  14825. `
  14826. menu
  14827. {
  14828. name 'CHARGEN_EXPORT'
  14829. modal
  14830. align center center
  14831. ignoreesc
  14832. onopen "chargenExportListId = 0"
  14833. label
  14834. {
  14835. area 0 0 864 710
  14836. mosaic 'GUIPOP46'
  14837. }
  14838. list
  14839. {
  14840. column
  14841. {
  14842. width 100
  14843. label
  14844. {
  14845. area 0 0 -1 -1
  14846. text lua "list_GUICG_21_2[rowNumber]"
  14847. text style "list"
  14848. pad 8 0 0 0
  14849. }
  14850. }
  14851. area 42 100 312 282
  14852. rowheight 18
  14853. table "list_GUICG_21_2"
  14854. var "chargenExportListId"
  14855. scrollbar 'GUISCRC'
  14856. action
  14857. "
  14858. createCharScreen:OnCharacterExportItemSelect(chargenExportListId - 1)
  14859. "
  14860. }
  14861. text
  14862. {
  14863. area 362 100 466 498
  14864. text 24461
  14865. text style "normal"
  14866.  
  14867. }
  14868. label
  14869. {
  14870. area 42 382 312 23
  14871. text "EXPORT_FILENAME_LABEL"
  14872. text style "label"
  14873. text color 3
  14874. }
  14875. label
  14876. {
  14877. area 42 405 312 51
  14878. rectangle 0
  14879. }
  14880. edit
  14881. {
  14882. name "chargenExportCharacterEditArea"
  14883. area 48 416 298 30
  14884. var chargenExportCharacterEdit
  14885. text style "edit"
  14886. maxlines 1
  14887. fill 112 111 111 64
  14888. }
  14889. button
  14890. {
  14891. on escape
  14892. area 196 650 230 40
  14893. bam GUIBUTMT
  14894. text "BACK_BUTTON"
  14895. text style "button"
  14896. action "Infinity_PopMenu('CHARGEN_EXPORT'); createCharScreen:OnCancelButtonClick()"
  14897. }
  14898. button
  14899. {
  14900. on return
  14901. area 438 650 230 40
  14902. bam GUIBUTMT
  14903. text "DONE_BUTTON"
  14904. text style "button"
  14905. action "Infinity_PopMenu('CHARGEN_EXPORT'); createCharScreen:OnDoneButtonClick()"
  14906. }
  14907.  
  14908. }
  14909. menu
  14910. {
  14911. name 'CHARGEN_DUALCLASS'
  14912. align center center
  14913. ignoreesc
  14914. label
  14915. {
  14916. area 0 0 864 710
  14917. mosaic guidcx
  14918. }
  14919. label
  14920. {
  14921. area 82 10 700 44
  14922. text "DUALCLASS_TITLE"
  14923. text style "title"
  14924. }
  14925. label
  14926. {
  14927. area 62 124 363 37
  14928. text lua "characters[currentID].name"
  14929. text style "label"
  14930. }
  14931. label
  14932. {
  14933. area 459 124 363 37
  14934. text lua "characters[currentID].class"
  14935. text style "label"
  14936. }
  14937. label
  14938. {
  14939. area 136 191 177 243
  14940. bitmap lua "characters[currentID].portrait"
  14941. }
  14942. text
  14943. {
  14944. area 481 194 336 407
  14945. text 10811 --dual class info
  14946. text style "normal"
  14947. scrollbar 'GUISCRC'
  14948. }
  14949. button
  14950. {
  14951. area 57 495 340 32
  14952. clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_CLASS"
  14953. bam GUIBUTWS
  14954. text "CLASS_BUTTON"
  14955. text style "button"
  14956. action
  14957. "
  14958. createCharScreen:OnMenuButtonClick()
  14959. "
  14960. }
  14961. button
  14962. {
  14963. area 57 528 340 32
  14964. clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_PROFICIENCIES"
  14965. bam GUIBUTWS
  14966. text "SKILLS_BUTTON"
  14967. text style "button"
  14968. action
  14969. "
  14970. createCharScreen:OnMenuButtonClick()
  14971. "
  14972. }
  14973. button
  14974. {
  14975. area 438 653 230 40
  14976. bam GUIBUTMT
  14977. clickable lua "createCharScreen:GetCurrentStep() == const.STEP_DUALCLASS_DONE"
  14978. text "DONE_BUTTON"
  14979. text style "button"
  14980. action
  14981. "
  14982. createCharScreen:OnDoneButtonClick()
  14983. "
  14984. }
  14985. button
  14986. {
  14987. on escape
  14988. area 196 653 230 40
  14989. clickable false
  14990. bam GUIBUTMT
  14991. text "BACK_BUTTON"
  14992. text style "button"
  14993. action
  14994. "
  14995. createCharScreen:OnCancelButtonClick()
  14996. "
  14997. }
  14998. }
  14999. `
  15000. difficulties =
  15001. {
  15002. {icon = "COLRSPRY", name = "DIFFICULTY_LABEL_STORYMODE", description = "DIFFICULTY_DESCRIPTION_STORYMODE"},
  15003. {icon = "CONTSHLF", name = "DIFFICULTY_LABEL_EASY", description = "DIFFICULTY_DESCRIPTION_EASY"},
  15004. {icon = "CONTSACK", name = "DIFFICULTY_LABEL_NORMAL", description = "DIFFICULTY_DESCRIPTION_NORMAL"},
  15005. {icon = "CONTGRND", name = "DIFFICULTY_LABEL_CORERULES", description = "DIFFICULTY_DESCRIPTION_CORERULES"},
  15006. {icon = "CONTBODY", name = "DIFFICULTY_LABEL_HARD", description = "DIFFICULTY_DESCRIPTION_HARD"},
  15007. {icon = "CONTSKL1", name = "DIFFICULTY_LABEL_INSANE", description = "DIFFICULTY_DESCRIPTION_INSANE"},
  15008. {icon = "CONTSKL2", name = "DIFFICULTY_LABEL_LEGACYOFBHAAL", description = "DIFFICULTY_DESCRIPTION_LEGACYOFBHAAL"},
  15009. }
  15010. fromSinglePlayer = false
  15011. fromMultiPlayer = false
  15012. function WhoYouGonnaCall()
  15013. fromSinglePlayer = (createCharScreen:GetEngineState() == 1 or createCharScreen:GetEngineState() == 7) and multiplayerScreen:GetEngineState() ~= 1
  15014. end
  15015. `
  15016. menu
  15017. {
  15018. name 'CHARGEN_DIFFICULTY'
  15019. modal
  15020. align center center
  15021. ignoreesc
  15022. onopen
  15023. "
  15024. currentDifficulty = 3
  15025. WhoYouGonnaCall()
  15026. "
  15027. label
  15028. {
  15029. area 0 0 864 710
  15030. mosaic 'GUIPOPF'
  15031. }
  15032. label
  15033. {
  15034. area 92 28 700 60
  15035. text "DIFFICULTY_TITLE"
  15036. text style "title"
  15037. }
  15038. list
  15039. {
  15040. column
  15041. {
  15042. width 15
  15043. label
  15044. {
  15045. area 20 5 60 60
  15046. bam "GUIDIFFS"
  15047. frame lua "rowNumber-1"
  15048. align center center
  15049. }
  15050. }
  15051. column
  15052. {
  15053. width 15
  15054. label
  15055. {
  15056. area 0 0 64 -1
  15057. text lua "t( difficulties[rowNumber].name )"
  15058. text style "label"
  15059. text align center center
  15060. text color B
  15061. }
  15062. }
  15063. column
  15064. {
  15065. width 70
  15066. label
  15067. {
  15068. area 10 0 -1 -1
  15069. text lua "t( difficulties[rowNumber].description )"
  15070. text style "label"
  15071. text point 12
  15072. text align left center
  15073. text color B
  15074. }
  15075. }
  15076. area 42 106 766 494
  15077. rowheight 69
  15078. table "difficulties"
  15079. var "currentDifficulty"
  15080. scrollbar 'GUISCRC'
  15081. action
  15082. "
  15083. "
  15084. }
  15085. button
  15086. {
  15087. on escape
  15088. area 74 632 230 40
  15089. bam GUIBUTMT
  15090. text 15416
  15091. text style "button"
  15092. action
  15093. "
  15094. Infinity_PopMenu()
  15095. if(createCharScreen:GetEngineState() == 7) then
  15096. --If we're in import character mode, go back to the import screen.
  15097. e:SelectEngine(startEngine)
  15098. Infinity_PopMenu()
  15099. startEngine:OnImportCharacterButtonClick()
  15100. end
  15101. "
  15102. }
  15103. button
  15104. {
  15105. area 586 632 230 40
  15106. bam GUIBUTMT
  15107. text lua "t('VENTURE_FORTH')"
  15108. text style "button"
  15109. enabled "fromSinglePlayer"
  15110. action
  15111. "
  15112. Infinity_PopMenu()
  15113. createCharScreen:AcceptCharacter(currentDifficulty)
  15114. "
  15115. }
  15116. button
  15117. {
  15118. area 586 632 230 40
  15119. bam GUIBUTMT
  15120. text 11973
  15121. text style "button"
  15122. enabled "fromMultiPlayer"
  15123. action
  15124. "
  15125. Infinity_PopMenu()
  15126. Infinity_PopMenu()
  15127. Infinity_PopMenu()
  15128. Infinity_PopMenu()
  15129.  
  15130. if connectionLocalNetworkGame == 1 then
  15131. connectionIsHosting = true
  15132. chooseNetworkProtocol(2)
  15133. end
  15134.  
  15135. fromMultiPlayer = false
  15136. mulitplayerPreexistingDifficulty = currentDifficulty
  15137. connectionScreen:OnNewGameButtonClick()
  15138. "
  15139. }
  15140. }
  15141.  
  15142. `
  15143. TEXT_popup_big = 0
  15144. `
  15145. menu
  15146. {
  15147. name 'POPUP_BIG'
  15148. align center center
  15149. modal
  15150. label
  15151. {
  15152. area 0 0 864 710
  15153. mosaic GUIPOPF
  15154. }
  15155. text
  15156. {
  15157. area 40 98 788 496
  15158. text lua "Infinity_FetchString(TEXT_popup_big)"
  15159. text style "label"
  15160. text align left top
  15161. scrollbar 'GUISCRC'
  15162. }
  15163. button
  15164. {
  15165. area 317 634 230 40
  15166. bam GUIBUTMT
  15167. text "DONE_BUTTON"
  15168. text style "button"
  15169. action
  15170. "
  15171. Infinity_PopMenu()
  15172. "
  15173. }
  15174. }
  15175.  
  15176.  
  15177. `
  15178. list_GUIMOVIE_0_0_idx = 0
  15179. `
  15180. menu
  15181. {
  15182. name 'MOVIES'
  15183. align center center
  15184.  
  15185. button
  15186. {
  15187. on escape
  15188. action
  15189. "
  15190. --Return to world screen on escape
  15191. e:SelectEngine(optionsScreen)
  15192. "
  15193. }
  15194. label
  15195. {
  15196. area 0 0 1024 768
  15197. mosaic "GUIMOVB"
  15198. }
  15199. label
  15200. {
  15201. area 321 74 386 44
  15202. text "MOVIES_TITLE"
  15203. text style "title"
  15204. }
  15205. list
  15206. {
  15207. column
  15208. {
  15209. width 100
  15210. label
  15211. {
  15212. area 0 0 384 18
  15213. text lua "list_GUIMOVIE_0_0[rowNumber].description"
  15214. text style "list"
  15215. pad 8 0 0 0
  15216. text align left center
  15217. }
  15218. }
  15219. area 318 128 390 316
  15220. rowheight 18
  15221. table "list_GUIMOVIE_0_0"
  15222. var "list_GUIMOVIE_0_0_idx"
  15223. scrollbar 'GUISCRC'
  15224. action
  15225. "
  15226. moviesScreen:OnMovieItemSelect(list_GUIMOVIE_0_0[list_GUIMOVIE_0_0_idx].movieCode)
  15227. "
  15228. }
  15229. button
  15230. {
  15231. area 366 470 300 40
  15232. bam GUIBUTWT
  15233. text "PLAY_MOVIE_BUTTON"
  15234. text style "button"
  15235. action "moviesScreen:OnPlayButtonClick()"
  15236. }
  15237. button
  15238. {
  15239. area 366 515 300 40
  15240. bam GUIBUTWT
  15241. text "CREDITS_MOVIE_BUTTON"
  15242. text style "button"
  15243. action "moviesScreen:OnCreditsButtonClick()"
  15244. }
  15245. button
  15246. {
  15247. area 366 558 300 40
  15248. bam GUIBUTWT
  15249. text "DONE_BUTTON"
  15250. text style "button"
  15251. action "moviesScreen:OnDoneButtonClick()"
  15252. }
  15253.  
  15254.  
  15255. }
  15256.  
  15257.  
  15258.  
  15259. `
  15260. --Multiplayer start.
  15261. mp_shownSessions = {}
  15262. selectedMp = 0
  15263. detailsStr = ""
  15264. passwordReq = 0
  15265. passwordMp = ""
  15266. connectionPlayerNameEdit = ""
  15267. connectionFilterNoPasswords = 0
  15268. connectionFilterNoFullGames = 0
  15269. selectedIndex = 0
  15270. connectionIsHosting = false
  15271.  
  15272. function connectionBuildGameList()
  15273. local index = 1
  15274. local count = 0
  15275. local entryOK = true
  15276. local foundSelected = false
  15277.  
  15278. for index = 1, #(mp_sessions), 1 do
  15279. entryOK = true
  15280. Infinity_GetPasswordRequired(index)
  15281. if mp_sessions[index] == nil then
  15282. entryOK = false
  15283. elseif mp_sessions[index]["flags"] == nil then
  15284. entryOK = false
  15285. elseif connectionFilterNoPasswords == 1 and passwordReq ~= 0 then
  15286. entryOK = false
  15287. elseif connectionFilterNoFullGames == 1 and mp_sessions[index]["players"] == 6 then
  15288. entryOK = false
  15289. end
  15290.  
  15291. if e:IsTouchUI() and mp_sessions[index]["version"] ~= "bgee-sod" then
  15292. entryOK = false
  15293. end
  15294.  
  15295. if entryOK == true then
  15296. count = count + 1
  15297. mp_shownSessions[count] = {}
  15298. mp_shownSessions[count]["actualIndex"] = index
  15299. mp_shownSessions[count]["updated_at"] = mp_sessions[index]["updated_at"]
  15300.  
  15301. if mp_sessions[index]['sessionIDString'] == selectedIndex then
  15302. selectedMp = count
  15303. foundSelected = true
  15304. end
  15305. end
  15306. end
  15307.  
  15308. local tableCount = #(mp_shownSessions)
  15309. while tableCount > count do
  15310. mp_shownSessions[tableCount] = nil
  15311. tableCount = tableCount - 1
  15312. end
  15313.  
  15314. if foundSelected == false then
  15315. selectedMp = 0
  15316. end
  15317. end
  15318. function chooseNetworkProtocol(num)
  15319. connectionScreen:SelectServiceProvider(num)
  15320. end
  15321. function joinGameEnabled()
  15322. if selectedMp <= 0 or mp_shownSessions[selectedMp]['actualIndex'] == nil then
  15323. return 0
  15324. else
  15325. return 1
  15326. end
  15327. end
  15328. function gameHasPassword(slot)
  15329. if(mp_sessions[mp_shownSessions[slot]["actualIndex"]] == nil) then
  15330. --if the session isn't loaded don't show anything.
  15331. return ""
  15332. end
  15333. Infinity_GetPasswordRequired(mp_shownSessions[slot]["actualIndex"])
  15334. if passwordReq ~= 0 then
  15335. ret = t("YES")
  15336. else
  15337. ret = t("NO")
  15338. end
  15339. return ret
  15340. end
  15341. function connectionGetGameName(slot)
  15342. ret = ""
  15343.  
  15344. ret = mp_sessions[mp_shownSessions[slot]["actualIndex"]]['name']
  15345.  
  15346. return ret
  15347. end
  15348. function connectionGetNumPlayers(slot)
  15349. ret = 0
  15350.  
  15351. ret = mp_sessions[mp_shownSessions[slot]["actualIndex"]]['players']
  15352.  
  15353. return ret
  15354. end
  15355. function connectionGetGameType(slot)
  15356. ret = ""
  15357.  
  15358. if mp_sessions[mp_shownSessions[slot]["actualIndex"]] ~= nil then
  15359. if mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bgee-main" then
  15360. ret = t("MAIN_GAME_LABEL")
  15361. elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bgee-bp" then
  15362. ret = t("ARENA_MODE_LABEL")
  15363. elseif mp_sessions[mp_shownSessions[slot]["actualIndex"]]["version"] == "bgee-sod" then
  15364. ret = t("EXPANSION_LABEL")
  15365. end
  15366. end
  15367.  
  15368. return ret
  15369. end
  15370.  
  15371. function matchMultiplayerGameType(gameVersion)
  15372. if gameVersion == "bgee-main" then
  15373. startEngine:OnSoAButtonClick(false)
  15374. e:CheckGUISong()
  15375. elseif gameVersion == "bgee-bp" then
  15376. startEngine:OnTBPButtonClick(false)
  15377. e:CheckGUISong()
  15378. elseif gameVersion == "bgee-sod" then
  15379. startEngine:OnCampaignButtonClick('SOD',false)
  15380. e:CheckGUISong()
  15381. end
  15382. end
  15383. `
  15384. menu
  15385. {
  15386. name 'CONNECTION'
  15387. align center center
  15388. onOpen
  15389. "
  15390. connectionFilterNoPasswords = 0
  15391. connectionFilterNoFullGames = 0
  15392. connectionIsHosting = false
  15393. connectionBuildGameList()
  15394.  
  15395. if connectionPlayerNameEdit == '' then
  15396. connectionSetDefaultGameSettings()
  15397. end
  15398. "
  15399. label -- Background
  15400. {
  15401. area 0 0 1024 768
  15402. mosaic GUIINVHB
  15403. }
  15404. label -- Title
  15405. {
  15406. area 174 12 700 40
  15407. text "JOIN_GAME_TITLE"
  15408. text style title
  15409. }
  15410. label
  15411. {
  15412. area 78 198 498 28
  15413. text lua "t('GAME_NAME_LABEL')"
  15414. text style "label_parchment"
  15415. align center center
  15416. }
  15417. label
  15418. {
  15419. area 576 198 84 28
  15420. text lua "t('PASSWORD_LABEL')"
  15421. text style "label_parchment"
  15422. align center center
  15423. }
  15424. label
  15425. {
  15426. area 660 198 70 28
  15427. text lua "t('PLAYERS_LABEL')"
  15428. text style "label_parchment"
  15429. align center center
  15430. }
  15431. label
  15432. {
  15433. area 730 198 186 28
  15434. text lua "t('GAME_TYPE_LABEL')"
  15435. text style "label_parchment"
  15436. align center center
  15437. }
  15438. list -- Multiplayer sessions
  15439. {
  15440. column
  15441. {
  15442. width 60
  15443. label
  15444. {
  15445. area 20 0 500 40
  15446. text lua "connectionGetGameName(rowNumber)"
  15447. text style "list_parchment"
  15448. align left center
  15449. }
  15450.  
  15451. }
  15452. column
  15453. {
  15454. width 10
  15455. label
  15456. {
  15457. area 20 0 210 40
  15458. text lua "gameHasPassword(rowNumber)"
  15459. text style "list_parchment"
  15460. align left center
  15461. }
  15462.  
  15463. }
  15464. column
  15465. {
  15466. width 10
  15467. label
  15468. {
  15469. area 20 0 210 40
  15470. text lua "connectionGetNumPlayers(rowNumber)"
  15471. text style "list_parchment"
  15472. align left center
  15473. }
  15474.  
  15475. }
  15476. column
  15477. {
  15478. width 20
  15479. label
  15480. {
  15481. area 20 0 210 40
  15482. text lua "connectionGetGameType(rowNumber)"
  15483. text style "list_parchment"
  15484. align left center
  15485. }
  15486.  
  15487. }
  15488.  
  15489. area 78 232 854 340
  15490.  
  15491. rowheight 44
  15492. table "mp_shownSessions"
  15493. var selectedMp
  15494. scrollbar 'GUISCRC'
  15495. action
  15496. "
  15497. selectedIndex = mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['sessionIDString']
  15498. "
  15499. }
  15500.  
  15501. label -- player name
  15502. {
  15503. area 312 70 210 40
  15504. text "PLAYER_NAME_LABEL"
  15505. text style "label"
  15506. }
  15507. label
  15508. {
  15509. area 308 104 218 44
  15510. fill 112 111 111 64
  15511. }
  15512. edit
  15513. {
  15514. name "ConnectionPlayerNameEditArea"
  15515. area 312 110 210 32
  15516. var connectionPlayerNameEdit
  15517. text style "edit"
  15518. maxlines 1
  15519. maxchars 32
  15520. }
  15521.  
  15522. label -- filter options
  15523. {
  15524. area 606 70 215 40
  15525. text style 'label'
  15526. text "CONNECTION_NOT_PASSWORD_PROTECTED_LABEL"
  15527. align left center
  15528. tooltip lua "t('CONNECTION_NO_PASSWORDS_TOOLTIP')"
  15529. }
  15530. button
  15531. {
  15532. area 562 77 32 32
  15533. bam ROUNDBUT
  15534. glow lua "connectionFilterNoPasswords"
  15535. scaleToClip
  15536. tooltip lua "t('CONNECTION_NO_PASSWORDS_TOOLTIP')"
  15537. action
  15538. "
  15539. connectionFilterNoPasswords = 1 - connectionFilterNoPasswords
  15540. connectionBuildGameList()
  15541. "
  15542. }
  15543. label
  15544. {
  15545. area 606 115 215 44
  15546. text style 'label'
  15547. text "CONNECTION_NOT_FULL_LABEL"
  15548. align left center
  15549. tooltip lua "t('CONNECTION_NO_FULL_GAMES_TOOLTIP')"
  15550. }
  15551. button
  15552. {
  15553. area 562 122 32 32
  15554. bam ROUNDBUT
  15555. glow lua "connectionFilterNoFullGames"
  15556. scaleToClip
  15557. tooltip lua "t('CONNECTION_NO_FULL_GAMES_TOOLTIP')"
  15558. action
  15559. "
  15560. connectionFilterNoFullGames = 1 - connectionFilterNoFullGames
  15561. connectionBuildGameList()
  15562. "
  15563. }
  15564.  
  15565. button -- Create game
  15566. {
  15567. area 56 110 230 40
  15568. bam GUIBUTMT
  15569. sequence 6
  15570. text "CONNECTION_CREATE_NEW_GAME_BUTTON"
  15571. text style "button"
  15572. action
  15573. "
  15574. Infinity_PushMenu('CONNECTION_CREATE')
  15575. "
  15576. }
  15577. button -- Direct Connect
  15578. {
  15579. area 78 610 230 40
  15580. bam GUIBUTMT
  15581. sequence 6
  15582. text "CONNECTION_DIRECT_CONNECTION_BUTTON"
  15583. text style "button"
  15584. tooltip lua "t('CONNECTION_DIRECT_CONNECT_TOOLTIP')"
  15585. action
  15586. "
  15587. connectionIsHosting = false
  15588. chooseNetworkProtocol(2)
  15589. "
  15590. }
  15591. button -- refresh
  15592. {
  15593. area 886 98 70 66
  15594. bam 'GUMPBUTX'
  15595. sequence 2
  15596. align center center
  15597. tooltip lua "t('CONNECTION_REFRESH_TOOLTIP')"
  15598. action
  15599. "
  15600. selectedMp = nil
  15601. mp_shownSessions = {}
  15602. mp_sessions = {}
  15603. connectionScreen:ClearSessions()
  15604. "
  15605. }
  15606.  
  15607. button -- Join game
  15608. {
  15609. area 720 702 230 40
  15610. bam GUIBUTMT
  15611. sequence 6
  15612. text "JOIN_BUTTON"
  15613. text style "button"
  15614. clickable lua "joinGameEnabled()"
  15615. action
  15616. "
  15617. Infinity_GetPasswordRequired(mp_shownSessions[selectedMp]['actualIndex'])
  15618. if string.find(connectionPlayerNameEdit, '%S') == nil then
  15619. Infinity_PushMenu('CONNECTION_NAME')
  15620. elseif passwordReq == 0 then
  15621. Infinity_PopMenu();
  15622. Infinity_PopMenu();
  15623. mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['password'] = passwordMp
  15624. Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex'])
  15625. else
  15626. Infinity_PushMenu('CONNECTION_PASSWORD')
  15627. end
  15628. "
  15629. }
  15630. button -- Back/ Log out
  15631. {
  15632. area 78 702 230 40
  15633. bam GUIBUTMT
  15634. sequence 0
  15635. text "BACK_BUTTON"
  15636. text style "button"
  15637. on escape
  15638. action
  15639. "
  15640. Infinity_PopMenu();
  15641. connectionScreen:OnMainCancelButtonClick()
  15642. "
  15643. }
  15644. }
  15645. `
  15646. connectionTCPIPEdit = ""
  15647. `
  15648. menu
  15649. {
  15650. name 'CONNECTION_IP'
  15651. modal
  15652. align center center
  15653.  
  15654. onopen "Infinity_FocusTextEdit('ConnectionTCPIPEditArea')"
  15655. label
  15656. {
  15657. area 0 0 657 234
  15658. mosaic GUIERR6
  15659. }
  15660. label --Title
  15661. {
  15662. area 42 20 572 64
  15663. text 20681
  15664. text style "label"
  15665. }
  15666. button
  15667. {
  15668. area 370 170 230 40
  15669. bam GUIBUTMT
  15670. sequence 0
  15671. text "DONE_BUTTON"
  15672. text style "button"
  15673. on return
  15674. clickable lua "connectionScreen:IsValidAddress(connectionTCPIPEdit)"
  15675. action
  15676. "
  15677. Infinity_PopMenu();
  15678. connectionScreen:JoinGameIPAddress(connectionTCPIPEdit)
  15679. "
  15680. }
  15681. button
  15682. {
  15683. area 88 170 230 40
  15684. bam GUIBUTMT
  15685. sequence 1
  15686. text "CANCEL_BUTTON"
  15687. text style "button"
  15688. on escape
  15689. action
  15690. "
  15691. Infinity_PopMenu();
  15692. chooseNetworkProtocol(1)
  15693. "
  15694. }
  15695.  
  15696. label
  15697. {
  15698. area 56 84 544 44
  15699. fill 112 111 111 64
  15700. }
  15701.  
  15702. edit
  15703. {
  15704. name "ConnectionTCPIPEditArea"
  15705. area 64 90 528 28
  15706. var connectionTCPIPEdit
  15707. text style "edit"
  15708. maxlines 1
  15709. }
  15710. }
  15711. `
  15712. connection = {}
  15713. connectionSessionNameEdit = ""
  15714. connectionSessionPasswordEdit = ""
  15715. connectionPasswordProtected = 0
  15716. connectionLocalNetworkGame = 0
  15717.  
  15718. function connectionCreateGameClickable()
  15719. local ret = string.find(connectionPlayerNameEdit, '%S') ~= nil and string.find(connectionSessionNameEdit, '%S') ~= nil
  15720.  
  15721. if connectionPasswordProtected == 1 then
  15722. ret = ret and string.find(connectionSessionPasswordEdit, '%S') ~= nil
  15723. end
  15724.  
  15725. return ret
  15726. end
  15727. function connectionSetDefaultGameSettings()
  15728. local player = t("MULTIPLAYER_DEFAULT_PLAYER")
  15729. local game = t("MULTIPLAYER_ENTER_GAME_NAME")
  15730. local pass = t("MULTIPLAYER_ENTER_GAME_PASSWORD")
  15731.  
  15732. if connectionPlayerNameEdit == "" then
  15733. connectionPlayerNameEdit = Infinity_GetINIString('Multiplayer', 'Player Name', player)
  15734. Infinity_SetINIValue('Multiplayer', 'Player Name', connectionPlayerNameEdit)
  15735. end
  15736.  
  15737. if connectionSessionPasswordEdit == "" then
  15738. connectionSessionPasswordEdit = Infinity_GetINIString('Multiplayer', 'Session Password', pass)
  15739. Infinity_SetINIValue('Multiplayer', 'Session Password', connectionSessionPasswordEdit)
  15740. end
  15741.  
  15742. if connectionSessionNameEdit == "" then
  15743. connectionSessionNameEdit = Infinity_GetINIString('Multiplayer', 'Session Name', game)
  15744. Infinity_SetINIValue('Multiplayer', 'Session Name', connectionSessionNameEdit)
  15745. end
  15746.  
  15747. if connectionSessionPasswordEdit ~= "" then
  15748. connectionPasswordProtected = 1
  15749. else
  15750. connectionPasswordProtected = 0
  15751. end
  15752.  
  15753. if connectionScreen:HasServiceProvider() then
  15754. connectionLocalNetworkGame = 0
  15755. else
  15756. connectionLocalNetworkGame = 1
  15757. end
  15758. end
  15759. `
  15760. menu
  15761. {
  15762. name 'CONNECTION_CREATE'
  15763. align center center
  15764. ignoreEsc
  15765. modal
  15766.  
  15767. onOpen
  15768. "
  15769. connectionSetDefaultGameSettings()
  15770. "
  15771.  
  15772. label
  15773. {
  15774. area 0 0 664 666
  15775. mosaic "RECENTEV"
  15776. }
  15777. label
  15778. {
  15779. area 104 70 462 45
  15780. text style 'title'
  15781. text "CREATEGAME_TITLE"
  15782. }
  15783.  
  15784. label -- player
  15785. {
  15786. area 100 122 462 45
  15787. text style 'label'
  15788. text "PLAYER_NAME_LABEL"
  15789. }
  15790. label
  15791. {
  15792. area 164 167 344 45
  15793. fill 112 111 111 64
  15794. }
  15795. edit
  15796. {
  15797. name "connectionPlayerNameEditArea"
  15798. area 170 174 334 32
  15799. var connectionPlayerNameEdit
  15800. text style "edit"
  15801. maxlines 1
  15802. maxchars 32
  15803.  
  15804. }
  15805.  
  15806. label -- session
  15807. {
  15808. area 100 221 462 45
  15809. text style 'label'
  15810. text "SESSION_NAME_LABEL"
  15811. }
  15812. label
  15813. {
  15814. area 164 266 344 44
  15815. fill 112 111 111 64
  15816. }
  15817. edit
  15818. {
  15819. name "connectionSessionNameEditArea"
  15820. area 170 272 334 32
  15821. var connectionSessionNameEdit
  15822. text style "edit"
  15823. maxlines 1
  15824. }
  15825.  
  15826.  
  15827. text -- password option
  15828. {
  15829. area 280 321 241 40
  15830. text style 'label'
  15831. text "CONNECTION_PASSWORD_PROTECTED"
  15832. tooltip lua "t('CONNECTION_PASSWORD_PROTECTED_TOOLTIP')"
  15833. align left center
  15834. }
  15835. button
  15836. {
  15837. area 237 328 32 32
  15838. bam ROUNDBUT
  15839. glow lua "connectionPasswordProtected"
  15840. scaleToClip
  15841. tooltip lua "t('CONNECTION_PASSWORD_PROTECTED_TOOLTIP')"
  15842. action
  15843. "
  15844. connectionPasswordProtected = 1 - connectionPasswordProtected
  15845. if connectionPasswordProtected == 1 then
  15846. Infinity_FocusTextEdit('connectionSessionPasswordEditArea')
  15847. end
  15848. "
  15849. }
  15850.  
  15851. text -- local option
  15852. {
  15853. area 280 366 241 40
  15854. text style 'label'
  15855. text "CONNECTION_LOCAL_NETWORK_GAME"
  15856. tooltip lua "t('CONNECTION_LOCAL_NETWORK_GAME_TOOLTIP')"
  15857. align left center
  15858. }
  15859. button
  15860. {
  15861. area 237 373 32 32
  15862. bam ROUNDBUT
  15863. glow lua "connectionLocalNetworkGame"
  15864. scaleToClip
  15865. tooltip lua "t('CONNECTION_LOCAL_NETWORK_GAME_TOOLTIP')"
  15866. action
  15867. "
  15868. if connectionScreen:HasServiceProvider() then
  15869. connectionLocalNetworkGame = 1 - connectionLocalNetworkGame
  15870. end
  15871. "
  15872. }
  15873.  
  15874. label -- password
  15875. {
  15876. area 100 416 462 45
  15877. text style 'label'
  15878. text "CHOOSE_PASSWORD_LABEL"
  15879. enabled connectionPasswordProtected
  15880. }
  15881. label
  15882. {
  15883. area 164 461 344 43
  15884. fill 112 111 111 64
  15885. enabled connectionPasswordProtected
  15886. }
  15887. edit
  15888. {
  15889. name "connectionSessionPasswordEditArea"
  15890. area 170 466 334 32
  15891. var connectionSessionPasswordEdit
  15892. text style "edit"
  15893. maxlines 1
  15894. enabled connectionPasswordProtected
  15895. }
  15896. button
  15897. {
  15898. clickable lua "connectionCreateGameClickable()"
  15899. area 236 572 200 40
  15900. bam 'GUIBUTNT'
  15901. text style "button"
  15902. text "CREATEGAME_BUTTON"
  15903. action
  15904. "
  15905. local stringStart = string.find(connectionPlayerNameEdit, '%S');
  15906. connectionPlayerNameEdit = string.sub(connectionPlayerNameEdit, stringStart, string.len(connectionPlayerNameEdit))
  15907. stringStart = string.find(connectionSessionNameEdit, '%S');
  15908. connectionSessionNameEdit = string.sub(connectionSessionNameEdit, stringStart, string.len(connectionSessionNameEdit))
  15909.  
  15910. if connectionPasswordProtected == 1 then
  15911. stringStart = string.find(connectionSessionPasswordEdit, '%S');
  15912. connectionSessionPasswordEdit = string.sub(connectionSessionPasswordEdit, stringStart, string.len(connectionSessionPasswordEdit))
  15913. end
  15914.  
  15915. if connectionPasswordProtected == 0 then
  15916. connectionSessionPasswordEdit = ''
  15917. end
  15918.  
  15919. Infinity_PushMenu('CONNECTION_NEWORSAVED')
  15920. "
  15921. }
  15922. button
  15923. {
  15924. on escape
  15925. area 236 528 200 40
  15926. bam 'GUIBUTNT'
  15927. text style "button"
  15928. text "BACK_BUTTON"
  15929. action
  15930. "
  15931. Infinity_PopMenu()
  15932. "
  15933. }
  15934. }
  15935. menu
  15936. {
  15937. name 'CONNECTION_NEWORSAVED'
  15938. align center center
  15939. modal
  15940.  
  15941. label
  15942. {
  15943. area 0 0 664 668
  15944. mosaic "RECENTEV"
  15945. }
  15946. label
  15947. {
  15948. area 104 70 460 48
  15949. text style 'title'
  15950. text "CONNECTION_NEW_OR_SAVED_GAME_TITLE"
  15951. }
  15952. label
  15953. {
  15954. area 130 140 392 45
  15955. text style 'label'
  15956. text "CONNECTION_SELECT_GAME_TYPE_LABEL"
  15957. }
  15958.  
  15959. button
  15960. {
  15961. bam GUIOSW
  15962. on esc
  15963. area 614 7 44 44
  15964. sequence 2
  15965. action
  15966. "
  15967. Infinity_PopMenu()
  15968. "
  15969. }
  15970.  
  15971. button
  15972. {
  15973. area 210 250 237 66
  15974. bam 'GUIBUTST'
  15975. text style "button"
  15976. text "NEW_GAME_BUTTON"
  15977. tooltip lua "t('CONNECTION_NEW_GAME_TOOLTIP')"
  15978. action
  15979. "
  15980. fromMultiPlayer = true
  15981. Infinity_PushMenu('CHARGEN_DIFFICULTY')
  15982. "
  15983. }
  15984. button
  15985. {
  15986. area 210 332 237 66
  15987. bam 'GUIBUTST'
  15988. text style "button"
  15989. text "LOAD_BUTTON"
  15990. tooltip lua "t('CONNECTION_LOAD_GAME_TOOLTIP')"
  15991. action
  15992. "
  15993. Infinity_PopMenu()
  15994. Infinity_PopMenu()
  15995. Infinity_PopMenu()
  15996.  
  15997. if connectionLocalNetworkGame == 1 then
  15998. connectionIsHosting = true
  15999. chooseNetworkProtocol(2)
  16000. end
  16001.  
  16002. connectionScreen:OnLoadGameButtonClick()
  16003. "
  16004. }
  16005.  
  16006. button
  16007. {
  16008. on escape
  16009. area 236 572 200 40
  16010. bam 'GUIBUTNT'
  16011. text style "button"
  16012. text "BACK_BUTTON"
  16013. action
  16014. "
  16015. Infinity_PopMenu()
  16016. "
  16017. }
  16018. }
  16019. `
  16020. connectionPasswordPasswordEdit = ""
  16021. `
  16022. menu
  16023. {
  16024. name 'CONNECTION_PASSWORD'
  16025. align center center
  16026. modal
  16027. onOpen
  16028. "
  16029. if mp_sessions[selectedMp]['name'] == Infinity_GetINIString('Multiplayer', 'Session Name', '') then
  16030. connectionPasswordPasswordEdit = Infinity_GetINIString('Multiplayer', 'Session Password', '')
  16031. else
  16032. connectionPasswordPasswordEdit = ''
  16033. end
  16034. Infinity_FocusTextEdit('connectionPasswordPasswordEditArea')
  16035. "
  16036.  
  16037. label
  16038. {
  16039. area 0 0 658 240
  16040. mosaic "GUIERR6"
  16041. }
  16042. label
  16043. {
  16044. area 22 14 606 45
  16045. text style 'title'
  16046. text "PASSWORD_REQUIRED_LABEL"
  16047. }
  16048. label
  16049. {
  16050. area 22 59 606 33
  16051. text style 'label'
  16052. text "ENTER_PASSWORD_LABEL"
  16053. }
  16054.  
  16055. button
  16056. {
  16057. bam GUIOSW
  16058. on esc
  16059. area 614 0 44 44
  16060. sequence 2
  16061. action
  16062. "
  16063. Infinity_PopMenu()
  16064. "
  16065. }
  16066.  
  16067. edit
  16068. {
  16069. name "connectionPasswordPasswordEditArea"
  16070. area 22 92 606 50
  16071. var connectionPasswordPasswordEdit
  16072. text style "edit"
  16073. text align center center
  16074. maxlines 1
  16075. fill 112 111 111 64
  16076. action
  16077. "
  16078. --On return pressed
  16079. if (key_pressed == 13) then
  16080. local stringStart = string.find(connectionNameNameEdit, '%S')
  16081. if stringStart ~= nil then
  16082. local stringStart = string.find(connectionPasswordPasswordEdit, '%S')
  16083. mp_sessions[selectedMp]['password'] = string.sub(connectionPasswordPasswordEdit, stringStart, string.len(connectionPasswordPasswordEdit) )
  16084. Infinity_PopMenu()
  16085. Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex'])
  16086. end
  16087. return -1
  16088. end
  16089. return 1
  16090. "
  16091. }
  16092.  
  16093. button
  16094. {
  16095. area 343 170 230 40
  16096. bam 'GUIBUTMT'
  16097. text style "button"
  16098. text "DONE_BUTTON"
  16099. clickable lua "connectionPasswordPasswordEdit ~='' and string.find(connectionPasswordPasswordEdit, '%S') ~= nil"
  16100. action
  16101. "
  16102. Infinity_PopMenu();
  16103. local stringStart = string.find(connectionPasswordPasswordEdit, '%S')
  16104. mp_sessions[selectedMp]['password'] = string.sub(connectionPasswordPasswordEdit, stringStart, string.len(connectionPasswordPasswordEdit) )
  16105. Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex'])
  16106. "
  16107. }
  16108.  
  16109. button
  16110. {
  16111. on escape
  16112. area 79 170 230 40
  16113. bam 'GUIBUTMT'
  16114. text style "button"
  16115. text "BACK_BUTTON"
  16116. action
  16117. "
  16118. Infinity_PopMenu()
  16119. "
  16120. }
  16121. }
  16122. `
  16123. connectionNameNameEdit = ""
  16124. `
  16125. menu
  16126. {
  16127. name 'CONNECTION_NAME'
  16128. align center center
  16129. modal
  16130. onOpen
  16131. "
  16132. connectionNameNameEdit = ''
  16133. Infinity_FocusTextEdit('connectionNameNameEditArea')
  16134. "
  16135.  
  16136. label
  16137. {
  16138. area 0 0 658 240
  16139. mosaic "GUIERR6"
  16140. }
  16141. label
  16142. {
  16143. area 12 16 632 70
  16144. text style 'title'
  16145. text "PLAYER_NAME_LABEL"
  16146. }
  16147.  
  16148. button
  16149. {
  16150. bam GUIOSW
  16151. on esc
  16152. area 614 0 44 44
  16153. sequence 2
  16154. action
  16155. "
  16156. Infinity_PopMenu()
  16157. "
  16158. }
  16159.  
  16160. edit
  16161. {
  16162. name "connectionNameNameEditArea"
  16163. area 22 92 606 50
  16164. var connectionNameNameEdit
  16165. text style "edit"
  16166. text align center center
  16167. maxlines 1
  16168. fill 112 111 111 64
  16169. action
  16170. "
  16171. --On return pressed
  16172. if (key_pressed == 13) then
  16173. local stringStart = string.find(connectionNameNameEdit, '%S')
  16174. if stringStart ~= nil then
  16175. connectionPlayerNameEdit = string.sub(connectionNameNameEdit, stringStart, string.len(connectionNameNameEdit) )
  16176. Infinity_PopMenu()
  16177.  
  16178. Infinity_GetPasswordRequired(mp_shownSessions[selectedMp]['actualIndex'])
  16179. if passwordReq == 0 then
  16180. Infinity_PopMenu();
  16181. Infinity_PopMenu();
  16182. mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['password'] = passwordMp
  16183. Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex'])
  16184. else
  16185. Infinity_PushMenu('CONNECTION_PASSWORD')
  16186. end
  16187. end
  16188. return -1
  16189. end
  16190. return 1
  16191. "
  16192. }
  16193.  
  16194. button
  16195. {
  16196. area 343 170 230 40
  16197. bam 'GUIBUTMT'
  16198. text style "button"
  16199. text "DONE_BUTTON"
  16200. clickable lua "connectionNameNameEdit ~='' and string.find(connectionNameNameEdit, '%S') ~= nil"
  16201. action
  16202. "
  16203. Infinity_PopMenu();
  16204. local stringStart = string.find(connectionNameNameEdit, '%S')
  16205. connectionPlayerNameEdit = string.sub(connectionNameNameEdit, stringStart, string.len(connectionNameNameEdit) )
  16206.  
  16207. Infinity_GetPasswordRequired(mp_shownSessions[selectedMp]['actualIndex'])
  16208. if passwordReq == 0 then
  16209. Infinity_PopMenu();
  16210. Infinity_PopMenu();
  16211. mp_sessions[mp_shownSessions[selectedMp]['actualIndex']]['password'] = passwordMp
  16212. Infinity_JoinMultiplayerGame(mp_shownSessions[selectedMp]['actualIndex'])
  16213. else
  16214. Infinity_PushMenu('CONNECTION_PASSWORD')
  16215. end
  16216. "
  16217. }
  16218.  
  16219. button
  16220. {
  16221. on escape
  16222. area 79 170 230 40
  16223. bam 'GUIBUTMT'
  16224. text style "button"
  16225. text "BACK_BUTTON"
  16226. action
  16227. "
  16228. Infinity_PopMenu()
  16229. "
  16230. }
  16231. }
  16232. menu
  16233. {
  16234. name 'CONNECTION_PLAYERNAME'
  16235. align center center
  16236. ignoreEsc
  16237. modal
  16238.  
  16239. onOpen
  16240. "
  16241. connectionPlayerNameEdit = Infinity_GetINIString('Multiplayer', 'Player Name', 'Player Name')
  16242. Infinity_FocusTextEdit('connectionPlayerNameEditArea')
  16243. "
  16244. label
  16245. {
  16246. area 0 0 512 651
  16247. mosaic "GUICONNB"
  16248. }
  16249. label
  16250. {
  16251. area 83 59 338 32
  16252. text style "label"
  16253. text "CURRENT_PLAYERS_LABEL"
  16254. }
  16255. label
  16256. {
  16257. area 83 446 338 32
  16258. text style "label"
  16259. text "PLAYER_NAME_LABEL"
  16260. }
  16261.  
  16262. list
  16263. {
  16264. column
  16265. {
  16266. width 100
  16267. label
  16268. {
  16269. area 0 0 -1 -1
  16270. text lua "connection.currentPlayers[rowNumber].name"
  16271. text style "edit"
  16272. align center center
  16273. }
  16274. }
  16275.  
  16276. action
  16277. "
  16278. "
  16279.  
  16280. rowheight 50
  16281. area 83 99 350 338
  16282. table "connection.currentPlayers"
  16283. var connectionSelectedPlayer
  16284. }
  16285.  
  16286. edit
  16287. {
  16288. name "connectionPlayerNameEditArea"
  16289. area 83 479 338 32
  16290. var connectionPlayerNameEdit
  16291. text style "edit"
  16292. text align center center
  16293. maxlines 1
  16294. maxchars 32
  16295. fill 112 111 111 64
  16296. }
  16297. button
  16298. {
  16299. clickable lua "connectionPlayerNameEdit ~= ''"
  16300. area 150 535 230 40
  16301. bam GUIBUTMT
  16302. sequence 0
  16303. text "DONE_BUTTON"
  16304. text style "button"
  16305. on return
  16306. action
  16307. "
  16308. Infinity_PopMenu();
  16309. Infinity_PopMenu();
  16310. connectionScreen:SetPlayerName(connectionPlayerNameEdit)
  16311. "
  16312. }
  16313. }
  16314.  
  16315. menu
  16316. {
  16317. name 'CONNECTION_JOINING'
  16318. modal
  16319. align center center
  16320.  
  16321. label
  16322. {
  16323. area 0 0 657 234
  16324. mosaic GUIERR6
  16325. }
  16326. label --Title
  16327. {
  16328. area 30 20 594 124
  16329. text 20274
  16330. text style "label"
  16331. }
  16332. button
  16333. {
  16334. area 222 170 230 40
  16335. bam GUIBUTMT
  16336. sequence 0
  16337. text "CANCEL_BUTTON"
  16338. text style "button"
  16339. on escape
  16340. action
  16341. "
  16342. Infinity_PopMenu();
  16343. "
  16344. }
  16345. }
  16346. menu
  16347. {
  16348. name 'CONNECTION_ERROR'
  16349. modal
  16350. align center center
  16351.  
  16352. label
  16353. {
  16354. area 0 0 657 234
  16355. mosaic GUIERR6
  16356. }
  16357. label --Title
  16358. {
  16359. area 30 20 600 64
  16360. text lua "Infinity_FetchString(CONNECTION_ERROR_MESSAGE)"
  16361. text style "label"
  16362. }
  16363. button
  16364. {
  16365. area 222 170 230 40
  16366. bam GUIBUTMT
  16367. sequence 0
  16368. text "CANCEL_BUTTON"
  16369. text style "button"
  16370. on escape
  16371. action
  16372. "
  16373. Infinity_PopMenu();
  16374. "
  16375. }
  16376. }
  16377.  
  16378. menu
  16379. {
  16380. name 'CONNECTION_WAITING_FOR_PROVIDER'
  16381. modal
  16382. align center center
  16383.  
  16384. label
  16385. {
  16386. area 0 0 657 234
  16387. mosaic GUIERR6
  16388. }
  16389. label --Title
  16390. {
  16391. area 30 20 600 122
  16392. text "CONNECTION_FINDING_DEVICES"
  16393. text style "label"
  16394. }
  16395. button
  16396. {
  16397. area 44 170 234 40
  16398. bam GUIBUTMT
  16399. sequence 0
  16400. text "CANCEL_BUTTON"
  16401. text style "button"
  16402. on escape
  16403. action
  16404. "
  16405. Infinity_PopMenu('CONNECTION_WAITING_FOR_PROVIDER')
  16406. Infinity_PopMenu('CONNECTION');
  16407. connectionScreen:OnMainCancelButtonClick()
  16408. "
  16409. }
  16410. button
  16411. {
  16412. area 404 170 230 40
  16413. bam GUIBUTMT
  16414. sequence 0
  16415. text "CONNECTION_LOCAL_NETWORK_GAME"
  16416. text style "button"
  16417. on return
  16418. action
  16419. "
  16420. Infinity_PopMenu('CONNECTION_WAITING_FOR_PROVIDER')
  16421. connectionScreen:StopConnectingToProvider()
  16422. "
  16423. }
  16424. }
  16425.  
  16426. menu
  16427. {
  16428. name 'CONNECTION_WAITING_FOR_SERVER'
  16429. modal
  16430. align center center
  16431.  
  16432. label
  16433. {
  16434. area 0 0 657 234
  16435. mosaic GUIERR6
  16436. }
  16437. label --Title
  16438. {
  16439. area 30 20 600 122
  16440. text "CONNECTION_WAITING_FOR_SERVER"
  16441. text style "label"
  16442. }
  16443. button
  16444. {
  16445. area 216 166 202 40
  16446. bam GUIBUTNT
  16447. sequence 0
  16448. text "CANCEL_BUTTON"
  16449. text style "button"
  16450. on escape
  16451. action
  16452. "
  16453. Infinity_PopMenu('CONNECTION_WAITING_FOR_SERVER')
  16454. connectionScreen:CancelJoinGame();
  16455. "
  16456. }
  16457. }
  16458.  
  16459. `
  16460. function getCampaignBackground()
  16461. local campaign = startEngine:GetCampaign()
  16462. return startCampaignData[campaign].background
  16463. end
  16464. `
  16465. menu
  16466. {
  16467. name 'BACKGROUND'
  16468. align center center
  16469. label
  16470. {
  16471. area 0 0 3840 2160
  16472. bam "4KBACK"
  16473. frame lua "getCampaignBackground()"
  16474. }
  16475. }
  16476.  
  16477. `
  16478. multiplayer = {}
  16479. mpChatEdit = ""
  16480. mpHelpTextString = ""
  16481. mpModifyingCharacter = -1
  16482. mpErrorText = -1
  16483. mpErrorState = -1
  16484. text_GUIMP_0_25 = ""
  16485. text_GUIMP_0_25_lines = 0
  16486. multiplayerInPermission = false
  16487. multiplayerInPermissionForPlayer = 0
  16488.  
  16489. multiplayerSessionName = ""
  16490. multiplayerSaveName = ""
  16491. multiplayerChapter = ""
  16492. multiplayerTimePlayed = ""
  16493. multiplayerDifficultyLabel = ""
  16494. multiplayerDifficultyImage = 0
  16495. mulitplayerPreexistingDifficulty = 0;
  16496.  
  16497. multiplayerLocalPlayerID = 1
  16498.  
  16499. multiplayerFromInGame = false
  16500.  
  16501. mpaCharacters =
  16502. {
  16503. {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"},
  16504. {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"},
  16505. {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"},
  16506. {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"},
  16507. {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"},
  16508. {ready = false, name = "", class = "", player = 1, portrait = "NOPORTLS", inprogress = false, color = "0xffffff"}
  16509. }
  16510.  
  16511. mpaPlayers =
  16512. {
  16513. {name = "", id = 0, color = "0xfff600"},
  16514. {name = "", id = 0, color = "0xff0000"},
  16515. {name = "", id = 0, color = "0x000cff"},
  16516. {name = "", id = 0, color = "0x1eff00"},
  16517. {name = "", id = 0, color = "0x00fcff"},
  16518. {name = "", id = 0, color = "0xff00f6"}
  16519. }
  16520.  
  16521. function updateMultiplayerPlayerSlot(slot,setting,value)
  16522. if multiplayerLocalPlayerID == 1 and setting == "name" and mpaPlayers[slot][setting] == "" and value ~= "" then
  16523. mpaPlayers[slot][setting] = value
  16524. broadcastPlayerAdded(slot)
  16525. elseif multiplayerLocalPlayerID == 1 and setting == "name" and mpaPlayers[slot][setting] ~= "" and value == "" then
  16526. broadcastPlayerRemoved(slot)
  16527. mpaPlayers[slot][setting] = value
  16528. else
  16529. mpaPlayers[slot][setting] = value
  16530. end
  16531. end
  16532. function updateMultiplayerCharacterSlot(slot,setting,value)
  16533. if multiplayerLocalPlayerID == 1 and setting == "color" and mpaCharacters[slot][setting] == "0xffffff" and value ~= "0xffffff" then
  16534. mpaCharacters[slot][setting] = value
  16535. broadcastCharacterAdded(slot)
  16536. elseif multiplayerLocalPlayerID == 1 and setting == "ready" and mpaCharacters[slot][setting] == false and value == true then
  16537. broadcastCharacterReady(slot)
  16538. mpaCharacters[slot][setting] = value
  16539. elseif multiplayerLocalPlayerID == 1 and setting == "ready" and mpaCharacters[slot][setting] == true and value == false then
  16540. broadcastCharacterNotReady(slot)
  16541. mpaCharacters[slot][setting] = value
  16542. else
  16543. mpaCharacters[slot][setting] = value
  16544. end
  16545. end
  16546.  
  16547. function clearCharacterSlot(slot, announce)
  16548. if announce == true and mpaCharacters[slot]['name'] ~= "" then
  16549. broadcastCharacterRemoved(slot)
  16550. end
  16551. mpaCharacters[slot]['ready'] = false
  16552. mpaCharacters[slot]['name'] = ""
  16553. mpaCharacters[slot]['class'] = ""
  16554. mpaCharacters[slot]['portrait'] = "NOPORTLS"
  16555. mpaCharacters[slot]['inprogress'] = false
  16556. mpaCharacters[slot]['color'] = "0xffffff"
  16557. end
  16558.  
  16559. function clearPlayerSlot(slot, announce)
  16560. if announce == true and mpaPlayers[slot]["name"] ~= "" then
  16561. broadcastPlayerRemoved(slot)
  16562. end
  16563. mpaPlayers[slot]["name"] = ""
  16564. mpaPlayers[slot]["id"] = 0
  16565. end
  16566.  
  16567. function getMultiplayerCharacterName(slot, newLine, getClass)
  16568. local ret = ""
  16569. local separator = ", "
  16570.  
  16571. if newLine == true then
  16572. separator = "\n"
  16573. end
  16574.  
  16575. if mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID == mpaCharacters[slot]["player"] then
  16576. ret = t("MULTIPLAYER_CREATE_CHARACTER_MESSAGE")
  16577. elseif mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID ~= mpaCharacters[slot]["player"] and mpaCharacters[slot]["inprogress"] == false then
  16578. ret = t("MULTIPLAYER_EMPTY_CHARACTER_MESSAGE")
  16579. elseif mpaCharacters[slot]["inprogress"] == true and mpaCharacters[slot]["class"] == "" then
  16580. setStringTokenLua("<PLAYER_NAME_1>",getMultiplayerPlayerName(mpaCharacters[slot]["player"], false, true))
  16581. setStringTokenLua("<SEPERATOR>",separator)
  16582. ret = t("MULTIPLAYER_CREATING_CHARACTER_MESSAGE")
  16583. removeStringTokenLua("<SEPERATOR>")
  16584. removeStringTokenLua("<PLAYER_NAME_1>")
  16585. elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" then
  16586. ret = "^0xff"..mpaCharacters[slot]["color"]..mpaCharacters[slot]["name"].."^-"
  16587. if getClass == true then
  16588. ret = ret..separator..mpaCharacters[slot]["class"]
  16589. end
  16590. end
  16591.  
  16592. return ret
  16593. end
  16594. function getMultiplayerCharacterButtonText(slot)
  16595. local ret = ""
  16596.  
  16597. if mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID == mpaCharacters[slot]["player"] then
  16598. ret = t("CREATE_CHAR_BUTTON")
  16599. elseif mpaCharacters[slot]["name"] == "" and multiplayerLocalPlayerID ~= mpaCharacters[slot]["player"] then
  16600. ret = ""
  16601. elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] == "" then
  16602. ret = ""
  16603. elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" and mpaCharacters[slot]["player"] ~= multiplayerLocalPlayerID then
  16604. ret = t("MULTIPLAYER_VIEW_DETAILS_BUTTON")
  16605. elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" and mpaCharacters[slot]["player"] == multiplayerLocalPlayerID and multiplayer.allowreformparty == false and multiplayerDifficultyLabel ~= "" then
  16606. ret = t("MULTIPLAYER_VIEW_DETAILS_BUTTON")
  16607. elseif mpaCharacters[slot]["name"] ~= "" and mpaCharacters[slot]["class"] ~= "" and mpaCharacters[slot]["player"] == multiplayerLocalPlayerID then
  16608. ret = t("MULTIPLAYER_EDIT_CHAR_BUTTON")
  16609. end
  16610.  
  16611. return ret
  16612. end
  16613. function shouldGreyscaleEditButton(slot)
  16614. local ret = false
  16615. local storedString = t("MULTIPLAYER_VIEW_DETAILS_BUTTON")
  16616.  
  16617. if multiplayerFromInGame == true then
  16618. ret = true
  16619. end
  16620.  
  16621. if ret == true and getMultiplayerCharacterButtonText(slot) == storedString then
  16622. ret = false
  16623. end
  16624.  
  16625. if ret == true and (multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[7] == true) then
  16626. ret = false
  16627. end
  16628.  
  16629. if ret == true and mpaCharacters[slot]["name"] == "" then
  16630. ret = false
  16631. end
  16632.  
  16633. if ret == false and mpaCharacters[slot]['ready'] == true and getMultiplayerCharacterButtonText(slot) ~= storedString and multiplayerFromInGame == false then
  16634. ret = true
  16635. end
  16636.  
  16637. return ret
  16638. end
  16639. function getMultiplayerCharacterReadyText(slot)
  16640. local ret = ""
  16641.  
  16642. if mpaCharacters[slot]["name"] == "" and mpaCharacters[slot]["inprogress"] == false then
  16643. ret = ""
  16644. elseif mpaCharacters[slot]["ready"] == false then
  16645. ret = t("MULTIPLAYER_NOT_READY_MESSAGE")
  16646. elseif mpaCharacters[slot]["ready"] == true then
  16647. ret = t("MULTIPLAYER_READY_MESSAGE")
  16648. end
  16649.  
  16650. return ret
  16651. end
  16652. function getMultiplayerPlayerName(slot,newLine,hostyou)
  16653. local ret = mpaPlayers[slot]["name"]
  16654. if ret ~= "" then
  16655. ret = "^0x"..mpaPlayers[slot]["color"]..mpaPlayers[slot]["name"].."^-"
  16656. end
  16657.  
  16658. local separator = " "
  16659. if newLine == true then
  16660. separator = "\n"
  16661. end
  16662.  
  16663. if hostyou == true then
  16664. if slot == multiplayerLocalPlayerID then
  16665. ret = ret..separator.."^0xFFFFFFFF"..t("MULTIPLAYER_PLAYER_YOU").."^-"
  16666. elseif slot == 1 then
  16667. ret = ret..separator.."^0xFFFFFFFF"..t("MULTIPLAYER_PLAYER_HOST").."^-"
  16668. elseif ret == "" then
  16669. ret = "^0xFF9B9B9B"..t("MULTIPLAYER_EMPTY_PLAYER").."^-"
  16670. end
  16671. end
  16672.  
  16673. return ret
  16674. end
  16675. function getMultiplayerPlayerControlledCharacter(player,slot)
  16676. local count = 0
  16677. local ret = "NOCTRL" -- need blank square or something
  16678.  
  16679. local index = 1
  16680. for index = 1, 6, 1 do
  16681. if mpaCharacters[index]["player"] == player then
  16682. count = count + 1
  16683. end
  16684.  
  16685. if currentMultiplayerSelectPlayer == player and mpDraggedCharacter == index then
  16686. slot = slot + 1
  16687. end
  16688.  
  16689. if count == slot then
  16690. ret = mpaCharacters[index]["portrait"]
  16691. break
  16692. end
  16693. end
  16694.  
  16695. return ret
  16696. end
  16697. function getMultiplayerPlayerControlledCharacterSlot(player,slot)
  16698. local count = 0
  16699. local ret = -1
  16700.  
  16701. local index = 1
  16702. for index = 1, 6, 1 do
  16703. if mpaCharacters[index]["player"] == player then
  16704. count = count + 1
  16705. end
  16706.  
  16707. if count == slot then
  16708. ret = index
  16709. break
  16710. end
  16711. end
  16712.  
  16713. return ret
  16714. end
  16715.  
  16716. function getPlayerKickWidth(slot)
  16717. if multiplayerLocalPlayerID ~= 1 or slot == 1 then
  16718. return 0
  16719. else
  16720. return 10
  16721. end
  16722. end
  16723.  
  16724. function getPlayerNameWidth(slot)
  16725. if multiplayerLocalPlayerID ~= 1 or slot == 1 then
  16726. return 45
  16727. else
  16728. return 35
  16729. end
  16730. end
  16731.  
  16732. function getStartGameButtonTooltip()
  16733. if multiplayer.donebuttonclickable then
  16734. return ""
  16735. else
  16736. return t("MULTIPLAYER_CANNOT_START")
  16737. end
  16738. end
  16739.  
  16740. function updateMultiplayerSessionData(sessionName, saveName, chapter, timePlayed, difficulty)
  16741. local gold = "^0xffc7f8fb"
  16742. multiplayerSessionName = gold..sessionName.."^-"
  16743.  
  16744. if areaName ~= "" then
  16745. multiplayerSaveName = gold..t("MULTIPLAYER_SAVED_GAME_LABEL").."^- ^0xffffffff"..saveName.."^-"
  16746. multiplayerChapter = gold..t("MULTIPLAYER_CHAPTER_LABEL").."^- ^0xffffffff"..chapter.."^-"
  16747. multiplayerTimePlayed = gold..t("MULTIPLAYER_TIME_PLAYED_LABEL").."^- ^0xffffffff"..timePlayed.."^-"
  16748. if difficulty > 0 then
  16749. mulitplayerPreexistingDifficulty = difficulty
  16750. multiplayerDifficultyLabel = gold..t("MULTIPLAYER_DIFFICULTY_LABEL").."^-^0xffffffff"..t(difficulties[difficulty].name).."^-"
  16751. multiplayerDifficultyImage = difficulty - 1
  16752. end
  16753. else
  16754. multiplayerSaveName = gold..t("MULTIPLAYER_NEW_GAME_LABEL").."^- ^0xffffffff"..saveName.."^-"
  16755. multiplayerChapter = gold..t("MULTIPLAYER_CHAPTER_LABEL").."^- ^0xffffffff"..chapter.."^-"
  16756. multiplayerTimePlayed = gold..t("MULTIPLAYER_TIME_PLAYED_NEW_GAME").."^-"
  16757. if difficulty > 0 then
  16758. multiplayerDifficultyLabel = gold..t("MULTIPLAYER_DIFFICULTY_LABEL").."^-^0xffffffff"..t(difficulties[difficulty].name).."^-"
  16759. multiplayerDifficultyImage = difficulty - 1
  16760. end
  16761. end
  16762. end
  16763.  
  16764. function broadcastCharacterControlChange(slot, newPlayer)
  16765. print("newPlayer "..newPlayer.." current "..currentMultiplayerSelectPlayer.." playernumber "..mpaCharacters[slot]["player"])
  16766. if mpaCharacters[slot]["player"] ~= newPlayer then
  16767. local host = getMultiplayerPlayerName(1,false,false)
  16768. local player = getMultiplayerPlayerName(newPlayer,false,false)
  16769. setStringTokenLua("<PLAYER_NAME_1>",host)
  16770. setStringTokenLua("<PLAYER_NAME_2>",player)
  16771. local message = t("MULTIPLAYER_SLOT_"..slot.."_ASSIGNED_TO")
  16772. removeStringTokenLua("<PLAYER_NAME_1>")
  16773. removeStringTokenLua("<PLAYER_NAME_2>")
  16774. print(message)
  16775. Infinity_SendChatMessage(message, true)
  16776. end
  16777. end
  16778.  
  16779. function broadcastCharacterAdded(slot)
  16780. local player = getMultiplayerPlayerName(mpaCharacters[slot]["player"],false,false)
  16781. local character = getMultiplayerCharacterName(slot, false, true)
  16782. setStringTokenLua("<PLAYER_NAME_1>",player)
  16783. setStringTokenLua("<CHARACTER_NAME_1>",character)
  16784. local message = t("MULTIPLAYER_HAS_ADDED")
  16785. removeStringTokenLua("<PLAYER_NAME_1>")
  16786. removeStringTokenLua("<CHARACTER_NAME_1>")
  16787. print(message)
  16788. Infinity_SendChatMessage(message, true)
  16789. end
  16790.  
  16791. function broadcastCharacterRemoved(slot)
  16792. local player = getMultiplayerPlayerName(mpaCharacters[slot]["player"],false,false)
  16793. local character = getMultiplayerCharacterName(slot, false, true)
  16794. setStringTokenLua("<PLAYER_NAME_1>",player)
  16795. setStringTokenLua("<CHARACTER_NAME_1>",character)
  16796. local message = t("MULTIPLAYER_HAS_REMOVED")
  16797. removeStringTokenLua("<PLAYER_NAME_1>")
  16798. removeStringTokenLua("<CHARACTER_NAME_1>")
  16799. print(message)
  16800. Infinity_SendChatMessage(message, true)
  16801. end
  16802.  
  16803. function broadcastCharacterReady(slot)
  16804. local character = getMultiplayerCharacterName(slot, false, false)
  16805. setStringTokenLua("<CHARACTER_NAME_1>",character)
  16806. local message = t("MULTIPLAYER_IS_READY_TO_START")
  16807. removeStringTokenLua("<CHARACTER_NAME_1>")
  16808. print(message)
  16809. Infinity_SendChatMessage(message, true)
  16810. end
  16811.  
  16812. function broadcastCharacterNotReady(slot)
  16813. local character = getMultiplayerCharacterName(slot, false, false)
  16814. setStringTokenLua("<CHARACTER_NAME_1>",character)
  16815. local message = t("MULTIPLAYER_IS_NO_LONGER_READY")
  16816. removeStringTokenLua("<CHARACTER_NAME_1>")
  16817. print(message)
  16818. Infinity_SendChatMessage(message, true)
  16819. end
  16820.  
  16821. function broadcastPlayerAdded(slot)
  16822. local player = getMultiplayerPlayerName(slot,false,false)
  16823. setStringTokenLua("<PLAYER_NAME_1>",player)
  16824. local message = t("MULTIPLAYER_HAS_JOINED_THE_GAME")
  16825. removeStringTokenLua("<PLAYER_NAME_1>")
  16826. print(message)
  16827. Infinity_SendChatMessage(message, true)
  16828. end
  16829.  
  16830. function broadcastPlayerRemoved(slot)
  16831. local player = getMultiplayerPlayerName(slot,false,false)
  16832. setStringTokenLua("<PLAYER_NAME_1>",player)
  16833. local message = t("MULTIPLAYER_HAS_LEFT_THE_GAME")
  16834. removeStringTokenLua("<PLAYER_NAME_1>")
  16835. print(message)
  16836. Infinity_SendChatMessage(message, true)
  16837. end
  16838.  
  16839. mpDraggedCharacter = nil
  16840. mpDraggedPortrait = 'NOCTRL'
  16841.  
  16842. function multiplayerStartSwapPortraits(player, character)
  16843. if multiplayerLocalPlayerID == 1 and player > 0 and player < 7 and mpaPlayers[player]["name"] ~= "" then
  16844. print("Starting the drag of player "..player.." character slot "..character)
  16845. mpDraggedCharacter = character
  16846. multiplayerScreen:SetModifiedCharacterSlot(character - 1)
  16847. currentMultiplayerSelectPlayer = player
  16848. mpDraggedPortrait = mpaCharacters[character]["portrait"]
  16849. end
  16850. end
  16851.  
  16852. function multiplayerStopSwapPortraits(player)
  16853. if multiplayerLocalPlayerID == 1 then
  16854. if player > 0 and player < 7 and mpaPlayers[player]["name"] ~= "" and currentMultiplayerSelectPlayer ~= nil then
  16855. if mpaCharacters[mpDraggedCharacter]['ready'] == true and mpaCharacters[mpDraggedCharacter]['player'] ~= player then
  16856. multiplayerScreen:OnReadyButtonClick(mpDraggedCharacter-1)
  16857. end
  16858. broadcastCharacterControlChange(mpDraggedCharacter, player)
  16859. multiplayerScreen:OnPlayerSelection(player-1)
  16860. end
  16861. mpDraggedCharacter = nil
  16862. currentMultiplayerSelectPlayer = nil
  16863. mpDraggedPortrait = 'NOCTRL'
  16864. end
  16865. end
  16866.  
  16867. function getMultiplayerReadyTooltip(character)
  16868. local ret = ""
  16869.  
  16870. if mpaCharacters[character]["ready"] == true then
  16871. ret = t("MULTIPLAYER_READY_BUTTON_ON_TOOLTIP")
  16872. else
  16873. ret = t("MULTIPLAYER_READY_BUTTON_OFF_TOOLTIP")
  16874. end
  16875.  
  16876. return ret
  16877. end
  16878.  
  16879. function multiplayerUpdateDraggedPortrait()
  16880. if mpDraggedPortrait ~= 'NOCTRL' and multiplayerLocalPlayerID == 1 then
  16881. local x,y,w,h = Infinity_GetArea('multiplayerDraggingPortraitImage')
  16882. x,y = Infinity_GetMousePosition();
  16883. x = x - 20
  16884. y = y - 30
  16885. Infinity_SetArea('multiplayerDraggingPortraitImage',x,y,w,h)
  16886. return true
  16887. else
  16888. local x,y,w,h = Infinity_GetArea('multiplayerDraggingPortraitImage')
  16889. Infinity_SetArea('multiplayerDraggingPortraitImage',-20,-20,w,h)
  16890. return false
  16891. end
  16892. end
  16893.  
  16894. function get4CheckFrame(slot)
  16895. local ret = 1
  16896.  
  16897. if mpaCharacters[slot]['ready'] == true and mpaCharacters[slot]['player'] == multiplayerLocalPlayerID then
  16898. ret = 0
  16899. elseif mpaCharacters[slot]['ready'] == true then
  16900. ret = 2
  16901. end
  16902.  
  16903. return ret
  16904. end
  16905.  
  16906. `
  16907. menu
  16908. {
  16909. name 'MULTIPLAYER'
  16910. align center center
  16911. ignoreesc
  16912. onOpen
  16913. "
  16914. existingDifficulty = Infinity_GetOption(12, 8) + 1;
  16915. multiplayerFromInGame = multiplayerScreen:GetEngineState() == 2
  16916. "
  16917. label
  16918. {
  16919. mosaic 'GUISMBM'
  16920. area 0 0 1024 768
  16921. }
  16922. label
  16923. {
  16924. area 162 16 700 44
  16925. text "ARBITRATION_TITLE"
  16926. text style "title"
  16927. }
  16928.  
  16929. label
  16930. {
  16931. area 514 70 492 618
  16932. fill 0 0 0 255
  16933. }
  16934. label
  16935. {
  16936. area 504 60 512 638
  16937. rectangle 3
  16938. }
  16939.  
  16940. label
  16941. {
  16942. area 524 112 471 93
  16943. fill 100 25 25 180
  16944. }
  16945. label
  16946. {
  16947. area 524 207 471 93
  16948. fill 50 50 50 180
  16949. }
  16950. label
  16951. {
  16952. area 524 302 471 93
  16953. fill 100 25 25 180
  16954. }
  16955. label
  16956. {
  16957. area 524 397 471 93
  16958. fill 50 50 50 180
  16959. }
  16960. label
  16961. {
  16962. area 524 492 471 93
  16963. fill 100 25 25 180
  16964. }
  16965. label
  16966. {
  16967. area 524 587 471 93
  16968. fill 50 50 50 180
  16969. }
  16970.  
  16971. label
  16972. {
  16973. area 524 80 136 22
  16974. text lua "t('PLAYER_LABEL')"
  16975. text style "label"
  16976. align center center
  16977. }
  16978. label
  16979. {
  16980. area 660 80 228 22
  16981. text lua "t('CHARACTER_LABEL')"
  16982. text style "label"
  16983. align center center
  16984. }
  16985. label
  16986. {
  16987. area 888 80 107 22
  16988. text lua "t('READY_TO_PLAY_LABEL')"
  16989. text style "label"
  16990. align center center
  16991. }
  16992. list -- character list
  16993. {
  16994. column --player
  16995. {
  16996. width 32
  16997. label
  16998. {
  16999. area 6 5 140 44
  17000. text lua "getMultiplayerPlayerName(mpaCharacters[rowNumber]['player'],true,true)"
  17001. text style "label"
  17002. enabled "multiplayerLocalPlayerID == 1 and rowNumber ~= 1"
  17003. }
  17004. label
  17005. {
  17006. area 6 0 140 95
  17007. text lua "getMultiplayerPlayerName(mpaCharacters[rowNumber]['player'],true,true)"
  17008. text style "label"
  17009. enabled "multiplayerLocalPlayerID ~= 1 or rowNumber == 1"
  17010. }
  17011. label
  17012. {
  17013. area 6 55 140 31
  17014. bam 'GUIBUTNS'
  17015. sequence 1
  17016. frame lua "currentCellCheck(1)"
  17017. align center center
  17018. enabled "multiplayerLocalPlayerID == 1 and rowNumber ~= 1"
  17019. text lua "t('MULTIPLAYER_CHANGE_PLAYER_BUTTON')"
  17020. text style "button"
  17021. }
  17022.  
  17023. }
  17024. column --portrait
  17025. {
  17026. width 15
  17027. label
  17028. {
  17029. area 0 0 -1 -1
  17030. bam 'GUIRSP10'
  17031. sequence 1
  17032. align center center
  17033. }
  17034. label
  17035. {
  17036. area 6 5 56 85
  17037. bitmap lua 'mpaCharacters[rowNumber]["portrait"]'
  17038. sequence 1
  17039. align center center
  17040. }
  17041. }
  17042. column --character
  17043. {
  17044. width 45
  17045. label
  17046. {
  17047. area 2 0 195 44
  17048. text lua "getMultiplayerCharacterName(rowNumber, true, true)"
  17049. text style "label"
  17050. enabled "getMultiplayerCharacterButtonText(rowNumber) ~= ''"
  17051. }
  17052. label
  17053. {
  17054. area 2 0 195 95
  17055. text lua "getMultiplayerCharacterName(rowNumber, true, true)"
  17056. text style "label"
  17057. enabled "getMultiplayerCharacterButtonText(rowNumber) == ''"
  17058. }
  17059. label
  17060. {
  17061. area 2 50 195 40
  17062. bam 'GUIBUTNT'
  17063. sequence 1
  17064. frame lua "currentCellCheck(3)"
  17065. align center center
  17066. enabled "getMultiplayerCharacterButtonText(rowNumber) ~= ''"
  17067. }
  17068. label
  17069. {
  17070. area 2 50 195 44
  17071. text lua "getMultiplayerCharacterButtonText(rowNumber)"
  17072. text style "button"
  17073. }
  17074. label
  17075. {
  17076. area 2 50 195 44
  17077. fill 0 0 0 170
  17078. enabled "shouldGreyscaleEditButton(rowNumber)"
  17079. }
  17080.  
  17081. }
  17082. column --ready
  17083. {
  17084. width 13
  17085. label
  17086. {
  17087. area 0 50 50 44
  17088. text lua "getMultiplayerCharacterReadyText(rowNumber)"
  17089. text style "label"
  17090. }
  17091.  
  17092. }
  17093.  
  17094. area 520 112 475 570
  17095.  
  17096. rowheight 95
  17097. table "mpaCharacters"
  17098. var selectedCharacter
  17099. scrollbar 'GUISCRC'
  17100. hidehighlight
  17101. action
  17102. "
  17103. if cellNumber == 1 then
  17104. cellNumber = nil
  17105. if multiplayerLocalPlayerID == 1 and selectedCharacter ~= 1 then
  17106. if multiplayerFromInGame == false then
  17107. multiplayerScreen:SetModifiedCharacterSlot(selectedCharacter - 1)
  17108. currentMultiplayerSelectPlayer = mpaCharacters[selectedCharacter]['player']
  17109. Infinity_PushMenu('MP_PICKPLAYER')
  17110. elseif shouldGreyscaleEditButton(selectedCharacter) == false then
  17111. multiplayerScreen:OnModifyButtonClick()
  17112. end
  17113. end
  17114. elseif cellNumber == 2 then
  17115. cellNumber = nil
  17116. elseif cellNumber == 3 then
  17117. cellNumber = nil
  17118. if shouldGreyscaleEditButton(selectedCharacter) == false then
  17119. if getMultiplayerCharacterButtonText(selectedCharacter) == t('MULTIPLAYER_VIEW_DETAILS_BUTTON') then
  17120. multiplayerScreen:OnPortraitButtonClick(selectedCharacter-1)
  17121. elseif getMultiplayerCharacterButtonText(selectedCharacter) == t('CREATE_CHAR_BUTTON') then
  17122. if multiplayerFromInGame == false then
  17123. multiplayerScreen:SetModifiedCharacterSlot(selectedCharacter-1)
  17124. multiplayerScreen:UpdateModifyCharacterPanel()
  17125. elseif shouldGreyscaleEditButton(selectedCharacter) == false then
  17126. multiplayerScreen:OnModifyButtonClick()
  17127. end
  17128. elseif getMultiplayerCharacterButtonText(selectedCharacter) == t('MULTIPLAYER_EDIT_CHAR_BUTTON') then
  17129. if multiplayerFromInGame == false then
  17130. mpModifyingCharacter = selectedCharacter - 1
  17131. Infinity_PushMenu('MP_MODIFYCHARACTER')
  17132. elseif shouldGreyscaleEditButton(selectedCharacter) == false then
  17133. multiplayerScreen:OnModifyButtonClick()
  17134. end
  17135. end
  17136. end
  17137. elseif cellNumber == 4 then
  17138. cellNumber = nil
  17139. end
  17140. "
  17141. actionAlt
  17142. "
  17143. cellNumber = nil
  17144. "
  17145. }
  17146.  
  17147. --ready buttons
  17148. button
  17149. {
  17150. area 942 112 50 50
  17151. bam '4CHECK'
  17152. sequence lua "get4CheckFrame(1)"
  17153. align center center
  17154. tooltip lua "getMultiplayerReadyTooltip(1)"
  17155. action
  17156. "
  17157. if multiplayerFromInGame == false then
  17158. if multiplayerLocalPlayerID == mpaCharacters[1]['player'] then
  17159. multiplayerScreen:OnReadyButtonClick(1-1)
  17160. end
  17161. end
  17162. "
  17163. }
  17164. button
  17165. {
  17166. area 942 207 50 50
  17167. bam '4CHECK'
  17168. sequence lua "get4CheckFrame(2)"
  17169. align center center
  17170. action
  17171. "
  17172. if multiplayerFromInGame == false then
  17173. if multiplayerLocalPlayerID == mpaCharacters[2]['player'] then
  17174. multiplayerScreen:OnReadyButtonClick(2-1)
  17175. end
  17176. end
  17177. "
  17178. }
  17179. button
  17180. {
  17181. area 942 304 50 50
  17182. bam '4CHECK'
  17183. sequence lua "get4CheckFrame(3)"
  17184. align center center
  17185. action
  17186. "
  17187. if multiplayerFromInGame == false then
  17188. if multiplayerLocalPlayerID == mpaCharacters[3]['player'] then
  17189. multiplayerScreen:OnReadyButtonClick(3-1)
  17190. end
  17191. end
  17192. "
  17193. }
  17194. button
  17195. {
  17196. area 942 397 50 50
  17197. bam '4CHECK'
  17198. sequence lua "get4CheckFrame(4)"
  17199. align center center
  17200. action
  17201. "
  17202. if multiplayerFromInGame == false then
  17203. if multiplayerLocalPlayerID == mpaCharacters[4]['player'] then
  17204. multiplayerScreen:OnReadyButtonClick(4-1)
  17205. end
  17206. end
  17207. "
  17208. }
  17209. button
  17210. {
  17211. area 942 492 50 50
  17212. bam '4CHECK'
  17213. sequence lua "get4CheckFrame(5)"
  17214. align center center
  17215. action
  17216. "
  17217. if multiplayerFromInGame == false then
  17218. if multiplayerLocalPlayerID == mpaCharacters[5]['player'] then
  17219. multiplayerScreen:OnReadyButtonClick(5-1)
  17220. end
  17221. end
  17222. "
  17223. }
  17224. button
  17225. {
  17226. area 942 587 50 50
  17227. bam '4CHECK'
  17228. sequence lua "get4CheckFrame(6)"
  17229. align center center
  17230. action
  17231. "
  17232. if multiplayerFromInGame == false then
  17233. if multiplayerLocalPlayerID == mpaCharacters[6]['player'] then
  17234. multiplayerScreen:OnReadyButtonClick(6-1)
  17235. end
  17236. end
  17237. "
  17238. }
  17239.  
  17240. label
  17241. {
  17242. area 40 308 454 25
  17243. fill 125 125 125 180
  17244. }
  17245. label
  17246. {
  17247. area 40 343 454 47
  17248. fill 50 50 50 180
  17249. }
  17250. label
  17251. {
  17252. area 40 394 454 47
  17253. fill 50 50 50 180
  17254. }
  17255. label
  17256. {
  17257. area 40 445 454 47
  17258. fill 50 50 50 180
  17259. }
  17260. label
  17261. {
  17262. area 40 496 454 47
  17263. fill 50 50 50 180
  17264. }
  17265. label
  17266. {
  17267. area 40 547 454 47
  17268. fill 50 50 50 180
  17269. }
  17270. label
  17271. {
  17272. area 40 598 454 47
  17273. fill 50 50 50 180
  17274. }
  17275. label
  17276. {
  17277. area 40 308 207 25
  17278. text lua "t('PLAYERS_LABEL')"
  17279. text style "label"
  17280. align center center
  17281. }
  17282. label
  17283. {
  17284. area 247 308 187 25
  17285. text lua "t('PARTY_SLOTS_LABEL')"
  17286. text style "label"
  17287. align center center
  17288. }
  17289. label
  17290. {
  17291. area 434 308 60 25
  17292. text lua "t('RULES_LABEL')"
  17293. text style "label"
  17294. align center center
  17295. }
  17296. list -- player list
  17297. {
  17298. column -- kick
  17299. {
  17300. width lua "getPlayerKickWidth(rowNumber)"
  17301. label
  17302. {
  17303. area 6 5 45 45
  17304. }
  17305. }
  17306. column --player
  17307. {
  17308. width lua "getPlayerNameWidth(rowNumber)"
  17309. label
  17310. {
  17311. area 0 0 195 55
  17312. text lua "getMultiplayerPlayerName(rowNumber, false, true)"
  17313. text style "label"
  17314. align left center
  17315. enabled "getPlayerKickWidth(rowNumber) == 0"
  17316. }
  17317. label
  17318. {
  17319. area 0 0 150 55
  17320. text lua "getMultiplayerPlayerName(rowNumber, false, true)"
  17321. text style "label"
  17322. align left center
  17323. enabled "getPlayerKickWidth(rowNumber) ~= 0"
  17324. }
  17325.  
  17326. }
  17327. column --portraits
  17328. {
  17329. width 45
  17330. label
  17331. {
  17332. area 6 5 25 38
  17333. }
  17334. }
  17335. column -- permissions
  17336. {
  17337. width 10
  17338. label
  17339. {
  17340. area 6 5 45 45
  17341. }
  17342. }
  17343.  
  17344. area 52 339 442 306
  17345.  
  17346. rowheight 51
  17347. table "mpaPlayers"
  17348. var selectedPlayer
  17349. scrollbar 'GUISCRC'
  17350. hidehighlight
  17351. action
  17352. "
  17353. if cellNumber == 1 and selectedPlayer > 1 then
  17354. cellNumber = 0
  17355. elseif cellNumber == 2 then
  17356. cellNumber = 0
  17357. elseif cellNumber == 3 then
  17358. cellNumber = 0
  17359. elseif cellNumber == 4 and selectedPlayer > 1 then
  17360. cellNumber = 0
  17361. end
  17362. "
  17363. }
  17364.  
  17365. --kick
  17366. button
  17367. {
  17368. area 40 395 46 45
  17369. bam GUMPBUTX
  17370. sequence 4
  17371. clickable lua "mpaPlayers[2]['name'] ~= ''"
  17372. align center center
  17373. enabled "multiplayerLocalPlayerID == 1"
  17374. tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')"
  17375. action
  17376. "
  17377. if mpaPlayers[2]['name'] ~= '' then
  17378. multiplayerScreen:OnKickPlayerButtonClick(2-1)
  17379. end
  17380. "
  17381. }
  17382. button
  17383. {
  17384. area 40 446 46 45
  17385. bam GUMPBUTX
  17386. sequence 4
  17387. clickable lua "mpaPlayers[3]['name'] ~= ''"
  17388. align center center
  17389. enabled "multiplayerLocalPlayerID == 1"
  17390. tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')"
  17391. action
  17392. "
  17393. if mpaPlayers[3]['name'] ~= '' then
  17394. multiplayerScreen:OnKickPlayerButtonClick(3-1)
  17395. end
  17396. "
  17397. }
  17398. button
  17399. {
  17400. area 40 497 46 45
  17401. bam GUMPBUTX
  17402. sequence 4
  17403. clickable lua "mpaPlayers[4]['name'] ~= ''"
  17404. align center center
  17405. enabled "multiplayerLocalPlayerID == 1"
  17406. tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')"
  17407. action
  17408. "
  17409. if mpaPlayers[4]['name'] ~= '' then
  17410. multiplayerScreen:OnKickPlayerButtonClick(4-1)
  17411. end
  17412. "
  17413. }
  17414. button
  17415. {
  17416. area 40 548 46 45
  17417. bam GUMPBUTX
  17418. sequence 4
  17419. clickable lua "mpaPlayers[5]['name'] ~= ''"
  17420. align center center
  17421. enabled "multiplayerLocalPlayerID == 1"
  17422. tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')"
  17423. action
  17424. "
  17425. if mpaPlayers[5]['name'] ~= '' then
  17426. multiplayerScreen:OnKickPlayerButtonClick(5-1)
  17427. end
  17428. "
  17429. }
  17430. button
  17431. {
  17432. area 40 599 46 45
  17433. bam GUMPBUTX
  17434. sequence 4
  17435. clickable lua "mpaPlayers[6]['name'] ~= ''"
  17436. align center center
  17437. enabled "multiplayerLocalPlayerID == 1"
  17438. tooltip lua "t('MULTIPALYER_KICK_TOOLTIP')"
  17439. action
  17440. "
  17441. if mpaPlayers[6]['name'] ~= '' then
  17442. multiplayerScreen:OnKickPlayerButtonClick(6-1)
  17443. end
  17444. "
  17445. }
  17446.  
  17447. --permissions
  17448. button
  17449. {
  17450. area 446 395 46 45
  17451. bam GUMPBUTX
  17452. sequence 3
  17453. clickable lua "mpaPlayers[2]['name'] ~= '' and multiplayerLocalPlayerID == 1"
  17454. align center center
  17455. tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')"
  17456. action
  17457. "
  17458. if mpaPlayers[2]['name'] ~= '' then
  17459. multiplayerInPermission = true
  17460. multiplayerInPermissionForPlayer = 2
  17461. Infinity_PushMenu('MP_PERMISSIONS')
  17462. end
  17463. "
  17464. }
  17465. button
  17466. {
  17467. area 446 446 46 45
  17468. bam GUMPBUTX
  17469. sequence 3
  17470. clickable lua "mpaPlayers[3]['name'] ~= '' and multiplayerLocalPlayerID == 1"
  17471. align center center
  17472. tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')"
  17473. action
  17474. "
  17475. if mpaPlayers[3]['name'] ~= '' then
  17476. multiplayerInPermission = true
  17477. multiplayerInPermissionForPlayer = 3
  17478. Infinity_PushMenu('MP_PERMISSIONS')
  17479. end
  17480. "
  17481. }
  17482. button
  17483. {
  17484. area 446 497 46 45
  17485. bam GUMPBUTX
  17486. sequence 3
  17487. clickable lua "mpaPlayers[4]['name'] ~= '' and multiplayerLocalPlayerID == 1"
  17488. align center center
  17489. tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')"
  17490. action
  17491. "
  17492. if mpaPlayers[4]['name'] ~= '' then
  17493. multiplayerInPermission = true
  17494. multiplayerInPermissionForPlayer = 4
  17495. Infinity_PushMenu('MP_PERMISSIONS')
  17496. end
  17497. "
  17498. }
  17499. button
  17500. {
  17501. area 446 548 46 45
  17502. bam GUMPBUTX
  17503. sequence 3
  17504. clickable lua "mpaPlayers[5]['name'] ~= '' and multiplayerLocalPlayerID == 1"
  17505. align center center
  17506. tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')"
  17507. action
  17508. "
  17509. if mpaPlayers[5]['name'] ~= '' then
  17510. multiplayerInPermission = true
  17511. multiplayerInPermissionForPlayer = 5
  17512. Infinity_PushMenu('MP_PERMISSIONS')
  17513. end
  17514. "
  17515. }
  17516. button
  17517. {
  17518. area 446 599 46 45
  17519. bam GUMPBUTX
  17520. sequence 3
  17521. clickable lua "mpaPlayers[6]['name'] ~= '' and multiplayerLocalPlayerID == 1"
  17522. align center center
  17523. tooltip lua "t('MULTIPALYER_PERMISSION_TOOLTIP')"
  17524. action
  17525. "
  17526. if mpaPlayers[6]['name'] ~= '' then
  17527. multiplayerInPermission = true
  17528. multiplayerInPermissionForPlayer = 6
  17529. Infinity_PushMenu('MP_PERMISSIONS')
  17530. end
  17531. "
  17532. }
  17533.  
  17534. --character drag/drop
  17535. --player 1
  17536. button
  17537. {
  17538. area 247 348 180 38
  17539. actionSimpleDrop
  17540. "
  17541. multiplayerStopSwapPortraits(1)
  17542. "
  17543. }
  17544. button
  17545. {
  17546. area 247 348 25 38
  17547. bitmap lua 'getMultiplayerPlayerControlledCharacter(1,1)'
  17548. sequence 1
  17549. align center center
  17550. --No changing control of character 1
  17551. }
  17552. button
  17553. {
  17554. area 278 348 25 38
  17555. bitmap lua 'getMultiplayerPlayerControlledCharacter(1,2)'
  17556. sequence 1
  17557. align center center
  17558. actionSimpleDrag
  17559. "
  17560. if multiplayerFromInGame == false then
  17561. local slot = getMultiplayerPlayerControlledCharacterSlot(1,2)
  17562. multiplayerStartSwapPortraits(1,slot)
  17563. elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then
  17564. multiplayerScreen:OnModifyButtonClick()
  17565. end
  17566. "
  17567. actionSimpleDrop
  17568. "
  17569. multiplayerStopSwapPortraits(1)
  17570. "
  17571. }
  17572. button
  17573. {
  17574. area 309 348 25 38
  17575. bitmap lua 'getMultiplayerPlayerControlledCharacter(1,3)'
  17576. sequence 1
  17577. align center center
  17578. actionSimpleDrag
  17579. "
  17580. if multiplayerFromInGame == false then
  17581. local slot = getMultiplayerPlayerControlledCharacterSlot(1,3)
  17582. multiplayerStartSwapPortraits(1,slot)
  17583. elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then
  17584. multiplayerScreen:OnModifyButtonClick()
  17585. end
  17586. "
  17587. actionSimpleDrop
  17588. "
  17589. multiplayerStopSwapPortraits(1)
  17590. "
  17591. }
  17592. button
  17593. {
  17594. area 340 348 25 38
  17595. bitmap lua 'getMultiplayerPlayerControlledCharacter(1,4)'
  17596. sequence 1
  17597. align center center
  17598. actionSimpleDrag
  17599. "
  17600. if multiplayerFromInGame == false then
  17601. local slot = getMultiplayerPlayerControlledCharacterSlot(1,4)
  17602. multiplayerStartSwapPortraits(1,slot)
  17603. elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then
  17604. multiplayerScreen:OnModifyButtonClick()
  17605. end
  17606. "
  17607. actionSimpleDrop
  17608. "
  17609. multiplayerStopSwapPortraits(1)
  17610. "
  17611. }
  17612. button
  17613. {
  17614. area 371 348 25 38
  17615. bitmap lua 'getMultiplayerPlayerControlledCharacter(1,5)'
  17616. sequence 1
  17617. align center center
  17618. actionSimpleDrag
  17619. "
  17620. if multiplayerFromInGame == false then
  17621. local slot = getMultiplayerPlayerControlledCharacterSlot(1,5)
  17622. multiplayerStartSwapPortraits(1,slot)
  17623. elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then
  17624. multiplayerScreen:OnModifyButtonClick()
  17625. end
  17626. "
  17627. actionSimpleDrop
  17628. "
  17629. multiplayerStopSwapPortraits(1)
  17630. "
  17631. }
  17632. button
  17633. {
  17634. area 402 348 25 38
  17635. bitmap lua 'getMultiplayerPlayerControlledCharacter(1,6)'
  17636. sequence 1
  17637. align center center
  17638. actionSimpleDrag
  17639. "
  17640. if multiplayerFromInGame == false then
  17641. local slot = getMultiplayerPlayerControlledCharacterSlot(1,6)
  17642. multiplayerStartSwapPortraits(1,slot)
  17643. elseif multiplayerLocalPlayerID == 1 or multiplayer.player[multiplayerLocalPlayerID].permissions[1] == true then
  17644. multiplayerScreen:OnModifyButtonClick()
  17645. end
  17646. "
  17647. actionSimpleDrop
  17648. "
  17649. multiplayerStopSwapPortraits(1)
  17650. "
  17651. }
  17652. --player 2
  17653. button
  17654. {
  17655. area 247 399 180 38
  17656. actionSimpleDrop
  17657. "
  17658. multiplayerStopSwapPortraits(2)
  17659. "
  17660. }
  17661. button
  17662. {
  17663. area 247 399 25 38
  17664. bitmap lua 'getMultiplayerPlayerControlledCharacter(2,1)'
  17665. sequence 1
  17666. align center center
  17667. actionSimpleDrag
  17668. "
  17669. local slot = getMultiplayerPlayerControlledCharacterSlot(2,1)
  17670. multiplayerStartSwapPortraits(2,slot)
  17671. "
  17672. actionSimpleDrop
  17673. "
  17674. multiplayerStopSwapPortraits(2)
  17675. "
  17676. }
  17677. button
  17678. {
  17679. area 278 399 25 38
  17680. bitmap lua 'getMultiplayerPlayerControlledCharacter(2,2)'
  17681. sequence 1
  17682. align center center
  17683. actionSimpleDrag
  17684. "
  17685. local slot = getMultiplayerPlayerControlledCharacterSlot(2,2)
  17686. multiplayerStartSwapPortraits(2,slot)
  17687. "
  17688. actionSimpleDrop
  17689. "
  17690. multiplayerStopSwapPortraits(2)
  17691. "
  17692. }
  17693. button
  17694. {
  17695. area 309 399 25 38
  17696. bitmap lua 'getMultiplayerPlayerControlledCharacter(2,3)'
  17697. sequence 1
  17698. align center center
  17699. actionSimpleDrag
  17700. "
  17701. local slot = getMultiplayerPlayerControlledCharacterSlot(2,3)
  17702. multiplayerStartSwapPortraits(2,slot)
  17703. "
  17704. actionSimpleDrop
  17705. "
  17706. multiplayerStopSwapPortraits(2)
  17707. "
  17708. }
  17709. button
  17710. {
  17711. area 340 399 25 38
  17712. bitmap lua 'getMultiplayerPlayerControlledCharacter(2,4)'
  17713. sequence 1
  17714. align center center
  17715. actionSimpleDrag
  17716. "
  17717. local slot = getMultiplayerPlayerControlledCharacterSlot(2,4)
  17718. multiplayerStartSwapPortraits(2,slot)
  17719. "
  17720. actionSimpleDrop
  17721. "
  17722. multiplayerStopSwapPortraits(2)
  17723. "
  17724. }
  17725. button
  17726. {
  17727. area 371 399 25 38
  17728. bitmap lua 'getMultiplayerPlayerControlledCharacter(2,5)'
  17729. sequence 1
  17730. align center center
  17731. actionSimpleDrag
  17732. "
  17733. local slot = getMultiplayerPlayerControlledCharacterSlot(2,5)
  17734. multiplayerStartSwapPortraits(2,slot)
  17735. "
  17736. actionSimpleDrop
  17737. "
  17738. multiplayerStopSwapPortraits(2)
  17739. "
  17740. }
  17741. button
  17742. {
  17743. area 402 399 25 38
  17744. bitmap lua 'getMultiplayerPlayerControlledCharacter(2,6)'
  17745. sequence 1
  17746. align center center
  17747. actionSimpleDrag
  17748. "
  17749. local slot = getMultiplayerPlayerControlledCharacterSlot(2,6)
  17750. multiplayerStartSwapPortraits(2,slot)
  17751. "
  17752. actionSimpleDrop
  17753. "
  17754. multiplayerStopSwapPortraits(2)
  17755. "
  17756. }
  17757. --player 3
  17758. button
  17759. {
  17760. area 247 449 180 38
  17761. actionSimpleDrop
  17762. "
  17763. multiplayerStopSwapPortraits(3)
  17764. "
  17765. }
  17766. button
  17767. {
  17768. area 247 449 25 38
  17769. bitmap lua 'getMultiplayerPlayerControlledCharacter(3,1)'
  17770. sequence 1
  17771. align center center
  17772. actionSimpleDrag
  17773. "
  17774. local slot = getMultiplayerPlayerControlledCharacterSlot(3,1)
  17775. multiplayerStartSwapPortraits(3,slot)
  17776. "
  17777. actionSimpleDrop
  17778. "
  17779. multiplayerStopSwapPortraits(3)
  17780. "
  17781. }
  17782. button
  17783. {
  17784. area 278 449 25 38
  17785. bitmap lua 'getMultiplayerPlayerControlledCharacter(3,2)'
  17786. sequence 1
  17787. align center center
  17788. actionSimpleDrag
  17789. "
  17790. local slot = getMultiplayerPlayerControlledCharacterSlot(3,2)
  17791. multiplayerStartSwapPortraits(3,slot)
  17792. "
  17793. actionSimpleDrop
  17794. "
  17795. multiplayerStopSwapPortraits(3)
  17796. "
  17797. }
  17798. button
  17799. {
  17800. area 309 449 25 38
  17801. bitmap lua 'getMultiplayerPlayerControlledCharacter(3,3)'
  17802. sequence 1
  17803. align center center
  17804. actionSimpleDrag
  17805. "
  17806. local slot = getMultiplayerPlayerControlledCharacterSlot(3,3)
  17807. multiplayerStartSwapPortraits(3,slot)
  17808. "
  17809. actionSimpleDrop
  17810. "
  17811. multiplayerStopSwapPortraits(3)
  17812. "
  17813. }
  17814. button
  17815. {
  17816. area 340 449 25 38
  17817. bitmap lua 'getMultiplayerPlayerControlledCharacter(3,4)'
  17818. sequence 1
  17819. align center center
  17820. actionSimpleDrag
  17821. "
  17822. local slot = getMultiplayerPlayerControlledCharacterSlot(3,4)
  17823. multiplayerStartSwapPortraits(3,slot)
  17824. "
  17825. actionSimpleDrop
  17826. "
  17827. multiplayerStopSwapPortraits(3)
  17828. "
  17829. }
  17830. button
  17831. {
  17832. area 371 449 25 38
  17833. bitmap lua 'getMultiplayerPlayerControlledCharacter(3,5)'
  17834. sequence 1
  17835. align center center
  17836. actionSimpleDrag
  17837. "
  17838. local slot = getMultiplayerPlayerControlledCharacterSlot(3,5)
  17839. multiplayerStartSwapPortraits(3,slot)
  17840. "
  17841. actionSimpleDrop
  17842. "
  17843. multiplayerStopSwapPortraits(3)
  17844. "
  17845. }
  17846. button
  17847. {
  17848. area 402 449 25 38
  17849. bitmap lua 'getMultiplayerPlayerControlledCharacter(3,6)'
  17850. sequence 1
  17851. align center center
  17852. actionSimpleDrag
  17853. "
  17854. local slot = getMultiplayerPlayerControlledCharacterSlot(3,6)
  17855. multiplayerStartSwapPortraits(3,slot)
  17856. "
  17857. actionSimpleDrop
  17858. "
  17859. multiplayerStopSwapPortraits(3)
  17860. "
  17861. }
  17862. --player 4
  17863. button
  17864. {
  17865. area 247 500 180 38
  17866. actionSimpleDrop
  17867. "
  17868. multiplayerStopSwapPortraits(4)
  17869. "
  17870. }
  17871. button
  17872. {
  17873. area 247 500 25 38
  17874. bitmap lua 'getMultiplayerPlayerControlledCharacter(4,1)'
  17875. sequence 1
  17876. align center center
  17877. actionSimpleDrag
  17878. "
  17879. local slot = getMultiplayerPlayerControlledCharacterSlot(4,1)
  17880. multiplayerStartSwapPortraits(4,slot)
  17881. "
  17882. actionSimpleDrop
  17883. "
  17884. multiplayerStopSwapPortraits(4)
  17885. "
  17886. }
  17887. button
  17888. {
  17889. area 278 500 25 38
  17890. bitmap lua 'getMultiplayerPlayerControlledCharacter(4,2)'
  17891. sequence 1
  17892. align center center
  17893. actionSimpleDrag
  17894. "
  17895. local slot = getMultiplayerPlayerControlledCharacterSlot(4,2)
  17896. multiplayerStartSwapPortraits(4,slot)
  17897. "
  17898. actionSimpleDrop
  17899. "
  17900. multiplayerStopSwapPortraits(4)
  17901. "
  17902. }
  17903. button
  17904. {
  17905. area 309 500 25 38
  17906. bitmap lua 'getMultiplayerPlayerControlledCharacter(4,3)'
  17907. sequence 1
  17908. align center center
  17909. actionSimpleDrag
  17910. "
  17911. local slot = getMultiplayerPlayerControlledCharacterSlot(4,3)
  17912. multiplayerStartSwapPortraits(4,slot)
  17913. "
  17914. actionSimpleDrop
  17915. "
  17916. multiplayerStopSwapPortraits(4)
  17917. "
  17918. }
  17919. button
  17920. {
  17921. area 340 500 25 38
  17922. bitmap lua 'getMultiplayerPlayerControlledCharacter(4,4)'
  17923. sequence 1
  17924. align center center
  17925. actionSimpleDrag
  17926. "
  17927. local slot = getMultiplayerPlayerControlledCharacterSlot(4,4)
  17928. multiplayerStartSwapPortraits(4,slot)
  17929. "
  17930. actionSimpleDrop
  17931. "
  17932. multiplayerStopSwapPortraits(4)
  17933. "
  17934. }
  17935. button
  17936. {
  17937. area 371 500 25 38
  17938. bitmap lua 'getMultiplayerPlayerControlledCharacter(4,5)'
  17939. sequence 1
  17940. align center center
  17941. actionSimpleDrag
  17942. "
  17943. local slot = getMultiplayerPlayerControlledCharacterSlot(4,5)
  17944. multiplayerStartSwapPortraits(4,slot)
  17945. "
  17946. actionSimpleDrop
  17947. "
  17948. multiplayerStopSwapPortraits(4)
  17949. "
  17950. }
  17951. button
  17952. {
  17953. area 402 500 25 38
  17954. bitmap lua 'getMultiplayerPlayerControlledCharacter(4,6)'
  17955. sequence 1
  17956. align center center
  17957. actionSimpleDrag
  17958. "
  17959. local slot = getMultiplayerPlayerControlledCharacterSlot(4,6)
  17960. multiplayerStartSwapPortraits(4,slot)
  17961. "
  17962. actionSimpleDrop
  17963. "
  17964. multiplayerStopSwapPortraits(4)
  17965. "
  17966. }
  17967. --player 5
  17968. button
  17969. {
  17970. area 247 551 180 38
  17971. actionSimpleDrop
  17972. "
  17973. multiplayerStopSwapPortraits(5)
  17974. "
  17975. }
  17976. button
  17977. {
  17978. area 247 551 25 38
  17979. bitmap lua 'getMultiplayerPlayerControlledCharacter(5,1)'
  17980. sequence 1
  17981. align center center
  17982. actionSimpleDrag
  17983. "
  17984. local slot = getMultiplayerPlayerControlledCharacterSlot(5,1)
  17985. multiplayerStartSwapPortraits(5,slot)
  17986. "
  17987. actionSimpleDrop
  17988. "
  17989. multiplayerStopSwapPortraits(5)
  17990. "
  17991. }
  17992. button
  17993. {
  17994. area 278 551 25 38
  17995. bitmap lua 'getMultiplayerPlayerControlledCharacter(5,2)'
  17996. sequence 1
  17997. align center center
  17998. actionSimpleDrag
  17999. "
  18000. local slot = getMultiplayerPlayerControlledCharacterSlot(5,2)
  18001. multiplayerStartSwapPortraits(5,slot)
  18002. "
  18003. actionSimpleDrop
  18004. "
  18005. multiplayerStopSwapPortraits(5)
  18006. "
  18007. }
  18008. button
  18009. {
  18010. area 309 551 25 38
  18011. bitmap lua 'getMultiplayerPlayerControlledCharacter(5,3)'
  18012. sequence 1
  18013. align center center
  18014. actionSimpleDrag
  18015. "
  18016. local slot = getMultiplayerPlayerControlledCharacterSlot(5,3)
  18017. multiplayerStartSwapPortraits(5,slot)
  18018. "
  18019. actionSimpleDrop
  18020. "
  18021. multiplayerStopSwapPortraits(5)
  18022. "
  18023. }
  18024. button
  18025. {
  18026. area 340 551 25 38
  18027. bitmap lua 'getMultiplayerPlayerControlledCharacter(5,4)'
  18028. sequence 1
  18029. align center center
  18030. actionSimpleDrag
  18031. "
  18032. local slot = getMultiplayerPlayerControlledCharacterSlot(5,4)
  18033. multiplayerStartSwapPortraits(5,slot)
  18034. "
  18035. actionSimpleDrop
  18036. "
  18037. multiplayerStopSwapPortraits(5)
  18038. "
  18039. }
  18040. button
  18041. {
  18042. area 371 551 25 38
  18043. bitmap lua 'getMultiplayerPlayerControlledCharacter(5,5)'
  18044. sequence 1
  18045. align center center
  18046. actionSimpleDrag
  18047. "
  18048. local slot = getMultiplayerPlayerControlledCharacterSlot(5,5)
  18049. multiplayerStartSwapPortraits(5,slot)
  18050. "
  18051. actionSimpleDrop
  18052. "
  18053. multiplayerStopSwapPortraits(5)
  18054. "
  18055. }
  18056. button
  18057. {
  18058. area 402 551 25 38
  18059. bitmap lua 'getMultiplayerPlayerControlledCharacter(5,6)'
  18060. sequence 1
  18061. align center center
  18062. actionSimpleDrag
  18063. "
  18064. local slot = getMultiplayerPlayerControlledCharacterSlot(5,6)
  18065. multiplayerStartSwapPortraits(5,slot)
  18066. "
  18067. actionSimpleDrop
  18068. "
  18069. multiplayerStopSwapPortraits(5)
  18070. "
  18071. }
  18072. --player 6
  18073. button
  18074. {
  18075. area 247 602 180 38
  18076. actionSimpleDrop
  18077. "
  18078. multiplayerStopSwapPortraits(6)
  18079. "
  18080. }
  18081. button
  18082. {
  18083. area 247 602 25 38
  18084. bitmap lua 'getMultiplayerPlayerControlledCharacter(6,1)'
  18085. sequence 1
  18086. align center center
  18087. actionSimpleDrag
  18088. "
  18089. local slot = getMultiplayerPlayerControlledCharacterSlot(6,1)
  18090. multiplayerStartSwapPortraits(6,slot)
  18091. "
  18092. actionSimpleDrop
  18093. "
  18094. multiplayerStopSwapPortraits(6)
  18095. "
  18096. }
  18097. button
  18098. {
  18099. area 278 602 25 38
  18100. bitmap lua 'getMultiplayerPlayerControlledCharacter(6,2)'
  18101. sequence 1
  18102. align center center
  18103. actionSimpleDrag
  18104. "
  18105. local slot = getMultiplayerPlayerControlledCharacterSlot(6,2)
  18106. multiplayerStartSwapPortraits(6,slot)
  18107. "
  18108. actionSimpleDrop
  18109. "
  18110. multiplayerStopSwapPortraits(6)
  18111. "
  18112. }
  18113. button
  18114. {
  18115. area 309 602 25 38
  18116. bitmap lua 'getMultiplayerPlayerControlledCharacter(6,3)'
  18117. sequence 1
  18118. align center center
  18119. actionSimpleDrag
  18120. "
  18121. local slot = getMultiplayerPlayerControlledCharacterSlot(6,3)
  18122. multiplayerStartSwapPortraits(6,slot)
  18123. "
  18124. actionSimpleDrop
  18125. "
  18126. multiplayerStopSwapPortraits(6)
  18127. "
  18128. }
  18129. button
  18130. {
  18131. area 340 602 25 38
  18132. bitmap lua 'getMultiplayerPlayerControlledCharacter(6,4)'
  18133. sequence 1
  18134. align center center
  18135. actionSimpleDrag
  18136. "
  18137. local slot = getMultiplayerPlayerControlledCharacterSlot(6,4)
  18138. multiplayerStartSwapPortraits(6,slot)
  18139. "
  18140. actionSimpleDrop
  18141. "
  18142. multiplayerStopSwapPortraits(6)
  18143. "
  18144. }
  18145. button
  18146. {
  18147. area 371 602 25 38
  18148. bitmap lua 'getMultiplayerPlayerControlledCharacter(6,5)'
  18149. sequence 1
  18150. align center center
  18151. actionSimpleDrag
  18152. "
  18153. local slot = getMultiplayerPlayerControlledCharacterSlot(6,5)
  18154. multiplayerStartSwapPortraits(6,slot)
  18155. "
  18156. actionSimpleDrop
  18157. "
  18158. multiplayerStopSwapPortraits(6)
  18159. "
  18160. }
  18161. button
  18162. {
  18163. area 402 602 25 38
  18164. bitmap lua 'getMultiplayerPlayerControlledCharacter(6,6)'
  18165. sequence 1
  18166. align center center
  18167. actionSimpleDrag
  18168. "
  18169. local slot = getMultiplayerPlayerControlledCharacterSlot(6,6)
  18170. multiplayerStartSwapPortraits(6,slot)
  18171. "
  18172. actionSimpleDrop
  18173. "
  18174. multiplayerStopSwapPortraits(6)
  18175. "
  18176. }
  18177.  
  18178. label -- game name
  18179. {
  18180. area 40 84 454 56
  18181. text lua "multiplayerSessionName"
  18182. text style 'label'
  18183. }
  18184. label -- new game type/save name
  18185. {
  18186. area 206 140 288 44
  18187. text lua "multiplayerSaveName"
  18188. text style 'label'
  18189. align left center
  18190. }
  18191. label -- chapter
  18192. {
  18193. area 206 180 288 44
  18194. text lua "multiplayerChapter"
  18195. text style 'label'
  18196. align left center
  18197. }
  18198. label -- time played
  18199. {
  18200. area 206 220 288 44
  18201. text lua "multiplayerTimePlayed"
  18202. text style 'label'
  18203. align left center
  18204. }
  18205. label -- difficulty
  18206. {
  18207. area 206 260 288 44
  18208. text lua "multiplayerDifficultyLabel"
  18209. text style 'label'
  18210. align left center
  18211. }
  18212. label -- other difficulty
  18213. {
  18214. area 40 140 166 164
  18215. bam "GUIDIFF"
  18216. frame lua "multiplayerDifficultyImage"
  18217. sequence 0
  18218. align center center
  18219. }
  18220.  
  18221. button
  18222. {
  18223. area 740 706 200 40
  18224. bam 'GUIBUTNT'
  18225. sequence 1
  18226. text "START_GAME_BUTTON" -- Done
  18227. text style 'button'
  18228. clickable lua "multiplayer.donebuttonclickable"
  18229. enabled "not multiplayerFromInGame"
  18230. tooltip lua "getStartGameButtonTooltip()"
  18231. action
  18232. "
  18233. multiplayerScreen:OnMainDoneButtonClick(mulitplayerPreexistingDifficulty)
  18234. "
  18235. }
  18236. button
  18237. {
  18238. on escape
  18239. area 740 706 200 40
  18240. bam 'GUIBUTNT'
  18241. sequence 1
  18242. text "DONE_BUTTON" -- Done
  18243. text style 'button'
  18244. clickable lua "multiplayer.donebuttonclickable"
  18245. enabled "multiplayerFromInGame"
  18246. tooltip lua "getStartGameButtonTooltip()"
  18247. action
  18248. "
  18249. multiplayerScreen:OnMainDoneButtonClick(mulitplayerPreexistingDifficulty)
  18250. "
  18251. }
  18252. button
  18253. {
  18254. area 82 706 200 40
  18255. bam 'GUIBUTNT'
  18256. sequence 0
  18257. text "LOGOUT_BUTTON" -- Logout
  18258. text style 'button'
  18259. action
  18260. "
  18261. multiplayerScreen:OnLogoutButtonClick()
  18262. "
  18263. }
  18264. button
  18265. {
  18266. area 298 652 200 40
  18267. bam 'GUIBUTNT'
  18268. sequence 0
  18269. text "MULTIPLAYER_GAME_OPTIONS_BUTTON"
  18270. text style 'button'
  18271. enabled "multiplayerLocalPlayerID == 1"
  18272. action
  18273. "
  18274. helpTextString = Infinity_FetchString(11323)
  18275. Infinity_PushMenu('MP_OPTIONS')
  18276. "
  18277. }
  18278.  
  18279. --dragged portrait
  18280. label
  18281. {
  18282. name "multiplayerDraggingPortraitImage"
  18283. area -20 -20 37 57
  18284. bitmap lua 'mpDraggedPortrait'
  18285. sequence 1
  18286. align center center
  18287. enabled "multiplayerUpdateDraggedPortrait()"
  18288. }
  18289. }
  18290. `
  18291. multiplayerPermissions =
  18292. {
  18293. {'MULTIPLAYER_PERMISSIONS_MODIFY', 'MULTIPLAYER_PERMISSIONS_MODIFY_TOOLTIP', false, false, 7},
  18294. {'MULTIPLAYER_PERMISSIONS_GOLD', 'MULTIPLAYER_PERMISSIONS_GOLD_TOOLTIP', false, false, 0},
  18295. {'MULTIPLAYER_PERMISSIONS_TRAVEL', 'MULTIPLAYER_PERMISSIONS_TRAVEL_TOOLTIP', false, false, 1},
  18296. {'MULTIPLAYER_PERMISSIONS_VIEW', 'MULTIPLAYER_PERMISSIONS_VIEW_TOOLTIP', false, false, 3},
  18297. {'MULTIPLAYER_PERMISSIONS_DIALOGUE','MULTIPLAYER_PERMISSIONS_DIALOGUE_TOOLTIP', false, false, 2},
  18298. {'MULTIPLAYER_PERMISSIONS_PAUSE', 'MULTIPLAYER_PERMISSIONS_PAUSE_TOOLTIP', false, false, 4}
  18299. }
  18300.  
  18301. function broadcastPermissionChange(player,permission,setting)
  18302. local player = getMultiplayerPlayerName(player,false,true)
  18303. local todo = t(multiplayerPermissions[permission][1])
  18304. setStringTokenLua("<PLAYER_NAME_1>",player)
  18305. setStringTokenLua("<PERMISSION>",todo)
  18306. if setting == true then
  18307. message = t("MULTIPLAYER_IS_NOW_PERMITTED")
  18308. else
  18309. message = t("MULTIPLAYER_IS_NOT_PERMITTED")
  18310. end
  18311. removeStringTokenLua("<PLAYER_NAME_1>")
  18312. removeStringTokenLua("<PERMISSION>")
  18313. print(message)
  18314. Infinity_SendChatMessage(message, true)
  18315. end
  18316.  
  18317. function getMultiplayerPlayerPermissionDescription()
  18318. local player = getMultiplayerPlayerName(multiplayerInPermissionForPlayer,false,false)
  18319. setStringTokenLua("<PLAYER_NAME_1>",player)
  18320. local canPerform = t("MULTIPLAYER_CAN_PERFORM")
  18321. removeStringTokenLua("<PLAYER_NAME_1>")
  18322.  
  18323. return canPerform
  18324. end
  18325. `
  18326. menu
  18327. {
  18328. name 'MP_PERMISSIONS'
  18329. align center center
  18330. modal
  18331. onOpen
  18332. "
  18333. local index = 1
  18334. for index = 0, #(multiplayer.player[multiplayerInPermissionForPlayer].permissions), 1 do
  18335. local luaIndex = -1
  18336. local loopLuaIndex = -1
  18337.  
  18338. for loopLuaIndex = 1, #multiplayerPermissions, 1 do
  18339. if multiplayerPermissions[loopLuaIndex][5] == index then
  18340. luaIndex = loopLuaIndex
  18341. break
  18342. end
  18343. end
  18344.  
  18345. if luaIndex ~= -1 then
  18346. if multiplayer.player[multiplayerInPermissionForPlayer].permissions[index] == true then
  18347. multiplayerPermissions[luaIndex][3] = true
  18348. multiplayerPermissions[luaIndex][4] = true
  18349. elseif multiplayer.player[multiplayerInPermissionForPlayer].permissions[index] == false then
  18350. multiplayerPermissions[luaIndex][3] = false
  18351. multiplayerPermissions[luaIndex][4] = false
  18352. else
  18353. multiplayerPermissions[luaIndex][3] = false
  18354. multiplayerPermissions[luaIndex][4] = false
  18355. end
  18356. end
  18357. end
  18358. "
  18359.  
  18360. label
  18361. {
  18362. mosaic 'RECENTEV'
  18363. area 2 -2 664 668
  18364. }
  18365. label
  18366. {
  18367. area 106 70 458 44
  18368. text "PERMISSIONS_TITLE"
  18369. text style "title"
  18370. }
  18371.  
  18372. label
  18373. {
  18374. area 106 114 458 44
  18375. text lua "getMultiplayerPlayerPermissionDescription()"
  18376. text style "title"
  18377. }
  18378.  
  18379. button
  18380. {
  18381. bam GUIOSW
  18382. on esc
  18383. area 616 6 44 44
  18384. sequence 2
  18385. action
  18386. "
  18387. multiplayerScreen:OnCancelButtonClick()
  18388. Infinity_PopMenu()
  18389. "
  18390. }
  18391.  
  18392. --bottom buttons
  18393. button
  18394. {
  18395. on escape
  18396. area 236 528 200 40
  18397. bam 'GUIBUTNT'
  18398. sequence 0
  18399. text "CANCEL_BUTTON" -- Back
  18400. text style 'button'
  18401. action
  18402. "
  18403. multiplayerScreen:OnCancelButtonClick()
  18404. Infinity_PopMenu()
  18405. "
  18406. }
  18407. button
  18408. {
  18409. on return
  18410. area 236 572 200 40
  18411. bam 'GUIBUTNT'
  18412. sequence 1
  18413. text "DONE_BUTTON" -- Done
  18414. text style 'button'
  18415. enabled "multiplayerLocalPlayerID == 1"
  18416. action
  18417. "
  18418. local index = 1
  18419. for index = #(multiplayerPermissions), 1, -1 do
  18420. if multiplayerPermissions[index][3] ~= multiplayerPermissions[index][4] then
  18421. broadcastPermissionChange(multiplayerInPermissionForPlayer,index,multiplayerPermissions[index][3])
  18422. multiplayerScreen:OnPermissionButtonClick(multiplayerInPermissionForPlayer - 1, multiplayerPermissions[index][5])
  18423. end
  18424. end
  18425.  
  18426. multiplayerInPermission = false
  18427. multiplayerScreen:OnDoneButtonClick()
  18428. Infinity_PopMenu()
  18429. "
  18430. }
  18431.  
  18432. --permissions
  18433. button
  18434. {
  18435. area 268 178 32 32
  18436. bam ROUNDBUT
  18437. sequence 0
  18438. glow lua "multiplayerPermissions[1][3] == true"
  18439. tooltip lua "t(multiplayerPermissions[1][2])"
  18440. scaleToClip
  18441. action
  18442. "
  18443. if multiplayerLocalPlayerID == 1 then
  18444. multiplayerPermissions[1][3] = not multiplayerPermissions[1][3]
  18445. end
  18446. "
  18447. }
  18448. text
  18449. {
  18450. area 306 166 212 56
  18451. text lua "t(multiplayerPermissions[1][1])"
  18452. tooltip lua "t(multiplayerPermissions[1][2])"
  18453. text style "normal"
  18454. align left center
  18455. }
  18456. button
  18457. {
  18458. area 268 233 32 32
  18459. bam ROUNDBUT
  18460. sequence 0
  18461. glow lua "multiplayerPermissions[2][3] == true"
  18462. tooltip lua "t(multiplayerPermissions[2][2])"
  18463. scaleToClip
  18464. action
  18465. "
  18466. if multiplayerLocalPlayerID == 1 then
  18467. multiplayerPermissions[2][3] = not multiplayerPermissions[2][3]
  18468. end
  18469. "
  18470. }
  18471. text
  18472. {
  18473. area 306 222 212 56
  18474. text lua "t(multiplayerPermissions[2][1])"
  18475. tooltip lua "t(multiplayerPermissions[2][2])"
  18476. text style "normal"
  18477. align left center
  18478. }
  18479. button
  18480. {
  18481. area 268 289 32 32
  18482. bam ROUNDBUT
  18483. sequence 0
  18484. glow lua "multiplayerPermissions[3][3] == true"
  18485. tooltip lua "t(multiplayerPermissions[3][2])"
  18486. scaleToClip
  18487. action
  18488. "
  18489. if multiplayerLocalPlayerID == 1 then
  18490. multiplayerPermissions[3][3] = not multiplayerPermissions[3][3]
  18491. end
  18492. "
  18493. }
  18494. text
  18495. {
  18496. area 306 278 212 56
  18497. text lua "t(multiplayerPermissions[3][1])"
  18498. tooltip lua "t(multiplayerPermissions[3][2])"
  18499. text style "normal"
  18500. align left center
  18501. }
  18502. button
  18503. {
  18504. area 268 347 32 32
  18505. bam ROUNDBUT
  18506. sequence 0
  18507. glow lua "multiplayerPermissions[4][3] == true"
  18508. tooltip lua "t(multiplayerPermissions[4][2])"
  18509. scaleToClip
  18510. action
  18511. "
  18512. if multiplayerLocalPlayerID == 1 then
  18513. multiplayerPermissions[4][3] = not multiplayerPermissions[4][3]
  18514. end
  18515. "
  18516. }
  18517. text
  18518. {
  18519. area 306 334 212 56
  18520. text lua "t(multiplayerPermissions[4][1])"
  18521. tooltip lua "t(multiplayerPermissions[4][2])"
  18522. text style "normal"
  18523. align left center
  18524. }
  18525. button
  18526. {
  18527. area 268 401 32 32
  18528. bam ROUNDBUT
  18529. sequence 0
  18530. glow lua "multiplayerPermissions[5][3] == true"
  18531. tooltip lua "t(multiplayerPermissions[5][2])"
  18532. scaleToClip
  18533. action
  18534. "
  18535. if multiplayerLocalPlayerID == 1 then
  18536. multiplayerPermissions[5][3] = not multiplayerPermissions[5][3]
  18537. end
  18538. "
  18539. }
  18540. text
  18541. {
  18542. area 306 390 212 56
  18543. text lua "t(multiplayerPermissions[5][1])"
  18544. tooltip lua "t(multiplayerPermissions[5][2])"
  18545. text style "normal"
  18546. align left center
  18547. }
  18548. button
  18549. {
  18550. area 268 459 32 32
  18551. bam ROUNDBUT
  18552. sequence 0
  18553. glow lua "multiplayerPermissions[6][3] == true"
  18554. tooltip lua "t(multiplayerPermissions[6][2])"
  18555. scaleToClip
  18556. action
  18557. "
  18558. if multiplayerLocalPlayerID == 1 then
  18559. multiplayerPermissions[6][3] = not multiplayerPermissions[6][3]
  18560. end
  18561. "
  18562. }
  18563. text
  18564. {
  18565. area 306 446 212 56
  18566. text lua "t(multiplayerPermissions[6][1])"
  18567. tooltip lua "t(multiplayerPermissions[6][2])"
  18568. text style "normal"
  18569. align left center
  18570. }
  18571. }
  18572. `
  18573. multiplayerGameOptions =
  18574. {
  18575. {"LISTEN_JOIN_LABEL", "LISTEN_JOIN_TOOLTIP", false, false},
  18576. {"ALLOW_REFORM_LABEL", "ALLOW_REFORM_TOOLTIP", false, false}
  18577. }
  18578. multiplayerImportOptions =
  18579. {
  18580. {"MULTIPLAYER_IMPORT_CHARACTER_RULES_SEI"},
  18581. {"MULTIPLAYER_IMPORT_CHARACTER_RULES_SE"},
  18582. {"MULTIPLAYER_IMPORT_CHARACTER_RULES_S"}
  18583. }
  18584. multiplayerImportOption = 0
  18585.  
  18586. function broadcastOptionChange(slot, onOff)
  18587. if multiplayerLocalPlayerID == 1 then
  18588. local message = ""
  18589. if slot < 3 then
  18590. local setting = t(multiplayerGameOptions[slot][1])
  18591. setStringTokenLua("<SESSION_RULES>",setting)
  18592. if onOff == true then
  18593. message = t("MULTIPLAYER_GAME_WILL_NOW")
  18594. else
  18595. message = t("MULTIPLAYER_GAME_WILL_NO_LONGER")
  18596. end
  18597. removeStringTokenLua("<SESSION_RULES>")
  18598. else
  18599. local setting = t(multiplayerImportOptions[slot-2][1])
  18600. setStringTokenLua("<IMPORT_RULES>",setting)
  18601. message = t("MULTIPLAYER_IMPORT_SETTINGS_CHANGE")
  18602. removeStringTokenLua("<IMPORT_RULES>")
  18603. end
  18604. print(message)
  18605. Infinity_SendChatMessage(message, true)
  18606. end
  18607. end
  18608. `
  18609. menu
  18610. {
  18611. name 'MP_OPTIONS'
  18612. align center center
  18613. modal
  18614. onOpen
  18615. "
  18616. multiplayerGameOptions[1][3] = multiplayer.listentojoin
  18617. multiplayerGameOptions[1][4] = multiplayerGameOptions[1][3]
  18618. multiplayerGameOptions[2][3] = multiplayer.allowreformparty
  18619. multiplayerGameOptions[2][4] = multiplayerGameOptions[2][3]
  18620. multiplayerImportOption = multiplayer.importsetting + 1
  18621. "
  18622.  
  18623. label
  18624. {
  18625. mosaic 'RECENTEV'
  18626. area 2 -2 664 668
  18627. }
  18628. label
  18629. {
  18630. area 106 68 460 44
  18631. text "OPTIONS_TITLE"
  18632. text style "title"
  18633. }
  18634. label
  18635. {
  18636. area 74 262 516 56
  18637. text "MULTIPLAYER_IMPORT_CHARACTER_RULES_LABEL"
  18638. text style "title"
  18639. align center center
  18640. }
  18641.  
  18642. button
  18643. {
  18644. area 210 148 32 32
  18645. bam ROUNDBUT
  18646. sequence 0
  18647. glow lua "multiplayerGameOptions[1][3] == true"
  18648. tooltip lua "t(multiplayerGameOptions[1][2])"
  18649. scaleToClip
  18650. action
  18651. "
  18652. multiplayerGameOptions[1][3] = not multiplayerGameOptions[1][3]
  18653. "
  18654. }
  18655. text
  18656. {
  18657. area 252 142 303 42
  18658. text lua "t(multiplayerGameOptions[1][1])"
  18659. text style "normal"
  18660. tooltip lua "t(multiplayerGameOptions[1][2])"
  18661. align left center
  18662. }
  18663. button
  18664. {
  18665. area 210 202 32 32
  18666. bam ROUNDBUT
  18667. sequence 0
  18668. glow lua "multiplayerGameOptions[2][3] == true"
  18669. tooltip lua "t(multiplayerGameOptions[2][2])"
  18670. scaleToClip
  18671. action
  18672. "
  18673. multiplayerGameOptions[2][3] = not multiplayerGameOptions[2][3]
  18674. "
  18675. }
  18676. text
  18677. {
  18678. area 252 196 303 42
  18679. text lua "t(multiplayerGameOptions[2][1])"
  18680. text style "normal"
  18681. tooltip lua "t(multiplayerGameOptions[2][2])"
  18682. align left center
  18683. }
  18684.  
  18685. button
  18686. {
  18687. area 210 332 32 32
  18688. bam ROUNDBUT
  18689. frame lua "currentCellCheck(3)"
  18690. sequence 0
  18691. glow lua "multiplayerImportOption == 1"
  18692. tooltip lua "t('IMPORT_RULES_TOOLTIP')"
  18693. scaleToClip
  18694. action
  18695. "
  18696. multiplayerImportOption = 1
  18697. "
  18698. }
  18699. text
  18700. {
  18701. area 252 326 303 42
  18702. text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_SEI')"
  18703. tooltip lua "t('IMPORT_RULES_TOOLTIP')"
  18704. text style "normal"
  18705. align left center
  18706. }
  18707. button
  18708. {
  18709. area 210 380 32 32
  18710. bam ROUNDBUT
  18711. frame lua "currentCellCheck(3)"
  18712. sequence 0
  18713. glow lua "multiplayerImportOption == 2"
  18714. tooltip lua "t('IMPORT_RULES_TOOLTIP')"
  18715. scaleToClip
  18716. action
  18717. "
  18718. multiplayerImportOption = 2
  18719. "
  18720. }
  18721. text
  18722. {
  18723. area 252 374 303 42
  18724. text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_SE')"
  18725. tooltip lua "t('IMPORT_RULES_TOOLTIP')"
  18726. text style "normal"
  18727. align left center
  18728. }
  18729. button
  18730. {
  18731. area 210 428 32 32
  18732. bam ROUNDBUT
  18733. frame lua "currentCellCheck(3)"
  18734. sequence 0
  18735. glow lua "multiplayerImportOption == 3"
  18736. tooltip lua "t('IMPORT_RULES_TOOLTIP')"
  18737. scaleToClip
  18738. action
  18739. "
  18740. multiplayerImportOption = 3
  18741. "
  18742. }
  18743. text
  18744. {
  18745. area 252 422 212 42
  18746. text lua "t('MULTIPLAYER_IMPORT_CHARACTER_RULES_S')"
  18747. tooltip lua "t('IMPORT_RULES_TOOLTIP')"
  18748. text style "normal"
  18749. align left center
  18750. }
  18751.  
  18752. button
  18753. {
  18754. bam GUIOSW
  18755. on esc
  18756. area 616 4 44 44
  18757. sequence 2
  18758. action
  18759. "
  18760. multiplayerScreen:OnCancelButtonClick()
  18761. Infinity_PopMenu()
  18762. "
  18763. }
  18764.  
  18765. --bottom buttons
  18766. button
  18767. {
  18768. on return
  18769. area 236 572 200 40
  18770. bam 'GUIBUTNT'
  18771. sequence 0
  18772. text "DONE_BUTTON" -- Done
  18773. text style 'button'
  18774. action
  18775. "
  18776. if multiplayerImportOption ~= multiplayer.importsetting + 1 then
  18777. multiplayerScreen:SetImportSetting(multiplayerImportOption - 1)
  18778. broadcastOptionChange(multiplayerImportOption+2)
  18779. end
  18780.  
  18781. if multiplayerGameOptions[1][3] ~= multiplayerGameOptions[1][4] then
  18782. broadcastOptionChange(1, multiplayerGameOptions[1][3])
  18783. multiplayerScreen:ToggleListenToJoin()
  18784. end
  18785.  
  18786. if multiplayerGameOptions[2][3] ~= multiplayerGameOptions[2][4] then
  18787. broadcastOptionChange(2, multiplayerGameOptions[2][3])
  18788. multiplayerScreen:ToggleAllowReformParty()
  18789. end
  18790.  
  18791. Infinity_PopMenu()
  18792. "
  18793. }
  18794. button
  18795. {
  18796. on escape
  18797. area 236 528 200 40
  18798. bam 'GUIBUTNT'
  18799. sequence 1
  18800. text "CANCEL_BUTTON" -- Cancel
  18801. text style 'button'
  18802. action
  18803. "
  18804. multiplayerScreen:OnCancelButtonClick()
  18805. Infinity_PopMenu()
  18806. "
  18807. }
  18808. }
  18809. `
  18810. function getActivePlayerIndex(index)
  18811. local ret = -1
  18812. local count = 0
  18813. local slot = 0
  18814.  
  18815. for slot = 1, 6, 1 do
  18816. if mpaPlayers[slot]["name"] ~= '' then
  18817. count = count + 1
  18818. end
  18819. if count == index then
  18820. ret = slot
  18821. break
  18822. end
  18823. end
  18824.  
  18825. return ret
  18826. end
  18827. `
  18828. menu
  18829. {
  18830. name 'MP_PICKPLAYER'
  18831. align center center
  18832. modal
  18833. label
  18834. {
  18835. mosaic 'RECENTEV'
  18836. area 0 0 664 662
  18837. }
  18838. label
  18839. {
  18840. area 104 70 456 44
  18841. text "SELECT_PLAYER_TITLE"
  18842. text style "title"
  18843. }
  18844. label
  18845. {
  18846. area 98 162 470 46
  18847. text "SELECT_PLAYER_DESCRIPTION"
  18848. text style "title"
  18849. }
  18850.  
  18851. -- list
  18852. list
  18853. {
  18854. column
  18855. {
  18856. width 100
  18857. label
  18858. {
  18859. area 0 0 340 32
  18860. text lua "getMultiplayerPlayerName(getActivePlayerIndex(rowNumber), false, true)"
  18861. text style "normal"
  18862. align left center
  18863. }
  18864. }
  18865.  
  18866. action
  18867. "
  18868. "
  18869.  
  18870. rowheight 32
  18871. area 202 218 258 280
  18872. table "multiplayer.player"
  18873. var currentMultiplayerSelectPlayer
  18874. }
  18875.  
  18876. button
  18877. {
  18878. bam GUIOSW
  18879. on esc
  18880. area 616 6 44 44
  18881. sequence 2
  18882. action
  18883. "
  18884. Infinity_PopMenu()
  18885. "
  18886. }
  18887.  
  18888. button
  18889. {
  18890. on escape
  18891. area 236 512 198 40
  18892. text "CANCEL_BUTTON"
  18893. text style "button"
  18894. align center center
  18895. bam 'GUIBUTNT'
  18896. sequence 0
  18897. action
  18898. "
  18899. Infinity_PopMenu()
  18900. "
  18901. }
  18902. button
  18903. {
  18904. on escape
  18905. area 236 564 198 40
  18906. text "DONE_BUTTON"
  18907. text style "button"
  18908. align center center
  18909. bam 'GUIBUTNT'
  18910. sequence 0
  18911. action
  18912. "
  18913. if mpaCharacters[selectedCharacter]['ready'] == true and mpaCharacters[selectedCharacter]['player'] ~= getActivePlayerIndex(currentMultiplayerSelectPlayer) then
  18914. multiplayerScreen:OnReadyButtonClick(selectedCharacter-1)
  18915. end
  18916. broadcastCharacterControlChange(selectedCharacter, getActivePlayerIndex(currentMultiplayerSelectPlayer))
  18917. multiplayerScreen:OnPlayerSelection(getActivePlayerIndex(currentMultiplayerSelectPlayer)-1)
  18918. Infinity_PopMenu()
  18919. "
  18920. }
  18921. }
  18922. `
  18923. function multiplayerIsDelete ()
  18924. if (multiplayer.character[mpModifyingCharacter+1].portrait ~= '') then
  18925. return t("DELETE_BUTTON")
  18926. else
  18927. return t("CREATE_BUTTON")
  18928. end
  18929. end
  18930. function getModifyConfirmationLabel()
  18931. print(mpModifyingCharacter+1)
  18932. return t('MULTIPLAYER_EDIT_CONFIRM').. ' ' .. getMultiplayerCharacterName(mpModifyingCharacter+1)
  18933. end
  18934. `
  18935. menu
  18936. {
  18937. name 'MP_MODIFYCHARACTER'
  18938. align center center
  18939. modal
  18940. label
  18941. {
  18942. mosaic 'GUIERR6'
  18943. area 0 0 682 238
  18944. }
  18945. label
  18946. {
  18947. area 26 18 598 120
  18948. text lua "getModifyConfirmationLabel()"
  18949. text style "title"
  18950. align center center
  18951. }
  18952. button
  18953. {
  18954. on escape
  18955. area 44 170 230 40
  18956. text "CANCEL_BUTTON" -- cancel
  18957. text style "button"
  18958. bam GUIBUTMT
  18959. action
  18960. "
  18961. Infinity_PopMenu()
  18962. "
  18963. }
  18964. button
  18965. {
  18966. on return
  18967. area 404 170 230 40
  18968. text lua "multiplayerIsDelete()"
  18969. text style "button"
  18970. bam GUIBUTMT
  18971. action
  18972. "
  18973. Infinity_PopMenu()
  18974. multiplayerScreen:SetModifiedCharacterSlot(mpModifyingCharacter)
  18975. if (multiplayer.character[mpModifyingCharacter+1].portrait ~= '') then
  18976. multiplayerScreen:OnModifyCharacterDelete()
  18977. else
  18978. multiplayerScreen:UpdateModifyCharacterPanel()
  18979. end
  18980. "
  18981. }
  18982. }
  18983.  
  18984. menu
  18985. {
  18986. name 'MP_ERRORONE'
  18987. align center center
  18988. modal
  18989. label
  18990. {
  18991. mosaic 'GUIERR6'
  18992. area 0 0 657 253
  18993. }
  18994. label
  18995. {
  18996. area 29 21 600 126
  18997. text lua "Infinity_FetchString( mpErrorText )"
  18998. text style "normal"
  18999. align center center
  19000. }
  19001. button
  19002. {
  19003. on return
  19004. area 213 170 230 40
  19005. text "DONE_BUTTON" -- done
  19006. text style "button"
  19007. align center center
  19008. bam GUIBUTMT
  19009. action
  19010. "
  19011. Infinity_PopMenu()
  19012. "
  19013. }
  19014. }
  19015.  
  19016. menu
  19017. {
  19018. name 'MP_ERRORTWO'
  19019. align center center
  19020. modal
  19021. label
  19022. {
  19023. mosaic 'GUIERR6'
  19024. area 0 0 657 253
  19025. }
  19026. label
  19027. {
  19028. area 29 21 600 126
  19029. text lua "Infinity_FetchString( mpErrorText )"
  19030. text style "normal"
  19031. align center center
  19032. }
  19033. button
  19034. {
  19035. on return
  19036. enabled "mpErrorState == 2"
  19037. area 343 170 230 40
  19038. text "MODIFY_BUTTON" -- modify
  19039. text style "button"
  19040. align center center
  19041. bam GUIBUTMT
  19042. action
  19043. "
  19044. Infinity_PopMenu()
  19045. multiplayerScreen:ModifyCharacters()
  19046. "
  19047. }
  19048. button
  19049. {
  19050. on return
  19051. enabled "mpErrorState == 3"
  19052. area 343 170 230 40
  19053. text "KICK_BUTTON" -- kick player
  19054. text style "button"
  19055. align center center
  19056. bam GUIBUTMT
  19057. action
  19058. "
  19059. Infinity_PopMenu()
  19060. multiplayerScreen:KickPlayer()
  19061. "
  19062. }
  19063. button
  19064. {
  19065. on return
  19066. enabled "mpErrorState == 4"
  19067. area 343 170 230 40
  19068. text "LOGOUT_BUTTON" -- log out
  19069. text style "button"
  19070. align center center
  19071. bam GUIBUTMT
  19072. action
  19073. "
  19074. local index = 1
  19075. Infinity_PopMenu()
  19076. multiplayerScreen:Logout()
  19077. "
  19078. }
  19079. button
  19080. {
  19081. on escape
  19082. area 79 170 230 40
  19083. text "CANCEL_BUTTON" -- cancel
  19084. text style "button"
  19085. align center center
  19086. bam GUIBUTMT
  19087. action
  19088. "
  19089. Infinity_PopMenu()
  19090. "
  19091. }
  19092. }
  19093. `
  19094. function dragMPChat(newY)
  19095. --do a quick bounds check.
  19096. local area = {Infinity_GetArea("mpChatDisplayBackground")}
  19097. if(area[4] + newY <= 150) then newY = 150 - area[4] end
  19098.  
  19099. area = {Infinity_GetArea("mpChatHandle")}
  19100. local screenWidth, screenHeight = Infinity_GetScreenSize()
  19101. if(area[2] + area[4] + newY > screenHeight) then newY = screenHeight - area[2] - area[4] end
  19102.  
  19103. adjustItemGroup({"mpChatDisplayBackground","mpChatDisplay"}, 0, 0, 0, newY)
  19104. adjustItemGroup({"mpChatEditBackground","mpChatEdit","mpChatHandle"}, 0, newY, 0 , 0)
  19105. end
  19106. mpChatTable = {}
  19107. showMpChat = 0
  19108. function updateChatViewed()
  19109. if(showMpChat == 0) then chatViewed = 0 end
  19110. end
  19111. function updateMPChatPreview(message)
  19112. if(showMpChat == 0) then table.insert(mpChatTable,{text = message}) end
  19113. end
  19114. function getMPMessageOpacity()
  19115. local current = mpChatTable[#mpChatTable]
  19116. if(current == nil) then
  19117. return 0
  19118. end
  19119. if(current.displayTime == nil) then
  19120. current.displayTime = 500
  19121.  
  19122. --set the box size
  19123. Infinity_ScaleToText("mpChatPreview")
  19124.  
  19125. --give some extra room for the padding
  19126. adjustItemGroup({"mpChatPreview"},0,0,0,16)
  19127. end
  19128. if(current.displayTime > 0) then
  19129. current.displayTime = current.displayTime - 4
  19130. end
  19131. if(current.displayTime > 255) then
  19132. return 255
  19133. else
  19134. return current.displayTime
  19135. end
  19136. end
  19137. function getMPMessage()
  19138. if(#mpChatTable > 0 and mpChatTable[#mpChatTable].displayTime ~= nil) then
  19139. return mpChatTable[#mpChatTable].text
  19140. end
  19141. return nil
  19142. end
  19143. function getChatIconOpacity()
  19144. if(chatViewed == 1) then return 255 end
  19145. local sinWave = math.sin(Infinity_GetFrameCounter() / 15)
  19146. local sinWaveAdjusted = (sinWave / 2) + 0.5
  19147. return sinWaveAdjusted * 255
  19148. end
  19149. function getChatBarTooltip()
  19150. if(showMpChat == 0) then
  19151. return t("MULTIPLAYER_CHAT_BAR_COLLAPSED")
  19152. else
  19153. return t("MULTIPLAYER_CHAT_BAR_EXPANDED")
  19154. end
  19155. end
  19156. function resizeMpEditBox()
  19157. Infinity_ScaleToText('mpChatEdit')
  19158. local x,y,w,h = Infinity_GetArea('mpChatEdit')
  19159. local offset = 20
  19160. if(h + offset < 42) then h = (42 - offset) end
  19161.  
  19162.  
  19163. Infinity_SetArea('mpChatEdit',x,y,w,h)
  19164. Infinity_SetArea('mpChatEditBackground',nil,nil,nil,h + offset)
  19165. Infinity_SetArea('mpChatHandle',nil,y+h+(offset/2),nil,nil)
  19166. end
  19167.  
  19168. function mpChatboxScroll(top, height, contentHeight)
  19169. if(mpChatboxJumpToBottom and contentHeight > height) then
  19170. mpChatboxJumpToBottom = nil
  19171. return height-contentHeight
  19172. end
  19173. if(mpChatboxScrollToBottom == 0 and mpChatboxScrollLastHeight == contentHeight) then
  19174. --defer to default scrolling
  19175. return nil
  19176. elseif mpChatboxScrollToBottom == 0 then
  19177. mpChatboxScrollLastHeight = contentHeight
  19178. return height-contentHeight
  19179. end
  19180. if(contentHeight < height) then
  19181. --no scrolling required, content fits
  19182. mpChatboxScrollToBottom = nil
  19183. return nil
  19184. end
  19185. local dT = Infinity_GetClockTicks() - mpChatboxScrollTimeLast
  19186. mpChatboxScrollTimeLast = Infinity_GetClockTicks()
  19187. top = top + lastTrimmedContentHeight
  19188. lastTrimmedContentHeight = 0
  19189. local newTop = (dT * -0.25) + top
  19190. if (newTop + contentHeight > height + 200) then
  19191. return (height - contentHeight + 200)
  19192. end
  19193. if(newTop + contentHeight < height) then
  19194. mpChatboxScrollToBottom = 0
  19195. return height - contentHeight
  19196. end
  19197. return newTop
  19198. end
  19199.  
  19200. mpChatboxScrollLastHeight = 0
  19201. mpChatboxScrollToBottom = nil
  19202. mpChatboxScrollTimeLast = 0
  19203. mpChatEditOverlay = ""
  19204. `
  19205. menu
  19206. {
  19207. name "MP_CHAT_OVERLAY"
  19208. enabled "e:IsMultiplayer()"
  19209. align right top
  19210. ignoreEsc
  19211. offset -120 0
  19212. onOpen
  19213. "
  19214. chatViewed = 1
  19215. "
  19216. label
  19217. {
  19218. name "mpChatDisplayBackground"
  19219. enabled "showMpChat"
  19220. area 0 0 300 281
  19221. rectangle 4
  19222. rectangle opacity 200
  19223. }
  19224. label
  19225. {
  19226. area 0 0 300 42
  19227. rectangle 0
  19228.  
  19229. }
  19230. label
  19231. {
  19232. area 10 8 28 28
  19233. bam "CHTICN"
  19234. frame 1
  19235. opacity lua "getChatIconOpacity()"
  19236.  
  19237. }
  19238. label
  19239. {
  19240. area 10 8 28 28
  19241. bam "CHTICN"
  19242. frame 0
  19243. opacity lua "255 - getChatIconOpacity()"
  19244. }
  19245. label
  19246. {
  19247. area 42 0 252 42
  19248. text "MULTIPLAYER_CHAT_LABEL"
  19249. text style "label"
  19250. }
  19251. button
  19252. {
  19253. area 0 0 300 42
  19254. toggle "showMpChat"
  19255. tooltip lua "getChatBarTooltip()"
  19256. action
  19257. "
  19258. chatViewed = 1
  19259. mpChatboxScrollToBottom = 1
  19260. if showMpChat == 1 then
  19261. Infinity_FocusTextEdit('mpChatEdit')
  19262. else
  19263. Infinity_FocusTextEdit('')
  19264. end
  19265. "
  19266. }
  19267.  
  19268. label
  19269. {
  19270. name "mpChatPreview"
  19271. enabled "showMpChat == 0"
  19272. opacity lua "getMPMessageOpacity()"
  19273. area 0 42 300 56
  19274. text style "normal"
  19275. text lua "getMPMessage()"
  19276. pad 8 8 8 8
  19277. rectangle 1
  19278. ignoreEvents
  19279. }
  19280. text
  19281. {
  19282. name "mpChatDisplay"
  19283. enabled "showMpChat"
  19284. area 20 46 258 180
  19285. text lua "mpChatText"
  19286. scrollbar 'GUISCRC'
  19287. scrollbar func "mpChatboxScroll"
  19288. text style normal
  19289. }
  19290. label
  19291. {
  19292. name "mpChatEditBackground"
  19293. enabled "showMpChat"
  19294. area 0 233 300 48
  19295. rectangle 0
  19296. }
  19297. edit
  19298. {
  19299. name "mpChatEdit"
  19300. enabled "showMpChat"
  19301. area 10 243 290 28
  19302. var mpChatEditOverlay
  19303. scrollbar 'GUISCRC'
  19304. text style "edit"
  19305. maxchars 255
  19306. fill 112 111 111 64
  19307. action
  19308. "
  19309. --On return pressed
  19310. if (key_pressed == 13) then
  19311. if (mpChatEditOverlay ~= '') then
  19312. Infinity_SendChatMessage(mpChatEditOverlay, false)
  19313. Infinity_PlaySound('WAL_19B')
  19314. mpChatEditOverlay=''
  19315. resizeMpEditBox()
  19316. mpChatboxScrollToBottom = 1
  19317. return -1
  19318. end
  19319. end
  19320. return 1
  19321. "
  19322. actionalt
  19323. "
  19324. resizeMpEditBox()
  19325. "
  19326. }
  19327. handle
  19328. {
  19329. name "mpChatHandle"
  19330. area 104 281 95 36
  19331. bam "MPCHATAB"
  19332. enabled "showMpChat"
  19333. tooltip lua "t('MULTIPLAYER_CHAT_RESIZE_TOOLTIP')"
  19334. actionDrag
  19335. "
  19336. dragMPChat(motionY)
  19337. "
  19338. }
  19339. }
  19340. `
  19341. function reinitQuests()
  19342. for questIdx, quest in pairs(quests) do
  19343. local noquest = true
  19344. for objIdx,objective in pairs(quest.objectives) do
  19345. local noobjective = true
  19346. for entryIdx,entry in pairs(objective.entries) do
  19347. if quests[questIdx].objectives[objIdx].entries[entryIdx].stateType ~= const.ENTRY_TYPE_NONE and quests[questIdx].objectives[objIdx].entries[entryIdx].stateType ~= nil then
  19348. noobjective = false
  19349. end
  19350. end
  19351. if noobjective then
  19352. quests[questIdx].objectives[objIdx].stateType = const.ENTRY_TYPE_NONE
  19353. end
  19354. if quests[questIdx].objectives[objIdx].stateType ~= const.ENTRY_TYPE_NONE and quests[questIdx].objectives[objIdx].stateType ~= nil then
  19355. noquest = false
  19356. end
  19357. end
  19358. if noquest then
  19359. quests[questIdx].stateType = const.ENTRY_TYPE_NONE
  19360. end
  19361. end
  19362. end
  19363.  
  19364. function initQuests()
  19365. --instead of always searching the quests, just map entry ids to their quests
  19366. entryToQuest = {}
  19367. for questIdx, quest in pairs(quests) do
  19368. quests[questIdx].stateType = const.ENTRY_TYPE_NONE
  19369. for objIdx,objective in pairs(quest.objectives) do
  19370. quests[questIdx].objectives[objIdx].stateType = const.ENTRY_TYPE_NONE
  19371. for entryIdx,entry in pairs(objective.entries) do
  19372. quests[questIdx].objectives[objIdx].entries[entryIdx].stateType = const.ENTRY_TYPE_NONE
  19373. entryToQuest[entry.id] = questIdx
  19374. end
  19375. end
  19376. end
  19377. end
  19378.  
  19379. function compareByRecvTime(o1,o2)
  19380. if(not o1.recvTime and not o2.recvTime) then return false end
  19381. if(not o1.recvTime) then return false end
  19382. if(not o2.recvTime) then return true end
  19383. return o1.recvTime > o2.recvTime
  19384. end
  19385.  
  19386. function buildEntry(text, recvTime, stateType, chapter, timeStamp)
  19387. local entry =
  19388. {
  19389. text = text,
  19390. recvTime = recvTime,
  19391. stateType = stateType,
  19392. timeStamp = timeStamp,
  19393. chapters = {}
  19394. }
  19395. entry.chapters[chapter] = 1
  19396. return entry
  19397. end
  19398.  
  19399. --Update a journal entry by the strref/journalId
  19400. function updateJournalEntry(journalId, recvTime, stateType, chapter, timeStamp)
  19401. if(stateType == const.ENTRY_TYPE_USER) then
  19402. local entry = buildEntry(journalId, recvTime, stateType, chapter, timeStamp)
  19403. table.insert(userNotes,entry)
  19404.  
  19405. --update display data
  19406. buildQuestDisplay()
  19407. return
  19408. end
  19409. --find the quest that is parent to this entry.
  19410. --NOTE this can be placed in a loop if there needs to be more than quest to an entry
  19411. --this would just mean entryToQuest returns a table that we iterate over
  19412. local questId = entryToQuest[journalId]
  19413. if questId == nil or stateType == const.ENTRY_TYPE_INFO then
  19414. --add loose entries into the looseEntries table so they still get displayed.
  19415. for _,entry in pairs(looseEntries) do
  19416. if entry.text == journalId then
  19417. return
  19418. end
  19419. end
  19420. local entry = buildEntry(journalId, recvTime, stateType, chapter, timeStamp)
  19421. table.insert(looseEntries,entry)
  19422.  
  19423. --update display data
  19424. buildQuestDisplay()
  19425. return
  19426. end
  19427.  
  19428. local quest = quests[questId]
  19429. if quest == nil then
  19430. print("JOURNAL ERROR - no quest entry associated with questId "..questId)
  19431. return
  19432. end
  19433. local previous = nil
  19434. --traverse quest to find objective and entry
  19435. for objIdx,objective in pairs(quest.objectives) do
  19436. for entryIdx,entry in pairs(objective.entries) do
  19437. if(entry.id == journalId) then
  19438. --now we know where our quest, objective, and entry are
  19439. --update quest, objective and entry appropriately
  19440. entry.recvTime = recvTime
  19441. entry.stateType = stateType
  19442. if(not entry.chapters) then entry.chapters = {} end
  19443. entry.chapters[chapter] = 1
  19444. entry.timeStamp = timeStamp
  19445. objective.entries[entryIdx] = entry
  19446.  
  19447. objective.recvTime = recvTime
  19448. if(not objective.chapters) then objective.chapters = {} end
  19449. objective.chapters[chapter] = 1
  19450. if(objective.stateType ~= const.ENTRY_TYPE_COMPLETE) then
  19451. objective.stateType = stateType
  19452. end
  19453. quest.objectives[objIdx] = objective
  19454.  
  19455. quest.recvTime = recvTime
  19456. if(not quest.chapters) then quest.chapters = {} end
  19457. quest.chapters[chapter] = 1
  19458. if(quest.stateType ~= const.ENTRY_TYPE_COMPLETE) then
  19459. quest.stateType = stateType
  19460. end
  19461.  
  19462. --mark any previous objective as complete
  19463. if(entry.previous ~= nil) then
  19464. for objIdx2,objective2 in pairs(quest.objectives) do
  19465. for k, prevObj in pairs(entry.previous) do
  19466. if(prevObj == objective2.text) then
  19467. quest.objectives[objIdx2].stateType = const.ENTRY_TYPE_COMPLETE
  19468. end
  19469. end
  19470. end
  19471. end
  19472.  
  19473. quests[questId] = quest
  19474.  
  19475. --remove all in subgroup (except myself!)
  19476. if(stateType == const.JOURNAL_STATE_COMPLETE and entry.subGroup) then
  19477. for k,v in pairs(subGroups[entry.subGroup]) do
  19478. if(v.id ~= entry.id) then
  19479. removeJournalEntry(v.id)
  19480. end
  19481. end
  19482. end
  19483.  
  19484. end
  19485. end
  19486. end
  19487. --sort the objectives.
  19488. table.sort(quest.objectives,compareByRecvTime)
  19489.  
  19490. --update display data
  19491. buildQuestDisplay()
  19492. end
  19493. function checkEntryComplete(journalId, stateType)
  19494. --Check if a journal entry is part of a quest that's already complete
  19495.  
  19496. --If anything other than an unfinished entry return false.
  19497. if(stateType ~= const.ENTRY_TYPE_INPROGRESS) then return false end
  19498.  
  19499. --Check if my quest is marked complete.
  19500. local questIndex = entryToQuest[journalId]
  19501. if (quests[questIndex].stateType == const.ENTRY_TYPE_COMPLETE) then
  19502. return 1
  19503. else
  19504. return 0
  19505. end
  19506. end
  19507. --this should maybe be done recursively, but i kinda want direct control over each level
  19508. function buildQuestDisplay()
  19509. --this is basically just a flatten
  19510. questDisplay = {}
  19511. journalDisplay = {}
  19512.  
  19513. local journalEntries = {} --temp holding table for sorting the entries
  19514.  
  19515. for k,quest in pairs(quests) do
  19516. --skip inactive quests
  19517. if(quest.stateType ~= nil and quest.stateType ~= const.ENTRY_TYPE_NONE) then
  19518. quest.quest = 1 -- tell the renderer what type of entry this is
  19519. table.insert(questDisplay, quest)
  19520. local curQuestIdx = #questDisplay --we'll need to modify current quest with it's children, store a reference.
  19521. local questChildren = {}
  19522. for k2,objective in pairs(quest.objectives) do
  19523. if(objective.stateType ~= const.ENTRY_TYPE_NONE) then
  19524. objective.objective = 1
  19525. objective.parent = curQuestIdx
  19526. if(objective.text == Infinity_FetchString(quest.text) or objective.text == nil) then
  19527. objective.text = objective.entries[1].timeStamp
  19528. end
  19529. if(objective.stateType ~= const.ENTRY_TYPE_INFO) then
  19530. --info entries should not go into quests
  19531. table.insert(questDisplay, objective)
  19532. table.insert(questChildren, #questDisplay)
  19533. end
  19534.  
  19535. local curObjectiveIdx = #questDisplay
  19536. local objectiveChildren = {}
  19537. for k3,entry in pairs(objective.entries) do
  19538. entry.entry = 1
  19539.  
  19540. entry.parent = curObjectiveIdx
  19541. table.insert(questDisplay, entry)
  19542. table.insert(objectiveChildren, #questDisplay)
  19543. end
  19544. questDisplay[curObjectiveIdx].children = objectiveChildren
  19545. end
  19546. end
  19547. questDisplay[curQuestIdx].children = questChildren
  19548. end
  19549. end
  19550.  
  19551. -- add the user entries to the journal display
  19552. for k,entry in pairs(userNotes) do
  19553. entry.entry = 1
  19554. table.insert(journalEntries,entry)
  19555. end
  19556.  
  19557. --add the loose entries (entries without quests) to the journal display
  19558. for k,entry in pairs(looseEntries) do
  19559. entry.entry = 1
  19560. table.insert(journalEntries,entry)
  19561. end
  19562.  
  19563.  
  19564. table.sort(journalEntries, compareByRecvTime)
  19565.  
  19566. for k,entry in pairs(journalEntries) do
  19567. local title = {}
  19568. title.title = 1
  19569. title.text = entry.timeStamp
  19570. title.chapters = entry.chapters
  19571. table.insert(journalDisplay,title)
  19572. table.insert(journalDisplay, entry)
  19573. end
  19574. end
  19575. function questContainsSearchString(row)
  19576. if(journalSearchString == nil or journalSearchString == "") then return 1 end --no search string, do nothing
  19577. local text = Infinity_FetchString(questDisplay[row].text)
  19578. if(string.find(string.lower(text),string.lower(journalSearchString))) then return 1 end -- string contains search string.
  19579. if(questDisplay[row].children == nil) then return nil end --no children, does not contain search string.
  19580. for k,v in pairs(questDisplay[row].children) do
  19581. --Infinity_Log(v)
  19582. if(containsSearchString(v)) then return 1 end -- one of children contains search string
  19583. end
  19584. return nil --does not contain search string
  19585. end
  19586. function containsChapter(tab, chapter)
  19587. if(not tab) then return nil end
  19588. return tab[chapter]
  19589. end
  19590. function entryEnabled(row)
  19591. local rowTab = questDisplay[row]
  19592. if(rowTab == nil or rowTab.entry == nil or not containsChapter(rowTab.chapters,chapter)) then return nil end
  19593.  
  19594. if(objectiveEnabled(rowTab.parent) and questDisplay[rowTab.parent].expanded) then return 1 else return nil end
  19595. end
  19596. function getEntryText(row)
  19597. return questDisplay[row].timeStamp .. "\n" .. questDisplay[row].text
  19598. end
  19599.  
  19600. function objectiveEnabled(row)
  19601. local rowTab = questDisplay[row]
  19602. if(rowTab == nil or rowTab.objective == nil or not containsChapter(rowTab.chapters,chapter)) then return nil end
  19603.  
  19604. if(questEnabled(rowTab.parent) and questDisplay[rowTab.parent].expanded) then return 1 else return nil end
  19605. end
  19606. function getObjectiveText(row)
  19607. local rowTab = questDisplay[row]
  19608. if (rowTab == nil) then return nil end
  19609. local text = rowTab.text
  19610. if(text == "" or text == nil) then
  19611. text = t("NO_OBJECTIVE_NORMAL")
  19612. end
  19613. --objectives shouldn't really display a completed state since they don't actually follow a progression.
  19614. --if(getFinished(row)) then
  19615. -- text = "^0xFF666666" .. text .. " (Finished)^-"
  19616. --end
  19617.  
  19618. return text
  19619. end
  19620.  
  19621. --Many thanks to 'lefreut'
  19622. function childrenContainsChapter(children)
  19623. for k,v in pairs(children) do
  19624. if containsChapter(questDisplay[v].chapters,chapter) then
  19625. return true
  19626. end
  19627. end
  19628. return nil
  19629. end
  19630.  
  19631. function questEnabled(row)
  19632. --return (questDisplay[row] and questDisplay[row].quest and containsChapter(questDisplay[row].chapters,chapter) and (#questDisplay[row].children > 0))
  19633. return (questDisplay[row] and questDisplay[row].quest and containsChapter(questDisplay[row].chapters,chapter) and childrenContainsChapter(questDisplay[row].children))
  19634. end
  19635.  
  19636. function getQuestText(row)
  19637. local rowTab = questDisplay[row]
  19638. if (rowTab == nil) then return nil end
  19639. local text = Infinity_FetchString(rowTab.text)
  19640.  
  19641. if(getFinished(row)) then
  19642. text = "^0xFFaaaaaa" .. text .. " (" .. t("OBJECTIVE_FINISHED_NORMAL") .. ")^-"
  19643. end
  19644.  
  19645. return text
  19646. end
  19647. function getArrowFrame(row)
  19648. if(questDisplay[row] == nil or (questDisplay[row].objective == nil and questDisplay[row].quest == nil)) then return "" end
  19649.  
  19650.  
  19651. if(questDisplay[row].expanded) then
  19652. return 0
  19653. else
  19654. return 1
  19655. end
  19656. end
  19657. function getArrowEnabled(row)
  19658. if(questDisplay[row].quest == nil and questDisplay[row].objective == nil) then return nil end
  19659. if(questDisplay[row].objective and not objectiveEnabled(row)) then return nil end
  19660. if(questDisplay[row].quest and not questEnabled(row)) then return nil end
  19661. return 1
  19662. end
  19663.  
  19664. function getFinished(row)
  19665. if(questDisplay[row].stateType == const.ENTRY_TYPE_COMPLETE) then return 1 else return nil end
  19666. end
  19667. function showObjectiveSeperator(row)
  19668. local tab = questDisplay[row]
  19669. if(objectiveEnabled(row) or entryEnabled(row)) then
  19670. --seperator is enabled for objective or entry as long as the next thing is an objective.
  19671. --search until we find something enabled or end of table.
  19672. local idx = row + 1
  19673. while(questDisplay[idx]) do
  19674. if(objectiveEnabled(idx)) then
  19675. return 1
  19676. else
  19677. if(questEnabled(idx) or entryEnabled(idx)) then
  19678. return nil
  19679. end
  19680. end
  19681. idx = idx + 1
  19682. end
  19683. end
  19684. end
  19685.  
  19686.  
  19687. function getJournalTitleEnabled(row)
  19688. return journalDisplay[row].title and containsChapter(journalDisplay[row].chapters,chapter) and journalContainsSearchString(row)
  19689. end
  19690. function getJournalTitleText(row)
  19691. return journalDisplay[row].text
  19692. end
  19693. function getJournalEntryEnabled(row)
  19694. return journalDisplay[row].entry and containsChapter(journalDisplay[row].chapters,chapter) and journalContainsSearchString(row)
  19695. end
  19696. function getJournalEntryText(row)
  19697. local text = Infinity_FetchString(journalDisplay[row].text)
  19698. if(text == nil or text == "") then
  19699. text = journalDisplay[row].text
  19700. end
  19701.  
  19702. if(journalSearchString and journalSearchString ~= "") then
  19703. --do the search string highlight
  19704. text = highlightString(text, journalSearchString, "^0xFF0000FF")
  19705. end
  19706.  
  19707. return text
  19708. end
  19709. function getJournalDarken(row)
  19710. local entry = journalDisplay[row]
  19711. if(entry.title) then
  19712. return (row == selectedJournal or row + 1 == selectedJournal)
  19713. end
  19714. if(entry.entry) then
  19715. return (row == selectedJournal or row - 1 == selectedJournal)
  19716. end
  19717. end
  19718. function journalContainsSearchString(row)
  19719. if(journalSearchString == nil or journalSearchString == "") then return 1 end --no search string, do nothing
  19720. local text = Infinity_FetchString(journalDisplay[row].text)
  19721. if(text == "") then text = journalDisplay[row].text end --no stringref, use the text.
  19722. if(string.find(string.lower(text),string.lower(journalSearchString))) then return 1 end -- string contains search string.
  19723.  
  19724. --check if the corresponding row to this one contains the string.
  19725. local pairText = nil
  19726. if(journalDisplay[row].title) then
  19727. --check the corresponding entry
  19728. pairText = Infinity_FetchString(journalDisplay[row+1].text) or journalDisplay[row+1].text
  19729. if(pairText == "") then pairText = journalDisplay[row+1].text end
  19730. else
  19731. if (journalDisplay[row].entry) then
  19732. pairText = Infinity_FetchString(journalDisplay[row-1].text) or journalDisplay[row-1].text
  19733. if(pairText == "") then pairText = journalDisplay[row-1].text end
  19734. end
  19735. end
  19736. if(string.find(string.lower(pairText),string.lower(journalSearchString))) then return 1 end -- pair string contains search string.
  19737.  
  19738. return nil --does not contain search string
  19739. end
  19740. function dragJournal()
  19741. local offsetX,offsetY,menuWidth,menuHeight = Infinity_GetMenuArea('JOURNAL')
  19742. offsetX = offsetX + motionX
  19743. offsetY = offsetY + motionY
  19744.  
  19745. --clamping
  19746. if(offsetX < 80) then
  19747. offsetX = 80
  19748. end
  19749. if(offsetY < 0) then
  19750. offsetY = 0
  19751. end
  19752.  
  19753. local screenWidth, screenHeight = Infinity_GetScreenSize()
  19754. if(offsetX > screenWidth - 80 - menuWidth) then
  19755. offsetX = screenWidth - 80 - menuWidth
  19756. end
  19757. if(offsetY > screenHeight - menuHeight) then
  19758. offsetY = screenHeight - menuHeight
  19759. end
  19760.  
  19761. Infinity_SetOffset('JOURNAL', offsetX, offsetY)
  19762. end
  19763. function journalEntryClickable(selectedJournal)
  19764. local entry = journalDisplay[selectedJournal]
  19765. if(entry) then return true end
  19766. end
  19767. function getJournalEntryRef(selectedJournal)
  19768. local entry = journalDisplay[selectedJournal]
  19769. if(not entry) then return end
  19770. if(entry.title) then
  19771. return journalDisplay[selectedJournal + 1].text
  19772. else
  19773. return entry.text
  19774. end
  19775. end
  19776. function getJournalBackgroundFrame()
  19777. if(journalMode == const.JOURNAL_MODE_QUESTS) then
  19778. return 0
  19779. else
  19780. return 1
  19781. end
  19782. end
  19783. journalMode = const.JOURNAL_MODE_QUESTS
  19784. journalSearchString = ""
  19785. `
  19786. menu
  19787. {
  19788. name 'JOURNAL'
  19789. align left top
  19790. offset 80 0
  19791. ignoreEsc
  19792. onopen "
  19793. reinitQuests()
  19794. buildQuestDisplay()
  19795. chapter = math.max(0,Infinity_GetMaxChapterPage());
  19796. "
  19797. label --background background
  19798. {
  19799. area 0 0 501 773
  19800. mosaic "QUESTBAK"
  19801. }
  19802. label --Background
  19803. {
  19804. area 0 0 485 747
  19805. bam "QUESTBG"
  19806. sequence 0
  19807. frame lua "getJournalBackgroundFrame()"
  19808. }
  19809. handle
  19810. {
  19811. area 0 0 472 80
  19812. actionDrag
  19813. "
  19814. dragJournal()
  19815. "
  19816. }
  19817. button
  19818. {
  19819. area 216 22 134 34
  19820. text "JOURNAL_LABEL"
  19821. text style "label_parchment"
  19822. text point 16
  19823. action "journalMode = const.JOURNAL_MODE_JOURNAL"
  19824. }
  19825. button
  19826. {
  19827. area 34 18 136 42
  19828. text "QUESTS_LABEL"
  19829. text style "label_parchment"
  19830. text point 16
  19831. action "journalMode = const.JOURNAL_MODE_QUESTS"
  19832. }
  19833. button
  19834. {
  19835. area 419 13 66 67
  19836. on esc
  19837. bam "XBUTT"
  19838. action
  19839. "
  19840. e:GetActiveEngine():OnLeftPanelButtonClick(2)
  19841. "
  19842. }
  19843. label -- Chapter
  19844. {
  19845. area 85 610 146 60
  19846. text lua "chapterText()"
  19847. text style "label_parchment"
  19848. mosaic "PCHAPTER"
  19849. }
  19850. button --prev chapter
  19851. {
  19852. area 48 610 41 60
  19853. bam "PARROW"
  19854. sequence 0
  19855.  
  19856. action
  19857. "
  19858. incrChapter(-1);
  19859. "
  19860. }
  19861. button
  19862. {
  19863. area 224 610 41 60
  19864. bam "PARROW"
  19865. sequence 1
  19866.  
  19867. action
  19868. "
  19869. incrChapter(1);
  19870. "
  19871. }
  19872. --[Bug #20368] Recent events button cut for now.
  19873. --
  19874. --button
  19875. --{
  19876. -- enabled "journalMode == const.JOURNAL_MODE_QUESTS"
  19877. -- area 278 616 162 47
  19878. -- bam "PAPERBUT"
  19879. -- sequence 1
  19880. -- text "RECENT_EVENTS_LABEL"
  19881. -- text style "button_parchment"
  19882. -- action
  19883. -- "
  19884. -- Infinity_PushMenu('JOURNAL_RECENT_EVENTS')
  19885. -- "
  19886. --}
  19887. label
  19888. {
  19889. enabled "journalMode == const.JOURNAL_MODE_JOURNAL"
  19890. area 54 88 374 32
  19891. fill 50 50 50 150
  19892. }
  19893. edit
  19894. {
  19895. enabled "journalMode == const.JOURNAL_MODE_JOURNAL"
  19896. area 62 88 357 32
  19897. var journalSearchString
  19898. placeholder "ENTER_SEARCH_TERM_NORMAL"
  19899. text style "edit"
  19900. maxlines 1
  19901. }
  19902. list
  19903. {
  19904. column
  19905. {
  19906. width 10
  19907. label
  19908. {
  19909. area 0 0 31 31
  19910. enabled "getArrowEnabled(rowNumber)"
  19911. bam "PCHEV"
  19912. frame lua "getArrowFrame(rowNumber)"
  19913. text style "label_parchment"
  19914. align top center
  19915. }
  19916. }
  19917. column {
  19918. width 90
  19919. label
  19920. {
  19921. enabled "questEnabled(rowNumber)"
  19922. area 0 0 -1 -1
  19923. rectangle 1
  19924. rectangle opacity 150
  19925. }
  19926. label
  19927. {
  19928. enabled "questEnabled(rowNumber)"
  19929. area 8 0 -1 -1
  19930. text lua "getQuestText(rowNumber)"
  19931. text style "label"
  19932. align left center
  19933. }
  19934. label
  19935. {
  19936. enabled "objectiveEnabled(rowNumber)"
  19937. area 16 0 -1 -1
  19938. pad 0 10 0 10
  19939. text lua "getObjectiveText(rowNumber)"
  19940. text style "normal_parchment"
  19941. }
  19942. label
  19943. {
  19944. enabled "entryEnabled(rowNumber)"
  19945. area 16 0 -1 -1
  19946. pad 0 10 0 10
  19947. text lua "getEntryText(rowNumber)"
  19948. text style "normal_parchment"
  19949. text color M
  19950. }
  19951. }
  19952. enabled "journalMode == const.JOURNAL_MODE_QUESTS"
  19953. rowheight dynamic
  19954. hidehighlight
  19955. seperator "showObjectiveSeperator(rowNumber)"
  19956. table "questDisplay"
  19957. var selectedQuest
  19958. scrollbar 'GUISCRP'
  19959. area 48 98 404 480
  19960. action
  19961. "
  19962. if(questDisplay[selectedQuest].expanded) then
  19963. questDisplay[selectedQuest].expanded = nil
  19964. else
  19965. questDisplay[selectedQuest].expanded = 1
  19966. end
  19967. "
  19968.  
  19969. }
  19970.  
  19971. list --journal
  19972. {
  19973. column
  19974. {
  19975. width 100
  19976. --light
  19977. label
  19978. {
  19979. enabled "getJournalTitleEnabled(rowNumber) and not getJournalDarken(rowNumber)"
  19980. area 0 0 -1 -1
  19981. pad 0 16 0 0
  19982. text lua "getJournalTitleText(rowNumber)"
  19983. text style "label_parchment"
  19984. text color 0 120 0 255
  19985. }
  19986. label
  19987. {
  19988. enabled "getJournalEntryEnabled(rowNumber) and not getJournalDarken(rowNumber)"
  19989. area 0 0 -1 -1
  19990. pad 8 16 0 16
  19991. text lua "getJournalEntryText(rowNumber)"
  19992. text style "normal_parchment"
  19993. }
  19994.  
  19995. --dark
  19996. label
  19997. {
  19998. enabled "(getJournalTitleEnabled(rowNumber) or getJournalEntryEnabled(rowNumber)) and getJournalDarken(rowNumber)"
  19999. area 0 0 -1 -1
  20000. fill 0 0 0 150
  20001. }
  20002. label
  20003. {
  20004. enabled "getJournalTitleEnabled(rowNumber) and getJournalDarken(rowNumber)"
  20005. area 0 0 -1 -1
  20006. pad 0 16 0 0
  20007. text lua "getJournalTitleText(rowNumber)"
  20008. text style "label_parchment"
  20009. text color 255 100 100 255
  20010. }
  20011. label
  20012. {
  20013. enabled "getJournalEntryEnabled(rowNumber) and getJournalDarken(rowNumber)"
  20014. area 0 0 -1 -1
  20015. pad 8 16 0 16
  20016. text lua "getJournalEntryText(rowNumber)"
  20017. text style "normal_parchment"
  20018. text color 'B'
  20019. }
  20020.  
  20021.  
  20022. }
  20023. enabled "journalMode == const.JOURNAL_MODE_JOURNAL"
  20024. seperator "getJournalEntryEnabled(rowNumber)"
  20025. rowheight dynamic
  20026. hidehighlight
  20027. table "journalDisplay"
  20028. var selectedJournal
  20029. scrollbar 'GUISCRP'
  20030. area 54 128 386 450
  20031. }
  20032. label
  20033. {
  20034. area 58 569 382 25
  20035. mosaic PAPERSEP
  20036. }
  20037. button
  20038. {
  20039. enabled "journalMode == const.JOURNAL_MODE_JOURNAL"
  20040. area 272 594 162 47
  20041. bam "PAPERBUT"
  20042. sequence 1
  20043. text "ADD_ENTRY_LABEL"
  20044. text style "button_parchment"
  20045. action
  20046. "
  20047. journalMode = const.JOURNAL_MODE_EDIT
  20048. journalNoteEdit = ''
  20049. journalNoteEditRef = nil
  20050. "
  20051. }
  20052. button
  20053. {
  20054. enabled "journalMode == const.JOURNAL_MODE_JOURNAL"
  20055. clickable lua "journalEntryClickable(selectedJournal)"
  20056. area 272 641 162 47
  20057. bam "PAPERBUT"
  20058. sequence 1
  20059. text "EDIT_ENTRY_LABEL"
  20060. text style "button_parchment"
  20061. action
  20062. "
  20063. journalNoteEditRef = getJournalEntryRef(selectedJournal)
  20064. journalNoteEdit = Infinity_FetchString(journalNoteEditRef)
  20065. journalMode = const.JOURNAL_MODE_EDIT
  20066. "
  20067. }
  20068.  
  20069.  
  20070. label
  20071. {
  20072. enabled "journalMode == const.JOURNAL_MODE_EDIT"
  20073. area 48 88 392 36
  20074. text style "normal_parchment"
  20075. text "WRITE_ENTRY_TEXT"
  20076.  
  20077. }
  20078. label
  20079. {
  20080. enabled "journalMode == const.JOURNAL_MODE_EDIT"
  20081. area 58 140 376 4
  20082. fill 10 71 1 255
  20083. }
  20084. label
  20085. {
  20086. enabled "journalMode == const.JOURNAL_MODE_EDIT"
  20087. area 58 144 382 42
  20088. text style "label"
  20089. text color 0 120 0 255
  20090. text lua "Infinity_GetTimeString()"
  20091. }
  20092. edit
  20093. {
  20094. enabled "journalMode == const.JOURNAL_MODE_EDIT"
  20095. area 58 186 382 383
  20096. text style "edit_parchment"
  20097. var journalNoteEdit
  20098. scrollbar 'GUISCRP'
  20099.  
  20100. }
  20101.  
  20102. button
  20103. {
  20104. on escape
  20105. enabled "journalMode == const.JOURNAL_MODE_EDIT"
  20106. area 272 641 162 47
  20107. bam "PAPERBUT"
  20108. sequence 1
  20109. text "CANCEL_BUTTON"
  20110. text style "button_parchment"
  20111. action
  20112. "
  20113. journalMode = const.JOURNAL_MODE_JOURNAL
  20114. "
  20115. }
  20116. button
  20117. {
  20118. enabled "journalMode == const.JOURNAL_MODE_EDIT"
  20119. area 272 594 162 47
  20120. bam "PAPERBUT"
  20121. sequence 1
  20122. text "DONE_BUTTON"
  20123. text style "button_parchment"
  20124. action
  20125. "
  20126. if(journalNoteEditRef == nil) then
  20127. Infinity_OnAddUserEntry(journalNoteEdit)
  20128. else
  20129. Infinity_OnEditUserEntry(journalNoteEditRef, journalNoteEdit)
  20130. end
  20131. journalMode = const.JOURNAL_MODE_JOURNAL
  20132. "
  20133. }
  20134.  
  20135.  
  20136. }
  20137. menu
  20138. {
  20139. name 'JOURNAL_RECENT_EVENTS'
  20140. align center center
  20141. modal
  20142. label
  20143. {
  20144. area 0 0 672 672
  20145. mosaic "RECENTEV"
  20146.  
  20147. }
  20148. label
  20149. {
  20150. area 158 52 354 46
  20151. text "RECENT_EVENTS_TITLE"
  20152. text style "title"
  20153. }
  20154. button
  20155. {
  20156. area 594 10 33 35
  20157. bam "XBUTT"
  20158. action
  20159. "
  20160. Infinity_PopMenu('JOURNAL_RECENT_EVENTS')
  20161. "
  20162. }
  20163. text
  20164. {
  20165. area 126 106 422 458
  20166. text "Recent events text will go here."
  20167. text style "normal"
  20168. }
  20169. button
  20170. {
  20171. area 320 572 200 40
  20172. text "DONE_BUTTON"
  20173. text style 'button'
  20174. bam GUIBUTNT
  20175. sequence 2
  20176. action
  20177. "
  20178. Infinity_PopMenu('JOURNAL_RECENT_EVENTS')
  20179. "
  20180. }
  20181. }
  20182. `
  20183. function processQuestsWithStyle()
  20184. out = ""
  20185. for k,v in pairs(quests_old) do
  20186. local questStrref = v[3]
  20187. out = out .. "createQuest ( " .. questStrref .. " )\n"
  20188.  
  20189. for k2,v2 in pairs(journals_quests_old) do
  20190. if(v2[2] == k) then
  20191. local subgroup = v2[const.ENTRIES_IDX_SUBGROUP]
  20192. if(subgroup == 0) then subgroup = "nil" end
  20193. out = out .. "createEntry ( " .. questStrref .. ", -1, " .. v2[1] .. ", {}, " .. subgroup .." )\n"
  20194. end
  20195. end
  20196. end
  20197. Infinity_Log(out)
  20198. end
  20199. `
  20200. menu
  20201. {
  20202. name 'MESSAGE_SCREEN'
  20203. align center center
  20204. label
  20205. {
  20206. area 0 0 657 234
  20207. mosaic GUIERR6
  20208. }
  20209. label
  20210. {
  20211. area 29 21 580 126
  20212. text lua "Infinity_FetchString(messageScreenText)"
  20213. text style "label"
  20214. }
  20215. }menu
  20216. {
  20217. name 'MESSAGE_SCREEN'
  20218. align center center
  20219. label
  20220. {
  20221. area 0 0 657 234
  20222. mosaic GUIERR6
  20223. }
  20224. label
  20225. {
  20226. area 29 21 580 126
  20227. text lua "Infinity_FetchString(messageScreenText)"
  20228. text style "label"
  20229. }
  20230. }
  20231. `
  20232. megacredits = ''
  20233. epilogueImage = "GUIOSTUR"
  20234. `
  20235. menu
  20236. {
  20237. name 'EPILOGUE'
  20238. align center center
  20239. ignoreEsc
  20240. onOpen
  20241. "
  20242. generateMegaCredits()
  20243. "
  20244. label
  20245. {
  20246. area 0 0 1024 768
  20247. mosaic "NPCCHAP"
  20248. }
  20249. text
  20250. {
  20251. area 100 50 828 36
  20252. text style "title"
  20253. text "MAIN_GAME_LABEL"
  20254. }
  20255. text
  20256. {
  20257. area 100 86 828 34
  20258. text style "title"
  20259. text "EXPANSION_LABEL"
  20260. }
  20261. label
  20262. {
  20263. area 110 176 274 430
  20264. mosaic lua "epilogueImage"
  20265. }
  20266. text
  20267. {
  20268. name "text_CHAPTERSCROLL_item"
  20269. area 440 148 492 482
  20270. text lua "megacredits"
  20271. text style normal
  20272. text align center top
  20273. scrollbar 'GUISCRC'
  20274. scrollbar func 'UpdateChapterScroll'
  20275. scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1'
  20276. action
  20277. "
  20278. text_CHAPTERSCROLL_auto = 0
  20279. "
  20280. }
  20281. button
  20282. {
  20283. area 526 662 230 40
  20284. bam GUIBUTMT
  20285. text "DONE_BUTTON"
  20286. text style "button"
  20287. clickable lua "chapterScreen:IsDoneButtonClickable()"
  20288. action
  20289. "
  20290. megacredits = ''
  20291. chapterScreen:OnDoneButtonClick()
  20292. "
  20293. }
  20294. button
  20295. {
  20296. area 284 662 230 40
  20297. bam GUIBUTMT
  20298. text "REPLAY_BUTTON"
  20299. text style "button"
  20300. clickable lua "chapterScreen:IsReplayButtonClickable()"
  20301. action
  20302. "
  20303. chapterScreen:OnReplayButtonClick()
  20304. "
  20305. }
  20306. }
  20307. `
  20308. function getDLCDescription()
  20309. return Infinity_FetchString(dlcScreen:GetDLCDescription())
  20310. end
  20311. function getDLCTitle()
  20312. return Infinity_FetchString(dlcScreen:GetDLCTitle())
  20313. end
  20314. function getDLCIndex()
  20315. return dlcScreen:GetDLCIndex() .. "/" .. dlcScreen:GetDLCCount()
  20316. end
  20317. function isDLCBuyButtonClickable()
  20318. local isBought = dlcScreen:GetDLCBought()
  20319. return isBought == false
  20320. end
  20321. `
  20322. menu
  20323. {
  20324. name 'START_DLC'
  20325. align center center
  20326.  
  20327. label
  20328. {
  20329. area 0 0 1024 768
  20330. mosaic 'GUIDLC'
  20331. }
  20332.  
  20333. label
  20334. {
  20335. area 60 0 906 56
  20336. text "STRREF_GUI_LOWER_DLC_STORE"
  20337. text style 'title'
  20338. text align center center
  20339. }
  20340.  
  20341. label
  20342. {
  20343. area 588 568 326 48
  20344. text lua "getDLCIndex()"
  20345. text style 'title'
  20346. text align center center
  20347. }
  20348.  
  20349. label
  20350. {
  20351. area 576 132 348 54
  20352. text lua "getDLCTitle()"
  20353. text style 'title'
  20354. text align center center
  20355. }
  20356.  
  20357. text
  20358. {
  20359. area 588 228 326 334
  20360. text lua "getDLCDescription()"
  20361. text style 'normal'
  20362. scrollbar 'GUISCRC'
  20363. }
  20364.  
  20365. label
  20366. {
  20367. area 154 92 362 568
  20368. bitmap lua "dlcScreen:GetDLCImage()"
  20369. }
  20370.  
  20371. button
  20372. {
  20373. bam 'GUIPRC'
  20374. sequence 0
  20375. area 22 274 56 140
  20376. align center center
  20377. action
  20378. "
  20379. dlcScreen:DecrementDLCIndex()
  20380. "
  20381. }
  20382.  
  20383. button
  20384. {
  20385. bam 'GUIPRC'
  20386. sequence 1
  20387. area 946 270 52 140
  20388. align center center
  20389. action
  20390. "
  20391. dlcScreen:IncrementDLCIndex()
  20392. "
  20393. }
  20394.  
  20395. button
  20396. {
  20397. on escape
  20398. bam 'GUIBUTNT'
  20399. sequence 0
  20400. area 316 713 200 40
  20401. align center center
  20402. text style "button"
  20403. text "BACK_BUTTON"
  20404. action
  20405. "
  20406. dlcScreen:OnDoneButtonClick()
  20407. "
  20408. }
  20409.  
  20410. button
  20411. {
  20412. bam 'GUIBUTNT'
  20413. frame 3
  20414. area 526 713 200 40
  20415. align center center
  20416. text style "button"
  20417. text "STRREF_GUI_DLC_INSTALLED"
  20418. text color 'E'
  20419. enabled "not isDLCBuyButtonClickable()"
  20420. action
  20421. "
  20422. dlcScreen:OnBuyButtonClick()
  20423. "
  20424. }
  20425.  
  20426. button
  20427. {
  20428. bam 'GUIBUTNT'
  20429. sequence 2
  20430. area 526 713 200 40
  20431. align center center
  20432. text style "button"
  20433. text "BUY_BUTTON"
  20434. enabled "isDLCBuyButtonClickable()"
  20435. action
  20436. "
  20437. dlcScreen:OnBuyButtonClick()
  20438. "
  20439. }
  20440.  
  20441. button
  20442. {
  20443. bam 'GUIBUTWT'
  20444. sequence 2
  20445. area 600 648 298 40
  20446. align center center
  20447. text style "button"
  20448. text "STRREF_GUI_DLC_RESTORE_PURCHASES"
  20449. action
  20450. "
  20451. dlcScreen:RestorePurchases()
  20452. "
  20453. }
  20454. }
  20455.  
  20456. `
  20457. dlcStatusDescriptionText = ""
  20458. dlcStatusButtonText = ""
  20459. dlcStatusState = 0
  20460.  
  20461. DLC_STATE_WAITING = 0
  20462. DLC_STATE_IN_PROGRESS = 1
  20463. DLC_STATE_SUCCESS = 2
  20464. DLC_STATE_FAILED = 3
  20465. DLC_STATE_CANCELLED = 4
  20466. DLC_STATE_RESTORING_PURCHASES = 5
  20467. DLC_STATE_RESTORING_PURCHASES_COMPLETE = 6
  20468. DLC_STATE_DOWNLOADING = 7
  20469.  
  20470. function checkDLCState()
  20471. dlcStatusState = dlcScreen:GetDLCState()
  20472. if dlcStatusState == DLC_STATE_WAITING then
  20473. dlcStatusDescriptionText = t("STRREF_GUI_DLC_WAITING")
  20474. dlcStatusButtonText = t("BACK_BUTTON")
  20475. elseif dlcStatusState == DLC_STATE_IN_PROGRESS then
  20476. dlcStatusDescriptionText = t("STRREF_GUI_DLC_IN_PROGRESS")
  20477. dlcStatusButtonText = t("BACK_BUTTON")
  20478. elseif dlcStatusState == DLC_STATE_SUCCESS then
  20479. dlcStatusDescriptionText = t("STRREF_GUI_DLC_SUCCESS")
  20480. dlcStatusButtonText = t("CONTINUE_BUTTON")
  20481. elseif dlcStatusState == DLC_STATE_FAILED then
  20482. dlcStatusDescriptionText = t("STRREF_GUI_DLC_FAILED")
  20483. dlcStatusButtonText = t("CONTINUE_BUTTON")
  20484. elseif dlcStatusState == DLC_STATE_CANCELLED then
  20485. dlcStatusDescriptionText = t("STRREF_GUI_DLC_CANCELLED")
  20486. dlcStatusButtonText = t("CONTINUE_BUTTON")
  20487. elseif dlcStatusState == DLC_STATE_RESTORING_PURCHASES then
  20488. dlcStatusDescriptionText = t("STRREF_GUI_DLC_RESTORING_PURCHASES")
  20489. dlcStatusButtonText = t("BACK_BUTTON")
  20490. elseif dlcStatusState == DLC_STATE_RESTORING_PURCHASES_COMPLETE then
  20491. dlcStatusDescriptionText = t("STRREF_GUI_DLC_RESTORING_PURCHASES_COMPLETE")
  20492. dlcStatusButtonText = t("CONTINUE_BUTTON")
  20493. elseif dlcStatusState == DLC_STATE_DOWNLOADING then
  20494. dlcScreen:GetDownloadString()
  20495. dlcStatusButtonText = ""
  20496. else
  20497. dlcStatusDescriptionText = "WAFFLES_Dont Know How We Got Here_WAFFLES"
  20498. dlcStatusButtonText = "WAFFLES_WAFFLES_WAFFLES"
  20499. end
  20500. end
  20501.  
  20502. function getDLCStatusText()
  20503. checkDLCState()
  20504. return dlcStatusDescriptionText
  20505. end
  20506. `
  20507. menu
  20508. {
  20509. name 'START_DLC_STATUS'
  20510. align center center
  20511.  
  20512. label
  20513. {
  20514. area 0 0 408 420
  20515. mosaic 'GUIERR'
  20516. }
  20517.  
  20518. label
  20519. {
  20520. area 86 76 236 84
  20521. text style "label"
  20522. text lua "getDLCStatusText()"
  20523. }
  20524.  
  20525. button
  20526. {
  20527. bam 'GUIOSTUM'
  20528. sequence 0
  20529. area 104 320 202 46
  20530. align center center
  20531. text style "button"
  20532. text lua "dlcStatusButtonText"
  20533. enabled "dlcStatusState ~= DLC_STATE_DOWNLOADING"
  20534. action
  20535. "
  20536. dlcScreen:OnErrorButtonClick();
  20537. "
  20538. }
  20539. }
  20540. `
  20541. dialogTable = {}
  20542. dialogOverflowTable = {}
  20543. hasDialogResponse = nil
  20544.  
  20545. chatboxScrollToBottom = nil
  20546. chatboxScrollTimeLast = 0
  20547. chatboxContentHeight = 0
  20548. chatboxOverflowed = nil
  20549. chatboxJumpToBottom = nil
  20550.  
  20551. -- The following two values determine how many item entries can exist. We trim
  20552. -- the number of entries to numDialogTrimEntries once it has overflowed that value
  20553. -- by numDialogOverflowLimit.
  20554. numDialogTrimEntries = 512
  20555. numDialogOverflowEntries = numDialogTrimEntries + 128
  20556.  
  20557. lastTrimmedContentHeight = 0
  20558.  
  20559. function getNumDialogTableEntries()
  20560. local count = 0
  20561. for _ in pairs(dialogTable) do count = count + 1 end
  20562. return count
  20563. end
  20564.  
  20565. function trimDialogTableSize()
  20566. local numTableEntries = getNumDialogTableEntries()
  20567. if (numTableEntries > numDialogOverflowEntries) then
  20568. local numEntriesToRemove = numTableEntries - numDialogTrimEntries
  20569. while (numEntriesToRemove > 0) do
  20570. -- Get our table entry and calculate its size
  20571. local tableEntry = dialogTable[1]
  20572. local delta = Infinity_GetContentHeight(styles.normal.font, w, tableEntry.text, styles.normal.point, 1, styles.normal.useFontZoom) --1 for indent.
  20573. chatboxContentHeight = chatboxContentHeight - delta
  20574. lastTrimmedContentHeight = lastTrimmedContentHeight + delta
  20575.  
  20576. table.remove(dialogTable, 1)
  20577. numEntriesToRemove = numEntriesToRemove - 1
  20578. end
  20579. end
  20580. end
  20581.  
  20582. function buildResponsesList()
  20583.  
  20584. hasDialogResponse = nil
  20585. dialogResponses = {}
  20586. for k,v in pairs(worldPlayerDialogChoices) do
  20587. if v.marker then
  20588. table.insert(dialogResponses, v)
  20589. hasDialogResponse = 1
  20590. end
  20591. end
  20592. end
  20593. function canShowDialogButton(num)
  20594. -- Show the buttons if we have a response, and the dialog button is not enabled
  20595. return dialogResponses and dialogResponses[num] ~= nil and showDialogButtonChoices()
  20596. end
  20597.  
  20598. function addDialogMessage(text,marker,makeTop)
  20599. local tab = {}
  20600. tab.text = text
  20601. tab.marker = marker
  20602. if(marker) then
  20603. dialogViewMode = nil
  20604. if(text == "") then
  20605. --empty markers are a signal, we shouldn't actually display them.
  20606. if(makeTop == true) then
  20607. --we'll ensure the next line is included in the visible content.
  20608. chatboxContentHeight = 0
  20609. end
  20610. return
  20611. else
  20612. hasDialogResponse = 1
  20613. end
  20614. end
  20615.  
  20616. --Calculate running total of dialog content height
  20617. local x,y,w,h = Infinity_GetArea("worldPlayerDialogChoicesList")
  20618. w = w - 18 --account for scrollbar influence on width
  20619. local delta = Infinity_GetContentHeight(styles.normal.font, w, text, styles.normal.point, 1, styles.normal.useFontZoom) --1 for indent.
  20620. chatboxContentHeight = chatboxContentHeight + delta
  20621.  
  20622. if(marker and chatboxContentHeight > h) then
  20623. --More to display than we have room for, put the responses in overflow and hide them behind button
  20624. table.insert(dialogOverflowTable,tab)
  20625. else
  20626. table.insert(dialogTable,tab)
  20627. end
  20628.  
  20629. if(makeTop == true) then
  20630. --we'll ensure the next line is included in the visible content.
  20631. chatboxContentHeight = 0
  20632. end
  20633.  
  20634. trimDialogTableSize()
  20635.  
  20636. triggerChatboxScroll()
  20637.  
  20638. buildResponsesList()
  20639. end
  20640. function clearDialogResponses()
  20641. for k,v in pairs(dialogTable) do
  20642. if(v.marker) then
  20643. table.remove(dialogTable,k)
  20644. clearDialogResponses()
  20645. end
  20646. end
  20647. hasDialogResponse = nil
  20648. chatboxOverflowed = nil
  20649. chatboxContentHeight = 0
  20650. dialogOverflowTable = {}
  20651. end
  20652. function dialogEntrySelectable(row)
  20653. return (dialogTable[row].marker ~= nil)
  20654. end
  20655. function showDialogButtonChoices()
  20656. return not (not hasDialogResponse or dialogViewMode or #dialogOverflowTable > 0)
  20657. end
  20658. function getResponsePickable()
  20659. return not hasDialogResponse or dialogViewMode or (gameOptions.m_bConfirmDialog == true)
  20660. end
  20661. function getDialogButtonText()
  20662. if(dialogViewMode) then
  20663. return t("DONE_BUTTON")
  20664. end
  20665.  
  20666. if(#dialogOverflowTable > 0) then
  20667. return t("SHOW_MORE_RESPONSES_BUTTON")
  20668. end
  20669.  
  20670. if(gameOptions.m_bConfirmDialog == true) then
  20671. return t("CHOOSE_RESPONSE_BUTTON")
  20672. end
  20673.  
  20674. return dialogButtonText
  20675. end
  20676. function triggerChatboxScroll()
  20677. chatboxScrollToBottom = 1
  20678. chatboxScrollTimeLast = Infinity_GetClockTicks()
  20679. end
  20680. function chatboxScroll(top, height, contentHeight)
  20681. if(chatboxJumpToBottom and contentHeight > height) then
  20682. chatboxJumpToBottom = nil
  20683. return height-contentHeight
  20684. end
  20685. if(chatboxScrollToBottom == 0) then
  20686. --defer to default scrolling
  20687. return nil
  20688. end
  20689. if(contentHeight < height) then
  20690. --no scrolling required, content fits
  20691. chatboxScrollToBottom = nil
  20692. return nil
  20693. end
  20694. local dT = Infinity_GetClockTicks() - chatboxScrollTimeLast
  20695. chatboxScrollTimeLast = Infinity_GetClockTicks()
  20696. top = top + lastTrimmedContentHeight
  20697. lastTrimmedContentHeight = 0
  20698. local newTop = (dT * -0.25) + top
  20699. if (newTop + contentHeight > height + 200) then
  20700. return (height - contentHeight + 200)
  20701. end
  20702. if(newTop + contentHeight < height) then
  20703. chatboxScrollToBottom = 0
  20704. return height - contentHeight
  20705. end
  20706. return newTop
  20707. end
  20708. function displayOverflowResponses()
  20709. for k,v in pairs(dialogOverflowTable) do
  20710. table.insert(dialogTable,v)
  20711. end
  20712. dialogOverflowTable = {}
  20713. triggerChatboxScroll()
  20714. buildResponsesList()
  20715. end
  20716. function GetFirstMarkedResponse()
  20717. for k,v in pairs(dialogTable) do
  20718. if v.marker ~= nil then
  20719. return k
  20720. end
  20721. end
  20722. return -1
  20723. end
  20724. function onDialogButtonClick()
  20725. if(dialogViewMode) then
  20726. --In dialog view mode this button closes the menu.
  20727. worldScreen:StopDialogHistory()
  20728. return
  20729. end
  20730.  
  20731. if(#dialogOverflowTable > 0) then
  20732. displayOverflowResponses()
  20733. return
  20734. end
  20735.  
  20736. if(gameOptions.m_bConfirmDialog == true and hasDialogResponse) then
  20737. -- if confirm dialog and choices available.
  20738. worldScreen:OnDialogReplyClick(dialogTable[worldPlayerDialogSelection].marker)
  20739. worldPlayerDialogSelection = 0
  20740. return
  20741. else
  20742. -- no choices, just step.
  20743. worldScreen:StepDialog()
  20744. end
  20745. end
  20746. function getDialogRowClickable(row)
  20747. return dialogTable[row].marker ~= nil
  20748. end
  20749. function isTouchActionbar()
  20750. --Make this read from an option to make it easy to switch out.
  20751. local default = 0
  20752. if(e:IsTouchUI()) then default = 1 end
  20753. local val = Infinity_GetINIValue('Program Options', 'Use Touch Actionbar', default)
  20754. if (val ~= 0) then
  20755. return 1
  20756. else
  20757. return nil
  20758. end
  20759. end
  20760. `
  20761. menu
  20762. {
  20763. name 'WORLD_DIALOG_LEFT'
  20764. align left center
  20765. ignoreEsc
  20766. --ignoreFocus 1
  20767. onOpen
  20768. "
  20769. Infinity_PushMenu('WORLD_DIALOG_LEFT_BUTTONS')
  20770. "
  20771. onClose
  20772. "
  20773. Infinity_PopMenu('WORLD_DIALOG_LEFT_BUTTONS')
  20774. "
  20775. label
  20776. {
  20777. area 0 0 80 1536
  20778. mosaic GUIWLSP
  20779. }
  20780. }
  20781. menu
  20782. {
  20783. name 'WORLD_DIALOG_LEFT_BUTTONS'
  20784. align left center
  20785. ignoreEsc
  20786. --ignoreFocus 1
  20787. label
  20788. {
  20789. area 0 0 85 780
  20790. rectangle 4
  20791. }
  20792. button
  20793. {
  20794. area 15 25 54 54
  20795. bam CBUTT
  20796. scaleToClip
  20797. text lua "'...'"
  20798. text style "button"
  20799. pad -3 -6 0 0
  20800. enabled "not showDialogButtonChoices()"
  20801. clickable lua "not dialogEntryGreyed()"
  20802. action
  20803. "
  20804. onDialogButtonClick()
  20805. "
  20806. }
  20807.  
  20808. button
  20809. {
  20810. area 15 25 54 54
  20811. bam CBUTT
  20812. scaleToClip
  20813. text lua "'1'"
  20814. text style "button"
  20815. pad -3 -6 0 0
  20816. enabled "canShowDialogButton(1)"
  20817. clickable lua "not dialogEntryGreyed()"
  20818. action
  20819. "
  20820. worldScreen:OnDialogReplyClick(dialogResponses[1].marker)
  20821. "
  20822. }
  20823. button
  20824. {
  20825. area 15 100 54 54
  20826. bam CBUTT
  20827. scaleToClip
  20828. text lua "'2'"
  20829. text style "button"
  20830. pad -3 -6 0 0
  20831. enabled "canShowDialogButton(2)"
  20832. clickable lua "not dialogEntryGreyed()"
  20833. action
  20834. "
  20835. worldScreen:OnDialogReplyClick(dialogResponses[2].marker)
  20836. "
  20837. }
  20838. button
  20839. {
  20840. area 15 175 54 54
  20841. bam CBUTT
  20842. scaleToClip
  20843. text lua "'3'"
  20844. text style "button"
  20845. pad -3 -6 0 0
  20846. enabled "canShowDialogButton(3)"
  20847. clickable lua "not dialogEntryGreyed()"
  20848. action
  20849. "
  20850. worldScreen:OnDialogReplyClick(dialogResponses[3].marker)
  20851. "
  20852. }
  20853. button
  20854. {
  20855. area 15 250 54 54
  20856. bam CBUTT
  20857. scaleToClip
  20858. text lua "'4'"
  20859. text style "button"
  20860. pad -3 -6 0 0
  20861. enabled "canShowDialogButton(4)"
  20862. clickable lua "not dialogEntryGreyed()"
  20863. action
  20864. "
  20865. worldScreen:OnDialogReplyClick(dialogResponses[4].marker)
  20866. "
  20867. }
  20868. button
  20869. {
  20870. area 15 325 54 54
  20871. bam CBUTT
  20872. scaleToClip
  20873. text lua "'5'"
  20874. text style "button"
  20875. pad -3 -6 0 0
  20876. enabled "canShowDialogButton(5)"
  20877. clickable lua "not dialogEntryGreyed()"
  20878. action
  20879. "
  20880. worldScreen:OnDialogReplyClick(dialogResponses[5].marker)
  20881. "
  20882. }
  20883. button
  20884. {
  20885. area 15 400 54 54
  20886. bam CBUTT
  20887. scaleToClip
  20888. text lua "'6'"
  20889. text style "button"
  20890. pad -3 -6 0 0
  20891. enabled "canShowDialogButton(6)"
  20892. clickable lua "not dialogEntryGreyed()"
  20893. action
  20894. "
  20895. worldScreen:OnDialogReplyClick(dialogResponses[6].marker)
  20896. "
  20897. }
  20898. button
  20899. {
  20900. area 15 475 54 54
  20901. bam CBUTT
  20902. scaleToClip
  20903. text lua "'7'"
  20904. text style "button"
  20905. pad -3 -6 0 0
  20906. enabled "canShowDialogButton(7)"
  20907. clickable lua "not dialogEntryGreyed()"
  20908. action
  20909. "
  20910. worldScreen:OnDialogReplyClick(dialogResponses[7].marker)
  20911. "
  20912. }
  20913.  
  20914. button
  20915. {
  20916. area 15 550 54 54
  20917. bam CBUTT
  20918. scaleToClip
  20919. text lua "'8'"
  20920. text style "button"
  20921. pad -3 -6 0 0
  20922. enabled "canShowDialogButton(8)"
  20923. clickable lua "not dialogEntryGreyed()"
  20924. action
  20925. "
  20926. worldScreen:OnDialogReplyClick(dialogResponses[8].marker)
  20927. "
  20928. }
  20929.  
  20930. button
  20931. {
  20932. area 15 625 54 54
  20933. bam CBUTT
  20934. scaleToClip
  20935. text lua "'9'"
  20936. text style "button"
  20937. pad -3 -6 0 0
  20938. enabled "canShowDialogButton(9)"
  20939. clickable lua "not dialogEntryGreyed()"
  20940. action
  20941. "
  20942. worldScreen:OnDialogReplyClick(dialogResponses[9].marker)
  20943. "
  20944. }
  20945. button
  20946. {
  20947. area 15 700 54 54
  20948. bam CBUTT
  20949. scaleToClip
  20950. text lua "'10'"
  20951. text style "button"
  20952. pad -3 -6 0 0
  20953. enabled "canShowDialogButton(10)"
  20954. clickable lua "not dialogEntryGreyed()"
  20955. action
  20956. "
  20957. worldScreen:OnDialogReplyClick(dialogResponses[10].marker)
  20958. "
  20959. }
  20960. }
  20961. menu
  20962. {
  20963. name 'WORLD_DIALOG_RIGHT'
  20964. align right center
  20965. ignoreEsc
  20966. --ignoreFocus 1
  20967. enabled "canShowDialogButton(11)"
  20968. onOpen
  20969. "
  20970. Infinity_PushMenu('WORLD_DIALOG_RIGHT_BUTTONS')
  20971. "
  20972. onClose
  20973. "
  20974. Infinity_PopMenu('WORLD_DIALOG_RIGHT_BUTTONS')
  20975. "
  20976. label
  20977. {
  20978. area 0 0 80 1536
  20979. mosaic GUIWRSP
  20980. }
  20981. }
  20982. menu
  20983. {
  20984. name 'WORLD_DIALOG_RIGHT_BUTTONS'
  20985. align right center
  20986. ignoreEsc
  20987. --ignoreFocus 1
  20988. enabled "canShowDialogButton(11)"
  20989. label
  20990. {
  20991. area 0 0 85 780
  20992. rectangle 4
  20993. }
  20994. button
  20995. {
  20996. area 15 25 54 54
  20997. bam CBUTT
  20998. scaleToClip
  20999. text lua "'11'"
  21000. text style "button"
  21001. pad -3 -6 0 0
  21002. enabled "canShowDialogButton(11)"
  21003. clickable lua "not dialogEntryGreyed()"
  21004. action
  21005. "
  21006. worldScreen:OnDialogReplyClick(dialogResponses[11].marker)
  21007. "
  21008. }
  21009. button
  21010. {
  21011. area 15 100 54 54
  21012. bam CBUTT
  21013. scaleToClip
  21014. text lua "'12'"
  21015. text style "button"
  21016. pad -3 -6 0 0
  21017. enabled "canShowDialogButton(12)"
  21018. clickable lua "not dialogEntryGreyed()"
  21019. action
  21020. "
  21021. worldScreen:OnDialogReplyClick(dialogResponses[12].marker)
  21022. "
  21023. }
  21024. button
  21025. {
  21026. area 15 175 54 54
  21027. bam CBUTT
  21028. scaleToClip
  21029. text lua "'13'"
  21030. text style "button"
  21031. pad -3 -6 0 0
  21032. enabled "canShowDialogButton(13)"
  21033. clickable lua "not dialogEntryGreyed()"
  21034. action
  21035. "
  21036. worldScreen:OnDialogReplyClick(dialogResponses[13].marker)
  21037. "
  21038. }
  21039. button
  21040. {
  21041. area 15 250 54 54
  21042. bam CBUTT
  21043. scaleToClip
  21044. text lua "'14'"
  21045. text style "button"
  21046. pad -3 -6 0 0
  21047. enabled "canShowDialogButton(14)"
  21048. clickable lua "not dialogEntryGreyed()"
  21049. action
  21050. "
  21051. worldScreen:OnDialogReplyClick(dialogResponses[14].marker)
  21052. "
  21053. }
  21054. button
  21055. {
  21056. area 15 325 54 54
  21057. bam CBUTT
  21058. scaleToClip
  21059. text lua "'15'"
  21060. text style "button"
  21061. pad -3 -6 0 0
  21062. enabled "canShowDialogButton(15)"
  21063. clickable lua "not dialogEntryGreyed()"
  21064. action
  21065. "
  21066. worldScreen:OnDialogReplyClick(dialogResponses[15].marker)
  21067. "
  21068. }
  21069. button
  21070. {
  21071. area 15 400 54 54
  21072. bam CBUTT
  21073. scaleToClip
  21074. text lua "'16'"
  21075. text style "button"
  21076. pad -3 -6 0 0
  21077. enabled "canShowDialogButton(16)"
  21078. clickable lua "not dialogEntryGreyed()"
  21079. action
  21080. "
  21081. worldScreen:OnDialogReplyClick(dialogResponses[16].marker)
  21082. "
  21083. }
  21084. button
  21085. {
  21086. area 15 475 54 54
  21087. bam CBUTT
  21088. scaleToClip
  21089. text lua "'17'"
  21090. text style "button"
  21091. pad -3 -6 0 0
  21092. enabled "canShowDialogButton(17)"
  21093. clickable lua "not dialogEntryGreyed()"
  21094. action
  21095. "
  21096. worldScreen:OnDialogReplyClick(dialogResponses[17].marker)
  21097. "
  21098. }
  21099.  
  21100. button
  21101. {
  21102. area 15 550 54 54
  21103. bam CBUTT
  21104. scaleToClip
  21105. text lua "'18'"
  21106. text style "button"
  21107. pad -3 -6 0 0
  21108. enabled "canShowDialogButton(18)"
  21109. clickable lua "not dialogEntryGreyed()"
  21110. action
  21111. "
  21112. worldScreen:OnDialogReplyClick(dialogResponses[18].marker)
  21113. "
  21114. }
  21115.  
  21116. button
  21117. {
  21118. area 15 625 54 54
  21119. bam CBUTT
  21120. scaleToClip
  21121. text lua "'19'"
  21122. text style "button"
  21123. pad -3 -6 0 0
  21124. enabled "canShowDialogButton(19)"
  21125. clickable lua "not dialogEntryGreyed()"
  21126. action
  21127. "
  21128. worldScreen:OnDialogReplyClick(dialogResponses[19].marker)
  21129. "
  21130. }
  21131. button
  21132. {
  21133. area 15 700 54 54
  21134. bam CBUTT
  21135. scaleToClip
  21136. text lua "'20'"
  21137. text style "button"
  21138. pad -3 -6 0 0
  21139. enabled "canShowDialogButton(20)"
  21140. clickable lua "not dialogEntryGreyed()"
  21141. action
  21142. "
  21143. worldScreen:OnDialogReplyClick(dialogResponses[20].marker)
  21144. "
  21145. }
  21146. }
  21147. `
  21148. currentButtonHelp = 11
  21149. buttonHelp =
  21150. {
  21151. {'GUILS10', 0, -1, 0, 0, -1, '', 'HELPTUTORIAL_RETURNTOGAME'}, -- 1 return to game
  21152. {'GUILS10', 1, -1, 0, 0, -1, '', 'HELPTUTORIAL_MAP'}, -- 2 map
  21153. {'GUILS10', 2, -1, 0, 0, -1, '', 'HELPTUTORIAL_JOURNAL'}, -- 3 journal
  21154. {'GUILS10', 3, -1, 0, 0, -1, '', 'HELPTUTORIAL_INVENTORY'}, -- 4 inventory
  21155. {'GUILS10', 4, -1, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERRECORD'}, -- 5 record
  21156. {'GUILS10', 5, -1, 0, 0, -1, '', 'HELPTUTORIAL_MAGESPELLS'}, -- 6 mage book
  21157. {'GUILS10', 6, -1, 0, 0, -1, '', 'HELPTUTORIAL_PRIESTSPELLS'}, -- 7 priest scroll
  21158. {'GUILS10', 7, -1, 0, 0, -1, '', 'HELPTUTORIAL_OPTIONS'}, -- 8 options
  21159. {'GUILS10', 8, -1, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERARBITRATION'}, -- 9 arbitration
  21160. {'GUILS10', 15, -1, 0, 0, -1, '', 'HELPTUTORIAL_QUICKSAVE'}, -- 10 quick save
  21161. {'GUILS10', 16, -1, 0, 0, -1, '', 'HELPTUTORIAL_HELP'}, -- 11 help
  21162. {'GUILS10', 9, -1, 0, 0, -1, '', 'HELPTUTORIAL_REST'}, -- 12 rest
  21163. {'GUILS10', 14, -1, 0, 0, -1, '', 'HELPTUTORIAL_SELECT'}, -- 13 drag
  21164. {'GUILS10', 11, -1, 0, 0, -1, '', 'HELPTUTORIAL_HIGHLIGHT'}, -- 14 highlight
  21165. {'GUILS10', 10, -1, 0, 0, -1, '', 'HELPTUTORIAL_TOGGLEAI'}, -- 15 ai
  21166. {'GUILS10', 13, -1, 0, 0, -1, '', 'HELPTUTORIAL_SELECTALL'}, -- 16 select all
  21167. {'', -1, 0, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 17 player 1
  21168. {'', -1, 1, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 18 player 2
  21169. {'', -1, 2, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 19 player 3
  21170. {'', -1, 3, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 20 player 4
  21171. {'', -1, 4, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 21 player 5
  21172. {'', -1, 5, 0, 0, -1, '', 'HELPTUTORIAL_CHARACTERPORTRAITS'}, -- 22 player 6
  21173. {'', -1, -1, 1, 0, -1, '', 'HELPTUTORIAL_CLOCK'}, -- 23 clock
  21174. {'ROUNDBUT', 0, -1, 0, 1, -1, '', 'HELPTUTORIAL_QUICKLOOT'}, -- 24 quick loot
  21175. {'GUIBTACT', 64, -1, 0, 0, 0, '', 'HELPTUTORIAL_ARROWLEFT'}, -- 25
  21176. {'GUIBTACT', 66, -1, 0, 0, 1, '', 'HELPTUTORIAL_ARROWRIGHT'}, -- 26
  21177. {'GUIBTACT', 22, -1, 0, 0, 2, '', 'HELPTUTORIAL_BARDSONG'}, -- 27
  21178. {'GUIBTACT', 12, -1, 0, 0, 3, '', 'HELPTUTORIAL_CASTSPELLS'}, -- 28
  21179. {'GUIBTACT', 34, -1, 0, 0, 4, '', 'HELPTUTORIAL_FINDTRAPS'}, -- 29
  21180. {'GUIBTACT', 4, -1, 0, 0, 5, '', 'HELPTUTORIAL_DIALOG'}, -- 30
  21181. {'GUIBTACT', 20, -1, 0, 0, 6, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 31
  21182. {'GUIBTACT', 0, -1, 0, 0, 7, '', 'HELPTUTORIAL_DEFEND'}, -- 32
  21183. {'GUIBTACT', 14, -1, 0, 0, 8, '', 'HELPTUTORIAL_ATTACK'}, -- 33
  21184. {'GUIBTACT', 40, -1, 0, 0, 9, '', 'HELPTUTORIAL_SHAPECHANGE'}, -- 34
  21185. {'GUIBTACT', 38, -1, 0, 0, 10, '', 'HELPTUTORIAL_SPECIALABILITIES'}, -- 35
  21186. {'GUIBTACT', 30, -1, 0, 0, 11, '', 'HELPTUTORIAL_STEALTH'}, -- 36
  21187. {'GUIBTACT', 26, -1, 0, 0, 12, '', 'HELPTUTORIAL_THIEVING'}, -- 37
  21188. {'GUIBTACT', 8, -1, 0, 0, 13, '', 'HELPTUTORIAL_TURNUNDEAD'}, -- 38
  21189. {'GUIBTACT', 18, -1, 0, 0, 14, '', 'HELPTUTORIAL_USEITEM'}, -- 39
  21190. {'GUIBTACT', 58, -1, 0, 0, 15, '', 'HELPTUTORIAL_STOP'}, -- 40
  21191. {'GUIBTACT', 20, -1, 0, 0, 16, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 41
  21192. {'GUIBTACT', 20, -1, 0, 0, 17, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 42
  21193. {'GUIBTACT', 20, -1, 0, 0, 18, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 43
  21194. {'GUIBTACT', 20, -1, 0, 0, 19, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 44
  21195. {'GUIBTACT', 20, -1, 0, 0, 20, '', 'HELPTUTORIAL_QUICKFORMATION'}, -- 45
  21196. {'STONSLOT', -1, -1, 0, 0, 21, 'STONITEM', 'HELPTUTORIAL_QUICKITEM'}, -- 46
  21197. {'STONSLOT', -1, -1, 0, 0, 22, 'STONITEM', 'HELPTUTORIAL_QUICKITEM'}, -- 47
  21198. {'STONSLOT', -1, -1, 0, 0, 23, 'STONITEM', 'HELPTUTORIAL_QUICKITEM'}, -- 48
  21199. {'STONSLOT', 12, -1, 0, 0, 24, 'STONSPEL', 'HELPTUTORIAL_QUICKSPELLS'}, -- 49
  21200. {'STONSLOT', 12, -1, 0, 0, 25, 'STONSPEL', 'HELPTUTORIAL_QUICKSPELLS'}, -- 50
  21201. {'STONSLOT', 12, -1, 0, 0, 26, 'STONSPEL', 'HELPTUTORIAL_QUICKSPELLS'}, -- 51
  21202. {'STONSLOT', -1, -1, 0, 0, 27, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 52
  21203. {'STONSLOT', -1, -1, 0, 0, 28, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 53
  21204. {'STONSLOT', -1, -1, 0, 0, 29, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 54
  21205. {'STONSLOT', -1, -1, 0, 0, 30, 'STONWEAP', 'HELPTUTORIAL_QUICKWEAPON'}, -- 55
  21206. {'STONSLOT', -1, -1, 0, 0, 31, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 56
  21207. {'STONSLOT', -1, -1, 0, 0, 32, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 57
  21208. {'STONSLOT', -1, -1, 0, 0, 33, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 58
  21209. {'STONSLOT', -1, -1, 0, 0, 34, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 59
  21210. {'STONSLOT', -1, -1, 0, 0, 35, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 60
  21211. {'STONSLOT', -1, -1, 0, 0, 36, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 61
  21212. {'STONSLOT', -1, -1, 0, 0, 37, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 62
  21213. {'STONSLOT', -1, -1, 0, 0, 38, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 63
  21214. {'STONSLOT', -1, -1, 0, 0, 39, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 64
  21215. {'STONSLOT', -1, -1, 0, 0, 40, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 65
  21216. {'STONSLOT', -1, -1, 0, 0, 41, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 66
  21217. {'STONSLOT', -1, -1, 0, 0, 42, '', 'HELPTUTORIAL_CONFIGURATION'}, -- 67
  21218. {'STONSLOT', -1, -1, 0, 0, 43, '', 'HELPTUTORIAL_ARROWLEFT'}, -- 68
  21219. {'STONSLOT', -1, -1, 0, 0, 44, '', 'HELPTUTORIAL_ARROWRIGHT'}, -- 69
  21220. {},
  21221. {},
  21222. {},
  21223. {},
  21224. {},
  21225. {},
  21226. {},
  21227. {},
  21228. {},
  21229. {},
  21230. {},
  21231. {},
  21232. {},
  21233. {},
  21234. {},
  21235. {},
  21236. {},
  21237. {},
  21238. {},
  21239. {},
  21240. {},
  21241. {},
  21242. {'STONSLOT', -1, -1, 0, 0, 67, '', 'HELPTUTORIAL_SWITCHTOMAGE'}, -- 91
  21243. {},
  21244. {'STONSLOT', -1, -1, 0, 0, 69, '', 'HELPTUTORIAL_SWITCHTOCLERIC'}, -- 93
  21245. }
  21246. `
  21247. menu
  21248. {
  21249. name 'HELP'
  21250. align center center
  21251. ignoreEsc
  21252. onOpen
  21253. "
  21254. currentButtonHelp = 11
  21255. Infinity_PushMenu('LEFT_SIDEBAR_HELP')
  21256. Infinity_PushMenu('RIGHT_SIDEBAR_HELP')
  21257. Infinity_PushMenu('WORLD_ACTIONBAR_HELP')
  21258. "
  21259. onClose
  21260. "
  21261. Infinity_PopMenu('LEFT_SIDEBAR_HELP')
  21262. Infinity_PopMenu('RIGHT_SIDEBAR_HELP')
  21263. Infinity_PopMenu('WORLD_ACTIONBAR_HELP')
  21264. "
  21265. label
  21266. {
  21267. area 0 0 912 244
  21268. mosaic GUIERR7
  21269. }
  21270. label
  21271. {
  21272. enabled "buttonHelp[currentButtonHelp][3] == -1 and buttonHelp[currentButtonHelp][4] == 0 and buttonHelp[currentButtonHelp][5] == 0 and buttonHelp[currentButtonHelp][6] == -1"
  21273. area 34 24 75 54
  21274. bam lua "buttonHelp[currentButtonHelp][1]"
  21275. sequence lua "buttonHelp[currentButtonHelp][2]"
  21276. }
  21277. label
  21278. {
  21279. enabled "buttonHelp[currentButtonHelp][3] == -1 and buttonHelp[currentButtonHelp][4] == 0 and buttonHelp[currentButtonHelp][5] ~= 0 and buttonHelp[currentButtonHelp][6] == -1"
  21280. area 34 24 44 44
  21281. bam lua "buttonHelp[currentButtonHelp][1]"
  21282. sequence lua "buttonHelp[currentButtonHelp][2]"
  21283. scaleToClip
  21284. }
  21285. label
  21286. {
  21287. enabled "buttonHelp[currentButtonHelp][3] == -1 and buttonHelp[currentButtonHelp][4] == 0 and buttonHelp[currentButtonHelp][5] == 0 and buttonHelp[currentButtonHelp][6] ~= -1"
  21288. area 34 24 75 54
  21289. bam lua "buttonHelp[currentButtonHelp][1]"
  21290. frame lua "buttonHelp[currentButtonHelp][2]"
  21291. }
  21292. button
  21293. {
  21294. area 34 24 64 90
  21295. enabled "buttonHelp[currentButtonHelp][3] ~= -1"
  21296. portrait lua "buttonHelp[currentButtonHelp][3]"
  21297. }
  21298.  
  21299. label
  21300. {
  21301. enabled "buttonHelp[currentButtonHelp][4] ~= 0"
  21302. area 29 16 95 120
  21303. bam "CGEAR"
  21304. frame lua "timer:GetCurrentTime() % 24"
  21305. }
  21306. label
  21307. {
  21308. enabled "buttonHelp[currentButtonHelp][4] ~= 0"
  21309. area 29 16 95 120
  21310. bam "CDIAL"
  21311. frame lua "timer:GetCurrentHour() % timer.TIMESCALE_HOUR_PER_DAY"
  21312. }
  21313. label
  21314. {
  21315. enabled "buttonHelp[currentButtonHelp][4] ~= 0"
  21316. area 29 16 95 120
  21317. bam "CPEN"
  21318. frame lua "timer:GetCurrentTime() % 24"
  21319. }
  21320.  
  21321. label
  21322. {
  21323. enabled "buttonHelp[currentButtonHelp][7] ~= ''"
  21324. area 34 24 52 52
  21325. align center center
  21326. bam lua "buttonHelp[currentButtonHelp][7]"
  21327. frame lua "buttonHelp[currentButtonHelp][7]"
  21328. }
  21329.  
  21330. label
  21331. {
  21332. area 118 24 752 120
  21333. text lua "t(buttonHelp[currentButtonHelp][8])"
  21334. text style "label"
  21335. text align left top
  21336. }
  21337. button
  21338. {
  21339. area 306 164 300 40
  21340. bam GUIBUTWT
  21341. text "DONE_BUTTON"
  21342. text style "button"
  21343. action
  21344. "
  21345. Infinity_PopMenu('HELP')
  21346. "
  21347. }
  21348. }
  21349.  
  21350. menu
  21351. {
  21352. name 'LEFT_SIDEBAR_HELP'
  21353. align left top
  21354. ignoreEsc
  21355. onOpen
  21356. "
  21357. Infinity_PushMenu('LEFT_SIDEBAR_BOTTOM_HELP')
  21358. "
  21359. onClose
  21360. "
  21361. Infinity_PopMenu('LEFT_SIDEBAR_BOTTOM_HELP')
  21362. "
  21363. label
  21364. {
  21365. name 'leftSidebarBackground'
  21366. area 0 0 80 1536
  21367. mosaic GUIWLSP
  21368. }
  21369. label
  21370. {
  21371.  
  21372. area 0 1536 80 1536
  21373. mosaic GUIWLSP
  21374. }
  21375. button
  21376. {
  21377. area 3 14 73 55
  21378. bam GUILS10
  21379. sequence 0
  21380. tooltip lua "getTooltipWithHotkey(2,24364)"
  21381. glow lua "true"
  21382. action
  21383. "
  21384. currentButtonHelp = 1
  21385. "
  21386. }
  21387. button
  21388. {
  21389. area 3 69 73 55
  21390. bam GUILS10
  21391. sequence 1
  21392. tooltip lua "getTooltipWithHotkey(4,15418)"
  21393. glow lua "true"
  21394. action
  21395. "
  21396. currentButtonHelp = 2
  21397. "
  21398. }
  21399. button
  21400. {
  21401. area 3 124 73 55
  21402. bam GUILS10
  21403. sequence 2
  21404. tooltip lua "getTooltipWithHotkey(3,24359)"
  21405. glow lua "true"
  21406. action
  21407. "
  21408. currentButtonHelp = 3
  21409. "
  21410. }
  21411. button
  21412. {
  21413. area 3 179 73 55
  21414. bam GUILS10
  21415. sequence 3
  21416. tooltip lua "getTooltipWithHotkey(0,24358)"
  21417. glow lua "true"
  21418. action
  21419. "
  21420. currentButtonHelp = 4
  21421. "
  21422. }
  21423. button
  21424. {
  21425. area 3 234 73 55
  21426. bam GUILS10
  21427. sequence 4
  21428. tooltip lua "getTooltipWithHotkey(1,24356)"
  21429. glow lua "true"
  21430. action
  21431. "
  21432. currentButtonHelp = 5
  21433. "
  21434. }
  21435. button
  21436. {
  21437. area 3 289 73 55
  21438. bam GUILS10
  21439. sequence 5
  21440. tooltip lua "getTooltipWithHotkey(5,24360)"
  21441. glow lua "true"
  21442. action
  21443. "
  21444. currentButtonHelp = 6
  21445. "
  21446. }
  21447. button
  21448. {
  21449. area 3 344 73 55
  21450. bam GUILS10
  21451. sequence 6
  21452. tooltip lua "getTooltipWithHotkey(6,24357)"
  21453. glow lua "true"
  21454. action
  21455. "
  21456. currentButtonHelp = 7
  21457. "
  21458. }
  21459. button
  21460. {
  21461. area 3 399 73 55
  21462. bam GUILS10
  21463. sequence 7
  21464. tooltip lua "getTooltipWithHotkey(7,24362)"
  21465. glow lua "true"
  21466. action
  21467. "
  21468. currentButtonHelp = 8
  21469. "
  21470. }
  21471. button
  21472. {
  21473. area 3 454 73 55
  21474. enabled "e:IsMultiplayer()"
  21475. bam GUILS10
  21476. sequence 8
  21477. tooltip lua "getTooltipWithHotkey(8,24363)"
  21478. glow lua "true"
  21479. action
  21480. "
  21481. currentButtonHelp = 9
  21482. "
  21483. }
  21484. }
  21485. menu
  21486. {
  21487. name 'LEFT_SIDEBAR_BOTTOM_HELP'
  21488. align left bottom
  21489. offset 0 -22
  21490. --combined height of these buttons makes a menu with height = 231, menu is placed into lower left. y pos is offset from top of this menu.
  21491. ignoreEsc
  21492. button
  21493. {
  21494. area 3 0 73 55
  21495. enabled "worldScreen == e:GetActiveEngine()"
  21496. bam GUILS10
  21497. sequence 15
  21498. tooltip lua "getTooltipWithHotkey(28,31813)"
  21499. glow lua "true"
  21500. action
  21501. "
  21502. currentButtonHelp = 10
  21503. "
  21504. }
  21505. button
  21506. {
  21507. area 3 56 73 55
  21508. enabled "worldScreen == e:GetActiveEngine()"
  21509. bam GUILS10
  21510. sequence 16
  21511. tooltip lua "Infinity_FetchString(31827)" --"getTooltipWithHotkey(16,31827)"
  21512. glow lua "true"
  21513. action
  21514. "
  21515. currentButtonHelp = 11
  21516. "
  21517. }
  21518. button
  21519. {
  21520. area 3 110 73 55
  21521. bam GUILS10
  21522. sequence 9
  21523. tooltip lua "getTooltipWithHotkey(31,11942)"
  21524. glow lua "true"
  21525. action
  21526. "
  21527. currentButtonHelp = 12
  21528. "
  21529. }
  21530.  
  21531.  
  21532. --begin clock
  21533. label
  21534. {
  21535. enabled "worldScreen == e:GetActiveEngine()"
  21536. area 0 182 73 55
  21537. bam "CGEAR"
  21538. frame lua "timer:GetCurrentTime() % 24"
  21539. useOverlayTint "worldScreen:CheckIfPaused()"
  21540. overlayTint 180 180 180
  21541. }
  21542. label
  21543. {
  21544. enabled "worldScreen == e:GetActiveEngine()"
  21545. area 0 182 73 55
  21546. bam "CDIAL"
  21547. frame lua "timer:GetCurrentHour() % timer.TIMESCALE_HOUR_PER_DAY"
  21548. useOverlayTint "worldScreen:CheckIfPaused()"
  21549. overlayTint 180 180 180
  21550. }
  21551. label
  21552. {
  21553. enabled "worldScreen == e:GetActiveEngine()"
  21554. area 0 182 73 55
  21555. bam "CPEN"
  21556. frame lua "timer:GetCurrentTime() % 24"
  21557. useOverlayTint "worldScreen:CheckIfPaused()"
  21558. overlayTint 180 180 180
  21559. }
  21560. button
  21561. {
  21562. enabled "worldScreen == e:GetActiveEngine()"
  21563. area 0 182 73 55
  21564. tooltip lua "worldScreen:GetCurrentTimeString()"
  21565. glow lua "true"
  21566. action
  21567. "
  21568. currentButtonHelp = 23
  21569. "
  21570. }
  21571. --end clock
  21572. label
  21573. {
  21574. --area is preset
  21575. enabled "gameOptions.m_bRenderFrameTimes"
  21576. frameTimes
  21577. }
  21578. }
  21579.  
  21580. menu
  21581. {
  21582. name 'RIGHT_SIDEBAR_HELP'
  21583. align right top
  21584. ignoreEsc
  21585. onOpen
  21586. "
  21587. Infinity_PushMenu('RIGHT_SIDEBAR_BOTTOM_HELP')
  21588. "
  21589. onClose
  21590. "
  21591. Infinity_PopMenu('RIGHT_SIDEBAR_BOTTOM_HELP')
  21592. "
  21593. label
  21594. {
  21595. name 'rightSidebarBackground'
  21596. area 0 0 80 1536
  21597. mosaic GUIWRSP
  21598. }
  21599. label
  21600. {
  21601. area 0 1536 80 1536
  21602. mosaic GUIWRSP
  21603. }
  21604. button
  21605. {
  21606. area 11 14 64 90
  21607. portrait 0
  21608. bam GUIRSP10
  21609. enabled "Infinity_GetNumCharacters() > 0"
  21610. glow lua "true"
  21611. action
  21612. "
  21613. currentButtonHelp = 17
  21614. "
  21615. tooltip lua "Infinity_GetPortraitTooltip(0)"
  21616. }
  21617. button
  21618. {
  21619. area 11 106 64 90
  21620. portrait 1
  21621. bam GUIRSP10
  21622. enabled "Infinity_GetNumCharacters() > 1"
  21623. glow lua "true"
  21624. action
  21625. "
  21626. currentButtonHelp = 18
  21627. "
  21628. tooltip lua "Infinity_GetPortraitTooltip(1)"
  21629. }
  21630. button
  21631. {
  21632. area 11 198 64 90
  21633. portrait 2
  21634. bam GUIRSP10
  21635. enabled "Infinity_GetNumCharacters() > 2"
  21636. glow lua "true"
  21637. action
  21638. "
  21639. currentButtonHelp = 19
  21640. "
  21641. tooltip lua "Infinity_GetPortraitTooltip(2)"
  21642. }
  21643. button
  21644. {
  21645. area 11 290 64 90
  21646. portrait 3
  21647. bam GUIRSP10
  21648. enabled "Infinity_GetNumCharacters() > 3"
  21649. glow lua "true"
  21650. action
  21651. "
  21652. currentButtonHelp = 20
  21653. "
  21654. tooltip lua "Infinity_GetPortraitTooltip(3)"
  21655. }
  21656. button
  21657. {
  21658. area 11 382 64 90
  21659. portrait 4
  21660. bam GUIRSP10
  21661. enabled "Infinity_GetNumCharacters() > 4"
  21662. glow lua "true"
  21663. action
  21664. "
  21665. currentButtonHelp = 21
  21666. "
  21667. tooltip lua "Infinity_GetPortraitTooltip(4)"
  21668. }
  21669. button
  21670. {
  21671. area 11 474 64 90
  21672. portrait 5
  21673. bam GUIRSP10
  21674. enabled "Infinity_GetNumCharacters() > 5"
  21675. glow lua "true"
  21676. action
  21677. "
  21678. currentButtonHelp = 22
  21679. "
  21680. tooltip lua "Infinity_GetPortraitTooltip(5)"
  21681. }
  21682. }
  21683. menu
  21684. {
  21685. name 'RIGHT_SIDEBAR_BOTTOM_HELP'
  21686. align right bottom
  21687. ignoreEsc
  21688. --Buttons form a menu aligned bottom right, with height = 197, y is offset from top of that menu.
  21689. button
  21690. {
  21691. area 6 0 71 48
  21692. enabled "e:IsTouchUI() and worldScreen == e:GetActiveEngine()"
  21693. bam GUILS10
  21694. sequence 14
  21695. glow lua "true"
  21696. action
  21697. "
  21698. currentButtonHelp = 13
  21699. "
  21700. }
  21701. button
  21702. {
  21703. area 6 49 71 48
  21704. enabled "worldScreen == e:GetActiveEngine()"
  21705. tooltip lua "Infinity_FetchString(32729)"
  21706. bam GUILS10
  21707. sequence 11
  21708. glow lua "true"
  21709. action
  21710. "
  21711. currentButtonHelp = 14
  21712. "
  21713. }
  21714. button
  21715. {
  21716. area 6 99 71 48
  21717. enabled "worldScreen == e:GetActiveEngine()"
  21718. tooltip lua "getPartyAITooltip()"
  21719. bam GUILS10
  21720. sequence 10
  21721. glow lua "true"
  21722. action
  21723. "
  21724. currentButtonHelp = 15
  21725. "
  21726. }
  21727. button
  21728. {
  21729. area 6 149 71 48
  21730. enabled "worldScreen == e:GetActiveEngine()"
  21731. tooltip lua "Infinity_FetchString(10485)"
  21732. bam GUILS10
  21733. sequence 13
  21734. glow lua "true"
  21735. action
  21736. "
  21737. currentButtonHelp = 16
  21738. "
  21739. }
  21740. }
  21741. menu
  21742. {
  21743. name "WORLD_ACTIONBAR_HELP"
  21744. align center bottom
  21745. onOpen
  21746. "
  21747. "
  21748. onClose
  21749. "
  21750. "
  21751. ignoreEsc
  21752. label
  21753. {
  21754. area 0 0 746 57
  21755. mosaic GUWBTP10
  21756. }
  21757. button
  21758. {
  21759. area 21 12 32 32
  21760. bam ROUNDBUT
  21761. glow lua "true"
  21762. scaleToClip
  21763. action
  21764. "
  21765. currentButtonHelp = 24
  21766. "
  21767. }
  21768. button
  21769. {
  21770. area 68 1 52 52
  21771. actionBar 0
  21772. enabled "buttonArray:GetButtonEnabled(0)"
  21773. tooltip lua "actionBarTooltip[0]"
  21774. glow lua "true"
  21775. action
  21776. "
  21777. currentButtonHelp = 25 + buttonArray:GetButtonType(0)
  21778. "
  21779. }
  21780. button
  21781. {
  21782. area 122 1 52 52
  21783. actionBar 1
  21784. enabled "buttonArray:GetButtonEnabled(1)"
  21785. tooltip lua "actionBarTooltip[1]"
  21786. glow lua "true"
  21787. action
  21788. "
  21789. currentButtonHelp = 25 + buttonArray:GetButtonType(1)
  21790. "
  21791. }
  21792. button
  21793. {
  21794. area 177 1 52 52
  21795. actionBar 2
  21796. enabled "buttonArray:GetButtonEnabled(2)"
  21797. tooltip lua "actionBarTooltip[2]"
  21798. glow lua "true"
  21799. action
  21800. "
  21801. currentButtonHelp = 25 + buttonArray:GetButtonType(2)
  21802. "
  21803. }
  21804. button
  21805. {
  21806. area 231 1 52 52
  21807. actionBar 3
  21808. enabled "buttonArray:GetButtonEnabled(3)"
  21809. tooltip lua "actionBarTooltip[3]"
  21810. glow lua "true"
  21811. action
  21812. "
  21813. currentButtonHelp = 25 + buttonArray:GetButtonType(3)
  21814. "
  21815. }
  21816. button
  21817. {
  21818. area 299 1 52 52
  21819. actionBar 4
  21820. enabled "buttonArray:GetButtonEnabled(4)"
  21821. tooltip lua "actionBarTooltip[4]"
  21822. glow lua "true"
  21823. action
  21824. "
  21825. currentButtonHelp = 25 + buttonArray:GetButtonType(4)
  21826. "
  21827. }
  21828. button
  21829. {
  21830. area 353 1 52 52
  21831. actionBar 5
  21832. enabled "buttonArray:GetButtonEnabled(5)"
  21833. tooltip lua "actionBarTooltip[5]"
  21834. glow lua "true"
  21835. action
  21836. "
  21837. currentButtonHelp = 25 + buttonArray:GetButtonType(5)
  21838. "
  21839. }
  21840. button
  21841. {
  21842. area 407 1 52 52
  21843. actionBar 6
  21844. enabled "buttonArray:GetButtonEnabled(6)"
  21845. tooltip lua "actionBarTooltip[6]"
  21846. glow lua "true"
  21847. action
  21848. "
  21849. currentButtonHelp = 25 + buttonArray:GetButtonType(6)
  21850. "
  21851. }
  21852. button
  21853. {
  21854. area 461 1 52 52
  21855. actionBar 7
  21856. enabled "buttonArray:GetButtonEnabled(7)"
  21857. tooltip lua "actionBarTooltip[7]"
  21858. glow lua "true"
  21859. action
  21860. "
  21861. currentButtonHelp = 25 + buttonArray:GetButtonType(7)
  21862. "
  21863. }
  21864.  
  21865. button
  21866. {
  21867. area 528 1 52 52
  21868. actionBar 8
  21869. enabled "buttonArray:GetButtonEnabled(8)"
  21870. tooltip lua "actionBarTooltip[8]"
  21871. glow lua "true"
  21872. action
  21873. "
  21874. currentButtonHelp = 25 + buttonArray:GetButtonType(8)
  21875. "
  21876. }
  21877. button
  21878. {
  21879. area 582 1 52 52
  21880. actionBar 9
  21881. enabled "buttonArray:GetButtonEnabled(9)"
  21882. tooltip lua "actionBarTooltip[9]"
  21883. glow lua "true"
  21884. action
  21885. "
  21886. currentButtonHelp = 25 + buttonArray:GetButtonType(9)
  21887. "
  21888. }
  21889. button
  21890. {
  21891. area 636 1 52 52
  21892. actionBar 10
  21893. enabled "buttonArray:GetButtonEnabled(10)"
  21894. tooltip lua "actionBarTooltip[10]"
  21895. glow lua "true"
  21896. action
  21897. "
  21898. currentButtonHelp = 25 + buttonArray:GetButtonType(10)
  21899. "
  21900. }
  21901. button
  21902. {
  21903. area 689 1 52 52
  21904. actionBar 11
  21905. enabled "buttonArray:GetButtonEnabled(11)"
  21906. tooltip lua "actionBarTooltip[11]"
  21907. glow lua "true"
  21908. action
  21909. "
  21910. currentButtonHelp = 25 + buttonArray:GetButtonType(11)
  21911. "
  21912. }
  21913. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement