Пример #1
0
        public PieceSelectionScreen(Game game) : base("Piece Selection")
        {
            this.game      = game;
            Title.Position = new CPos(0, -4096, 0);

            mapSelection = new PanelList(new MPos(4096, 4096), new MPos(512, 512), "wooden")
            {
                Position = new CPos(0, 1024, 0)
            };
            foreach (var piece in PieceManager.Pieces)
            {
                mapSelection.Add(new PanelListItem(new BatchObject(UISpriteManager.Get("UI_map")[0]), new MPos(512, 512), piece.Name, new[] { Color.Grey + "[" + piece.Size.X + "," + piece.Size.Y + "]" },
                                                   () =>
                {
                    GameController.CreateNew(GameSaveManager.DefaultSave.Copy(), MissionType.TEST, InteractionMode.EDITOR, custom: MapType.FromPiece(piece));
                    Hide();
                }));
            }
            Add(mapSelection);
            Add(new Button("Back", "wooden", () => game.ShowScreen(ScreenType.MENU))
            {
                Position = new CPos(4096, 6144, 0)
            });
            Add(new Button("New Piece", "wooden", () => { createPieceScreen.ActiveScreen = true; })
            {
                Position = new CPos(0, 6144, 0)
            });
            Add(new Button("Delete Piece", "wooden")
            {
                Position = new CPos(-4096, 6144, 0)
            });

            createPieceScreen = new CreatePieceScreen();
        }
Пример #2
0
        public ActorShopScreen(Game game) : base("Actor Shop")
        {
            this.game      = game;
            Title.Position = new CPos(0, -4096, 0);

            Add(new Panel(new MPos(8 * 1024, 2 * 1024), "wooden")
            {
                Position = new CPos(0, 920, 0)
            });

            actors = new PanelList(new MPos(8120, 1024), new MPos(1024, 1024), "stone")
            {
                Position = new CPos(0, -2048, 0)
            };
            foreach (var a in ActorCache.Types.Values)
            {
                if (a.Playable == null)
                {
                    continue;
                }

                var sprite = a.GetPreviewSprite();
                var scale  = MasterRenderer.PixelSize / (float)Math.Max(sprite.Width, sprite.Height) - 0.1f;
                var item   = new PanelListItem(new BatchObject(sprite), new MPos(1024, 1024), a.Playable.Name, new string[0], () => selectActor(a))
                {
                    Scale = scale * 2
                };

                if (!game.Stats.ActorAvailable(a.Playable))
                {
                    item.SetColor(Color.Black);
                }

                actors.Add(item);
                actorTypes.Add(a.Playable.InternalName);
            }
            Add(actors);

            Add(new Button("Buy", "wooden", () => buyActor(selected))
            {
                Position = new CPos(-6144, 3072, 0)
            });
            Add(new Button("Resume", "wooden", () => game.ShowScreen(ScreenType.DEFAULT, false))
            {
                Position = new CPos(0, 6144, 0)
            });

            information = new UITextBlock(FontManager.Default, TextOffset.LEFT, "Select an actor for further information.", "", "", "Cost: -")
            {
                Position = new CPos(-7900, 0, 0)
            };
            Add(information);

            Add(new MoneyDisplay(game)
            {
                Position = new CPos(Left + 2048, Bottom - 1024, 0)
            });
        }
Пример #3
0
        public TrophyScreen(Game game) : base("Trophy Collection")
        {
            this.game      = game;
            Title.Position = new CPos(0, -4096, 0);

            trophies = new PanelList(new MPos(8120, 1024), new MPos(512, 1024), "wooden")
            {
                Position = new CPos(0, -1024, 0)
            };
            foreach (var key in TrophyCache.Trophies.Keys)
            {
                var value = TrophyCache.Trophies[key];

                var sprite = value.Image.GetTextures()[0];
                var scale  = MasterRenderer.PixelSize / (float)Math.Max(sprite.Width, sprite.Height) - 0.1f;
                var item   = new PanelListItem(new BatchObject(sprite), new MPos(512, 1024), value.Name, new string[0], () => selectTrophy(key, value))
                {
                    Scale = scale * 2f
                };
                if (!game.Stats.TrophyUnlocked(key))
                {
                    item.SetColor(Color.Black);
                }

                trophies.Add(item);
            }
            Add(trophies);

            Add(new Panel(new MPos(8 * 1024, 1024), "stone")
            {
                Position = new CPos(0, 1024, 0)
            });

            information = new UITextBlock(FontManager.Default, TextOffset.LEFT, "Select a trophy for further information.", "", "", "")
            {
                Position = new CPos(-7900, 512 - 128, 0)
            };
            Add(information);

            Add(new Button("Resume", "wooden", () => game.ShowScreen(ScreenType.DEFAULT, false))
            {
                Position = new CPos(0, 6144, 0)
            });
        }