Advertisement
Treedestroyed

KFItemLocalization

Jan 13th, 2022
3,016
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class KFItemLocalization extends Object;
  2.  
  3. struct StructItemLocalization
  4. {
  5.     var name ItemKey;
  6.     var() array<string> ItemName;
  7.     var() array<string> ItemDescription;
  8. };
  9.  
  10. var Ext_TraitAcidicCompound TraitAcidicCompound;
  11. var Ext_TraitAcidicCompound TraitAutoFire;
  12.  
  13. var array<StructItemLocalization> ItemLocalization;
  14.  
  15. function byte GetLanguageIndexByName()
  16. {
  17.     if ( class'Engine'.static.GetEngine().GetLanguage() ~= "ENG" )
  18.     {
  19.         return 0;
  20.     }
  21.     else if ( class'Engine'.static.GetEngine().GetLanguage() ~= "RUS" )
  22.     {
  23.         return 1;
  24.     }
  25. }
  26.  
  27. function SetItemLocalization()
  28. {
  29.     TraitAcidicCompound.ItemName = ItemLocalization[ItemLocalization.Find( 'ItemKey', TraitAcidicCompound.Class.Name )].ItemName[GetLanguageIndexByName()];
  30.     TraitAcidicCompound.ItemDescription = ItemLocalization[ItemLocalization.Find( 'ItemKey', TraitAcidicCompound.Class.Name )].ItemDescription[GetLanguageIndexByName()];
  31.    
  32.     TraitAutoFire.ItemName = ItemLocalization[ItemLocalization.Find( 'ItemKey', TraitAutoFire.Class.Name )].ItemName[GetLanguageIndexByName()];
  33.     TraitAutoFire.ItemDescription = ItemLocalization[ItemLocalization.Find( 'ItemKey', TraitAutoFire.Class.Name )].ItemDescription[GetLanguageIndexByName()];
  34. }
  35.  
  36. defaultproperties
  37. {
  38.     ItemLocalization[0]={( ItemKey=Ext_TraitAcidicCompound,
  39.                            ItemName=("Acidic Compound", "Кислотные боеприпасы"),
  40.                            ItemDescription=("When activated medic weapons have a chance to poison zeds.", "Медицинское оружие получает шанс отравить зедов.") )}
  41.                            
  42.     ItemLocalization[1]={( ItemKey=Ext_TraitAutoFire,
  43.                            ItemName=("Auto-Fire weapons", "Авто режим оружия"),
  44.                            ItemDescription=("Make all perked weapons fully automatic.", "Делает все ваше оружие полностью автоматическим.") )}
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement