This commit is contained in:
Evil Factory
2022-07-14 12:25:44 -03:00
86 changed files with 839 additions and 412 deletions
@@ -275,7 +275,7 @@ namespace Barotrauma
{
GUILayoutGroup inputContainer = CreateSettingBase(parent, description, tooltip, horizontalSize: 0.55f, verticalSize: verticalSize);
GUIButton minusButton = new GUIButton(new RectTransform(Vector2.One, inputContainer.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIMinusButton", textAlignment: Alignment.Center) { UserData = -1 };
GUIButton minusButton = new GUIButton(new RectTransform(Vector2.One, inputContainer.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIButtonToggleLeft", textAlignment: Alignment.Center) { UserData = -1 };
GUIFrame inputFrame = new GUIFrame(new RectTransform(Vector2.One, inputContainer.RectTransform), style: null);
GUINumberInput numberInput = new GUINumberInput(new RectTransform(Vector2.One, inputFrame.RectTransform, Anchor.Center), NumberType.Int, textAlignment: Alignment.Center, style: "GUITextBox", hidePlusMinusButtons: true)
{
@@ -290,7 +290,7 @@ namespace Barotrauma
CanBeFocused = false
};
GUIButton plusButton = new GUIButton(new RectTransform(Vector2.One, inputContainer.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIPlusButton", textAlignment: Alignment.Center) { UserData = 1 };
GUIButton plusButton = new GUIButton(new RectTransform(Vector2.One, inputContainer.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIButtonToggleRight", textAlignment: Alignment.Center) { UserData = 1 };
minusButton.OnClicked = plusButton.OnClicked = ChangeValue;
@@ -235,13 +235,6 @@ namespace Barotrauma
}
};
var disclaimerBtn = new GUIButton(new RectTransform(new Vector2(1.0f, 0.8f), rightColumn.RectTransform, Anchor.TopRight) { AbsoluteOffset = new Point(5) }, style: "GUINotificationButton")
{
IgnoreLayoutGroups = true,
OnClicked = (btn, userdata) => { GameMain.Instance.ShowCampaignDisclaimer(); return true; }
};
disclaimerBtn.RectTransform.MaxSize = new Point((int)(30 * GUI.Scale));
columnContainer.Recalculate();
leftColumn.Recalculate();
rightColumn.Recalculate();
@@ -57,8 +57,8 @@ namespace Barotrauma
CreateUI(container);
campaign.Map.OnLocationSelected += SelectLocation;
campaign.Map.OnMissionsSelected += (connection, missions) =>
campaign.Map.OnLocationSelected = SelectLocation;
campaign.Map.OnMissionsSelected = (connection, missions) =>
{
if (missionList?.Content != null)
{
@@ -608,12 +608,6 @@ namespace Barotrauma
ShowTutorialSkipWarning(Tab.NewGame);
return true;
}
if (!GameSettings.CurrentConfig.CampaignDisclaimerShown)
{
selectedTab = Tab.Empty;
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.NewGame); });
return true;
}
campaignSetupUI.RandomizeCrew();
campaignSetupUI.SetPage(0);
campaignSetupUI.CreateDefaultSaveName();
@@ -633,12 +627,6 @@ namespace Barotrauma
ShowTutorialSkipWarning(Tab.JoinServer);
return true;
}
if (!GameSettings.CurrentConfig.CampaignDisclaimerShown)
{
selectedTab = Tab.Empty;
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.JoinServer); });
return true;
}
GameMain.ServerListScreen.Select();
break;
case Tab.HostServer:
@@ -648,13 +636,6 @@ namespace Barotrauma
ShowTutorialSkipWarning(tab);
return true;
}
if (!GameSettings.CurrentConfig.CampaignDisclaimerShown)
{
selectedTab = Tab.Empty;
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.HostServer); });
return true;
}
serverExecutableDropdown.ListBox.Content.Children.ToArray()
.Where(c => c.UserData is ServerExecutableFile f && !ContentPackageManager.EnabledPackages.All.Contains(f.ContentPackage))
.ForEach(serverExecutableDropdown.ListBox.RemoveChild);
@@ -685,12 +666,6 @@ namespace Barotrauma
}
break;
case Tab.Tutorials:
if (!GameSettings.CurrentConfig.CampaignDisclaimerShown)
{
selectedTab = Tab.Empty;
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.Tutorials); });
return true;
}
UpdateTutorialList();
break;
case Tab.CharacterEditor:
@@ -921,7 +921,7 @@ namespace Barotrauma
toggleEntityMenuButton = new GUIButton(new RectTransform(new Vector2(0.15f, 0.08f), EntityMenu.RectTransform, Anchor.TopCenter, Pivot.BottomCenter) { MinSize = new Point(0, 15) },
style: "UIToggleButtonVertical")
{
ToolTip = RichString.Rich(TextManager.Get("EntityMenuToggleTooltip") + "‖color:125,125,125‖\nQ‖color:end‖"),
ToolTip = RichString.Rich($"{TextManager.Get("EntityMenuToggleTooltip")}\n‖color:125,125,125‖{GameSettings.CurrentConfig.KeyMap.Bindings[InputType.ToggleInventory].Name}‖color:end‖"),
OnClicked = (btn, userdata) =>
{
entityMenuOpen = !entityMenuOpen;
@@ -1822,7 +1822,7 @@ namespace Barotrauma
{
if (Submarine.GetLightCount() > MaxLights)
{
new GUIMessageBox(TextManager.Get("error"), TextManager.GetWithVariable("subeditor.lightcounterror", "[max]", MaxShadowCastingLights.ToString()));
new GUIMessageBox(TextManager.Get("error"), TextManager.GetWithVariable("subeditor.lightcounterror", "[max]", MaxLights.ToString()));
return false;
}
@@ -2530,6 +2530,27 @@ namespace Barotrauma
}
};
var outFittingArea = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.25f), subSettingsContainer.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft)
{
Stretch = true,
AbsoluteSpacing = 5
};
new GUITextBlock(new RectTransform(new Vector2(0.6f, 1.0f), outFittingArea.RectTransform),
TextManager.Get("ManuallyOutfitted"), textAlignment: Alignment.CenterLeft, wrap: true, font: GUIStyle.SmallFont)
{
ToolTip = TextManager.Get("manuallyoutfittedtooltip")
};
new GUITickBox(new RectTransform((0.4f, 1.0f), outFittingArea.RectTransform), "")
{
ToolTip = TextManager.Get("manuallyoutfittedtooltip"),
Selected = MainSub.Info.IsManuallyOutfitted,
OnSelected = box =>
{
MainSub.Info.IsManuallyOutfitted = box.Selected;
return true;
}
};
if (MainSub != null)
{
int min = MainSub.Info.RecommendedCrewSizeMin;
@@ -2832,7 +2853,7 @@ namespace Barotrauma
};
var saveButton = new GUIButton(new RectTransform(new Vector2(0.3f, 1.0f), buttonArea.RectTransform, Anchor.BottomRight),
TextManager.Get("SaveSubButton"))
TextManager.Get("SaveSubButton").Fallback(TextManager.Get("save")))
{
OnClicked = (button, o) => SaveSub(packageToSaveInList.SelectedData as ContentPackage)
};
@@ -3510,8 +3531,11 @@ namespace Barotrauma
modProject.RemoveFile(modProject.Files.First(f => ContentPath.FromRaw(subPackage, f.Path) == sub.FilePath));
modProject.Save(subPackage.Path);
ReloadModifiedPackage(subPackage);
}
if (MainSub?.Info != null && MainSub.Info.FilePath == sub.FilePath)
{
MainSub.Info.FilePath = null;
}
}
sub.Dispose();
CreateLoadScreen();
}
@@ -5044,8 +5068,8 @@ namespace Barotrauma
hullVolumeFrame.Visible = MapEntity.SelectedList.Any(s => s is Hull);
hullVolumeFrame.RectTransform.AbsoluteOffset = new Point(Math.Max(showEntitiesPanel.Rect.Right, previouslyUsedPanel.Rect.Right), 0);
saveAssemblyFrame.Visible = MapEntity.SelectedList.Count > 0;
snapToGridFrame.Visible = MapEntity.SelectedList.Count > 0;
saveAssemblyFrame.Visible = MapEntity.SelectedList.Count > 0 && !WiringMode;
snapToGridFrame.Visible = MapEntity.SelectedList.Count > 0 && !WiringMode;
var offset = cam.WorldView.Top - cam.ScreenToWorld(new Vector2(0, GameMain.GraphicsHeight - EntityMenu.Rect.Top)).Y;
@@ -5171,7 +5195,7 @@ namespace Barotrauma
}
}
if (PlayerInput.KeyHit(Keys.Q) && mode == Mode.Default)
if (GameSettings.CurrentConfig.KeyMap.Bindings[InputType.ToggleInventory].IsHit() && mode == Mode.Default)
{
toggleEntityMenuButton.OnClicked?.Invoke(toggleEntityMenuButton, toggleEntityMenuButton.UserData);
}