Example #1
0
        public string GetOptionName(int slot)
        {
            int i = ConvertSlotToOption(slot);

            if (i == -1)
            {
                i = 0;
            }

            return(SpeechManager.GetTranslation(options[i].label, options[i].lineID, Options.GetLanguage()));
        }
Example #2
0
        public string GetLabelFromID(int _ID, int languageNumber)
        {
            foreach (CursorIcon cursorIcon in cursorIcons)
            {
                if (cursorIcon.id == _ID)
                {
                    return(SpeechManager.GetTranslation(cursorIcon.label, cursorIcon.lineID, languageNumber) + " ");
                }
            }

            return("");
        }
Example #3
0
        public override string GetLabel(int i, int languageNumber)
        {
            if (languageNumber > 0)
            {
                return(SpeechManager.GetTranslation(GetItem(i).label, GetItem(i).lineID, languageNumber));
            }
            if (GetItem(i).altLabel != "")
            {
                return(GetItem(i).altLabel);
            }

            return(GetItem(i).label);
        }
Example #4
0
        public string GetLabel(InvItem item, int languageNumber)
        {
            if (languageNumber > 0)
            {
                return(SpeechManager.GetTranslation(item.label, item.lineID, languageNumber));
            }
            else if (item.altLabel != "")
            {
                return(item.altLabel);
            }

            return(item.label);
        }
Example #5
0
 public string GetName(int languageNumber)
 {
     if (languageNumber > 0)
     {
         return(SpeechManager.GetTranslation(gameObject.name, displayLineID, languageNumber));
     }
     else if (hotspotName != "")
     {
         return(hotspotName);
     }
     else
     {
         return(gameObject.name);
     }
 }
Example #6
0
 public string GetLabel(int languageNumber)
 {
     if (languageNumber > 0)
     {
         return(SpeechManager.GetTranslation(label, lineID, languageNumber));
     }
     else
     {
         if (altLabel != "")
         {
             return(altLabel);
         }
         return(label);
     }
 }
Example #7
0
        public string GetHotspotPrefixLabel(InvItem item, string itemName, int languageNumber, bool canGive = false)
        {
            string prefix1 = "";
            string prefix2 = "";

            if (canGive && IsGivingItem())
            {
                prefix1 = SpeechManager.GetTranslation(KickStarter.cursorManager.hotspotPrefix3.label, KickStarter.cursorManager.hotspotPrefix3.lineID, languageNumber);
                prefix2 = SpeechManager.GetTranslation(KickStarter.cursorManager.hotspotPrefix4.label, KickStarter.cursorManager.hotspotPrefix4.lineID, languageNumber);
            }
            else
            {
                if (item != null && item.overrideUseSyntax)
                {
                    prefix1 = SpeechManager.GetTranslation(item.hotspotPrefix1.label, item.hotspotPrefix1.lineID, languageNumber);
                    prefix2 = SpeechManager.GetTranslation(item.hotspotPrefix2.label, item.hotspotPrefix2.lineID, languageNumber);
                }
                else
                {
                    prefix1 = SpeechManager.GetTranslation(KickStarter.cursorManager.hotspotPrefix1.label, KickStarter.cursorManager.hotspotPrefix1.lineID, languageNumber);
                    prefix2 = SpeechManager.GetTranslation(KickStarter.cursorManager.hotspotPrefix2.label, KickStarter.cursorManager.hotspotPrefix2.lineID, languageNumber);
                }
            }

            if (prefix1 == "" && prefix2 != "")
            {
                return(prefix2 + " ");
            }

            if (prefix1 != "" && prefix2 == "")
            {
                return(prefix1 + " " + itemName + " ");
            }

            return(prefix1 + " " + itemName + " " + prefix2 + " ");
        }
Example #8
0
 protected string TranslateLabel(string label, int languageNumber)
 {
     return(SpeechManager.GetTranslation(label, lineID, languageNumber));
 }
Example #9
0
 private string TranslatePage(JournalPage page, int languageNumber)
 {
     return(SpeechManager.GetTranslation(page.text, page.lineID, languageNumber));
 }
Example #10
0
 public string GetHotspotLabel(int languageNumber)
 {
     return(SpeechManager.GetTranslation(hotspotLabel, hotspotLabelID, languageNumber));
 }
Example #11
0
        private float StartSpeech()
        {
            string _text     = messageText;
            string _language = "";
            int    _lineID   = lineID;

            int lanuageNumber = Options.GetLanguage();

            if (lanuageNumber > 0)
            {
                // Not in original language, so pull translation in from Speech Manager
                _text     = SpeechManager.GetTranslation(_text, lineID, lanuageNumber);
                _language = KickStarter.speechManager.languages [lanuageNumber];
            }

            bool isSplittingLines = false;
            bool isLastSplitLine  = false;

            _text = _text.Replace("\\n", "\n");

            if (KickStarter.speechManager.separateLines)
            {
                // Split line into an array, and pull the correct one
                string[] textArray = _text.Split(stringSeparators, System.StringSplitOptions.None);
                _text = textArray [splitNumber];

                if (textArray.Length > 1)
                {
                    isSplittingLines = true;

                    if (splitNumber > 0)
                    {
                        _lineID = -1;
                    }
                    if (textArray.Length > splitNumber)
                    {
                        isLastSplitLine = true;
                    }
                }
            }

            if (_text != "")
            {
                speech = KickStarter.dialog.StartDialog(speaker, _text, _lineID, _language, isBackground, noAnimation);
                float displayDuration = speech.displayDuration;

                if (speaker && !noAnimation)
                {
                    if (speaker.animEngine == null)
                    {
                        speaker.ResetAnimationEngine();
                    }

                    if (speaker.animEngine != null)
                    {
                        speaker.animEngine.ActionSpeechRun(this);
                    }
                }

                if (isLastSplitLine)
                {
                    return(displayDuration + waitTimeOffset);
                }

                if (isSplittingLines)
                {
                    return(displayDuration);
                }

                if (!isBackground)
                {
                    return(displayDuration + waitTimeOffset);
                }
            }

            return(0f);
        }