0.1500.3.0 (🗿 edition)
This commit is contained in:
@@ -1694,7 +1694,7 @@ namespace Barotrauma
|
||||
|
||||
private void CreateJobVariantTooltip(JobPrefab jobPrefab, int variant, GUIComponent parentSlot)
|
||||
{
|
||||
jobVariantTooltip = new GUIFrame(new RectTransform(new Point((int)(500 * GUI.Scale), (int)(200 * GUI.Scale)), GUI.Canvas, pivot: Pivot.BottomRight),
|
||||
jobVariantTooltip = new GUIFrame(new RectTransform(new Point((int)(400 * GUI.Scale), (int)(180 * GUI.Scale)), GUI.Canvas, pivot: Pivot.BottomRight),
|
||||
style: "GUIToolTip")
|
||||
{
|
||||
UserData = new Pair<JobPrefab, int>(jobPrefab, variant)
|
||||
@@ -1707,17 +1707,7 @@ namespace Barotrauma
|
||||
AbsoluteSpacing = (int)(15 * GUI.Scale)
|
||||
};
|
||||
|
||||
string name =
|
||||
TextManager.Get("jobname." + jobPrefab.Identifier + (variant + 1), returnNull: true, fallBackTag: "jobname." + jobPrefab.Identifier) ??
|
||||
"";
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), content.RectTransform), name, font: GUI.SubHeadingFont);
|
||||
|
||||
string description =
|
||||
TextManager.Get("jobdescription." + jobPrefab.Identifier + (variant + 1), returnNull: true, fallBackTag: "jobdescription." + jobPrefab.Identifier) ??
|
||||
"";
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), content.RectTransform), description, wrap: true, font: GUI.SmallFont);
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), content.RectTransform), TextManager.GetWithVariable("startingequipmentname", "[number]", (variant + 1).ToString()), font: GUI.SubHeadingFont, textAlignment: Alignment.Center);
|
||||
|
||||
var itemIdentifiers = jobPrefab.ItemIdentifiers[variant]
|
||||
.Distinct()
|
||||
@@ -1726,7 +1716,7 @@ namespace Barotrauma
|
||||
int itemsPerRow = 5;
|
||||
int rows = (int)Math.Max(Math.Ceiling(itemIdentifiers.Count() / (float)itemsPerRow), 1);
|
||||
|
||||
new GUICustomComponent(new RectTransform(new Vector2(1.0f, 0.4f * rows), content.RectTransform, Anchor.BottomLeft),
|
||||
new GUICustomComponent(new RectTransform(new Vector2(1.0f, 0.4f * rows), content.RectTransform, Anchor.BottomCenter),
|
||||
onDraw: (sb, component) => { DrawJobVariantItems(sb, component, new Pair<JobPrefab, int>(jobPrefab, variant), itemsPerRow); });
|
||||
|
||||
jobVariantTooltip.RectTransform.MinSize = new Point(0, content.RectTransform.Children.Sum(c => c.Rect.Height + content.AbsoluteSpacing));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.Items.Components;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -23,6 +24,8 @@ namespace Barotrauma
|
||||
private Character? dummyCharacter;
|
||||
public static Effect BlueprintEffect;
|
||||
|
||||
private TabMenu tabMenu;
|
||||
|
||||
public TestScreen()
|
||||
{
|
||||
Cam = new Camera();
|
||||
@@ -50,18 +53,15 @@ namespace Barotrauma
|
||||
dummyCharacter?.Remove();
|
||||
}
|
||||
|
||||
// ????????
|
||||
submarine = new Submarine(SubmarineInfo.SavedSubmarines.FirstOrDefault(info => info.Name.Equals("Crescent", StringComparison.OrdinalIgnoreCase)));
|
||||
miniMapItem = new Item(ItemPrefab.Find(null, "statusmonitor"), Vector2.Zero, submarine);
|
||||
MiniMap miniMap = miniMapItem.GetComponent<MiniMap>();
|
||||
miniMap.PowerConsumption = 0;
|
||||
|
||||
dummyCharacter = Character.Create(CharacterPrefab.HumanSpeciesName, Vector2.Zero, "", id: Entity.DummyID, hasAi: false);
|
||||
dummyCharacter.Info.Job = new Job(JobPrefab.Prefabs.Where(jp => TalentTree.JobTalentTrees.ContainsKey(jp.Identifier)).GetRandom());
|
||||
dummyCharacter.Info.Name = "Galldren";
|
||||
dummyCharacter.Inventory.CreateSlots();
|
||||
|
||||
Character.Controlled = dummyCharacter;
|
||||
GameMain.World.ProcessChanges();
|
||||
TabMenu.selectedTab = TabMenu.InfoFrameTab.Talents;
|
||||
tabMenu = new TabMenu();
|
||||
}
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
@@ -69,34 +69,21 @@ namespace Barotrauma
|
||||
Frame.AddToGUIUpdateList();
|
||||
CharacterHUD.AddToGUIUpdateList(dummyCharacter);
|
||||
dummyCharacter?.SelectedConstruction?.AddToGUIUpdateList();
|
||||
tabMenu.AddToGUIUpdateList();
|
||||
}
|
||||
|
||||
public override void Update(double deltaTime)
|
||||
{
|
||||
base.Update(deltaTime);
|
||||
tabMenu.Update();
|
||||
|
||||
if (dummyCharacter is { } dummy && miniMapItem is { } item)
|
||||
if (dummyCharacter is { } dummy)
|
||||
{
|
||||
if (dummy.SelectedConstruction != item)
|
||||
{
|
||||
dummy.SelectedConstruction = item;
|
||||
}
|
||||
dummy.SelectedConstruction?.UpdateHUD(Cam, dummy, (float)deltaTime);
|
||||
Vector2 pos = FarseerPhysics.ConvertUnits.ToSimUnits(item.Position);
|
||||
foreach (Limb limb in dummy.AnimController.Limbs)
|
||||
{
|
||||
limb.body.SetTransform(pos, 0.0f);
|
||||
}
|
||||
|
||||
if (dummy.AnimController?.Collider is { } collider)
|
||||
{
|
||||
collider.SetTransform(pos, 0);
|
||||
}
|
||||
|
||||
dummy.ControlLocalPlayer((float)deltaTime, Cam, false);
|
||||
dummy.Control((float)deltaTime, Cam);
|
||||
dummy.Submarine = submarine;
|
||||
}
|
||||
|
||||
GUI.Update((float)deltaTime);
|
||||
}
|
||||
|
||||
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
|
||||
|
||||
Reference in New Issue
Block a user