1
0
Fork 0

Compare commits

..

No commits in common. "0907591e8ecebcdaa997de0fffb1febfe9b73866" and "32b6b4c81912c59c8604c9036d288af705cc4185" have entirely different histories.

2 changed files with 3 additions and 57 deletions

View File

@ -35,60 +35,6 @@ function Poker_TableBrowser.Update()
end end
end end
do
local currSort = 1
local currOrder = "asc"
function Poker_TableBrowser.SortTables(id)
if currSort == id then
if currOrder == "desc" then
currOrder = "asc"
else
currOrder = "desc"
end
elseif id then
currSort = id
currOrder = "asc"
end
table.sort(Poker_TableBrowser.Tables, function (v1, v2)
if currOrder == "desc" then
return v1[currSort] > v2[currSort]
else
return v1[currSort] < v2[currSort]
end
end)
Poker_TableBrowser.Update()
end
end
do
local selection = nil
function Poker_TableBrowser.SelectEntry(id)
if selection then
for i = 1, MAX_TABLES do
getglobal("Poker_TableBrowserTableListEntry"..i.."BG"):Hide()
end
selection.isSelected = nil
end
selection = Poker_TableBrowser.Tables[id]
selection.isSelected = true
end
function Poker_TableBrowser.IsSelected(id)
return Poker_TableBrowser.Tables[id] == selection
end
function Poker_TableBrowser.JoinSelectedTable()
if not selection then
return
end
print(string.format("Joining %s's table %s", selection[2], selection[1]))
end
end
for i = 1, MAX_TABLES do for i = 1, MAX_TABLES do
table.insert(Poker_TableBrowser.Tables, { table.insert(Poker_TableBrowser.Tables, {
"Test Table "..i, "Test Table "..i,

View File

@ -5,8 +5,8 @@
<Button name="Poker_TableBrowserHeader" virtual="true"> <Button name="Poker_TableBrowserHeader" virtual="true">
<Scripts> <Scripts>
<OnClick> <OnClick>
Poker_TableBrowser.SortTables(self:GetID()) Poker_TableBrowser.SortTables(this:GetID())
PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON) PlaySound("igMainMenuOptionCheckBoxOn")
</OnClick> </OnClick>
<OnEnter> <OnEnter>
getglobal(self:GetName().."BG"):SetVertexColor(1, 1, 1, 1) getglobal(self:GetName().."BG"):SetVertexColor(1, 1, 1, 1)