Fixes (#73)
* - fix: Genitals sprite shit and meow for tajaran * - add: fart sound if kicked from server * - tweak: vulpies and tajaran now for donaters!!! * - fix: Fart on exit * - add: roleplay think * - fix: database shit and loc * - add: ears for slime * - fix: LOC interaction fix * - add: height setting * - fix: height for felinids * - fix: nigga fix * - fix: no bitches on captain * - fix: interaction panel animation shit
This commit is contained in:
@@ -330,13 +330,14 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem
|
||||
// Okay so if the marking prototype is modified but we load old marking data this may no longer be valid
|
||||
// and we need to check the index is correct.
|
||||
// So if that happens just default to white?
|
||||
// Alpha WD EDIT
|
||||
if (colors != null && j < colors.Count)
|
||||
{
|
||||
sprite.LayerSetColor(layerId, colors[j]);
|
||||
sprite.LayerSetColor(layerId, colors[j].WithAlpha(markingPrototype.LayerAlpha));
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite.LayerSetColor(layerId, Color.White);
|
||||
sprite.LayerSetColor(layerId, Color.White.WithAlpha(markingPrototype.LayerAlpha));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +131,15 @@
|
||||
<Control HorizontalExpand="True"/>
|
||||
<OptionButton Name="CSpawnPriorityButton" HorizontalAlignment="Right" />
|
||||
</BoxContainer>
|
||||
<!-- Height -->
|
||||
<BoxContainer HorizontalExpand="True" Orientation="Vertical" Name="HeightContainer">
|
||||
<Label Text="{Loc 'humanoid-profile-editor-height-label'}" />
|
||||
<Slider HorizontalExpand="True" Name="CHeight" MinValue="0" MaxValue="255" Value="1"/>
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label Name="CHeightInformation"/>
|
||||
<Button Name="ResetHeightButton" Text="{Loc 'height-reset'}"/>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
<!-- Skin -->
|
||||
<BoxContainer Margin="10" HorizontalExpand="True" Orientation="Vertical">
|
||||
@@ -178,6 +187,12 @@
|
||||
<humanoid:MarkingPicker Name="CMarkings" IgnoreCategories="Hair,FacialHair" />
|
||||
</ScrollContainer>
|
||||
</BoxContainer>
|
||||
<BoxContainer Name="CRolePlayThinkTab" Orientation="Vertical" Margin="10">
|
||||
<!-- RolePlay sel -->
|
||||
<ScrollContainer VerticalExpand="True">
|
||||
<BoxContainer Name="CRolePlayThing" Orientation="Vertical"></BoxContainer>
|
||||
</ScrollContainer>
|
||||
</BoxContainer>
|
||||
</TabContainer>
|
||||
</BoxContainer>
|
||||
<!-- Right side -->
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Client.Message;
|
||||
using Content.Client.Players.PlayTimeTracking;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared._Amour.RoleplayInfo;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.GameTicking;
|
||||
@@ -85,6 +86,8 @@ namespace Content.Client.Preferences.UI
|
||||
//WD-EDIT
|
||||
private OptionButton _voiceButton => CVoiceButton;
|
||||
private Button _voicePlayButton => CVoicePlayButton;
|
||||
private BoxContainer _rolePlayThink => CRolePlayThing;
|
||||
private List<RolePlaySelector> _roleplaySelections = new();
|
||||
//WD-EDIT
|
||||
|
||||
private Slider _skinColor => CSkin;
|
||||
@@ -220,6 +223,10 @@ namespace Content.Client.Preferences.UI
|
||||
#region Genitals
|
||||
InitializeGenitals();
|
||||
#endregion
|
||||
|
||||
#region height
|
||||
InitializeHeight();
|
||||
#endregion
|
||||
//AMOUR END
|
||||
|
||||
#region Species
|
||||
@@ -242,6 +249,7 @@ namespace Content.Client.Preferences.UI
|
||||
SetSpecies(_speciesList[args.Id].ID);
|
||||
UpdateHairPickers();
|
||||
OnSkinColorOnValueChanged();
|
||||
UpdateHeightControl(); // AMOUR
|
||||
};
|
||||
|
||||
#endregion Species
|
||||
@@ -545,6 +553,27 @@ namespace Content.Client.Preferences.UI
|
||||
|
||||
#endregion FlavorText
|
||||
|
||||
//WD EDIT
|
||||
#region RolePlayThink
|
||||
_tabContainer.SetTabTitle(5, Loc.GetString("roleplay-tab"));
|
||||
_rolePlayThink.DisposeAllChildren();
|
||||
_roleplaySelections.Clear();
|
||||
|
||||
foreach (var proto in prototypeManager.EnumeratePrototypes<RoleplayInfoPrototype>())
|
||||
{
|
||||
var think = new RolePlaySelector(proto.ID);
|
||||
think.PreferenceChanged += selection =>
|
||||
{
|
||||
Profile = Profile?.WithRoleplaySelection(proto.ID, selection);
|
||||
IsDirty = true;
|
||||
};
|
||||
_roleplaySelections.Add(think);
|
||||
_rolePlayThink.Children.Add(think);
|
||||
}
|
||||
|
||||
#endregion
|
||||
//WD END EDIT
|
||||
|
||||
#region Dummy
|
||||
|
||||
_previewRotateLeftButton.OnPressed += _ =>
|
||||
@@ -1286,6 +1315,8 @@ namespace Content.Client.Preferences.UI
|
||||
|
||||
//Amour edit
|
||||
UpdateGenitalsControls();
|
||||
UpdateRoleplayThink();
|
||||
UpdateHeightControl();
|
||||
//Amour edit
|
||||
|
||||
_preferenceUnavailableButton.SelectId((int) Profile.PreferenceUnavailable);
|
||||
@@ -1603,5 +1634,74 @@ namespace Content.Client.Preferences.UI
|
||||
PreferenceChanged?.Invoke(Preference);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class RolePlaySelector : Control
|
||||
{
|
||||
private readonly RadioOptions<RoleplaySelection> _options;
|
||||
|
||||
public RoleplaySelection Preference
|
||||
{
|
||||
get => _options.SelectedValue;
|
||||
set => _options.SelectByValue(value);
|
||||
}
|
||||
|
||||
public string RolePlayId { get; }
|
||||
|
||||
public event Action<RoleplaySelection>? PreferenceChanged;
|
||||
public RolePlaySelector(string rolePlayId)
|
||||
{
|
||||
RolePlayId = rolePlayId;
|
||||
_options = new RadioOptions<RoleplaySelection>(RadioOptionsLayout.Horizontal)
|
||||
{
|
||||
FirstButtonStyle = StyleBase.ButtonOpenRight,
|
||||
ButtonStyle = StyleBase.ButtonOpenBoth,
|
||||
LastButtonStyle = StyleBase.ButtonOpenLeft
|
||||
};
|
||||
|
||||
_options.GenerateItem = (text, _) => new Button
|
||||
{
|
||||
Text = text,
|
||||
MinWidth = 90
|
||||
};
|
||||
|
||||
_options.OnItemSelected += args => _options.Select(args.Id);
|
||||
|
||||
var titleLabel = new Label()
|
||||
{
|
||||
Margin = new Thickness(5f, 0, 5f, 0),
|
||||
Text = Loc.GetString("roleplay-name-" + rolePlayId.ToLower()),
|
||||
MouseFilter = MouseFilterMode.Stop,
|
||||
ToolTip = Loc.GetString("roleplay-desc-" + rolePlayId.ToLower())
|
||||
};
|
||||
|
||||
_options.OnItemSelected += _ => PreferenceChanged?.Invoke(Preference);
|
||||
|
||||
_options.AddItem(Loc.GetString("roleplay-no"), RoleplaySelection.No);
|
||||
_options.AddItem(Loc.GetString("roleplay-maybe"), RoleplaySelection.Maybe);
|
||||
_options.AddItem(Loc.GetString("roleplay-yes"), RoleplaySelection.Yes);
|
||||
|
||||
titleLabel.HorizontalAlignment = HAlignment.Left;
|
||||
_options.HorizontalAlignment = HAlignment.Center;
|
||||
|
||||
AddChild(titleLabel);
|
||||
AddChild(_options);
|
||||
HorizontalExpand = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void UpdateRoleplayThink()
|
||||
{
|
||||
if(Profile is null)
|
||||
return;
|
||||
|
||||
foreach (var selector in _roleplaySelections)
|
||||
{
|
||||
if (Profile.RoleplayInfoData.TryGetValue(selector.RolePlayId, out var value))
|
||||
{
|
||||
selector.Preference = value.RoleplaySelection;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
Content.Client/_Amour/CustomHeight/CustomHeightSystem.cs
Normal file
25
Content.Client/_Amour/CustomHeight/CustomHeightSystem.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared._Amour.CustomHeight;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client._Amour.CustomHeight;
|
||||
|
||||
public sealed class CustomHeightSystem : SharedCustomHeightSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<CustomHeightComponent,AppearanceChangeEvent>(OnHeightChange);
|
||||
}
|
||||
|
||||
private void OnHeightChange(EntityUid uid, CustomHeightComponent component, AppearanceChangeEvent args)
|
||||
{
|
||||
if(args.Sprite is null || !AppearanceSystem.TryGetData<float>(uid, HeightVisuals.State, out var height))
|
||||
return;
|
||||
|
||||
height = Math.Clamp(height, component.Min, component.Max);
|
||||
|
||||
args.Sprite.Scale = new Vector2(height);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using Content.Client._Amour.CustomHeight;
|
||||
using Content.Shared._Amour.CustomHeight;
|
||||
using Content.Shared._Amour.LoggerExtension;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Range = Robust.Client.UserInterface.Controls.Range;
|
||||
|
||||
namespace Content.Client.Preferences.UI;
|
||||
public sealed partial class HumanoidProfileEditor
|
||||
{
|
||||
private Slider _height => CHeight;
|
||||
private Label _heightInformation => CHeightInformation;
|
||||
|
||||
private CustomHeightSystem _customHeightSystem = default!;
|
||||
|
||||
public void InitializeHeight()
|
||||
{
|
||||
_customHeightSystem = _entMan.System<CustomHeightSystem>();
|
||||
|
||||
_height.OnValueChanged += HeightValueChanged;
|
||||
ResetHeightButton.OnPressed += ResetHeightButtonOnOnPressed;
|
||||
}
|
||||
|
||||
private void ResetHeightButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_entMan.TryGetComponent<CustomHeightComponent>(_previewDummy, out var heightComponent))
|
||||
{
|
||||
SetDummyHeight(_customHeightSystem.GetByteFromHeight(_previewDummy.Value, heightComponent.Starting));
|
||||
}
|
||||
}
|
||||
|
||||
private void HeightValueChanged(Range obj)
|
||||
{
|
||||
SetDummyHeight((byte) _height.Value,false);
|
||||
}
|
||||
|
||||
public void UpdateHeightControl()
|
||||
{
|
||||
if (Profile is null)
|
||||
return;
|
||||
|
||||
if (!_entMan.TryGetComponent<CustomHeightComponent>(_previewDummy, out _))
|
||||
{
|
||||
HeightContainer.Visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
HeightContainer.Visible = true;
|
||||
_height.Value = Profile.Appearance.Height;
|
||||
|
||||
UpdateHeightText();
|
||||
}
|
||||
|
||||
public void SetDummyHeight(byte height, bool changeHeightValue = true)
|
||||
{
|
||||
if (Profile is null || !_entMan.TryGetComponent<CustomHeightComponent>(_previewDummy, out var a))
|
||||
return;
|
||||
|
||||
if(changeHeightValue)
|
||||
_height.Value = height;
|
||||
|
||||
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithHeight(height));
|
||||
|
||||
UpdateHeightText();
|
||||
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
public void UpdateHeightText()
|
||||
{
|
||||
if (_entMan.TryGetComponent<CustomHeightComponent>(_previewDummy, out _))
|
||||
{
|
||||
var height = (int)(_customHeightSystem
|
||||
.GetHeightFromByte(_previewDummy.Value, (byte) _height.Value) * 180);
|
||||
|
||||
_heightInformation.Text = Loc.GetString("humanoid-profile-height-current") + height;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
Content.Client/_Amour/Fart/FartSystem.cs
Normal file
31
Content.Client/_Amour/Fart/FartSystem.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Content.Client.Gameplay;
|
||||
using Content.Client.Launcher;
|
||||
using Robust.Client.Audio;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.State;
|
||||
|
||||
namespace Content.Client._Amour.Fart;
|
||||
|
||||
public sealed class FartSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IStateManager _stateManager = default!;
|
||||
[Dependency] private readonly IAudioManager _audioManager = default!;
|
||||
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||
|
||||
public const string FartPath = "/Audio/_Amour/fart-with-reverb.ogg";
|
||||
private AudioResource _audioResource = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
_audioResource = _resourceCache.GetResource<AudioResource>(FartPath);
|
||||
_stateManager.OnStateChanged += StateManagerOnOnStateChanged;
|
||||
}
|
||||
|
||||
private void StateManagerOnOnStateChanged(StateChangedEventArgs obj)
|
||||
{
|
||||
if(obj.OldState is not GameplayState || obj.NewState is not LauncherConnecting)
|
||||
return;
|
||||
|
||||
_audioManager.CreateAudioSource(_audioResource.AudioStream)?.StartPlaying();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user