Skip to content

Commit

Permalink
Merge branch 'master' into tsd_develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrodinger71 authored Jun 24, 2024
2 parents 3d787a4 + 9a95663 commit c2ea6cf
Show file tree
Hide file tree
Showing 2,139 changed files with 743,265 additions and 82,618 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.203

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
with:
host: ${{ secrets.BUILDS_HOST }}
username: ${{ secrets.BUILDS_USERNAME }}
password: ${{ secrets.BUILD_PASSWORD }}
key: ${{ secrets.BUILDS_SSH_KEY }}
port: ${{ secrets.BUILDS_PORT }}
script: python3 ~/manifest.py --version ${{ github.sha }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.203

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.203
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion ADT_STATION
104 changes: 104 additions & 0 deletions Content.Client/ADT/Changeling/ChangelingPanelSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/// Made for Adventure Time Project by ModerN. https://github.com/modern-nm mailto:[email protected]
/// see also https://github.com/DocNITE/liebendorf-station/tree/feature/emote-radial-panel
using Content.Client.Humanoid;
using Content.Client.UserInterface.Systems.Radial;
using Content.Client.UserInterface.Systems.Radial.Controls;
using Content.Shared.Changeling;
using Content.Shared.Humanoid.Prototypes;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using System.Numerics;

namespace Content.Client.ADT.Language;

public sealed class ChangelingPanelSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[Dependency] private readonly IPlayerManager _playerMan = default!;
[Dependency] private readonly SpriteSystem _spriteSystem = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly HumanoidAppearanceSystem _appearanceSystem = default!;

/// <summary>
/// We should enable radial for single target
/// </summary>
private RadialContainer? _openedMenu;

private const string DefaultIcon = "/Textures/Interface/AdminActions/play.png";

private const string EmptyIcon = "/Textures/Interface/AdminActions/emptyIcon.png";

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);

SubscribeNetworkEvent<RequestChangelingFormsMenuEvent>(HandleChangelingFormsMenuEvent);
}

private void HandleChangelingFormsMenuEvent(RequestChangelingFormsMenuEvent args)
{
if (_openedMenu != null)
return;
if (_playerMan.LocalEntity == null)
{
return;
}

//if (!TryComp<ChangelingComponent>(_playerMan.LocalEntity.Value, out var changelingComponent)) // нет на клиенте
// return;

_openedMenu = _userInterfaceManager.GetUIController<RadialUiController>()
.CreateRadialContainer();

foreach (var humanoid in args.HumanoidData)
{
var dummy = _entManager.SpawnEntity(_proto.Index<SpeciesPrototype>(humanoid.Species).DollPrototype, MapCoordinates.Nullspace);
//var humanoidEntityUid = GetEntity(humanoid); // Entities on the client outside of the FOV are nonexistant. You can see that if you zoom out. //So it'll give you UID 0 which is EntityUid.Invalid.
_appearanceSystem.LoadProfile(dummy, humanoid.Profile);
var face = new SpriteView();
face.SetEntity(dummy);

var actionName = humanoid.Name;
var texturePath = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath(EmptyIcon)));

var emoteButton = _openedMenu.AddButton(actionName, texturePath, face);
emoteButton.Opacity = 210;
emoteButton.Tooltip = null;
emoteButton.Controller.OnPressed += (_) =>
{
var ev = new SelectChangelingFormEvent(args.Target, entitySelected: humanoid.NetEntity);
RaiseNetworkEvent(ev);
_openedMenu.Dispose();
};
}
_openedMenu.OnClose += (_) =>
{
_openedMenu = null;
};
if (_playerMan.LocalEntity != null)
_openedMenu.OpenAttached(_playerMan.LocalEntity.Value);

}

private void OnPlayerAttached(PlayerAttachedEvent args)
{
_openedMenu?.Dispose();
}

private void OnPlayerDetached(PlayerDetachedEvent args)
{
_openedMenu?.Dispose();
}
}
19 changes: 19 additions & 0 deletions Content.Client/ADT/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2024 Adventure Station

1. The provided software code in this and nested directories (hereinafter referred to as the "Adventure Station" project code) is intended solely for use within the "Adventure Station" project.

2. Any use, copying, distribution, or modification of the "Adventure Station" project code outside of "Adventure Station" project is prohibited.

3. This license does not grant any rights to own, use, or distribute the "Adventure Station" project code outside of the "Adventure Station" project.

4. This license is valid indefinitely, or until a decision is made by the copyright holder of the "Adventure Station" project to revoke/modify it.

Copyright (c) 2024 Adventure Station

1. Представленный программный код в данном и вложенных директориях (далее - код проекта "Adventure Station") предназначен исключительно для использования в рамках проекта "Adventure Station"

2. Любое использование, копирование, распространение и изменение кода проекта "Adventure Station" за пределами данного проекта запрещены.

3. Настоящая лицензия не предоставляет никаких прав на владение, использование или распространение кода проекта "Adventure Station" вне проекта "Adventure Station".

4. Настоящая лицензия действительна бессрочно, или до решения об упразднении/изменении правообладателем проекта "Adventure Station".
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using Content.Shared.BluespaceHarvester;
using JetBrains.Annotations;

namespace Content.Client.BluespaceHarvester;

[UsedImplicitly]
public sealed class BluespaceHarvesterBoundUserInterface : BoundUserInterface
{
private BluespaceHarvesterMenu? _window;

public BluespaceHarvesterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window = new BluespaceHarvesterMenu(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 BluespaceHarvesterBoundUserInterfaceState current)
return;

_window?.UpdateState(current);
}

public void SendTargetLevel(int level)
{
SendMessage(new BluespaceHarvesterTargetLevelMessage(level));
}

public void SendBuy(Shared.BluespaceHarvester.BluespaceHarvesterCategory category)
{
SendMessage(new BluespaceHarvesterBuyMessage(category));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Control xmlns="https://spacestation14.io">
<GridContainer Margin = "2 0 0 0" Columns="2">
<Label Name="CategoryLabel" Text="Category" StyleClasses="StatusFieldTitle"></Label>
<Button Name="CategoryButton" Text="10000" StyleClasses="OpenRight" Access="Public"/>
</GridContainer>
</Control>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Content.Shared.BluespaceHarvester;

namespace Content.Client.BluespaceHarvester;

[GenerateTypedNameReferences]
public sealed partial class BluespaceHarvesterCategory : Control
{
public BluespaceHarvesterCategory(BluespaceHarvesterCategoryInfo category, bool canBuy)
{
RobustXamlLoader.Load(this);

CategoryLabel.Text = Loc.GetString($"bluespace-harvester-category-{Enum.GetName(typeof(Shared.BluespaceHarvester.BluespaceHarvesterCategory), category.Type)}");

CategoryButton.Text = $"{category.Cost}";
CategoryButton.Disabled = !canBuy;
}
}
46 changes: 46 additions & 0 deletions Content.Client/BluespaceHarvester/BluespaceHarvesterMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'bluespace-harvester-window-title'}"
MinSize="480 360">
<BoxContainer Orientation="Vertical">
<Label Text="{Loc 'bluespace-harvester-window-lable-input'}"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<GridContainer Margin="2 0 0 0" Columns="2">
<Label Text="{Loc 'bluespace-harvester-window-level-input'}" StyleClasses="StatusFieldTitle"/>
<LineEdit Name="InputLevelBar" PlaceHolder="0" HorizontalExpand="True" Margin ="0 4"/>
<Label Text="{Loc 'bluespace-harvester-window-level-target'}" StyleClasses="StatusFieldTitle"/>
<Label Name="TargetLevel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-level-current'}" StyleClasses="StatusFieldTitle"/>
<Label Name="CurrentLevel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-level-desired'}" StyleClasses="StatusFieldTitle"/>
<ProgressBar Name="DesiredBar"
HorizontalExpand="True"
MinValue="0"
MaxValue="1"
SetHeight="25"/>
<Label Text="{Loc 'bluespace-harvester-window-power-usage'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerUsageLabel" Text="0w"/>
<Label Text="{Loc 'bluespace-harvester-window-power-next'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerUsageNextLabel" Text="0w"/>
<Label Text="{Loc 'bluespace-harvester-window-power-surplus'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerSuppliertLabel" Text="0w"/>
</GridContainer>
<Control/>
<Label Text="{Loc 'bluespace-harvester-window-lable-output'}"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<GridContainer Margin="2 0 10 0" Columns="2">
<BoxContainer Orientation="Vertical">
<GridContainer Margin="2 0 0 0" Columns="2">
<Label Text="{Loc 'bluespace-harvester-window-points-available'}" StyleClasses="StatusFieldTitle"/>
<Label Name="AvailablePointsLabel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-points-generation'}" StyleClasses="StatusFieldTitle"/>
<Label Name="GenerationPointsLabel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-points-total'}" StyleClasses="StatusFieldTitle"/>
<Label Name="TotalPontsLabel" Text="0"/>
</GridContainer>
</BoxContainer>
<BoxContainer Name="Categories" Orientation="Vertical">
</BoxContainer>
</GridContainer>
</BoxContainer>
</controls:FancyWindow>
60 changes: 60 additions & 0 deletions Content.Client/BluespaceHarvester/BluespaceHarvesterMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.BluespaceHarvester;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.BluespaceHarvester;

[GenerateTypedNameReferences]
public sealed partial class BluespaceHarvesterMenu : FancyWindow
{
private readonly BluespaceHarvesterBoundUserInterface _owner;

public BluespaceHarvesterMenu(BluespaceHarvesterBoundUserInterface owner)
{
RobustXamlLoader.Load(this);

_owner = owner;

InputLevelBar.OnTextEntered += (args) =>
{
if (!int.TryParse(args.Text, out var level) || level < 0 || level > 20)
{
InputLevelBar.Text = "0";
return;
}

_owner.SendTargetLevel(level);
};

// EntityView.SetEntity(_owner.Owner);
}

public void UpdateState(BluespaceHarvesterBoundUserInterfaceState state)
{
TargetLevel.Text = $"{state.TargetLevel}";
CurrentLevel.Text = $"{state.CurrentLevel}";
DesiredBar.Value = ((float)state.CurrentLevel) / ((float)state.MaxLevel);

PowerUsageLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerUsage));
PowerUsageNextLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerUsageNext));
PowerSuppliertLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerSuppliert));

AvailablePointsLabel.Text = $"{state.Points}";
TotalPontsLabel.Text = $"{state.TotalPoints}";
GenerationPointsLabel.Text = $"{state.PointsGen}";

Categories.RemoveAllChildren();
foreach (var category in state.Categories)
{
var child = new BluespaceHarvesterCategory(category, state.Points >= category.Cost);

child.CategoryButton.OnButtonDown += (args) =>
{
_owner.SendBuy(category.Type);
};

Categories.AddChild(child);
}
}
}
Loading

0 comments on commit c2ea6cf

Please sign in to comment.