当前位置: 首页>>代码示例>>C#>>正文


C# Core.MyGuiControlButton类代码示例

本文整理汇总了C#中MinerWars.AppCode.Game.GUI.Core.MyGuiControlButton的典型用法代码示例。如果您正苦于以下问题:C# MyGuiControlButton类的具体用法?C# MyGuiControlButton怎么用?C# MyGuiControlButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MyGuiControlButton类属于MinerWars.AppCode.Game.GUI.Core命名空间,在下文中一共展示了MyGuiControlButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnOkClick

        protected override void OnOkClick(MyGuiControlButton sender)
        {
            MyMwcSectorTypeEnum sectorType = string.IsNullOrEmpty(m_playerName.Text) ? MyMwcSectorTypeEnum.STORY : MyMwcSectorTypeEnum.SANDBOX;
            bool namedSector = !string.IsNullOrEmpty(m_sector_name.Text);
            MyMwcSectorIdentifier sectorIdentifier;
            if (namedSector)
            {
                sectorIdentifier = new MyMwcSectorIdentifier(sectorType, null, new MyMwcVector3Int(0, 0, 0), m_sector_name.Text);
            }
            else
            {
                int x, y, z;
                if (!int.TryParse(m_sectorIdentifierX.Text, out x) ||
                    !int.TryParse(m_sectorIdentifierY.Text, out y) ||
                    !int.TryParse(m_sectorIdentifierZ.Text, out z))
                {
                    MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.ERROR, 
                        MyTextsWrapperEnum.BadSectorIdentifierInput, MyTextsWrapperEnum.MessageBoxCaptionError,
                        MyTextsWrapperEnum.Ok, null));
                    return;
                }

                sectorIdentifier = new MyMwcSectorIdentifier(sectorType, null, new MyMwcVector3Int(x, y, z), null);
            }

            // This screen will be closed on successfull load from progress screen
            MyGuiManager.AddScreen(new MyGuiScreenEditorLoadSectorObjectsProgress(
                this, MyTextsWrapperEnum.LoadingPleaseWait, m_playerName.Text, sectorIdentifier));
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:29,代码来源:MyGuiScreenEditorCopyToolSelectSector.cs

示例2: LoadControls

        void LoadControls()
        {
            // Background texture unloaded in base
            m_backgroundTexture = MyTextureManager.GetTexture<MyTexture2D>("Textures\\GUI\\BackgroundScreen\\ProgressBackground", flags: TextureFlags.IgnoreQuality);
            m_wheelTexture = MyTextureManager.GetTexture<MyTexture2D>("Textures\\GUI\\Loading", flags: TextureFlags.IgnoreQuality);

            m_size = new Vector2(598 / 1600f, 368 / 1200f);
            Controls.Add(new MyGuiControlLabel(this, new Vector2(0.0f, -0.05f), null, m_progressText, MyGuiConstants.LABEL_TEXT_COLOR,
                MyGuiConstants.LABEL_TEXT_SCALE * 0.86f, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER));

            float deltaX = (m_enableCancel) ? 0.08f : 0.0f;
            float deltaY = 0.035f;

            Controls.Add(new MyGuiControlRotatingWheel(this, new Vector2(-deltaX, deltaY), MyGuiConstants.ROTATING_WHEEL_COLOR, MyGuiConstants.ROTATING_WHEEL_DEFAULT_SCALE,
                MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, m_wheelTexture));

            //  Sometimes we don't want to allow user to cancel pending progress screen
            if (m_enableCancel)
            {
                var cancelButton = new MyGuiControlButton(this, new Vector2(deltaX, deltaY), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE_SMALL,
                        Vector4.One,
                        MyGuiManager.GetConfirmButton(), null, null, MyTextsWrapperEnum.Cancel,
                        MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, MyGuiControlButtonTextAlignment.CENTERED, OnCancelClick,
                        true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true);
                Controls.Add(cancelButton);
            }
            m_controlsCreated = true;
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:28,代码来源:MyGuiScreenProgressBase.cs

示例3: LoadControls

        protected override void LoadControls()
        {
            Vector2 position = GetNextControlPosition() + new Vector2(0.38f, 0);

            m_onButton = new MyGuiControlButton(this, position, new Vector2(0.051f, 0.061f), Vector4.One, MyTextureManager.GetTexture<MyTexture2D>("Textures\\GUI\\ButtonOnOff", flags: TextureFlags.IgnoreQuality), null, null,
                MyTextsWrapperEnum.On, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE_SMALLER,
                MyGuiControlButtonTextAlignment.CENTERED, OnOnOffClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true, MyGuiControlHighlightType.WHEN_ACTIVE);
            Controls.Add(m_onButton);
            m_onButton.DrawRedTextureWhenDisabled = false;
            m_onButton.UseSwitchMode = true;

            position.X -= 0.04f;

            m_offButon = new MyGuiControlButton(this, position, new Vector2(0.051f, 0.061f), Vector4.One, MyTextureManager.GetTexture<MyTexture2D>("Textures\\GUI\\ButtonOnOff", flags: TextureFlags.IgnoreQuality), null, null,
                MyTextsWrapperEnum.Off, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE_SMALLER,
                MyGuiControlButtonTextAlignment.CENTERED, OnOnOffClick, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true, MyGuiControlHighlightType.WHEN_ACTIVE);
            Controls.Add(m_offButon);
            m_offButon.DrawRedTextureWhenDisabled = false;
            m_offButon.UseSwitchMode = true;

            position.X -= 0.11f;

            m_unpoweredLabel = new MyGuiControlLabel(this, position, null, MyTextsWrapperEnum.Unpowered, MyGuiConstants.LABEL_TEXT_COLOR, 1.5f, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue());
            m_remoteControlledLabel = new MyGuiControlLabel(this, position, null, MyTextsWrapperEnum.MP_RemoteControlled, MyGuiConstants.LABEL_TEXT_COLOR, 1.5f, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, MyGuiManager.GetFontMinerWarsBlue());
            Controls.Add(m_unpoweredLabel);
            Controls.Add(m_remoteControlledLabel);

            m_isPrefabElectrified = !Prefab.IsElectrified();
            UpdateVisibility();
            UpdateEnabledState();
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:31,代码来源:MyGuiControlPrefabUse.cs

示例4: OnOkClick

 protected override void OnOkClick(MyGuiControlButton sender)
 {
     base.OnOkClick(sender);
     
     MyGuiScreenGamePlay.Static.SetSectorName(m_nameTextbox.Text);
     MyEditor.Static.PerformContextMenuAction(MyGuiContextMenuItemActionType.SAVE_SECTOR);            
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyGuiScreenSaveSector.cs

示例5: LoadContent

        public override void LoadContent()
        {
            base.LoadContent();

            Vector2 menuPositionOrigin = new Vector2(0.0f, -m_size.Value.Y / 2.0f + 0.145f);
            const MyGuiControlButtonTextAlignment menuButtonTextAlignement = MyGuiControlButtonTextAlignment.CENTERED;


            Controls.Add(new MyGuiControlButton(this, menuPositionOrigin + 0 * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyGuiConstants.MAIN_MENU_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.DifficultyEasy, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnEasyClick, menuButtonTextAlignement, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));
            Controls.Add(new MyGuiControlButton(this, menuPositionOrigin + 1 * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyGuiConstants.MAIN_MENU_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.DifficultyNormal, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnNormalClick, menuButtonTextAlignement, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));
            Controls.Add(new MyGuiControlButton(this, menuPositionOrigin + 2 * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyGuiConstants.MAIN_MENU_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.DifficultyHard, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnHardClick, menuButtonTextAlignement, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));

            var exitButton = new MyGuiControlButton(this, new Vector2(0, 0.1460f), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE,
                MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyGuiManager.GetConfirmButton(), null, null, MyTextsWrapperEnum.Back,
                MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, menuButtonTextAlignement, OnBackClick,
                true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true);
            Controls.Add(exitButton);


            SetControlIndex(2);
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:25,代码来源:MyGuiScreenChooseDifficulty.cs

示例6: RecreateControls

        public override void RecreateControls(bool contructor)
        {
            Controls.Clear();

            AddCaption(MyTextsWrapperEnum.Options, new Vector2(0, 0.005f));

            Vector2 menuPositionOrigin = new Vector2(0.0f, -m_size.Value.Y / 2.0f + 0.146f);
            MyGuiControlButtonTextAlignment menuButtonTextAlignement = MyGuiControlButtonTextAlignment.CENTERED;

            int index = 0;

            Controls.Add(new MyGuiControlButton(this, menuPositionOrigin + index++ * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyGuiConstants.MAIN_MENU_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.Game, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnGameClick, menuButtonTextAlignement, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));

            Controls.Add(new MyGuiControlButton(this, menuPositionOrigin + index++ * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyGuiConstants.MAIN_MENU_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.Video, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnVideoClick, menuButtonTextAlignement, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, m_showVideoOption ? (MyTextsWrapperEnum?)null : MyTextsWrapperEnum.FeatureAccessibleOnlyFromMainMenu));

            Controls.Add(new MyGuiControlButton(this, menuPositionOrigin + index++ * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyGuiConstants.MAIN_MENU_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.Audio, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnAudioClick, menuButtonTextAlignement, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));
            Controls.Add(new MyGuiControlButton(this, menuPositionOrigin + index++ * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyGuiConstants.MAIN_MENU_BUTTON_SIZE, MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyTextsWrapperEnum.Controls, MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, OnControlsClick, menuButtonTextAlignement, true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true));

            var backButton = new MyGuiControlButton(this, new Vector2(0, 0.178f), MyGuiConstants.MESSAGE_BOX_BUTTON_SIZE,
                MyGuiConstants.BUTTON_BACKGROUND_COLOR,
                MyGuiManager.GetConfirmButton(), null, null, MyTextsWrapperEnum.Back,
                MyGuiConstants.BUTTON_TEXT_COLOR, MyGuiConstants.BUTTON_TEXT_SCALE, menuButtonTextAlignement, OnBackClick,
                true, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, true, true);
            Controls.Add(backButton);

        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:30,代码来源:MyGuiScreenOptions.cs

示例7: OnCancelClick

 protected override void OnCancelClick(MyGuiControlButton sender)
 {
     if (m_waypointPath != null)
         if (m_newlyAdded)
             MyWayPointGraph.RemovePath(MyWayPointGraph.SelectedPath);
     CloseScreen();
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyGuiScreenEditorWayPointPath.cs

示例8: OnOkClick

 public override void OnOkClick(MyGuiControlButton sender)
 {
     base.OnOkClick(sender);
     foreach (var v in m_waypoints)
         v.IsSecret = m_secretCheckbox.Checked;
     MyGuiManager.CloseAllScreensExcept(MyGuiScreenGamePlay.Static);
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:7,代码来源:MyGuiScreenEditorWaypoint.cs

示例9: OnAcquireControlClick

        void OnAcquireControlClick(MyGuiControlButton sender)
        {
            Debug.Assert(PrefabLargeWeapon.EntityId.HasValue, "EntityID cannot be null");

            if (MyMultiplayerGameplay.IsRunning)
            {
                MyMultiplayerGameplay.Static.LockReponse = (e, success) =>
                {
                    MyMultiplayerGameplay.Static.LockReponse = null;
                    if (PrefabLargeWeapon != e)
                    {
                        Debug.Fail("Something went wrong, locked different entity");
                        MyMultiplayerGameplay.Static.Lock(e, false);
                        return;
                    }

                    if (success)
                    {
                        ParentScreen.Closed += ParentScreenClosed;

                        MyGuiScreenGamePlay.Static.TakeControlOfLargeWeapon(PrefabLargeWeapon);
                        HideHUBScreen();
                    }
                };
                MyMultiplayerGameplay.Static.Lock(PrefabLargeWeapon, true);
            }
            else
            {
                MyGuiScreenGamePlay.Static.TakeControlOfLargeWeapon(PrefabLargeWeapon);
                HideHUBScreen();
            }
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:32,代码来源:MyGuiControlPrefabLargeWeaponUse.cs

示例10: OnVideoClick

        public void OnVideoClick(MyGuiControlButton sender)
        {
            MyMwcLog.WriteLine("MyGuiScreenOptions.OnVideoClick START");

            MyGuiManager.AddScreen(new MyGuiScreenOptionsVideo());

            MyMwcLog.WriteLine("MyGuiScreenOptions.OnVideoClick END");
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyGuiScreenOptions.cs

示例11: OnDeleteClick

 private void OnDeleteClick(MyGuiControlButton sender) 
 {
     int? selectedPrefabId = m_connectedPrefabIdsListbox.GetSelectedItemKey();
     if (selectedPrefabId != null) 
     {
         PrefabSecurityControlHUB.DisconnetEntity((uint)selectedPrefabId.Value);
         m_connectedPrefabIdsListbox.RemoveItem(selectedPrefabId.Value);
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:9,代码来源:MyGuiScreenEditorSecurityControlHUB.cs

示例12: OnOkClick

        public override void OnOkClick(MyGuiControlButton sender)
        {
            base.OnOkClick(sender);

            PrefabContainer.AlarmOn = m_alarmOn.Checked;
            PrefabContainer.Activate(m_activatedCheckbox.Checked, false);

            MyGuiManager.CloseAllScreensExcept(MyGuiScreenGamePlay.Static);

        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:10,代码来源:MyGuiScreenEditorPrefabContainer.cs

示例13: OnAllowEnter

 public void OnAllowEnter(MyGuiControlButton sender)
 {
     MyMultiplayerGameplay.Static.AllowEnter(ref m_request.Message);
     if (m_chkRememberSetting.Checked)
     {
         MyMultiplayerGameplay.Static.JoinMode = MyJoinMode.Open;
         MyMultiplayerGameplay.Static.UpdateGameInfo();
     }
     CloseScreen();
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:10,代码来源:MyGuiScreenMultiplayerEnterGameRequest.cs

示例14: OnSelectAllNone

 void OnSelectAllNone(MyGuiControlButton sender)
 {
     if (m_objectList.GetSelectedItems().Count > 0)
     {
         m_objectList.DeselectAll();
     }
     else
     {
         m_objectList.SelectAll();
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MyGuiScreenEditorCopyTool.cs

示例15: OnOkClick

 protected override void OnOkClick(MyGuiControlButton sender)
 {
     if (!string.IsNullOrEmpty(m_nameTextbox.Text) && m_myGuiScreenEditorGroups.ChangeGroupName(m_group, m_nameTextbox.Text))
     {
         base.OnOkClick(sender);
     }
     else
     {
         MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.ERROR, MyTextsWrapperEnum.EditorGroupsNameUsedText, MyTextsWrapperEnum.EditorGroupsNameUsedCaption, MyTextsWrapperEnum.Ok, null));
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MyGuiScreenEditorRenameGroup.cs


注:本文中的MinerWars.AppCode.Game.GUI.Core.MyGuiControlButton类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。