New Thief minor antagonist (#21520)
* start working * add right-click thief antagins some architecture restruct * add meh thief greeting audio * add thief subgamemode to Traitors gamemode * add late join thief (not tested yet) add briefing * add pacifism * add Steal tasks to thief * fix crash thief+traitor on person * add new condition: collection steal * add tracking of succes collection objective * add stamp collection target remove some boring steal target add check pulling entity to collection target * finalize first 2 group objective * start merging stealing objective systems * merging * finish merging. Now traitor steal objective work better * we don't check the items of pullable sentient entity * clear naming, enable thief signle item objective start * objective pack add * finish with steal item objectives * convert string to ProtoId<> * some clean up * add thieves to revolution game mode * Update Resources/Locale/en-US/game-ticking/game-presets/preset-thief.ftl Co-authored-by: Flareguy <78941145+Flareguy@users.noreply.github.com> * Update Resources/Locale/en-US/game-ticking/game-presets/preset-thief.ftl Co-authored-by: Flareguy <78941145+Flareguy@users.noreply.github.com> * update pacifism: fix crashing, monkey-thief without pacified * adaptive animal briefing, cleaning locales * add structure steal objectives * remove RCD target * add thiefs to manifest, but bug with traitor duplications * add escape objective * add chat briefing * setup animal objective group system * add animal steal objectives * add animal objectives notroleconditions * add morty * now thief mode has a chance of not launching Now there are a random number of thieves per round from 1 to 3 * 6 hours of trying to fix duplicate tasks. Failure * added thief pinpointer (buggy) * start thief backpack UI work * revert pinpointer for scope reason * UI continue work * add thief starter kits content * remove ERP kit :trollface: * finally! giving starting items to thief. Now it playable, but still need more work * clean up * fix * fox * add merged items into thief new Starting Kit (buggy) * fix YES antag menu * objection tweaks * remove hearts objective, working on spawning things from toolbox * smug * fixes * add race specifier objective condition LAMPS * meh * fix fix fix * the alive * Adding stamps * Update backpack.ftl * Revert1 * Revert ftl * add voice mask to communicator kit * Update Resources/Locale/en-US/administration/antag.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/game-ticking/game-presets/preset-thief.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/objectives/conditions/steal.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/prototypes/roles/antags.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * Update Resources/Locale/en-US/thief/backpack.ftl Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com> * update * fix * more reusable function, add documentation * fix doc * faint fixes --------- Co-authored-by: Flareguy <78941145+Flareguy@users.noreply.github.com> Co-authored-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com>
This commit is contained in:
52
Content.Client/Thief/ThiefBackpackBoundUserInterface.cs
Normal file
52
Content.Client/Thief/ThiefBackpackBoundUserInterface.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using Content.Shared.Thief;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Thief;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class ThiefBackpackBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private ThiefBackpackMenu? _window;
|
||||
|
||||
public ThiefBackpackBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new ThiefBackpackMenu(this);
|
||||
_window.OnClose += Close;
|
||||
_window.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (!disposing)
|
||||
return;
|
||||
|
||||
_window?.Dispose();
|
||||
_window = null;
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
if (state is not ThiefBackpackBoundUserInterfaceState current)
|
||||
return;
|
||||
|
||||
_window?.UpdateState(current);
|
||||
}
|
||||
|
||||
public void SendChangeSelected(int setNumber)
|
||||
{
|
||||
SendMessage(new ThiefBackpackChangeSetMessage(setNumber));
|
||||
}
|
||||
|
||||
public void SendApprove()
|
||||
{
|
||||
SendMessage(new ThiefBackpackApproveMessage());
|
||||
}
|
||||
}
|
||||
39
Content.Client/Thief/ThiefBackpackMenu.xaml
Normal file
39
Content.Client/Thief/ThiefBackpackMenu.xaml
Normal file
@@ -0,0 +1,39 @@
|
||||
<controls:FancyWindow xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
|
||||
Title="{Loc 'thief-backpack-window-title'}"
|
||||
MinSize="700 700">
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True">
|
||||
<!-- First Informational panel -->
|
||||
<Label Text="{Loc 'thief-backpack-window-description'}" Margin="5 5"/>
|
||||
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
|
||||
<Label Name="SelectedSets" Text="{Loc 'thief-backpack-window-selected'}" Margin="5 5"/>
|
||||
|
||||
<!-- Second sets panel -->
|
||||
<PanelContainer Margin="5 5">
|
||||
<PanelContainer.PanelOverride>
|
||||
<gfx:StyleBoxFlat BackgroundColor="#050505" />
|
||||
</PanelContainer.PanelOverride>
|
||||
<ScrollContainer
|
||||
HScrollEnabled="False"
|
||||
MinSize="0 600"
|
||||
SizeFlagsStretchRatio="2"
|
||||
VerticalExpand="True">
|
||||
<BoxContainer Name="SetsGrid" Orientation="Vertical" MinSize="460 200">
|
||||
<!-- Sets is filled by code -->
|
||||
|
||||
</BoxContainer>
|
||||
</ScrollContainer>
|
||||
</PanelContainer>
|
||||
|
||||
<!-- Third approve button panel -->
|
||||
<PanelContainer Margin="10">
|
||||
<Button Name="ApproveButton"
|
||||
Text="{Loc 'thief-backpack-window-approve-button'}"
|
||||
Margin="0 5"
|
||||
Access="Public"
|
||||
HorizontalAlignment ="Right"
|
||||
StyleClasses="OpenRight"/>
|
||||
</PanelContainer>
|
||||
</BoxContainer>
|
||||
</controls:FancyWindow>
|
||||
56
Content.Client/Thief/ThiefBackpackMenu.xaml.cs
Normal file
56
Content.Client/Thief/ThiefBackpackMenu.xaml.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared.Thief;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.Thief;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ThiefBackpackMenu : FancyWindow
|
||||
{
|
||||
[Dependency] private readonly IEntitySystemManager _sysMan = default!;
|
||||
private readonly SpriteSystem _spriteSystem;
|
||||
|
||||
private readonly ThiefBackpackBoundUserInterface _owner;
|
||||
|
||||
public ThiefBackpackMenu(ThiefBackpackBoundUserInterface owner)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
_spriteSystem = _sysMan.GetEntitySystem<SpriteSystem>();
|
||||
|
||||
_owner = owner;
|
||||
|
||||
ApproveButton.OnButtonDown += (args) =>
|
||||
{
|
||||
_owner.SendApprove();
|
||||
};
|
||||
}
|
||||
|
||||
public void UpdateState(ThiefBackpackBoundUserInterfaceState state)
|
||||
{
|
||||
SetsGrid.RemoveAllChildren();
|
||||
int count = 0;
|
||||
int selectedNumber = 0;
|
||||
foreach (var set in state.Sets)
|
||||
{
|
||||
var child = new ThiefBackpackSet(set.Value, _spriteSystem);
|
||||
|
||||
child.SetButton.OnButtonDown += (args) =>
|
||||
{
|
||||
_owner.SendChangeSelected(set.Key);
|
||||
};
|
||||
|
||||
SetsGrid.AddChild(child);
|
||||
|
||||
count++;
|
||||
|
||||
if (set.Value.Selected)
|
||||
selectedNumber++;
|
||||
}
|
||||
|
||||
SelectedSets.Text = Loc.GetString("thief-backpack-window-selected", ("selectedCount", selectedNumber), ("maxCount", state.MaxSelectedSets));
|
||||
ApproveButton.Disabled = selectedNumber == state.MaxSelectedSets ? false : true;
|
||||
}
|
||||
}
|
||||
23
Content.Client/Thief/ThiefBackpackSet.xaml
Normal file
23
Content.Client/Thief/ThiefBackpackSet.xaml
Normal file
@@ -0,0 +1,23 @@
|
||||
<Control xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client">
|
||||
<!-- Name and button -->
|
||||
<PanelContainer Margin="5 5 0 5">
|
||||
<PanelContainer.PanelOverride>
|
||||
<gfx:StyleBoxFlat BackgroundColor="#18211b" />
|
||||
</PanelContainer.PanelOverride>
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
|
||||
<GridContainer Margin="5" Columns="2" MinSize="600 0">
|
||||
<Label Name="SetName" Text="Set" StyleClasses="StatusFieldTitle"></Label>
|
||||
<Button Margin="0 10" Name="SetButton" Text="Select" StyleClasses="OpenRight" Access="Public" HorizontalAlignment="Right"/>
|
||||
</GridContainer>
|
||||
<controls:HLine Color="#404040" Thickness="1" Margin="0 5"/>
|
||||
<!-- Icon and Description -->
|
||||
<GridContainer Margin="0 5" Columns="2">
|
||||
<TextureRect Name="Icon" Margin="10" Stretch="KeepAspectCentered"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="64 64"/>
|
||||
<Label Name="SetDescription" Text="Description"></Label>
|
||||
</GridContainer>
|
||||
</BoxContainer>
|
||||
</PanelContainer>
|
||||
</Control>
|
||||
22
Content.Client/Thief/ThiefBackpackSet.xaml.cs
Normal file
22
Content.Client/Thief/ThiefBackpackSet.xaml.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Content.Shared.Thief;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Thief;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ThiefBackpackSet : Control
|
||||
{
|
||||
public ThiefBackpackSet(ThiefBackpackSetInfo set, SpriteSystem spriteSystem)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
Icon.Texture = spriteSystem.Frame0(set.Sprite);
|
||||
SetName.Text = Loc.GetString(set.Name);
|
||||
SetDescription.Text = Loc.GetString(set.Description);
|
||||
SetButton.Text = Loc.GetString(set.Selected ? "thief-backpack-button-deselect" : "thief-backpack-button-select");
|
||||
SetButton.ModulateSelfOverride = set.Selected ? new Color(40, 84, 35) : new Color(68, 75, 103);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user