Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menu_lan_results={
- init_function = function()
- Network:StartSystemLink()
- windows_reset()
- GameFlow.SetGameMode("JOIN")
- StandardUpperBalk()
- StandardLowerBalk()
- --XBoxLiveLowerBalk(LINKRESULTS_JOIN, LINKRESULTS_BACK, LINKRESULTS_REFRESH)
- GUI:LoadBackground("data/menu/bg/game_background.tga")
- local listboxParams={
- ListBoxTemplate={Name="sessionlist", ShowBorders=FALSE},
- Left=Layout.ListPos[1],
- Top=Layout.ListPos[2],
- LeftPadding=0,
- RightPadding=0,
- TopPadding=0,
- BottomPadding=0,
- RowWidth=Layout.ListWidth,
- RowHeight=Layout.ListRowHeight,
- RowPadding=Layout.ListRowPadding,
- RowTemplate={Font=Layout.ListFont, DrawBackgroundColor=TRUE, TitleCentering=TITLE_CENTER_NONE},
- RowTemplateType="Button",
- RowTemplateCust=function(Row, RowNr)
- Row:SetColor({0, 0, 0, 0})
- Row:SetActiveColor(Layout.ListBackgroundColor)
- Row:SetInactiveColor({0, 0, 0, 0})
- end,
- NumRows=9,
- Coloumns={
- [1]={
- Name="matchnr", -- _row# is added
- ColoumnTemplate={Position=Layout.MatchNrPos, Font=Layout.MatchNrFont, Size=SIZE(Layout.ListRowHeight,Layout.MatchNrWidth), ShowBorders=FALSE},
- ColoumnTemplateType="StaticText",
- ColoumnTemplateCust=function(Coloumn, RowNr, ColoumnNr)
- Coloumn:SetColor(Layout.MatchNrFontColor)
- end
- },
- [2]={
- Name="matchname", -- _row# is added
- ColoumnTemplate={Position=Layout.MatchNamePos, Size=SIZE(Layout.ListRowHeight,Layout.MatchNameWidth), Font=Layout.ListFont, DrawBackgroundColor=FALSE, TitleCentering=TITLE_CENTER_NONE},
- ColoumnTemplateType="StaticText",
- ColoumnTemplateCust=function(Coloumn, RowNr, ColoumnNr)
- Coloumn:SetColor(Layout.ListFontColor)
- end
- },
- [3]={
- Name="players", -- _row# is added
- ColoumnTemplate={Position=Layout.PlayersPos, Size=SIZE(Layout.ListRowHeight,Layout.PlayersWidth), Font=Layout.ListFont, DrawBackgroundColor=FALSE, TitleCentering=TITLE_CENTER_NONE},
- ColoumnTemplateType="StaticText",
- ColoumnTemplateCust=function(Coloumn, RowNr, ColoumnNr)
- Coloumn:SetColor(Layout.ListFontColor)
- end
- },
- }
- }
- local list=addparent(CreateMultiColoumnListBox(listboxParams))
- list.onNeedData=function(Self, RowObject, RowNr, ControlRowNr)
- local matchnr=wm.GetWindow(string.format("matchnr_row%i", ControlRowNr))
- local matchname=wm.GetWindow(string.format("matchname_row%i", ControlRowNr))
- local players=wm.GetWindow(string.format("players_row%i", ControlRowNr))
- if RowNr <=SessionList:GetNumSessions() then
- SessionList:SetSessionNum(RowNr)
- local sessionInfo=SessionList:GetSessionInfo()
- --matchnr:SetTitle(ConvertToWString(string.format("%02i", RowNr)))
- matchname:SetTitle(sessionInfo.SessionName)
- local playersTitle=string.format("%i/%i", sessionInfo.FilledPublicSlots+sessionInfo.FilledPrivateSlots, sessionInfo.MaxPublicSlots+sessionInfo.MaxPrivateSlots)
- playersTitle=ConvertToWString(playersTitle)
- players:SetTitle(playersTitle)
- end
- end
- list:SetNumRows(0)
- list.onSelectedRowChanged=function(Self, RowNr)
- RefreshGameInfoBox()
- end
- local win=addparent(StaticText{Position=MakeSafePos(Layout.GameTitlePos), Size=Layout.TitleSize, Font=Layout.TitleFont, ShowBorders=FALSE})
- win:SetColor(Layout.TitleFontColor)
- win:SetTitle(LINKRESULTS_GAME)
- local win=addparent(StaticText{Position=MakeSafePos(Layout.PlayersTitlePos), Size=Layout.TitleSize, Font=Layout.TitleFont, ShowBorders=FALSE})
- win:SetColor(Layout.TitleFontColor)
- win:SetTitle(LINKRESULTS_PLAYERS)
- CreateGameInfoBox(Layout.InfoBoxPos, Layout.InfoBoxSize, true, false, true)
- --local handler=addparent(InputHandler{Name="inputhandler"})
- --handler.onKeyPressed=function(Self, Character, VirtualKey, ScanCode)
- -- if VirtualKey==KeyCodes["BUTTON_START"] then
- -- JoinSelectedSession()
- -- elseif VirtualKey==KeyCodes["BUTTON_SELECT"] then
- -- menu_lan_results.options.back_action()
- -- elseif VirtualKey==KeyCodes["BUTTON_X"] and State=="DISPLAYING" then
- -- Network:StopSystemLink()
- -- Network:StartSystemLink()
- -- SessionList:Refresh()
- -- ShowThinkingWindow()
- -- State="SEARCHING"
- -- elseif VirtualKey==KeyCodes["BUTTON_UP"] then
- -- list:MovePrev()
- -- elseif VirtualKey==KeyCodes["BUTTON_DOWN"] then
- -- list:MoveNext()
- -- elseif VirtualKey==KeyCodes["BUTTON_LEFT"] then
- -- PrevInfoPage()
- -- elseif VirtualKey==KeyCodes["BUTTON_RIGHT"] then
- -- NextInfoPage()
- -- end
- --end
- --handler:SetFocus()
- activateparents()
- SessionList:Refresh()
- ShowThinkingWindow()
- State="SEARCHING"
- end,
- deinit_function = function()
- --deactivateparents()
- windows_reset()
- end,
Advertisement
Add Comment
Please, Sign In to add comment