@@ -318,9 +318,10 @@ namespace Barotrauma
|
||||
|
||||
if (MapGenerationParams.Instance.RadiationParams != null)
|
||||
{
|
||||
bool prevRadiationToggleEnabled = EnableRadiationToggle?.Selected ?? true;
|
||||
EnableRadiationToggle = new GUITickBox(new RectTransform(new Vector2(0.3f, 0.3f), CampaignSettingsContent.RectTransform), TextManager.Get("CampaignOption.EnableRadiation"), font: GUI.Style.Font)
|
||||
{
|
||||
Selected = true,
|
||||
Selected = prevRadiationToggleEnabled,
|
||||
ToolTip = TextManager.Get("campaignoption.enableradiation.tooltip")
|
||||
};
|
||||
}
|
||||
@@ -340,7 +341,9 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
};
|
||||
MaxMissionCountText = new GUITextBlock(new RectTransform(new Vector2(0.7f, 1.0f), maxMissionCountContainer.RectTransform), CampaignSettings.DefaultMaxMissionCount.ToString(), textAlignment: Alignment.Center, style: "GUITextBox");
|
||||
|
||||
string prevMaxMissionCountText = MaxMissionCountText?.Text ?? CampaignSettings.DefaultMaxMissionCount.ToString();
|
||||
MaxMissionCountText = new GUITextBlock(new RectTransform(new Vector2(0.7f, 1.0f), maxMissionCountContainer.RectTransform), prevMaxMissionCountText, textAlignment: Alignment.Center, style: "GUITextBox");
|
||||
maxMissionCountButtons[1] = new GUIButton(new RectTransform(new Vector2(0.15f, 0.8f), maxMissionCountContainer.RectTransform), style: "GUIButtonToggleRight")
|
||||
{
|
||||
OnClicked = (button, obj) =>
|
||||
@@ -806,11 +809,12 @@ namespace Barotrauma
|
||||
UserData = "savefileframe"
|
||||
};
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1, 0.2f), saveFileFrame.RectTransform, Anchor.TopCenter)
|
||||
var titleText = new GUITextBlock(new RectTransform(new Vector2(0.9f, 0.2f), saveFileFrame.RectTransform, Anchor.TopCenter)
|
||||
{
|
||||
RelativeOffset = new Vector2(0, 0.05f)
|
||||
},
|
||||
Path.GetFileNameWithoutExtension(fileName), font: GUI.LargeFont, textAlignment: Alignment.Center);
|
||||
titleText.Text = ToolBox.LimitString(titleText.Text, titleText.Font, titleText.Rect.Width);
|
||||
|
||||
var layoutGroup = new GUILayoutGroup(new RectTransform(new Vector2(0.8f, 0.5f), saveFileFrame.RectTransform, Anchor.Center)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Barotrauma
|
||||
|
||||
private GUIListBox missionList;
|
||||
private readonly List<GUITickBox> missionTickBoxes = new List<GUITickBox>();
|
||||
private readonly List<GUITextBlock> missionRewardTexts = new List<GUITextBlock>();
|
||||
|
||||
private bool hasMaxMissions;
|
||||
|
||||
@@ -368,6 +369,7 @@ namespace Barotrauma
|
||||
public void SelectLocation(Location location, LocationConnection connection)
|
||||
{
|
||||
missionTickBoxes.Clear();
|
||||
missionRewardTexts.Clear();
|
||||
locationInfoPanel.ClearChildren();
|
||||
//don't select the map panel if we're looking at some other tab
|
||||
if (selectedTab == CampaignMode.InteractionType.Map)
|
||||
@@ -524,6 +526,12 @@ namespace Barotrauma
|
||||
Campaign.Map.CurrentLocation.DeselectMission(mission);
|
||||
}
|
||||
|
||||
foreach (GUITextBlock rewardText in missionRewardTexts)
|
||||
{
|
||||
Mission otherMission = rewardText.UserData as Mission;
|
||||
rewardText.SetRichText(otherMission.GetMissionRewardText(Submarine.MainSub));
|
||||
}
|
||||
|
||||
UpdateMaxMissions(connection.OtherLocation(currentDisplayLocation));
|
||||
|
||||
if ((Campaign is MultiPlayerCampaign multiPlayerCampaign) && !multiPlayerCampaign.SuppressStateSending &&
|
||||
@@ -567,7 +575,11 @@ namespace Barotrauma
|
||||
//spacing
|
||||
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.0f), missionTextContent.RectTransform) { MinSize = new Point(0, GUI.IntScale(10)) }, style: null);
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), missionTextContent.RectTransform), mission.GetMissionRewardText(Submarine.MainSub), wrap: true, parseRichText: true);
|
||||
var rewardText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), missionTextContent.RectTransform), mission.GetMissionRewardText(Submarine.MainSub), wrap: true, parseRichText: true)
|
||||
{
|
||||
UserData = mission
|
||||
};
|
||||
missionRewardTexts.Add(rewardText);
|
||||
|
||||
string reputationText = mission.GetReputationRewardText(mission.Locations[0]);
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), missionTextContent.RectTransform), reputationText, wrap: true, parseRichText: true);
|
||||
|
||||
@@ -119,6 +119,7 @@ namespace Barotrauma
|
||||
addValueDropdown.AddItem(nameof(LimbType), typeof(LimbType));
|
||||
addValueDropdown.AddItem(nameof(ReputationAction.ReputationType), typeof(ReputationAction.ReputationType));
|
||||
addValueDropdown.AddItem(nameof(SpawnAction.SpawnLocationType), typeof(SpawnAction.SpawnLocationType));
|
||||
addValueDropdown.AddItem(nameof(CharacterTeamType), typeof(CharacterTeamType));
|
||||
|
||||
loadButton.OnClicked += (button, o) => Load(loadDropdown.SelectedData as EventPrefab);
|
||||
addActionButton.OnClicked += (button, o) => AddAction(addActionDropdown.SelectedData as Type);
|
||||
|
||||
@@ -1089,6 +1089,7 @@ namespace Barotrauma
|
||||
itemContentPackage = ContentPackage.CreatePackage(sub.Name, Path.Combine(destinationFolder, SteamManager.MetadataFileName), corePackage: false);
|
||||
SteamManager.CreateWorkshopItemStaging(itemContentPackage, out itemEditor);
|
||||
|
||||
bool fileMoved = false;
|
||||
string submarineDir = Path.GetDirectoryName(sub.FilePath);
|
||||
if (submarineDir != Path.GetDirectoryName(destinationFolder))
|
||||
{
|
||||
@@ -1097,14 +1098,18 @@ namespace Barotrauma
|
||||
{
|
||||
File.Move(sub.FilePath, destinationPath);
|
||||
}
|
||||
fileMoved = true;
|
||||
sub.FilePath = destinationPath;
|
||||
}
|
||||
|
||||
itemContentPackage.AddFile(sub.FilePath, ContentType.Submarine);
|
||||
itemContentPackage.Name = sub.Name;
|
||||
itemContentPackage.Save(itemContentPackage.Path);
|
||||
//ContentPackage.List.Add(itemContentPackage);
|
||||
//GameMain.Config.SelectContentPackage(itemContentPackage);
|
||||
|
||||
if (fileMoved)
|
||||
{
|
||||
GameMain.Config.EnableRegularPackage(itemContentPackage);
|
||||
}
|
||||
|
||||
itemEditor = itemEditor?.WithTitle(sub.Name).WithTag("Submarine").WithDescription(sub.Description);
|
||||
|
||||
|
||||
@@ -4506,7 +4506,7 @@ namespace Barotrauma
|
||||
{
|
||||
var newItem = new Item(itemPrefab, Vector2.Zero, Submarine.MainSub);
|
||||
|
||||
if (inv.CanBePut(itemPrefab, i))
|
||||
if (inv.CanBePutInSlot(itemPrefab, i, condition: null))
|
||||
{
|
||||
bool placedItem = inv.TryPutItem(newItem, i, false, true, dummyCharacter);
|
||||
spawnedItem |= placedItem;
|
||||
@@ -4696,7 +4696,7 @@ namespace Barotrauma
|
||||
CloseItem();
|
||||
}
|
||||
}
|
||||
MapEntity.UpdateEditor(cam);
|
||||
MapEntity.UpdateEditor(cam, (float)deltaTime);
|
||||
}
|
||||
|
||||
entityMenuOpenState = entityMenuOpen && !WiringMode ?
|
||||
|
||||
Reference in New Issue
Block a user