Example #1
0
        public void Init(WordsPage _manager, WordInfo _wordInfo, bool _selected)
        {
            myWordInfo = _wordInfo;
            myManager  = _manager;
            uIButton   = GetComponent <UIButton>();

            if (myWordInfo.unlocked || AppManager.I.Player.IsDemoUser)
            {
                OkIcon.enabled = true;
            }
            else
            {
                OkIcon.enabled = false;
            }

            Title.text    = myWordInfo.data.Arabic;
            SubTitle.text = myWordInfo.data.Id;

            if (myWordInfo.data.Drawing != "")
            {
                Drawing.text = AppManager.I.VocabularyHelper.GetWordDrawing(myWordInfo.data);
                if (myWordInfo.data.Category == WordDataCategory.Color)
                {
                    Drawing.SetColor(GenericHelper.GetColorFromString(myWordInfo.data.Value));
                }
            }
            else
            {
                Drawing.text = "";
            }

            hightlight(_selected);
        }
Example #2
0
        public void DetailWord(WordInfo _currentWord)
        {
            currentWordInfo = _currentWord;
            DetailPanel.SetActive(true);
            HighlightWordItem(currentWordInfo.data.Id);
            PlayWord();

            // empty spelling container
            foreach (Transform t in SpellingContainer.transform)
            {
                Destroy(t.gameObject);
            }
            var splittedLetters = ArabicAlphabetHelper.SplitWord(AppManager.I.DB, currentWordInfo.data, false, false);

            foreach (var letter in splittedLetters)
            {
                btnGO = Instantiate(SpellingLetterItemPrefab);
                btnGO.transform.SetParent(SpellingContainer.transform, false);
                btnGO.transform.SetAsFirstSibling();
                btnGO.GetComponent <ItemSpellingLetter>().Init(letter.letter);
            }

            WordArabicText.text = currentWordInfo.data.Arabic;

            if (currentWordInfo.data.Drawing != "")
            {
                WordDrawingText.text = AppManager.I.VocabularyHelper.GetWordDrawing(currentWordInfo.data);
                if (currentWordInfo.data.Category == WordDataCategory.Color)
                {
                    WordDrawingText.SetColor(GenericHelper.GetColorFromString(currentWordInfo.data.Value));
                }
            }
            else
            {
                WordDrawingText.text = "";
            }

            if (AppConfig.DebugLogEnabled)
            {
                Debug.Log("Detail Word(): " + currentWordInfo.data.Id);
                Debug.Log("word unicodes: " + ArabicAlphabetHelper.GetStringUnicodes(currentWordInfo.data.Arabic));
                Debug.Log("word unicodes forms: " + ArabicAlphabetHelper.GetStringUnicodes(WordArabicText.RenderedText));
            }
            //ScoreText.text = "Score: " + currentWord.score;
        }
Example #3
0
        /// <summary>
        /// Called when [model changed].
        /// </summary>
        private void OnModelChanged()
        {
            DisableSlots();
            if (data == null)
            {
                Wideness        = 1.0f;
                Drawing.enabled = false;
                Label.enabled   = false;
            }
            else
            {
                if (Data.DataType == LivingLetterDataType.Image)
                {
                    Drawing.text    = Data.DrawingCharForLivingLetter;
                    Drawing.enabled = true;

                    var imageData = (LL_ImageData)Data;
                    if (imageData.Data.Category == Database.WordDataCategory.Color)
                    {
                        Drawing.color = GenericHelper.GetColorFromString(imageData.Data.Value);
                    }
                    else
                    {
                        Drawing.color = Color.black;
                    }

                    Label.enabled = false;
                    Wideness      = 1.0f;
                }
                else
                {
                    Drawing.enabled = false;
                    Label.enabled   = true;
                    Label.text      = Data.TextForLivingLetter;

                    SetWidness(data.DataType);
                }
            }
        }