diff --git a/itemcontroller.lua b/itemcontroller.lua index a89da2c..6f18cdb 100644 --- a/itemcontroller.lua +++ b/itemcontroller.lua @@ -143,7 +143,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage, for i=entryStart,entryEnd do local group = groups[i] - local text = group:getDisplayName() + local text = group:getSimpleName() local count = tostring(group:getItemCount()) -- Fit text inside of width budget @@ -241,7 +241,7 @@ local PAGES = { state.height, state.pageState[state.currentPage], function(element, x, y, source, group) - print("Clicked: "..group:getDisplayName()) + print("Clicked: "..group:getSimpleName()) return true end, function(page) @@ -253,7 +253,7 @@ local PAGES = { state:itemTransaction(function() for _,nodeStack in ipairs(state.node:find(function(s) return not s:isEmpty() end)) do if not state.controller:insertStack(nodeStack) then - print("Couldn't find a free slot for: "..(nodeStack:getDisplayName() or nodeStack:getName() or "[EMPTY]")) + print("Couldn't find a free slot for: "..nodeStack:getSimpleName()) end end end) @@ -291,16 +291,14 @@ local CONTROLLER_STATE = { monitor = monitor, nextPage = "MAIN", exit = false, - pageState = {}, - lock = lock, - unlock = unlock, - isLocked = isLocked + pageState = {} } function CONTROLLER_STATE:itemTransaction(transact) - self.lock() + lock() transact() - self.unlock() + saveState(CACHE_FILE, self.controller) + unlock() end os.queueEvent("dummy_event")