public void Enable() { if (Active) { return; } if (UIManager.Enable(this)) { locale.Load(); OnEnable(); OnGUI = animator.StartOpen(() => { }); Active = true; } }
public static void SendLocalizedTextAll(string file, string key, string[] args) { string[] sendArgs = args ?? new string[0]; if (Localization.Language.SelectedLanguage != Localization.Language.DefaultLanguage) { Localization.Locale loc = new Localization.Locale("English", file, true, ','); loc.Load(); string content = sendArgs.Length <= 0 ? loc[key] : loc.Format(key, sendArgs); FengGameManagerMKII.FGM.BasePV.RPC("Chat", PhotonTargets.NotAnarchy, new object[] { content, string.Empty }); loc.Unload(); } else { Localization.Locale loc = Localization.Language.Find(file); bool needClose = false; if (!loc.IsOpen) { loc.Load(); needClose = true; } string content = sendArgs.Length <= 0 ? loc[key] : loc.Format(key, sendArgs); FengGameManagerMKII.FGM.BasePV.RPC("Chat", PhotonTargets.NotAnarchy, new object[] { content, string.Empty }); if (needClose) { loc.Unload(); } } FengGameManagerMKII.FGM.BasePV.RPC("ChatLocalized", PhotonTargets.AnarchyUsers, new object[] { file, key, sendArgs }); }
public static void SendLocalizedText(PhotonPlayer target, string file, string key, string[] args) { string[] sendArgs = args ?? new string[0]; if (!target.AnarchySync) { Localization.Locale loc; bool needClose = false; if (Localization.Language.SelectedLanguage != "English") { loc = new Localization.Locale("English", file, true, ','); loc.Load(); needClose = true; } else { loc = Localization.Language.Find(file) ?? new Localization.Locale(file, true, ','); if (!loc.IsOpen) { loc.Load(); needClose = true; } } string content = sendArgs.Length <= 0 ? loc[key] : loc.Format(key, sendArgs); FengGameManagerMKII.FGM.BasePV.RPC("Chat", target, new object[] { content, string.Empty }); if (needClose) { loc.Unload(); } } else { FengGameManagerMKII.FGM.BasePV.RPC("ChatLocalized", target, new object[] { file, key, sendArgs }); } }