Exemplo n.º 1
0
        public LoginComponent(D3DEngine engine, MainScreen screen, SandboxCommonResources commonResources)
            : base(engine, screen, commonResources)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }
            if (screen == null)
            {
                throw new ArgumentNullException("screen");
            }
            _engine = engine;
            _screen = screen;

            _stEnter         = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\enter.png"));
            _stEnterHover    = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\enter_hover.png"));
            _stEnterDown     = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\enter_press.png"));
            _stEnterDisabled = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\enter_disabled.png"));

            _stSign      = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\sign.png"));
            _stSignHover = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\sign_hover.png"));

            _stInputBg  = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\login_input_bg.png"));
            _stEmail    = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\email.png"));
            _stPassword = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\password.png"));

            _stAutentification = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\authentication.png"));
            _stError           = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\Login\\error.png"));
        }
Exemplo n.º 2
0
        public MainMenuComponent(D3DEngine engine, MainScreen screen, RealmRuntimeVariables runtime, SandboxCommonResources commonResources)
            : base(engine, screen, commonResources)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }
            if (screen == null)
            {
                throw new ArgumentNullException("screen");
            }
            _engine  = engine;
            _screen  = screen;
            _runtime = runtime;

            _engine.ScreenSize_Updated += UpdateLayout;


            _stLabelContinue     = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_continue.png"));
            _stLabelCredits      = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_credits.png"));
            _stLabelExit         = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_exit.png"));
            _stLabelLogOut       = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_logout.png"));
            _stLabelMultiplayer  = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_multiplayer.png"));
            _stLabelSingleplayer = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_singleplayer.png"));
            _stLabelSettings     = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_settings.png"));
            _stLabelEditor       = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_editor.png"));
            _stMainMenuLabel     = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu.png"));
        }
Exemplo n.º 3
0
        protected SandboxMenuComponent(D3DEngine engine, MainScreen screen, SandboxCommonResources commonResources)
        {
            _engine                     = engine;
            _screen                     = screen;
            _commonResources            = commonResources;
            _engine.ScreenSize_Updated += EngineViewPortUpdated;

            _linen = new ImageControl {
                Image = _commonResources.StLinenPattern
            };
            _cubes = new ImageControl {
                Image = _commonResources.StCubesPattern
            };
            _shadow = new ImageControl {
                Image = _commonResources.StShadow
            };
            _logo = new ImageControl {
                Image = _commonResources.StLogo
            };
            _version = new ImageControl {
                Image = _commonResources.StGameName
            };


            DrawOrders.UpdateIndex(0, int.MaxValue - 1);
        }
Exemplo n.º 4
0
        public MenuTemplate1Component(Game game, D3DEngine engine, MainScreen screen, SandboxCommonResources commonResources)
        {
            _engine         = engine;
            _screen         = screen;
            CommonResources = commonResources;
            _game           = game;

            _engine.ScreenSize_Updated += UpdateLayoutInternal;
        }
Exemplo n.º 5
0
        public override void Initialize()
        {
            _stIconInventory = ToDispose(SandboxCommonResources.LoadTexture(_d3DEngine, "Images\\Inventory\\icon_inventory.png"));
            _stIconCrafting  = ToDispose(SandboxCommonResources.LoadTexture(_d3DEngine, "Images\\Inventory\\icon_crafting.png"));

            InventoryButton = new AlphaImageButtonControl
            {
                CustomImage      = _stIconInventory,
                CustomImageDown  = _stIconInventory,
                CustomImageHover = _stIconInventory,
                AlphaDefault     = 0.5f,
                AlphaHover       = 0.8f,
                AlphaDown        = 1f,
                LayoutFlags      = ControlLayoutFlags.Skip
            };

            CraftingButton = new AlphaImageButtonControl
            {
                CustomImage      = _stIconCrafting,
                CustomImageDown  = _stIconCrafting,
                CustomImageHover = _stIconCrafting,
                AlphaDefault     = 0.5f,
                AlphaHover       = 0.8f,
                AlphaDown        = 1f,
                LayoutFlags      = ControlLayoutFlags.Skip
            };

            _inventoryLabel = new LabelControl
            {
                IsClickTransparent = true,
                Color       = new S33M3Resources.Structs.ByteColor(255, 255, 255, 100),
                LayoutFlags = ControlLayoutFlags.Skip
            };

            _craftingLabel = new LabelControl
            {
                IsClickTransparent = true,
                Color       = new S33M3Resources.Structs.ByteColor(255, 255, 255, 100),
                LayoutFlags = ControlLayoutFlags.Skip
            };

            UpdateLabels();

            UpdateLayout(_d3DEngine.ViewPort, _d3DEngine.BackBufferTex.Description);

            base.Initialize();
        }
Exemplo n.º 6
0
        public override void Initialize()
        {
            base.Initialize();

            _stLabelConnect = ToDispose(SandboxCommonResources.LoadTexture(_engine, "Images\\connect_label.png"));

            _serversLabel = new LabelControl
            {
                Text       = "Servers:",
                Color      = ColorHelper.ToColor4(System.Drawing.Color.White),
                CustomFont = _commonResources.FontBebasNeue25
            };

            _serverDescriptionLabel = new LabelControl {
                Color = ColorHelper.ToColor4(System.Drawing.Color.White),
                CustomVerticalPlacement = FlatGuiGraphics.Frame.VerticalTextAlignment.Top
            };

            _backButton = new ButtonControl
            {
                Text                = "Back",
                CustomImage         = _commonResources.StButtonBackground,
                CustomImageHover    = _commonResources.StButtonBackgroundHover,
                CustomImageDown     = _commonResources.StButtonBackgroundDown,
                CustomImageDisabled = _commonResources.StButtonBackground,
                CusomImageLabel     = _commonResources.StBackLabel
            };
            _backButton.Pressed += delegate { OnBackPressed(); };

            _connectButton = new ButtonControl
            {
                Text             = "Connect",
                Enabled          = false,
                CustomImage      = _commonResources.StButtonBackground,
                CustomImageHover = _commonResources.StButtonBackgroundHover,
                CustomImageDown  = _commonResources.StButtonBackgroundDown,
                CusomImageLabel  = _stLabelConnect
            };
            _connectButton.Pressed += delegate { OnConnectPressed(); };

            _serverList = new ListControl {
                Bounds = new UniRectangle(100, 100, 400, 400), SelectionMode = ListSelectionMode.Single
            };
            _serverList.SelectionChanged += ServerListSelectionChanged;

            UpdateLayout(_engine.ViewPort, _engine.BackBufferTex.Description);
        }
Exemplo n.º 7
0
        public ServerSelectionComponent(D3DEngine engine, MainScreen screen, SandboxCommonResources commonResources)
            : base(engine, screen, commonResources)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }
            if (screen == null)
            {
                throw new ArgumentNullException("screen");
            }
            _engine          = engine;
            _screen          = screen;
            _commonResources = commonResources;

            _engine.ScreenSize_Updated += UpdateLayout;
        }
Exemplo n.º 8
0
        public InGameMenuComponent(D3DEngine engine, MainScreen screen, SandboxCommonResources commonResources)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }
            if (screen == null)
            {
                throw new ArgumentNullException("screen");
            }

            _engine          = engine;
            _screen          = screen;
            _commonResources = commonResources;

            _engine.ScreenSize_Updated += UpdateLayout;

            _stMenuBg        = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\gameplay_menu.png"));
            _stLabelContinue = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_continue.png"));
            _stLabelSettings = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_settings.png"));
            _stLabelExit     = ToDispose(SandboxCommonResources.LoadTexture(engine, "Images\\MainMenu\\main_menu_label_exit.png"));
        }
Exemplo n.º 9
0
 public LoadingComponent(D3DEngine engine, MainScreen screen, SandboxCommonResources commonResources)
     : base(engine, screen, commonResources)
 {
     _engine = engine;
     _screen = screen;
 }