Skip to content

Commit

Permalink
已完成原语言包的全部替换
Browse files Browse the repository at this point in the history
  • Loading branch information
1144822034 committed Oct 30, 2020
1 parent fdb0523 commit 6f4fb4b
Show file tree
Hide file tree
Showing 39 changed files with 279 additions and 1,252 deletions.
9 changes: 5 additions & 4 deletions Survivalcraft/Block/EggBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class EggType

public BlockMesh BlockMesh;
}
public static string fName = "EggBlock";

public const int Index = 118;

Expand Down Expand Up @@ -110,21 +111,21 @@ public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int val
bool isLaid = GetIsLaid(data);
if (isCooked)
{
return LanguageControl.getTranslate("block.cookied") + eggType.DisplayName;
return LanguageControl.Get(fName,1) + eggType.DisplayName;
}
if (!isLaid)
{
return eggType.DisplayName;
}
return LanguageControl.getTranslate("block.laid") + eggType.DisplayName;
return LanguageControl.Get(fName,2) + eggType.DisplayName;
}
public override string GetCategory(int value)
{
return LanguageControl.getTranslate("sccate.Spawner_Eggs");
return LanguageControl.Get("BlocksManager","Spawner Eggs");
}
public override string GetDescription(int value)
{
return LanguageControl.getTranslate("system.generate")+GetEggType(Terrain.ExtractData(value)).TemplateName;
return LanguageControl.Get(fName,3)+GetEggType(Terrain.ExtractData(value)).TemplateName;
}
public override float GetNutritionalValue(int value)
{
Expand Down
2 changes: 1 addition & 1 deletion Survivalcraft/Block/FenceBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public override string GetCategory(int value)
{
return base.GetCategory(value);
}
return LanguageControl.getTranslate("sccate.Painted");
return LanguageControl.Get("BlocksManager","Painted");
}

public override IEnumerable<int> GetCreativeValues()
Expand Down
2 changes: 1 addition & 1 deletion Survivalcraft/Block/FenceGateBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public override string GetCategory(int value)
{
return base.GetCategory(value);
}
return LanguageControl.getTranslate("sccate.Painted");
return LanguageControl.Get("BlocksManager","Painted");
}

public override IEnumerable<int> GetCreativeValues()
Expand Down
4 changes: 2 additions & 2 deletions Survivalcraft/Block/LightbulbBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public override IEnumerable<int> GetCreativeValues()
public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value)
{
int? color = GetColor(Terrain.ExtractData(value));
return SubsystemPalette.GetName(subsystemTerrain, color, "µçµÆ");
return SubsystemPalette.GetName(subsystemTerrain, color, LanguageControl.Get(fName,1));
}

public override string GetCategory(int value)
Expand All @@ -76,7 +76,7 @@ public override string GetCategory(int value)
{
return base.GetCategory(value);
}
return LanguageControl.getTranslate("sccate.Painted");
return LanguageControl.Get("BlocksManager","Painted");
}

public override int GetFace(int value)
Expand Down
2 changes: 1 addition & 1 deletion Survivalcraft/Block/PaintedCubeBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public override string GetCategory(int value)
{
return base.GetCategory(value);
}
return LanguageControl.getTranslate("sccate.Painted");
return LanguageControl.Get("BlocksManager","Painted");
}

public int? GetPaintColor(int value)
Expand Down
2 changes: 1 addition & 1 deletion Survivalcraft/Block/PostedSignBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public override string GetCategory(int value)
{
return base.GetCategory(value);
}
return LanguageControl.getTranslate("sccate.Painted");
return LanguageControl.Get("BlocksManager","Painted");
}

public override IEnumerable<int> GetCreativeValues()
Expand Down
2 changes: 1 addition & 1 deletion Survivalcraft/Block/SlabBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public override string GetCategory(int value)
{
return base.GetCategory(value);
}
return LanguageControl.getTranslate("sccate.Painted");
return LanguageControl.Get("BlocksManager", "Painted");
}

public override IEnumerable<int> GetCreativeValues()
Expand Down
12 changes: 8 additions & 4 deletions Survivalcraft/Block/SoilBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class SoilBlock : CubeBlock
{
public const int Index = 168;

public new static string fName = "SoilBlock";

public static BoundingBox[] m_collisionBoxes = new BoundingBox[1]
{
new BoundingBox(new Vector3(0f, 0f, 0f), new Vector3(1f, 0.9375f, 1f))
Expand Down Expand Up @@ -66,17 +68,19 @@ public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int val
bool hydration = GetHydration(data);
if (nitrogen > 0 && hydration)
{
return LanguageControl.getTranslate( "block.Moist_Compost");
string nm = LanguageControl.Get(fName, 2);
return LanguageControl.Get(fName,1);
}
if (nitrogen > 0)
{
return LanguageControl.getTranslate("block.Compost");
string nm = LanguageControl.Get(fName, 2);
return LanguageControl.Get(fName, 2);
}
if (hydration)
{
return LanguageControl.getTranslate("block.Moist_Soil");
return LanguageControl.Get(fName, 3);
}
return LanguageControl.getTranslate("block.Soil");
return LanguageControl.Get(fName, 4);
}

public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
Expand Down
2 changes: 1 addition & 1 deletion Survivalcraft/Block/StairsBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public override string GetCategory(int value)
{
return base.GetCategory(value);
}
return LanguageControl.getTranslate("sccate.Painted");
return LanguageControl.Get("BlocksManager","Painted");
}

public override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List<BlockDropValue> dropValues, out bool showDebris)
Expand Down
6 changes: 4 additions & 2 deletions Survivalcraft/Component/ComponentClothing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class ComponentClothing : Component, IUpdateable, IInventory

public bool m_clothedTexturesValid;

public static string fName = "ComponentClothing";

public List<int> m_clothesList = new List<int>();

public Dictionary<ClothingSlot, List<int>> m_clothes = new Dictionary<ClothingSlot, List<int>>();
Expand Down Expand Up @@ -324,7 +326,7 @@ public void Update(float dt)
if ((float)clothingData.PlayerLevelRequired > m_componentPlayer.PlayerData.Level)
{

m_componentGui.DisplaySmallMessage(string.Format(LanguageControl.getTranslate("componentclothing.level_not_enough"), clothingData.PlayerLevelRequired, clothingData.DisplayName), Color.White, blinking: true, playNotificationSound: true);
m_componentGui.DisplaySmallMessage(string.Format(LanguageControl.Get(fName,1), clothingData.PlayerLevelRequired, clothingData.DisplayName), Color.White, blinking: true, playNotificationSound: true);
m_subsystemPickables.AddPickable(value, 1, m_componentBody.Position, null, null);
m_clothesList.RemoveAt(num);
flag = true;
Expand Down Expand Up @@ -368,7 +370,7 @@ public void Update(float dt)
{
m_clothesList.RemoveAt(num4);
m_subsystemParticles.AddParticleSystem(new BlockDebrisParticleSystem(m_subsystemTerrain, m_componentBody.Position + m_componentBody.BoxSize / 2f, 1f, 1f, Color.White, 0));
m_componentGui.DisplaySmallMessage(LanguageControl.getTranslate("componentclothing.cloth_worn_out"), Color.White, blinking: true, playNotificationSound: true);
m_componentGui.DisplaySmallMessage(LanguageControl.Get(fName, 2), Color.White, blinking: true, playNotificationSound: true);
}
else
{
Expand Down
9 changes: 5 additions & 4 deletions Survivalcraft/Component/ComponentFlu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class ComponentFlu : Component, IUpdateable
public Random m_random = new Random();

public float m_fluOnset;
public static string fName = "ComponentFlu";

public float m_fluDuration;

Expand Down Expand Up @@ -116,7 +117,7 @@ public void Update(float dt)
if (m_subsystemTime.GameTime - m_lastMessageTime > 60.0)
{
m_lastMessageTime = m_subsystemTime.GameTime;
m_componentPlayer.ComponentGui.DisplaySmallMessage(LanguageControl.getTranslate("componentflu.will_get_flu"), Color.White, blinking: true, playNotificationSound: true);
m_componentPlayer.ComponentGui.DisplaySmallMessage(LanguageControl.Get(fName,1), Color.White, blinking: true, playNotificationSound: true);
}
}
if (m_fluOnset > 60f && m_subsystemTime.PeriodicGameTimeEvent(num2, -0.0099999997764825821) && m_random.Bool(0.75f))
Expand Down Expand Up @@ -178,7 +179,7 @@ public void FluEffect()
{
m_subsystemTime.QueueGameTimeDelayedExecution(m_subsystemTime.GameTime + 0.75, delegate
{
m_componentPlayer.ComponentHealth.Injure(injury, null, ignoreInvulnerability: false, LanguageControl.getTranslate("componentflu.flu"));
m_componentPlayer.ComponentHealth.Injure(injury, null, ignoreInvulnerability: false, LanguageControl.Get(fName,4));
});
}
if (Time.FrameStartTime - m_lastMessageTime > 60.0)
Expand All @@ -188,11 +189,11 @@ public void FluEffect()
{
if (m_componentPlayer.ComponentVitalStats.Temperature < 8f)
{
m_componentPlayer.ComponentGui.DisplaySmallMessage(LanguageControl.getTranslate("componentflu.get_flu"), Color.White, blinking: true, playNotificationSound: true);
m_componentPlayer.ComponentGui.DisplaySmallMessage(LanguageControl.Get(fName, 2), Color.White, blinking: true, playNotificationSound: true);
}
else
{
m_componentPlayer.ComponentGui.DisplaySmallMessage(LanguageControl.getTranslate("componentflu.heal_flu"), Color.White, blinking: true, playNotificationSound: true);
m_componentPlayer.ComponentGui.DisplaySmallMessage(LanguageControl.Get(fName, 3), Color.White, blinking: true, playNotificationSound: true);
}
});
}
Expand Down
38 changes: 19 additions & 19 deletions Survivalcraft/Component/ComponentGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Message

public float Duration;
}

public static string fName = "ComponentGui";
public SubsystemGameInfo m_subsystemGameInfo;

public SubsystemAudio m_subsystemAudio;
Expand Down Expand Up @@ -514,12 +514,12 @@ public void HandleInput()
if (!m_keyboardHelpMessageShown && (m_componentPlayer.PlayerData.InputDevice & WidgetInputDevice.Keyboard) != 0 && Time.PeriodicEvent(7.0, 0.0))
{
m_keyboardHelpMessageShown = true;
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.press_h"), Color.White, blinking: true, playNotificationSound: true);
DisplaySmallMessage(LanguageControl.Get(fName,1), Color.White, blinking: true, playNotificationSound: true);
}
else if (!m_gamepadHelpMessageShown && (m_componentPlayer.PlayerData.InputDevice & WidgetInputDevice.Gamepads) != 0 && Time.PeriodicEvent(7.0, 0.0))
{
m_gamepadHelpMessageShown = true;
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.press_start"), Color.White, blinking: true, playNotificationSound: true);
DisplaySmallMessage(LanguageControl.Get(fName, 2), Color.White, blinking: true, playNotificationSound: true);
}
}
if (playerInput.KeyboardHelp)
Expand Down Expand Up @@ -590,11 +590,11 @@ public void HandleInput()
{
if (m_componentPlayer.ComponentBody.IsSneaking)
{
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.sneak_on"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 3), Color.White, blinking: false, playNotificationSound: false);
}
else
{
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.sneak_off"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 4), Color.White, blinking: false, playNotificationSound: false);
}
}
}
Expand All @@ -617,11 +617,11 @@ public void HandleInput()
{
if (componentRider.Mount != null)
{
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.mounted"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 5), Color.White, blinking: false, playNotificationSound: false);
}
else
{
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.dismounted"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 6), Color.White, blinking: false, playNotificationSound: false);
}
}
}
Expand Down Expand Up @@ -660,11 +660,11 @@ public void HandleInput()
if (m_componentPlayer.ComponentLocomotion.IsCreativeFlyEnabled)
{
m_componentPlayer.ComponentLocomotion.JumpOrder = 1f;
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.fly_on"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 7), Color.White, blinking: false, playNotificationSound: false);
}
else
{
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.fly_off"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 8), Color.White, blinking: false, playNotificationSound: false);
}
}
}
Expand All @@ -674,32 +674,32 @@ public void HandleInput()
if (gameWidget.ActiveCamera.GetType() == typeof(FppCamera))
{
gameWidget.ActiveCamera = gameWidget.FindCamera<TppCamera>();
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.third_camera"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 9), Color.White, blinking: false, playNotificationSound: false);
}
else if (gameWidget.ActiveCamera.GetType() == typeof(TppCamera))
{
gameWidget.ActiveCamera = gameWidget.FindCamera<OrbitCamera>();
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.orbit_camera"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 10), Color.White, blinking: false, playNotificationSound: false);
}
else if (gameWidget.ActiveCamera.GetType() == typeof(OrbitCamera))
{
gameWidget.ActiveCamera = gameWidget.FindCamera<FixedCamera>();
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.fixed_camera"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 11), Color.White, blinking: false, playNotificationSound: false);
}
else
{
gameWidget.ActiveCamera = gameWidget.FindCamera<FppCamera>();
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.first_camera"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 12), Color.White, blinking: false, playNotificationSound: false);
}
}
if (m_photoButtonWidget.IsClicked || playerInput.TakeScreenshot)
{
ScreenCaptureManager.CapturePhoto(delegate
{
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.photo_save"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 13), Color.White, blinking: false, playNotificationSound: false);
}, delegate
{
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.error_capuring"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 14), Color.White, blinking: false, playNotificationSound: false);
});
}
if (m_subsystemGameInfo.WorldSettings.GameMode == GameMode.Creative && (m_lightningButtonWidget.IsClicked || playerInput.Lighting))
Expand All @@ -721,22 +721,22 @@ public void HandleInput()
if (num6 == num10)
{
m_subsystemTimeOfDay.TimeOfDayOffset += num6;
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.dawn"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 15), Color.White, blinking: false, playNotificationSound: false);
}
else if (num7 == num10)
{
m_subsystemTimeOfDay.TimeOfDayOffset += num7;
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.noon"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 16), Color.White, blinking: false, playNotificationSound: false);
}
else if (num8 == num10)
{
m_subsystemTimeOfDay.TimeOfDayOffset += num8;
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.dusk"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 17), Color.White, blinking: false, playNotificationSound: false);
}
else if (num9 == num10)
{
m_subsystemTimeOfDay.TimeOfDayOffset += num9;
DisplaySmallMessage(LanguageControl.getTranslate("componentgui.midnight"), Color.White, blinking: false, playNotificationSound: false);
DisplaySmallMessage(LanguageControl.Get(fName, 18), Color.White, blinking: false, playNotificationSound: false);
}
}
if (ModalPanelWidget != null)
Expand Down
9 changes: 5 additions & 4 deletions Survivalcraft/Component/ComponentIntro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class ComponentIntro : Component, IUpdateable
public ComponentPlayer m_componentPlayer;

public bool m_playIntro;
public static string fName = "ComponentIntro";

public StateMachine m_stateMachine = new StateMachine();

Expand Down Expand Up @@ -94,22 +95,22 @@ public void ShipView_Enter()
base.Project.AddEntity(entity);
m_subsystemTime.QueueGameTimeDelayedExecution(2.0, delegate
{
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.getTranslate("componentplayer.cast_away"), 5f, 0f);
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.Get(fName,1), 5f, 0f);
});
m_subsystemTime.QueueGameTimeDelayedExecution(7.0, delegate
{
if (isPlayerMounted)
{
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.getTranslate("componentplayer.you_in_boat"), 5f, 0f);
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.Get(fName, 1), 5f, 0f);
}
else
{
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.getTranslate("componentplayer.on_the_shore"), 5f, 0f);
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.Get(fName, 1), 5f, 0f);
}
});
m_subsystemTime.QueueGameTimeDelayedExecution(12.0, delegate
{
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.getTranslate("componentplayer.hope_you_good"), 5f, 0f);
m_componentPlayer.ComponentGui.DisplayLargeMessage(null, LanguageControl.Get(fName, 1), 5f, 0f);
});
IntroCamera introCamera = m_componentPlayer.GameWidget.FindCamera<IntroCamera>();
m_componentPlayer.GameWidget.ActiveCamera = introCamera;
Expand Down
Loading

0 comments on commit 6f4fb4b

Please sign in to comment.