public void SetLabelTextToReturnToMenu(TranslatedText label) { if ((label != null) && (string.IsNullOrEmpty(returnToTextTemplateTranslationKey) == false)) { label.SetTranslationKey(returnToTextTemplateTranslationKey, TransitionManager.MainMenu.DisplayName); } }
void SetLabelTextTo(TranslatedText label, string templateKey) { if ((label != null) && (string.IsNullOrEmpty(templateKey) == false)) { SceneInfo currentScene = TransitionManager.CurrentScene; if (currentScene != null) { label.SetTranslationKey(templateKey, currentScene.DisplayName); } } }
public void UpdateReason(Reason reason) { // Grab the web checker WebLocationChecker webChecker = null; if (Singleton.Instance.IsWebplayer == true) { webChecker = Singleton.Get <WebLocationChecker>(); } // Update the reason for this dialog to appear switch (reason) { case Reason.CannotConfirmDomain: // Update translation key reasonMessage.TranslationKey = cannotConfirmDomainMessageTranslationKey; break; case Reason.IsIncorrectDomain: if (webChecker != null) { // Setup translation key, with proper population of fields reasonMessage.SetTranslationKey(domainDoesNotMatchMessageTranslationKey, webChecker.RetrievedHostName); } else { // Update translation key reasonMessage.TranslationKey = gameIsNotGenuineMessageTranslationKey; } break; case Reason.JustTesting: // Overwrite the text: it's a test StringBuilder builder = new StringBuilder(); builder.Append("This menu is just a test. "); Utility.BuildTestMessage(builder, webChecker); reasonMessage.CurrentText = builder.ToString(); break; default: // Update translation key reasonMessage.TranslationKey = gameIsNotGenuineMessageTranslationKey; break; } }