Skip to content

Commit

Permalink
v0.10.2.1-alpha
Browse files Browse the repository at this point in the history
- Fix regressions in IDS functions
  • Loading branch information
Bubb13 committed May 22, 2024
1 parent 636ffe6 commit d288660
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 12 deletions.
2 changes: 1 addition & 1 deletion EEex/EEex.tp2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BACKUP ~EEex/backup~
AUTHOR ~Bubb~
VERSION ~v0.10.2-alpha~
VERSION ~v0.10.2.1-alpha~
README ~EEex/readme-EEex.html~

BEGIN ~EEex~ LABEL ~B3-EEex-Main~
Expand Down
2 changes: 1 addition & 1 deletion EEex/copy/EEex_Action.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function EEex_Action_ExecuteScriptFileResponseAsAIBaseInstantly(pScriptFile, pGa
pCurAction:operator_equ(pAction)

-- Decode new action's CAIObjectType(s)
if not EEex_EngineGlobal_CBaldurChitin.m_pObjectGame.m_ruleTables.m_lNoDecodeList:Find1(pCurAction.m_actionID) then
if not EEex_EngineGlobal_CBaldurChitin.m_pObjectGame.m_ruleTables.m_lNoDecodeList:FindID(pCurAction.m_actionID) then
pCurAction:Decode(pGameAIBase)
end

Expand Down
1 change: 1 addition & 0 deletions EEex/copy/EEex_Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ EEex_Main_Private_NormalStartupFiles = {
"EEex_Sprite_Patch",
"EEex_Stats",
"EEex_Stats_Patch",
"EEex_Test",
"EEex_Trigger",
"EEex_Trigger_Patch",
"EEex_Utility",
Expand Down
16 changes: 8 additions & 8 deletions EEex/copy/EEex_Resource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ C2DArray.free = EEex_Resource_Free2DA
--
-- @param { columnIndex / type=number }: The column index of the label to be fetched.
--
-- @return { type=number }: See summary.
-- @return { type=string }: See summary.

function EEex_Resource_Get2DAColumnLabel(array, columnIndex)
local sizeX = array.m_nSizeX
Expand Down Expand Up @@ -447,7 +447,7 @@ C2DArray.getMaxIndices = EEex_Resource_GetMax2DAIndices
--
-- @param { columnIndex / type=number }: The index of the column whose values are to be iterated.
--
-- @param { func / type=function(value: string) -> boolean }: The function to be called.
-- @param { func / type=function(i: number, value: string) -> boolean }: The function to be called.

function EEex_Resource_Iterate2DAColumnIndex(array, columnIndex, func)
local sizeX, sizeY = array:getDimensions()
Expand All @@ -469,7 +469,7 @@ C2DArray.iterateColumnIndex = EEex_Resource_Iterate2DAColumnIndex
--
-- @param { columnLabel / type=string }: The label of the column whose values are to be iterated.
--
-- @param { func / type=function(value: string) -> boolean }: The function to be called.
-- @param { func / type=function(i: number, value: string) -> boolean }: The function to be called.

function EEex_Resource_Iterate2DAColumnLabel(array, columnLabel, func)
array:iterateColumnIndex(array:findColumnLabel(columnLabel), func)
Expand All @@ -484,7 +484,7 @@ C2DArray.iterateColumnLabel = EEex_Resource_Iterate2DAColumnLabel
--
-- @param { rowIndex / type=number }: The index of the row whose values are to be iterated.
--
-- @param { func / type=function(value: string) -> boolean }: The function to be called.
-- @param { func / type=function(i: number, value: string) -> boolean }: The function to be called.

function EEex_Resource_Iterate2DARowIndex(array, rowIndex, func)
local sizeX, sizeY = array:getDimensions()
Expand All @@ -506,7 +506,7 @@ C2DArray.iterateRowIndex = EEex_Resource_Iterate2DARowIndex
--
-- @param { rowLabel / type=string }: The label of the row whose values are to be iterated.
--
-- @param { func / type=function(value: string) -> boolean }: The function to be called.
-- @param { func / type=function(i: number, value: string) -> boolean }: The function to be called.

function EEex_Resource_Iterate2DARowLabel(array, rowLabel, func)
array:iterateRowIndex(array:findRowLabel(rowLabel), func)
Expand Down Expand Up @@ -756,7 +756,7 @@ CAIIdList.getEntry = EEex_Resource_GetIDSEntry
-- @return { type=string }: See summary.

function EEex_Resource_GetIDSLine(ids, id)
local entry = ids:getEntry()
local entry = ids:getEntry(id)
return entry and entry.m_line.m_pchData:get() or nil
end
CAIIdList.getLine = EEex_Resource_GetIDSLine
Expand All @@ -775,7 +775,7 @@ CAIIdList.getLine = EEex_Resource_GetIDSLine
-- @return { type=string }: See summary.

function EEex_Resource_GetIDSStart(ids, id)
local entry = ids:getEntry()
local entry = ids:getEntry(id)
return entry and entry.m_start.m_pchData:get() or nil
end
CAIIdList.getStart = EEex_Resource_GetIDSStart
Expand All @@ -793,7 +793,7 @@ CAIIdList.getStart = EEex_Resource_GetIDSStart
-- @return { type=boolean }: See summary.

function EEex_Resource_IDSHasID(ids, id)
return ids:getEntry() ~= nil
return ids:getEntry(id) ~= nil
end
CAIIdList.hasID = EEex_Resource_IDSHasID

Expand Down
72 changes: 72 additions & 0 deletions EEex/copy/EEex_Test.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

function EEex_Test_IDSFunctions()

local doTest = function(cacheAsArray)

local action = EEex_Resource_LoadIDS("ACTION", cacheAsArray)

print(string.format(" [%s] %d", "EEex_Resource_GetIDSCount", EEex_Resource_GetIDSCount(action)))
print(string.format(" [%s] %s", "EEex_Resource_GetIDSEntry", tostring(EEex_Resource_GetIDSEntry(action, 3))))
print(string.format(" [%s] %s", "EEex_Resource_GetIDSLine", EEex_Resource_GetIDSLine(action, 1)))
print(string.format(" [%s] %s", "EEex_Resource_GetIDSStart", EEex_Resource_GetIDSStart(action, 1)))
print(string.format(" [%s] %s", "EEex_Resource_IDSHasID(3)", tostring(EEex_Resource_IDSHasID(action, 3))))
print(string.format(" [%s] %s", "EEex_Resource_IDSHasID(4)", tostring(EEex_Resource_IDSHasID(action, 4))))

print(string.format(" [%s]", "EEex_Resource_IterateIDSEntries"))
EEex_Resource_IterateIDSEntries(action, function(entry)
print(string.format(" %s", tostring(entry)))
end)

print(string.format(" [%s]", "EEex_Resource_IterateUnpackedIDSEntries"))
EEex_Resource_IterateUnpackedIDSEntries(action, function(id, line, start)
print(string.format(" %d, %s, %s", id, line, start))
end)
end

print(string.format("[cacheAsArray=false]"))
doTest(false)
print(string.format("[cacheAsArray=true]"))
doTest(true)
end

function EEex_Test_2DAFunctions()

local kitlist = EEex_Resource_Load2DA("KITLIST")

print(string.format("[%s] %d", "EEex_Resource_Find2DAColumnIndex", EEex_Resource_Find2DAColumnIndex(kitlist, 1, "CLABFI02")))
print(string.format("[%s] %d", "EEex_Resource_Find2DAColumnLabel", EEex_Resource_Find2DAColumnLabel(kitlist, "ABILITIES")))
print(string.format("[%s] %d", "EEex_Resource_Find2DARowIndex", EEex_Resource_Find2DARowIndex(kitlist, 0, "SHAPESHIFTER")))
print(string.format("[%s] %d", "EEex_Resource_Find2DARowLabel", EEex_Resource_Find2DARowLabel(kitlist, "32")))
print(string.format("[%s] %s", "EEex_Resource_Get2DAColumnLabel", EEex_Resource_Get2DAColumnLabel(kitlist, 2)))
print(string.format("[%s] %s", "EEex_Resource_Get2DADefault", EEex_Resource_Get2DADefault(kitlist)))

local dimX, dimY = EEex_Resource_Get2DADimensions(kitlist)
print(string.format("[%s] %d, %d", "EEex_Resource_Get2DADimensions", dimX, dimY))

print(string.format("[%s] %s", "EEex_Resource_Get2DARowLabel", EEex_Resource_Get2DARowLabel(kitlist, 5)))
print(string.format("[%s] %s", "EEex_Resource_GetAt2DALabels", EEex_Resource_GetAt2DALabels(kitlist, "ABILITIES", "31")))
print(string.format("[%s] %s", "EEex_Resource_GetAt2DAPoint", EEex_Resource_GetAt2DAPoint(kitlist, 3, 3)))

local maxX, maxY = EEex_Resource_GetMax2DAIndices(kitlist)
print(string.format("[%s] %d, %d", "EEex_Resource_GetMax2DAIndices", maxX, maxY))

print(string.format("[%s]", "EEex_Resource_Iterate2DAColumnIndex"))
EEex_Resource_Iterate2DAColumnIndex(kitlist, 1, function(i, str)
print(string.format(" [%d] = %s", i, str))
end)

print(string.format("[%s]", "EEex_Resource_Iterate2DAColumnLabel"))
EEex_Resource_Iterate2DAColumnLabel(kitlist, "UNUSABLE", function(i, str)
print(string.format(" [%d] = %s", i, str))
end)

print(string.format("[%s]", "EEex_Resource_Iterate2DARowIndex"))
EEex_Resource_Iterate2DARowIndex(kitlist, 5, function(i, str)
print(string.format(" [%d] = %s", i, str))
end)

print(string.format("[%s]", "EEex_Resource_Iterate2DARowLabel"))
EEex_Resource_Iterate2DARowLabel(kitlist, "41", function(i, str)
print(string.format(" [%d] = %s", i, str))
end)
end
Binary file modified EEex/loader/EEex.dll
Binary file not shown.
Loading

0 comments on commit d288660

Please sign in to comment.