-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into listening-post-map-changes
- Loading branch information
Showing
431 changed files
with
9,750 additions
and
2,265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
# Hey there fork dev! If you like to include your own contributors in this then you can probably just change this to your own repo | ||
# Do this in dump_github_contributors.ps1 too into your own repo | ||
if: github.repository == 'DeltaV-Station/Delta-v-rebase' | ||
if: github.repository == 'DeltaV-Station/Delta-v' | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -23,25 +23,25 @@ jobs: | |
|
||
# TODO | ||
#- name: Get this week's Patreons | ||
# run: Tools/script2dumppatreons > Resources/Credits/Patrons.yml | ||
# run: Tools/script2dumppatreons > Resources/Credits/Patrons.yml | ||
|
||
# MAKE SURE YOU ENABLED "Allow GitHub Actions to create and approve pull requests" IN YOUR ACTIONS, OTHERWISE IT WILL MOST LIKELY FAIL | ||
|
||
|
||
# For this you can use a pat token of an account with direct push access to the repo if you have protected branches. | ||
# For this you can use a pat token of an account with direct push access to the repo if you have protected branches. | ||
# Uncomment this and comment the other line if you do this. | ||
# https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches | ||
|
||
#- name: Commit new credit files | ||
# uses: stefanzweifel/git-auto-commit-action@v4 | ||
# with: | ||
# commit_message: Update Credits | ||
# commit_author: PJBot <[email protected]> | ||
|
||
# This will make a PR | ||
- name: Set current date as env variable | ||
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,40 @@ | ||
using Content.Client.Examine; | ||
using Content.Client.Storage.UI; | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Client.Verbs.UI; | ||
using Content.Shared.Input; | ||
using Content.Shared.Interaction; | ||
using Content.Client.Storage.Systems; | ||
using Content.Shared.Storage; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Shared.Input; | ||
using static Content.Shared.Storage.StorageComponent; | ||
|
||
namespace Content.Client.Storage | ||
{ | ||
[UsedImplicitly] | ||
public sealed class StorageBoundUserInterface : BoundUserInterface | ||
{ | ||
[ViewVariables] | ||
private StorageWindow? _window; | ||
|
||
[Dependency] private readonly IEntityManager _entManager = default!; | ||
|
||
public StorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
namespace Content.Client.Storage; | ||
|
||
if (_window == null) | ||
{ | ||
// TODO: This is a bit of a mess but storagecomponent got moved to shared and cleaned up a bit. | ||
var controller = IoCManager.Resolve<IUserInterfaceManager>().GetUIController<StorageUIController>(); | ||
_window = controller.EnsureStorageWindow(Owner); | ||
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName; | ||
|
||
_window.EntityList.GenerateItem += _window.GenerateButton; | ||
_window.EntityList.ItemPressed += InteractWithItem; | ||
_window.StorageContainerButton.OnPressed += TouchedContainerButton; | ||
|
||
_window.OnClose += Close; | ||
|
||
if (EntMan.TryGetComponent<StorageComponent>(Owner, out var storageComp)) | ||
{ | ||
BuildEntityList(Owner, storageComp); | ||
} | ||
|
||
} | ||
else | ||
{ | ||
_window.Open(); | ||
} | ||
} | ||
|
||
public void BuildEntityList(EntityUid uid, StorageComponent component) | ||
{ | ||
_window?.BuildEntityList(uid, component); | ||
} | ||
[UsedImplicitly] | ||
public sealed class StorageBoundUserInterface : BoundUserInterface | ||
{ | ||
[Dependency] private readonly IEntityManager _entManager = default!; | ||
|
||
public void InteractWithItem(BaseButton.ButtonEventArgs? args, ListData? cData) | ||
{ | ||
if (args == null || cData is not EntityListData { Uid: var entity }) | ||
return; | ||
private readonly StorageSystem _storage; | ||
|
||
if (args.Event.Function == EngineKeyFunctions.UIClick) | ||
{ | ||
SendPredictedMessage(new StorageInteractWithItemEvent(_entManager.GetNetEntity(entity))); | ||
} | ||
else if (EntMan.EntityExists(entity)) | ||
{ | ||
OnButtonPressed(args.Event, entity); | ||
} | ||
} | ||
public StorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_storage = _entManager.System<StorageSystem>(); | ||
} | ||
|
||
private void OnButtonPressed(GUIBoundKeyEventArgs args, EntityUid entity) | ||
{ | ||
if (args.Function == ContentKeyFunctions.ExamineEntity) | ||
{ | ||
EntMan.System<ExamineSystem>() | ||
.DoExamine(entity); | ||
} | ||
else if (args.Function == EngineKeyFunctions.UseSecondary) | ||
{ | ||
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<VerbMenuUIController>().OpenVerbMenu(entity); | ||
} | ||
else if (args.Function == ContentKeyFunctions.ActivateItemInWorld) | ||
{ | ||
EntMan.EntityNetManager?.SendSystemNetworkMessage( | ||
new InteractInventorySlotEvent(EntMan.GetNetEntity(entity), altInteract: false)); | ||
} | ||
else if (args.Function == ContentKeyFunctions.AltActivateItemInWorld) | ||
{ | ||
EntMan.RaisePredictiveEvent(new InteractInventorySlotEvent(EntMan.GetNetEntity(entity), altInteract: true)); | ||
} | ||
else | ||
{ | ||
return; | ||
} | ||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
|
||
args.Handle(); | ||
} | ||
_storage.CloseStorageWindow(Owner); | ||
} | ||
|
||
public void TouchedContainerButton(BaseButton.ButtonEventArgs args) | ||
{ | ||
SendPredictedMessage(new StorageInsertItemMessage()); | ||
} | ||
protected override void ReceiveMessage(BoundUserInterfaceMessage message) | ||
{ | ||
base.ReceiveMessage(message); | ||
|
||
protected override void Dispose(bool disposing) | ||
if (message is StorageModifyWindowMessage) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
|
||
if (_window != null) | ||
{ | ||
_window.Orphan(); | ||
_window.EntityList.GenerateItem -= _window.GenerateButton; | ||
_window.EntityList.ItemPressed -= InteractWithItem; | ||
_window.StorageContainerButton.OnPressed -= TouchedContainerButton; | ||
_window.OnClose -= Close; | ||
_window = null; | ||
} | ||
if (_entManager.TryGetComponent<StorageComponent>(Owner, out var comp)) | ||
_storage.OpenStorageWindow((Owner, comp)); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.