コード例 #1
0
        public LoadingScreen(string picturePath, Vector2 pictureSize)
        {
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/LoadingScreen/background.png"),
                TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap,
            };

            Common.Tuple<string, Vector2> picture;
            if (picturePath != null)
                picture = new Common.Tuple<string, Vector2>(picturePath, pictureSize);
            else
                picture = defaultPictures[new Random().Next(defaultPictures.Length)];

            var picMetaTexture = new TextureFromFile(picture.First) { DontScale = true };
            var pic = new Control
            {
                Background = new ImageGraphic
                {
                    Texture = picMetaTexture,
                    SizeMode = SizeMode.AutoAdjust
                },
                Anchor = Orientation.Center,
                Size = picture.Second
            };

            Dock = System.Windows.Forms.DockStyle.Fill;

            pic.AddChild(progress);
            AddChild(pic);
        }
コード例 #2
0
 void AddToolTip(Control control, Control tooltip)
 {
     control.ToolTip = tooltip;
     control.MouseEnter += new EventHandler(control_MouseEnter);
     control.MouseLeave += new EventHandler(control_MouseLeave);
     control.MouseMove += new System.Windows.Forms.MouseEventHandler(control_MouseMove);
 }
コード例 #3
0
 public void SetToolTip(Control control, Control tooltip)
 {
     if (tooltip == null)
     {
         RemoveToolTip(control);
     }
     else
     {
         if(control.ToolTip != null)
         {
             bool isDisplaying = current == control;
             if (isDisplaying)
                 HideTooltip();
             control.ToolTip = tooltip;
             if (isDisplaying)
                 ShowTooltip(control);
         }
         else
             AddToolTip(control, tooltip);
     }
 }
コード例 #4
0
        public void ScrollOut(Control control)
        {
            var p = popupDatas[control];

            float val = 0;
            if (Orientation == ProgressOrientation.BottomToTop)
                val = Size.Y;

            float time = 1;
            if (TimeType == AnimationTimeType.Speed)
                time = Math.Abs((p.Value.Value - val) / Time);

            Common.InterpolatorKey<float> k;
            p.Value.ClearKeys();
            p.Value.AddKey(k = new Common.InterpolatorKey<float>
            {
                Time = time,
                TimeType = Common.InterpolatorKeyTimeType.Relative,
                Value = val
            });
            k.Passing += new EventHandler((o, e) => { toRemove.Add(p.Control); });
            p.Removing = true;
            Invalidate();
        }
コード例 #5
0
 public void SetToolTip(Control control, String text)
 {
     if (String.IsNullOrEmpty(text))
     {
         RemoveToolTip(control);
     }
     else
     {
         if(control.ToolTip != null && control.ToolTip is Label)
         {
             ((Label)control.ToolTip).Text = text;
         }
         else
             SetToolTip(control, new Label
             {
                 AutoSize = AutoSizeMode.RestrictedFull,
                 Clickable = false,
                 Text = text,
                 MaxSize = new Vector2(300, float.MaxValue),
                 Padding = new System.Windows.Forms.Padding(3),
                 Background = InterfaceScene.DefaultSlimBorder
             });
     }
 }
コード例 #6
0
        public StageInfoControl()
        {
            AddChild(arrowsGrid);
            arrowsGrid.AddChild(hitPoints);
            arrowsGrid.AddChild(rage);
            arrowsGrid.AddChild(ammo);
            arrowsGrid.AddChild(time);
            AddChild(textsGrid);

            textsGrid.AddChild(hitPointsLabel = new Control
            {
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/IngameInterface/HP1.png") { DontScale = true }
                },
                Anchor = Orientation.Center,
                Clickable = false,
            });
            textsGrid.AddChild(rageLabel = new Control
            {
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/IngameInterface/Rage1.png") { DontScale = true }
                },
                Anchor = Orientation.Center,
                Clickable = false,
            });
            textsGrid.AddChild(ammoLabel = new Control
            {
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/IngameInterface/Bullet1.png") { DontScale = true }
                },
                Anchor = Orientation.Center,
                Clickable = false,
            });
            textsGrid.AddChild(timeLabel = new Control
            {
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/IngameInterface/Time1.png") { DontScale = true }
                },
                Anchor = Orientation.Center,
                Clickable = false,
            });

            //textsGrid.Padding = new System.Windows.Forms.Padding(15, 0, 0, 5);

            //textsGrid.AddChild(hitPointsLabel = new Label
            //{
            //    Text = Locale.Resource.HUDStageHP,
            //    Background = null,
            //    TextAnchor = Orientation.Center,
            //    Clickable = false,
            //});
            //textsGrid.AddChild(rageLabel = new Label
            //{
            //    Text = Locale.Resource.HUDStageRage,
            //    Background = null,
            //    TextAnchor = Orientation.Center,
            //    Clickable = false,
            //});
            //textsGrid.AddChild(ammoLabel = new Label
            //{
            //    Text = Locale.Resource.HUDStageAmmo,
            //    Background = null,
            //    TextAnchor = Orientation.Center,
            //    Clickable = false,
            //});
            //textsGrid.AddChild(timeLabel = new Label
            //{
            //    Text = Locale.Resource.HUDStageTime,
            //    Background = null,
            //    TextAnchor = Orientation.Center,
            //    Clickable = false,
            //});
            Size = new Vector2(500, 300);
        }
コード例 #7
0
 public void RemoveControl(Control c)
 {
     controls.Remove(c);
     Invalidate();
 }
コード例 #8
0
        public ProfileMenu()
        {
            Instance = this;
            Dock = System.Windows.Forms.DockStyle.Fill;
            //AddChild(new MenuBackgroundControl());

            //AddChild(new SelectMapControl
            //{
            //    Anchor = Orientation.Center
            //});
            //AddChild(new ProfileInfoForm
            //{
            //    Anchor = Orientation.Left
            //});
            //AddChild(new WeaponsMenu
            //{
            //    Anchor = Orientation.Right
            //});
            Control worldMapContainer = new Control
            {
            };
            worldMapContainer.AddChild(new WorldMapControl());
            AddChild(worldMapContainer);
            AddChild(new ProfileQuickbar());
            AddChild(PopupContainer);
        }
コード例 #9
0
        Control StatisticsForm(Statistics statistics, Vector2 elementPosition)
        {
            Control f = new Control
            {
                Anchor = global::Graphics.Orientation.TopLeft,
                Size = new Vector2(600, 450)
            };

            float spacing = 20f;

            //f.AddChild(CharacterActionBox(statistics.CharacterActions, ref elementPosition));
            //elementPosition += new Vector2(0, spacing);

            //f.AddChild(ActionBox(statistics.Actions, ref elementPosition));
            //elementPosition += new Vector2(0, spacing);

            //f.AddChild(KillBox(statistics.Kills, statistics.MapUnits, ref elementPosition));
            //elementPosition += new Vector2(0, spacing);

            f.AddChild(PotpourriBox(statistics, ref elementPosition));
            elementPosition += new Vector2(0, spacing);

            return f;
        }
コード例 #10
0
        public override void Enter()
        {
            base.Enter();
            Program.Instance.Interface.AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureFromFile("mainmenubackground.png"),
                    Size    = new Vector2(Program.Settings.GraphicsDeviceSettings.Resolution.Width, Program.Settings.GraphicsDeviceSettings.Resolution.Height)
                },
                Dock = System.Windows.Forms.DockStyle.Fill
            });

            if (Common.ProgramConfigurationInformation.Warnings.Count > 0)
            {
                Program.Instance.Interface.AddChild(
                    new Graphics.Interface.ProgramConfigurationInformationControl
                {
                    Position = new Vector2(0, 150)
                });
            }

            form = new DeveloperMainMenuForm();
            Program.Instance.Interface.AddChild(form);

            Program.Instance.Interface.AddChild(new TestMaps());

            var buttonsGrid = new Grid
            {
                Size    = new Vector2(800, 200),
                Anchor  = Orientation.BottomLeft,
                NWidth  = 4,
                NHeight = 8
            };

            Program.Instance.Interface.AddChild(buttonsGrid);

            var videoSettings = new Button
            {
                Size     = new Vector2(200, 20),
                Text     = "Options",
                Position = new Vector2(200, 60)
            };

            buttonsGrid.AddChild(videoSettings);
            videoSettings.Click += new EventHandler(videoSettings_Click3);

            videoSettings = new Button
            {
                Text = "Fullscreen",
            };
            buttonsGrid.AddChild(videoSettings);
            videoSettings.Click += new EventHandler((o, e) => { Program.Settings.WindowMode = WindowMode.Fullscreen; Program.UpdateWindowMode(); });


            Button exitGameButton = new Button
            {
                Position = new Vector2(200, 40),
                Size     = new Vector2(200, 20),
                Text     = "Exit",
            };

            buttonsGrid.AddChild(exitGameButton);
            exitGameButton.Click += new EventHandler(exitGameButton_Click);

            Button ratingTestPopup = new Button
            {
                Position = new Vector2(200, 0),
                Size     = new Vector2(200, 20),
                Text     = "Rating Test"
            };

            buttonsGrid.AddChild(ratingTestPopup);
            ratingTestPopup.Click += new EventHandler((o, e) =>
            {
                Client.Game.Interface.ScoreScreenControl ssc = new Client.Game.Interface.ScoreScreenControl
                {
                    GameState = new Client.Game.GameState {
                    },
                    Map       = new Client.Game.Map.Map {
                        Settings = new Client.Game.Map.MapSettings {
                            Name = "asdf"
                        }
                    },
                    GameTime        = 123,
                    Statistics      = new Client.Game.Statistics {
                    },
                    EarnedGoldCoins = 1,
                    SilverEnabled   = Program.Settings.SilverEnabled,
                    HideStats       = Program.Settings.HideStats
                };
                ssc.AddChild(new Client.Game.Interface.RatingBox {
                    Anchor = Orientation.TopRight, Position = new Vector2(0, 45)
                });
                Program.Instance.Interface.AddChild(ssc);
            });

            Button helpPopup = new Button
            {
                Position = new Vector2(200, 40),
                Size     = new Vector2(200, 20),
                Text     = "Help",
            };

            buttonsGrid.AddChild(helpPopup);
            helpPopup.Click += new EventHandler(helpPopup_Click);

            Button button = new Button
            {
                Text = "NormalWindow",
            };

            buttonsGrid.AddChild(button);
            button.Click += new EventHandler((o, e) =>
            {
                Program.Instance.Interface.AddChild(
                    new Window {
                    Anchor = Orientation.Center, Moveable = true
                });
            });

            button = new Button
            {
                Text = "LargeWindow",
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler((o, e) =>
            {
                Program.Instance.Interface.AddChild(
                    new Window {
                    Anchor = Orientation.Center, Moveable = true, LargeWindow = true
                });
            });

            button = new Button
            {
                Text = "Display settings form"
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler(button_Click);

            var currentStages = new Client.Game.Interface.StageInfo[]
            {
                new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 300,
                    Rage         = 2.3f,
                    Time         = 200,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 300,
                    Rage         = 2.3f,
                    Time         = 200,
                    MaxHitPoints = 600,
                },
                null,
                null,
                null
            };
            var bestStages = new Client.Game.Interface.StageInfo[]
            {
                new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 500,
                    Rage         = 3f,
                    Time         = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 100,
                    Rage         = 3f,
                    Time         = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 500,
                    Rage         = 3f,
                    Time         = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 500,
                    Rage         = 3f,
                    Time         = 150,
                    MaxHitPoints = 600,
                },
                null
            };

            Action <String, Func <Graphics.Entity> > addDialogTest = (text, dialog) =>
            {
                button = new Button
                {
                    Text = text,
                };
                buttonsGrid.AddChild(button);
                button.Click += new EventHandler((o, e) =>
                {
                    var d = dialog();
                    Program.Instance.Interface.AddChild(d);
                    System.Windows.Forms.Form f = new System.Windows.Forms.Form
                    {
                        Size = new System.Drawing.Size(200, 500)
                    };
                    var pg = new System.Windows.Forms.PropertyGrid
                    {
                        SelectedObject = d,
                        Dock           = System.Windows.Forms.DockStyle.Fill
                    };
                    f.Controls.Add(pg);
                    pg.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler((o2, e2) =>
                                                                                                         { d.Invalidate(); });
                    f.Show();
                });
            };

            addDialogTest("StartScreenControl", () => new Game.Interface.StartScreenControl
            {
                Anchor      = Orientation.Center,
                Moveable    = true,
                MapSettings = new Client.Game.Map.MapSettings
                {
                    Name = "The test map",
                },
                AvailableRangedWeapons = Program.Instance.Profile.AvailableRangedWeapons,
                AvailableMeleeWeapons  = Program.Instance.Profile.AvailableMeleeWeapons
            });
            addDialogTest("CreditsText", () => new Game.Interface.CreditsText
            {
                Title = "Entertainment",
                Text  = "The muppets",
            });

            addDialogTest("LargeStoneButton", () => new LargeStoneButton
            {
                Text   = "Button",
                Anchor = Orientation.Center
            });

            addDialogTest("StoneButton", () => new StoneButton
            {
                Text   = "Button",
                Anchor = Orientation.Center
            });

            Random random = new Random();
            var    stats  = new Client.Game.Statistics();

            stats.CharacterActions.ShotgunFired    = 40;
            stats.CharacterActions.ShotgunSlugHits = 67;
            stats.CharacterActions.GhostRifleFired = 20;
            stats.CharacterActions.GhostRifleHits  = 18;
            stats.Actions.DamageDealt = random.Next(950);
            stats.Actions.DamageTaken = random.Next(340);
            stats.Actions.HitsTaken   = random.Next(34);
            stats.Actions.TimesNetted = random.Next(40);
            stats.Kills.TotalKills    = random.Next(12031);
            addDialogTest("ScoreScreenControl", () => new Game.Interface.ScoreScreenControl
            {
                Anchor = Orientation.Center,
                Map    = new Client.Game.Map.Map
                {
                    Settings = new Client.Game.Map.MapSettings
                    {
                        Name   = "The Challenge",
                        Stages = 5
                    }
                },
                Statistics         = stats,
                Moveable           = true,
                EarnedGoldCoins    = 1,
                LostGameReason     = "You were killed by a grunt",
                GameState          = Client.Game.GameState.Won,
                AchievementsEarned = new List <Achievement>
                {
                    new Achievements.Make5TriesOnASingleMap(),
                    new Achievements.Kill70ZombiesInUnder10Seconds(),
                    new Achievements.Make10TriesOnASingleMap(),
                    new Achievements.Make20TriesOnASingleMap(),
                    new Achievements.Kill100ZombiesInUnder10Seconds(),
                },
                CurrentStages = currentStages,
                BestStages    = bestStages,
                SilverEnabled = Program.Settings.SilverEnabled,
                HideStats     = Program.Settings.HideStats
            });

            addDialogTest("InGameMenu", () => new Game.Interface.InGameMenu
            {
                Anchor      = Orientation.Center,
                MapSettings = new Client.Game.Map.MapSettings
                {
                    Name = "The test map",
                },
            });

            addDialogTest("StoneDropDownBar", () =>
            {
                var r = new StoneDropDownBar
                {
                    Anchor = Orientation.Center,
                };
                r.AddItem("hello");
                r.AddItem("cruel");
                r.AddItem("world which sdlf jdsf klsdfadsflksda jödaskfj lsdjf lksafdjdöf kl sdkj\n\nslkfj");
                return(r);
            });
            addDialogTest("AchievementUnlockedPopup", () => new AchievementUnlockedPopup
            {
                DisplayName = "O needs medical attention?",
                Description = "Complete \"Reverse Gauntlet\" without killing any regular chests."
            });

            addDialogTest("UnlockButton", () => new UnlockButton
            {
            });

            addDialogTest("MapButton", () =>
            {
                var mb = new MapButton
                {
                    Map = "LevelA",
                };
                Program.Instance.Tooltip.SetToolTip(mb, new MapToolTip
                {
                    Title     = "Jahman",
                    Objective = "Killin them zombies",
                    Yield     = 2
                });
                return(mb);
            });

            addDialogTest("RatingBox", () => new Game.Interface.RatingBox
            {
            });

            addDialogTest("ActionTipText", () => new Game.Interface.WarningFlashText
            {
                Text = "Press space!"
            });

            addDialogTest("TutorialText", () => new Game.Interface.TutorialText
            {
                Text  = "Dead Meets Lead is every bit and piece of what a zombie slaying, fast paced action game should be. Enter the role of the 18th century commander who's on a mission to obliterate the evil, by fighting your way through the islands and liberating the villagers before they are all consumed by a mystic plague. You'll have to act, think and move fast if you want to survive the horrors of these wicked parts of the world, and do not hope for any rescue or help, it's all up to you and you alone!",
                Title = "Tutorial"
            });

            addDialogTest("Dialog", () => new Dialog
            {
                Title = "Hello",
                Text  = "Applications that load assemblies with this method will be affected by upgrades of those assemblies. Therefore, do not use this method; redesign the application to use the Load(String) method overload or the LoadFrom(String) method overload.",
            });


            addDialogTest("InGameMenu", () => new Game.Interface.InGameMenu
            {
            });

            addDialogTest("SpeachBubble", () => new Game.Interface.SpeachBubble
            {
                Text = "Dead Meets Lead is every bit and piece of what a zombie slaying, fast paced action game should be. Enter the role of the 18th century commander who's on a mission..."
            });

            addDialogTest("Rating", () => new Game.Interface.RatingControl
            {
                Anchor = global::Graphics.Orientation.Center
            });

            addDialogTest("StageInfo", () => new Game.Interface.StageInfoControl
            {
                Anchor       = global::Graphics.Orientation.Center,
                Background   = InterfaceScene.DefaultSlimBorder,
                CurrentStage = new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 300,
                    Rage         = 2.3f,
                    Time         = 200,
                    MaxHitPoints = 600
                },
                BestStage = new Client.Game.Interface.StageInfo
                {
                    HitPoints    = 500,
                    Rage         = 3,
                    Time         = 150,
                    MaxHitPoints = 600
                }
            });
            addDialogTest("StageCompleted", () =>
            {
                var s = new Game.Interface.StageControl
                {
                    Anchor       = global::Graphics.Orientation.Center,
                    CurrentStage = new Client.Game.Interface.StageInfo
                    {
                        HitPoints    = 300,
                        Rage         = 2.3f,
                        Ammo         = 15,
                        Time         = 200,
                        MaxHitPoints = 600,
                        Stage        = 2
                    },
                    BestStage = new Client.Game.Interface.StageInfo
                    {
                        HitPoints    = 200,
                        Rage         = 3,
                        Ammo         = 5,
                        Time         = 150,
                        MaxHitPoints = 600
                    },
                    Stage     = 1,
                    Clickable = true
                };
                s.Click += new EventHandler((o, e) =>
                {
                    if (s.State == Client.Game.Interface.StageCompletedState.Maximized)
                    {
                        s.State = Client.Game.Interface.StageCompletedState.Minimizing;
                    }
                    else
                    {
                        s.State = Client.Game.Interface.StageCompletedState.Maximizing;
                    }
                });
                return(s);
            }
                          );
            addDialogTest("ArrowIndicator", () => new ArrowIndicator
            {
                Anchor = global::Graphics.Orientation.Center,
                Size   = new Vector2(100, 100)
            });
            addDialogTest("DefaultFormBorderOutlined", () => new Form
            {
                Anchor     = global::Graphics.Orientation.Center,
                Size       = new Vector2(250, 140),
                Background = InterfaceScene.DefaultFormBorderOutlined,
                Moveable   = true
            });
            addDialogTest("Stages", () =>
            {
                var s = new Client.Game.Interface.StagesControl
                {
                    Anchor  = global::Graphics.Orientation.Center,
                    Size    = new Vector2(1000, 140),
                    NStages = 5
                };
                for (int i = 0; i < s.NStages; i++)
                {
                    s.SetBestStage(i + 1, bestStages[i]);
                    s.SetCurrentStage(i + 1, currentStages[i]);
                }
                s.SetActive(1, true);
                Program.Instance.Timeout(2, () => s.Maximize(2));
                Program.Instance.Timeout(10, () => s.Minimize(2));
                return(s);
            });
            addDialogTest("Scaling", () =>
            {
                var s = new Graphics.Interface.Control
                {
                    Background = new Graphics.Content.ImageGraphic
                    {
                        SizeMode = SizeMode.AutoAdjust,
                        Texture  = new TextureFromFile("checker.png")
                    },
                    Size       = new Vector2(512, 512),
                    Position   = new Vector2(100, 100),
                    Updateable = true
                };
                var c = new Graphics.Interface.Control
                {
                    Background = new Graphics.Content.ImageGraphic
                    {
                        SizeMode = SizeMode.AutoAdjust,
                        Texture  = new TextureFromFile("cornell.png")
                    },
                    Size     = new Vector2(128, 128),
                    Position = new Vector2(100, 100),
                };
                s.AddChild(c);
                float v   = 0;
                s.Update += new UpdateEventHandler((o, d) =>
                {
                    v      += d.Dtime;
                    s.Scale = new Vector3((float)Math.Abs(Math.Sin(v)), (float)Math.Abs(Math.Sin(v)), 1);
                });
                return(s);
            });

            addDialogTest("VideoOptionsWindow", () => new VideoOptionsWindow
            {
                AvailableAnimationQualities = new Graphics.Renderer.Settings.AnimationQualities[] { Graphics.Renderer.Settings.AnimationQualities.Low, Graphics.Renderer.Settings.AnimationQualities.Medium, Graphics.Renderer.Settings.AnimationQualities.High },
                AnimationQuality            = Program.Settings.RendererSettings.AnimationQuality,
                AvailableVideoQualities     = new VideoQualities[] { VideoQualities.Custom, VideoQualities.Low, VideoQualities.Medium, VideoQualities.High, VideoQualities.Ultra },
                OverallVideoQuality         = Program.Settings.VideoQuality,
            });

            deviceRes = new Label
            {
                Anchor   = Orientation.TopLeft,
                Size     = new Vector2(70, 70),
                Position = new Vector2(0, 50)
            };

            clientRes = new Label
            {
                Anchor   = Orientation.TopLeft,
                Size     = new Vector2(70, 70),
                Position = new Vector2(80, 50)
            };

            windowRes = new Label
            {
                Anchor   = Orientation.TopLeft,
                Size     = new Vector2(70, 70),
                Position = new Vector2(240, 50)
            };

            fps = new Label
            {
                Anchor   = Orientation.BottomRight,
                Size     = new Vector2(70, 70),
                Position = new Vector2(160, 50)
            };

            mousePos = new Label
            {
                Anchor   = Orientation.TopLeft,
                Size     = new Vector2(70, 70),
                Position = new Vector2(320, 50)
            };
#if DEBUG_DEVELOPERMAINMENU
            i++;
            s[i] = new System.IO.StreamWriter("debugRESOLUTION" + i + ".txt");
#endif
            Program.Instance.Interface.AddChild(deviceRes);
            Program.Instance.Interface.AddChild(clientRes);
            Program.Instance.Interface.AddChild(windowRes);
            Program.Instance.Interface.AddChild(fps);
            Program.Instance.Interface.AddChild(mousePos);

            fader = new Fader {
                State = FadeState.FadedOut
            };
            Program.Instance.Interface.AddChild(fader);
        }
コード例 #11
0
        public Control ActionBox(Statistics.Action statistics, ref Vector2 elementPosition)
        {
            Control f = new Control();

            f.AddChild(HeaderText("Actions", ref elementPosition));

            NewTextResults(f, "Hits taken", statistics.HitsTaken.ToString(), ref elementPosition);
            NewTextResults(f, "Damage dealt", statistics.DamageDealt.ToString(), ref elementPosition);
            NewTextResults(f, "Damage taken", statistics.DamageTaken.ToString(), ref elementPosition);
            NewTextResults(f, "Caught in net", statistics.TimesNetted.ToString(), ref elementPosition);

            return f;
        }
コード例 #12
0
        public void NewProgressBarResults(Control f, string label, float value, float maxValue, ref Vector2 elementPosition, string customText)
        {
            if (maxValue <= 0)
                return;

            System.Drawing.Color color = System.Drawing.Color.Red;

            if (value <= maxValue)
            {
                System.Drawing.Color color1 = System.Drawing.Color.Red, color2 = System.Drawing.Color.Yellow, color3 = System.Drawing.Color.Green;
                float halfWay = maxValue / 2f;
                float v = value;
                if (v >= halfWay)
                {
                    color1 = color2;
                    color2 = color3;
                    v -= halfWay;
                }
                var i = new Common.Interpolator4();
                i.AddKey(new Common.InterpolatorKey<Vector4> { Time = 0, Value = Common.Math.ToVector4(color1) });
                i.AddKey(new Common.InterpolatorKey<Vector4> { Time = 1, Value = Common.Math.ToVector4(color2) });
                color = Common.Math.ToColor(i.Update(v / halfWay));
            }

            float pbSize = 18;

            var pb = new ProgressBar
            {
                Size = new Vector2(rightHandWidth, pbSize),
                Text = customText,
                MaxValue = maxValue,
                Value = value,
                Anchor = global::Graphics.Orientation.TopLeft,
                ProgressGraphic = new Graphics.Content.StretchingImageGraphic
                {
                    Texture = new Graphics.Content.TextureConcretizer { TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(color) }
                },
                Font = statTextFont
            };

            NewResults(f, label, pb, ref elementPosition);
        }
コード例 #13
0
 void RemoveToolTip(Control control)
 {
     if (current == control)
         HideTooltip();
     control.ToolTip = null;
     control.MouseEnter -= new EventHandler(control_MouseEnter);
     control.MouseLeave -= new EventHandler(control_MouseLeave);
     control.MouseMove -= new System.Windows.Forms.MouseEventHandler(control_MouseMove);
 }
コード例 #14
0
 void ShowTooltip(Control control)
 {
     if (currentTooltip != null)
         currentTooltip.Remove();
     currentTooltip = control.ToolTip;
     AddChild(currentTooltip);
     currentTooltip.PerformLayout();
     current = control;
 }
コード例 #15
0
        void HideTooltip()
        {
            if (current == null) return;

            currentTooltip.Remove();
            currentTooltip = null;
            current = null;
        }
コード例 #16
0
        public override void Init()
        {
            Content.ContentPath = "Data";

            InterfaceScene = new Graphics.Interface.InterfaceScene(this);

            InterfaceScene.Add(new Graphics.Interface.TextBox
            {
                Size = new Vector2(100, 20),
                Text = "TopRight",
                Anchor = Orientation.TopRight
            });

            InterfaceScene.Add(new Graphics.Interface.TextBox
            {
                Size = new Vector2(100, 20),
                Text = "BottomLeft",
                Anchor = Orientation.BottomLeft
            });

            InterfaceScene.Add(new Graphics.Interface.TextBox
            {
                Size = new Vector2(100, 20),
                Text = "BottomRight",
                Anchor = Orientation.BottomRight
            });

            InterfaceScene.Add(new Graphics.Interface.Button
            {
                Size = new Vector2(100, 20),
                Text = "Button",
                Anchor = Orientation.Center
            });

            InterfaceScene.Add(cb = new Graphics.Interface.Checkbox
            {
                Size = new Vector2(100, 20),
                Text = "Checkbox",
                Anchor = Orientation.Center,
                Position = new Vector2(0, 40)
            });

            InterfaceScene.Add(pb = new Graphics.Interface.ProgressBar
            {
                Size = new Vector2(100, 100),
                Text = "Button",
                Anchor = Orientation.Bottom,
                MaxValue = 100,
                Value = 50,
                ProgressGraphic = new ImageGraphic
                {
                    Texture = new TextureFromFile("cornellbox3.png"),
                        //new TextureConcretizer { TextureDescription = new Graphics.Software.Textures.SingleColorTexture(Color.Red) },
                    TextureAnchor = Orientation.BottomLeft
                },
                ProgressOrientation = Graphics.Interface.ProgressOrientation.BottomToTop
            });

            InterfaceScene.Add(dpb = new Graphics.Interface.DeltaProgressBar
            {
                Size = new Vector2(140, 10),
                Anchor = Orientation.Center,
                MaxValue = 100,
                Value = 70,
                Position = new Vector2(0, -30),
                ProgressOrientation = Graphics.Interface.ProgressOrientation.LeftToRight
            });

            Button bb;
            InterfaceScene.Add(bb = new Button
            {
                Size = new Vector2(50, 20),
                Text = "-",
                Anchor = Orientation.Center,
                Position = new Vector2(-30, -60)
            });
            bb.Click += (sender, ea) => { dpb.Value = Common.Math.Clamp(dpb.Value - 20, 0, 100); };
            InterfaceScene.Add(bb = new Button
            {
                Size = new Vector2(50, 20),
                Text = "+",
                Anchor = Orientation.Center,
                Position = new Vector2(30, -60)
            });
            bb.Click += (sender, ea) => { dpb.Value = Common.Math.Clamp(dpb.Value + 20, 0, 100); };

            InterfaceScene.Add(new Graphics.Interface.Console
            {
                Anchor = Orientation.Bottom,
                Position = new Vector2(0, 100),
                Size = new Vector2(400, 100)
            });

            var f = new Graphics.Interface.Form
            {
                Size = new Vector2(300, 300)
            };
            InterfaceScene.Add(f);
            b = new Graphics.Interface.Button
            {
                Size = new Vector2(100, 20),
                Text = "TopLeft",
                Anchor = Orientation.TopLeft
            };
            f.AddChild(b);
            Control checker;
            InterfaceScene.Add(checker = new Control
            {
                Background = new ImageGraphic
                {
                    Size = new Vector2(100, 100),
                    Texture = new TextureFromFile("checker.png")
                },
                Size = new Vector2(100, 100),
                Position = new Vector2(10, 30),
                Anchor = Orientation.TopRight,
                Clickable = true,
                PickingLocalBounding = new Common.Bounding.Chain
                {
                    Boundings = new object[]
                    {
                        new BoundingBox(Vector3.Zero, new Vector3(1, 1, 0)),
                        new MetaBoundingImageGraphic
                        {
                            Graphic = new ImageGraphic
                            {
                                Size = new Vector2(100, 100),
                                Texture = new TextureFromFile("checker.png")
                            },
                        }
                    },
                    Shallow = true
                }
            });
            InterfaceScene.Add(popupContainer);
            InterfaceScene.Add(new Form
            {
                Anchor = Orientation.Right,
                Size = new Vector2(100, 100),
                ControlBox = true
            });

            tt = new Graphics.Interface.ToolTip();
            tt.SetToolTip(pb, "This is a progress bar");
            tt.SetToolTip(checker, "Checker");
            InterfaceScene.Add(tt);

            if (Direct3DVersion == Direct3DVersion.Direct3D10)
                InterfaceRenderer = new Graphics.Interface.InterfaceRenderer10(Device10)
                { Scene = InterfaceScene };
            else
                InterfaceRenderer = new Graphics.Interface.InterfaceRenderer9(Device9)
                { Scene = InterfaceScene, StateManager = new Device9StateManager(Device9) };
            InterfaceRenderer.Initialize(this);
            InputHandler = Manager = new Graphics.Interface.InterfaceManager { Scene = InterfaceScene };
            //bvr = new BoundingVolumesRenderer
            //{
            //    View = this,
            //    StateManager = sm
            //};
        }
コード例 #17
0
        public override void Enter()
        {
            base.Enter();
            Program.Instance.Interface.AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureFromFile("mainmenubackground.png"),
                    Size = new Vector2(Program.Settings.GraphicsDeviceSettings.Resolution.Width, Program.Settings.GraphicsDeviceSettings.Resolution.Height)
                },
                Dock = System.Windows.Forms.DockStyle.Fill
            });

            if (Common.ProgramConfigurationInformation.Warnings.Count > 0)
                Program.Instance.Interface.AddChild(
                    new Graphics.Interface.ProgramConfigurationInformationControl
                    {
                        Position = new Vector2(0, 150)
                    });

            form = new DeveloperMainMenuForm();
            Program.Instance.Interface.AddChild(form);

            Program.Instance.Interface.AddChild(new TestMaps());

            var buttonsGrid = new Grid
            {
                Size = new Vector2(800, 200),
                Anchor = Orientation.BottomLeft,
                NWidth = 4,
                NHeight = 8
            };
            Program.Instance.Interface.AddChild(buttonsGrid);

            var videoSettings = new Button
            {
                Size = new Vector2(200, 20),
                Text = "Options",
                Position = new Vector2(200, 60)
            };
            buttonsGrid.AddChild(videoSettings);
            videoSettings.Click += new EventHandler(videoSettings_Click3);

            videoSettings = new Button
            {
                Text = "Fullscreen",
            };
            buttonsGrid.AddChild(videoSettings);
            videoSettings.Click += new EventHandler((o, e) => { Program.Settings.WindowMode = WindowMode.Fullscreen; Program.UpdateWindowMode(); });

            Button exitGameButton = new Button
            {
                Position = new Vector2(200, 40),
                Size = new Vector2(200, 20),
                Text = "Exit",
            };
            buttonsGrid.AddChild(exitGameButton);
            exitGameButton.Click += new EventHandler(exitGameButton_Click);

            Button ratingTestPopup = new Button
            {
                Position = new Vector2(200, 0),
                Size = new Vector2(200, 20),
                Text = "Rating Test"
            };
            buttonsGrid.AddChild(ratingTestPopup);
            ratingTestPopup.Click += new EventHandler((o, e) =>
            {
                Client.Game.Interface.ScoreScreenControl ssc = new Client.Game.Interface.ScoreScreenControl
                {
                    GameState = new Client.Game.GameState { },
                    Map = new Client.Game.Map.Map { Settings = new Client.Game.Map.MapSettings { Name = "asdf" } },
                    GameTime = 123,
                    Statistics = new Client.Game.Statistics { },
                    EarnedGoldCoins = 1,
                    SilverEnabled = Program.Settings.SilverEnabled,
                    HideStats = Program.Settings.HideStats
                };
                ssc.AddChild(new Client.Game.Interface.RatingBox { Anchor = Orientation.TopRight, Position = new Vector2(0, 45) });
                Program.Instance.Interface.AddChild(ssc);
            });

            Button helpPopup = new Button
            {
                Position = new Vector2(200, 40),
                Size = new Vector2(200, 20),
                Text = "Help",
            };
            buttonsGrid.AddChild(helpPopup);
            helpPopup.Click += new EventHandler(helpPopup_Click);

            Button button = new Button
            {
                Text = "NormalWindow",
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler((o, e) =>
            {
                Program.Instance.Interface.AddChild(
                new Window { Anchor = Orientation.Center, Moveable = true });
            });

            button = new Button
            {
                Text = "LargeWindow",
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler((o, e) =>
            {
                Program.Instance.Interface.AddChild(
                new Window { Anchor = Orientation.Center, Moveable = true, LargeWindow = true });
            });

            button = new Button
            {
                Text = "Display settings form"
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler(button_Click);

            var currentStages = new Client.Game.Interface.StageInfo[]
            {
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 300,
                    Rage = 2.3f,
                    Time = 200,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 300,
                    Rage = 2.3f,
                    Time = 200,
                    MaxHitPoints = 600,
                },
                null,
                null,
                null
            };
            var bestStages = new Client.Game.Interface.StageInfo[]
            {
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 100,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                null
            };

            Action<String, Func<Graphics.Entity>> addDialogTest = (text, dialog) =>
            {
                button = new Button
                {
                    Text = text,
                };
                buttonsGrid.AddChild(button);
                button.Click += new EventHandler((o, e) =>
                {
                    var d = dialog();
                    Program.Instance.Interface.AddChild(d);
                    System.Windows.Forms.Form f = new System.Windows.Forms.Form
                    {
                        Size = new System.Drawing.Size(200, 500)
                    };
                    var pg = new System.Windows.Forms.PropertyGrid
                    {
                        SelectedObject = d,
                        Dock = System.Windows.Forms.DockStyle.Fill
                    };
                    f.Controls.Add(pg);
                    pg.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler((o2, e2) =>
                    { d.Invalidate(); });
                    f.Show();
                });
            };

            addDialogTest("StartScreenControl", () => new Game.Interface.StartScreenControl
            {
                Anchor = Orientation.Center,
                Moveable = true,
                MapSettings = new Client.Game.Map.MapSettings
                {
                    Name = "The test map",
                },
                AvailableRangedWeapons = Program.Instance.Profile.AvailableRangedWeapons,
                AvailableMeleeWeapons = Program.Instance.Profile.AvailableMeleeWeapons
            });
            addDialogTest("CreditsText", () => new Game.Interface.CreditsText
            {
                Title = "Entertainment",
                Text = "The muppets",
            });

            addDialogTest("LargeStoneButton", () => new LargeStoneButton
            {
                Text = "Button",
                Anchor = Orientation.Center
            });

            addDialogTest("StoneButton", () => new StoneButton
            {
                Text = "Button",
                Anchor = Orientation.Center
            });

            Random random = new Random();
            var stats = new Client.Game.Statistics();
            stats.CharacterActions.ShotgunFired = 40;
            stats.CharacterActions.ShotgunSlugHits = 67;
            stats.CharacterActions.GhostRifleFired = 20;
            stats.CharacterActions.GhostRifleHits = 18;
            stats.Actions.DamageDealt = random.Next(950);
            stats.Actions.DamageTaken = random.Next(340);
            stats.Actions.HitsTaken = random.Next(34);
            stats.Actions.TimesNetted = random.Next(40);
            stats.Kills.TotalKills = random.Next(12031);
            addDialogTest("ScoreScreenControl", () => new Game.Interface.ScoreScreenControl
            {
                Anchor = Orientation.Center,
                Map = new Client.Game.Map.Map
                {
                    Settings = new Client.Game.Map.MapSettings
                    {
                        Name = "The Challenge",
                        Stages = 5
                    }
                },
                Statistics = stats,
                Moveable = true,
                EarnedGoldCoins = 1,
                LostGameReason = "You were killed by a grunt",
                GameState = Client.Game.GameState.Won,
                AchievementsEarned = new List<Achievement>
                {
                    new Achievements.Make5TriesOnASingleMap(),
                    new Achievements.Kill70ZombiesInUnder10Seconds(),
                    new Achievements.Make10TriesOnASingleMap(),
                    new Achievements.Make20TriesOnASingleMap(),
                    new Achievements.Kill100ZombiesInUnder10Seconds(),
                },
                CurrentStages = currentStages,
                BestStages = bestStages,
                SilverEnabled = Program.Settings.SilverEnabled,
                HideStats = Program.Settings.HideStats
            });

            addDialogTest("InGameMenu", () => new Game.Interface.InGameMenu
            {
                Anchor = Orientation.Center,
                MapSettings = new Client.Game.Map.MapSettings
                {
                    Name = "The test map",
                },
            });

            addDialogTest("StoneDropDownBar", () =>
                {
                    var r = new StoneDropDownBar
                        {
                            Anchor = Orientation.Center,
                        };
                    r.AddItem("hello");
                    r.AddItem("cruel");
                    r.AddItem("world which sdlf jdsf klsdfadsflksda jödaskfj lsdjf lksafdjdöf kl sdkj\n\nslkfj");
                    return r;
                });
            addDialogTest("AchievementUnlockedPopup", () => new AchievementUnlockedPopup
            {
                DisplayName = "O needs medical attention?",
                Description = "Complete \"Reverse Gauntlet\" without killing any regular chests."
            });

            addDialogTest("UnlockButton", () => new UnlockButton
            {

            });

            addDialogTest("MapButton", () =>
            {
                var mb = new MapButton
                {
                    Map = "LevelA",
                };
                Program.Instance.Tooltip.SetToolTip(mb, new MapToolTip
                    {
                        Title = "Jahman",
                        Objective = "Killin them zombies",
                        Yield = 2

                    });
                return mb;
            });

            addDialogTest("RatingBox", () => new Game.Interface.RatingBox
            {
            });

            addDialogTest("ActionTipText", () => new Game.Interface.WarningFlashText
            {
                Text = "Press space!"
            });

            addDialogTest("TutorialText", () => new Game.Interface.TutorialText
            {
                Text = "Dead Meets Lead is every bit and piece of what a zombie slaying, fast paced action game should be. Enter the role of the 18th century commander who's on a mission to obliterate the evil, by fighting your way through the islands and liberating the villagers before they are all consumed by a mystic plague. You'll have to act, think and move fast if you want to survive the horrors of these wicked parts of the world, and do not hope for any rescue or help, it's all up to you and you alone!",
                Title = "Tutorial"
            });

            addDialogTest("Dialog", () => new Dialog
            {
                Title = "Hello",
                Text = "Applications that load assemblies with this method will be affected by upgrades of those assemblies. Therefore, do not use this method; redesign the application to use the Load(String) method overload or the LoadFrom(String) method overload.",
            });

            addDialogTest("InGameMenu", () => new Game.Interface.InGameMenu
            {
            });

            addDialogTest("SpeachBubble", () => new Game.Interface.SpeachBubble
            {
                Text = "Dead Meets Lead is every bit and piece of what a zombie slaying, fast paced action game should be. Enter the role of the 18th century commander who's on a mission..."
            });

            addDialogTest("Rating", () => new Game.Interface.RatingControl
            {
                Anchor = global::Graphics.Orientation.Center
            });

            addDialogTest("StageInfo", () => new Game.Interface.StageInfoControl
            {
                Anchor = global::Graphics.Orientation.Center,
                Background = InterfaceScene.DefaultSlimBorder,
                CurrentStage = new Client.Game.Interface.StageInfo
                {
                    HitPoints = 300,
                    Rage = 2.3f,
                    Time = 200,
                    MaxHitPoints = 600
                },
                BestStage = new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3,
                    Time = 150,
                    MaxHitPoints = 600
                }
            });
            addDialogTest("StageCompleted", () =>
                {
                    var s = new Game.Interface.StageControl
                    {
                        Anchor = global::Graphics.Orientation.Center,
                        CurrentStage = new Client.Game.Interface.StageInfo
                        {
                            HitPoints = 300,
                            Rage = 2.3f,
                            Ammo = 15,
                            Time = 200,
                            MaxHitPoints = 600,
                            Stage = 2
                        },
                        BestStage = new Client.Game.Interface.StageInfo
                        {
                            HitPoints = 200,
                            Rage = 3,
                            Ammo = 5,
                            Time = 150,
                            MaxHitPoints = 600
                        },
                        Stage = 1,
                        Clickable = true
                    };
                    s.Click += new EventHandler((o, e) =>
                    {
                        if (s.State == Client.Game.Interface.StageCompletedState.Maximized)
                            s.State = Client.Game.Interface.StageCompletedState.Minimizing;
                        else
                            s.State = Client.Game.Interface.StageCompletedState.Maximizing;
                    });
                    return s;
                }
            );
            addDialogTest("ArrowIndicator", () => new ArrowIndicator
            {
                Anchor = global::Graphics.Orientation.Center,
                Size = new Vector2(100, 100)
            });
            addDialogTest("DefaultFormBorderOutlined", () => new Form
            {
                Anchor = global::Graphics.Orientation.Center,
                Size = new Vector2(250, 140),
                Background = InterfaceScene.DefaultFormBorderOutlined,
                Moveable = true
            });
            addDialogTest("Stages", () =>
                {
                    var s = new Client.Game.Interface.StagesControl
                    {
                        Anchor = global::Graphics.Orientation.Center,
                        Size = new Vector2(1000, 140),
                        NStages = 5
                    };
                    for (int i = 0; i < s.NStages; i++)
                    {
                        s.SetBestStage(i + 1, bestStages[i]);
                        s.SetCurrentStage(i + 1, currentStages[i]);
                    }
                    s.SetActive(1, true);
                    Program.Instance.Timeout(2, () => s.Maximize(2));
                    Program.Instance.Timeout(10, () => s.Minimize(2));
                    return s;
                });
            addDialogTest("Scaling", () =>
            {
                var s = new Graphics.Interface.Control
                {
                    Background = new Graphics.Content.ImageGraphic
                    {
                        SizeMode= SizeMode.AutoAdjust,
                        Texture = new TextureFromFile("checker.png")
                    },
                    Size = new Vector2(512, 512),
                    Position = new Vector2(100, 100),
                    Updateable = true
                };
                var c = new Graphics.Interface.Control
                {
                    Background = new Graphics.Content.ImageGraphic
                    {
                        SizeMode = SizeMode.AutoAdjust,
                        Texture = new TextureFromFile("cornell.png")
                    },
                    Size = new Vector2(128, 128),
                    Position = new Vector2(100, 100),
                };
                s.AddChild(c);
                float v = 0;
                s.Update += new UpdateEventHandler((o, d) =>
                {
                    v += d.Dtime;
                    s.Scale = new Vector3((float)Math.Abs(Math.Sin(v)), (float)Math.Abs(Math.Sin(v)), 1);
                });
                return s;
            });

            addDialogTest("VideoOptionsWindow", () => new VideoOptionsWindow
            {
                AvailableAnimationQualities = new Graphics.Renderer.Settings.AnimationQualities[] { Graphics.Renderer.Settings.AnimationQualities.Low, Graphics.Renderer.Settings.AnimationQualities.Medium, Graphics.Renderer.Settings.AnimationQualities.High },
                AnimationQuality = Program.Settings.RendererSettings.AnimationQuality,
                AvailableVideoQualities = new VideoQualities[] { VideoQualities.Custom, VideoQualities.Low, VideoQualities.Medium, VideoQualities.High, VideoQualities.Ultra },
                OverallVideoQuality = Program.Settings.VideoQuality,
            });

            deviceRes = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(0, 50)
            };

            clientRes = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(80, 50)
            };

            windowRes = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(240, 50)
            };

            fps = new Label
            {
                Anchor = Orientation.BottomRight,
                Size = new Vector2(70, 70),
                Position = new Vector2(160, 50)
            };

            mousePos = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(320, 50)
            };
            #if DEBUG_DEVELOPERMAINMENU
            i++;
            s[i] = new System.IO.StreamWriter("debugRESOLUTION" + i + ".txt");
            #endif
            Program.Instance.Interface.AddChild(deviceRes);
            Program.Instance.Interface.AddChild(clientRes);
            Program.Instance.Interface.AddChild(windowRes);
            Program.Instance.Interface.AddChild(fps);
            Program.Instance.Interface.AddChild(mousePos);

            fader = new Fader { State = FadeState.FadedOut };
            Program.Instance.Interface.AddChild(fader);
        }
コード例 #18
0
 public Control AddReward(Control title, Control text, String tooltip)
 {
     Control back = new Control
     {
         Size = new Vector2(470, RewardHeight),
         Margin = new System.Windows.Forms.Padding(5, 5, 5, 5),
         Background = //InterfaceScene.DefaultFormBorder,
             new ImageGraphic
             {
                 Texture = new TextureFromFile("Interface/Common/GoldlineBoard1.png") { DontScale = true },
                 Position = new Vector3(-7, -7, 0),
                 SizeMode = SizeMode.AutoAdjust
             },
         Clickable = true,
     };
     Program.Instance.Tooltip.SetToolTip(back, tooltip);
     rewardsFlow.AddControl(back);
     back.AddChild(title);
     back.AddChild(text);
     Invalidate();
     return back;
 }
コード例 #19
0
 public void NewTextResults(Control f, string label, string text, ref Vector2 elementPosition)
 {
     Label tb = new Label
     {
         AutoSize = AutoSizeMode.Full,
         Size = new Vector2(rightHandWidth, descriptionTextBoxHeight),
         Text = text,
         Background = null,
         TextAnchor = global::Graphics.Orientation.Center,
         Font = statTextFont,
     };
     NewResults(f, label, tb, ref elementPosition);
 }
コード例 #20
0
 public Control AddReward(Control title, String text, String tooltip)
 {
     return AddReward(title, new Label
     {
         Background = null,
         Clickable = false,
         Dock = System.Windows.Forms.DockStyle.Fill,
         TextAnchor = global::Graphics.Orientation.Left,
         Font = new Font
         {
             SystemFont = Fonts.MediumSystemFont,
             Color = System.Drawing.Color.Gold
         },
         Text = text
     }, tooltip);
 }
コード例 #21
0
        private Control KillBox(Statistics.Kill statistics, Statistics.MapUnit amountStatistics, ref Vector2 elementPosition)
        {
            Control f = new Control();

            f.AddChild(HeaderText("Killed units", ref elementPosition));

            NewTextResults(f, "Total killed", statistics.TotalKills.ToString(), ref elementPosition);
            //NewProgressBarResults(f, "Bulls", statistics.Bulls, amountStatistics.Bulls, ref elementPosition);
            //NewProgressBarResults(f, "Brutes", statistics.Brutes, amountStatistics.Brutes, ref elementPosition);
            //NewProgressBarResults(f, "Clerics", statistics.Clerics, amountStatistics.Clerics, ref elementPosition);
            //NewProgressBarResults(f, "Commanders", statistics.Commanders, amountStatistics.Commanders, ref elementPosition);
            //NewProgressBarResults(f, "Grunts", statistics.Grunts, amountStatistics.Grunts, ref elementPosition);
            //NewProgressBarResults(f, "Infected", statistics.Infected, amountStatistics.Infected, ref elementPosition);
            //NewProgressBarResults(f, "Mongrels", statistics.Mongrels, amountStatistics.Mongrels, ref elementPosition);
            //NewProgressBarResults(f, "Rotten", statistics.Rotten, amountStatistics.Rotten, ref elementPosition);

            f.Size = new Vector2(350f, elementPosition.Y);
            return f;
        }
コード例 #22
0
 public void NewProgressBarResults(Control f, string label, float value, float maxValue, ref Vector2 elementPosition)
 {
     NewProgressBarResults(f, label, value, maxValue, ref elementPosition, "$value$ / $maxvalue$");
 }
コード例 #23
0
        public ChallengeMapMenuControl()
        {
            Dock = System.Windows.Forms.DockStyle.Fill;
            AddChild(new ChallengeBackgroundControl());
            AddChild(new GameLogoChallengeImage
            {
                Anchor = Orientation.Top,
                Position = new Vector2(-15, 50)
            });

            Control profilePanel = new FlowLayout
            {
                HorizontalFill = true,
                Newline = false,
                AutoSize = true,
                Anchor = Orientation.BottomLeft,
                Position = new Vector2(10, 10),
                Size = new Vector2(400, 20),
                Origin = FlowOrigin.BottomRight
            };
            AddChild(profilePanel);
            Control changeProfile = new ClickableTextButton
            {
                Text = "(Change)",
                AutoSize = AutoSizeMode.Full,
                Background = null,
            };
            profilePanel.AddChild(changeProfile);
            changeProfile.Click += new EventHandler(profile_Click);
            profilePanel.AddChild(profileName);

            Control buttonsPanel = new Control
            {
                Background = InterfaceScene.DefaultFormBorder,
                Size = new Vector2(400, 150),
                Anchor = Orientation.Top,
                Position = new Vector2(0, 500),
                Padding = new System.Windows.Forms.Padding(10)
            };
            AddChild(buttonsPanel);

            if (!String.IsNullOrEmpty(Program.Settings.ChallengeSurveyLink))
            {
                var u = new Uri(Program.Settings.ChallengeSurveyLink);
                var s = u.ToString();
                if (!u.IsFile)
                {
                    //Control feedback = new Control
                    //{
                    //    Background = InterfaceScene.DefaultFormBorder,
                    //    Anchor = Orientation.Top,
                    //    Position = new Vector2(300, 500),
                    //    Size=  new Vector2(300, 100),
                    //    Padding = new System.Windows.Forms.Padding(10)
                    //};
                    //AddChild(feedback);
                    //feedback.AddChild(new TextBox
                    //{
                    //    Text = "Tell us what you think of the game!",
                    //    Clickable = false,
                    //    Background = null,
                    //    AutoSize = AutoSizeMode.Full,
                    //});
                    Control survey = new ClickableTextButton
                    {
                        Text = "Tell us what you think!",
                        Anchor = Orientation.Right,
                        AutoSize = AutoSizeMode.Full,
                        Background = null,
                        Position = new Vector2(25, 45)
                    };
                    survey.Click += new EventHandler((o, e) =>
                    {
                        Util.StartBrowser(s);
                    });
                    buttonsPanel.AddChild(survey);
                }
            }

            ButtonBase challenge = new LargeStoneButton
            {
                Anchor = Orientation.Right,
                Position = new Vector2(25, 0),
                Text = "Play"
            };
            buttonsPanel.AddChild(challenge);
            challenge.Click += new EventHandler(challenge_Click);

            ButtonBase tutorial = new StoneButton
            {
                Anchor = Orientation.TopLeft,
                Position = new Vector2(0, 0),
                Text = "Tutorial"
            };
            buttonsPanel.AddChild(tutorial);
            tutorial.Click += new EventHandler(tutorial_Click);

            ButtonBase options = new StoneButton
            {
                Anchor = Orientation.TopLeft,
                Position = new Vector2(0, 45),
                Text = "Options"
            };
            buttonsPanel.AddChild(options);
            options.Click += new EventHandler(options_Click);

            ButtonBase exit = new StoneButton
            {
                Anchor = Orientation.TopLeft,
                Position = new Vector2(0, 90),
                Text = "Exit"
            };
            buttonsPanel.AddChild(exit);
            exit.Click += new EventHandler(exit_Click);

            if (!String.IsNullOrEmpty(Program.Settings.HallOfFameAddress))
            {
                var u = new Uri(Program.Settings.HallOfFameAddress);
                var s = u.ToString();
                if (!u.IsFile)
                {
                    Control hof = new Button
                    {
                        Anchor = Orientation.Top,
                        Position = new Vector2(0, 655),
                        HoverTexture = new TextureFromFile("Interface/Common/HallOfFame2Mouseover1.png") { DontScale = true },
                        NormalTexture = new TextureFromFile("Interface/Common/HallOfFame2.png") { DontScale = true },
                        ClickTexture = new TextureFromFile("Interface/Common/HallOfFame2.png") { DontScale = true },
                        Background = new ImageGraphic
                        {
                        },
                        Size = new Vector2(260, 38)
                    };
                    hof.Click += new EventHandler((o, e) =>
                    {
                        Util.StartBrowser(s);
                    });
                    AddChild(hof);
                }
            }

            fader = new Fader { State = FadeState.FadedOut };
            AddChild(fader);
            Updateable = true;
        }
コード例 #24
0
        public void NewResults(Control f, string label, Label rh, ref Vector2 elementPosition)
        {
            var tb = new Label
            {
                AutoSize = AutoSizeMode.Full,
                Size = new Vector2(150f, descriptionTextBoxHeight),
                Text = label,
                Background = null,
                Position = elementPosition,
            };
            f.AddChild(tb);

            rh.Position = elementPosition + new Vector2(250, 0);
            f.AddChild(rh);

            elementPosition.Y += System.Math.Max(tb.Size.Y, rh.Size.Y);
        }
コード例 #25
0
 bool MouseIsOver(Control c)
 {
     if (c.MouseState != MouseState.Out) return true;
     foreach (Control v in c.Children)
         if (MouseIsOver(v)) return true;
     return false;
 }
コード例 #26
0
        private Control CharacterActionBox(Statistics.CharacterAction statistics, ref Vector2 elementPosition)
        {
            Control f = new Control();

            f.AddChild(HeaderText("Character actions", ref elementPosition));

            var blast = new Map.Units.Blast();
            int totalSlugs = statistics.ShotgunFired * blast.SlugsCount * (((Map.Units.BlastProjectile)blast.Projectile).NumberOfPenetratableUnits + 1);
            NewTextResults(f, "Shotgun shots", statistics.ShotgunFired.ToString(), ref elementPosition);
            NewProgressBarResults(f, "Shotgun accuracy", statistics.ShotgunSlugHits, totalSlugs, ref elementPosition, String.Format("{0:0.00} %", totalSlugs > 0 ? 100f * statistics.ShotgunSlugHits / totalSlugs : 0));
            NewTextResults(f, "Ghost Rifle shots", statistics.GhostRifleFired.ToString(), ref elementPosition);
            NewProgressBarResults(f, "Ghost Rifle accuracy", statistics.GhostRifleHits, statistics.GhostRifleFired, ref elementPosition, String.Format("{0:0.00} %", statistics.GhostRifleFired > 0 ? 100f * statistics.GhostRifleHits / statistics.GhostRifleFired : 0));

            f.Size = new Vector2(350f, elementPosition.Y);
            return f;
        }
コード例 #27
0
        protected override void OnConstruct()
        {
            base.OnConstruct();
            ClearChildren();
            var ss = text.Split('\n');
            foreach (var s in ss)
            {
                var str = s;
                Font font = new Font
                {
                    SystemFont = new System.Drawing.Font(Fonts.DefaultFontFamily, 20,
                        System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel),
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                };
                int marginTop = 0, marginBottom = 0;

                if (str.StartsWith("[i]"))
                {
                    font.SystemFont = new System.Drawing.Font(Fonts.DefaultFontFamily, 30,
                        System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
                    str = str.Substring(3);
                    marginTop = 60;
                    marginBottom = 10;
                }
                if (str.StartsWith("[e="))
                {
                    int end = str.IndexOf(']');
                    font.Encoding = Encoding.GetEncoding(str.Substring(3, end - 3));
                    str = str.Substring(end + 1);
                }
                if(str.StartsWith("[DML]"))
                {
                    Control c;
                    AddChild(c = new Control
                    {
                        Size = new Vector2(1280, 600)
                    });
                    c.AddChild(new Control
                    {
                        Anchor = Orientation.Center,
                        Background = new ImageGraphic
                        {
                            Texture = new TextureFromFile("Interface/Common/DeadMeetsLead1.png") { DontScale = true },
                        },
                        Size = new Vector2(1100, 502)
                    });
                }
                else if (str.StartsWith("[Keldyn]"))
                {
                    Control c;
                    AddChild(c = new Control
                    {
                        Size = new Vector2(1280, 600)
                    });
                    c.AddChild(new Control
                    {
                        Anchor = Orientation.Center,
                        Background = new ImageGraphic
                        {
                            Texture = new TextureFromFile("Interface/Common/KeldynLogo1.png") { DontScale = true },
                        },
                        Size = new Vector2(300, 433)
                    });
                }
                else
                {
                    AddChild(new Label
                    {
                        Background = null,
                        Clickable = false,
                        Size = new Vector2(1280, 30),
                        Overflow = global::Graphics.TextOverflow.Ignore,
                        TextAnchor = global::Graphics.Orientation.Center,
                        Font = font,
                        Margin = new System.Windows.Forms.Padding(0, marginTop, 0, marginBottom),
                        Text = str
                    });
                }
            }
            Position = new Vector2(0, -Size.Y + acc);
        }
コード例 #28
0
        private Control PotpourriBox(Statistics statistics, ref Vector2 elementPosition)
        {
            Control f = new Control();

            NewTextResults(f, Locale.Resource.StatsUnitsKilled, statistics.Kills.TotalKills.ToString(), ref elementPosition);
            NewTextResults(f, Locale.Resource.StatsHitsTaken, statistics.Actions.HitsTaken.ToString(), ref elementPosition);
            NewTextResults(f, Locale.Resource.StatsDamageDealt, statistics.Actions.DamageDealt.ToString(), ref elementPosition);
            NewTextResults(f, Locale.Resource.StatsDamageTaken, statistics.Actions.DamageTaken.ToString(), ref elementPosition);
            NewTextResults(f, Locale.Resource.StatsCaughtInNet, statistics.Actions.TimesNetted.ToString(), ref elementPosition);

            f.Size = new Vector2(350f, elementPosition.Y);
            return f;
        }
コード例 #29
0
 public void AddControl(Control c)
 {
     controls.Add(c);
     Invalidate();
 }
コード例 #30
0
        protected override void OnConstruct()
        {
            Size = new Vector2(1000, 600);
            Padding = new System.Windows.Forms.Padding(20);
            Anchor = global::Graphics.Orientation.Center;
            Clickable = true;
            ControlBox = false;
            ClearChildren();

            var topBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 70),
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Padding = new System.Windows.Forms.Padding(0, 0, 0, 5)
            };
            AddChild(topBar);

            Control topLeftBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(500, 0)
            };
            topBar.AddChild(topLeftBar);
            var winLoseTextBox = new Label
            {
                Font = new Graphics.Content.Font
                {
                    SystemFont = Fonts.HugeSystemFont,
                    Color = System.Drawing.Color.Green,
                },
                AutoSize = AutoSizeMode.Full,
                TextAnchor = global::Graphics.Orientation.TopLeft,
                Dock = System.Windows.Forms.DockStyle.Top,
                Background = null,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            topLeftBar.AddChild(winLoseTextBox);

            if (GameState == GameState.Won)
            {
                winLoseTextBox.Text = Locale.Resource.ScoreVictory;
                winLoseTextBox.Font.Color = System.Drawing.Color.Green;
            }
            else
            {
                winLoseTextBox.Text = Locale.Resource.ScoreDefeat;
                winLoseTextBox.Font.Color = System.Drawing.Color.Red;
                topLeftBar.AddChild(new Label
                {
                    Font = new Font
                    {
                        SystemFont = Fonts.MediumSystemFont,
                        Color = System.Drawing.Color.White
                    },
                    Background = null,
                    Dock = System.Windows.Forms.DockStyle.Fill,
                    Text = LostGameReason,
                    TextAnchor = global::Graphics.Orientation.TopLeft,
                });
            }

            Control trPanel = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Right,
                Size = new Vector2(200, 40)
            };
            topBar.AddChild(trPanel);

            var gt = new DateTime(TimeSpan.FromSeconds(GameTime).Ticks);

            var timeLeftTextBox = new Label
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Background = null,
                Size = new Vector2(120, 20),
                TextAnchor = global::Graphics.Orientation.BottomRight,
            };
            timeLeftTextBox.Text = Locale.Resource.GenTime + ": " + gt.ToString("mm:ss");

            trPanel.AddChild(timeLeftTextBox);
            if (SilverEnabled)
            {
                Control silverTextContainer = new Control
                {
                    Dock = System.Windows.Forms.DockStyle.Bottom,
                    Size = new Vector2(0, 30),
                };
                trPanel.AddChild(silverTextContainer);
                silverTextContainer.AddChild(new SilverText
                {
                    Anchor = Orientation.BottomRight,
                    Size = new Vector2(120, 30),
                    Background = null,
                    SilverYield = SilverYield
                });
            }

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 1)
            });

            Control bottomBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 50)
            };
            AddChild(bottomBar);

            FlowLayout leftBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomLeft
            };
            bottomBar.AddChild(leftBottomFlow);

            FlowLayout rightBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomRight,
                Origin = FlowOrigin.BottomRight,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            bottomBar.AddChild(rightBottomFlow);

            ButtonBase mainMenuButton = new StoneButton
            {
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            if (FirstTimeCompletedMap)
                mainMenuButton.Text = Locale.Resource.GenContinue;
            else
                mainMenuButton.Text = Locale.Resource.GenMainMenu;
            rightBottomFlow.AddChild(mainMenuButton);
            mainMenuButton.Click += new EventHandler(mainMenuButton_Click);

            ButtonBase playAgainButton = new StoneButton
            {
                Text = Locale.Resource.GenPlayAgain,
                Visible = EarnedGoldCoins == 0,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            rightBottomFlow.AddChild(playAgainButton);
            playAgainButton.Click += new EventHandler(playAgainButton_Click);

            if (FirstTimeCompletedMap && Program.Settings.DisplayMapRatingDialog == MapRatingDialogSetup.Optional)
            {
                ButtonBase rateMapButton = new StoneButton
                {
                    Text = Locale.Resource.GenRateMap,
                    AutoSize = AutoSizeMode.Horizontal,
                    Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
                };
                rightBottomFlow.AddChild(rateMapButton);
                rateMapButton.Click += new EventHandler(rateMapButton_Click);
            }

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 1)
            });

            Control main = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            AddChild(main);

            //////////////////////////
            // STATS /////////////////
            //////////////////////////

            StatsControl stats = new StatsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                Visible = false
            };
            stats.GameState = GameState;
            stats.LostGameReason = LostGameReason;
            stats.Statistics = Statistics;
            stats.Map = Map;
            main.AddChild(stats);

            //////////////////////////
            // REWARDS ///////////////
            //////////////////////////

            ResultsAndRewardsControl rewards = new ResultsAndRewardsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Anchor = global::Graphics.Orientation.TopRight
            };
            rewards.GameState = GameState;
            rewards.EarnedGoldCoins = EarnedGoldCoins;
            rewards.NPlaythroughs = NPlaythroughs;
            rewards.AchievementsEarned = AchievementsEarned;
            rewards.SilverYield = SilverYield;
            rewards.PreviousMaxSilverYield = PreviousMaxSilverYield;
            rewards.FirstTimeCompletedMap = FirstTimeCompletedMap;
            rewards.CurrentStages = CurrentStages;
            rewards.BestStages = BestStages;
            rewards.Map = Map;
            main.AddChild(rewards);

            /////////////////////
            // Switch buttons
            /////////////////////

            CheckboxBase rnrButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreRewardsAndResults,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = true,
                AutoCheck = false,
                Size = new Vector2(200, 38),
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(rnrButton);

            CheckboxBase statsButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreStats,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = false,
                AutoCheck = false,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(statsButton);

            if (HideStats)
            {
                leftBottomFlow.Visible = false;
                stats.Visible = false;
            }
            else
            {
                statsButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = false;
                    statsButton.Checked = stats.Visible = true;
                });
                rnrButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = true;
                    statsButton.Checked = stats.Visible = false;
                });
            }

            base.OnConstruct();
        }
コード例 #31
0
        public WorldMapControl()
        {
            Moveable = true;
            ControlBox = false;
            Size = new Vector2(100000, 100000);
            var res = Program.Instance.GraphicsDevice.Settings.Resolution;
            Position = new Vector2(-Size.X / 2f + res.Width / 2f, -Size.Y / 2f + res.Height / 2f);
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/Menu/MapBackground1.png"),
                Size = new Vector2(2000, 2000),
                TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap
            };

            //Form center = new Form
            //{
            //    Size = new Vector2(20, 20),
            //    Anchor = Orientation.Center
            //};
            //AddChild(center);

            Control innerWorld = new Control
            {
                Size = new Vector2(50, 50),
                Position = new Vector2(Size.X/2f, Size.Y / 2f)
            };
            AddChild(innerWorld);

            innerWorld.AddChild(new WorldMapSelectMapControl
            {
                Position = new Vector2(-1000, -1000)
            });
            innerWorld.AddChild(new Control
            {
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/MapTexture1.png"),
                    Size = new Vector2(5000, 5000),
                    TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap
                },
                Size = new Vector2(5000, 5000),
                Position = new Vector2(-2500, -2500)
            });
            innerWorld.AddChild(new Control
            {
                Position = new Vector2(-550, -180),
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/GameLogo.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust
                }
            });
            innerWorld.AddChild(new GoldCoinsControl
            {
                Position = new Vector2(-250, 100),
            });
            innerWorld.AddChild(new SilverCoinsControl
            {
                Position = new Vector2(-220, 260),
            });
            innerWorld.AddChild(new WeaponsMenu
            {
                Position = new Vector2(-400, 400),
            });
            innerWorld.AddChild(new AchievementsMenu
            {
                Position = new Vector2(500, 400)
            });
            innerWorld.AddChild(new Control
            {
                Position = new Vector2(-4000, -4000),
                Size = new Vector2(8000, 8000),
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/MapDimmer1.png"),
                    Size = new Vector2(8000, 8000),
                    TextureUVMin = new Vector2(-0.5f, -0.5f),
                    TextureUVMax = new Vector2(1.5f, 1.5f)
                }
            });
            //Updateable = true;
        }