Community Curator/Source/TSWRes Community1

function Community.OfflineMenu for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOfflineMenu draw.endframe print("Offline") TX, TY = draw.waittouch local BackTap = TRec(24, SizeY - 64, 128, SizeY - 24, TX, TY) local ConnectTap = TRec(24, 64, 128, 96, TX, TY) if BackTap then return elseif ConnectTap then if Community.ShowIntro == true then Community.Intro end if Community.FirstUse then Community.FirstConnect else Community.ConnectToCommunity end elseif LevelsTap then

end end end

-- Gets the icon touched function PlayIcoTapped(TX, TY, Scroll) t2=t2 or t  local X1 = 32 local X2, Y2 = SizeX - 32, SizeY-32 local FunX,FunY = 32, 64 local DwSize, IcoSize = 1, 64 local OptSz = 64 local DISz = (IcoSize*DwSize) for k,v in pairs(PlayIcons) do     local TappedIcon = TRec(FunX, FunY, FunX+64, FunY+64, TX, TY + Scroll) if TappedIcon then SavedFile.SFJSON["Icon"] = k        Action = "Close" return k     end FunX = FunX + OptSz if FunX + OptSz > X2 then FunX, FunY = X1, FunY + OptSz end end end

-- Icon Menu Touch function PlayIcoTouch(TX, TY) local ClosePress = TRec(32, 32, 64, 64, TX, TY) local Scroll = 0 if ClosePress then Action = "Close" return else PlayIcoTapped(TX, TY, Scroll) end end

-- Player Icons function Community.PlayIconsMenu sleep(100) for i=1, math.huge do     draw.tracktouches(Nil, Nil, PlayIcoTouch) local OldTime = sys.gettime Action = nil draw.beginframe Draw.BGs.PlayIconsMenu draw.endframe draw.doevents if Action == "Close" then Action = nil return end end end

function Community.OnlineMenuHome for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOnlineMenuHome draw.endframe TX, TY = draw.waittouch local DisconnectTap = TRec(0, 0, 48, 48, TX, TY) local NewsTap = TRec(SizeX-180, 0, SizeX, HS, TX, TY) local LevelsTap = TRec(SizeX-180, HS, SizeX, HS*2, TX, TY) local FriendsTap = TRec(SizeX-180, HS*2, SizeX, HS*3, TX, TY) local ActivityTap = TRec(SizeX-180, HS*3, SizeX, HS*4, TX, TY) local StoreTap = TRec(SizeX-180, HS*4, SizeX, HS*5, TX, TY) local MeTap = TRec(SizeX-180, HS*5, SizeX, HS*6, TX, TY) local HelpTap = TRec(SizeX-180, HS*6, SizeX, HS*7, TX, TY) local SignOutTap = TRec(SizeX-180, SizeY-HS, SizeX, SizeY, TX, TY) local SearchTap = TRec(0, SizeY-32, 256, SizeY, TX, TY) if DisconnectTap then Community.SaveFile Community.Disconnect sys.alert("drop") return elseif NewsTap then Community.OnlineMenuNews elseif LevelsTap then Community.OnlineMenuLevels elseif FriendsTap then Community.OnlineMenuFriends elseif ActivityTap then Community.OnlineMenuActivity elseif StoreTap then Community.OnlineMenuStore elseif MeTap then Community.PlayIconsMenu elseif SignOutTap then if Community.SignedIn then Community.SignOut Community.OnlineMenuHomeSO return end elseif SearchTap then local SearchTerm = Key.Keyboard("Search") http.load(Community.ConnectURL.. "MediaWiki:Search/"..SearchTerm) end end end

function Community.OnlineMenuHomeSO for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOnlineMenuHomeSO draw.endframe TX, TY = draw.waittouch local DisconnectTap = TRec(0, 0, 48, 48, TX, TY) local NewsTap = TRec(SizeX-180, 0, SizeX, 48, TX, TY) local LevelsTap = TRec(SizeX-180, 48, SizeX, 48*2, TX, TY) local ActivityTap = TRec(SizeX-180, 48*2, SizeX, 48*3, TX, TY) local SignInTap = TRec(SizeX-180, SizeY-96, SizeX, SizeY-48, TX, TY) local RegisterTap = TRec(SizeX-180, SizeY-48, SizeX, SizeY, TX, TY) if DisconnectTap then Community.Disconnect sys.alert("drop") return elseif NewsTap then Community.OnlineMenuNews elseif LevelsTap then Community.OnlineMenuLevels elseif ActivityTap then Community.OnlineMenuActivity elseif SignInTap then Community.SignIn if Community.SignedIn then Community.OnlineMenuHome return end end end end

function Community.OnlineMenuNews for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOnlineMenuNews draw.endframe TX, TY = draw.waittouch local BackTap = TRec(0, 0, 48, 48, TX, TY) if BackTap then return end end end

function Community.OnlineMenuLevels for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOnlineMenuLevels draw.endframe TX, TY = draw.waittouch local BackTap = TRec(0, 0, 48, 48, TX, TY) if BackTap then return end end end

function Community.OnlineMenuFriends for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOnlineMenuLevels draw.endframe TX, TY = draw.waittouch local BackTap = TRec(0, 0, 48, 48, TX, TY) if BackTap then return end end end

function Community.OnlineMenuActivity for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOnlineMenuLevels draw.endframe TX, TY = draw.waittouch local BackTap = TRec(0, 0, 48, 48, TX, TY) if BackTap then return end end end

function Community.OnlineMenuStore for i=1, math.huge do     draw.beginframe Draw.BGs.CommunityOnlineMenuLevels draw.endframe TX, TY = draw.waittouch local BackTap = TRec(0, 0, 48, 48, TX, TY) if BackTap then return end end end