Example #1
0
        public void P_Show(string evt, string text)
        {
            int mode;

            int.TryParse(text, out mode);
            if (mode < 1 || mode > 2)
            {
                mode = 1;
            }
            var split = text.Split('\n');

            EODController.ShowEODMode(new EODLiveModeOpt
            {
                Buttons    = 0,
                Expandable = false,
                Height     = EODHeight.Normal,
                Length     = EODLength.None,
                Timer      = EODTimer.None,
                Tips       = EODTextTips.None
            });

            var style = TextStyle.DefaultLabel.Clone();

            style.Shadow  = true;
            Add(SeeDialog = new UILabel()
            {
                Position     = new Microsoft.Xna.Framework.Vector2(0, 32),
                Size         = new Microsoft.Xna.Framework.Vector2(472, 112),
                Alignment    = TextAlignment.Center | TextAlignment.Middle,
                CaptionStyle = style,
                Caption      = GameFacade.Strings.GetString("f120", "36")
            });

            if (UIBulletinDialog.Present)
            {
                GameThread.NextUpdate(x => OnClose());
            }
            else
            {
                Dialog = new UIBulletinDialog(LotController?.vm?.TSOState?.NhoodID ?? 0);
                Dialog.OnModeChange += (dmode) =>
                {
                    Send("bulletin_mode", dmode.ToString());
                };
                Dialog.CloseButton.OnButtonClick += (btn) => OnClose();
                if (mode == 2)
                {
                    Dialog.SelectedPost(null);
                }
                else
                {
                    Send("bulletin_mode", "0");
                }
                UIScreen.GlobalShowDialog(Dialog, false);
                //Send("bulletin_mode", ((mode == 1) ? 0 : 2).ToString());
            }
        }
Example #2
0
 public override void OnClose()
 {
     Send("close", "");
     if (Dialog != null)
     {
         UIScreen.RemoveDialog(Dialog);
     }
     Dialog = null;
     base.OnClose();
 }
Example #3
0
        //private Binding<Avatar> Binding;

        public BulletinDialogController(UIBulletinDialog view, IClientDataService dataService, Network.Network network)
        {
            this.Network     = network;
            this.DataService = dataService;
            this.View        = view;
            //this.Binding = new Binding<Avatar>().WithMultiBinding(x => { RefreshResults(); }, "Avatar_BookmarksVec");

            this.Actions = UIScreen.Current.FindController <CoreGameScreenController>()?.BulletinProtocol;

            //Init();
        }