private void ClientManager_EventGameStarted() { Application.Invoke(new EventHandler((o, e) => { GameWidget.Game = Game; GameWidget.SetClientManager(ClientManager); stack.VisibleChild = GameWidget; _btn3D.Visible = true; _hScale.Visible = true; _btn3D.WidgetEvent += _btn3D_WidgetEvent; _hScale.WidgetEvent += _hScale_WidgetEvent; })); }
public mw() : this(new Builder("GameWindow.glade")) { MainWidget = new MainWidget(); GameWidget = new GameWidget(); ConnectWidget = new ConnectWidget(); RoomWidget = new RoomWidget(); stack.Add(MainWidget); stack.Add(ConnectWidget); stack.Add(RoomWidget); stack.Add(GameWidget); //MainWidget.ButtonPlay += MainWindow_ButtonPlay; MainWidget.ButtonConnect += MainWindow_ButtonConnect; MainWidget.ButtonCreate += MainWindow_ButtonCreate; //MainWidget.ButtonSettings += MainWindow_ButtonSettings; MainWidget.ButtonQuit += MainWindow_ButtonQuit; ConnectWidget.Connecting += ConnectWidget_Connecting; ConnectWidget.Cancel += new EventHandler((o, e) => stack.VisibleChild = MainWidget); }
private void LoadBTN() { GameWidget gameWidget = m_componentPlayer.View.GameWidget; Subtexture subtexture1 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button1"), Vector2.Zero, Vector2.One); Subtexture subtexture2 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button2"), Vector2.Zero, Vector2.One); Subtexture subtexture3 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button3"), Vector2.Zero, Vector2.One); Subtexture subtexture4 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonPaste"), Vector2.Zero, Vector2.One); Subtexture subtexture5 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonFill"), Vector2.Zero, Vector2.One); Subtexture subtexture6 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonReplace"), Vector2.Zero, Vector2.One); Subtexture subtexture7 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonClear"), Vector2.Zero, Vector2.One); Subtexture subtexture8 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonMemCopy"), Vector2.Zero, Vector2.One); Subtexture subtexture9 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonMemPaste"), Vector2.Zero, Vector2.One); Subtexture subtexture10 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button1_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture11 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button2_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture12 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button3_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture13 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonPaste_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture14 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonFill_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture15 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonReplace_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture16 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonClear_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture17 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonMemCopy_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture18 = new Subtexture(ContentManager.Get <Texture2D>("WE/ButtonMemPaste_pressed"), Vector2.Zero, Vector2.One); Subtexture subtexture21 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button_geo"), Vector2.Zero, Vector2.One); Subtexture subtexture22 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button_geo_press"), Vector2.Zero, Vector2.One); Subtexture subtexture23 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button_run"), Vector2.Zero, Vector2.One); Subtexture subtexture24 = new Subtexture(ContentManager.Get <Texture2D>("WE/Button_run_press"), Vector2.Zero, Vector2.One); Subtexture subtexture19 = new Subtexture(ContentManager.Get <Texture2D>("WE/WEBTN"), Vector2.Zero, Vector2.One); Subtexture subtexture20 = new Subtexture(ContentManager.Get <Texture2D>("WE/WEBTNP"), Vector2.Zero, Vector2.One); F1 = gameWidget.Children.Find <BitmapButtonWidget>("F1", true); F2 = gameWidget.Children.Find <BitmapButtonWidget>("F2", true); F3 = gameWidget.Children.Find <BitmapButtonWidget>("F3", true); F5 = gameWidget.Children.Find <BitmapButtonWidget>("F5", true); F6 = gameWidget.Children.Find <BitmapButtonWidget>("F6", true); F7 = gameWidget.Children.Find <BitmapButtonWidget>("F7", true); F8 = gameWidget.Children.Find <BitmapButtonWidget>("F8", true); F9 = gameWidget.Children.Find <BitmapButtonWidget>("F9", true); F10 = gameWidget.Children.Find <BitmapButtonWidget>("F10", true); F11 = gameWidget.Children.Find <BitmapButtonWidget>("F11", true); F12 = gameWidget.Children.Find <BitmapButtonWidget>("F12", true); WorldEditMenu = gameWidget.Children.Find <BitmapButtonWidget>("WorldEditMenu", true); WorldEditMenuContainerBottom = gameWidget.Children.Find <StackPanelWidget>("WorldEditMenuContainerBottom", true); WorldEditMenuContainerTop = gameWidget.Children.Find <StackPanelWidget>("WorldEditMenuContainerTop", true); WorldEditMenu.NormalSubtexture = subtexture19; WorldEditMenu.ClickedSubtexture = subtexture20; F1.NormalSubtexture = subtexture1; F2.NormalSubtexture = subtexture2; F3.NormalSubtexture = subtexture3; F5.NormalSubtexture = subtexture4; F6.NormalSubtexture = subtexture5; F7.NormalSubtexture = subtexture6; F8.NormalSubtexture = subtexture7; F9.NormalSubtexture = subtexture8; F10.NormalSubtexture = subtexture9; F1.ClickedSubtexture = subtexture10; F2.ClickedSubtexture = subtexture11; F3.ClickedSubtexture = subtexture12; F5.ClickedSubtexture = subtexture13; F6.ClickedSubtexture = subtexture14; F7.ClickedSubtexture = subtexture15; F8.ClickedSubtexture = subtexture16; F9.ClickedSubtexture = subtexture17; F10.ClickedSubtexture = subtexture18; F11.NormalSubtexture = subtexture21; F11.ClickedSubtexture = subtexture22; F12.NormalSubtexture = subtexture23; F12.ClickedSubtexture = subtexture24; }
public FixedCamera(GameWidget gameWidget) : base(gameWidget) { }
public void SetGameWidgetPart(Server.TokenAndId tai, Game game) { this.tai = tai; this.game = game; gameWidget = new GameWidget(tai, game); CrazyGoTimerControl timerControl = new CrazyGoTimerControl(250, timerScript); gameWidget.Controls.timer = timerControl; gameWidget.Callbacks.updateGameCallback = delegate(string s, int a) { UpdateGameCallback(s, a); }; gameWidget.Callbacks.eventCallback = delegate(string message) { OnEvent(message); }; gameWidget.Callbacks.illegalMoveCallback = delegate { UnityEngine.Debug.Log("Illegal move"); }; gameWidget.Callbacks.gameEndedCallback = delegate(string res) { this.OnGameEnd(res); }; gameWidget.Callbacks.gameEndedCallback = delegate(string s) { OnGameEnd(s); UnityEngine.Debug.Log("Game ended: result is " + s); }; gameWidget.Callbacks.eventCallback = delegate(string s) { OnEvent(s); //UnityEngine.Debug.Log("Event: " + s); }; moveButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { //pressButtonSound.Play(); Point a = this.controller.GetCurrentMoveIndicator(); if (a != null) { gameWidget.MakeAMove(a.x + "-" + a.y); } } ))); resignButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeVisible(resignPopup.transform); } ))); yesResignButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeUnvisible(resignPopup.transform); gameWidget.MakeAMove("resign"); } ))); this.yesTry.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeUnvisible(this.tryPopup.transform); gameWidget.MakeAMove("yes"); } ))); this.noTry.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeUnvisible(this.tryPopup.transform); gameWidget.MakeAMove("no"); } ))); this.passButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeUnvisible(resignPopup.transform); gameWidget.MakeAMove("pass"); } ))); this.agreeButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeUnvisible(resignPopup.transform); gameWidget.MakeAMove("agree"); } ))); this.askButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeUnvisible(resignPopup.transform); gameWidget.MakeAMove("ask"); } ))); this.goButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { gameWidget.MakeAMove("go"); } ))); noResignButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { pressButtonSound.Play(); Utils.MakeUnvisible(resignPopup.transform); //gameWidget.MakeAMove("resign"); } ))); exitButton.onClick.Add(new EventDelegate(new EventDelegate.Callback( delegate { GoToLobby(); } ))); /* * this.board.SetUserTogglePoint(delegate (Point a) * { * if (a.x >= 0 && a.x < this.board.GetN()) * { * if (a.y >= 0 && a.y < this.board.GetN()) * { * gameWidget.MakeAMove(a.x + "-" + a.y); * } * } * }); */ gameWidget.Go(); SetInitialData(); StartChat(); }