(9edcbf86d) Added: More prominent graphics for when a tutorial objective is completed
This commit is contained in:
+12
-4
@@ -392,10 +392,18 @@ namespace Barotrauma.Tutorials
|
|||||||
{
|
{
|
||||||
objective.IsTriggered = true;
|
objective.IsTriggered = true;
|
||||||
|
|
||||||
RectTransform rectT = new RectTransform(new Point((int)GUI.CheckmarkIcon.size.X, (int)GUI.CheckmarkIcon.size.Y), objective.ReplayButton.RectTransform, Anchor.BottomLeft, Pivot.BottomLeft);
|
int checkMarkHeight = (int)(objective.ReplayButton.Rect.Height * 1.2f);
|
||||||
rectT.AbsoluteOffset = new Point(-rectT.Rect.Width - 5, 0);
|
int checkMarkWidth = (int)(checkMarkHeight * 0.93f);
|
||||||
GUIImage checkmark = new GUIImage(rectT, GUI.CheckmarkIcon);
|
|
||||||
checkmark.Color = Color.Green;
|
Color color = new Color(4, 180, 108);
|
||||||
|
RectTransform rectTA = new RectTransform(new Point(checkMarkWidth, checkMarkHeight), objective.ReplayButton.RectTransform, Anchor.BottomLeft, Pivot.BottomLeft);
|
||||||
|
rectTA.AbsoluteOffset = new Point(-rectTA.Rect.Width - 5, 0);
|
||||||
|
GUIImage checkmark = new GUIImage(rectTA, "CheckMark");
|
||||||
|
checkmark.Color = color;
|
||||||
|
|
||||||
|
RectTransform rectTB = new RectTransform(new Vector2(1.1f, .8f), objective.LinkedText.RectTransform, Anchor.Center, Pivot.Center);
|
||||||
|
GUIImage stroke = new GUIImage(rectTB, "Stroke");
|
||||||
|
stroke.Color = color;
|
||||||
|
|
||||||
CoroutineManager.StartCoroutine(WaitForObjectiveEnd(objective));
|
CoroutineManager.StartCoroutine(WaitForObjectiveEnd(objective));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,10 +107,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
var warningBtn = new GUIButton(new RectTransform(new Point(buttonWidth, buttonHeight), columnLeft.RectTransform)
|
var warningBtn = new GUIButton(new RectTransform(new Point(buttonWidth, buttonHeight), columnLeft.RectTransform)
|
||||||
{ AbsoluteOffset = new Point((i % buttonsPerRow) * (buttonWidth + spacing), (int)Math.Floor(i / (float)buttonsPerRow) * (buttonHeight + spacing)) },
|
{ AbsoluteOffset = new Point((i % buttonsPerRow) * (buttonWidth + spacing), (int)Math.Floor(i / (float)buttonsPerRow) * (buttonHeight + spacing)) },
|
||||||
TextManager.Get(warningTexts[i]), style: "IndicatorButton")
|
TextManager.Get(warningTexts[i]), style: "IndicatorButton");
|
||||||
{
|
|
||||||
CanBeFocused = false
|
|
||||||
};
|
|
||||||
|
|
||||||
var btnText = warningBtn.GetChild<GUITextBlock>();
|
var btnText = warningBtn.GetChild<GUITextBlock>();
|
||||||
btnText.Font = GUI.SmallFont;
|
btnText.Font = GUI.SmallFont;
|
||||||
|
|||||||
@@ -381,6 +381,9 @@
|
|||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\8_Approach1\BaroTutorial_Approach.mp4">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\8_Approach1\BaroTutorial_Approach.mp4">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\UI\tutorialAtlas.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Content\Fonts\BebasNeue-Regular.otf">
|
<None Include="$(MSBuildThisFileDirectory)Content\Fonts\BebasNeue-Regular.otf">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
if (item.Container != null) { return false; }
|
if (item.Container != null) { return false; }
|
||||||
|
|
||||||
if (AutoInteractWithContained && character.SelectedConstruction == null)
|
if (AutoInteractWithContained)
|
||||||
{
|
{
|
||||||
foreach (Item contained in Inventory.Items)
|
foreach (Item contained in Inventory.Items)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -686,6 +686,39 @@ namespace Barotrauma
|
|||||||
|
|
||||||
AllowedLinks = element.GetAttributeStringArray("allowedlinks", new string[0], convertToLowerInvariant: true).ToList();
|
AllowedLinks = element.GetAttributeStringArray("allowedlinks", new string[0], convertToLowerInvariant: true).ToList();
|
||||||
|
|
||||||
|
if (sprite == null)
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError("Item \"" + Name + "\" has no sprite!");
|
||||||
|
#if SERVER
|
||||||
|
sprite = new Sprite("", Vector2.Zero);
|
||||||
|
sprite.SourceRect = new Rectangle(0, 0, 32, 32);
|
||||||
|
#else
|
||||||
|
sprite = new Sprite(TextureLoader.PlaceHolderTexture, null, null)
|
||||||
|
{
|
||||||
|
Origin = TextureLoader.PlaceHolderTexture.Bounds.Size.ToVector2() / 2
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
size = sprite.size;
|
||||||
|
sprite.EntityID = identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!category.HasFlag(MapEntityCategory.Legacy) && string.IsNullOrEmpty(identifier))
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError(
|
||||||
|
"Item prefab \"" + name + "\" has no identifier. All item prefabs have a unique identifier string that's used to differentiate between items during saving and loading.");
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(identifier))
|
||||||
|
{
|
||||||
|
MapEntityPrefab existingPrefab = List.Find(e => e.Identifier == identifier);
|
||||||
|
if (existingPrefab != null)
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError(
|
||||||
|
"Map entity prefabs \"" + name + "\" and \"" + existingPrefab.Name + "\" have the same identifier!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AllowedLinks = element.GetAttributeStringArray("allowedlinks", new string[0], convertToLowerInvariant: true).ToList();
|
||||||
|
|
||||||
List.Add(this);
|
List.Add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user