public void Init() { if (hasInitialized) return; hasInitialized = true; View = new WeenusUI(this); MenuAnimationTimer = new ActionTimer(MenuAnimationSpeed, OnMenuAnimationComplete); MenuAnimationTimer.AccurateMode = true; View.SetClickHandler("games", true, delegate () { View.UI.SwitchToScreen("games"); View.UI.CloseAppMenu(); }); View.SetClickHandler("friends", true, delegate () { View.UI.SwitchToScreen("friends"); View.UI.CloseAppMenu(); }); View.SetClickHandler("exit", true, delegate() { Application.Quit(); }); View.SetClickHandler("backtogame", true, delegate() { MobileUIManager.Current.Manager.StartPlayMode(); }); MenuBacking.onClick.AddListener(delegate() { this.CloseAppMenu(); }); }
public void Start() { View = new WeenusUI(this); scrollList.BindableList.OnItemClicked = (BindableListItem item) => { Debug.Log(item.ItemText); }; View.SetOnChangedHandler("search", PerformSearch); }
public void Init() { if (hasInitialized) return; hasInitialized = true; this.View = new WeenusUI(this); Button b = this.GetComponent<Button>(); b.onClick.AddListener(CloseModal); }
public void Start() { View = new WeenusUI(this); scrollList.BindableList.OnItemClicked = (BindableListItem item) => { Debug.Log(item.ItemText); }; View.SetClickHandler("add", delegate () { MobileUIManager.Current.Manager.SwitchToScreen("searchplayers"); }); }
public void Init() { if (hasInitialized) return; hasInitialized = true; View = new WeenusUI(this); View.SetClickHandler("save", delegate() { string friendSelectScreenName = "FriendsSelect"; var selectScreen = MobileUIManager.Current.Manager.GetComponentFromScreen<HamburglarUiFriendSelect>(friendSelectScreenName); selectScreen.OnSelectionsFinished = OnPlayersSelected; MobileUIManager.Current.Manager.SwitchToScreen(friendSelectScreenName); }); }
public void Init() { if (hasInitialized) return; hasInitialized = true; View = new WeenusUI(this); View.SetClickHandler("save", delegate() { string url = UrlResolver.CreateUser( View.GetInputText("username"), View.GetInputText("password"), View.GetInputInt("imageurl")); HamburglarContext.Instance.Service.Call("signup", url, OnPlayerCreated); }); }
public void Start() { View = new WeenusUI(this); scrollList.BindableList.OnItemClicked = (BindableListItem item) => { // first check if game request is for game that's currently loaded if (HamburglarContext.Instance.BuildingData != null && HamburglarContext.Instance.BuildingData.Id.Equals(item.Value.ToString(), System.StringComparison.OrdinalIgnoreCase)) { // send to play mode directly MobileUIManager.Current.Manager.StartPlayMode(); return; } // start game loading workflow HamburglarContext.Instance.Service.StartGame(item.Value.ToString()); }; View.SetClickHandler("add", delegate() { MobileUIManager.Current.Manager.SwitchToScreen("create"); }); }
public static FriendListItem.FriendType GetFriendshipType(WeenusUI View, string playerId) { if (playerId.Equals(HamburglarContext.Instance.PlayerId, StringComparison.OrdinalIgnoreCase)) return FriendListItem.FriendType.You; var _pendingFriends = View.UI.GetViewData<List<GameListItem>>("friend.pending"); var _friendRequests = View.UI.GetViewData<List<GameListItem>>("friend.requests"); var _friends = View.UI.GetViewData<List<GameListItem>>("friend.friends"); if (_friendRequests != null && _friendRequests.Any(x => x.i.Equals(playerId, StringComparison.InvariantCultureIgnoreCase))) return FriendListItem.FriendType.FriendRequest; if (_friends != null && _friends.Any(x => x.i.Equals(playerId, StringComparison.InvariantCultureIgnoreCase))) return FriendListItem.FriendType.Friend; if (_pendingFriends != null && _pendingFriends.Any(x => x.i.Equals(playerId, StringComparison.InvariantCultureIgnoreCase))) return FriendListItem.FriendType.Pending; return FriendListItem.FriendType.Nothing; }
void Start() { View = new WeenusUI(this); View.SetClickHandler("login", delegate() { string username = View.GetInputText("username").Trim(); string password = View.GetInputText("password").Trim(); if (string.IsNullOrEmpty(username)) { return; // no username! } string url = UrlResolver.Login(username, password); HamburglarContext.Instance.Service.Call("login", url, OnLoggedIn); }); View.SetClickHandler("create", delegate() { MobileUIManager.Current.Manager.SwitchToScreen("SignUp"); }); if (HamburglarContext.Instance.DebugUser) { OnLoggedIn(HamburglarContext.Instance.DegugUserID); } }
public void Start() { View = new WeenusUI(this); View.SetOnChangedHandler("search", PerformSearch); View.SetClickHandler("accept", () => { if (OnSelectionsFinished != null) { CaptureCurrentSelectedPlayers(); OnSelectionsFinished(SelectedPlayers); } }); }
// Use this for initialization void Start() { View = new WeenusUI(this); }