Esempio n. 1
0
        void InitDifficultyButtons()
        {
            ImageToggleButton btnNormal = null;
            ImageToggleButton btnEasy   = null;

            easymode              = false;
            btnEasy               = new ImageToggleButton();
            btnEasy.Image         = Root.Singleton.Material("img/customizeUI/button_easy_on.png");
            btnEasy.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_easy_select2.png");
            btnEasy.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_easy_select2.png");
            btnEasy.DisabledImage = Root.Singleton.Material("img/customizeUI/button_easy_off.png");
            btnEasy.Enabled       = true;
            btnEasy.Toggled       = true;
            btnEasy.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnEasy.OnClick      += sender =>
            {
                btnEasy.Toggled = true;
                btnEasy.UpdateImage();
                btnNormal.Toggled = false;
                btnNormal.UpdateImage();
                easymode = true;
            };
            Util.LayoutControl(btnEasy, 977, 16, btnEasy.Image.Size, rctScreen);
            btnEasy.Parent = Root.Singleton.Canvas;
            btnEasy.Init();


            btnNormal               = new ImageToggleButton();
            btnNormal.Image         = Root.Singleton.Material("img/customizeUI/button_normal_on.png");
            btnNormal.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_normal_select2.png");
            btnNormal.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_normal_select2.png");
            btnNormal.DisabledImage = Root.Singleton.Material("img/customizeUI/button_normal_off.png");
            btnNormal.Enabled       = true;
            btnNormal.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnNormal.OnClick      += sender =>
            {
                btnEasy.Toggled = false;
                btnEasy.UpdateImage();
                btnNormal.Toggled = true;
                btnNormal.UpdateImage();
                easymode = false;
            };
            Util.LayoutControl(btnNormal, 977, 41, btnNormal.Image.Size, rctScreen);
            btnNormal.Parent = Root.Singleton.Canvas;
            btnNormal.Init();
        }
Esempio n. 2
0
        void InitLayoutButtons()
        {
            btnLayoutA = null;
            btnLayoutB = null;

            btnLayoutA               = new ImageToggleButton();
            btnLayoutA.Image         = Root.Singleton.Material("img/customizeUI/button_typea_on.png");
            btnLayoutA.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_typea_select2.png");
            btnLayoutA.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_typea_select2.png");
            btnLayoutA.DisabledImage = Root.Singleton.Material("img/customizeUI/button_typea_off.png");
            btnLayoutA.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnLayoutA.OnClick      += sender =>
            {
                btnLayoutA.Toggled = true;
                btnLayoutA.UpdateImage();
                btnLayoutB.Toggled = false;
                btnLayoutB.UpdateImage();
                SetShipGenerator(currentShipGen, 0);
            };
            Util.LayoutControl(btnLayoutA, 18, 260, btnLayoutA.Image.Size, rctScreen);
            btnLayoutA.Parent = Root.Singleton.Canvas;
            btnLayoutA.Init();

            btnLayoutB               = new ImageToggleButton();
            btnLayoutB.Image         = Root.Singleton.Material("img/customizeUI/button_typeb_on.png");
            btnLayoutB.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_typeb_select2.png");
            btnLayoutB.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_typeb_select2.png");
            btnLayoutB.DisabledImage = Root.Singleton.Material("img/customizeUI/button_typeb_off.png");
            btnLayoutB.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnLayoutB.OnClick      += sender =>
            {
                btnLayoutA.Toggled = false;
                btnLayoutA.UpdateImage();
                btnLayoutB.Toggled = true;
                btnLayoutB.UpdateImage();
                SetShipGenerator(currentShipGen, 1);
            };
            Util.LayoutControl(btnLayoutB, 100, 260, btnLayoutB.Image.Size, rctScreen);
            btnLayoutB.Parent = Root.Singleton.Canvas;
            btnLayoutB.Init();
        }
Esempio n. 3
0
        public void OnActivate()
        {
            StoreWindow();
            LoadSprites();
            LoadUI();

            InitShipNamePanel();
            InitShipRenameButton();
            InitShipNameText();
            InitListShipsButton();
            InitShipsLeftButton();
            InitShipsRightButton();

            ImageToggleButton btnNormal = null, btnEasy = null;

            easymode = false;
            #region InitEasyButton
            btnEasy               = new ImageToggleButton();
            btnEasy.Image         = Root.Singleton.Material("img/customizeUI/button_easy_on.png");
            btnEasy.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_easy_select2.png");
            btnEasy.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_easy_select2.png");
            btnEasy.DisabledImage = Root.Singleton.Material("img/customizeUI/button_easy_off.png");
            btnEasy.Enabled       = true;
            btnEasy.Toggled       = true;
            btnEasy.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnEasy.OnClick      += sender => {
                btnEasy.Toggled = true;
                btnEasy.UpdateImage();
                btnNormal.Toggled = false;
                btnNormal.UpdateImage();
                easymode = true;
            };
            Util.LayoutControl(btnEasy, 977, 16, 95, 24, rctScreen);
            btnEasy.Parent = Root.Singleton.Canvas;
            btnEasy.Init();
            #endregion
            #region InitNormalButton
            btnNormal               = new ImageToggleButton();
            btnNormal.Image         = Root.Singleton.Material("img/customizeUI/button_normal_on.png");
            btnNormal.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_normal_select2.png");
            btnNormal.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_normal_select2.png");
            btnNormal.DisabledImage = Root.Singleton.Material("img/customizeUI/button_normal_off.png");
            btnNormal.Enabled       = true;
            btnNormal.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnNormal.OnClick      += sender => {
                btnEasy.Toggled = false;
                btnEasy.UpdateImage();
                btnNormal.Toggled = true;
                btnNormal.UpdateImage();
                easymode = false;
            };
            Util.LayoutControl(btnNormal, 977, 41, 95, 24, rctScreen);
            btnNormal.Parent = Root.Singleton.Canvas;
            btnNormal.Init();
            #endregion
            InitStartButton();

            ImageToggleButton btnTypeA = null, btnTypeB = null;

            #region Init Button Type A
            btnTypeA               = new ImageToggleButton();
            btnTypeA.Image         = Root.Singleton.Material("img/customizeUI/button_typea_on.png");
            btnTypeA.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_typea_select2.png");
            btnTypeA.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_typea_select2.png");
            btnTypeA.DisabledImage = Root.Singleton.Material("img/customizeUI/button_typea_off.png");
            btnTypeA.Enabled       = true;
            btnTypeA.Toggled       = true;
            btnTypeA.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnTypeA.OnClick      += sender => {
                btnTypeA.Toggled = true;
                btnTypeA.UpdateImage();
                btnTypeB.Toggled = false;
                btnTypeB.UpdateImage();
            };
            Util.LayoutControl(btnTypeA, 18, 260, 80, 22, rctScreen);
            btnTypeA.Parent = Root.Singleton.Canvas;
            btnTypeA.Init();
            #endregion
            #region Init Button Type B
            btnTypeB               = new ImageToggleButton();
            btnTypeB.Image         = Root.Singleton.Material("img/customizeUI/button_typeb_on.png");
            btnTypeB.HoveredImage  = Root.Singleton.Material("img/customizeUI/button_typeb_select2.png");
            btnTypeB.ToggledImage  = Root.Singleton.Material("img/customizeUI/button_typeb_select2.png");
            btnTypeB.DisabledImage = Root.Singleton.Material("img/customizeUI/button_typeb_off.png");
            btnTypeB.Enabled       = false;
            btnTypeB.HoverSound    = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnTypeB.OnClick      += sender => {
                btnTypeA.Toggled = false;
                btnTypeA.UpdateImage();
                btnTypeB.Toggled = true;
                btnTypeB.UpdateImage();
            };
            Util.LayoutControl(btnTypeB, 100, 260, 80, 22, rctScreen);
            btnTypeB.Parent = Root.Singleton.Canvas;
            btnTypeB.Init();
            #endregion
            InitShowRoomsButton();

            if (currentShipGen == null)
            {
                // Locate the default ship
                SetShipGenerator(GetDefaultShipGenerator());
            }
            else
            {
                SetShipGenerator(currentShipGen);
            }
        }