Пример #1
0
    // Need a data structure for this to parse and fill out texts accordingly.
    // This needs to be thought through.
    // Main level, sublevel1, sublevel2


    // Use this for initialization
    void Start()
    {
        camera = GameObject.Find("Main Camera");
        lm     = this.GetComponent <LocalisationManager>();
        lm.LoadLocalisedText("localizedText_en.json");
        Debug.Log(lm);
        Debug.Log(lm.GetLocalisedValue("game_title"));
    }
Пример #2
0
    public void UpdateText()
    {
        Text text = GetComponent <Text>();

        if (locMan != null)
        {
            text.text = locMan.GetLocalisedValue(key);
        }
    }
Пример #3
0
 void Start()
 {
     locManager = GameObject.Find("LocalisationManager").GetComponent <LocalisationManager>();
     foreach (string k in keys)
     {
         string localisedKey = locManager.GetLocalisedValue(k);
         //TODO: This line is supposed to send the string to the localisation special command handler
         //localisedKey = TextCommandHandler.CheckForTextCommands(localisedKey);
         finalTTMessages.Add(localisedKey);
     }
     gameObject.GetComponent <TooltipRegistration>().ttMessages = finalTTMessages;
 }
Пример #4
0
    public void WriteSlotText()
    {
        // TODO: implement Chapter numbers?
        string slot    = LocalisationManager.GetLocalisedValue("SaveSlot");
        string time    = LocalisationManager.GetLocalisedValue("SaveTime");
        string faction = LocalisationManager.GetLocalisedValue("SaveFaction");
        string noData  = LocalisationManager.GetLocalisedValue("SaveNoData");

        var      buttonText = gameObject.transform.Find("Text").gameObject.GetComponent <Text>();
        SaveData data       = ReadDataFromSlot();

        if (data == null)
        {
            buttonText.text = $"{slot} {SlotNumber}    {noData}";
            _isData         = false;
        }
        else
        {
            buttonText.text = $"{slot} {SlotNumber}    {time}: {data.SaveTime.ToString()}  {faction}: {data.Faction}";
            _isData         = true;
        }
    }
Пример #5
0
        /// <summary>
        /// Prefix to Abrakam::WelcomeLayout::OnNewAccountButton
        /// </summary>
        public static bool OnNewAccountButton()
        {
            Abrakam.WelcomeLayout welcomeLayout = LayoutManager.WelcomeLayout;
            if (welcomeLayout == null)
            {
                return(true);
            }

            MobileFriendlyTextInput usernameField = welcomeLayout.GetPrivateField <MobileFriendlyTextInput>("userNameInputField");

            if (usernameField == null)
            {
                return(true);
            }

            MobileFriendlyTextInput passwordField = welcomeLayout.GetPrivateField <MobileFriendlyTextInput>("passwordInputField");

            if (passwordField == null)
            {
                return(true);
            }

            string error = GuiManager.CheckUsername(usernameField.text);

            if (error != null)
            {
                welcomeLayout.errorPanelLayout.DisplayErrorMessage(error);
                return(true);
            }

            if (passwordField.text.Length < 8)
            {
                welcomeLayout.errorPanelLayout.DisplayErrorMessage(LocalisationManager.GetLocalisedValue("PASSWORD_TOO_SHORT"));
                return(true);
            }

            return(false);
        }
 void LocaliseText()
 {
     GetComponent <Text>().text = LocalisationManager.GetLocalisedValue(sample.key);
 }