forked from fluffy-mods/ColonyManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e65523a
commit a8dfad5
Showing
15 changed files
with
240 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,65 @@ | ||
// I18n.cs | ||
// Copyright Karel Kroeze, 2020-2020 | ||
|
||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using Verse; | ||
|
||
namespace FluffyManager | ||
{ | ||
public class I18n | ||
{ | ||
public static string Translate( string key, params object[] args ) | ||
{ | ||
return Key( key ).Translate( args ).ResolveTags(); | ||
} | ||
|
||
public static string Key( string key ) => $"Fluffy.ColonyManager.{key}"; | ||
public static string HistoryStock = Translate( "HistoryStock" ); | ||
public static string HistoryDesignated = Translate( "HistoryDesignated" ); | ||
public static string HistoryCorpses = Translate( "HistoryCorpses" ); | ||
public static string HistoryChunks = Translate( "HistoryChunks" ); | ||
public static string HistoryProduction = Translate( "HistoryProduction" ); | ||
public static string HistoryConsumption = Translate( "HistoryConsumption" ); | ||
public static string HistoryBatteries = Translate( "HistoryBatteries" ); | ||
|
||
|
||
public static string Aggressiveness( float aggression ) | ||
{ | ||
return Translate( "Aggressiveness", | ||
aggression >= .1f | ||
? aggression.ToStringPercent().Colorize( Color.red ) | ||
: aggression.ToStringPercent() ); | ||
} | ||
|
||
public static string Key( string key ) | ||
{ | ||
return $"Fluffy.ColonyManager.{key}"; | ||
} | ||
|
||
public static string Translate( string key, params object[] args ) | ||
{ | ||
return Key( key ).Translate( args ).ResolveTags(); | ||
} | ||
|
||
public static string YieldOne( string label ) | ||
{ | ||
return $"{Translate( "Yield" )} {label}"; | ||
} | ||
|
||
public static string YieldMany( IEnumerable<string> labels ) | ||
{ | ||
return $"{Translate( "Yield" )}\n - {labels.ToLineList( " - " )}"; | ||
} | ||
|
||
public static string YieldOne( float yield, ThingDef def ) | ||
{ | ||
return YieldOne( $"{def.LabelCap} x{yield:F0} " ); | ||
} | ||
|
||
public static string Gender( Gender gender ) | ||
{ | ||
return Translate( $"Gender.{gender}" ); | ||
} | ||
|
||
public static string ChanceToDrop( float chance ) | ||
{ | ||
return Translate( "ChanceToDrop", chance.ToStringPercent() ); | ||
} | ||
} | ||
} |
Oops, something went wrong.