Skip to content

Commit

Permalink
v4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
r-e-d committed Aug 10, 2022
1 parent ebc439d commit 6cb69c0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LeUI/LeUI.tp2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BACKUP ~LeUI/backup~
AUTHOR ~lefreut~
VERSION ~4.4.6~
VERSION ~4.5~
LANGUAGE
~English~ ~en_US~ ~LeUI/lang/en_US/setup.tra~

Expand Down
25 changes: 17 additions & 8 deletions LeUI/copy/UI.menu
Original file line number Diff line number Diff line change
Expand Up @@ -13916,6 +13916,14 @@ function dragMessagesY(newY)
setQuickLootOffset()
chatboxScrollToBottom = 1
end

function clean(str)
-- remove extra space in front of innate abilities
str = str:gsub('(%^%-: %^0x%x%x%x%x%x%x%x%x) ', '%1')
-- remove empty name
str = str:gsub('%^0x%x%x%x%x%x%x%x%x %^%-: ', '')
return str
end
`
menu
{
Expand Down Expand Up @@ -13963,7 +13971,7 @@ menu
label
{
area 0 0 816 -1
text lua "combatLog[rowNumber]"
text lua "clean(combatLog[rowNumber])"
text style "normal"
}
}
Expand Down Expand Up @@ -14085,7 +14093,7 @@ function getDialogText(row)
idx2 = idx2 - 1
end

return trim(row == 1 and worldMessageBoxText:sub(1, idx1) or worldMessageBoxText:sub(idx1 + 1))
return clean(trim(row == 1 and worldMessageBoxText:sub(1, idx1) or worldMessageBoxText:sub(idx1 + 1)))
end

function B3Split(inputstr, sep)
Expand Down Expand Up @@ -16147,7 +16155,10 @@ function specialistFrame(num)
return 0
end
function specialistOrSelectedFrame(num)
if chargen.choose_spell[rowNumber].enabled or chargen.choose_spell[rowNumber].known then
if chargen.choose_spell[rowNumber].known then
return 4
end
if chargen.choose_spell[rowNumber].enabled then
return 2
end
return specialistFrame(num)
Expand Down Expand Up @@ -21692,25 +21703,23 @@ function createEntry(questId, objectiveId, entryId, previousObjectives, subGroup
table.insert(subGroups[subGroup],entry)
end

--This code is different if we're sod or BG
local lineCount = 1
local fullStr = Infinity_FetchString(entryId)
for line in string.gmatch(fullStr, "[^\r\n]+") do
if(lineCount == 1) then
--objective text is first line.
objective.text = line
end
if(lineCount > 1) then
else
--entry text is everything after first
entry.text = entry.text .. line .. "\n"
end
lineCount = lineCount + 1
if(line:sub(-1) == ".") then break end
end
if(lineCount == 2) then
--it looks like sometimes entries are just an unbroken paragraph
--in this case the entry should get the paragraph and the objective gets nothing
--note lineCount == 2 is a bit misleading, there's only one line in this case.
entry.text = objective.text
entry.text = fullStr
objective.text = Infinity_FetchString(quest.text)
end
objective.entries = {entry}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The goal of this mod is to provide an unified and improved UI for Baldur's Gate

## Compatibility

For EE version 2.6, use the v4.4.6 version of this mod.
For EE version 2.6, use the v4.5 version of this mod.

For EE version 2.5, use the v4.3.2 version of this mod.

Expand Down

0 comments on commit 6cb69c0

Please sign in to comment.