Beispiel #1
0
        //指定の名前のウィンドウを検索
        internal AdvMessageWindow FindWindow(string name)
        {
            AdvMessageWindow window = CurrentWindow;

            if (!string.IsNullOrEmpty(name))
            {
                if (!AllWindows.TryGetValue(name, out window))
                {
                    Debug.LogError(name + "is not found in all message windows");
                }
            }
            return(window);
        }
Beispiel #2
0
        //メッセージウィンドを変更
        internal void ChangeCurrentWindow(string name)
        {
            //設定なしならなにもしない
            if (string.IsNullOrEmpty(name))
            {
                return;
            }

            if (CurrentWindow != null && CurrentWindow.Name == name)
            {
                //変化なし
                return;
            }
            else
            {
                AdvMessageWindow window;
                if (!ActiveWindows.TryGetValue(name, out window))
                {
                    //アクティブなウィンドウにない場合、全ウィンドウから検索
                    if (!AllWindows.TryGetValue(name, out window))
                    {
                        //全ウィンドウにもない場合どうしようもないので、デフォルトウィンドウを
                        Debug.LogWarning(name + "is not found in window manager");
                        name   = DefaultActiveWindowNameList[0];
                        window = AllWindows[name];
                    }
                    //非アクティブなウィンドウと交換
                    if (CurrentWindow != null)
                    {
                        ActiveWindows.Remove(CurrentWindow.Name);
                    }
                    ActiveWindows.Add(name, window);

                    //登録されたイベントを呼ぶ
                    CalllEventActiveWindows();
                }
                LastWindow    = CurrentWindow;
                CurrentWindow = window;
                //登録されたイベントを呼ぶ
                if (LastWindow != null)
                {
                    LastWindow.ChangeCurrent(false);
                }
                CurrentWindow.ChangeCurrent(true);
                OnChangeCurrentWindow.Invoke(this);
            }
        }
Beispiel #3
0
        internal void ChangeActiveWindows(List <string> names)
        {
            //複数ウィンドウの設定
            ActiveWindows.Clear();
            foreach (var name in names)
            {
                AdvMessageWindow window;
                if (!AllWindows.TryGetValue(name, out window))
                {
                    Debug.LogError(name + " is not found in message windows");
                }
                else
                {
                    ActiveWindows.Add(name, window);
                }
            }

            //登録されたイベントを呼ぶ
            CalllEventActiveWindows();
        }