Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combat mode oomph #276

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Just-a-Unity-Dev marked this conversation as resolved.
Show resolved Hide resolved
Just-a-Unity-Dev marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Just-a-Unity-Dev marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Just-a-Unity-Dev marked this conversation as resolved.
Show resolved Hide resolved
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.
Loading