mirror of
https://github.com/kepler155c/opus
synced 2024-12-24 23:50:26 +00:00
grid setSelected, update tron url/icon
This commit is contained in:
parent
beae4e6eaf
commit
1fb5379b11
@ -1424,6 +1424,18 @@ function UI.Grid:getSelected()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UI.Grid:setSelected(name, value)
|
||||||
|
if self.sorted then
|
||||||
|
for k,v in pairs(self.sorted) do
|
||||||
|
if self.values[v][name] == value then
|
||||||
|
self:setIndex(k)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self:setIndex(1)
|
||||||
|
end
|
||||||
|
|
||||||
function UI.Grid:focus()
|
function UI.Grid:focus()
|
||||||
self:drawRows()
|
self:drawRows()
|
||||||
end
|
end
|
||||||
@ -1465,14 +1477,7 @@ function UI.Grid:update()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.sorted = { }
|
self.sorted = Util.keys(self.values)
|
||||||
for k,v in pairs(self.values) do
|
|
||||||
if self:isRowValid(k, v) then
|
|
||||||
table.insert(self.sorted, k)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--self.sorted = Util.keys(self.values)
|
|
||||||
if order then
|
if order then
|
||||||
table.sort(self.sorted, function(a,b)
|
table.sort(self.sorted, function(a,b)
|
||||||
return order(self.values[a], self.values[b])
|
return order(self.values[a], self.values[b])
|
||||||
@ -1558,12 +1563,6 @@ function UI.Grid:drawRows()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Non-intuitive: update must be called if the table was specified
|
|
||||||
-- in the shortcut definition (as this callback was not yet overridden)
|
|
||||||
function UI.Grid:isRowValid(--[[ key, value ]])
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function UI.Grid:getRowTextColor(row, selected)
|
function UI.Grid:getRowTextColor(row, selected)
|
||||||
if selected then
|
if selected then
|
||||||
if self.focused then
|
if self.focused then
|
||||||
|
@ -137,7 +137,7 @@ function Canvas:writeBlit(x, y, text, bg, fg)
|
|||||||
if bg then
|
if bg then
|
||||||
bg = _sub(bg, 2 - x)
|
bg = _sub(bg, 2 - x)
|
||||||
end
|
end
|
||||||
if bg then
|
if fg then
|
||||||
fg = _sub(fg, 2 - x)
|
fg = _sub(fg, 2 - x)
|
||||||
end
|
end
|
||||||
width = width + x - 1
|
width = width + x - 1
|
||||||
@ -149,7 +149,7 @@ function Canvas:writeBlit(x, y, text, bg, fg)
|
|||||||
if bg then
|
if bg then
|
||||||
bg = _sub(bg, 1, self.width - x + 1)
|
bg = _sub(bg, 1, self.width - x + 1)
|
||||||
end
|
end
|
||||||
if bg then
|
if fg then
|
||||||
fg = _sub(fg, 1, self.width - x + 1)
|
fg = _sub(fg, 1, self.width - x + 1)
|
||||||
end
|
end
|
||||||
width = #text
|
width = #text
|
||||||
|
@ -203,9 +203,9 @@
|
|||||||
[ "76b849f460640bc789c433894382fb5acbac42a2" ] = {
|
[ "76b849f460640bc789c433894382fb5acbac42a2" ] = {
|
||||||
title = "Tron",
|
title = "Tron",
|
||||||
category = "Games",
|
category = "Games",
|
||||||
iconExt = "\030 \031f\0305\031f\151\030f\0315\135\131\0305\031f\146\
|
iconExt = "\030 \031f\030b\031f\143\030f\128\128\030b\143\143\143\030f\128\128\
|
||||||
\030 \031f\030f\0315\130\141\0305\031f\139\030f\0315\130\
|
\030 \031f\0309\031b\140\030b\031f\151\030f\031b\131\0307\148\0317\128\030b\151\030f\031b\131\148\
|
||||||
\030 \031f\0305\031f\146\143\030f\0315\158\031e\130",
|
\030 \031f\030f\031b\131\031f\128\031b\131\0317\131\031f\128\0317\131\031b\131\031f\128",
|
||||||
run = "https://raw.githubusercontent.com/LDDestroier/CC/master/tron",
|
run = "https://raw.githubusercontent.com/LDDestroier/CC/master/tron.lua",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user