v0.19.0.0 (unstable)
This commit is contained in:
+11
-10
@@ -115,12 +115,16 @@ namespace Barotrauma
|
||||
|
||||
partial void InitProjSpecific()
|
||||
{
|
||||
var buttonContainer = new GUILayoutGroup(HUDLayoutSettings.ToRectTransform(HUDLayoutSettings.ButtonAreaTop, GUI.Canvas),
|
||||
isHorizontal: true, childAnchor: Anchor.CenterRight)
|
||||
{
|
||||
CanBeFocused = false
|
||||
};
|
||||
CreateButtons();
|
||||
}
|
||||
|
||||
public override void HUDScaleChanged()
|
||||
{
|
||||
CreateButtons();
|
||||
}
|
||||
|
||||
private void CreateButtons()
|
||||
{
|
||||
int buttonHeight = (int) (GUI.Scale * 40),
|
||||
buttonWidth = GUI.IntScale(450),
|
||||
buttonCenter = buttonHeight / 2,
|
||||
@@ -166,8 +170,6 @@ namespace Barotrauma
|
||||
},
|
||||
UserData = "ReadyCheckButton"
|
||||
};
|
||||
|
||||
buttonContainer.Recalculate();
|
||||
}
|
||||
|
||||
private void InitCampaignUI()
|
||||
@@ -311,7 +313,7 @@ namespace Barotrauma
|
||||
|
||||
if (prevControlled != null)
|
||||
{
|
||||
prevControlled.SelectedConstruction = null;
|
||||
prevControlled.SelectedItem = prevControlled.SelectedSecondaryItem = null;
|
||||
if (prevControlled.AIController != null)
|
||||
{
|
||||
prevControlled.AIController.Enabled = true;
|
||||
@@ -362,7 +364,7 @@ namespace Barotrauma
|
||||
float t = 0.0f;
|
||||
while (t < fadeOutDuration || endTransition.Running)
|
||||
{
|
||||
t += CoroutineManager.UnscaledDeltaTime;
|
||||
t += CoroutineManager.DeltaTime;
|
||||
overlayColor = Color.Lerp(Color.Transparent, Color.White, t / fadeOutDuration);
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
@@ -469,7 +471,6 @@ namespace Barotrauma
|
||||
{
|
||||
base.End(transitionType);
|
||||
ForceMapUI = ShowCampaignUI = false;
|
||||
UpgradeManager.CanUpgrade = true;
|
||||
|
||||
// remove all event dialogue boxes
|
||||
GUIMessageBox.MessageBoxes.ForEachMod(mb =>
|
||||
|
||||
+20
-10
@@ -169,10 +169,20 @@ namespace Barotrauma
|
||||
public static SinglePlayerCampaign Load(XElement element) => new SinglePlayerCampaign(element);
|
||||
|
||||
private void InitUI()
|
||||
{
|
||||
CreateEndRoundButton();
|
||||
|
||||
campaignUIContainer = new GUIFrame(new RectTransform(Vector2.One, GUI.Canvas, Anchor.Center), style: "InnerGlow", color: Color.Black);
|
||||
CampaignUI = new CampaignUI(this, campaignUIContainer)
|
||||
{
|
||||
StartRound = () => { TryEndRound(); }
|
||||
};
|
||||
}
|
||||
|
||||
private void CreateEndRoundButton()
|
||||
{
|
||||
int buttonHeight = (int)(GUI.Scale * 40);
|
||||
int buttonWidth = GUI.IntScale(450);
|
||||
|
||||
endRoundButton = new GUIButton(HUDLayoutSettings.ToRectTransform(new Rectangle((GameMain.GraphicsWidth / 2) - (buttonWidth / 2), HUDLayoutSettings.ButtonAreaTop.Center.Y - (buttonHeight / 2), buttonWidth, buttonHeight), GUI.Canvas),
|
||||
TextManager.Get("EndRound"), textAlignment: Alignment.Center, style: "EndRoundButton")
|
||||
{
|
||||
@@ -190,12 +200,11 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
campaignUIContainer = new GUIFrame(new RectTransform(Vector2.One, GUI.Canvas, Anchor.Center), style: "InnerGlow", color: Color.Black);
|
||||
CampaignUI = new CampaignUI(this, campaignUIContainer)
|
||||
{
|
||||
StartRound = () => { TryEndRound(); }
|
||||
};
|
||||
public override void HUDScaleChanged()
|
||||
{
|
||||
CreateEndRoundButton();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -292,7 +301,7 @@ namespace Barotrauma
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
overlayTextColor = Color.Lerp(Color.Transparent, Color.White, (timer - 1.0f) / fadeInDuration);
|
||||
timer = Math.Min(timer + CoroutineManager.UnscaledDeltaTime, textDuration);
|
||||
timer = Math.Min(timer + CoroutineManager.DeltaTime, textDuration);
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
var outpost = GameMain.GameSession.Level.StartOutpost;
|
||||
@@ -320,7 +329,7 @@ namespace Barotrauma
|
||||
while (timer < fadeInDuration)
|
||||
{
|
||||
overlayColor = Color.Lerp(Color.LightGray, Color.Transparent, timer / fadeInDuration);
|
||||
timer += CoroutineManager.UnscaledDeltaTime;
|
||||
timer += CoroutineManager.DeltaTime;
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
overlayColor = Color.Transparent;
|
||||
@@ -353,7 +362,7 @@ namespace Barotrauma
|
||||
|
||||
if (prevControlled != null)
|
||||
{
|
||||
prevControlled.SelectedConstruction = null;
|
||||
prevControlled.SelectedItem = prevControlled.SelectedSecondaryItem = null;
|
||||
if (prevControlled.AIController != null)
|
||||
{
|
||||
prevControlled.AIController.Enabled = true;
|
||||
@@ -424,7 +433,7 @@ namespace Barotrauma
|
||||
float t = 0.0f;
|
||||
while (t < fadeOutDuration || endTransition.Running)
|
||||
{
|
||||
t += CoroutineManager.UnscaledDeltaTime;
|
||||
t += CoroutineManager.DeltaTime;
|
||||
overlayColor = Color.Lerp(Color.Transparent, Color.White, t / fadeOutDuration);
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
@@ -436,6 +445,7 @@ namespace Barotrauma
|
||||
if (success)
|
||||
{
|
||||
GameMain.GameSession.SubmarineInfo = new SubmarineInfo(GameMain.GameSession.Submarine);
|
||||
GameMain.GameSession.EventManager.RegisterEventHistory();
|
||||
SaveUtil.SaveGame(GameMain.GameSession.SavePath);
|
||||
}
|
||||
else
|
||||
|
||||
+6
-6
@@ -124,7 +124,7 @@ namespace Barotrauma.Tutorials
|
||||
captain_medicSpawnPos = Item.ItemList.Find(i => i.HasTag("captain_medicspawnpos")).WorldPosition;
|
||||
tutorial_submarineDoor = Item.ItemList.Find(i => i.HasTag("tutorial_submarinedoor")).GetComponent<Door>();
|
||||
tutorial_submarineDoorLight = Item.ItemList.Find(i => i.HasTag("tutorial_submarinedoorlight")).GetComponent<LightComponent>();
|
||||
var medicInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("medicaldoctor"))
|
||||
var medicInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("medicaldoctor".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
@@ -148,21 +148,21 @@ namespace Barotrauma.Tutorials
|
||||
SetDoorAccess(tutorial_lockedDoor_1, null, false);
|
||||
SetDoorAccess(tutorial_lockedDoor_2, null, false);
|
||||
|
||||
var mechanicInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("mechanic"))
|
||||
var mechanicInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("mechanic".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
captain_mechanic = Character.Create(mechanicInfo, WayPoint.GetRandom(SpawnType.Human, mechanicInfo.Job?.Prefab, Submarine.MainSub).WorldPosition, "mechanic");
|
||||
captain_mechanic.GiveJobItems();
|
||||
|
||||
var securityInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("securityofficer"))
|
||||
var securityInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("securityofficer".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
captain_security = Character.Create(securityInfo, WayPoint.GetRandom(SpawnType.Human, securityInfo.Job?.Prefab, Submarine.MainSub).WorldPosition, "securityofficer");
|
||||
captain_security.GiveJobItems();
|
||||
|
||||
var engineerInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("engineer"))
|
||||
var engineerInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("engineer".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
@@ -339,8 +339,8 @@ namespace Barotrauma.Tutorials
|
||||
private bool IsSelectedItem(Item item)
|
||||
{
|
||||
return
|
||||
captain?.SelectedConstruction == item ||
|
||||
(captain?.SelectedConstruction?.linkedTo?.Contains(item) ?? false);
|
||||
captain?.SelectedItem == item ||
|
||||
(captain?.SelectedItem?.linkedTo?.Contains(item) ?? false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -119,7 +119,7 @@ namespace Barotrauma.Tutorials
|
||||
var patientHull2 = WayPoint.WayPointList.Find(wp => wp.IdCardDesc == "airlock").CurrentHull;
|
||||
medBay = WayPoint.WayPointList.Find(wp => wp.IdCardDesc == "medbay").CurrentHull;
|
||||
|
||||
var assistantInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("assistant"))
|
||||
var assistantInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("assistant".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
@@ -130,7 +130,7 @@ namespace Barotrauma.Tutorials
|
||||
patient1.AddDamage(patient1.WorldPosition, new List<Affliction>() { new Affliction(AfflictionPrefab.Burn, 15.0f) }, stun: 0, playSound: false);
|
||||
patient1.AIController.Enabled = false;
|
||||
|
||||
assistantInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("assistant"))
|
||||
assistantInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("assistant".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
@@ -139,7 +139,7 @@ namespace Barotrauma.Tutorials
|
||||
patient2.CanSpeak = false;
|
||||
patient2.AIController.Enabled = false;
|
||||
|
||||
var mechanicInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("engineer"))
|
||||
var mechanicInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("engineer".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
@@ -148,13 +148,13 @@ namespace Barotrauma.Tutorials
|
||||
subPatient1.AddDamage(patient1.WorldPosition, new List<Affliction>() { new Affliction(AfflictionPrefab.Burn, 40.0f) }, stun: 0, playSound: false);
|
||||
subPatients.Add(subPatient1);
|
||||
|
||||
var securityInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("securityofficer"));
|
||||
var securityInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("securityofficer".ToIdentifier()));
|
||||
var subPatient2 = Character.Create(securityInfo, WayPoint.GetRandom(SpawnType.Human, securityInfo.Job?.Prefab, Submarine.MainSub).WorldPosition, "3");
|
||||
subPatient2.TeamID = CharacterTeamType.Team1;
|
||||
subPatient2.AddDamage(patient1.WorldPosition, new List<Affliction>() { new Affliction(AfflictionPrefab.InternalDamage, 40.0f) }, stun: 0, playSound: false);
|
||||
subPatients.Add(subPatient2);
|
||||
|
||||
var engineerInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("engineer"))
|
||||
var engineerInfo = new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobOrJobPrefab: JobPrefab.Get("engineer".ToIdentifier()))
|
||||
{
|
||||
TeamID = CharacterTeamType.Team1
|
||||
};
|
||||
@@ -262,7 +262,7 @@ namespace Barotrauma.Tutorials
|
||||
HighlightInventorySlot(doctor_suppliesCabinet.Inventory, i, highlightColor, .5f, .5f, 0f);
|
||||
}
|
||||
}
|
||||
if (doctor.SelectedConstruction == doctor_suppliesCabinet.Item)
|
||||
if (doctor.SelectedItem == doctor_suppliesCabinet.Item)
|
||||
{
|
||||
for (int i = 0; i < doctor.Inventory.Capacity; i++)
|
||||
{
|
||||
@@ -373,7 +373,7 @@ namespace Barotrauma.Tutorials
|
||||
HighlightInventorySlot(doctor_medBayCabinet.Inventory, i, highlightColor, .5f, .5f, 0f);
|
||||
}
|
||||
}
|
||||
if (doctor.SelectedConstruction == doctor_medBayCabinet.Item)
|
||||
if (doctor.SelectedItem == doctor_medBayCabinet.Item)
|
||||
{
|
||||
for (int i = 0; i < doctor.Inventory.Capacity; i++)
|
||||
{
|
||||
|
||||
+3
-3
@@ -400,7 +400,7 @@ namespace Barotrauma.Tutorials
|
||||
wait -= 0.1f;
|
||||
engineer_reactor.AutoTemp = true;
|
||||
} while (wait > 0.0f);
|
||||
engineer.SelectedConstruction = null;
|
||||
engineer.SelectedItem = null;
|
||||
engineer_reactor.CanBeSelected = false;
|
||||
RemoveCompletedObjective(2);
|
||||
GameAnalyticsManager.AddDesignEvent("Tutorial:EngineerTutorial:Objective2");
|
||||
@@ -513,7 +513,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
private bool IsSelectedItem(Item item)
|
||||
{
|
||||
return engineer?.SelectedConstruction == item;
|
||||
return engineer?.SelectedItem == item;
|
||||
}
|
||||
|
||||
private IEnumerable<CoroutineStatus> ReactorOperatedProperly()
|
||||
@@ -568,7 +568,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
private void HandleJunctionBoxWiringHighlights()
|
||||
{
|
||||
Item selected = engineer.SelectedConstruction;
|
||||
Item selected = engineer.SelectedItem;
|
||||
|
||||
if (!engineer.HasEquippedItem("screwdriver".ToIdentifier()))
|
||||
{
|
||||
|
||||
+2
-2
@@ -440,7 +440,7 @@ namespace Barotrauma.Tutorials
|
||||
bool gotSodium = false;
|
||||
do
|
||||
{
|
||||
if (mechanic.SelectedConstruction == mechanic_craftingCabinet.Item)
|
||||
if (mechanic.SelectedItem == mechanic_craftingCabinet.Item)
|
||||
{
|
||||
for (int i = 0; i < mechanic.Inventory.Capacity; i++)
|
||||
{
|
||||
@@ -702,7 +702,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
private bool IsSelectedItem(Item item)
|
||||
{
|
||||
return mechanic?.SelectedConstruction == item;
|
||||
return mechanic?.SelectedItem == item;
|
||||
}
|
||||
|
||||
private bool WallHasDamagedSections(Structure wall)
|
||||
|
||||
+1
-1
@@ -510,7 +510,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
private bool IsSelectedItem(Item item)
|
||||
{
|
||||
return officer?.SelectedConstruction == item;
|
||||
return officer?.SelectedItem == item;
|
||||
}
|
||||
|
||||
private Character SpawnMonster(string speciesName, Vector2 pos)
|
||||
|
||||
Reference in New Issue
Block a user