Skip to content

Commit

Permalink
Combat mode oomph (#276)
Browse files Browse the repository at this point in the history
* Combat mode oomph

* wtf???

* Rerun tests
  • Loading branch information
Just-a-Unity-Dev authored Apr 12, 2024
1 parent 10f3744 commit 2d07d4f
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 12 deletions.
20 changes: 9 additions & 11 deletions Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Serialization;
using Robust.Client.UserInterface;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.Utility;

namespace Content.Client.CombatMode;
Expand All @@ -32,7 +30,7 @@ public sealed class CombatModeIndicatorsOverlay : Overlay

public override OverlaySpace Space => OverlaySpace.ScreenSpace;

public Color MainColor = Color.White.WithAlpha(0.3f);
public Color MainColor = Color.White.WithAlpha(1f);
public Color StrokeColor = Color.Black.WithAlpha(0.5f);
public float Scale = 0.6f; // 1 is a little big

Expand All @@ -46,12 +44,12 @@ public CombatModeIndicatorsOverlay(IInputManager input, IEntityManager entMan,
_hands = hands;

var spriteSys = _entMan.EntitySysManager.GetEntitySystem<SpriteSystem>();
_gunSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"),
_gunSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/_FTL/Interface/Misc/crosshair_pointers.rsi"),
"gun_sight"));
_gunBoltSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"),
_gunBoltSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/_FTL/Interface/Misc/crosshair_pointers.rsi"),
"gun_bolt_sight"));
_meleeSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/crosshair_pointers.rsi"),
"melee_sight"));
_meleeSight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/_FTL/Interface/Misc/crosshair_pointers.rsi"),
"melee_sight"));
}

protected override bool BeforeDraw(in OverlayDrawArgs args)
Expand Down Expand Up @@ -87,11 +85,11 @@ protected override void Draw(in OverlayDrawArgs args)
private void DrawSight(Texture sight, DrawingHandleScreen screen, Vector2 centerPos, float scale)
{
var sightSize = sight.Size * scale;
var expandedSize = sightSize + new Vector2(7f, 7f);
// var expandedSize = sightSize + new Vector2(7f, 7f);

// screen.DrawTextureRect(sight,
// UIBox2.FromDimensions(centerPos - sightSize * 0.5f, sightSize), StrokeColor);
screen.DrawTextureRect(sight,
UIBox2.FromDimensions(centerPos - sightSize * 0.5f, sightSize), StrokeColor);
screen.DrawTextureRect(sight,
UIBox2.FromDimensions(centerPos - expandedSize * 0.5f, expandedSize), MainColor);
UIBox2.FromDimensions(centerPos - sightSize * 0.5f, sightSize), MainColor);
}
}
3 changes: 3 additions & 0 deletions Content.Shared/CombatMode/SharedCombatModeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.MouseRotator;
using Content.Shared.Movement.Components;
using Content.Shared.Popups;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Network;
using Robust.Shared.Timing;

Expand All @@ -13,6 +14,7 @@ public abstract class SharedCombatModeSystem : EntitySystem
[Dependency] private readonly INetManager _netMan = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -51,6 +53,7 @@ private void OnActionPerform(EntityUid uid, CombatModeComponent component, Toggl
return;

var msg = component.IsInCombatMode ? "action-popup-combat-enabled" : "action-popup-combat-disabled";
_audio.PlayGlobal(component.IsInCombatMode ? "/Audio/_FTL/Effects/CombatMode/on.ogg" : "/Audio/_FTL/Effects/CombatMode/off.ogg", uid);
_popup.PopupEntity(Loc.GetString(msg), args.Performer, args.Performer);
}

Expand Down
4 changes: 4 additions & 0 deletions Resources/Audio/_FTL/Effects/CombatMode/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["on.ogg", "off.ogg"]
license: "CC-BY-3.0"
copyright: 'Obtained at /tg/station at commit 87c4c6ae94acd6ac8000bc0c2f43fc2cfc928224. Converted to mono by Just-a-Unity-Dev'
source: "https://github.com/tgstation/tgstation/blob/87c4c6ae94acd6ac8000bc0c2f43fc2cfc928224"
Binary file added Resources/Audio/_FTL/Effects/CombatMode/off.ogg
Binary file not shown.
Binary file added Resources/Audio/_FTL/Effects/CombatMode/on.ogg
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Audio/_FTL/Machines/attributions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- files: ["beep.ogg", "pda_button1.ogg", "pda_button2.ogg"]
license: "CC-BY-4.0"
license: "CC-BY-3.0"
copyright: 'Obtained at /tg/station at commit 87c4c6ae94acd6ac8000bc0c2f43fc2cfc928224. Converted to mono by Just-a-Unity-Dev'
source: "https://github.com/tgstation/tgstation/blob/87c4c6ae94acd6ac8000bc0c2f43fc2cfc928224"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Assets made by Just-a-Unity-Dev",
"size": {
"x": 64,
"y": 64
},
"states": [
{
"name": "gun_sight"
},
{
"name": "gun_bolt_sight"
},
{
"name": "melee_sight"
},
{
"name": "pointer"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d07d4f

Please sign in to comment.