コード例 #1
0
ファイル: Dialog.ci.cs プロジェクト: Matthewism/manicdigger
 GameScreen ConvertDialog(Game game, Packet_Dialog p)
 {
     DialogScreen s = new DialogScreen();
     s.widgets = new MenuWidget[p.WidgetsCount];
     s.WidgetCount = p.WidgetsCount;
     for (int i = 0; i < p.WidgetsCount; i++)
     {
         Packet_Widget a = p.Widgets[i];
         MenuWidget b = new MenuWidget();
         if (a.Type == Packet_WidgetTypeEnum.Text)
         {
             b.type = WidgetType.Label;
         }
         if (a.Type == Packet_WidgetTypeEnum.Image)
         {
             b.type = WidgetType.Button;
         }
         if (a.Type == Packet_WidgetTypeEnum.TextBox)
         {
             b.type = WidgetType.Textbox;
         }
         b.x = a.X;
         b.y = a.Y;
         b.sizex = a.Width;
         b.sizey = a.Height_;
         b.text = a.Text;
         if (b.text != null)
         {
             b.text = game.platform.StringReplace(b.text, "!SERVER_IP!", game.ServerInfo.connectdata.Ip);
         }
         if (b.text != null)
         {
             b.text = game.platform.StringReplace(b.text, "!SERVER_PORT!", game.platform.IntToString(game.ServerInfo.connectdata.Port));
         }
         b.color = a.Color;
         if (a.Font != null)
         {
             b.font = new FontCi();
             b.font.family = game.ValidFont(a.Font.FamilyName);
             b.font.size = game.DeserializeFloat(a.Font.SizeFloat);
             b.font.style = a.Font.FontStyle;
         }
         b.id = a.Id;
         b.isbutton = a.ClickKey != 0;
         if (a.Image == "Solid")
         {
             b.image = null;
         }
         else if (a.Image != null)
         {
             b.image = StringTools.StringAppend(game.platform, a.Image, ".png");
         }
         s.widgets[i] = b;
     }
     for (int i = 0; i < s.WidgetCount; i++)
     {
         if (s.widgets[i] == null) { continue; }
         if (s.widgets[i].type == WidgetType.Textbox)
         {
             s.widgets[i].editing = true;
             break;
         }
     }
     return s;
 }
コード例 #2
0
            /// <summary>
            /// Initializes a new instance of the <see cref="DialogScreenVM"/> class.
            /// </summary>
            /// <param name="screen">The dialog screen that owns the view model.</param>
            internal DialogScreenVM(DialogScreen screen)
            {
                Contract.Require(screen, nameof(screen));

                this.screen = screen;
            }
コード例 #3
0
ファイル: EscMenuDialog.cs プロジェクト: RUSshy/ultraviolet
        /// <summary>
        /// Initializes a new instance of the <see cref="EscMenuDialog"/> class.
        /// </summary>
        /// <param name="owner">The screen that owns the dialog box.</param>
        public EscMenuDialog(GameScreenBase owner)
        {
            Contract.Require(owner, "owner");

            this.screen = new DialogScreen(this, owner.GlobalContent);
        }
コード例 #4
0
            /// <summary>
            /// Initializes a new instance of the <see cref="DialogScreenVM"/> class.
            /// </summary>
            /// <param name="screen">The dialog screen that owns the view model.</param>
            internal DialogScreenVM(DialogScreen screen)
            {
                Contract.Require(screen, "screen");

                this.screen = screen;
            }
コード例 #5
0
ファイル: MainScreen.cs プロジェクト: mxgmn/GENW
    public void LoadTextures()
    {
        editor = new Editor(size - new ZPoint(66, 62), new ZPoint(56, 52));
        ZPoint dialogSize = new ZPoint(400, 200);
        dialogScreen = new DialogScreen(new ZPoint((int)(0.5f * (size.x - dialogSize.x)), size.y - 8 - dialogSize.y), dialogSize);

        fonts.ambient = game.Content.Load<SpriteFont>("fonts/ambient");
        fonts.small = game.Content.Load<SpriteFont>("fonts/small");
        fonts.verySmall = game.Content.Load<SpriteFont>("fonts/verySmall");
        fonts.superSmall = game.Content.Load<SpriteFont>("fonts/superSmall");
        fonts.verdana = game.Content.Load<SpriteFont>("fonts/verdana");
        fonts.verdanaBold = game.Content.Load<SpriteFont>("fonts/verdanaBold");
    }