forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #772 from TheArturZh/upstream-merge-53
Upstream merge 53
- Loading branch information
Showing
992 changed files
with
159,205 additions
and
45,657 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" | ||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4=" | ||
fi | ||
use flake |
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
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
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using Content.Shared.CCVar; | ||
|
||
namespace Content.Client.Options; | ||
|
||
/// <summary> | ||
/// Allows specifying sprite alternatives depending on the client's accessibility options. | ||
/// </summary> | ||
/// <remarks> | ||
/// A list of layer mappings is given that the component applies to, | ||
/// and it will pick one entry to apply based on the settings configuration. Example: | ||
/// | ||
/// <code> | ||
/// - type: Sprite | ||
/// sprite: Effects/optionsvisualizertest.rsi | ||
/// layers: | ||
/// - state: none | ||
/// map: [ "layer" ] | ||
/// - type: OptionsVisualizer | ||
/// visuals: | ||
/// layer: | ||
/// - options: Default | ||
/// data: { state: none } | ||
/// - options: Test | ||
/// data: { state: test } | ||
/// - options: ReducedMotion | ||
/// data: { state: motion } | ||
/// - options: [Test, ReducedMotion] | ||
/// data: { state: both } | ||
/// </code> | ||
/// </remarks> | ||
/// <seealso cref="OptionsVisualizerSystem"/> | ||
/// <seealso cref="OptionVisualizerOptions"/> | ||
[RegisterComponent] | ||
public sealed partial class OptionsVisualizerComponent : Component | ||
{ | ||
/// <summary> | ||
/// A mapping storing data about which sprite layer keys should be controlled. | ||
/// </summary> | ||
/// <remarks> | ||
/// Each layer stores an array of possible options. The last entry with a | ||
/// <see cref="LayerDatum.Options"/> matching the active user preferences will be picked. | ||
/// This allows choosing a priority if multiple entries are matched. | ||
/// </remarks> | ||
[DataField(required: true)] | ||
public Dictionary<string, LayerDatum[]> Visuals = default!; | ||
|
||
/// <summary> | ||
/// A single option for a layer to be selected. | ||
/// </summary> | ||
[DataDefinition] | ||
public sealed partial class LayerDatum | ||
{ | ||
/// <summary> | ||
/// Which options must be set by the user to make this datum match. | ||
/// </summary> | ||
[DataField] | ||
public OptionVisualizerOptions Options { get; set; } | ||
|
||
/// <summary> | ||
/// The sprite layer data to set on the sprite when this datum matches. | ||
/// </summary> | ||
[DataField] | ||
public PrototypeLayerData Data { get; set; } | ||
} | ||
} | ||
|
||
[Flags] | ||
public enum OptionVisualizerOptions | ||
{ | ||
/// <summary> | ||
/// Corresponds to no special options being set, can be used as a "default" state. | ||
/// </summary> | ||
Default = 0, | ||
|
||
/// <summary> | ||
/// Corresponds to the <see cref="CCVars.DebugOptionVisualizerTest"/> CVar being set. | ||
/// </summary> | ||
Test = 1 << 0, | ||
|
||
/// <summary> | ||
/// Corresponds to the <see cref="CCVars.ReducedMotion"/> CVar being set. | ||
/// </summary> | ||
ReducedMotion = 1 << 1, | ||
} |
Oops, something went wrong.