bdbcef4...18b4bac
commit 18b4bacd5bb645f36f62e77587af971cb789d37c Author: Daniel Asteljoki <daniel.asteljoki@gmail.com> Date: Fri Mar 8 13:04:51 2019 +0200 Added a beginner level sub commit eef09f7d07cde64d1f2f6971eda733505339a0c0 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Thu Mar 7 19:05:14 2019 +0200 Remove the old sprite when recreating the sprite. commit a6c3ce00782882bc14f200f95abab0fa4d5d9a2d Author: itchyOwl <lauri.harkanen@gmail.com> Date: Thu Mar 7 19:04:51 2019 +0200 Fix gender specific wearables not refreshing when we change the gender. commit f606b801dac9e4cbb4238506ff4d73981709a2f8 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Thu Mar 7 18:42:14 2019 +0200 Move some console commands from the shared project to the client. These should not be debug only, because they might be useful for modders too. commit 154251c183eacf37e92fa7b27bb6d57bb15797d8 Author: itchyOwl <lauri.harkanen@gmail.com> Date: Thu Mar 7 14:42:22 2019 +0200 Disable latchonto ai for now.
This commit is contained in:
@@ -149,7 +149,7 @@ namespace Barotrauma
|
||||
commands.SelectMany(c => c.names).ToArray(),
|
||||
new string[0]
|
||||
};
|
||||
}));
|
||||
}, isCheat: true));
|
||||
|
||||
|
||||
commands.Add(new Command("items|itemlist", "itemlist: List all the item prefabs available for spawning.", (string[] args) =>
|
||||
@@ -382,8 +382,9 @@ namespace Barotrauma
|
||||
banDuration = parsedBanDuration;
|
||||
}
|
||||
|
||||
GameMain.NetworkMember.BanPlayer(client.Name, reason, false, banDuration);
|
||||
});
|
||||
ShowQuestionPrompt("Reason for kicking \"" + client.Name + "\"?", (reason) =>
|
||||
{
|
||||
GameMain.NetworkMember.KickPlayer(client.Name, reason);
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -980,98 +981,6 @@ namespace Barotrauma
|
||||
NewMessage("Set packet duplication to " + (int)(duplicates * 100) + "%.", Color.White);
|
||||
}));
|
||||
|
||||
commands.Add(new Command("flipx", "flipx: mirror the main submarine horizontally", (string[] args) =>
|
||||
{
|
||||
Submarine.MainSub?.FlipX();
|
||||
}));
|
||||
|
||||
commands.Add(new Command("gender", "Set the gender of the controlled character. Allowed parameters: Male, Female, None.", args =>
|
||||
{
|
||||
var character = Character.Controlled;
|
||||
if (character == null)
|
||||
{
|
||||
ThrowError("Not controlling any character!");
|
||||
return;
|
||||
}
|
||||
if (args.Length == 0)
|
||||
{
|
||||
ThrowError("No parameters provided!");
|
||||
return;
|
||||
}
|
||||
if (Enum.TryParse(args[0], true, out Gender gender))
|
||||
{
|
||||
character.Info.Gender = gender;
|
||||
character.ReloadHead();
|
||||
foreach (var limb in character.AnimController.Limbs)
|
||||
{
|
||||
foreach (var wearable in limb.WearingItems)
|
||||
{
|
||||
if (wearable.Gender != Gender.None && wearable.Gender != gender)
|
||||
{
|
||||
wearable.Gender = gender;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
commands.Add(new Command("race", "Set race of the controlled character. Allowed parameters: White, Black, Asian, None.", args =>
|
||||
{
|
||||
var character = Character.Controlled;
|
||||
if (character == null)
|
||||
{
|
||||
ThrowError("Not controlling any character!");
|
||||
return;
|
||||
}
|
||||
if (args.Length == 0)
|
||||
{
|
||||
ThrowError("No parameters provided!");
|
||||
return;
|
||||
}
|
||||
if (Enum.TryParse(args[0], true, out Race race))
|
||||
{
|
||||
character.Info.Race = race;
|
||||
character.ReloadHead();
|
||||
}
|
||||
}));
|
||||
|
||||
commands.Add(new Command("loadhead|head", "Load head sprite(s). Required argument: head id. Optional arguments: hair index, beard index, moustache index, face attachment index.", args =>
|
||||
{
|
||||
var character = Character.Controlled;
|
||||
if (character == null)
|
||||
{
|
||||
ThrowError("Not controlling any character!");
|
||||
return;
|
||||
}
|
||||
if (args.Length == 0)
|
||||
{
|
||||
ThrowError("No head id provided!");
|
||||
return;
|
||||
}
|
||||
if (int.TryParse(args[0], out int id))
|
||||
{
|
||||
int hairIndex, beardIndex, moustacheIndex, faceAttachmentIndex;
|
||||
hairIndex = beardIndex = moustacheIndex = faceAttachmentIndex = -1;
|
||||
if (args.Length > 1)
|
||||
{
|
||||
int.TryParse(args[1], out hairIndex);
|
||||
}
|
||||
if (args.Length > 2)
|
||||
{
|
||||
int.TryParse(args[2], out beardIndex);
|
||||
}
|
||||
if (args.Length > 3)
|
||||
{
|
||||
int.TryParse(args[3], out moustacheIndex);
|
||||
}
|
||||
if (args.Length > 4)
|
||||
{
|
||||
int.TryParse(args[4], out faceAttachmentIndex);
|
||||
}
|
||||
character.ReloadHead(id, hairIndex, beardIndex, moustacheIndex, faceAttachmentIndex);
|
||||
}
|
||||
}));
|
||||
|
||||
commands.Add(new Command("money", "", args =>
|
||||
{
|
||||
if (args.Length == 0) { return; }
|
||||
|
||||
@@ -1226,6 +1226,32 @@ namespace Barotrauma
|
||||
NewLineOnAttributes = true
|
||||
};
|
||||
|
||||
#if CLIENT
|
||||
if (Tutorial.Tutorials != null)
|
||||
{
|
||||
foreach (Tutorial tutorial in Tutorial.Tutorials)
|
||||
{
|
||||
if (tutorial.Completed && !CompletedTutorialNames.Contains(tutorial.Name))
|
||||
{
|
||||
CompletedTutorialNames.Add(tutorial.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
var tutorialElement = new XElement("tutorials");
|
||||
foreach (string tutorialName in CompletedTutorialNames)
|
||||
{
|
||||
tutorialElement.Add(new XElement("Tutorial", new XAttribute("name", tutorialName)));
|
||||
}
|
||||
doc.Root.Add(tutorialElement);
|
||||
|
||||
XmlWriterSettings settings = new XmlWriterSettings
|
||||
{
|
||||
Indent = true,
|
||||
OmitXmlDeclaration = true,
|
||||
NewLineOnAttributes = true
|
||||
};
|
||||
|
||||
#if CLIENT
|
||||
if (Tutorial.Tutorials != null)
|
||||
{
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace Barotrauma
|
||||
if (value == _gender) { return; }
|
||||
_gender = value;
|
||||
IsInitialized = false;
|
||||
SpritePath = ParseSpritePath(SourceElement.GetAttributeString("texture", string.Empty));
|
||||
Init(_gender);
|
||||
}
|
||||
}
|
||||
@@ -111,15 +112,16 @@ namespace Barotrauma
|
||||
/// <summary>
|
||||
/// Note: this constructor cannot initialize automatically, because the gender is unknown at this point. We only know it when the item is equipped.
|
||||
/// </summary>
|
||||
public WearableSprite(XElement subElement, Wearable item)
|
||||
public WearableSprite(XElement subElement, Wearable wearable)
|
||||
{
|
||||
Type = WearableType.Item;
|
||||
WearableComponent = item;
|
||||
string texturePath = subElement.GetAttributeString("texture", string.Empty);
|
||||
SpritePath = texturePath.Contains("/") ? texturePath : $"{Path.GetDirectoryName(item.Item.Prefab.ConfigFile)}/{texturePath}";
|
||||
WearableComponent = wearable;
|
||||
SpritePath = ParseSpritePath(subElement.GetAttributeString("texture", string.Empty));
|
||||
SourceElement = subElement;
|
||||
}
|
||||
|
||||
private string ParseSpritePath(string texturePath) => texturePath.Contains("/") ? texturePath : $"{Path.GetDirectoryName(WearableComponent.Item.Prefab.ConfigFile)}/{texturePath}";
|
||||
|
||||
public bool IsInitialized { get; private set; }
|
||||
public void Init(Gender gender = Gender.None)
|
||||
{
|
||||
|
||||
@@ -430,13 +430,6 @@ namespace Barotrauma
|
||||
}
|
||||
CurrentLocation.SelectedMissionIndex = missionIndex;
|
||||
|
||||
//the destination must be the same as the destination of the mission
|
||||
if (CurrentLocation.SelectedMission != null &&
|
||||
CurrentLocation.SelectedMission.Locations[1] != SelectedLocation)
|
||||
{
|
||||
SelectLocation(CurrentLocation.SelectedMission.Locations[1]);
|
||||
}
|
||||
|
||||
SelectedLocation = location;
|
||||
SelectedConnection = connections.Find(c => c.Locations.Contains(CurrentLocation) && c.Locations.Contains(SelectedLocation));
|
||||
OnLocationSelected?.Invoke(SelectedLocation, SelectedConnection);
|
||||
|
||||
@@ -160,16 +160,6 @@ namespace Barotrauma
|
||||
}
|
||||
#endif
|
||||
|
||||
public void SetState()
|
||||
{
|
||||
hit = binding.IsHit();
|
||||
if (hit) hitQueue = true;
|
||||
|
||||
held = binding.IsDown();
|
||||
if (held) heldQueue = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
public bool Hit
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user