Hi there,
I've been working on an In Game log searcher for logs that I save in a database.
I've got a column named source and affected elements
The source column saves the account ID of the one who triggered the function. The affected column stores the account ID's of those who were around when the function was triggered, these numbers are seperated by a ; icon.
I've got an export to a different resource, that allows me to get the character name from the account ID. I already managed to do this for the source column so that it displays the character name in game, instead of the number.
Though the column on the gridlist in game it shows either as 22; or 22;34, depending if there was only 1 affected player, or more.
I've posted the code below that populates the gridlist with the data acquired from the mySQL string on the server side. Though how do I go about seperating the ID's and getting the names from them.
to display like Derek J;Dustin J or Derek J, Dustin J.
I'm using the DGS directx lib, though that shouldn't be much of an issue.
function populateLogGrid(logsResult)
for i, record in ipairs(logsResult) do
local row = DGS:dgsGridListAddRow(grid)
DGS:dgsGridListSetItemText(grid, row, col.date, record[1])
local theAct = getActionRecord(tonumber(record[2]))
DGS:dgsGridListSetItemText(grid, row, col.act, tostring(theAct))
local nameShow = exports.cache:getCharacterNameFromID(record[3])
DGS:dgsGridListSetItemText(grid, row, col.element, tostring(nameShow))
DGS:dgsGridListSetItemText(grid, row, col.elements, record[4])
DGS:dgsGridListSetItemText(grid, row, col.detail, tostring(record[5]))
end
end
addEvent("log:populate", true)
addEventHandler("log:populate", localPlayer, populateLogGrid)