Update template to latest RobustToolbox version.

- Converts template to use file-scoped namespaces.
- Add manifest.yml and comments for it.
This commit is contained in:
Vera Aguilera Puerto 2021-12-29 12:21:56 +01:00
parent b417f4355e
commit 729c2a6206
18 changed files with 197 additions and 272 deletions

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
<TargetFramework>$(TargetFramework)</TargetFramework>
<LangVersion>9</LangVersion>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>../bin/Content.Shared</OutputPath>

View file

@ -3,40 +3,39 @@ using Robust.Shared.ContentPack;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
// DEVNOTE: Games that want to be on the hub are FORCED use the "Content." prefix for assemblies they want to load.
namespace Content.Shared
// DEVNOTE: Games that want to be on the hub can change their namespace prefix in the "manifest.yml" file.
namespace Content.Shared;
public class EntryPoint : GameShared
{
public class EntryPoint : GameShared
{
// IoC services shared between the client and the server go here...
// IoC services shared between the client and the server go here...
// See line 23. Controls the default game culture and language.
// Robust calls this culture, but you might find it more fitting to call it the game
// language. Robust doesn't support changing this mid-game. Load your config file early
// if you want that.
private const string Culture = "en-US";
// See line 23. Controls the default game culture and language.
// Robust calls this culture, but you might find it more fitting to call it the game
// language. Robust doesn't support changing this mid-game. Load your config file early
// if you want that.
private const string Culture = "en-US";
public override void PreInit()
{
IoCManager.InjectDependencies(this);
public override void PreInit()
{
IoCManager.InjectDependencies(this);
// Default to en-US.
// DEVNOTE: If you want your game to be multiregional at runtime, you'll need to
// do something more complicated here.
IoCManager.Resolve<ILocalizationManager>().LoadCulture(new CultureInfo(Culture));
// TODO: Document what else you might want to put here
}
// Default to en-US.
// DEVNOTE: If you want your game to be multiregional at runtime, you'll need to
// do something more complicated here.
IoCManager.Resolve<ILocalizationManager>().LoadCulture(new CultureInfo(Culture));
// TODO: Document what else you might want to put here
}
public override void Init()
{
// TODO: Document what you put here
}
public override void Init()
{
// TODO: Document what you put here
}
public override void PostInit()
{
base.PostInit();
// DEVNOTE: You might want to put special init handlers for, say, tiles here.
// TODO: Document what else you might want to put here
}
public override void PostInit()
{
base.PostInit();
// DEVNOTE: You might want to put special init handlers for, say, tiles here.
// TODO: Document what else you might want to put here
}
}

View file

@ -1,21 +1,20 @@
using Robust.Shared;
using Robust.Shared.Configuration;
namespace Content.Shared
{
// DEVNOTE: This is the same as SS14's CCVars. Except it's not named CCVars as that name is
// hot garbage.
[CVarDefs]
public sealed class GameConfigVars: CVars
{
// Declare persistent game config variables here.
// ```
// public static readonly CVarDef<SerializableType>
// VariableName = CVarDef.Create("namespace.varname", default_value, CVar.TYPE | CVar.OTHERTYPE)
// ```
// This is a good spot to store your database config, among other things.
namespace Content.Shared;
public static readonly CVarDef<bool>
DummyCVarForTemplate = CVarDef.Create("dummy.whydoineedthis", true, CVar.ARCHIVE);
}
// DEVNOTE: This is the same as SS14's CCVars. Except it's not named CCVars as that name is
// hot garbage.
[CVarDefs]
public sealed class GameConfigVars: CVars
{
// Declare persistent game config variables here.
// ```
// public static readonly CVarDef<SerializableType>
// VariableName = CVarDef.Create("namespace.varname", default_value, CVar.TYPE | CVar.OTHERTYPE)
// ```
// This is a good spot to store your database config, among other things.
public static readonly CVarDef<bool>
DummyCVarForTemplate = CVarDef.Create("dummy.whydoineedthis", true, CVar.ARCHIVE);
}

View file

@ -1,11 +1,10 @@
using Robust.Shared.Input;
namespace Content.Shared.Input
namespace Content.Shared.Input;
[KeyFunctions]
public static class ContentKeyFunctions
{
[KeyFunctions]
public static class ContentKeyFunctions
{
// DEVNOTE: Stick keys you want to be bindable here.
// public static readonly DummyKey = "DummyKey";
}
// DEVNOTE: Stick keys you want to be bindable here.
// public static readonly DummyKey = "DummyKey";
}