diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 3baf1f5ece..a1b82d7e2f 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -29,6 +29,9 @@ namespace OpenRA { public static class Game { + [TranslationReference("filename")] + const string SavedScreenshot = "saved-screenshot"; + public const int TimestepJankThreshold = 250; // Don't catch up for delays larger than 250ms public static InstalledMods Mods { get; private set; } @@ -571,9 +574,6 @@ namespace OpenRA public static void RunAfterTick(Action a) { delayedActions.Add(a, RunTime); } public static void RunAfterDelay(int delayMilliseconds, Action a) { delayedActions.Add(a, RunTime + delayMilliseconds); } - [TranslationReference("filename")] - static readonly string SavedScreenshot = "saved-screenshot"; - static void TakeScreenshotInner() { using (new PerfTimer("Renderer.SaveScreenshot")) diff --git a/OpenRA.Game/Server/PlayerMessageTracker.cs b/OpenRA.Game/Server/PlayerMessageTracker.cs index 4fcb39f79f..a271a3394a 100644 --- a/OpenRA.Game/Server/PlayerMessageTracker.cs +++ b/OpenRA.Game/Server/PlayerMessageTracker.cs @@ -17,7 +17,7 @@ namespace OpenRA.Server class PlayerMessageTracker { [TranslationReference("remaining")] - static readonly string ChatTemporaryDisabled = "chat-temp-disabled"; + const string ChatTemporaryDisabled = "chat-temp-disabled"; readonly Dictionary> messageTracker = new Dictionary>(); readonly Server server; diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index dc348fb4a5..3b1ffa452f 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -46,6 +46,75 @@ namespace OpenRA.Server public sealed class Server { + [TranslationReference] + const string CustomRules = "custom-rules"; + + [TranslationReference] + const string BotsDisabled = "bots-disabled"; + + [TranslationReference] + const string TwoHumansRequired = "two-humans-required"; + + [TranslationReference] + const string ErrorGameStarted = "error-game-started"; + + [TranslationReference] + const string RequiresPassword = "requires-password"; + + [TranslationReference] + const string IncorrectPassword = "incorrect-password"; + + [TranslationReference] + const string IncompatibleMod = "incompatible-mod"; + + [TranslationReference] + const string IncompatibleVersion = "incompatible-version"; + + [TranslationReference] + const string IncompatibleProtocol = "incompatible-protocol"; + + [TranslationReference] + const string Banned = "banned"; + + [TranslationReference] + const string TempBanned = "temp-banned"; + + [TranslationReference] + const string Full = "full"; + + [TranslationReference("player")] + const string Joined = "joined"; + + [TranslationReference] + const string RequiresForumAccount = "requires-forum-account"; + + [TranslationReference] + const string NoPermission = "no-permission"; + + [TranslationReference("command")] + const string UnknownServerCommand = "unknown-server-command"; + + [TranslationReference("player")] + const string LobbyDisconnected = "lobby-disconnected"; + + [TranslationReference("player")] + const string PlayerDisconnected = "player-disconnected"; + + [TranslationReference("player", "team")] + const string PlayerTeamDisconnected = "player-team-disconnected"; + + [TranslationReference("player")] + const string ObserverDisconnected = "observer-disconnected"; + + [TranslationReference("player")] + const string NewAdmin = "new-admin"; + + [TranslationReference] + const string YouWereKicked = "you-were-kicked"; + + [TranslationReference] + const string GameStarted = "game-started"; + public readonly MersenneTwister Random = new MersenneTwister(); public readonly ServerType Type; @@ -81,75 +150,6 @@ namespace OpenRA.Server readonly Stopwatch pingUpdated = Stopwatch.StartNew(); readonly PlayerMessageTracker playerMessageTracker; - [TranslationReference] - static readonly string CustomRules = "custom-rules"; - - [TranslationReference] - static readonly string BotsDisabled = "bots-disabled"; - - [TranslationReference] - static readonly string TwoHumansRequired = "two-humans-required"; - - [TranslationReference] - static readonly string ErrorGameStarted = "error-game-started"; - - [TranslationReference] - static readonly string RequiresPassword = "requires-password"; - - [TranslationReference] - static readonly string IncorrectPassword = "incorrect-password"; - - [TranslationReference] - static readonly string IncompatibleMod = "incompatible-mod"; - - [TranslationReference] - static readonly string IncompatibleVersion = "incompatible-version"; - - [TranslationReference] - static readonly string IncompatibleProtocol = "incompatible-protocol"; - - [TranslationReference] - static readonly string Banned = "banned"; - - [TranslationReference] - static readonly string TempBanned = "temp-banned"; - - [TranslationReference] - static readonly string Full = "full"; - - [TranslationReference("player")] - static readonly string Joined = "joined"; - - [TranslationReference] - static readonly string RequiresForumAccount = "requires-forum-account"; - - [TranslationReference] - static readonly string NoPermission = "no-permission"; - - [TranslationReference("command")] - static readonly string UnknownServerCommand = "unknown-server-command"; - - [TranslationReference("player")] - static readonly string LobbyDisconnected = "lobby-disconnected"; - - [TranslationReference("player")] - static readonly string PlayerDisconnected = "player-disconnected"; - - [TranslationReference("player", "team")] - static readonly string PlayerTeamDisconnected = "player-team-disconnected"; - - [TranslationReference("player")] - static readonly string ObserverDisconnected = "observer-disconnected"; - - [TranslationReference("player")] - public static readonly string NewAdmin = "new-admin"; - - [TranslationReference] - static readonly string YouWereKicked = "you-were-kicked"; - - [TranslationReference] - public static readonly string GameStarted = "game-started"; - public ServerState State { get => internalState; diff --git a/OpenRA.Mods.Common/Commands/ChatCommands.cs b/OpenRA.Mods.Common/Commands/ChatCommands.cs index c881fef88e..0ecb6841f5 100644 --- a/OpenRA.Mods.Common/Commands/ChatCommands.cs +++ b/OpenRA.Mods.Common/Commands/ChatCommands.cs @@ -22,10 +22,10 @@ namespace OpenRA.Mods.Common.Commands public class ChatCommands : INotifyChat { - public Dictionary Commands { get; } - [TranslationReference("name")] - static readonly string InvalidCommand = "invalid-command"; + const string InvalidCommand = "invalid-command"; + + public Dictionary Commands { get; } public ChatCommands() { diff --git a/OpenRA.Mods.Common/Commands/DebugVisualizationCommands.cs b/OpenRA.Mods.Common/Commands/DebugVisualizationCommands.cs index bf994d838b..b333394e8a 100644 --- a/OpenRA.Mods.Common/Commands/DebugVisualizationCommands.cs +++ b/OpenRA.Mods.Common/Commands/DebugVisualizationCommands.cs @@ -24,19 +24,19 @@ namespace OpenRA.Mods.Common.Commands public class DebugVisualizationCommands : IChatCommand, IWorldLoaded { [TranslationReference] - static readonly string CombatGeometryDescription = "combat-geometry-description"; + const string CombatGeometryDescription = "combat-geometry-description"; [TranslationReference] - static readonly string RenderGeometryDescription = "render-geometry-description"; + const string RenderGeometryDescription = "render-geometry-description"; [TranslationReference] - static readonly string ScreenMapOverlayDescription = "screen-map-overlay-description"; + const string ScreenMapOverlayDescription = "screen-map-overlay-description"; [TranslationReference] - static readonly string DepthBufferDescription = "depth-buffer-description"; + const string DepthBufferDescription = "depth-buffer-description"; [TranslationReference] - static readonly string ActorTagsOverlayDescripition = "actor-tags-overlay-description"; + const string ActorTagsOverlayDescripition = "actor-tags-overlay-description"; readonly IDictionary Handler)> commandHandlers = new Dictionary Handler)> { diff --git a/OpenRA.Mods.Common/Commands/DevCommands.cs b/OpenRA.Mods.Common/Commands/DevCommands.cs index 351d9a69a2..694fe6725c 100644 --- a/OpenRA.Mods.Common/Commands/DevCommands.cs +++ b/OpenRA.Mods.Common/Commands/DevCommands.cs @@ -25,55 +25,55 @@ namespace OpenRA.Mods.Common.Commands public class DevCommands : IChatCommand, IWorldLoaded { [TranslationReference] - static readonly string CheatsDisabled = "cheats-disabled"; + const string CheatsDisabled = "cheats-disabled"; [TranslationReference] - static readonly string InvalidCashAmount = "invalid-cash-amount"; + const string InvalidCashAmount = "invalid-cash-amount"; [TranslationReference] - static readonly string ToggleVisiblityDescription = "toggle-visibility"; + const string ToggleVisiblityDescription = "toggle-visibility"; [TranslationReference] - static readonly string GiveCashDescription = "give-cash"; + const string GiveCashDescription = "give-cash"; [TranslationReference] - static readonly string GiveCashAllDescription = "give-cash-all"; + const string GiveCashAllDescription = "give-cash-all"; [TranslationReference] - static readonly string InstantBuildingDescription = "instant-building"; + const string InstantBuildingDescription = "instant-building"; [TranslationReference] - static readonly string BuildAnywhereDescription = "build-anywhere"; + const string BuildAnywhereDescription = "build-anywhere"; [TranslationReference] - static readonly string UnlimitedPowerDescription = "unlimited-power"; + const string UnlimitedPowerDescription = "unlimited-power"; [TranslationReference] - static readonly string EnableTechDescription = "enable-tech"; + const string EnableTechDescription = "enable-tech"; [TranslationReference] - static readonly string FastChargeDescription = "fast-charge"; + const string FastChargeDescription = "fast-charge"; [TranslationReference] - static readonly string DevCheatAllDescription = "dev-cheat-all"; + const string DevCheatAllDescription = "dev-cheat-all"; [TranslationReference] - static readonly string DevCrashDescription = "dev-crash"; + const string DevCrashDescription = "dev-crash"; [TranslationReference] - static readonly string LevelUpActorDescription = "levelup-actor"; + const string LevelUpActorDescription = "levelup-actor"; [TranslationReference] - static readonly string PlayerExperienceDescription = "player-experience"; + const string PlayerExperienceDescription = "player-experience"; [TranslationReference] - static readonly string PowerOutageDescription = "power-outage"; + const string PowerOutageDescription = "power-outage"; [TranslationReference] - static readonly string KillSelectedActorsDescription = "kill-selected-actors"; + const string KillSelectedActorsDescription = "kill-selected-actors"; [TranslationReference] - static readonly string DisposeSelectedActorsDescription = "dispose-selected-actors"; + const string DisposeSelectedActorsDescription = "dispose-selected-actors"; readonly IDictionary Handler)> commandHandlers = new Dictionary)> { diff --git a/OpenRA.Mods.Common/Commands/HelpCommand.cs b/OpenRA.Mods.Common/Commands/HelpCommand.cs index 03319be9dd..432fcecabe 100644 --- a/OpenRA.Mods.Common/Commands/HelpCommand.cs +++ b/OpenRA.Mods.Common/Commands/HelpCommand.cs @@ -21,17 +21,17 @@ namespace OpenRA.Mods.Common.Commands public class HelpCommand : IChatCommand, IWorldLoaded { + [TranslationReference] + const string AvailableCommands = "available-commands"; + + [TranslationReference] + const string NoDescription = "no-description"; + + [TranslationReference] + const string HelpDescription = "help-description"; + readonly Dictionary helpDescriptions; - [TranslationReference] - static readonly string AvailableCommands = "available-commands"; - - [TranslationReference] - static readonly string NoDescription = "no-description"; - - [TranslationReference] - static readonly string HelpDescription = "help-description"; - World world; ChatCommands console; diff --git a/OpenRA.Mods.Common/Commands/PlayerCommands.cs b/OpenRA.Mods.Common/Commands/PlayerCommands.cs index 038c9f94ee..cff97efb9f 100644 --- a/OpenRA.Mods.Common/Commands/PlayerCommands.cs +++ b/OpenRA.Mods.Common/Commands/PlayerCommands.cs @@ -20,14 +20,14 @@ namespace OpenRA.Mods.Common.Commands public class PlayerCommands : IChatCommand, IWorldLoaded { + [TranslationReference] + const string PauseDescription = "pause-description"; + + [TranslationReference] + const string SurrenderDescription = "surrender-description"; + World world; - [TranslationReference] - static readonly string PauseDescription = "pause-description"; - - [TranslationReference] - static readonly string SurrenderDescription = "surrender-description"; - public void WorldLoaded(World w, WorldRenderer wr) { world = w; diff --git a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs index 3c02156da3..76826539e5 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs @@ -25,133 +25,133 @@ namespace OpenRA.Mods.Common.Server public class LobbyCommands : ServerTrait, IInterpretCommand, INotifyServerStart, INotifyServerEmpty, IClientJoined { [TranslationReference] - static readonly string CustomRules = "custom-rules"; + const string CustomRules = "custom-rules"; [TranslationReference] - static readonly string OnlyHostStartGame = "only-only-host-start-game"; + const string OnlyHostStartGame = "only-only-host-start-game"; [TranslationReference] - static readonly string NoStartUntilRequiredSlotsFull = "no-start-until-required-slots-full"; + const string NoStartUntilRequiredSlotsFull = "no-start-until-required-slots-full"; [TranslationReference] - static readonly string NoStartWithoutPlayers = "no-start-without-players"; + const string NoStartWithoutPlayers = "no-start-without-players"; [TranslationReference] - static readonly string TwoHumansRequired = "two-humans-required"; + const string TwoHumansRequired = "two-humans-required"; [TranslationReference] - static readonly string InsufficientEnabledSpawnPoints = "insufficient-enabled-spawnPoints"; + const string InsufficientEnabledSpawnPoints = "insufficient-enabled-spawnPoints"; [TranslationReference("command")] - static readonly string MalformedCommand = "malformed-command"; + const string MalformedCommand = "malformed-command"; [TranslationReference] - static readonly string KickNone = "kick-none"; + const string KickNone = "kick-none"; [TranslationReference] - static readonly string NoKickGameStarted = "no-kick-game-started"; + const string NoKickGameStarted = "no-kick-game-started"; [TranslationReference("admin", "player")] - static readonly string Kicked = "kicked"; + const string Kicked = "kicked"; [TranslationReference("admin", "player")] - static readonly string TempBan = "temp-ban"; + const string TempBan = "temp-ban"; [TranslationReference] - static readonly string NoTransferAdmin = "only-host-transfer-admin"; + const string NoTransferAdmin = "only-host-transfer-admin"; [TranslationReference] - static readonly string EmptySlot = "empty-slot"; + const string EmptySlot = "empty-slot"; [TranslationReference("admin", "player")] - static readonly string MoveSpectators = "move-spectators"; + const string MoveSpectators = "move-spectators"; [TranslationReference("player", "name")] - static readonly string Nick = "nick"; + const string Nick = "nick"; [TranslationReference] - static readonly string StateUnchangedReady = "state-unchanged-ready"; + const string StateUnchangedReady = "state-unchanged-ready"; [TranslationReference("command")] - static readonly string StateUnchangedGameStarted = "state-unchanged-game-started"; + const string StateUnchangedGameStarted = "state-unchanged-game-started"; [TranslationReference("faction")] - static readonly string InvalidFactionSelected = "invalid-faction-selected"; + const string InvalidFactionSelected = "invalid-faction-selected"; [TranslationReference("factions")] - static readonly string SupportedFactions = "supported-factions"; + const string SupportedFactions = "supported-factions"; [TranslationReference] - static readonly string RequiresHost = "requires-host"; + const string RequiresHost = "requires-host"; [TranslationReference] - static readonly string InvalidBotSlot = "invalid-bot-slot"; + const string InvalidBotSlot = "invalid-bot-slot"; [TranslationReference] - static readonly string InvalidBotType = "invalid-bot-type"; + const string InvalidBotType = "invalid-bot-type"; [TranslationReference] - static readonly string HostChangeMap = "only-host-change-map"; + const string HostChangeMap = "only-host-change-map"; [TranslationReference] - static readonly string UnknownMap = "unknown-map"; + const string UnknownMap = "unknown-map"; [TranslationReference] - static readonly string SearchingMap = "searching-map"; + const string SearchingMap = "searching-map"; [TranslationReference] - static readonly string NotAdmin = "only-host-change-configuration"; + const string NotAdmin = "only-host-change-configuration"; [TranslationReference] - static readonly string InvalidConfigurationCommand = "invalid-configuration-command"; + const string InvalidConfigurationCommand = "invalid-configuration-command"; [TranslationReference("option")] - static readonly string OptionLocked = "option-locked"; + const string OptionLocked = "option-locked"; [TranslationReference("player", "map")] - static readonly string ChangedMap = "changed-map"; + const string ChangedMap = "changed-map"; [TranslationReference] - static readonly string MapBotsDisabled = "map-bots-disabled"; + const string MapBotsDisabled = "map-bots-disabled"; [TranslationReference("player", "name", "value")] - static readonly string ValueChanged = "value-changed"; + const string ValueChanged = "value-changed"; [TranslationReference] - static readonly string NoMoveSpectators = "only-host-move-spectators"; + const string NoMoveSpectators = "only-host-move-spectators"; [TranslationReference] - static readonly string AdminOption = "admin-option"; + const string AdminOption = "admin-option"; [TranslationReference("raw")] - static readonly string NumberTeams = "number-teams"; + const string NumberTeams = "number-teams"; [TranslationReference] - static readonly string AdminClearSpawn = "admin-clear-spawn"; + const string AdminClearSpawn = "admin-clear-spawn"; [TranslationReference] - static readonly string SpawnOccupied = "spawn-occupied"; + const string SpawnOccupied = "spawn-occupied"; [TranslationReference] - static readonly string SpawnLocked = "spawn-locked"; + const string SpawnLocked = "spawn-locked"; [TranslationReference] - static readonly string AdminLobbyInfo = "admin-lobby-info"; + const string AdminLobbyInfo = "admin-lobby-info"; [TranslationReference] - static readonly string InvalidLobbyInfo = "invalid-lobby-info"; + const string InvalidLobbyInfo = "invalid-lobby-info"; [TranslationReference] - static readonly string AdminKick = "admin-kick"; + const string AdminKick = "admin-kick"; [TranslationReference] - static readonly string SlotClosed = "slot-closed"; + const string SlotClosed = "slot-closed"; [TranslationReference("player")] - public static readonly string NewAdmin = "new-admin"; + const string NewAdmin = "new-admin"; [TranslationReference] - static readonly string YouWereKicked = "you-were-kicked"; + const string YouWereKicked = "you-were-kicked"; readonly IDictionary> commandHandlers = new Dictionary> { diff --git a/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs b/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs index 4df7d0106b..8661bc23d1 100644 --- a/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/MasterServerPinger.cs @@ -31,17 +31,22 @@ namespace OpenRA.Mods.Common.Server const int RateLimitInterval = 1000; [TranslationReference] - static readonly string NoPortForward = "no-port-forward"; + const string NoPortForward = "no-port-forward"; + [TranslationReference] - static readonly string BlacklistedTitle = "blacklisted-title"; + const string BlacklistedTitle = "blacklisted-title"; + [TranslationReference] - static readonly string InvalidErrorCode = "invalid-error-code"; + const string InvalidErrorCode = "invalid-error-code"; + [TranslationReference] - static readonly string Connected = "master-server-connected"; + const string Connected = "master-server-connected"; + [TranslationReference] - static readonly string Error = "master-server-error"; + const string Error = "master-server-error"; + [TranslationReference] - static readonly string GameOffline = "game-offline"; + const string GameOffline = "game-offline"; static readonly Beacon LanGameBeacon; static readonly Dictionary MasterServerErrors = new Dictionary() diff --git a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs index 5c26e5401d..88c53dbf04 100644 --- a/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs +++ b/OpenRA.Mods.Common/ServerTraits/PlayerPinger.cs @@ -18,22 +18,22 @@ namespace OpenRA.Mods.Common.Server { public class PlayerPinger : ServerTrait, ITick { + [TranslationReference] + const string PlayerDropped = "player-dropped"; + + [TranslationReference("player")] + const string ConnectionProblems = "connection-problems"; + + [TranslationReference("player")] + const string Timeout = "timeout"; + + [TranslationReference("player", "timeout")] + const string TimeoutIn = "timeout-in"; + static readonly int PingInterval = 5000; // Ping every 5 seconds static readonly int ConnReportInterval = 20000; // Report every 20 seconds static readonly int ConnTimeout = 60000; // Drop unresponsive clients after 60 seconds - [TranslationReference] - static readonly string PlayerDropped = "player-dropped"; - - [TranslationReference("player")] - static readonly string ConnectionProblems = "connection-problems"; - - [TranslationReference("player")] - static readonly string Timeout = "timeout"; - - [TranslationReference("player", "timeout")] - static readonly string TimeoutIn = "timeout-in"; - long lastPing = 0; long lastConnReport = 0; bool isInitialPing = true; diff --git a/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs b/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs index f268b4daa2..700edaf65c 100644 --- a/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs +++ b/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs @@ -72,6 +72,9 @@ namespace OpenRA.Mods.Common.Traits public class DeveloperMode : IResolveOrder, ISync, INotifyCreated, IUnlocksRenderPlayer { + [TranslationReference("cheat", "player", "suffix")] + const string CheatUsed = "cheat-used"; + readonly DeveloperModeInfo info; public bool Enabled { get; private set; } @@ -106,9 +109,6 @@ namespace OpenRA.Mods.Common.Traits bool enableAll; - [TranslationReference("cheat", "player", "suffix")] - static readonly string CheatUsed = "cheat-used"; - public DeveloperMode(DeveloperModeInfo info) { this.info = info; diff --git a/OpenRA.Mods.Common/Traits/World/ColorPickerManager.cs b/OpenRA.Mods.Common/Traits/World/ColorPickerManager.cs index c20ed6050b..39bc1fa481 100644 --- a/OpenRA.Mods.Common/Traits/World/ColorPickerManager.cs +++ b/OpenRA.Mods.Common/Traits/World/ColorPickerManager.cs @@ -22,6 +22,15 @@ namespace OpenRA.Mods.Common.Traits [Desc("Configuration options for the lobby player color picker. Attach this to the world actor.")] public class ColorPickerManagerInfo : TraitInfo, IRulesetLoaded { + [TranslationReference] + const string PlayerColorTerrain = "player-color-terrain"; + + [TranslationReference] + const string PlayerColorPlayer = "player-color-player"; + + [TranslationReference] + const string InvalidPlayerColor = "invalid-player-color"; + [Desc("Minimum and maximum saturation levels that are valid for use.")] public readonly float[] HsvSaturationRange = { 0.3f, 0.95f }; @@ -60,13 +69,6 @@ namespace OpenRA.Mods.Common.Traits public Color Color; - [TranslationReference] - static readonly string PlayerColorTerrain = "player-color-terrain"; - [TranslationReference] - static readonly string PlayerColorPlayer = "player-color-player"; - [TranslationReference] - static readonly string InvalidPlayerColor = "invalid-player-color"; - bool TryGetBlockingColor((float R, float G, float B) color, List<(float R, float G, float B)> candidateBlockers, out (float R, float G, float B) closestBlocker) { var closestDistance = SimilarityThreshold; diff --git a/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs index 812b59a29f..934ce16928 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/AssetBrowserLogic.cs @@ -34,6 +34,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic Unknown = 16 } + [TranslationReference("length")] + const string LengthInSeconds = "length-in-seconds"; + + [TranslationReference] + const string AllPackages = "all-packages"; + readonly string[] allowedExtensions; readonly string[] allowedSpriteExtensions; readonly string[] allowedModelExtensions; @@ -71,12 +77,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic float modelScale; AssetType assetTypesToDisplay = AssetType.Sprite | AssetType.Model | AssetType.Audio | AssetType.Video; - [TranslationReference("length")] - static readonly string LengthInSeconds = "length-in-seconds"; - - [TranslationReference] - static readonly string AllPackages = "all-packages"; - readonly string allPackages; [ObjectCreator.UseCtor] diff --git a/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs index c4c9148c3c..7bc2c484dd 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ConnectionLogic.cs @@ -17,13 +17,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class ConnectionLogic : ChromeLogic { + [TranslationReference("endpoint")] + const string ConnectingToEndpoint = "connecting-to-endpoint"; + readonly Action onConnect; readonly Action onAbort; readonly Action onRetry; - [TranslationReference("endpoint")] - static readonly string ConnectingToEndpoint = "connecting-to-endpoint"; - void ConnectionStateChanged(OrderManager om, string password, NetworkConnection connection) { if (connection.ConnectionState == ConnectionState.Connected) @@ -86,21 +86,21 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class ConnectionFailedLogic : ChromeLogic { + [TranslationReference("target")] + const string CouldNotConnectToTarget = "could-not-connect-to-target"; + + [TranslationReference] + const string UnknownError = "unknown-error"; + + [TranslationReference] + const string PasswordRequired = "password-required"; + + [TranslationReference] + const string ConnectionFailed = "connection-failed"; + readonly PasswordFieldWidget passwordField; bool passwordOffsetAdjusted; - [TranslationReference("target")] - static readonly string CouldNotConnectToTarget = "could-not-connect-to-target"; - - [TranslationReference] - static readonly string UnknownError = "unknown-error"; - - [TranslationReference] - static readonly string PasswordRequired = "password-required"; - - [TranslationReference] - static readonly string ConnectionFailed = "connection-failed"; - [ObjectCreator.UseCtor] public ConnectionFailedLogic(Widget widget, ModData modData, OrderManager orderManager, NetworkConnection connection, string password, Action onAbort, Action onRetry) { @@ -171,7 +171,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class ConnectionSwitchModLogic : ChromeLogic { [TranslationReference] - static readonly string ModSwitchFailed = "mod-switch-failed"; + const string ModSwitchFailed = "mod-switch-failed"; [ObjectCreator.UseCtor] public ConnectionSwitchModLogic(Widget widget, OrderManager orderManager, NetworkConnection connection, Action onAbort, Action onRetry) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs index 64ad36f70c..96152f0a82 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs @@ -20,6 +20,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class ActorEditLogic : ChromeLogic { + [TranslationReference] + const string DuplicateActorId = "duplicate-actor-id"; + + [TranslationReference] + const string EnterActorId = "enter-actor-id"; + + [TranslationReference] + const string Owner = "owner"; + // Error states define overlapping bits to simplify panel reflow logic [Flags] enum ActorIDStatus { Normal = 0, Duplicate = 1, Empty = 3 } @@ -44,15 +53,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly int editPanelPadding; // Padding between right edge of actor and the edit panel. readonly long scrollVisibleTimeout = 100; // Delay after scrolling map before edit widget becomes visible again. - [TranslationReference] - static readonly string DuplicateActorId = "duplicate-actor-id"; - - [TranslationReference] - static readonly string EnterActorId = "enter-actor-id"; - - [TranslationReference] - static readonly string Owner = "owner"; - long lastScrollTime = 0; int2 lastScrollPosition = int2.Zero; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs index c77b0fff7c..5a2beafe81 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorSelectorLogic.cs @@ -21,6 +21,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class ActorSelectorLogic : CommonSelectorLogic { + [TranslationReference] + const string Type = "type"; + class ActorSelectorActor { public readonly ActorInfo Actor; @@ -42,9 +45,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly ActorSelectorActor[] allActors; readonly EditorCursorLayer editorCursor; - [TranslationReference] - static readonly string Type = "type"; - PlayerReference selectedOwner; [ObjectCreator.UseCtor] diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs index 9801143c01..5202cb0262 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs @@ -19,6 +19,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public abstract class CommonSelectorLogic : ChromeLogic { + [TranslationReference] + const string None = "none"; + + [TranslationReference] + const string SearchResults = "search-results"; + + [TranslationReference] + const string All = "all"; + + [TranslationReference] + const string Multiple = "multiple"; + protected readonly Widget Widget; protected readonly ModData ModData; protected readonly TextFieldWidget SearchTextField; @@ -34,18 +46,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic protected string[] allCategories; protected string searchFilter; - [TranslationReference] - static readonly string None = "none"; - - [TranslationReference] - static readonly string SearchResults = "search-results"; - - [TranslationReference] - static readonly string All = "all"; - - [TranslationReference] - static readonly string Multiple = "multiple"; - public CommonSelectorLogic(Widget widget, ModData modData, World world, WorldRenderer worldRenderer, string templateListId, string previewTemplateId) { Widget = widget; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 92485df71f..82424ebe6e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -43,34 +43,34 @@ namespace OpenRA.Mods.Common.Widgets.Logic } [TranslationReference] - static readonly string SaveMapFailedTitle = "save-map-failed-title"; + const string SaveMapFailedTitle = "save-map-failed-title"; [TranslationReference] - static readonly string SaveMapFailedPrompt = "save-map-failed-prompt"; + const string SaveMapFailedPrompt = "save-map-failed-prompt"; [TranslationReference] - static readonly string SaveMapFailedAccept = "save-map-failed-accept"; + const string SaveMapFailedAccept = "save-map-failed-accept"; [TranslationReference] - static readonly string Unpacked = "unpacked"; + const string Unpacked = "unpacked"; [TranslationReference] - static readonly string OverwriteMapFailedTitle = "overwrite-map-failed-title"; + const string OverwriteMapFailedTitle = "overwrite-map-failed-title"; [TranslationReference] - static readonly string OverwriteMapFailedPrompt = "overwrite-map-failed-prompt"; + const string OverwriteMapFailedPrompt = "overwrite-map-failed-prompt"; [TranslationReference] - static readonly string SaveMapFailedConfirm = "overwrite-map-failed-confirm"; + const string SaveMapFailedConfirm = "overwrite-map-failed-confirm"; [TranslationReference] - static readonly string OverwriteMapOutsideEditTitle = "overwrite-map-outside-edit-title"; + const string OverwriteMapOutsideEditTitle = "overwrite-map-outside-edit-title"; [TranslationReference] - static readonly string OverwriteMapOutsideEditPrompt = "overwrite-map-outside-edit-prompt"; + const string OverwriteMapOutsideEditPrompt = "overwrite-map-outside-edit-prompt"; [TranslationReference] - static readonly string SaveMapMapOutsideConfirm = "overwrite-map-outside-edit-confirm"; + const string SaveMapMapOutsideConfirm = "overwrite-map-outside-edit-confirm"; [ObjectCreator.UseCtor] public SaveMapLogic(Widget widget, ModData modData, Action onSave, Action onExit, diff --git a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs index 12adfa697d..4eeb59d70b 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/GameSaveBrowserLogic.cs @@ -20,6 +20,45 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class GameSaveBrowserLogic : ChromeLogic { + [TranslationReference] + const string RenameSaveTitle = "rename-save-title"; + + [TranslationReference] + const string RenameSavePrompt = "rename-save-prompt"; + + [TranslationReference] + const string RenameSaveAccept = "rename-save-accept"; + + [TranslationReference] + const string DeleteSaveTitle = "delete-save-title"; + + [TranslationReference("save")] + const string DeleteSavePrompt = "delete-save-prompt"; + + [TranslationReference] + const string DeleteSaveAccept = "delete-save-accept"; + + [TranslationReference] + const string DeleteAllSavesTitle = "delete-all-saves-title"; + + [TranslationReference("count")] + const string DeleteAllSavesPrompt = "delete-all-saves-prompt"; + + [TranslationReference] + const string DeleteAllSavesAccept = "delete-all-saves-accept"; + + [TranslationReference("savePath")] + const string SaveDeletionFailed = "save-deletion-failed"; + + [TranslationReference] + const string OverwriteSaveTitle = "overwrite-save-title"; + + [TranslationReference("file")] + const string OverwriteSavePrompt = "overwrite-save-prompt"; + + [TranslationReference] + const string OverwriteSaveAccpet = "overwrite-save-accept"; + readonly Widget panel; readonly ScrollPanelWidget gameList; readonly TextFieldWidget saveTextField; @@ -33,45 +72,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly string defaultSaveFilename; string selectedSave; - [TranslationReference] - static readonly string RenameSaveTitle = "rename-save-title"; - - [TranslationReference] - static readonly string RenameSavePrompt = "rename-save-prompt"; - - [TranslationReference] - static readonly string RenameSaveAccept = "rename-save-accept"; - - [TranslationReference] - static readonly string DeleteSaveTitle = "delete-save-title"; - - [TranslationReference("save")] - static readonly string DeleteSavePrompt = "delete-save-prompt"; - - [TranslationReference] - static readonly string DeleteSaveAccept = "delete-save-accept"; - - [TranslationReference] - static readonly string DeleteAllSavesTitle = "delete-all-saves-title"; - - [TranslationReference("count")] - static readonly string DeleteAllSavesPrompt = "delete-all-saves-prompt"; - - [TranslationReference] - static readonly string DeleteAllSavesAccept = "delete-all-saves-accept"; - - [TranslationReference("savePath")] - static readonly string SaveDeletionFailed = "save-deletion-failed"; - - [TranslationReference] - static readonly string OverwriteSaveTitle = "overwrite-save-title"; - - [TranslationReference("file")] - static readonly string OverwriteSavePrompt = "overwrite-save-prompt"; - - [TranslationReference] - static readonly string OverwriteSaveAccpet = "overwrite-save-accept"; - [ObjectCreator.UseCtor] public GameSaveBrowserLogic(Widget widget, ModData modData, Action onExit, Action onStart, bool isSavePanel, World world) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs index 610876b28e..98a51ae220 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoLogic.cs @@ -22,6 +22,21 @@ namespace OpenRA.Mods.Common.Widgets.Logic class GameInfoLogic : ChromeLogic { + [TranslationReference] + const string Objectives = "objectives"; + + [TranslationReference] + const string Briefing = "briefing"; + + [TranslationReference] + const string Options = "options"; + + [TranslationReference] + const string Debug = "debug"; + + [TranslationReference] + const string Chat = "chat"; + readonly World world; readonly ModData modData; readonly Action hideMenu; @@ -29,21 +44,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic IngameInfoPanel activePanel; readonly bool hasError; - [TranslationReference] - static readonly string Objectives = "objectives"; - - [TranslationReference] - static readonly string Briefing = "briefing"; - - [TranslationReference] - static readonly string Options = "options"; - - [TranslationReference] - static readonly string Debug = "debug"; - - [TranslationReference] - static readonly string Chat = "chat"; - [ObjectCreator.UseCtor] public GameInfoLogic(Widget widget, ModData modData, World world, IngameInfoPanel initialPanel, Action hideMenu) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs index 1246c51be9..ea7233ddda 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoObjectivesLogic.cs @@ -19,17 +19,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic { class GameInfoObjectivesLogic : ChromeLogic { + [TranslationReference] + const string InProgress = "in-progress"; + + [TranslationReference] + const string Accomplished = "accomplished"; + + [TranslationReference] + const string Failed = "failed"; + readonly ContainerWidget template; - [TranslationReference] - static readonly string InProgress = "in-progress"; - - [TranslationReference] - static readonly string Accomplished = "accomplished"; - - [TranslationReference] - static readonly string Failed = "failed"; - [ObjectCreator.UseCtor] public GameInfoObjectivesLogic(Widget widget, World world, ModData modData) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs index dcd0cff2b2..3bd7183f27 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameInfoStatsLogic.cs @@ -23,40 +23,40 @@ namespace OpenRA.Mods.Common.Widgets.Logic class GameInfoStatsLogic : ChromeLogic { [TranslationReference] - static readonly string Unmute = "unmute"; + const string Unmute = "unmute"; [TranslationReference] - static readonly string Mute = "mute"; + const string Mute = "mute"; [TranslationReference] - static readonly string Accomplished = "accomplished"; + const string Accomplished = "accomplished"; [TranslationReference] - static readonly string Failed = "failed"; + const string Failed = "failed"; [TranslationReference] - static readonly string InProgress = "in-progress"; + const string InProgress = "in-progress"; [TranslationReference("team")] - static readonly string TeamNumber = "team-number"; + const string TeamNumber = "team-number"; [TranslationReference] - static readonly string NoTeam = "no-team"; + const string NoTeam = "no-team"; [TranslationReference] - static readonly string Spectators = "spectators"; + const string Spectators = "spectators"; [TranslationReference] - static readonly string Gone = "gone"; + const string Gone = "gone"; [TranslationReference("player")] - static readonly string KickTitle = "kick-title"; + const string KickTitle = "kick-title"; [TranslationReference] - static readonly string KickPrompt = "kick-prompt"; + const string KickPrompt = "kick-prompt"; [TranslationReference] - static readonly string KickAccept = "kick-accept"; + const string KickAccept = "kick-accept"; [ObjectCreator.UseCtor] public GameInfoStatsLogic(Widget widget, ModData modData, World world, OrderManager orderManager, WorldRenderer worldRenderer, Action hideMenu) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs index d2f9db4c21..fad9a9e1be 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs @@ -19,16 +19,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class GameTimerLogic : ChromeLogic { [TranslationReference] - static readonly string Paused = "paused"; + const string Paused = "paused"; [TranslationReference] - static readonly string MaxSpeed = "max-speed"; + const string MaxSpeed = "max-speed"; [TranslationReference("percentage")] - static readonly string Speed = "speed"; + const string Speed = "speed"; [TranslationReference("percentage")] - static readonly string Complete = "complete"; + const string Complete = "complete"; [ObjectCreator.UseCtor] public GameTimerLogic(Widget widget, ModData modData, OrderManager orderManager, World world) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs index e8fca59e7a..876dd4256b 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameCashCounterLogic.cs @@ -17,6 +17,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class IngameCashCounterLogic : ChromeLogic { + [TranslationReference("usage", "capacity")] + const string SiloUsage = "silo-usage"; + const float DisplayFracPerFrame = .07f; const int DisplayDeltaPerFrame = 37; @@ -32,9 +35,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic string siloUsageTooltip = ""; - [TranslationReference("usage", "capacity")] - static readonly string SiloUsage = "silo-usage"; - [ObjectCreator.UseCtor] public IngameCashCounterLogic(Widget widget, ModData modData, World world) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs index 7af512209e..6c9a36585f 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs @@ -23,6 +23,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic [ChromeLogicArgsHotkeys("OpenTeamChat", "OpenGeneralChat")] public class IngameChatLogic : ChromeLogic, INotificationHandler { + [TranslationReference] + const string Team = "team"; + + [TranslationReference] + const string All = "all"; + + [TranslationReference("seconds")] + const string ChatAvailability = "chat-availability"; + + [TranslationReference] + const string ChatDisabled = "chat-disabled"; + readonly Ruleset modRules; readonly World world; @@ -44,18 +56,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly bool isMenuChat; - [TranslationReference] - static readonly string Team = "team"; - - [TranslationReference] - static readonly string All = "all"; - - [TranslationReference("seconds")] - static readonly string ChatAvailability = "chat-availability"; - - [TranslationReference] - static readonly string ChatDisabled = "chat-disabled"; - [ObjectCreator.UseCtor] public IngameChatLogic(Widget widget, OrderManager orderManager, World world, ModData modData, bool isMenuChat, Dictionary logicArgs) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs index 280a718556..7657e66cb3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs @@ -21,6 +21,102 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class IngameMenuLogic : ChromeLogic { + [TranslationReference] + const string Leave = "leave"; + + [TranslationReference] + const string AbortMission = "abort-mission"; + + [TranslationReference] + const string LeaveMissionTitle = "leave-mission-title"; + + [TranslationReference] + const string LeaveMissionPrompt = "leave-mission-prompt"; + + [TranslationReference] + const string LeaveMissionAccept = "leave-mission-accept"; + + [TranslationReference] + const string LeaveMissionCancel = "leave-mission-cancel"; + + [TranslationReference] + const string RestartButton = "restart-button"; + + [TranslationReference] + const string RestartMissionTitle = "restart-mission-title"; + + [TranslationReference] + const string RestartMissionPrompt = "restart-mission-prompt"; + + [TranslationReference] + const string RestartMissionAccept = "restart-mission-accept"; + + [TranslationReference] + const string RestartMissionCancel = "restart-mission-cancel"; + + [TranslationReference] + const string SurrenderButton = "surrender-button"; + + [TranslationReference] + const string SurrenderTitle = "surrender-title"; + + [TranslationReference] + const string SurrenderPrompt = "surrender-prompt"; + + [TranslationReference] + const string SurrenderAccept = "surrender-accept"; + + [TranslationReference] + const string SurrenderCancel = "surrender-cancel"; + + [TranslationReference] + const string LoadGameButton = "load-game-button"; + + [TranslationReference] + const string SaveGameButton = "save-game-button"; + + [TranslationReference] + const string MusicButton = "music-button"; + + [TranslationReference] + const string SettingsButton = "settings-button"; + + [TranslationReference] + const string ReturnToMap = "return-to-map"; + + [TranslationReference] + const string Resume = "resume"; + + [TranslationReference] + const string SaveMapButton = "save-map-button"; + + [TranslationReference] + const string ErrorMaxPlayerTitle = "error-max-player-title"; + + [TranslationReference("players", "max")] + const string ErrorMaxPlayerPrompt = "error-max-player-prompt"; + + [TranslationReference] + const string ErrorMaxPlayerAccept = "error-max-player-accept"; + + [TranslationReference] + const string ExitMapButton = "exit-map-button"; + + [TranslationReference] + const string ExitMapEditorTitle = "exit-map-editor-title"; + + [TranslationReference] + const string ExitMapEditorPromptUnsaved = "exit-map-editor-prompt-unsaved"; + + [TranslationReference] + const string ExitMapEditorPromptDeleted = "exit-map-editor-prompt-deleted"; + + [TranslationReference] + const string ExitMapEditorAnywayConfirm = "exit-map-editor-confirm-anyway"; + + [TranslationReference] + const string ExitMapEditorConfirm = "exit-map-editor-confirm"; + readonly Widget menu; readonly Widget buttonContainer; readonly ButtonWidget buttonTemplate; @@ -37,102 +133,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic bool leaving; bool hideMenu; - [TranslationReference] - static readonly string Leave = "leave"; - - [TranslationReference] - static readonly string AbortMission = "abort-mission"; - - [TranslationReference] - static readonly string LeaveMissionTitle = "leave-mission-title"; - - [TranslationReference] - static readonly string LeaveMissionPrompt = "leave-mission-prompt"; - - [TranslationReference] - static readonly string LeaveMissionAccept = "leave-mission-accept"; - - [TranslationReference] - static readonly string LeaveMissionCancel = "leave-mission-cancel"; - - [TranslationReference] - static readonly string RestartButton = "restart-button"; - - [TranslationReference] - static readonly string RestartMissionTitle = "restart-mission-title"; - - [TranslationReference] - static readonly string RestartMissionPrompt = "restart-mission-prompt"; - - [TranslationReference] - static readonly string RestartMissionAccept = "restart-mission-accept"; - - [TranslationReference] - static readonly string RestartMissionCancel = "restart-mission-cancel"; - - [TranslationReference] - static readonly string SurrenderButton = "surrender-button"; - - [TranslationReference] - static readonly string SurrenderTitle = "surrender-title"; - - [TranslationReference] - static readonly string SurrenderPrompt = "surrender-prompt"; - - [TranslationReference] - static readonly string SurrenderAccept = "surrender-accept"; - - [TranslationReference] - static readonly string SurrenderCancel = "surrender-cancel"; - - [TranslationReference] - static readonly string LoadGameButton = "load-game-button"; - - [TranslationReference] - static readonly string SaveGameButton = "save-game-button"; - - [TranslationReference] - static readonly string MusicButton = "music-button"; - - [TranslationReference] - static readonly string SettingsButton = "settings-button"; - - [TranslationReference] - static readonly string ReturnToMap = "return-to-map"; - - [TranslationReference] - static readonly string Resume = "resume"; - - [TranslationReference] - static readonly string SaveMapButton = "save-map-button"; - - [TranslationReference] - static readonly string ErrorMaxPlayerTitle = "error-max-player-title"; - - [TranslationReference("players", "max")] - static readonly string ErrorMaxPlayerPrompt = "error-max-player-prompt"; - - [TranslationReference] - static readonly string ErrorMaxPlayerAccept = "error-max-player-accept"; - - [TranslationReference] - static readonly string ExitMapButton = "exit-map-button"; - - [TranslationReference] - static readonly string ExitMapEditorTitle = "exit-map-editor-title"; - - [TranslationReference] - static readonly string ExitMapEditorPromptUnsaved = "exit-map-editor-prompt-unsaved"; - - [TranslationReference] - static readonly string ExitMapEditorPromptDeleted = "exit-map-editor-prompt-deleted"; - - [TranslationReference] - static readonly string ExitMapEditorAnywayConfirm = "exit-map-editor-confirm-anyway"; - - [TranslationReference] - static readonly string ExitMapEditorConfirm = "exit-map-editor-confirm"; - [ObjectCreator.UseCtor] public IngameMenuLogic(Widget widget, ModData modData, World world, Action onExit, WorldRenderer worldRenderer, IngameInfoPanel initialPanel, Dictionary logicArgs) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerBarLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerBarLogic.cs index 8000d51295..9266948195 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerBarLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerBarLogic.cs @@ -18,10 +18,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class IngamePowerBarLogic : ChromeLogic { [TranslationReference("usage", "capacity")] - static readonly string PowerUsage = "power-usage"; + const string PowerUsage = "power-usage"; [TranslationReference] - static readonly string Infinite = "infinite-power"; + const string Infinite = "infinite-power"; [ObjectCreator.UseCtor] public IngamePowerBarLogic(Widget widget, ModData modData, World world) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerCounterLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerCounterLogic.cs index c31caf5f49..9a23c5d596 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerCounterLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngamePowerCounterLogic.cs @@ -18,10 +18,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class IngamePowerCounterLogic : ChromeLogic { [TranslationReference("usage", "capacity")] - static readonly string PowerUsage = "power-usage"; + const string PowerUsage = "power-usage"; [TranslationReference] - static readonly string Infinite = "infinite-power"; + const string Infinite = "infinite-power"; [ObjectCreator.UseCtor] public IngamePowerCounterLogic(Widget widget, ModData modData, World world) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameSiloBarLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameSiloBarLogic.cs index 65483a1b91..9f1b58313e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameSiloBarLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameSiloBarLogic.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class IngameSiloBarLogic : ChromeLogic { [TranslationReference("usage", "capacity")] - static readonly string SiloUsage = "silo-usage"; + const string SiloUsage = "silo-usage"; [ObjectCreator.UseCtor] public IngameSiloBarLogic(Widget widget, ModData modData, World world) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs index 30bda07dae..493cba7053 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverShroudSelectorLogic.cs @@ -23,6 +23,24 @@ namespace OpenRA.Mods.Common.Widgets.Logic [ChromeLogicArgsHotkeys("CombinedViewKey", "WorldViewKey")] public class ObserverShroudSelectorLogic : ChromeLogic { + [TranslationReference] + const string CameraOptionAllPlayers = "camera-option-all-players"; + + [TranslationReference] + const string CameraOptionDisableShroud = "camera-option-disable-shroud"; + + [TranslationReference] + const string CameraOptionOther = "camera-option-other"; + + [TranslationReference] + const string Players = "players"; + + [TranslationReference("team")] + const string TeamNumber = "team-number"; + + [TranslationReference] + const string NoTeam = "no-team"; + readonly CameraOption combined, disableShroud; readonly IOrderedEnumerable> teams; readonly bool limitViews; @@ -35,24 +53,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic CameraOption selected; readonly LabelWidget shroudLabel; - [TranslationReference] - static readonly string CameraOptionAllPlayers = "camera-option-all-players"; - - [TranslationReference] - static readonly string CameraOptionDisableShroud = "camera-option-disable-shroud"; - - [TranslationReference] - static readonly string CameraOptionOther = "camera-option-other"; - - [TranslationReference] - static readonly string Players = "players"; - - [TranslationReference("team")] - static readonly string TeamNumber = "team-number"; - - [TranslationReference] - static readonly string NoTeam = "no-team"; - class CameraOption { public readonly Player Player; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs index 559782df9f..7c60a2e004 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs @@ -27,6 +27,39 @@ namespace OpenRA.Mods.Common.Widgets.Logic "StatisticsArmyGraphKey")] public class ObserverStatsLogic : ChromeLogic { + [TranslationReference] + const string InformationNone = "information-none"; + + [TranslationReference] + const string Basic = "basic"; + + [TranslationReference] + const string Economy = "economy"; + + [TranslationReference] + const string Production = "production"; + + [TranslationReference] + const string SupportPowers = "support-powers"; + + [TranslationReference] + const string Combat = "combat"; + + [TranslationReference] + const string Army = "army"; + + [TranslationReference] + const string EarningsGraph = "earnings-graph"; + + [TranslationReference] + const string ArmyGraph = "army-graph"; + + [TranslationReference("team")] + const string TeamNumber = "team-number"; + + [TranslationReference] + const string NoTeam = "no-team"; + readonly ContainerWidget basicStatsHeaders; readonly ContainerWidget economyStatsHeaders; readonly ContainerWidget productionStatsHeaders; @@ -54,39 +87,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly string clickSound = ChromeMetrics.Get("ClickSound"); ObserverStatsPanel activePanel; - [TranslationReference] - static readonly string InformationNone = "information-none"; - - [TranslationReference] - static readonly string Basic = "basic"; - - [TranslationReference] - static readonly string Economy = "economy"; - - [TranslationReference] - static readonly string Production = "production"; - - [TranslationReference] - static readonly string SupportPowers = "support-powers"; - - [TranslationReference] - static readonly string Combat = "combat"; - - [TranslationReference] - static readonly string Army = "army"; - - [TranslationReference] - static readonly string EarningsGraph = "earnings-graph"; - - [TranslationReference] - static readonly string ArmyGraph = "army-graph"; - - [TranslationReference("team")] - static readonly string TeamNumber = "team-number"; - - [TranslationReference] - static readonly string NoTeam = "no-team"; - [ObjectCreator.UseCtor] public ObserverStatsLogic(World world, ModData modData, WorldRenderer worldRenderer, Widget widget, Dictionary logicArgs) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs index aa1fd61874..cd4355a273 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/WorldTooltipLogic.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class WorldTooltipLogic : ChromeLogic { [TranslationReference] - static readonly string UnrevealedTerrain = "unrevealed-terrain"; + const string UnrevealedTerrain = "unrevealed-terrain"; [ObjectCreator.UseCtor] public WorldTooltipLogic(Widget widget, ModData modData, World world, TooltipContainerWidget tooltipContainer, ViewportControllerWidget viewport) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs index e7648204fc..09b950bb87 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs @@ -23,40 +23,40 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class DownloadPackageLogic : ChromeLogic { - static readonly string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }; - [TranslationReference("title")] - static readonly string Downloading = "downloading"; + const string Downloading = "downloading"; [TranslationReference] - static readonly string FetchingMirrorList = "fetching-mirror-list"; + const string FetchingMirrorList = "fetching-mirror-list"; [TranslationReference] - static readonly string UnknownHost = "unknown-host"; + const string UnknownHost = "unknown-host"; [TranslationReference("host", "received", "suffix")] - static readonly string DownloadingFrom = "downloading-from"; + const string DownloadingFrom = "downloading-from"; [TranslationReference("host", "received", "total", "suffix", "progress")] - static readonly string DownloadingFromProgress = "downloading-from-progress"; + const string DownloadingFromProgress = "downloading-from-progress"; [TranslationReference] - static readonly string VerifyingArchive = "verifying-archive"; + const string VerifyingArchive = "verifying-archive"; [TranslationReference] - static readonly string ArchiveValidationFailed = "archive-validation-failed"; + const string ArchiveValidationFailed = "archive-validation-failed"; [TranslationReference] - static readonly string Extracting = "extracting"; + const string Extracting = "extracting"; [TranslationReference("entry")] - static readonly string ExtractingEntry = "extracting-entry"; + const string ExtractingEntry = "extracting-entry"; [TranslationReference] - static readonly string ArchiveExtractionFailed = "archive-extraction-failed"; + const string ArchiveExtractionFailed = "archive-extraction-failed"; [TranslationReference] - static readonly string MirrorSelectionFailed = "mirror-selection-failed"; + const string MirrorSelectionFailed = "mirror-selection-failed"; + + static readonly string[] SizeSuffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }; readonly ModData modData; readonly ModContent.ModDownload download; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromSourceLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromSourceLogic.cs index c12245a2c4..dbd39f5aa6 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromSourceLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromSourceLogic.cs @@ -21,6 +21,63 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class InstallFromSourceLogic : ChromeLogic { + [TranslationReference] + const string DetectingSources = "detecting-sources"; + + [TranslationReference] + const string CheckingSources = "checking-sources"; + + [TranslationReference("title")] + const string SearchingSourceFor = "searching-source-for"; + + [TranslationReference] + const string ContentPackageInstallation = "content-package-installation"; + + [TranslationReference] + const string GameSources = "game-sources"; + + [TranslationReference] + const string DigitalInstalls = "digital-installs"; + + [TranslationReference] + const string GameContentNotFound = "game-content-not-found"; + + [TranslationReference] + const string AlternativeContentSources = "alternative-content-sources"; + + [TranslationReference] + const string InstallingContent = "installing-content"; + + [TranslationReference("filename")] + public const string CopyingFilename = "copying-filename"; + + [TranslationReference("filename", "progress")] + public const string CopyingFilenameProgress = "copying-filename-progress"; + + [TranslationReference] + const string InstallationFailed = "installation-failed"; + + [TranslationReference] + const string CheckInstallLog = "check-install-log"; + + [TranslationReference("filename")] + public const string Extracing = "extracting-filename"; + + [TranslationReference("filename", "progress")] + public const string ExtracingProgress = "extracting-filename-progress"; + + [TranslationReference] + public const string Continue = "continue"; + + [TranslationReference] + const string Cancel = "cancel"; + + [TranslationReference] + const string Retry = "retry"; + + [TranslationReference] + const string Back = "back"; + // Hide percentage indicators for files smaller than 25 MB public const int ShowPercentageThreshold = 26214400; @@ -53,63 +110,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic Mode visible = Mode.Progress; - [TranslationReference] - static readonly string DetectingSources = "detecting-sources"; - - [TranslationReference] - static readonly string CheckingSources = "checking-sources"; - - [TranslationReference("title")] - static readonly string SearchingSourceFor = "searching-source-for"; - - [TranslationReference] - static readonly string ContentPackageInstallation = "content-package-installation"; - - [TranslationReference] - static readonly string GameSources = "game-sources"; - - [TranslationReference] - static readonly string DigitalInstalls = "digital-installs"; - - [TranslationReference] - static readonly string GameContentNotFound = "game-content-not-found"; - - [TranslationReference] - static readonly string AlternativeContentSources = "alternative-content-sources"; - - [TranslationReference] - static readonly string InstallingContent = "installing-content"; - - [TranslationReference("filename")] - public static readonly string CopyingFilename = "copying-filename"; - - [TranslationReference("filename", "progress")] - public static readonly string CopyingFilenameProgress = "copying-filename-progress"; - - [TranslationReference] - static readonly string InstallationFailed = "installation-failed"; - - [TranslationReference] - static readonly string CheckInstallLog = "check-install-log"; - - [TranslationReference("filename")] - public static readonly string Extracing = "extracting-filename"; - - [TranslationReference("filename", "progress")] - public static readonly string ExtracingProgress = "extracting-filename-progress"; - - [TranslationReference] - static readonly string Continue = "continue"; - - [TranslationReference] - static readonly string Cancel = "cancel"; - - [TranslationReference] - static readonly string Retry = "retry"; - - [TranslationReference] - static readonly string Back = "back"; - [ObjectCreator.UseCtor] public InstallFromSourceLogic(Widget widget, ModData modData, ModContent content, Dictionary sources) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentLogic.cs index 162b1cab85..ad8802c965 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentLogic.cs @@ -20,6 +20,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class ModContentLogic : ChromeLogic { + [TranslationReference] + const string ManualInstall = "manual-install"; + readonly ModData modData; readonly ModContent content; readonly ScrollPanelWidget scrollPanel; @@ -30,9 +33,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic bool sourceAvailable; - [TranslationReference] - static readonly string ManualInstall = "manual-install"; - [ObjectCreator.UseCtor] public ModContentLogic(ModData modData, Widget widget, Manifest mod, ModContent content, Action onCancel) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentPromptLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentPromptLogic.cs index 801b4199c4..fc31f3f16e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentPromptLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentPromptLogic.cs @@ -20,15 +20,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class ModContentPromptLogic : ChromeLogic { + [TranslationReference] + const string Continue = "continue"; + + [TranslationReference] + const string Quit = "quit"; + readonly ModContent content; bool requiredContentInstalled; - [TranslationReference] - static readonly string Continue = "continue"; - - [TranslationReference] - static readonly string Quit = "quit"; - [ObjectCreator.UseCtor] public ModContentPromptLogic(ModData modData, Widget widget, Manifest mod, ModContent content, Action continueLoading) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs index be99bc790a..4821bbb016 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs @@ -21,19 +21,20 @@ namespace OpenRA.Mods.Common.Widgets.Logic // Increment the version number when adding new stats const int IntroductionVersion = 1; + [TranslationReference] + const string Classic = "classic"; + + [TranslationReference] + const string Modern = "modern"; + + readonly string classic; + readonly string modern; + public static bool ShouldShowPrompt() { return Game.Settings.Game.IntroductionPromptVersion < IntroductionVersion; } - [TranslationReference] - static readonly string Classic = "classic"; - readonly string classic; - - [TranslationReference] - static readonly string Modern = "modern"; - readonly string modern; - [ObjectCreator.UseCtor] public IntroductionPromptLogic(Widget widget, ModData modData, WorldRenderer worldRenderer, Action onComplete) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs index 77c7659e75..596f60624b 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickClientLogic.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic class KickClientLogic : ChromeLogic { [TranslationReference("player")] - static readonly string KickClient = "kick-client"; + const string KickClient = "kick-client"; [ObjectCreator.UseCtor] public KickClientLogic(ModData modData, Widget widget, string clientName, Action okPressed, Action cancelPressed) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs index 69a4985d91..990df9331a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/KickSpectatorsLogic.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic class KickSpectatorsLogic : ChromeLogic { [TranslationReference("count")] - static readonly string KickSpectators = "kick-spectators"; + const string KickSpectators = "kick-spectators"; [ObjectCreator.UseCtor] public KickSpectatorsLogic(ModData modData, Widget widget, int clientCount, Action okPressed, Action cancelPressed) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index a8f835a0cc..105ff11063 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -22,6 +22,42 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class LobbyLogic : ChromeLogic, INotificationHandler { + [TranslationReference] + const string Add = "add"; + + [TranslationReference] + const string Remove = "remove"; + + [TranslationReference] + const string ConfigureBots = "configure-bots"; + + [TranslationReference("count")] + const string NumberTeams = "n-teams"; + + [TranslationReference] + const string HumanVsBots = "humans-vs-bots"; + + [TranslationReference] + const string FreeForAll = "free-for-all"; + + [TranslationReference] + const string ConfigureTeams = "configure-teams"; + + [TranslationReference] + const string Back = "back"; + + [TranslationReference] + const string Team = "team"; + + [TranslationReference] + const string All = "all"; + + [TranslationReference("seconds")] + const string ChatAvailability = "chat-availability"; + + [TranslationReference] + const string ChatDisabled = "chat-disabled"; + static readonly Action DoNothing = () => { }; readonly ModData modData; @@ -73,42 +109,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic bool MapIsPlayable => (mapStatus & Session.MapStatus.Playable) == Session.MapStatus.Playable; - [TranslationReference] - static readonly string Add = "add"; - - [TranslationReference] - static readonly string Remove = "remove"; - - [TranslationReference] - static readonly string ConfigureBots = "configure-bots"; - - [TranslationReference("count")] - static readonly string NumberTeams = "n-teams"; - - [TranslationReference] - static readonly string HumanVsBots = "humans-vs-bots"; - - [TranslationReference] - static readonly string FreeForAll = "free-for-all"; - - [TranslationReference] - static readonly string ConfigureTeams = "configure-teams"; - - [TranslationReference] - static readonly string Back = "back"; - - [TranslationReference] - static readonly string Team = "team"; - - [TranslationReference] - static readonly string All = "all"; - - [TranslationReference("seconds")] - static readonly string ChatAvailability = "chat-availability"; - - [TranslationReference] - static readonly string ChatDisabled = "chat-disabled"; - // Listen for connection failures void ConnectionStateChanged(OrderManager om, string password, NetworkConnection connection) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyOptionsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyOptionsLogic.cs index 364af9c677..a3dcbc3522 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyOptionsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyOptionsLogic.cs @@ -20,6 +20,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class LobbyOptionsLogic : ChromeLogic { + [TranslationReference] + const string NotAvailable = "not-available"; + readonly ModData modData; readonly ScrollPanelWidget panel; readonly Widget optionsContainer; @@ -32,9 +35,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly Func configurationDisabled; MapPreview mapPreview; - [TranslationReference] - static readonly string NotAvailable = "not-available"; - [ObjectCreator.UseCtor] internal LobbyOptionsLogic(ModData modData, Widget widget, OrderManager orderManager, Func getMap, Func configurationDisabled) { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index ffe44b413d..fcaf809cb3 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -24,19 +24,19 @@ namespace OpenRA.Mods.Common.Widgets.Logic public static class LobbyUtils { [TranslationReference] - static readonly string Open = "open"; + const string Open = "open"; [TranslationReference] - static readonly string Closed = "closed"; + const string Closed = "closed"; [TranslationReference] - static readonly string Bots = "bots"; + const string Bots = "bots"; [TranslationReference] - static readonly string BotsDisabled = "bots-disabled"; + const string BotsDisabled = "bots-disabled"; [TranslationReference] - static readonly string Slot = "slot"; + const string Slot = "slot"; class SlotDropDownOption { diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs index 9b4e0f9caa..d9dded2386 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/MapPreviewLogic.cs @@ -19,28 +19,28 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class MapPreviewLogic : ChromeLogic { + [TranslationReference] + const string Connecting = "connecting"; + + [TranslationReference("size")] + const string Downloading = "downloading-map"; + + [TranslationReference("size", "progress")] + const string DownloadingPercentage = "downloading-map-progress"; + + [TranslationReference] + const string RetryInstall = "retry-install"; + + [TranslationReference] + const string RetrySearch = "retry-search"; + + [TranslationReference("author")] + const string CreatedBy = "created-by"; + readonly int blinkTickLength = 10; bool installHighlighted; int blinkTick; - [TranslationReference] - static readonly string Connecting = "connecting"; - - [TranslationReference("size")] - static readonly string Downloading = "downloading-map"; - - [TranslationReference("size", "progress")] - static readonly string DownloadingPercentage = "downloading-map-progress"; - - [TranslationReference] - static readonly string RetryInstall = "retry-install"; - - [TranslationReference] - static readonly string RetrySearch = "retry-search"; - - [TranslationReference("author")] - static readonly string CreatedBy = "created-by"; - [ObjectCreator.UseCtor] internal MapPreviewLogic(Widget widget, ModData modData, OrderManager orderManager, Func<(MapPreview Map, Session.MapStatus Status)> getMap, Action onMouseDown, Func> getSpawnOccupants, diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/SpawnSelectorTooltipLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/SpawnSelectorTooltipLogic.cs index 9a99c497fb..008ffac229 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/SpawnSelectorTooltipLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/SpawnSelectorTooltipLogic.cs @@ -18,13 +18,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class SpawnSelectorTooltipLogic : ChromeLogic { [TranslationReference] - static readonly string DisabledSpawn = "disabled-spawn"; + const string DisabledSpawn = "disabled-spawn"; [TranslationReference] - static readonly string AvailableSpawn = "available-spawn"; + const string AvailableSpawn = "available-spawn"; [TranslationReference("team")] - static readonly string TeamNumber = "team-number"; + const string TeamNumber = "team-number"; readonly CachedTransform teamMessage; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 2d190b1de6..c743a6b2de 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -22,6 +22,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic { public class MainMenuLogic : ChromeLogic { + [TranslationReference] + const string LoadingNews = "loading-news"; + + [TranslationReference("message")] + const string NewsRetrivalFailed = "news-retrival-failed"; + + [TranslationReference("message")] + const string NewsParsingFailed = "news-parsing-failed"; + protected enum MenuType { Main, Singleplayer, Extras, MapEditor, StartupPrompts, None } protected enum MenuPanel { None, Missions, Skirmish, Multiplayer, MapEditor, Replays, GameSaves } @@ -33,15 +42,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly LabelWidget newsStatus; readonly ModData modData; - [TranslationReference] - static readonly string LoadingNews = "loading-news"; - - [TranslationReference("message")] - static readonly string NewsRetrivalFailed = "news-retrival-failed"; - - [TranslationReference("message")] - static readonly string NewsParsingFailed = "news-parsing-failed"; - // Update news once per game launch static bool fetchedNews; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs index fe3ca6cf5a..81e070b0df 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs @@ -19,56 +19,57 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class MapChooserLogic : ChromeLogic { [TranslationReference] - static readonly string AllMaps = "all-maps"; - readonly string allMaps; + const string AllMaps = "all-maps"; [TranslationReference] - static readonly string NoMatches = "no-matches"; + const string NoMatches = "no-matches"; [TranslationReference("players")] - static readonly string Players = "player-players"; + const string Players = "player-players"; [TranslationReference("author")] - static readonly string CreatedBy = "created-by"; + const string CreatedBy = "created-by"; [TranslationReference] - static readonly string MapSizeHuge = "map-size-huge"; + const string MapSizeHuge = "map-size-huge"; [TranslationReference] - static readonly string MapSizeLarge = "map-size-large"; + const string MapSizeLarge = "map-size-large"; [TranslationReference] - static readonly string MapSizeMedium = "map-size-medium"; + const string MapSizeMedium = "map-size-medium"; [TranslationReference] - static readonly string MapSizeSmall = "map-size-small"; + const string MapSizeSmall = "map-size-small"; [TranslationReference("map")] - static readonly string MapDeletionFailed = "map-deletion-failed"; + const string MapDeletionFailed = "map-deletion-failed"; [TranslationReference] - static readonly string DeleteMapTitle = "delete-map-title"; + const string DeleteMapTitle = "delete-map-title"; [TranslationReference("title")] - static readonly string DeleteMapPrompt = "delete-map-prompt"; + const string DeleteMapPrompt = "delete-map-prompt"; [TranslationReference] - static readonly string DeleteMapAccept = "delete-map-accept"; + const string DeleteMapAccept = "delete-map-accept"; [TranslationReference] - static readonly string DeleteAllMapsTitle = "delete-all-maps-title"; + const string DeleteAllMapsTitle = "delete-all-maps-title"; [TranslationReference] - static readonly string DeleteAllMapsPrompt = "delete-all-maps-prompt"; + const string DeleteAllMapsPrompt = "delete-all-maps-prompt"; [TranslationReference] - static readonly string DeleteAllMapsAccept = "delete-all-maps-accept"; + const string DeleteAllMapsAccept = "delete-all-maps-accept"; [TranslationReference] - static readonly string OrderMapsByPlayers = "order-maps-players"; + const string OrderMapsByPlayers = "order-maps-players"; [TranslationReference] - static readonly string OrderMapsByDate = "order-maps-date"; + const string OrderMapsByDate = "order-maps-date"; + + readonly string allMaps; readonly Widget widget; readonly DropDownButtonWidget gameModeDropdown; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs index 61b5c71007..39edfd3964 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MissionBrowserLogic.cs @@ -26,22 +26,22 @@ namespace OpenRA.Mods.Common.Widgets.Logic enum PlayingVideo { None, Info, Briefing, GameStart } [TranslationReference] - static readonly string NoVideoTitle = "no-video-title"; + const string NoVideoTitle = "no-video-title"; [TranslationReference] - static readonly string NoVideoPrompt = "no-video-prompt"; + const string NoVideoPrompt = "no-video-prompt"; [TranslationReference] - static readonly string NoVideoCancel = "no-video-cancel"; + const string NoVideoCancel = "no-video-cancel"; [TranslationReference] - static readonly string CantPlayTitle = "cant-play-title"; + const string CantPlayTitle = "cant-play-title"; [TranslationReference] - static readonly string CantPlayPrompt = "cant-play-prompt"; + const string CantPlayPrompt = "cant-play-prompt"; [TranslationReference] - static readonly string CantPlayCancel = "cant-play-cancel"; + const string CantPlayCancel = "cant-play-cancel"; readonly ModData modData; readonly Action onStart; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs index f64497d1db..3ebd1a0a06 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MusicPlayerLogic.cs @@ -19,10 +19,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class MusicPlayerLogic : ChromeLogic { [TranslationReference] - static readonly string SoundMuted = "sound-muted"; + const string SoundMuted = "sound-muted"; [TranslationReference] - static readonly string NoSongPlaying = "no-song-playing"; + const string NoSongPlaying = "no-song-playing"; readonly ScrollPanelWidget musicList; readonly ScrollItemWidget itemTemplate; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs index 26ee22b321..70269e2ff4 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MuteHotkeyLogic.cs @@ -18,14 +18,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic [ChromeLogicArgsHotkeys("MuteAudioKey")] public class MuteHotkeyLogic : SingleHotkeyBaseLogic { + [TranslationReference] + const string AudioMuted = "audio-muted"; + + [TranslationReference] + const string AudioUnmuted = "audio-unmuted"; + readonly ModData modData; - [TranslationReference] - static readonly string AudioMuted = "audio-muted"; - - [TranslationReference] - static readonly string AudioUnmuted = "audio-unmuted"; - [ObjectCreator.UseCtor] public MuteHotkeyLogic(Widget widget, ModData modData, Dictionary logicArgs) : base(widget, modData, "MuteAudioKey", "GLOBAL_KEYHANDLER", logicArgs) diff --git a/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs index b9d77f8bc1..a2668ebffa 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs @@ -132,10 +132,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class RegisteredProfileTooltipLogic : ChromeLogic { [TranslationReference] - static readonly string LoadingPlayerProfile = "loading-player-profile"; + const string LoadingPlayerProfile = "loading-player-profile"; [TranslationReference] - static readonly string LoadingPlayerProfileFailed = "loading-player-profile-failed"; + const string LoadingPlayerProfileFailed = "loading-player-profile-failed"; readonly PlayerDatabase playerDatabase; PlayerProfile profile; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index fde048ede7..f9fcaf5bd8 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -26,82 +26,82 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class ReplayBrowserLogic : ChromeLogic { [TranslationReference("time")] - static readonly string Duration = "duration"; + const string Duration = "duration"; [TranslationReference] - static readonly string Singleplayer = "singleplayer"; + const string Singleplayer = "singleplayer"; [TranslationReference] - static readonly string Multiplayer = "multiplayer"; + const string Multiplayer = "multiplayer"; [TranslationReference] - static readonly string Today = "today"; + const string Today = "today"; [TranslationReference] - static readonly string LastWeek = "last-week"; + const string LastWeek = "last-week"; [TranslationReference] - static readonly string LastFortnight = "last-fortnight"; + const string LastFortnight = "last-fortnight"; [TranslationReference] - static readonly string LastMonth = "last-month"; + const string LastMonth = "last-month"; [TranslationReference] - static readonly string ReplayDurationVeryShort = "replay-duration-very-short"; + const string ReplayDurationVeryShort = "replay-duration-very-short"; [TranslationReference] - static readonly string ReplayDurationShort = "replay-duration-short"; + const string ReplayDurationShort = "replay-duration-short"; [TranslationReference] - static readonly string ReplayDurationMedium = "replay-duration-medium"; + const string ReplayDurationMedium = "replay-duration-medium"; [TranslationReference] - static readonly string ReplayDurationLong = "replay-duration-long"; + const string ReplayDurationLong = "replay-duration-long"; [TranslationReference] - static readonly string RenameReplayTitle = "rename-replay-title"; + const string RenameReplayTitle = "rename-replay-title"; [TranslationReference] - static readonly string RenameReplayPrompt = "rename-replay-prompt"; + const string RenameReplayPrompt = "rename-replay-prompt"; [TranslationReference] - static readonly string RenameReplayAccept = "rename-replay-accept"; + const string RenameReplayAccept = "rename-replay-accept"; [TranslationReference] - static readonly string DeleteReplayTitle = "delete-replay-title"; + const string DeleteReplayTitle = "delete-replay-title"; [TranslationReference("replay")] - static readonly string DeleteReplayPrompt = "delete-replay-prompt"; + const string DeleteReplayPrompt = "delete-replay-prompt"; [TranslationReference] - static readonly string DeleteReplayAccept = "delete-replay-accept"; + const string DeleteReplayAccept = "delete-replay-accept"; [TranslationReference] - static readonly string DeleteAllReplaysTitle = "delete-all-replays-title"; + const string DeleteAllReplaysTitle = "delete-all-replays-title"; [TranslationReference("count")] - static readonly string DeleteAllReplaysPrompt = "delete-all-replays-prompt"; + const string DeleteAllReplaysPrompt = "delete-all-replays-prompt"; [TranslationReference] - static readonly string DeleteAllReplaysAccept = "delete-all-replays-accept"; + const string DeleteAllReplaysAccept = "delete-all-replays-accept"; [TranslationReference("file")] - static readonly string ReplayDeletionFailed = "replay-deletion-failed"; + const string ReplayDeletionFailed = "replay-deletion-failed"; [TranslationReference] - static readonly string Players = "players"; + const string Players = "players"; [TranslationReference("team")] - static readonly string TeamNumber = "team-number"; + const string TeamNumber = "team-number"; [TranslationReference] - static readonly string NoTeam = "no-team"; + const string NoTeam = "no-team"; [TranslationReference] - static readonly string Victory = "victory"; + const string Victory = "victory"; [TranslationReference] - static readonly string Defeat = "defeat"; + const string Defeat = "defeat"; static Filter filter = new Filter(); diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayUtils.cs index 81ba8d4dea..6005849d12 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayUtils.cs @@ -18,28 +18,28 @@ namespace OpenRA.Mods.Common.Widgets.Logic public static class ReplayUtils { [TranslationReference] - static readonly string IncompatibleReplayTitle = "incompatible-replay-title"; + const string IncompatibleReplayTitle = "incompatible-replay-title"; [TranslationReference] - static readonly string IncompatibleReplayPrompt = "incompatible-replay-prompt"; + const string IncompatibleReplayPrompt = "incompatible-replay-prompt"; [TranslationReference] - static readonly string IncompatibleReplayAccept = "incompatible-replay-accept"; + const string IncompatibleReplayAccept = "incompatible-replay-accept"; [TranslationReference] - static readonly string UnknownVersion = "incompatible-replay-unknown-version"; + const string UnknownVersion = "incompatible-replay-unknown-version"; [TranslationReference] - static readonly string UnknownMod = "incompatible-replay-unknown-mod"; + const string UnknownMod = "incompatible-replay-unknown-mod"; [TranslationReference("mod")] - static readonly string UnvailableMod = "incompatible-replay-unavailable-mod"; + const string UnvailableMod = "incompatible-replay-unavailable-mod"; [TranslationReference("version")] - static readonly string IncompatibleVersion = "incompatible-replay-incompatible-version"; + const string IncompatibleVersion = "incompatible-replay-incompatible-version"; [TranslationReference("map")] - static readonly string UnvailableMap = "incompatible-replay-unavailable-map"; + const string UnvailableMap = "incompatible-replay-unavailable-map"; static readonly Action DoNothing = () => { }; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs index 1ea78d3941..e01b3fa311 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerCreationLogic.cs @@ -20,37 +20,37 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class ServerCreationLogic : ChromeLogic { [TranslationReference] - static readonly string InternetServerNatA = "internet-server-nat-A"; + const string InternetServerNatA = "internet-server-nat-A"; [TranslationReference] - static readonly string InternetServerNatBenabled = "internet-server-nat-B-enabled"; + const string InternetServerNatBenabled = "internet-server-nat-B-enabled"; [TranslationReference] - static readonly string InternetServerNatBnotSupported = "internet-server-nat-B-not-supported"; + const string InternetServerNatBnotSupported = "internet-server-nat-B-not-supported"; [TranslationReference] - static readonly string InternetServerNatBdisabled = "internet-server-nat-B-disabled"; + const string InternetServerNatBdisabled = "internet-server-nat-B-disabled"; [TranslationReference] - static readonly string InternetServerNatC = "internet-server-nat-C"; + const string InternetServerNatC = "internet-server-nat-C"; [TranslationReference] - static readonly string LocalServer = "local-server"; + const string LocalServer = "local-server"; [TranslationReference("port")] - static readonly string ServerCreationFailedPrompt = "server-creation-failed-prompt"; + const string ServerCreationFailedPrompt = "server-creation-failed-prompt"; [TranslationReference] - static readonly string ServerCreationFailedPortUsed = "server-creation-failed-port-used"; + const string ServerCreationFailedPortUsed = "server-creation-failed-port-used"; [TranslationReference("message", "code")] - static readonly string ServerCreationFailedError = "server-creation-failed-error"; + const string ServerCreationFailedError = "server-creation-failed-error"; [TranslationReference] - static readonly string ServerCreationFailedTitle = "server-creation-failed-title"; + const string ServerCreationFailedTitle = "server-creation-failed-title"; [TranslationReference] - static readonly string ServerCreationFailedCancel = "server-creation-failed-cancel"; + const string ServerCreationFailedCancel = "server-creation-failed-cancel"; readonly Widget panel; readonly ModData modData; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs index bb0a80040e..1e27c20838 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs @@ -26,72 +26,73 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class ServerListLogic : ChromeLogic { [TranslationReference] - static readonly string SearchStatusFailed = "search-status-failed"; + const string SearchStatusFailed = "search-status-failed"; [TranslationReference] - static readonly string SearchStatusNoGames = "search-status-no-games"; + const string SearchStatusNoGames = "search-status-no-games"; [TranslationReference("players")] - static readonly string PlayersOnline = "players-online"; + const string PlayersOnline = "players-online"; [TranslationReference] - static readonly string NoServerSelected = "no-server-selected"; - readonly string noServerSelected; + const string NoServerSelected = "no-server-selected"; [TranslationReference] - static readonly string MapStatusSearching = "map-status-searching"; - readonly string mapStatusSearching; + const string MapStatusSearching = "map-status-searching"; [TranslationReference] - static readonly string MapClassificationUnknown = "map-classification-unknown"; - readonly string mapClassificationUnknown; + const string MapClassificationUnknown = "map-classification-unknown"; [TranslationReference("players")] - static readonly string PlayersLabel = "players-label"; + const string PlayersLabel = "players-label"; [TranslationReference("bots")] - static readonly string BotsLabel = "bots-label"; + const string BotsLabel = "bots-label"; [TranslationReference("spectators")] - static readonly string SpectatorsLabel = "spectators-label"; + const string SpectatorsLabel = "spectators-label"; [TranslationReference] - static readonly string Players = "players"; + const string Players = "players"; [TranslationReference("team")] - static readonly string TeamNumber = "team-number"; + const string TeamNumber = "team-number"; [TranslationReference] - static readonly string NoTeam = "no-team"; + const string NoTeam = "no-team"; [TranslationReference] - static readonly string Spectators = "spectators"; + const string Spectators = "spectators"; [TranslationReference("players")] - static readonly string OtherPlayers = "n-other-players"; + const string OtherPlayers = "n-other-players"; [TranslationReference] - static readonly string Playing = "playing"; - readonly string playing; + const string Playing = "playing"; [TranslationReference] - static readonly string Waiting = "waiting"; - readonly string waiting; + const string Waiting = "waiting"; [TranslationReference("minutes")] - static readonly string InProgress = "in-progress-for"; + const string InProgress = "in-progress-for"; [TranslationReference] - static readonly string PasswordProtected = "password-protected"; + const string PasswordProtected = "password-protected"; [TranslationReference] - static readonly string WaitingForPlayers = "waiting-for-players"; + const string WaitingForPlayers = "waiting-for-players"; [TranslationReference] - static readonly string ServerShuttingDown = "server-shutting-down"; + const string ServerShuttingDown = "server-shutting-down"; [TranslationReference] - static readonly string UnknownServerState = "unknown-server-state"; + const string UnknownServerState = "unknown-server-state"; + + readonly string noServerSelected; + readonly string mapStatusSearching; + readonly string mapClassificationUnknown; + readonly string playing; + readonly string waiting; readonly Color incompatibleVersionColor; readonly Color incompatibleProtectedGameColor; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs index 1b72e95535..1c7b580004 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Settings/DisplaySettingsLogic.cs @@ -23,48 +23,46 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class DisplaySettingsLogic : ChromeLogic { [TranslationReference] - static readonly string Close = "close"; + const string Close = "close"; [TranslationReference] - static readonly string Medium = "medium"; + const string Medium = "medium"; [TranslationReference] - static readonly string Far = "far"; + const string Far = "far"; [TranslationReference] - static readonly string Furthest = "furthest"; + const string Furthest = "furthest"; [TranslationReference] - static readonly string Windowed = "windowed"; + const string Windowed = "windowed"; [TranslationReference] - static readonly string LegacyFullscreen = "legacy-fullscreen"; - readonly string legacyFullscreen; + const string LegacyFullscreen = "legacy-fullscreen"; [TranslationReference] - static readonly string Fullscreen = "fullscreen"; - readonly string fullscreen; + const string Fullscreen = "fullscreen"; [TranslationReference("number")] - static readonly string Display = "display"; + const string Display = "display"; [TranslationReference] - static readonly string Standard = "standard"; + const string Standard = "standard"; [TranslationReference] - static readonly string ShowOnDamage = "show-on-damage"; + const string ShowOnDamage = "show-on-damage"; [TranslationReference] - static readonly string AlwaysShow = "always-show"; + const string AlwaysShow = "always-show"; [TranslationReference] - static readonly string Automatic = "automatic"; + const string Automatic = "automatic"; [TranslationReference] - static readonly string Manual = "manual"; + const string Manual = "manual"; [TranslationReference] - static readonly string Disabled = "disabled"; + const string Disabled = "disabled"; static readonly int OriginalVideoDisplay; static readonly WindowMode OriginalGraphicsMode; @@ -83,6 +81,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic readonly string manual; readonly string disabled; + readonly string legacyFullscreen; + readonly string fullscreen; + static DisplaySettingsLogic() { var original = Game.Settings; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs index 2eb90bc6cc..c92d6ed1d5 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs @@ -18,42 +18,43 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class InputSettingsLogic : ChromeLogic { [TranslationReference] - static readonly string Classic = "classic"; - readonly string classic; + const string Classic = "classic"; [TranslationReference] - static readonly string Modern = "modern"; - readonly string modern; + const string Modern = "modern"; [TranslationReference] - static readonly string Disabled = "disabled"; + const string Disabled = "disabled"; [TranslationReference] - static readonly string Standard = "standard"; + const string Standard = "standard"; [TranslationReference] - static readonly string Inverted = "inverted"; + const string Inverted = "inverted"; [TranslationReference] - static readonly string Joystick = "joystick"; + const string Joystick = "joystick"; [TranslationReference] - static readonly string Alt = "alt"; + const string Alt = "alt"; [TranslationReference] - static readonly string Ctrl = "ctrl"; + const string Ctrl = "ctrl"; [TranslationReference] - static readonly string Meta = "meta"; + const string Meta = "meta"; [TranslationReference] - static readonly string Shift = "shift"; + const string Shift = "shift"; [TranslationReference] - static readonly string None = "none"; + const string None = "none"; static InputSettingsLogic() { } + readonly string classic; + readonly string modern; + readonly ModData modData; [ObjectCreator.UseCtor] diff --git a/OpenRA.Mods.Common/Widgets/Logic/Settings/SettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Settings/SettingsLogic.cs index 7f6ac65c4e..20c90db686 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Settings/SettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Settings/SettingsLogic.cs @@ -20,37 +20,37 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class SettingsLogic : ChromeLogic { [TranslationReference] - static readonly string SettingsSaveTitle = "settings-save-title"; + const string SettingsSaveTitle = "settings-save-title"; [TranslationReference] - static readonly string SettingsSavePrompt = "settings-save-prompt"; + const string SettingsSavePrompt = "settings-save-prompt"; [TranslationReference] - static readonly string SettingsSaveCancel = "settings-save-cancel"; + const string SettingsSaveCancel = "settings-save-cancel"; [TranslationReference] - static readonly string RestartTitle = "restart-title"; + const string RestartTitle = "restart-title"; [TranslationReference] - static readonly string RestartPrompt = "restart-prompt"; + const string RestartPrompt = "restart-prompt"; [TranslationReference] - static readonly string RestartAccept = "restart-accept"; + const string RestartAccept = "restart-accept"; [TranslationReference] - static readonly string RestartCancel = "restart-cancel"; + const string RestartCancel = "restart-cancel"; [TranslationReference("panel")] - static readonly string ResetTitle = "reset-title"; + const string ResetTitle = "reset-title"; [TranslationReference] - static readonly string ResetPrompt = "reset-prompt"; + const string ResetPrompt = "reset-prompt"; [TranslationReference] - static readonly string ResetAccept = "reset-accept"; + const string ResetAccept = "reset-accept"; [TranslationReference] - static readonly string ResetCancel = "reset-cancel"; + const string ResetCancel = "reset-cancel"; readonly Dictionary> leavePanelActions = new Dictionary>(); readonly Dictionary resetPanelActions = new Dictionary();