Merge pull request #119 from frosty-dev/ups

Ups
This commit is contained in:
Jabak
2024-08-25 15:36:19 +03:00
committed by GitHub
13 changed files with 161 additions and 72 deletions

View File

@@ -20,15 +20,14 @@ namespace Content.Client.Lathe.UI
_menu = new LatheMenu(this);
_menu.OnClose += Close;
_menu.OnServerListButtonPressed += _ =>
{
SendMessage(new ConsoleServerSelectionMessage());
SendPredictedMessage(new ConsoleServerSelectionMessage());
};
_menu.RecipeQueueAction += (recipe, amount) =>
{
SendMessage(new LatheQueueRecipeMessage(recipe, amount));
SendPredictedMessage(new LatheQueueRecipeMessage(recipe, amount));
};
_menu.OpenCenteredRight();
@@ -54,8 +53,10 @@ namespace Content.Client.Lathe.UI
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_menu?.Dispose();
}
}

View File

@@ -43,7 +43,9 @@ public sealed class MeatyOreUIController : UIController
{
base.FrameUpdate(args);
if(!_buttonLoaded) return;
if (!_buttonLoaded)
return;
var shouldBeVisible = CheckButtonVisibility();
MeatyOreButton!.Visible = shouldBeVisible;
}
@@ -51,13 +53,19 @@ public sealed class MeatyOreUIController : UIController
private bool CheckButtonVisibility()
{
if(!_sponsorsManager.TryGetInfo(out var sponsor)) return false;
if(sponsor?.Tier == null || sponsor?.MeatyOreCoin == 0) return false;
if (!_sponsorsManager.TryGetInfo(out var sponsor))
return false;
var controlledEntity = _playerManager!.LocalPlayer!.ControlledEntity;
if(controlledEntity == null) return false;
if (sponsor.Tier == null || sponsor.MeatyOreCoin == 0)
return false;
if (!_entityManager.HasComponent<HumanoidAppearanceComponent>(controlledEntity)) return false;
var controlledEntity = _playerManager.LocalPlayer!.ControlledEntity;
if (controlledEntity == null)
return false;
if (!_entityManager.HasComponent<HumanoidAppearanceComponent>(controlledEntity))
return false;
return true;
}

View File

@@ -45,7 +45,7 @@ public sealed partial class ChangelingSystem
private void OnShop(EntityUid uid, SubdermalImplantComponent component, ChangelingShopActionEvent args)
{
if(!TryComp<StoreComponent>(uid, out var store))
if (!TryComp<StoreComponent>(uid, out var store))
return;
_storeSystem.ToggleUi(args.Performer, uid, store);

View File

@@ -21,7 +21,7 @@ public sealed class UserDbDataManager : IPostInjectInit
{
[Dependency] private readonly IServerPreferencesManager _prefs = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly PlayTimeTrackingManager _playTimeTracking = default!;
[Dependency] private readonly IPlayTimeTrackingManager _playTimeTracking = default!;
private readonly Dictionary<NetUserId, UserData> _users = new();

View File

@@ -309,7 +309,7 @@ public sealed class PlayTimeTrackingManager : IPlayTimeTrackingManager, ISharedP
var data = new PlayTimeData();
_playTimeData.Add(session, data);
var playTimes = await _db.GetPlayTimes(session.UserId, cancel);
var playTimes = await _db.GetPlayTimes(session.UserId);
cancel.ThrowIfCancellationRequested();
foreach (var timer in playTimes)

View File

@@ -1,4 +1,5 @@
using Content.Server.Chat.Managers;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http;
@@ -31,6 +32,7 @@ using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
namespace Content.Server._White.MeatyOre;
@@ -49,6 +51,7 @@ public sealed class MeatyOreStoreSystem : EntitySystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IBanManager _banManager = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private HttpClient _httpClient = default!;
private string _apiUrl = default!;
@@ -152,7 +155,7 @@ public sealed class MeatyOreStoreSystem : EntitySystem
return;
_pvsOverrideSystem.AddSessionOverride(storeEntity.Value, playerSession);
_storeSystem.ToggleUi(playerEntity.Value, storeEntity.Value, storeComponent);
_storeSystem.ToggleUi(playerEntity.Value, storeEntity.Value);
}
private bool TryGetStore(ICommonSession session, out StoreComponent store, [NotNullWhen(true)] out EntityUid? storeEntity)
@@ -190,19 +193,19 @@ public sealed class MeatyOreStoreSystem : EntitySystem
private (EntityUid, StoreComponent) CreateStore(NetUserId userId, int balance)
{
var session = _playerManager.GetSessionById(userId);
var storeEntity = _entityManager.SpawnEntity("StoreMeatyOreEntity", MapCoordinates.Nullspace);
var storeComponent = Comp<StoreComponent>(storeEntity);
var user = session.AttachedEntity!;
_storeSystem.InitializeFromPreset(StorePresetPrototype, storeEntity, storeComponent);
var storeComponent = Comp<StoreComponent>(user.Value);
_storeSystem.InitializeFromPreset(StorePresetPrototype, user.Value, storeComponent);
storeComponent.Balance.Clear();
_storeSystem.TryAddCurrency(new Dictionary<string, FixedPoint2> { { MeatyOreCurrencyPrototype, balance } },
storeEntity, storeComponent);
user.Value, storeComponent);
_meatyOreStores[userId] = (storeEntity, storeComponent);
_pvsOverrideSystem.AddSessionOverride(storeEntity, session);
_meatyOreStores[userId] = (user.Value, storeComponent);
return (storeEntity, storeComponent);
return (user.Value, storeComponent);
}
private async void TryAddRole(EntityUid user, EntityUid target, StoreComponent store, EntityUid storeEntity)

View File

@@ -236,7 +236,7 @@ namespace Content.Shared.CCVar
/// If roles should be restricted based on time.
/// </summary>
public static readonly CVarDef<bool>
GameRoleTimers = CVarDef.Create("game.role_timers", false, CVar.SERVER | CVar.REPLICATED);
GameRoleTimers = CVarDef.Create("game.role_timers", true, CVar.SERVER | CVar.REPLICATED);
/// <summary>
/// Override default role requirements using a <see cref="JobRequirementOverridePrototype"/>

View File

@@ -1,50 +1,4 @@
Entries:
- author: EnefFlow
changes:
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430 \u043F\u0440\u043E\
\u0432\u0435\u0440\u043A\u0430 \u043F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\
\u0438\u0438 \u043A\u043D\u043E\u043F\u043A\u0438 \u0432\u044B\u0437\u043E\u0432\
\u0430 \u0441\u0442\u0430\u043D\u0446\u0438\u0438. \u0415\u0441\u043B\u0438\
\ \u043A\u043E\u043D\u0441\u043E\u043B\u044C \u043D\u0430\u0445\u043E\u0434\u0438\
\u0442\u0441\u044F \u043D\u0435 \u043D\u0430 \u0441\u0442\u0430\u043D\u0446\u0438\
\u0438, \u0442\u043E \u0432\u044B\u0434\u0430\u0451\u0442 \u043F\u043E\u043F\
\u0430\u043F \"\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\
\ \u0441\u0432\u044F\u0437\u0438\"."
type: Add
id: 19
time: '2023-01-06T17:33:46.0000000+00:00'
- author: NCast-Hops
changes:
- message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E \u0432\u0435\u0441\
\u0435\u043B\u044C\u0435!"
type: Add
- message: "\u0423\u0431\u0440\u0430\u043D\u043E \u0432\u0435\u0441\u0435\u043B\u044C\
\u0435!"
type: Remove
id: 20
time: '2023-01-12T11:08:53.0000000+00:00'
- author: HitPanda
changes:
- message: "\u041D\u043E\u0432\u044B\u0439 \u043F\u0440\u0435\u0441\u0435\u0442\
\ \u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E \u0434\u043B\u044F \u043D\
\u0435\u0433\u043E."
type: Add
- message: "\u0415\u0441\u043B\u0438 \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043E\
\ \u043F\u0440\u0430\u0432\u0438\u043B\u043E, \u0442\u043E \u043A\u043E\u043D\
\u0441\u043E\u043B\u044C \u043A\u043E\u043C\u043C\u0443\u043D\u0438\u043A\u0430\
\u0446\u0438\u0438 \u043D\u0435 \u0434\u0430\u0451\u0442 \u0432\u044B\u0437\u0432\
\u0430\u0442\u044C \u0448\u0430\u0442\u0442\u043B, \u043F\u043E\u043A\u0430\
\ \u043D\u0435 \"\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0441\
\u044F \u0441\u0432\u044F\u0437\u044C\"."
type: Add
- message: "\u0414\u043B\u044F \u043F\u0440\u0430\u0432\u0438\u043B\u0430 \u043F\
\u0440\u043E\u043F\u0438\u0441\u0430\u043D\u044B \u043C\u0435\u0442\u043E\u0434\
\u044B \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430 \u043A\u043E\u043D\
\u043A\u0440\u0435\u0442\u043D\u043E\u0433\u043E \u0438\u0432\u0435\u043D\u0442\
\u0430."
type: Add
id: 21
time: '2023-01-12T12:56:46.0000000+00:00'
- author: HitPanda
changes:
- message: "\u0423\u0431\u0440\u0430\u043B \u0438\u0437 \u0433\u043E\u043B\u043E\
@@ -8555,3 +8509,92 @@
id: 518
time: '2024-08-23T08:38:47.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/660
- author: ThereDrD0
changes:
- message: "\u041C\u0435\u0442\u0435\u043E\u0440 \u043C\u0435\u043D\u044E \u0441\
\u043D\u043E\u0432\u0430 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442\
\u0441\u044F"
type: Fix
- message: "\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u044B\u0445 \u0444\u0438\u043A\
\u0441 \u0442\u0430\u0439\u043C\u0435\u0440\u043E\u0432"
type: Fix
- message: "\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u044B\u0439 \u0444\u0438\u043A\
\u0441 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0442\u0435\
\u0445\u0444\u0430\u0431\u0430 \u0421\u0411"
type: Fix
id: 519
time: '2024-08-24T22:37:24.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/664
- author: ThereDrD0
changes:
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u0441\u0431\
\u0440\u0430\u0441\u044B\u0432\u0430\u044E\u0449\u0438\u0435\u0441\u044F \u0438\
\u043C\u0435\u043D\u0430"
type: Fix
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430 \u043D\u0435\
\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u043F\u043E\
\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0442\u043E\u0447\u043A\u0438 \u0432\
\ \u0438\u043C\u0435\u043D\u0438 \u0431\u043E\u0440\u0433\u043E\u0432"
type: Fix
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430 \u0430\u0432\
\u0442\u043E\u0437\u0430\u043C\u0435\u043D\u0430 \u0431\u0443\u043A\u0432 \u043D\
\u0430 \u0431\u043E\u043B\u044C\u0448\u0438\u0435 \u0432 \u0438\u043C\u0435\u043D\
\u0430\u0445 \u043C\u0438\u043C\u043E\u0432, \u043A\u043B\u043E\u0443\u043D\u043E\
\u0432 \u0438 \u0431\u043E\u0440\u0433\u043E\u0432"
type: Fix
- message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043F\u0435\
\u0440\u0435\u043F\u0443\u0442\u0430\u043D\u043D\u044B\u0435 \u0440\u0443\u043A\
\u0438 \u0443 \u0444\u0435\u043B\u0438\u043D\u0438\u0434\u043E\u0432, \u0433\
\u0430\u0440\u043F\u0438\u0439 \u0438 \u0442\u0435\u0440\u043C\u0438\u043D\u0430\
\u0442\u043E\u0440\u0430"
type: Fix
id: 520
time: '2024-08-24T09:36:44.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/663
- author: ThereDrD0
changes:
- message: "\u0421\u043A\u043E\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043E\
\ \u0442\u0430\u0439\u043C\u0435\u0440\u044B \u0442\u0435\u043F\u0435\u0440\u044C\
\ \u0442\u043E\u0447\u043D\u043E \u0434\u043E\u043B\u0436\u043D\u044B \u0437\
\u0430\u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C"
type: Fix
- message: "\u0420\u0443\u043A\u0438 \u0443 \u0444\u0435\u043B\u0438\u043D\u0438\
\u0434\u043E\u0432, \u0433\u0430\u0440\u043F\u0438\u0439 \u0438 \u0442\u0435\
\u0440\u043C\u0438\u043D\u0430\u0442\u043E\u0440\u0430 \u0442\u0435\u043F\u0435\
\u0440\u044C \u0432 \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E\u043C\
\ \u043F\u043E\u0440\u044F\u0434\u043A\u0435."
type: Fix
- message: "\u0422\u0435\u043F\u0435\u0440\u044C \u0445\u0440\u0430\u043D\u0438\u043B\
\u0438\u0449\u0435 \u0432\u043D\u0443\u0442\u0440\u0438 \u0442\u0435\u043B\u0430\
\ \u0441\u043B\u0438\u0437\u043D\u0435\u043B\u044E\u0434\u043E\u0432 \u043D\u0435\
\ \u043C\u0435\u0448\u0430\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\
\u043E\u0432\u0430\u0442\u044C \u043D\u0430 \u043D\u0435\u043C \u043F\u0440\u0435\
\u0434\u043C\u0435\u0442\u044B \u0438 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\
\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u0440\u0438\
\ \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u043F\u0443\u0441\u0442\u043E\u0439\
\ \u0440\u0443\u043A\u0438 \u0438\u043B\u0438 \u0447\u0435\u0440\u0435\u0437\
\ \u041F\u041A\u041C \u043C\u0435\u043D\u044E."
type: Fix
- message: "\u042D\u0444\u0444\u0435\u043A\u0442 \u0440\u0430\u0434\u0438\u0430\u0446\
\u0438\u0438 \u0443 \u0430\u0440\u0442\u0435\u0444\u0430\u043A\u0442\u0430 \u043F\
\u043E\u0432\u044B\u0448\u0435\u043D \u0432 \u0446\u0435\u043D\u0435 \u0441\
\ 1 \u0434\u043E 4 \u043E\u0447\u043A\u043E\u0432. \u0412\u0441\u0435\u0433\u043E\
\ \u0438\u0445 \u043C\u0430\u043A\u0441\u0438\u043C\u0443\u043C \u043C\u043E\
\u0436\u0435\u0442 \u0431\u044B\u0442\u044C 10 \u0443 \u0430\u0440\u0442\u0435\
\u0444\u0430\u043A\u0442\u0430"
type: Tweak
- message: "\u042D\u0444\u0444\u0435\u043A\u0442 \u0441\u043F\u0430\u0432\u043D\u0430\
\ \u0441\u0438\u043D\u0433\u0443\u043B\u044F\u0440\u043D\u043E\u0441\u0442\u0438\
\ \u043F\u043E\u043D\u0438\u0436\u0435\u043D \u0432 \u0446\u0435\u043D\u0435\
\ \u0441 10 \u0434\u043E 8 \u043E\u0447\u043A\u043E\u0432, \u0442\u0430\u043A\
\ \u043A\u0430\u043A \u043A\u0430\u0436\u0435\u0442\u0441\u044F, \u0447\u0442\
\u043E \u0432\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435\u0433\u043E\
\ 1 \u044D\u0444\u0444\u0435\u043A\u0442 \u0434\u043B\u044F \u0430\u0440\u0442\
\u0435\u0444\u0430\u043A\u0442\u0430 \u0438\u0433\u0440\u0430 \u043D\u0435 \u0441\
\u043F\u043E\u0441\u043E\u0431\u043D\u0430 \u0438 \u0442\u0440\u0430\u0442\u0438\
\u0442 \u043E\u0447\u043A\u0438 \u043D\u0430 \u0440\u0430\u0437\u043D\u0443\u044E\
\ \u0445\u0443\u0439\u043D\u044E."
type: Tweak
id: 521
time: '2024-08-25T07:37:38.0000000+00:00'
url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/665

View File

@@ -235,8 +235,17 @@
type: SpellSelectorBUI
enum.CultEmpowerRemoveUiKey.Key:
type: SpellRemoverBUI
enum.StoreUiKey.Key:
type: StoreBoundUserInterface
# WD-EDIT END
- type: Puller
# WD edit start
- type: Store
preset: StorePresetMeatyOre
balance:
MeatyOreCoin: 0
- type: IgnorBUIInteractionRange # Oleg kryt
# WD edit end
- type: Butcherable
butcheringType: Spike # TODO human.
spawned:

View File

@@ -17,6 +17,7 @@
grid:
- 0,0,1,2
maxItemSize: Large
clickInsert: false
storageInsertSound:
path: /Audio/Voice/Slime/slime_squish.ogg
- type: ContainerContainer

View File

@@ -38,7 +38,7 @@
materials:
Steel: 250
Plastic: 100
- type: latheRecipe
id: WeaponLaserCarbine
result: WeaponLaserCarbine
@@ -390,6 +390,30 @@
materials:
Steel: 120
- type: latheRecipe # WD
id: MagazineShotgun
result: MagazineShotgun
category: Ammo
completetime: 5
materials:
Steel: 300
- type: latheRecipe # WD
id: MagazineShotgunSlug
result: MagazineShotgunSlug
category: Ammo
completetime: 5
materials:
Steel: 300
- type: latheRecipe # WD
id: MagazinePistolCaselessRifle
result: MagazinePistolCaselessRifle
category: Ammo
completetime: 5
materials:
Steel: 300
- type: latheRecipe
id: ShellShotgunIncendiary
result: ShellShotgunIncendiary

View File

@@ -19,6 +19,7 @@
currencyWhitelist:
- MeatyOreCoin
# This is unused now
- type: entity
id: StoreMeatyOreEntity
name: ThisIsDumb
@@ -32,5 +33,4 @@
interfaces:
enum.StoreUiKey.Key:
type: StoreBoundUserInterface
range: -1
- type: IgnorBUIInteractionRange

View File

@@ -254,7 +254,7 @@
- type: artifactEffect
id: EffectRadiate
targetDepth: 1
targetDepth: 4
effectHint: artifact-effect-hint-release
components:
- type: RadiationSource
@@ -714,7 +714,7 @@
- type: artifactEffect
id: EffectSingulo
targetDepth: 10
targetDepth: 8
effectHint: artifact-effect-hint-destruction
components:
- type: SpawnArtifact
@@ -724,7 +724,7 @@
- type: artifactEffect
id: EffectTesla
targetDepth: 10
targetDepth: 8
effectHint: artifact-effect-hint-destruction
components:
- type: SpawnArtifact