Skip to content

Commit

Permalink
UI.menu fix for 8. and 9. memorized mage spells not being shown
Browse files Browse the repository at this point in the history
  • Loading branch information
Renegade0 committed Jun 29, 2019
1 parent 344fbec commit fc3cde5
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions dragonspear_ui++/content-bg2/UI.MENU
Original file line number Diff line number Diff line change
Expand Up @@ -11476,6 +11476,40 @@ function filterMemorizedMageSpells7()
return out
end

function filterMemorizedMageSpells8()
local out = {}
currentSpellLevel = math.min(currentSpellLevel, 9)
for k,v in pairs(characters[id].mageSpells[8]) do
for i=v.memorizedCount, 1, -1 do
local spell = deepcopy(v)
if(i <= v.castableCount) then
spell.castable = 1
else
spell.castable = 0
end
table.insert(out, spell)
end
end
return out
end

function filterMemorizedMageSpells9()
local out = {}
currentSpellLevel = math.min(currentSpellLevel, 9)
for k,v in pairs(characters[id].mageSpells[9]) do
for i=v.memorizedCount, 1, -1 do
local spell = deepcopy(v)
if(i <= v.castableCount) then
spell.castable = 1
else
spell.castable = 0
end
table.insert(out, spell)
end
end
return out
end

function findFirstDifferenceInSpellList(oldList, newList)
local ret = -1
local spellIndex = 1
Expand Down Expand Up @@ -11520,6 +11554,8 @@ function refreshMageBook()
newBottomSpells5 = filterMemorizedMageSpells5()
newBottomSpells6 = filterMemorizedMageSpells6()
newBottomSpells7 = filterMemorizedMageSpells7()
newBottomSpells8 = filterMemorizedMageSpells8()
newBottomSpells9 = filterMemorizedMageSpells9()

if showMageMemorizationFlash == true then
createMageMemorizationSparkle(0,0,36,36,"memorizedListMage", findFirstDifferenceInSpellList(bottomSpells, newBottomSpells))
Expand All @@ -11533,6 +11569,8 @@ function refreshMageBook()
bottomSpells5 = newBottomSpells5
bottomSpells6 = newBottomSpells6
bottomSpells7 = newBottomSpells7
bottomSpells8 = newBottomSpells8
bottomSpells9 = newBottomSpells9
bottomSpellsPlaceHolder = makeBlankTable(characters[id].mageDetails[currentSpellLevel].maxMemorized)
bottomSpellsPlaceHolder1 = makeBlankTable(characters[id].mageDetails[1].maxMemorized)
bottomSpellsPlaceHolder2 = makeBlankTable(characters[id].mageDetails[2].maxMemorized)
Expand All @@ -11541,6 +11579,8 @@ function refreshMageBook()
bottomSpellsPlaceHolder5 = makeBlankTable(characters[id].mageDetails[5].maxMemorized)
bottomSpellsPlaceHolder6 = makeBlankTable(characters[id].mageDetails[6].maxMemorized)
bottomSpellsPlaceHolder7 = makeBlankTable(characters[id].mageDetails[7].maxMemorized)
bottomSpellsPlaceHolder8 = makeBlankTable(characters[id].mageDetails[8].maxMemorized)
bottomSpellsPlaceHolder9 = makeBlankTable(characters[id].mageDetails[9].maxMemorized)
else
bookSpells = characters[id].mageSpells[currentSpellLevel]
bottomSpells = {}
Expand All @@ -11551,6 +11591,8 @@ function refreshMageBook()
bottomSpells5 = {}
bottomSpells6 = {}
bottomSpells7 = {}
bottomSpells8 = {}
bottomSpells9 = {}
bottomSpellsPlaceHolder = {}
bottomSpellsPlaceHolder1 = {}
bottomSpellsPlaceHolder2 = {}
Expand All @@ -11559,6 +11601,8 @@ function refreshMageBook()
bottomSpellsPlaceHolder5 = {}
bottomSpellsPlaceHolder6 = {}
bottomSpellsPlaceHolder7 = {}
bottomSpellsPlaceHolder8 = {}
bottomSpellsPlaceHolder9 = {}
end
elseif bookMode == 1 then
bookSpells = filterContingencyMageSpells()
Expand Down

0 comments on commit fc3cde5

Please sign in to comment.