Skip to content

Commit

Permalink
Compatibility with Remove intelligence-based restrictions on number a…
Browse files Browse the repository at this point in the history
…nd level of learnable spells (Talents of Faerûn)
  • Loading branch information
r-e-d committed Jan 5, 2024
1 parent 957ad16 commit bfa67f0
Showing 1 changed file with 68 additions and 72 deletions.
140 changes: 68 additions & 72 deletions LeUI/copy/UI.menu
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,17 @@ listMetaInfo = {}
combatLog = {}

function updateAttrTable()
if (characters[currentID] ~= nil) then
attributeItems = {
{ characters[currentID].attr.str, 9582 },
{ characters[currentID].attr.dex, 9584 },
{ characters[currentID].attr.con, 9583 },
{ characters[currentID].attr.int, 9585 },
{ characters[currentID].attr.wis, 9586 },
{ characters[currentID].attr.cha, 9587 }
}
buildRecordStats()
buildRecordInfos()
end
end

function characterDescString(char)
return Infinity_FetchString(char.gender) .. "\n" .. Infinity_FetchString(char.race) .. "\n" .. char.class .. "\n" .. Infinity_FetchString(char.alignment)
end

function displaySTR()
local txt = characters[currentID].attr.str.current

if (characters[currentID].attr.str.current == 18 and characters[currentID].attr.str.extra ~= 0) then
txt = txt .. '/' .. string.format('%02d', characters[currentID].attr.str.extra % 100)
end
if (characters[currentID].attr.str.current > characters[currentID].attr.str.base or characters[currentID].attr.str.extra > characters[currentID].attr.str.extraBase) then
txt = '^G' .. txt .. '^-'
end
if (characters[currentID].attr.str.current < characters[currentID].attr.str.base or characters[currentID].attr.str.extra < characters[currentID].attr.str.extraBase) then
txt = '^R' .. txt .. '^-'
end
return txt
end

function displayBuff(current, base)
if(current > base) then
return '^G' .. current .. '^-'
elseif (current < base) then
return '^R' .. current .. '^-'
end
return current
end
if (characters[currentID] == nil) then return end

function displayAttr(index)
if (index == 1) then
return displaySTR()
else
return displayBuff(attributeItems[index][1].current, attributeItems[index][1].base)
end
end

function CurrentlyInGame()
return characterScreen:IsInGame()
end
attributeItems = {
{ characters[currentID].attr.str, 9582 },
{ characters[currentID].attr.dex, 9584 },
{ characters[currentID].attr.con, 9583 },
{ characters[currentID].attr.int, 9585 },
{ characters[currentID].attr.wis, 9586 },
{ characters[currentID].attr.cha, 9587 }
}

function buildRecordStats()
recordStats = {}

table.insert(recordStats, {1,t("ABILITIES_TITLE")})
Expand Down Expand Up @@ -97,25 +53,7 @@ function buildRecordStats()
local pos = s:find(":", 1)
table.insert(recordStats, {2,s:sub(1, pos - 1),s:sub(pos + 2)})
end
end
function isEmpty(t)
if next(t) == nil then
return true
end
return false
end
function getClassString()
table.insert(recordInfos, {1,characters[currentID].classlevel.first.details})
if characters[currentID].classlevel.second then
table.insert(recordInfos, {1,""})
table.insert(recordInfos, {1,characters[currentID].classlevel.second.details})
end
if characters[currentID].classlevel.third then
table.insert(recordInfos, {1,""})
table.insert(recordInfos, {1,characters[currentID].classlevel.third.details})
end
end
function buildRecordInfos()

recordInfos = {}

if characters[currentID].classlevel.second then
Expand Down Expand Up @@ -175,6 +113,64 @@ function buildRecordInfos()
end
end
end

function characterDescString(char)
return Infinity_FetchString(char.gender) .. "\n" .. Infinity_FetchString(char.race) .. "\n" .. char.class .. "\n" .. Infinity_FetchString(char.alignment)
end

function displaySTR()
local txt = characters[currentID].attr.str.current

if (characters[currentID].attr.str.current == 18 and characters[currentID].attr.str.extra ~= 0) then
txt = txt .. '/' .. string.format('%02d', characters[currentID].attr.str.extra % 100)
end
if (characters[currentID].attr.str.current > characters[currentID].attr.str.base or characters[currentID].attr.str.extra > characters[currentID].attr.str.extraBase) then
txt = '^G' .. txt .. '^-'
end
if (characters[currentID].attr.str.current < characters[currentID].attr.str.base or characters[currentID].attr.str.extra < characters[currentID].attr.str.extraBase) then
txt = '^R' .. txt .. '^-'
end
return txt
end

function displayBuff(current, base)
if(current > base) then
return '^G' .. current .. '^-'
elseif (current < base) then
return '^R' .. current .. '^-'
end
return current
end

function displayAttr(index)
if (index == 1) then
return displaySTR()
else
return displayBuff(attributeItems[index][1].current, attributeItems[index][1].base)
end
end

function CurrentlyInGame()
return characterScreen:IsInGame()
end

function isEmpty(t)
if next(t) == nil then
return true
end
return false
end
function getClassString()
table.insert(recordInfos, {1,characters[currentID].classlevel.first.details})
if characters[currentID].classlevel.second then
table.insert(recordInfos, {1,""})
table.insert(recordInfos, {1,characters[currentID].classlevel.second.details})
end
if characters[currentID].classlevel.third then
table.insert(recordInfos, {1,""})
table.insert(recordInfos, {1,characters[currentID].classlevel.third.details})
end
end
function getStatusString(strRef)
if type(dwAddCharacterIcon2) == 'function' then
strRef = dwAddCharacterIcon2(strRef)
Expand Down

0 comments on commit bfa67f0

Please sign in to comment.