Inheritance: UnityEngine.ScriptableObject
コード例 #1
0
 public ChildDialog(GraphicsControl sender, Rectangle rect, Dialog parent, DialogData data)
     : base(sender, rect, data)
 {
     ParentDialog = parent;
     //Parent = parent;
     ParentAttachPoint = Anchor.TopRight;
 }
コード例 #2
0
        public Button(GraphicsControl context, Dialog parent, DialogData data)
            : base(context, parent, "button", data)
        {
            ImageType = ImageType.EndCap;
            //Text = Name;
            TextStyles[(int)Race.Terran] =
                TextStyles[(int)Race.Protoss] =
                TextStyles[(int)Race.Zerg] = FontParser.Fonts["StandardButton"];
            Images[(int)Race.Terran] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normalpressed_terran.dds");
            Images[(int)Race.Protoss] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normalpressed_protoss.dds");
            Images[(int)Race.Zerg] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normalpressed_zerg.dds");
            HoverImages[(int)Race.Terran] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normaloverpressedover_terran.dds");
            HoverImages[(int)Race.Protoss] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normaloverpressedover_protoss.dds");
            HoverImages[(int)Race.Zerg] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normaloverpressedover_zerg.dds");

            ImageType = ImageType.Border;
            Text = Name;
            IsHalfTexture = true;
        }
コード例 #3
0
 public Slider(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "slider", data)
 {
     Images[(int)Race.Terran] = new SingleTextureProperty("Assets\\Textures\\ui_glue_sliderframe_terran.dds");
     Images[(int)Race.Protoss] = new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_sliderframe.dds");
     Images[(int)Race.Zerg] = new SingleTextureProperty("Assets\\Textures\\ui_glue_sliderframe_zerg.dds");
     ImageType = ImageType.Border;
 }
コード例 #4
0
 public override void OnStateDisable(VOGController ctrl)
 {
     base.OnStateDisable(ctrl);
     if (Data != null && Data.Callback != null)
     {
         Data.Callback();
     }
     Data = null;
 }
コード例 #5
0
        public Label(GraphicsControl context, Dialog parent, DialogData data)
            : base(context, parent, "label", data)
        {
            Text = Name;

            TextStyles[(int)Race.Terran] =
                TextStyles[(int)Race.Protoss] =
                TextStyles[(int)Race.Zerg] = FontParser.Fonts["StandardLabel"];
        }
コード例 #6
0
 public Dialog(GraphicsControl sender, Rectangle rect, DialogData data)
     : base(sender, null, "dialog", data)
 {
     //Default values
     base.ImageType = ImageType.Border;
     base.Position = new Point(rect.X, rect.Y);
     base.Size = new Size(rect.Width, rect.Height);
     BackgroundVisible = true;
     base.RenderPriority = 512;
 }
コード例 #7
0
    private void Update()
    {
        if (m_textFinished)
        {
            FadeBlink();
        }

        if (Input.GetKeyDown(m_continueKey) && m_textFinished)
        {
            m_continueText.enabled = false;
            ResetDialog();
            if (m_dialogData == null)
            {
                StartCoroutine(ResetSprites());
            }
        }

        if (m_dialogData != null)
        {
            if (m_playAction)
            {
                DialogAction action;
                Image        entity;
                UpdateCurrent(out action, out entity);

                if (action.shakeDuration > 0.0f)
                {
                    Shake(action);
                }
                if (action.blinkDuration > 0.0f)
                {
                    StartCoroutine(BlinkSprite(entity, action.blinkSize, action.blinkDuration));
                }
                if (action.entryPoint != DialogAction.EntryPoint.NONE)
                {
                    StartCoroutine(MoveSprite(entity, action.entryPoint, 2.0f));
                }

                float animSpeed = action.textAnimationSpeed == 0.0f ? 1.0f : action.textAnimationSpeed;
                StartCoroutine(DrawText(action.text, action.textSpeed, animSpeed, action.interactee.pitch * action.pitchModifier, action.interactee.color));

                m_playAction   = false;
                m_textFinished = false;
                m_dialogIndex++;

                if (m_dialogIndex >= m_dialogData.actions.Count)
                {
                    m_dialogData            = null;
                    m_dialogIndex           = 0;
                    m_currentInteractees[0] = null;
                    m_currentInteractees[1] = null;
                }
            }
        }
    }
コード例 #8
0
    protected void ShowContent(DialogData dialogData)
    {
        if (dialogData == null)
        {
            Debug.LogError("null");
        }
        for (int i = 0; i < goSelects.Length; i++)
        {
            goSelects[i].SetActive(false);
        }
        if (dialogData.Sound > 0)
        {
            Game.Sound.Play(dialogData.Sound);
        }
        int action = dialogData.Action;

        switch (dialogData.ShowMode)
        {
        case 0:    //玩家
            if (oppData == null)
            {
                goOppInfo.SetActive(false);
            }
            goMyInfo.SetActive(true);
            lblMyContent.text = I18N.Get(dialogData.Content);
            StartTypewriting(lblMyContent);
            texMyIcon.Load(dialogData.Head);
            break;

        case 1:    //怪物
            if (myData == null)
            {
                goMyInfo.SetActive(false);
            }
            goOppInfo.SetActive(true);
            lblOppContent.text = I18N.Get(dialogData.Content);
            StartTypewriting(lblOppContent);
            texOppIcon.Load(dialogData.Head);
            break;

        case 2:    //Boss
            if (myData == null)
            {
                goMyInfo.SetActive(false);
            }
            goOppInfo.SetActive(true);
            lblOppContent.text = I18N.Get(dialogData.Content);
            StartTypewriting(lblOppContent);
            texOppIcon.Load(dialogData.Head);
            break;

        default:
            break;
        }
    }
コード例 #9
0
    public void Push(DialogData data)
    {
        Debug.Log("PUSH");
        _dialogQueue.Add(data);

        if (_currentDialog == null)
        {
            Debug.Log("ShowNext()");
            ShowNext();
        }
    }
コード例 #10
0
ファイル: TlfPickUp.cs プロジェクト: agluque62/svn-dev_TFT
        /// <summary>
        /// Parsea los datos relevantes que llegan en el info del notify
        /// </summary>
        /// <param name="xml"></param>
        /// <returns> lista de dialogData</returns>
        public List <DialogData> NotifyDialogParse(string xml, out string source)
        {
            List <DialogData> dialogList = new List <DialogData>();

            source = null;
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xml);
                XmlNodeList nodes = doc.GetElementsByTagName("dialog-info");
                source = (nodes.Item(0).Attributes["entity"] != null) ? nodes.Item(0).Attributes.GetNamedItem("entity").Value : null;
                XmlNodeList dialogs = doc.GetElementsByTagName("dialog");
                foreach (XmlNode dialog in dialogs)
                {
                    XmlNodeList dialogData = dialog.ChildNodes;

                    DialogData dlg = new DialogData();
                    dlg.callId  = (dialog.Attributes["call-id"] != null) ? dialog.Attributes.GetNamedItem("call-id").Value : null;
                    dlg.toTag   = (dialog.Attributes["local-tag"] != null) ? dialog.Attributes.GetNamedItem("local-tag").Value : null;
                    dlg.fromTag = (dialog.Attributes["remote-tag"] != null) ? dialog.Attributes.GetNamedItem("remote-tag").Value : null;
                    foreach (XmlNode node in dialogData)
                    {
                        if (node.Name == "state")
                        {
                            dlg.state = node.InnerText;
                        }
                        else if (node.Name == "remote")
                        {
                            XmlNodeList remoteNode = node.ChildNodes;
                            foreach (XmlNode remoteData in remoteNode)
                            {
                                if (remoteData.Name == "identity")
                                {
                                    dlg.remoteId = remoteData.InnerText;
                                    dlg.display  = (remoteData.Attributes["display"] != null) ? remoteData.Attributes["display"].Value : null;
                                }
                            }
                        }
                    }
                    //Hay que descartar los dialogos early de llamadas salientes
                    string direction = (dialog.Attributes["direction"] != null) ? dialog.Attributes.GetNamedItem("direction").Value : null;
                    if ((direction != "initiator") || (dlg.state != "early"))
                    {
                        dialogList.Add(dlg);
                    }
                }
            }
            catch (Exception exc)
            {
                _Logger.Error("NotifyDialog Parse error {0} en {1}", exc.Message, xml);
                dialogList.Clear();
            }
            return(dialogList);
        }
コード例 #11
0
    private void Start()
    {
        currentGameMode = m_gameManager.GetGameMode();
        //Debug.Log("currentgameMode:" + currentGameMode);
        //데이터 초기화
        if ((currentGameMode == 1) || (currentGameMode == 2))
        {
            m_gameManager.SetCurrentSceneKey(m_gameManager.GetCurrentSceneKey() + 1);

            stageStatus = StageState.READY;

            sceneData = m_gameManager.GetSceneIndData(currentGameMode);

            m_data = m_gameManager.GetDialogData(currentGameMode);
        }
        else if (currentGameMode == 3)//연습모드일떄
        {
            m_gameManager.SetPracticeSceneDataKey(m_gameManager.GetPracticeSceneKey() + 1);

            m_data = m_gameManager.GetDialogData(currentGameMode);
        }
        m_script.SetScriptloader(m_data.script, m_data.conv_state);

        show_chapter_num = m_data.chapterNum;
        show_stage_num   = m_data.stageNum;


        bg_image_.sprite = Resources.Load("Background/" + m_data.BGImage, typeof(Sprite)) as Sprite;

        //GameObject tempEnemy = Resources.Load("EnemyPref/Mob_" + m_data.enemyWholeImage.ToString())as GameObject;
        //m_enemy = Instantiate(enemyImg, new Vector3(507.392f, 405.248f, -9000f), transform.rotation)as GameObject;
        //m_enemy.GetComponent<SpriteRenderer>().sprite = tempEnemy.GetComponent<SpriteRenderer>().sprite;

        GameObject tempEnemy = Resources.Load("DialogPref/Mob_" + m_data.enemyWholeImage.ToString() + " Variant") as GameObject;

        m_enemy = Instantiate(tempEnemy, new Vector3(0f, 0f, 0f), transform.rotation) as GameObject;
        m_enemy.transform.Translate(new Vector3(-m_enemy.GetComponent <SpriteRenderer>().bounds.size.x / 2, m_enemy.GetComponent <SpriteRenderer>().bounds.size.y / 2, 0));

        m_enemy.transform.SetParent(m_canvas.transform, false);


        bg_audioclip = Resources.Load("BGM/" + m_data.BGM) as AudioClip;
        m_audio.clip = bg_audioclip;

        m_audio.Play();
        m_audio.loop = true;

        convStateHandler.FaceImageUpload(m_data.enemyImage);

        if (currentGameMode != 3)
        {
            m_gameManager.SaveCheckPoint();
        }
    }
コード例 #12
0
        void UpdateView(DialogData viewData, DialogData prevViewData)
        {
            timeTextBox.Text = viewData.TimeValue;

            threadLinkLabel.Text      = viewData.ThreadLinkValue;
            threadLinkLabel.BackColor = ResolveLinkColor(viewData.ThreadLinkBkColor);
            threadLinkLabel.Enabled   = viewData.ThreadLinkEnabled;

            logSourceLinkLabel.Text      = viewData.SourceLinkValue;
            logSourceLinkLabel.BackColor = ResolveLinkColor(viewData.SourceLinkBkColor);
            logSourceLinkLabel.Enabled   = viewData.SourceLinkEnabled;

            bookmarkedStatusLabel.Text      = viewData.BookmarkedStatusText;
            bookmarkActionLinkLabel.Text    = viewData.BookmarkActionLinkText;
            bookmarkActionLinkLabel.Enabled = viewData.BookmarkActionLinkEnabled;

            severityTextBox.Text = viewData.SeverityValue;

            messagesTextBox.Visible = viewData.TextValue != null;
            messagesTextBox.Text    = FixLineBreaks(viewData.TextValue ?? "");

            var customControl     = viewData.CustomView as Control;
            var prevCustomControl = prevViewData?.CustomView as Control;

            if (prevCustomControl != customControl)
            {
                if (prevCustomControl != null)
                {
                    contentsContainer.Controls.Remove(prevCustomControl);
                }
                if (customControl != null)
                {
                    contentsContainer.Controls.Add(customControl);
                    customControl.Bounds = contentsContainer.ClientRectangle;
                    customControl.Anchor = messagesTextBox.Anchor;
                }
            }

            bool hlEnabled = viewData.HighlightedCheckboxEnabled;

            nextHighlightedCheckBox.Enabled = hlEnabled;
            if (!hlEnabled)
            {
                nextHighlightedCheckBox.Checked = false;
            }

            for (int i = 0; i < contentModeButtons.Length; ++i)
            {
                var visible = i < viewData.ContentViewModes.Count;
                contentModeButtons[i].Visible = visible;
                contentModeButtons[i].Text    = visible ? viewData.ContentViewModes[i] : "";
                contentModeButtons[i].Checked = visible && i == viewData.ContentViewModeIndex;
            }
        }
コード例 #13
0
ファイル: Pulldown.cs プロジェクト: whatisthispanda/galaxy-pp
 public Pulldown(GraphicsControl context, Dialog parent, DialogData data) : base(context, parent, "pulldown", data)
 {
     Images[(int)Race.Terran]       = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_terran.dds");
     Images[(int)Race.Protoss]      = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_protoss.dds");
     Images[(int)Race.Zerg]         = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_zerg.dds");
     HoverImages[(int)Race.Terran]  = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_terran.dds");
     HoverImages[(int)Race.Protoss] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_protoss.dds");
     HoverImages[(int)Race.Zerg]    = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_zerg.dds");
     ImageType     = ImageType.EndCap;
     IsHalfTexture = true;
 }
コード例 #14
0
    public void ImportConversation(DialogData newConversationData)
    {
        PrepareConversation();

        currentConversationData = newConversationData;

        currentConversationIndex = 0;
        maxConversationIndex     = newConversationData.dialogLines.Length;

        conversationDialogDisplay.ImportConversationData(currentConversationData);
    }
コード例 #15
0
ファイル: DialogLoader.cs プロジェクト: Oshimada/Rhisis
 /// <summary>
 /// Adds a dialog to a given <see cref="DialogSet"/>.
 /// </summary>
 /// <param name="dialogSet">Dialog set</param>
 /// <param name="dialog">Dialog to add</param>
 private void AddDialog(DialogSet dialogSet, DialogData dialog)
 {
     if (dialogSet.ContainsKey(dialog.Name))
     {
         this._logger.LogDebug(GameResources.ObjectIgnoredMessage, "Dialog", dialog.Name, "already declared");
     }
     else
     {
         dialogSet.Add(dialog.Name, dialog);
     }
 }
コード例 #16
0
 //初期化
 public override IEnumerator DialogInitialize(DialogData data = null)
 {
     //取得したデータを元に内容を書き換え
     if (data != null)
     {
         SampleDialogData dData = (SampleDialogData)data;
         titleText.text   = dData.title;
         contentText.text = dData.content;
     }
     yield return(base.DialogInitialize(data));
 }
コード例 #17
0
    private static void InputValue(DialogData data, string key, bool value)
    {
        switch (key)
        {
        case "RightCharacter": data.RightActive = value;
            break;

        case "LeftCharacter": data.LeftActive = value;
            break;
        }
    }
コード例 #18
0
ファイル: DialogManager.cs プロジェクト: skh02083/Unity3DBook
    // Push함수로 DialogData를 추가합니다.
    public void Push(DialogData data)
    {
        // 다이얼로그 리스트를 저장하는 변수에 새로운 다이얼로그 데이터를 추가합니다.
        _dialogQueue.Add(data);

        if (_currentDialog == null)
        {
            // 다음으로 보여줄
            ShowNext();
        }
    }
コード例 #19
0
 public ListBox(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "listBox", data)
 {
     Images[(int)Race.Terran] = new SingleTextureProperty("Assets\\Textures\\ui_glue_listboxframe_terran.dds");
     Images[(int)Race.Protoss] = new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_listboxframe.dds");
     Images[(int)Race.Zerg] = new SingleTextureProperty("Assets\\Textures\\ui_glue_listboxframe_zerg.dds");
     ImageType = ImageType.Border;
     TextStyles[(int) Race.Terran] =
         TextStyles[(int) Race.Protoss] =
         TextStyles[(int) Race.Zerg] = FontParser.Fonts["StandardListBox"];
 }
コード例 #20
0
    public void Push(DialogData data)
    {
        Debug.Log("PUSH");
        _dialogQueue.Add(data);

        if (_currentDialog == null)
        {
            Debug.Log("ShowNext()");
            ShowNext();
        }
    }
コード例 #21
0
        protected RefactoringDialogStub(DialogData dialogData, TModel model, TView view, TViewModel viewModel)
        {
            Model     = model;
            ViewModel = viewModel;

            View                      = view;
            View.DataContext          = viewModel;
            ViewModel.OnWindowClosed += ViewModel_OnWindowClosed;

            DialogResult = RefactoringDialogResult.Execute;
        }
コード例 #22
0
    // Push함수로 DialogData를 추가합니다.
    public void Push(DialogData data)
    {
        // 다이얼로그 리스트를 저장하는 변수에 새로운 다이얼로그 데이터를 추가합니다.
        _dialogQueue.Add(data);

        if (_currentDialog == null)
        {
            // 다음으로 보여줄
            ShowNext();
        }
    }
コード例 #23
0
        public void ShowCurrentDialogInstantly()
        {
            dialogText.text = Localization.Get(_currentDialogData.message);
            StopCoroutine("WaitAndPrint");
            isPrinting = false;
            _currentRealCharIndexIndex = 0;
            _currentDialogData         = DialogData.GetNextDialogData(_currentDialogData);
            enterImage.gameObject.SetActive(true);

            AutoDelayShowNextDialog();
        }
コード例 #24
0
ファイル: EShopItem.cs プロジェクト: 517752548/-
    public void Click()
    {
        DialogData data = new DialogData();

        data.dialog = DialogController.instance.ShopEquipDialog;
        EShopItemData heroData = new EShopItemData();

        heroData.equipId = equipId;
        data.obj         = heroData;
        DialogController.instance.ShowDialog(DialogController.instance.ShopEquipDialog, DialogController.DialogType.stack);
    }
コード例 #25
0
ファイル: UIController.cs プロジェクト: TheJammers/Vertbix
    private void DialogClosed(object sender, ValueArgs <object> e)
    {
        this.Raise(currentDialog.onClose, e);
        Destroy(currentDialog.dialog.gameObject);

        if (dialogStack.Count > 0)
        {
            currentDialog = dialogStack.Pop();
            currentDialog.dialog.Show();
        }
    }
コード例 #26
0
ファイル: NpcLoader.cs プロジェクト: tech-bear/Rhisis
        /// <inheritdoc />
        public void Load()
        {
            IEnumerable <string> files = Directory.GetFiles(GameResources.ResourcePath, "character*.inc", SearchOption.AllDirectories);

            foreach (string file in files)
            {
                using (var npcFile = new IncludeFile(file))
                {
                    foreach (IStatement npcStatement in npcFile.Statements)
                    {
                        if (!(npcStatement is Block npcBlock))
                        {
                            continue;
                        }

                        string npcId   = npcStatement.Name;
                        string npcName = npcId;

                        // We gets the npc name.
                        foreach (IStatement npcInfoStatement in npcBlock.Statements)
                        {
                            if (npcInfoStatement is Instruction instruction && npcInfoStatement.Name == "SetName")
                            {
                                if (instruction.Parameters.Count > 0)
                                {
                                    npcName = this._texts[instruction.Parameters.First().ToString()];
                                }
                            }
                        }

                        //TODO: implement other npc settings (image, music, actions...)
                        //      + constants for statement (like SetName)

                        // We gets shop and dialog of this npc.
                        ShopData   shop   = this._shops.GetShopData(npcId);
                        DialogData dialog = this._dialogs.GetDialogData(npcId, this._configuration.Language);

                        var npc = new NpcData(npcId, npcName, shop, dialog);

                        if (this._npcData.ContainsKey(npc.Id))
                        {
                            this._npcData[npc.Id] = npc;
                            this._logger.LogWarning(GameResources.ObjectOverridedMessage, "NPC", npc.Id, "already declared");
                        }
                        else
                        {
                            this._npcData.Add(npc.Id, npc);
                        }
                    }
                }
            }

            this._logger.LogInformation($"-> {this._npcData.Count} NPCs loaded.");
        }
コード例 #27
0
        public void SetInitDialogData(DialogData initDialogData, DialogShowEndDelegate dialogShowEndDelegate)
        {
            _firstDialogData   = initDialogData;
            _lastDialogData    = GetLastDialogData();
            _currentDialogData = initDialogData;

            skipButton.gameObject.SetActive(_currentDialogData.canSkip);

            this.dialogShowEndDelegate = dialogShowEndDelegate;
            ShowCurrentDialog();
        }
コード例 #28
0
 public DialogControl(GraphicsControl context, Dialog parent, string baseName, DialogData data)
     : base(context, parent, baseName, data)
 {
     RenderPriority = 512;
     Enabled = true;
     FullDialog = false;
     Visible = true;
     Text = "";
     TintColors[0] = TintColors[1] = TintColors[2] = Color.White;
     BlendMode = BlendMode.Alpha;
 }
コード例 #29
0
 public virtual void ApplyToConfiguration(Utility.Configuration.ConfigurationData.ConfigNotifierBase config)
 {
     DialogData.ApplyToConfiguration(config);
     config.PlaysSound    = PlaysSound;
     config.SoundPath     = SoundPath;
     config.SoundVolume   = SoundVolume;
     config.LoopsSound    = LoopsSound;
     config.IsEnabled     = IsEnabled;
     config.ShowsDialog   = ShowsDialog;
     config.AccelInterval = AccelInterval;
 }
コード例 #30
0
    void FinishDialogue()
    {
        UiManager.Instance.DialogUI.DisableRoots();
        UiManager.Instance.DialogUI.gameObject.SetActive(false);
        // enable control

        _activeDialogue = null;

        ScenesManager.Instance.player.enableControl = true;

        OnDialogEnd?.Invoke();
    }
コード例 #31
0
 public Pulldown(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "pulldown", data)
 {
     Images[(int)Race.Terran] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_terran.dds");
     Images[(int)Race.Protoss] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_protoss.dds");
     Images[(int)Race.Zerg] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_zerg.dds");
     HoverImages[(int)Race.Terran] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_terran.dds");
     HoverImages[(int)Race.Protoss] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_protoss.dds");
     HoverImages[(int)Race.Zerg] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_zerg.dds");
     ImageType = ImageType.EndCap;
     IsHalfTexture = true;
 }
コード例 #32
0
    void StartDialogue(DialogData dialog)
    {
        // disable control
        UiManager.Instance.DialogUI.gameObject.SetActive(true);

        _activeDialogue = dialog;
        _index          = 0;

        ScenesManager.Instance.player.DisableControl();

        ShowMonolog(dialog.monologs[_index]);
    }
コード例 #33
0
        public void UpdateItemById(DialogData item)
        {
            if (items == null)
            {
                items = new List <IDialog>();
            }
            var index = items.IndexOf(items.First(i => i.Id == item.Id));

            items.RemoveAt(index);
            items.Insert(index, item);
            NotifyItemChanged(index);
        }
コード例 #34
0
    public IEnumerator Display(string speakerName, DialogData data)
    {
        Visible           = true;
        _speakerName.Text = speakerName;

        for (var i = 0; i < data.Messages.Count; ++i)
        {
            _text.BbcodeText   = data.Messages[i];
            _indicator.Visible = i + 1 < data.Messages.Count;
            yield return(null);
        }
    }
コード例 #35
0
ファイル: DialogWindow.cs プロジェクト: stonezhu870/iteam
        /// <summary>
        /// 绘图方法
        /// </summary>
        /// <param name="sender">调用者</param>
        /// <param name="paint">绘图</param>
        /// <param name="clipRect">裁剪区域</param>
        private void PaintDiv(object sender, CPaint paint, RECT clipRect)
        {
            List <DialogInfo> dialogs      = DataCenter.DialogService.m_dialogs;
            int dialogsSize                = dialogs.Count;
            Dictionary <String, int> names = new Dictionary <String, int>();

            for (int i = 0; i < dialogsSize; i++)
            {
                DialogInfo dialog = dialogs[i];
                if (names.ContainsKey(dialog.m_name))
                {
                    names[dialog.m_name] = names[dialog.m_name] + 1;
                }
                else
                {
                    names[dialog.m_name] = 1;
                }
            }
            List <DialogData> datas = new List <DialogData>();

            foreach (String key in names.Keys)
            {
                DialogData data = new DialogData();
                data.m_name  = key;
                data.m_times = names[key];
                datas.Add(data);
            }
            datas.Sort(new DialogDataCompare());
            int width = m_divDialogs.Width, height = m_divDialogs.Height;
            int datasSize = datas.Count;

            if (datasSize > 0)
            {
                int    paddingLeft = 50, paddingRight = 50, paddingTop = 20, paddingBottom = 20;
                int    top   = paddingTop;
                int    pSize = (height - paddingTop - paddingBottom) / datasSize;
                double max   = 0;
                for (int i = 0; i < datasSize; i++)
                {
                    DialogData data = datas[i];
                    if (i == 0)
                    {
                        max = data.m_times;
                    }
                    int wSize = (int)((width - paddingLeft - paddingRight) * data.m_times / max);
                    CDraw.DrawText(paint, data.m_name, COLOR.ARGB(0, 0, 0), m_divDialogs.Font, 5, top);
                    paint.FillGradientRect(m_sysColors[i % m_sysColors.Length], m_sysColors[(i + 1) % m_sysColors.Length], new RECT(paddingLeft, top + 2, paddingLeft + wSize, top + 12), 2, 0);
                    FONT font = new FONT("微软雅黑", 14, false, false, false);
                    CDraw.DrawText(paint, data.m_times.ToString(), COLOR.ARGB(0, 0, 0), font, paddingLeft + wSize, top);
                    top += pSize;
                }
            }
        }
コード例 #36
0
    void Awake()
    {
        var dialogTexts = new List <DialogData>();

        DialogData finalLine = new DialogData("You find your way back to the elevator and cautiously press one one the elevator panel. Even if not on this floor, you'll find your way out one way or another.", "Narrator");

        dialogTexts.Add(finalLine);

        DialogManager.Show(dialogTexts);

        finalLine.Callback = () => GoToSceneOne();
    }
コード例 #37
0
    public override void Build(DialogData data)
    {
        base.Build(data);

        if( ! (data is DialogDataConfirm) ) {
            Debug.LogError("Invalid dialog data!");
            return;
        }

        Data = data as DialogDataConfirm;
        LabelTitle.text = Data.Title;
        LabelMessage.text = Data.Message;
    }
コード例 #38
0
        void OnEnable()
        {
            dialog  = JsonUtility.FromJson <DialogData>(dialogJson.text);
            uiState = FindObjectOfType <UIState>();
            if (resetSaveInEditor)
            {
                TutorialShowedStatus.ClearAllStatePrefs();
            }

            HideAll();

            uiState.OnStateChanged += OnStateChanged;
        }
コード例 #39
0
ファイル: DialogManager.cs プロジェクト: innocence-ze/D203G8
 public void StartDialog(DialogData dlgData, int index = 0)
 {
     isShowing    = true;
     data         = dlgData;
     currentLine  = index;
     targetString = data.contents[index].dialogText;
     ui           = GameManager.Singleton.uiMgr.GetPanel <DialogPanel>();
     if (ui == null)
     {
         ui = GameManager.Singleton.uiMgr.ShowPanel <DialogPanel>();
     }
     state = State.typing;
 }
コード例 #40
0
ファイル: DialogBox.cs プロジェクト: ruslan-smirnov/Thirty
    private void Awake()
    {
        Instance = this;

        thisTansform  = transform as RectTransform;
        startPosition = thisTansform.anchoredPosition;

        cg = GetComponent <CanvasGroup>();

        dialogData = new DialogData();

        Hide();
    }
コード例 #41
0
        private DialogData GetLastDialogData()
        {
            DialogData dialogData = _firstDialogData;

            if (dialogData != null)
            {
                while (DialogData.GetNextDialogData(dialogData) != null)
                {
                    dialogData = DialogData.GetNextDialogData(dialogData);
                }
            }
            return(dialogData);
        }
コード例 #42
0
    private void ShowNext()
    {
        DialogData       dialogNext = null;
        DialogController controller = null;

        dialogNext        = m_listDialogQueue[0];
        controller        = m_dictionaryLogs[dialogNext.m_eType].GetComponent <DialogController>();
        m_dcCurrentDialog = controller;

        m_dcCurrentDialog.Build(dialogNext);
        m_dcCurrentDialog.Show(delegate { });
        m_listDialogQueue.RemoveAt(0);
    }
コード例 #43
0
    public override void Build(DialogData data)
    {
        base.Build(data);

        if( ! (data is DialogDataRanking) ) {
            Debug.LogError("Invalid dialog data!");
            return;
        }

        Data = data as DialogDataRanking;
        LabelTitle.text = Data.Title;
        LabelScoreMsg.text = "Your score is : " + Data.Score;
        LabelRankings.text = Data.rankings;
    }
コード例 #44
0
 public ProgressBar(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "progressBar", data)
 {
     Images[(int) Race.Terran] =
         Images[(int) Race.Protoss] =
         Images[(int) Race.Zerg] =
         new SingleTextureProperty(@"Assets\Textures\progress-queue.dds");
     TintColors[(int)Race.Terran] = new Color(40, 125, 75);
     TintColors[(int)Race.Protoss] = new Color(35, 125, 254);
     TintColors[(int)Race.Zerg] = new Color(229, 95, 5);
     ImageType = ImageType.Normal;
     MaxValue = 1f;
     IsHalfTexture = true;
 }
コード例 #45
0
    // 확인 팝업창이 생성될 때 호출되는 함수입니다.
    public override void Build(DialogData data)
    {
        base.Build(data);
        // 데이터가 없는데 Build를 하면 로그를 남기고 예외처리를 합니다.
        if( ! (data is DialogDataAlert) ) {
            Debug.LogError("Invalid dialog data!");
            return;
        }

        // DialogDataAlert로 데이터를 받고 화면의 제목과 메시지의 내용을 입력합니다.
        Data = data as DialogDataAlert;
        LabelTitle.text = Data.Title;
        LabelMessage.text = Data.Message;
    }
コード例 #46
0
 public CheckBox(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "checkBox", data)
 {
     Images[(int)Race.Terran] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normalpressed_terran.dds");
     Images[(int)Race.Protoss] =
         new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_checkbox_normalpressed.dds");
     Images[(int)Race.Zerg] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normalpressed_zerg.dds");
     HoverImages[(int)Race.Terran] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normaloverpressedover_terran.dds");
     HoverImages[(int)Race.Protoss] =
         new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_checkbox_normaloverpressedover.dds");
     HoverImages[(int)Race.Zerg] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normaloverpressedover_zerg.dds");
     ImageType = ImageType.Normal;
     IsHalfTexture = true;
 }
コード例 #47
0
    public override void OnDrawGui(VOGController ctrl)
    {
        if (Data == null)
        {
            Data = new DialogData();
        }

        ShadeScreen();

        BeginWindow(280, 150);

        HeadingCentered(Data.Header ?? "");
        BodyCentered(Data.Body ?? "");

        GUILayout.FlexibleSpace();
        if (Button("Ok", ctrl.InputEnabled(this)))
        {
            ctrl.StartBackTransition();
        }

        EndWindow();
    }
コード例 #48
0
ファイル: UIDialog.cs プロジェクト: kofight/CapsUnity
    public override void OnCreate()
    {
        base.OnCreate();
		m_dialogText = GetChildComponent<AocTypewriterEffect>("DialogText");
		m_head1Sprite = GetChildComponent<UISprite>("LeftHead");
		m_head2Sprite = GetChildComponent<UISprite>("RightHead");
        m_dialogBoardSprite = GetChildComponent<UISprite>("DialogBoard");
        m_dialogEffectPlayer = m_dialogBoardSprite.GetComponent<UIEffectPlayer>();

        m_backPic = GetChildComponent<UISprite>("Background");
		m_itemBoard = GetChildComponent<UISprite>("ItemBoard");
        m_clickSprite = GetChildComponent<UISprite>("ClickSprite");

        m_pressReceiver = m_dialogBoardSprite.transform.GetComponent<PressReceiver>();

        AddChildComponentMouseClick("SkipBtn", delegate()
        {
            EndDialog();
        });

        //解析DialogEvent配置文件
        string eventContent = ResourceManager.Singleton.LoadTextFile("DialogEvent");
        //解析Dialog配置文件////////////////////////////////////////////////////////////////////////
        StringReader sr = new StringReader(eventContent);
        string line = sr.ReadLine();
        while (line != null)
        {
            if (line.Contains("//"))
            {
                line = sr.ReadLine();
                continue;
            }
            if (string.IsNullOrEmpty(line))
            {
                line = sr.ReadLine();
                continue;
            }
            string[] values = line.Split(new string[] { "\t", " " }, System.StringSplitOptions.RemoveEmptyEntries);
            if (values.Length > 0)
            {
                int curStageNum = System.Convert.ToInt32(values[0]);
                DialogTriggerPos triggerPos = (DialogTriggerPos)System.Convert.ToInt32(values[1]);

                DialogEvent data = new DialogEvent();
                data.dialogGroupNum = System.Convert.ToInt32(values[2]);
                data.need3Star = (values[2] == "Y");
                data.backPic = values[3];
                data.triggerPos = triggerPos;

                m_dialogEventMap.Add(new KeyValuePair<int, DialogTriggerPos>(curStageNum, triggerPos), data);                               //添加对话数据
            }

            line = sr.ReadLine();
        }
        sr.Close();

        string content = ResourceManager.Singleton.LoadTextFile("Dialog");
        //解析Dialog配置文件////////////////////////////////////////////////////////////////////////
        sr = new StringReader(content);
        line = sr.ReadLine();
        int curDialogGroupNum = -1;
        List<DialogData> curDialogGroup = new List<DialogData>();
        while (line != null)
        {
            if (line.Contains("//"))
            {
                line = sr.ReadLine();
                continue;
            }
            if (string.IsNullOrEmpty(line))
            {
                line = sr.ReadLine();
                continue;
            }
            string[] values = line.Split(new string[] { "\t", " " }, System.StringSplitOptions.RemoveEmptyEntries);
            if (values.Length > 0)
            {
                int num = System.Convert.ToInt32(values[0]);
				if(curDialogGroupNum == -1)
				{
					curDialogGroupNum = num;
					m_dialogGroupMap.Add(curDialogGroupNum, curDialogGroup);
				}
                else if (num != curDialogGroupNum)                           //若数字变化了,新加一组对话
                {
					curDialogGroup = new List<DialogData>();            //重新创建一个对话组数据
					curDialogGroupNum = num;                            //更改当前在编的对话组数字
                    m_dialogGroupMap.Add(curDialogGroupNum, curDialogGroup);
                }

                DialogData data = new DialogData();
                data.activeLeftHead = (values[1] == "L");
                data.headLeft = values[2];
                data.headRight = values[3];
                data.itemSprite = values[4];
                data.speed = System.Convert.ToInt32(values[5]);
                data.content = values[6];
                data.content.Replace('_', ' ');                         //下划线替换成空格

                curDialogGroup.Add(data);                               //添加对话数据
            }

            line = sr.ReadLine();
        }
        sr.Close();
    }
コード例 #49
0
 public virtual void Build(DialogData data)
 {
 }
コード例 #50
0
 public override void OnDataChanged(object data)
 {
     base.OnDataChanged(data);
     Data = data as DialogData;
 }