localization
This commit is contained in:
parent
e07e98020b
commit
cb19485ea2
73
CTI/Classes/CTI_LocalMessage.uc
Normal file
73
CTI/Classes/CTI_LocalMessage.uc
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
class CTI_LocalMessage extends Object
|
||||||
|
abstract;
|
||||||
|
|
||||||
|
var const String SyncItemsDefault;
|
||||||
|
var private localized String SyncItems;
|
||||||
|
|
||||||
|
var const String SyncFinishedDefault;
|
||||||
|
var private localized String SyncFinished;
|
||||||
|
|
||||||
|
var const String WaitingGRIDefault;
|
||||||
|
var private localized String WaitingGRI;
|
||||||
|
|
||||||
|
var const String IncompatibleGRIDefault;
|
||||||
|
var private localized String IncompatibleGRI;
|
||||||
|
|
||||||
|
var const String DisconnectDefault;
|
||||||
|
var private localized String Disconnect;
|
||||||
|
|
||||||
|
var const String SecondsShortDefault;
|
||||||
|
var private localized String SecondsShort;
|
||||||
|
|
||||||
|
enum E_CTI_LocalMessageType
|
||||||
|
{
|
||||||
|
CTI_SyncItems,
|
||||||
|
CTI_SyncFinished,
|
||||||
|
CTI_WaitingGRI,
|
||||||
|
CTI_IncompatibleGRI,
|
||||||
|
CTI_Disconnect,
|
||||||
|
CTI_SecondsShort
|
||||||
|
};
|
||||||
|
|
||||||
|
public static function String GetLocalizedString(
|
||||||
|
E_LogLevel LogLevel,
|
||||||
|
E_CTI_LocalMessageType LMT,
|
||||||
|
optional String String1,
|
||||||
|
optional String String2,
|
||||||
|
optional String String3)
|
||||||
|
{
|
||||||
|
`Log_TraceStatic();
|
||||||
|
|
||||||
|
switch (LMT)
|
||||||
|
{
|
||||||
|
case CTI_SyncItems:
|
||||||
|
return (default.SyncItems != "" ? default.SyncItems : default.SyncItemsDefault);
|
||||||
|
|
||||||
|
case CTI_SyncFinished:
|
||||||
|
return (default.SyncFinished != "" ? default.SyncFinished : default.SyncFinishedDefault);
|
||||||
|
|
||||||
|
case CTI_WaitingGRI:
|
||||||
|
return (default.WaitingGRI != "" ? default.WaitingGRI : default.WaitingGRIDefault);
|
||||||
|
|
||||||
|
case CTI_IncompatibleGRI:
|
||||||
|
return (default.IncompatibleGRI != "" ? default.IncompatibleGRI : default.IncompatibleGRIDefault);
|
||||||
|
|
||||||
|
case CTI_Disconnect:
|
||||||
|
return (default.Disconnect != "" ? default.Disconnect : default.DisconnectDefault);
|
||||||
|
|
||||||
|
case CTI_SecondsShort:
|
||||||
|
return (default.SecondsShort != "" ? default.SecondsShort : default.SecondsShortDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
SyncItemsDefault = "Sync items:"
|
||||||
|
SyncFinishedDefault = "Sync finished."
|
||||||
|
WaitingGRIDefault = "Waiting GRI..."
|
||||||
|
IncompatibleGRIDefault = "Incompatible GRI:"
|
||||||
|
DisconnectDefault = "Disconnect..."
|
||||||
|
SecondsShortDefault = "s"
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
class CTI_RepInfo extends ReplicationInfo;
|
class CTI_RepInfo extends ReplicationInfo;
|
||||||
|
|
||||||
const Trader = class'Trader';
|
const Trader = class'Trader';
|
||||||
|
const LocalMessage = class'CTI_LocalMessage';
|
||||||
|
|
||||||
var public bool PendingSync;
|
var public bool PendingSync;
|
||||||
|
|
||||||
@ -119,7 +120,7 @@ private simulated function ShowReadyButton()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private simulated function UpdateNotification(String Title, String Downloading, String Remainig, int Percent)
|
private simulated function UpdateNotification(String Title, String Left, String Right, int Percent)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
@ -128,8 +129,8 @@ private simulated function UpdateNotification(String Title, String Downloading,
|
|||||||
Notification.SetString("itemName", Title);
|
Notification.SetString("itemName", Title);
|
||||||
Notification.SetFloat("percent", Percent);
|
Notification.SetFloat("percent", Percent);
|
||||||
Notification.SetInt("queue", 0);
|
Notification.SetInt("queue", 0);
|
||||||
Notification.SetString("downLoading", Downloading);
|
Notification.SetString("downLoading", Left);
|
||||||
Notification.SetString("remaining", Remainig);
|
Notification.SetString("remaining", Right);
|
||||||
Notification.SetObject("notificationInfo", Notification);
|
Notification.SetObject("notificationInfo", Notification);
|
||||||
Notification.SetVisible(true);
|
Notification.SetVisible(true);
|
||||||
}
|
}
|
||||||
@ -164,8 +165,9 @@ private reliable client function ClientSync(class<KFWeaponDefinition> WeapDef, o
|
|||||||
|
|
||||||
Recieved = RemoveItems.Length + AddItems.Length;
|
Recieved = RemoveItems.Length + AddItems.Length;
|
||||||
|
|
||||||
NotificationLeftText = WeapDef.static.GetItemName();
|
NotificationHeaderText = (Remove ? "-" : "+") @ WeapDef.static.GetItemName();
|
||||||
NotificationRightText = Recieved @ "/" @ SyncSize @ "(" $ (Remove ? "remove" : "add") $ ")";
|
NotificationLeftText = LocalMessage.static.GetLocalizedString(LogLevel, CTI_SyncItems);
|
||||||
|
NotificationRightText = Recieved @ "/" @ SyncSize;
|
||||||
if (SyncSize != 0)
|
if (SyncSize != 0)
|
||||||
{
|
{
|
||||||
NotificationPercent = (float(Recieved) / float(SyncSize)) * 100;
|
NotificationPercent = (float(Recieved) / float(SyncSize)) * 100;
|
||||||
@ -199,8 +201,8 @@ private simulated reliable client function ClientSyncFinished()
|
|||||||
if (WorldInfo.GRI == None)
|
if (WorldInfo.GRI == None)
|
||||||
{
|
{
|
||||||
`Log_Debug("ClientSyncFinished: Waiting GRI");
|
`Log_Debug("ClientSyncFinished: Waiting GRI");
|
||||||
NotificationHeaderText = "Waiting for GameReplicationInfo...";
|
NotificationHeaderText = LocalMessage.static.GetLocalizedString(LogLevel, CTI_WaitingGRI);
|
||||||
NotificationLeftText = String(++WaitingGRI) $ "s";
|
NotificationLeftText = String(++WaitingGRI) $ LocalMessage.static.GetLocalizedString(LogLevel, CTI_SecondsShort);
|
||||||
NotificationRightText = "";
|
NotificationRightText = "";
|
||||||
SetTimer(1.0f, false, nameof(ClientSyncFinished));
|
SetTimer(1.0f, false, nameof(ClientSyncFinished));
|
||||||
return;
|
return;
|
||||||
@ -212,15 +214,15 @@ private simulated reliable client function ClientSyncFinished()
|
|||||||
`Log_Fatal("Incompatible Replication info:" @ String(WorldInfo.GRI));
|
`Log_Fatal("Incompatible Replication info:" @ String(WorldInfo.GRI));
|
||||||
ClearTimer(nameof(KeepNotification));
|
ClearTimer(nameof(KeepNotification));
|
||||||
UpdateNotification(
|
UpdateNotification(
|
||||||
"Incompatible GRI:" @ String(WorldInfo.GRI),
|
LocalMessage.static.GetLocalizedString(LogLevel, CTI_IncompatibleGRI) @ String(WorldInfo.GRI),
|
||||||
"Disconnect...", "", 0);
|
LocalMessage.static.GetLocalizedString(LogLevel, CTI_Disconnect), "", 0);
|
||||||
Cleanup();
|
Cleanup();
|
||||||
ConsoleCommand("Disconnect");
|
ConsoleCommand("Disconnect");
|
||||||
SafeDestroy();
|
SafeDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationHeaderText = "Sync finished";
|
NotificationHeaderText = LocalMessage.static.GetLocalizedString(LogLevel, CTI_SyncFinished);
|
||||||
NotificationLeftText = "";
|
NotificationLeftText = "";
|
||||||
NotificationRightText = "";
|
NotificationRightText = "";
|
||||||
NotificationPercent = 0;
|
NotificationPercent = 0;
|
||||||
@ -285,7 +287,6 @@ defaultproperties
|
|||||||
PendingSync = false
|
PendingSync = false
|
||||||
Recieved = 0
|
Recieved = 0
|
||||||
|
|
||||||
NotificationHeaderText = "Sync trader items, please wait..."
|
|
||||||
NotificationPercent = 0
|
NotificationPercent = 0
|
||||||
WaitingGRI = 0
|
WaitingGRI = 0
|
||||||
}
|
}
|
||||||
|
BIN
Localization/INT/CTI.int
Normal file
BIN
Localization/INT/CTI.int
Normal file
Binary file not shown.
BIN
Localization/RUS/CTI.rus
Normal file
BIN
Localization/RUS/CTI.rus
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user