Merge branch 'master' into kitchen

This commit is contained in:
Pieter-Jan Briers
2020-05-05 11:35:20 +02:00
committed by GitHub
112 changed files with 2184 additions and 408 deletions

View File

@@ -0,0 +1,22 @@
using System;
using Content.Shared.GameObjects.Components.Sound;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Random;
namespace Content.Shared.Audio
{
public static class AudioHelpers{
/// <summary>
/// Returns a random pitch.
/// </summary>
public static AudioParams WithVariation(float amplitude)
{
var scale = (float)(IoCManager.Resolve<IRobustRandom>().NextGaussian(1, amplitude));
return AudioParams.Default.WithPitchScale(scale);
}
}
}

View File

@@ -1,23 +1,36 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using Content.Shared.Maps;
using Robust.Shared.ContentPack;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
namespace Content.Shared
{
public class EntryPoint : GameShared
{
// If you want to change your codebase's language, do it here.
private const string Culture = "en-US";
#pragma warning disable 649
[Dependency] private readonly IPrototypeManager _prototypeManager;
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
#pragma warning restore 649
public override void PreInit()
{
IoCManager.InjectDependencies(this);
// Default to en-US.
_localizationManager.LoadCulture(new CultureInfo(Culture));
}
public override void Init()
{
IoCManager.InjectDependencies(this);
}
public override void PostInit()

View File

@@ -0,0 +1,57 @@
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Gravity
{
public class SharedGravityGeneratorComponent: Component
{
public override string Name => "GravityGenerator";
public override uint? NetID => ContentNetIDs.GRAVITY_GENERATOR;
/// <summary>
/// Sent to the server to set whether the generator should be on or off
/// </summary>
[Serializable, NetSerializable]
public class SwitchGeneratorMessage : BoundUserInterfaceMessage
{
public bool On;
public SwitchGeneratorMessage(bool on)
{
On = on;
}
}
/// <summary>
/// Sent to the server when requesting the status of the generator
/// </summary>
[Serializable, NetSerializable]
public class GeneratorStatusRequestMessage : BoundUserInterfaceMessage
{
public GeneratorStatusRequestMessage()
{
}
}
[Serializable, NetSerializable]
public class GeneratorState : BoundUserInterfaceState
{
public bool On;
public GeneratorState(bool on)
{
On = on;
}
}
[Serializable, NetSerializable]
public enum GravityGeneratorUiKey
{
Key
}
}
}

View File

@@ -43,5 +43,6 @@
public const uint REAGENT_INJECTOR = 1038;
public const uint GHOST = 1039;
public const uint MICROWAVE = 1040;
public const uint GRAVITY_GENERATOR = 1041;
}
}

View File

@@ -5,8 +5,7 @@ namespace Content.Shared.Input
[KeyFunctions]
public static class ContentKeyFunctions
{
public static readonly BoundKeyFunction UseOrAttack = "UseOrAttack";
public static readonly BoundKeyFunction Attack = "Attack";
public static readonly BoundKeyFunction WideAttack = "WideAttack";
public static readonly BoundKeyFunction ActivateItemInHand = "ActivateItemInHand";
public static readonly BoundKeyFunction ActivateItemInWorld = "ActivateItemInWorld"; // default action on world entity
public static readonly BoundKeyFunction Drop = "Drop";
@@ -16,6 +15,8 @@ namespace Content.Shared.Input
public static readonly BoundKeyFunction OpenContextMenu = "OpenContextMenu";
public static readonly BoundKeyFunction OpenCraftingMenu = "OpenCraftingMenu";
public static readonly BoundKeyFunction OpenInventoryMenu = "OpenInventoryMenu";
public static readonly BoundKeyFunction SmartEquipBackpack = "SmartEquipBackpack";
public static readonly BoundKeyFunction SmartEquipBelt = "SmartEquipBelt";
public static readonly BoundKeyFunction OpenTutorial = "OpenTutorial";
public static readonly BoundKeyFunction SwapHands = "SwapHands";
public static readonly BoundKeyFunction ThrowItemInHand = "ThrowItemInHand";
@@ -24,5 +25,7 @@ namespace Content.Shared.Input
public static readonly BoundKeyFunction OpenEntitySpawnWindow = "OpenEntitySpawnWindow";
public static readonly BoundKeyFunction OpenSandboxWindow = "OpenSandboxWindow";
public static readonly BoundKeyFunction OpenTileSpawnWindow = "OpenTileSpawnWindow";
public static readonly BoundKeyFunction TakeScreenshot = "TakeScreenshot";
public static readonly BoundKeyFunction TakeScreenshotNoUI = "TakeScreenshotNoUI";
}
}

View File

@@ -138,7 +138,7 @@ namespace Content.Shared
public string GamemodeTitle;
public TimeSpan RoundDuration;
public uint PlayerCount;