本文整理汇总了C#中Sandbox.Graphics.GUI.MyGuiControlCheckbox.SetToolTip方法的典型用法代码示例。如果您正苦于以下问题:C# MyGuiControlCheckbox.SetToolTip方法的具体用法?C# MyGuiControlCheckbox.SetToolTip怎么用?C# MyGuiControlCheckbox.SetToolTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Graphics.GUI.MyGuiControlCheckbox
的用法示例。
在下文中一共展示了MyGuiControlCheckbox.SetToolTip方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildControls
protected virtual void BuildControls()
{
Vector2 buttonSize = MyGuiConstants.BACK_BUTTON_SIZE;
Vector2 buttonsOrigin = m_size.Value / 2 - new Vector2(0.23f, 0.03f);
if (m_isNewGame)
AddCaption(MyCommonTexts.ScreenCaptionCustomWorld);
else
AddCaption(MyCommonTexts.ScreenCaptionEditSettings);
int numControls = 0;
var nameLabel = MakeLabel(MyCommonTexts.Name);
var descriptionLabel = MakeLabel(MyCommonTexts.Description);
var gameModeLabel = MakeLabel(MyCommonTexts.WorldSettings_GameMode);
var onlineModeLabel = MakeLabel(MyCommonTexts.WorldSettings_OnlineMode);
m_maxPlayersLabel = MakeLabel(MyCommonTexts.MaxPlayers);
var environmentLabel = MakeLabel(MySpaceTexts.WorldSettings_EnvironmentHostility);
var scenarioLabel = MakeLabel(MySpaceTexts.WorldSettings_Scenario);
var soundModeLabel = MakeLabel(MySpaceTexts.WorldSettings_SoundMode);
float width = 0.284375f + 0.025f;
m_nameTextbox = new MyGuiControlTextbox(maxLength: MySession.MAX_NAME_LENGTH);
m_descriptionTextbox = new MyGuiControlTextbox(maxLength: MySession.MAX_DESCRIPTION_LENGTH);
m_onlineMode = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_environment = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_maxPlayersSlider = new MyGuiControlSlider(
position: Vector2.Zero,
width: m_onlineMode.Size.X,
minValue: 2,
maxValue: 16,
labelText: new StringBuilder("{0}").ToString(),
labelDecimalPlaces: 0,
labelSpaceWidth: 0.05f,
intValue: true
);
m_asteroidAmountLabel = MakeLabel(MySpaceTexts.Asteroid_Amount);
m_asteroidAmountCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_asteroidAmountCombo.ItemSelected += m_asteroidAmountCombo_ItemSelected;
m_soundModeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_scenarioTypesList = new MyGuiControlList();
// Ok/Cancel
m_okButton = new MyGuiControlButton(position: buttonsOrigin - new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MyCommonTexts.Ok), onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
m_cancelButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MyCommonTexts.Cancel), onButtonClick: OnCancelButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);
m_creativeModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MyCommonTexts.WorldSettings_GameModeCreative), onButtonClick: OnCreativeClick);
m_creativeModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeCreative);
m_survivalModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MyCommonTexts.WorldSettings_GameModeSurvival), onButtonClick: OnSurvivalClick);
m_survivalModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeSurvival);
m_onlineMode.ItemSelected += OnOnlineModeSelect;
m_onlineMode.AddItem((int)MyOnlineModeEnum.OFFLINE, MyCommonTexts.WorldSettings_OnlineModeOffline);
m_onlineMode.AddItem((int)MyOnlineModeEnum.PRIVATE, MyCommonTexts.WorldSettings_OnlineModePrivate);
m_onlineMode.AddItem((int)MyOnlineModeEnum.FRIENDS, MyCommonTexts.WorldSettings_OnlineModeFriends);
m_onlineMode.AddItem((int)MyOnlineModeEnum.PUBLIC, MyCommonTexts.WorldSettings_OnlineModePublic);
m_environment.AddItem((int)MyEnvironmentHostilityEnum.SAFE, MySpaceTexts.WorldSettings_EnvironmentHostilitySafe);
m_environment.AddItem((int)MyEnvironmentHostilityEnum.NORMAL, MySpaceTexts.WorldSettings_EnvironmentHostilityNormal);
m_environment.AddItem((int)MyEnvironmentHostilityEnum.CATACLYSM, MySpaceTexts.WorldSettings_EnvironmentHostilityCataclysm);
m_environment.AddItem((int)MyEnvironmentHostilityEnum.CATACLYSM_UNREAL, MySpaceTexts.WorldSettings_EnvironmentHostilityCataclysmUnreal);
m_environment.ItemSelected += HostilityChanged;
m_soundModeCombo.AddItem((int)MySoundModeEnum.Arcade, MySpaceTexts.WorldSettings_ArcadeSound);
m_soundModeCombo.AddItem((int)MySoundModeEnum.Realistic, MySpaceTexts.WorldSettings_RealisticSound);
if (m_isNewGame)
{
m_scenarioTypesGroup = new MyGuiControlRadioButtonGroup();
m_scenarioTypesGroup.SelectedChanged += scenario_SelectedChanged;
foreach (var scenario in MyDefinitionManager.Static.GetScenarioDefinitions())
{
if (!scenario.Public && !MyFakes.ENABLE_NON_PUBLIC_SCENARIOS)
continue;
var button = new MyGuiControlScenarioButton(scenario);
m_scenarioTypesGroup.Add(button);
m_scenarioTypesList.Controls.Add(button);
}
}
m_nameTextbox.SetToolTip(string.Format(MyTexts.GetString(MyCommonTexts.ToolTipWorldSettingsName), MySession.MIN_NAME_LENGTH, MySession.MAX_NAME_LENGTH));
m_descriptionTextbox.SetToolTip(MyTexts.GetString(MyCommonTexts.ToolTipWorldSettingsDescription));
m_environment.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsEnvironment));
m_onlineMode.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsOnlineMode));
m_maxPlayersSlider.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsMaxPlayer));
m_asteroidAmountCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsAsteroidAmount));
m_soundModeCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsSoundMode));
m_nameTextbox.TextChanged += m_nameTextbox_TextChanged;
m_soundModeCombo.ItemSelected += m_soundModeCombo_ItemSelected;
var advanced = new MyGuiControlButton(highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Advanced), onButtonClick: OnAdvancedClick);
//.........这里部分代码省略.........
示例2: Init
public void Init(IMyGuiControlsParent controlsParent)
{
m_controlsParent = controlsParent;
RefreshUserInfo();
m_tableFactions = (MyGuiControlTable)controlsParent.Controls.GetControlByName("FactionsTable");
m_tableFactions.SetColumnComparison(0, (a, b) => ((StringBuilder)a.UserData).CompareToIgnoreCase((StringBuilder)b.UserData));
m_tableFactions.SetColumnComparison(1, (a, b) => ((StringBuilder)a.UserData).CompareToIgnoreCase((StringBuilder)b.UserData));
m_tableFactions.ItemSelected += OnFactionsTableItemSelected;
RefreshTableFactions();
m_tableFactions.SortByColumn(1);
m_buttonCreate = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonCreate");
m_buttonJoin = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonJoin");
m_buttonCancelJoin = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonCancelJoin");
m_buttonLeave = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonLeave");
m_buttonSendPeace = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonSendPeace");
m_buttonCancelPeace = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonCancelPeace");
m_buttonAcceptPeace = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonAcceptPeace");
m_buttonMakeEnemy = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonEnemy");
m_buttonCreate.ShowTooltipWhenDisabled = true;
m_buttonCreate.TextEnum = MySpaceTexts.TerminalTab_Factions_Create;
m_buttonJoin.TextEnum = MySpaceTexts.TerminalTab_Factions_Join;
m_buttonCancelJoin.TextEnum = MySpaceTexts.TerminalTab_Factions_CancelJoin;
m_buttonLeave.TextEnum = MySpaceTexts.TerminalTab_Factions_Leave;
m_buttonSendPeace.TextEnum = MySpaceTexts.TerminalTab_Factions_Friend;
m_buttonCancelPeace.TextEnum = MySpaceTexts.TerminalTab_Factions_CancelPeaceRequest;
m_buttonAcceptPeace.TextEnum = MySpaceTexts.TerminalTab_Factions_AcceptPeaceRequest;
m_buttonMakeEnemy.TextEnum = MySpaceTexts.TerminalTab_Factions_Enemy;
m_buttonJoin.SetToolTip(MySpaceTexts.TerminalTab_Factions_JoinToolTip);
m_buttonSendPeace.SetToolTip(MySpaceTexts.TerminalTab_Factions_FriendToolTip);
m_buttonCreate.ButtonClicked += OnCreateClicked;
m_buttonJoin.ButtonClicked += OnJoinClicked;
m_buttonCancelJoin.ButtonClicked += OnCancelJoinClicked;
m_buttonLeave.ButtonClicked += OnLeaveClicked;
m_buttonSendPeace.ButtonClicked += OnFriendClicked;
m_buttonCancelPeace.ButtonClicked += OnCancelPeaceRequestClicked;
m_buttonAcceptPeace.ButtonClicked += OnAcceptFriendClicked;
m_buttonMakeEnemy.ButtonClicked += OnEnemyClicked;
// RIGHT SIDE
m_labelFactionName = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionName");
m_labelFactionDesc = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionDesc");
m_labelFactionPriv = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionPrivate");
m_labelMembers = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionMembers");
m_labelAutoAcceptMember = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionMembersAcceptEveryone");
m_labelAutoAcceptPeace = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionMembersAcceptPeace");
m_labelFactionDesc.Text = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_CreateFactionDescription).ToString();
m_labelFactionPriv.Text = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_Private).ToString();
m_labelMembers.Text = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_Members).ToString();
m_labelAutoAcceptMember.Text = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_AutoAccept).ToString();
m_labelAutoAcceptPeace.Text = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_AutoAcceptRequest).ToString();
m_labelAutoAcceptMember.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptToolTip);
m_labelAutoAcceptPeace.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptRequestToolTip);
m_textFactionDesc = (MyGuiControlMultilineText)controlsParent.Controls.GetControlByName("textFactionDesc");
m_textFactionPriv = (MyGuiControlMultilineText)controlsParent.Controls.GetControlByName("textFactionPrivate");
m_textFactionDesc.BackgroundTexture = MyGuiConstants.TEXTURE_HIGHLIGHT_DARK;
m_textFactionPriv.BackgroundTexture = MyGuiConstants.TEXTURE_HIGHLIGHT_DARK;
m_tableMembers = (MyGuiControlTable)controlsParent.Controls.GetControlByName("tableMembers");
m_tableMembers.SetColumnComparison(1, (a, b) => ((int)((MyMemberComparerEnum)a.UserData)).CompareTo((int)((MyMemberComparerEnum)b.UserData)));
m_tableMembers.ItemSelected += OnTableItemSelected;
m_checkAutoAcceptMember = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("checkFactionMembersAcceptEveryone");
m_checkAutoAcceptPeace = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("checkFactionMembersAcceptPeace");
m_checkAutoAcceptMember.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptToolTip);
m_checkAutoAcceptPeace.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptRequestToolTip);
m_checkAutoAcceptMember.IsCheckedChanged += OnAutoAcceptChanged;
m_checkAutoAcceptPeace.IsCheckedChanged += OnAutoAcceptChanged;
m_buttonEdit = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonEdit");
m_buttonPromote = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonPromote");
m_buttonKick = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonKick");
m_buttonAcceptJoin = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonAcceptJoin");
m_buttonDemote = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonDemote");
m_buttonAddNpc = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonAddNpc");
m_buttonEdit.TextEnum = MyCommonTexts.Edit;
m_buttonPromote.TextEnum = MyCommonTexts.Promote;
m_buttonKick.TextEnum = MyCommonTexts.Kick;
m_buttonAcceptJoin.TextEnum = MyCommonTexts.Accept;
m_buttonDemote.TextEnum = MyCommonTexts.Demote;
m_buttonAddNpc.TextEnum = MySpaceTexts.AddNpcToFaction;
m_buttonAddNpc.SetToolTip(MySpaceTexts.AddNpcToFactionHelp);
m_buttonEdit.ButtonClicked += OnCreateClicked;
m_buttonPromote.ButtonClicked += OnPromotePlayerClicked;
m_buttonKick.ButtonClicked += OnKickPlayerClicked;
m_buttonAcceptJoin.ButtonClicked += OnAcceptJoinClicked;
//.........这里部分代码省略.........
示例3: RecreateControls
public override void RecreateControls(bool constructor)
{
base.RecreateControls(constructor);
Vector2 cbOffset = new Vector2(-0.05f, 0.0f);
Vector2 controlPadding = new Vector2(0.02f, 0.02f); // X: Left & Right, Y: Bottom & Top
float textScale = 0.8f;
float separatorSize = 0.01f;
float usableWidth = SCREEN_SIZE.X - HIDDEN_PART_RIGHT - controlPadding.X * 2;
float hiddenPartTop = (SCREEN_SIZE.Y - 1.0f) / 2.0f - 0.02f;
m_currentPosition = -m_size.Value / 2.0f;
m_currentPosition += controlPadding;
m_currentPosition.Y += hiddenPartTop;
m_scale = textScale;
float y;
MyGuiControlButton btn;
///////////////////// SPACE MASTER /////////////////////
var caption = AddCaption(MySpaceTexts.ScreenDebugAdminMenu_Caption, m_labelColor, controlPadding + new Vector2(-HIDDEN_PART_RIGHT, hiddenPartTop));
m_currentPosition.Y += MyGuiConstants.SCREEN_CAPTION_DELTA_Y + separatorSize + controlPadding.Y;
m_creativeCheckbox = AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_EnableAdminMode, false, OnEnableAdminModeChanged, true, null, m_labelColor, cbOffset);
m_creativeCheckbox.SetToolTip(MyCommonTexts.ScreenDebugAdminMenu_EnableAdminMode_Tooltip);
m_creativeCheckbox.IsChecked = MySession.Static.IsAdminModeEnabled(Sync.MyId);
m_creativeCheckbox.Enabled = MySession.Static.IsAdmin;
///////////////////// CYCLING /////////////////////
AddSubcaption(MyCommonTexts.ScreenDebugAdminMenu_CycleObjects, m_labelColor, new Vector2(-HIDDEN_PART_RIGHT, -0.03f));
m_currentPosition.Y -= 0.065f;
CreateSelectionCombo();
m_labelCurrentIndex = AddLabel(String.Empty, m_labelColor, 1);
m_labelCurrentIndex.TextToDraw = new StringBuilder().AppendFormat(MyTexts.GetString(MyCommonTexts.ScreenDebugAdminMenu_CurrentValue), m_entityId == 0 ? "-" : m_metricValue.ToString());
y = m_currentPosition.Y;
btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_First, c => OnCycleClicked(true, true));
btn.PositionX = -usableWidth / 3 - controlPadding.X;
m_currentPosition.Y = y;
btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Next, c => OnCycleClicked(false, false));
btn.PositionX = -controlPadding.X + separatorSize / 2;
m_currentPosition.Y = y;
btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Previous, c => OnCycleClicked(false, true));
btn.PositionX = usableWidth / 3 - controlPadding.X + separatorSize;
y = m_currentPosition.Y;
m_removeItemButton = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Remove, c => OnEntityRemoveClicked(MyTrashRemovalOperation.Remove));
m_removeItemButton.PositionX = -usableWidth / 3 - controlPadding.X;
m_currentPosition.Y = y;
btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Stop, c => OnEntityRemoveClicked(MyTrashRemovalOperation.Stop));
btn.PositionX = -controlPadding.X + separatorSize / 2;
m_currentPosition.Y = y;
CreateDepowerButton(usableWidth, controlPadding.X, separatorSize);
CreateDebugButton(usableWidth, MyCommonTexts.SpectatorControls_None, OnPlayerControl, true, MySpaceTexts.SpectatorControls_None_Desc);
m_onlySmallGridsCheckbox = AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_SmallGrids, false, OnSmallGridChanged, true, null, m_labelColor, cbOffset);
m_onlySmallGridsCheckbox.SetToolTip(MyCommonTexts.ScreenDebugAdminMenu_EnableAdminMode_Tooltip);
m_onlyLargeGridsCheckbox = AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_LargeGrids, false, OnLargeGridChanged, true, null, m_labelColor, cbOffset);
m_onlyLargeGridsCheckbox.IsChecked = m_cyclingOtions.OnlyLargeGrids;
m_onlySmallGridsCheckbox.IsChecked = m_cyclingOtions.OnlySmallGrids;
///////////////////// TRASH /////////////////////
AddSubcaption(MyCommonTexts.ScreenDebugAdminMenu_TrashRemoval, m_labelColor, new Vector2(-HIDDEN_PART_RIGHT, -0.03f));
m_currentPosition.Y -= 0.065f;
//AddLabel("Select which objects WON'T be removed", white, 1);
CreateTrashCheckBoxes(ref cbOffset, ref m_labelColor);
var blockCountLabelText = string.Format(MyTexts.GetString(MyCommonTexts.ScreenDebugAdminMenu_WithBlockCount), String.Empty);
AddLabel(blockCountLabelText, m_labelColor, 1);
var blockCount = AddTextbox(MyTrashRemoval.PreviewSettings.BlockCountThreshold.ToString(), OnBlockCountChanged, m_labelColor, 0.9f, MyGuiControlTextboxType.DigitsOnly);
var distancePlayerText = string.Format(MyTexts.GetString(MyCommonTexts.ScreenDebugAdminMenu_DistanceFromPlayer), String.Empty);
AddLabel(distancePlayerText, m_labelColor, 1);
AddTextbox(MyTrashRemoval.PreviewSettings.PlayerDistanceThreshold.ToString(), OnDistanceChanged, m_labelColor, 0.9f, MyGuiControlTextboxType.DigitsOnly);
m_labelNumVisible = AddLabel(MyCommonTexts.ScreenDebugAdminMenu_DistanceFromPlayer.ToString(), m_labelColor, 1);
m_labelNumVisible.TextToDraw = new StringBuilder();
AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_ShowTrashAdminView, () => MyTrashRemoval.PreviewEnabled, v => MyTrashRemoval.PreviewEnabled = v, true, null, m_labelColor, cbOffset);
y = m_currentPosition.Y;
btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_RemoveTrash, c => OnTrashRemoveClicked(MyTrashRemovalOperation.Remove));
btn.PositionX = -usableWidth / 3 - controlPadding.X;
m_currentPosition.Y = y;
btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_StopTrash, c => OnTrashRemoveClicked(MyTrashRemovalOperation.Stop));
btn.PositionX = -controlPadding.X + separatorSize / 2;
//.........这里部分代码省略.........
示例4: CreateGpsPageControls
//.........这里部分代码省略.........
//size: new Vector2(0.4f, 0.035f)
)
{
Name = "labelInsZ",
};
left += gpsLabelX.Size.X + spacingH;
var gpsZCoord = new MyGuiControlTextbox()
{
OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
Position = new Vector2(left, top),
Size = new Vector2((gpsComposite.Size.X - spacingH) / 3 - 2 * spacingH - gpsLabelX.Size.X, 0.035f),
Name = "textInsZ"
};
top += gpsNamePanel.Size.Y + (2f * spacingV);
//BUTTONS:
left = spacingH-0.15f;
//SHOW ON HUD & COPY TO CLIPBOARD:
var checkGpsShowOnHud = new MyGuiControlCheckbox(
originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
position: new Vector2(left, top)
) { Name = "checkInsShowOnHud" };
var labelGpsShowOnHud = new MyGuiControlLabel(
originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
position: new Vector2(left+ checkGpsShowOnHud.Size.X + spacingH, top),
size: checkGpsShowOnHud.Size - new Vector2(0.01f, 0.01f)
)
{
Name = "labelInsShowOnHud",
Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_ShowOnHud).ToString()
};
var toClipboardButton = new MyGuiControlButton(
position: new Vector2(gpsComposite.Position.X+gpsComposite.Size.X-spacingH, top),
visualStyle: MyGuiControlButtonStyleEnum.Rectangular,
size: new Vector2(300f, 48f) / MyGuiConstants.GUI_OPTIMAL_SIZE,
text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_CopyToClipboard),
originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER)
{
Name = "buttonToClipboard"
};
top += toClipboardButton.Size.Y * 1.1f;
var checkGpsAlwaysVisible = new MyGuiControlCheckbox(
originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
position: new Vector2(left, top)
)
{
Name = "checkInsAlwaysVisible",
};
checkGpsAlwaysVisible.SetToolTip(MySpaceTexts.TerminalTab_GPS_AlwaysVisible_Tooltip);
var labelGpsAlwaysVisible = new MyGuiControlLabel(
originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
position: new Vector2(left + checkGpsShowOnHud.Size.X + spacingH, top),
size: checkGpsShowOnHud.Size - new Vector2(0.01f, 0.01f)
)
{
Name = "labelInsAlwaysVisible",
Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_AlwaysVisible).ToString()
};
labelGpsAlwaysVisible.SetToolTip(MySpaceTexts.TerminalTab_GPS_AlwaysVisible_Tooltip);
top += checkGpsShowOnHud.Size.Y;
var labelIllegalDataWarning = new MyGuiControlLabel(
originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
position: new Vector2(left + spacingH, top),
size: new Vector2(gpsComposite.Size.X - 0.012f, 0.035f)
)
{
Name = "TerminalTab_GPS_SaveWarning",
Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_SaveWarning).ToString(),
ColorMask = Color.Red.ToVector4()
};
gpsPage.Controls.Add(gpsComposite);
gpsPage.Controls.Add(gpsNamePanel);
gpsPage.Controls.Add(gpsNameLabel);
gpsPage.Controls.Add(gpsDescLabel);
gpsPage.Controls.Add(gpsDescText);
gpsPage.Controls.Add(gpsLabelX);
gpsPage.Controls.Add(gpsXCoord);
gpsPage.Controls.Add(gpsLabelY);
gpsPage.Controls.Add(gpsYCoord);
gpsPage.Controls.Add(gpsLabelZ);
gpsPage.Controls.Add(gpsZCoord);
gpsPage.Controls.Add(toClipboardButton);
gpsPage.Controls.Add(checkGpsShowOnHud);
gpsPage.Controls.Add(labelGpsShowOnHud);
gpsPage.Controls.Add(labelIllegalDataWarning);
gpsPage.Controls.Add(checkGpsAlwaysVisible);
gpsPage.Controls.Add(labelGpsAlwaysVisible);
}
示例5: BuildControls
//.........这里部分代码省略.........
labelText: new StringBuilder("{0}").ToString(),
labelDecimalPlaces: 0,
labelSpaceWidth: 0.05f,
intValue: true
);
m_maxFloatingObjectsSlider = new MyGuiControlSlider(
position: Vector2.Zero,
width: m_onlineMode.Size.X,
minValue: 16,
maxValue: 1024,
labelText: new StringBuilder("{0}").ToString(),
labelDecimalPlaces: 0,
labelSpaceWidth: 0.05f,
intValue: true
);
m_startInRespawnScreen = new MyGuiControlCheckbox();
m_enableVoxelDestruction = new MyGuiControlCheckbox();
m_trashRemoval = new MyGuiControlCheckbox();
m_respawnShipDelete = new MyGuiControlCheckbox();
m_worldSizeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_soundModeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_spawnShipTimeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_viewDistanceCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_physicsOptionsCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
// Ok/Cancel
m_okButton = new MyGuiControlButton(position: buttonsOrigin - new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.Ok), onButtonClick: OkButtonClicked, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
m_cancelButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.Cancel), onButtonClick: CancelButtonClicked, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);
m_creativeModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_GameModeCreative), onButtonClick: CreativeClicked);
m_creativeModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeCreative);
m_survivalModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_GameModeSurvival), onButtonClick: SurvivalClicked);
m_survivalModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeSurvival);
m_inventory_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnInventoryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_inventory_x3 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x3), onButtonClick: OnInventoryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_inventory_x10 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x10), onButtonClick: OnInventoryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_inventory_x1.UserData = 1.0f;
m_inventory_x3.UserData = 3.0f;
m_inventory_x10.UserData = 10.0f;
m_inventory_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Inventory_x1);
m_inventory_x3.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Inventory_x3);
m_inventory_x10.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Inventory_x10);
m_assembler_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnAssemblerClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_assembler_x3 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x3), onButtonClick: OnAssemblerClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_assembler_x10 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x10), onButtonClick: OnAssemblerClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_assembler_x1.UserData = 1.0f;
m_assembler_x3.UserData = 3.0f;
m_assembler_x10.UserData = 10.0f;
m_assembler_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Assembler_x1);
m_assembler_x3.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Assembler_x3);
m_assembler_x10.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Assembler_x10);
m_refinery_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnRefineryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_refinery_x3 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x3), onButtonClick: OnRefineryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_refinery_x10 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x10), onButtonClick: OnRefineryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
m_refinery_x1.UserData = 1.0f;
m_refinery_x3.UserData = 3.0f;
m_refinery_x10.UserData = 10.0f;
m_refinery_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Refinery_x1);
m_refinery_x3.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Refinery_x3);
m_refinery_x10.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Refinery_x10);
示例6: RecreateControls
public override void RecreateControls(bool constructor)
{
float width = 0.284375f + 0.025f;
base.RecreateControls(constructor);
AddCaption(MySpaceTexts.ScreenCaptionWorldGeneratorSettings);
m_moonMinSizeSlider = new MyGuiControlSlider(
position: Vector2.Zero,
width: width,
minValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MIN_LIMIT,
maxValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MAX_LIMIT,
labelText: new StringBuilder("{0} m").ToString(),
labelDecimalPlaces: 0,
labelSpaceWidth: 0.09f,
intValue: true
);
m_moonMinSizeSlider.ValueChanged += (x) =>
{
if (x.Value > m_moonMaxSizeSlider.Value)
{
m_moonMaxSizeSlider.Value = x.Value;
}
};
m_moonMaxSizeSlider = new MyGuiControlSlider(
position: Vector2.Zero,
width: width,
minValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MIN_LIMIT,
maxValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MAX_LIMIT,
labelText: new StringBuilder("{0} m").ToString(),
labelDecimalPlaces: 0,
labelSpaceWidth: 0.09f,
intValue: true
);
m_moonMaxSizeSlider.ValueChanged += (x) =>
{
if (x.Value < m_moonMinSizeSlider.Value)
{
m_moonMinSizeSlider.Value = x.Value;
}
};
m_planetMinSizeSlider = new MyGuiControlSlider(
position: Vector2.Zero,
width: width,
minValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MIN_LIMIT,
maxValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MAX_LIMIT,
labelText: new StringBuilder("{0} m").ToString(),
labelDecimalPlaces: 0,
labelSpaceWidth: 0.09f,
intValue: true
);
m_planetMinSizeSlider.ValueChanged += (x) =>
{
if (x.Value > m_planetMaxSizeSlider.Value)
{
m_planetMaxSizeSlider.Value = x.Value;
}
};
m_planetMaxSizeSlider = new MyGuiControlSlider(
position: Vector2.Zero,
width: width,
minValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MIN_LIMIT,
maxValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MAX_LIMIT,
labelText: new StringBuilder("{0} m").ToString(),
labelDecimalPlaces: 0,
labelSpaceWidth: 0.09f,
intValue: true
);
m_planetMaxSizeSlider.ValueChanged += (x) =>
{
if (x.Value < m_planetMinSizeSlider.Value)
{
m_planetMinSizeSlider.Value = x.Value;
}
};
m_asteroidAmountLabel = MakeLabel(MySpaceTexts.Asteroid_Amount);
m_asteroidAmountCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
m_asteroidAmountCombo.ItemSelected += m_asteroidAmountCombo_ItemSelected;
m_asteroidAmountCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsAsteroidAmount));
m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.Normal, MySpaceTexts.WorldSettings_AsteroidAmountNormal);
m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.More, MySpaceTexts.WorldSettings_AsteroidAmountLarge);
if (Environment.Is64BitProcess)
m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.Many, MySpaceTexts.WorldSettings_AsteroidAmountExtreme);
if (MyFakes.ENABLE_ASTEROID_FIELDS)
{
m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.ProceduralLow, MySpaceTexts.WorldSettings_AsteroidAmountProceduralLow);
m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.ProceduralNormal, MySpaceTexts.WorldSettings_AsteroidAmountProceduralNormal);
if (Environment.Is64BitProcess)
//.........这里部分代码省略.........