Пример #1
0
        void RestoreQuestion(bool result)
        {
            LivingLetterController letterView = m_aoCurrentQuestionScene[m_iRemovedLLDataIndex].GetComponent <LetterBehaviour>().mLetter;

            foreach (GameObject _obj in m_aoCurrentQuestionScene)
            {
                _obj.GetComponent <LetterBehaviour>().Refresh();
            }

            if (result)
            {
                m_oEmoticonsController.EmoticonPositive();
            }
            else
            {
                m_oEmoticonsController.EmoticonNegative();
            }

            //change restored color letter with tag
            Color32 markColor = result ? new Color32(0x4C, 0xAF, 0x50, 0xFF) : new Color32(0xDD, 0x2C, 0x00, 0xFF);
            string  color     = result ? "#4CAF50" : "#DD2C00";

            if (MissingLetterConfiguration.Instance.Variation == MissingLetterVariation.Phrase)
            {
                letterView.Label.text = "<color=" + color + ">" + letterView.Label.text + "</color>";
            }
            else
            {
                LL_WordData word = (LL_WordData)m_oCurrQuestionPack.GetQuestion();
                letterView.Label.text = ArabicTextUtilities.GetWordWithMarkedLetterText(word.Data, m_oRemovedLetter, markColor, ArabicTextUtilities.MarkType.SingleLetter);
            }
        }
Пример #2
0
        public void SetQuestionText(LL_WordData word, LL_LetterData markedLetter, Color color)
        {
            string text  = ArabicAlphabetHelper.ProcessArabicString(word.Data.Arabic);
            var    parts = ArabicAlphabetHelper.FindLetter(AppManager.I.DB, word.Data, markedLetter.Data, false);

            if (parts.Count > 0)
            {
                text = ArabicTextUtilities.GetWordWithMarkedLetterText(word.Data, parts[0], color, ArabicTextUtilities.MarkType.SingleLetter);
            }
            letter.Init(word, text, 1.3f);
        }
Пример #3
0
        public void SetGreenLetter(ILivingLetterData word, ILivingLetterData letter)
        {
            var wordInner   = word as LL_WordData;
            var letterInner = letter as LL_LetterData;

            var parts = ArabicAlphabetHelper.FindLetter(AppManager.I.DB, wordInner.Data, letterInner.Data, false);

            var partToRemove = parts[0];

            // .. and voil�! Thank you Davide! :)
            Label.text = ArabicTextUtilities.GetWordWithMarkedLetterText(
                wordInner.Data, partToRemove, SpecialGreen, ArabicTextUtilities.MarkType.SingleLetter
                );
        }