This commit is contained in:
@@ -167,7 +167,7 @@ namespace Barotrauma
|
||||
foreach (GUITickBox tickBox in missionTickBoxes)
|
||||
{
|
||||
bool disable = hasMaxMissions && !tickBox.Selected;
|
||||
tickBox.Enabled = Campaign.AllowedToManageCampaign(ClientPermissions.ManageMap) && !disable;
|
||||
tickBox.Enabled = CampaignMode.AllowedToManageCampaign(ClientPermissions.ManageMap) && !disable;
|
||||
tickBox.Box.DisabledColor = disable ? tickBox.Box.Color * 0.5f : tickBox.Box.Color * 0.8f;
|
||||
foreach (GUIComponent child in tickBox.Parent.Parent.Children)
|
||||
{
|
||||
@@ -315,7 +315,7 @@ namespace Barotrauma
|
||||
if (GUI.MouseOn == tickBox) { return false; }
|
||||
if (tickBox != null)
|
||||
{
|
||||
if (Campaign.AllowedToManageCampaign(ClientPermissions.ManageMap) && tickBox.Enabled)
|
||||
if (CampaignMode.AllowedToManageCampaign(ClientPermissions.ManageMap) && tickBox.Enabled)
|
||||
{
|
||||
tickBox.Selected = !tickBox.Selected;
|
||||
}
|
||||
@@ -356,10 +356,10 @@ namespace Barotrauma
|
||||
};
|
||||
tickBox.RectTransform.MinSize = new Point(tickBox.Rect.Height, 0);
|
||||
tickBox.RectTransform.IsFixedSize = true;
|
||||
tickBox.Enabled = Campaign.AllowedToManageCampaign(ClientPermissions.ManageMap);
|
||||
tickBox.Enabled = CampaignMode.AllowedToManageCampaign(ClientPermissions.ManageMap);
|
||||
tickBox.OnSelected += (GUITickBox tb) =>
|
||||
{
|
||||
if (!Campaign.AllowedToManageCampaign(Networking.ClientPermissions.ManageMap)) { return false; }
|
||||
if (!CampaignMode.AllowedToManageCampaign(Networking.ClientPermissions.ManageMap)) { return false; }
|
||||
|
||||
if (tb.Selected)
|
||||
{
|
||||
@@ -379,7 +379,7 @@ namespace Barotrauma
|
||||
UpdateMaxMissions(connection.OtherLocation(currentDisplayLocation));
|
||||
|
||||
if ((Campaign is MultiPlayerCampaign multiPlayerCampaign) && !multiPlayerCampaign.SuppressStateSending &&
|
||||
Campaign.AllowedToManageCampaign(Networking.ClientPermissions.ManageMap))
|
||||
CampaignMode.AllowedToManageCampaign(Networking.ClientPermissions.ManageMap))
|
||||
{
|
||||
GameMain.Client?.SendCampaignState();
|
||||
}
|
||||
@@ -500,7 +500,7 @@ namespace Barotrauma
|
||||
return true;
|
||||
},
|
||||
Enabled = true,
|
||||
Visible = Campaign.AllowedToManageCampaign(ClientPermissions.ManageMap)
|
||||
Visible = CampaignMode.AllowedToManageCampaign(ClientPermissions.ManageMap)
|
||||
};
|
||||
|
||||
buttonArea.RectTransform.MinSize = new Point(0, StartButton.RectTransform.MinSize.Y);
|
||||
|
||||
@@ -351,7 +351,7 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
if (string.IsNullOrEmpty(contentPackageNameElement.Text))
|
||||
{
|
||||
contentPackageNameElement.Flash();
|
||||
contentPackageNameElement.Flash(useRectangleFlash: true);
|
||||
return false;
|
||||
}
|
||||
if (ContentPackageManager.AllPackages.Any(cp => cp.Name.ToLower() == contentPackageNameElement.Text.ToLower()))
|
||||
@@ -405,7 +405,7 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
if (ContentPackage == null)
|
||||
{
|
||||
contentPackageDropDown.Flash();
|
||||
contentPackageDropDown.Flash(useRectangleFlash: true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace Barotrauma.CharacterEditor
|
||||
if (!File.Exists(evaluatedTexturePath))
|
||||
{
|
||||
GUI.AddMessage(GetCharacterEditorTranslation("TextureDoesNotExist"), GUIStyle.Red);
|
||||
texturePathElement.Flash(GUIStyle.Red);
|
||||
texturePathElement.Flash(useRectangleFlash: true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -425,7 +425,7 @@ namespace Barotrauma.CharacterEditor
|
||||
if (!path.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
GUI.AddMessage(TextManager.Get("WrongFileType"), GUIStyle.Red);
|
||||
texturePathElement.Flash(GUIStyle.Red);
|
||||
texturePathElement.Flash(useRectangleFlash: true);
|
||||
return false;
|
||||
}
|
||||
if (IsCopy)
|
||||
@@ -486,7 +486,8 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
PlaySoundOnSelect = true,
|
||||
};
|
||||
var removeLimbButton = new GUIButton(new RectTransform(new Vector2(0.05f, 1.0f), limbEditLayout.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIMinusButton")
|
||||
var limbButtonSize = Vector2.One * 0.8f;
|
||||
var removeLimbButton = new GUIButton(new RectTransform(limbButtonSize, limbEditLayout.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIMinusButton")
|
||||
{
|
||||
OnClicked = (b, d) =>
|
||||
{
|
||||
@@ -497,7 +498,7 @@ namespace Barotrauma.CharacterEditor
|
||||
return true;
|
||||
}
|
||||
};
|
||||
var addLimbButton = new GUIButton(new RectTransform(new Vector2(0.05f, 1.0f), limbEditLayout.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIPlusButton")
|
||||
var addLimbButton = new GUIButton(new RectTransform(limbButtonSize, limbEditLayout.RectTransform, scaleBasis: ScaleBasis.BothHeight), style: "GUIPlusButton")
|
||||
{
|
||||
OnClicked = (b, d) =>
|
||||
{
|
||||
|
||||
@@ -1817,7 +1817,11 @@ namespace Barotrauma
|
||||
subList = dropDown.ListBox.Content;
|
||||
}
|
||||
|
||||
var frame = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.15f), subList.RectTransform) { MinSize = new Point(0, 25) },
|
||||
var frame = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.1f), subList.RectTransform)
|
||||
{
|
||||
//enough space for 2 lines (price and class) + some padding
|
||||
MinSize = new Point(0, (int)(GUIStyle.SmallFont.LineHeight * 2.3f))
|
||||
},
|
||||
style: "ListBoxElement")
|
||||
{
|
||||
ToolTip = sub.Description,
|
||||
|
||||
+15
-2
@@ -7,6 +7,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -953,8 +955,19 @@ namespace Barotrauma
|
||||
okButton.Enabled = false;
|
||||
okButton.OnClicked = (btn, userdata) =>
|
||||
{
|
||||
if (!Endpoint.Parse(endpointBox.Text).TryUnwrap(out var endpoint)) { return false; }
|
||||
JoinServer(endpoint, "");
|
||||
if (Endpoint.Parse(endpointBox.Text).TryUnwrap(out var endpoint))
|
||||
{
|
||||
JoinServer(endpoint, "");
|
||||
}
|
||||
else if (LidgrenEndpoint.ParseFromWithHostNameCheck(endpointBox.Text, tryParseHostName: true).TryUnwrap(out var lidgrenEndpoint))
|
||||
{
|
||||
JoinServer(lidgrenEndpoint, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
new GUIMessageBox(TextManager.Get("error"), TextManager.GetWithVariable("invalidipaddress", "[serverip]:[port]", endpointBox.Text));
|
||||
endpointBox.Flash();
|
||||
}
|
||||
msgBox.Close();
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -1926,9 +1926,15 @@ namespace Barotrauma
|
||||
{
|
||||
filePath = $"{ContentPath.ModDirStr}/{filePath[packageDir.Length..]}";
|
||||
}
|
||||
if (!modProject.Files.Any(f => f.Type == subFileType &&
|
||||
f.Path == filePath))
|
||||
if (!modProject.Files.Any(f => f.Type == subFileType && f.Path == filePath))
|
||||
{
|
||||
//check if there's a file with the same name but different filename case
|
||||
var matchingFile = modProject.Files.FirstOrDefault(f => f.Type == subFileType && filePath.CleanUpPath().Equals(f.Path.CleanUpPath(), StringComparison.OrdinalIgnoreCase));
|
||||
if (matchingFile != null)
|
||||
{
|
||||
File.Delete(matchingFile.Path.Replace(ContentPath.ModDirStr, packageDir));
|
||||
modProject.RemoveFile(matchingFile);
|
||||
}
|
||||
var newFile = ModProject.File.FromPath(filePath, subFileType);
|
||||
modProject.AddFile(newFile);
|
||||
}
|
||||
@@ -2485,7 +2491,7 @@ namespace Barotrauma
|
||||
|
||||
new GUINumberInput(new RectTransform(new Vector2(0.4f, 1.0f), tierGroup.RectTransform), NumberType.Int)
|
||||
{
|
||||
IntValue = SubmarineInfo.GetDefaultTier(MainSub.Info.Price),
|
||||
IntValue = MainSub.Info.Tier,
|
||||
MinValueInt = 1,
|
||||
MaxValueInt = 3,
|
||||
OnValueChanged = (numberInput) =>
|
||||
@@ -2827,6 +2833,7 @@ namespace Barotrauma
|
||||
OnClicked = (button, o) =>
|
||||
{
|
||||
var requiredPackages = MapEntity.mapEntityList.Select(e => e.Prefab.ContentPackage)
|
||||
.Where(cp => cp != null)
|
||||
.Distinct().OfType<ContentPackage>().Select(p => p.Name).ToHashSet();
|
||||
var tickboxes = requiredContentPackList.Content.Children.OfType<GUITickBox>().ToArray();
|
||||
tickboxes.ForEach(tb => tb.Selected = requiredPackages.Contains(tb.UserData as string ?? ""));
|
||||
@@ -2925,7 +2932,7 @@ namespace Barotrauma
|
||||
|
||||
subTypeDropdown.SelectItem(MainSub.Info.Type);
|
||||
|
||||
if (quickSave) { SaveSub(null); }
|
||||
if (quickSave) { SaveSub(packageToSaveInList.SelectedData as ContentPackage); }
|
||||
}
|
||||
|
||||
private void CreateSaveAssemblyScreen()
|
||||
|
||||
Reference in New Issue
Block a user