Skip to content

Commit

Permalink
Localized strings for game #377
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjac committed Jan 14, 2024
1 parent d19d5fc commit 90aca7d
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Assets/Game/GameLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private IEnumerator LoadCoroutine()
{
var dialog = loadingGUI.gameObject.AddComponent<DialogGUI>();
dialog.message = e.FullMessage;
dialog.yesButtonText = "Close";
dialog.yesButtonText = GUIPanel.StringSet.Close;
dialog.yesButtonHandler = () =>
{
Close(Scenes.MENU);
Expand Down
14 changes: 7 additions & 7 deletions Assets/Game/PauseGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public class PauseGUI : GUIPanel
void Start()
{
GUIPanel.topPanel = this;
healthCounter = new HUDCounter("Health: ");
scoreCounter = new HUDCounter("Score: ");
healthCounter = new HUDCounter(StringSet.HealthCounterPrefix);
scoreCounter = new HUDCounter(StringSet.ScoreCounterPrefix);
}

public override void OnEnable()
Expand Down Expand Up @@ -95,7 +95,7 @@ public override void WindowGUI()
}
else if (wasAlive)
{
ActionBarGUI.ActionBarLabel("you died :(");
ActionBarGUI.ActionBarLabel(StringSet.YouDied);
scoreCounter.Display();
}

Expand All @@ -116,13 +116,13 @@ private void PauseGame()
pauseMenu = gameObject.AddComponent<OverflowMenuGUI>();
pauseMenu.items = new OverflowMenuGUI.MenuItem[]
{
new OverflowMenuGUI.MenuItem("Resume", IconSet.play,
new OverflowMenuGUI.MenuItem(StringSet.ResumeGame, IconSet.play,
() => {}), // menu will close
new OverflowMenuGUI.MenuItem("Restart", IconSet.restart,
new OverflowMenuGUI.MenuItem(StringSet.RestartGame, IconSet.restart,
() => { gameLoad.Close(Scenes.GAME); }),
new OverflowMenuGUI.MenuItem("Editor", IconSet.editor,
new OverflowMenuGUI.MenuItem(StringSet.OpenEditor, IconSet.editor,
() => { gameLoad.Close(Scenes.EDITOR); }),
new OverflowMenuGUI.MenuItem("Close", IconSet.x,
new OverflowMenuGUI.MenuItem(StringSet.CloseGame, IconSet.x,
() => { gameLoad.Close(Scenes.MENU); }),
};

Expand Down
88 changes: 84 additions & 4 deletions Assets/Game/playScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RenderSettings:
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
serializedVersion: 12
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
Expand Down Expand Up @@ -98,7 +98,7 @@ LightmapSettings:
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_LightingSettings: {fileID: 178770567}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
Expand All @@ -118,9 +118,72 @@ NavMeshSettings:
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!850595691 &178770567
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Settings.lighting
serializedVersion: 3
m_GIWorkflowMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 0
m_LightmapMaxSize: 1024
m_BakeResolution: 40
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
--- !u!1 &189311173
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -313,6 +376,7 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!1001 &836356989
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -440,7 +504,7 @@ MonoBehaviour:
world: {fileID: 0}
help: {fileID: 0}
helpCircle: {fileID: 0}
done: {fileID: 0}
done: {fileID: 2800000, guid: e1b609b81bf81fd4b8188b39dbbdfca4, type: 3}
rotateLeft: {fileID: 0}
rotateRight: {fileID: 0}
flipHorizontal: {fileID: 0}
Expand All @@ -461,7 +525,6 @@ MonoBehaviour:
playAudio: {fileID: 0}
reddit: {fileID: 0}
youTube: {fileID: 0}
gitHub: {fileID: 0}
undo: {fileID: 0}
import: {fileID: 0}
fill: {fileID: 0}
Expand All @@ -472,6 +535,18 @@ MonoBehaviour:
newTexture: {fileID: 0}
worldImport: {fileID: 0}
newItem: {fileID: 0}
website: {fileID: 0}
donate: {fileID: 0}
pan: {fileID: 0}
orbit: {fileID: 0}
sensor: {fileID: 0}
random: {fileID: 0}
baseLayer: {fileID: 0}
overlayLayer: {fileID: 0}
plusOne: {fileID: 0}
minusOne: {fileID: 0}
color: {fileID: 0}
camera: {fileID: 0}
indoorLarge: {fileID: 0}
floatingLarge: {fileID: 0}
newWorldLarge: {fileID: 0}
Expand Down Expand Up @@ -613,6 +688,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
Expand Down Expand Up @@ -713,6 +789,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
Expand Down Expand Up @@ -885,6 +962,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1944336051}
m_TargetAssemblyTypeName:
m_MethodName: SetDownState
m_Mode: 1
m_Arguments:
Expand All @@ -900,6 +978,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1944336051}
m_TargetAssemblyTypeName:
m_MethodName: SetUpState
m_Mode: 1
m_Arguments:
Expand All @@ -926,6 +1005,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.416}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
Expand Down
18 changes: 18 additions & 0 deletions Assets/VoxelEditor/GUI/localization/GUIStringSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class GUIStringSet
"OK";
public virtual string Done =>
"Done";
public virtual string Close =>
"Close";
public virtual string AreYouSure =>
"Are you sure?";

Expand Down Expand Up @@ -287,6 +289,22 @@ public class GUIStringSet
public virtual string DemoBallPit =>
"Ball Pit";

// Game UI
public virtual string HealthCounterPrefix =>
"Health: ";
public virtual string ScoreCounterPrefix =>
"Score: ";
public virtual string YouDied =>
"you died :(";
public virtual string ResumeGame =>
"Resume";
public virtual string RestartGame =>
"Restart";
public virtual string OpenEditor =>
"Editor";
public virtual string CloseGame =>
"Close";

// Tutorial messages...
// Tutorials use <i>italics</i> to mark commands for the user.
public virtual string TutorialWelcome =>
Expand Down

0 comments on commit 90aca7d

Please sign in to comment.