private void ReceiveConcealedGridsResponse(byte[] body)
        {
            Log.Trace("Receiving Concealed Grids Response",
                      "ReceiveConcealedGridsResponse");

            ConcealedGridsResponse response = ConcealedGridsResponse.FromBytes(body);

            Session.ConcealedGrids = response.ConcealedGrids;
            String result = Session.ConcealedGrids.Count + " Concealed Grids:\n\n";

            int i = 1;

            foreach (World.Entities.ConcealedGrid grid in Session.ConcealedGrids)
            {
                result += String.Format("{0}: \"{1}\" - Revealability: {2}\n",
                                        i, grid.DisplayName, grid.IsRevealable);
                i++;
            }

            Notification notice = new WindowNotification()
            {
                Text       = result,
                BigLabel   = "Garden Performance",
                SmallLabel = "Concealed Grids"
            };

            notice.Raise();
        }
        private void ReceiveObservingEntitiesResponse(byte[] body)
        {
            Log.Trace("Receiving Observing Entities Response",
                      "ReceiveObservingEntitiesResponse");

            Log.Trace("body size is " + body.Count(), "ReceiveObservingEntitiesResponse");
            ObservingEntitiesResponse response = ObservingEntitiesResponse.FromBytes(body);

            Session.ObservingEntities = response.ObservingEntities;

            String result = Session.ObservingEntities.Count + " Observing Entities:\n\n";

            int i = 1;

            foreach (ObservingEntity e in Session.ObservingEntities)
            {
                // Ids
                result += i + ": \"" + e.ObservationDetails() + "\n";

                i++;
            }

            Notification notice = new WindowNotification()
            {
                Text       = result,
                BigLabel   = "Garden Performance",
                SmallLabel = "Observing Entities"
            };

            notice.Raise();
        }
        private void ReceiveRevealedGridsResponse(byte[] body)
        {
            Log.Trace("Receiving Revealed Grids Response",
                      "ReceiveRevealedGridsResponse");

            RevealedGridsResponse response = RevealedGridsResponse.FromBytes(body);

            Session.RevealedGrids = response.RevealedGrids;

            String result = Session.RevealedGrids.Count + " Revealed Grids:\n\n";

            int i = 1;

            foreach (RevealedGrid grid in Session.RevealedGrids)
            {
                // Ids
                result += i + ": \"" + grid.DisplayName + "\" - ";
                result += (grid.IsConcealable) ? "Concealable" : "Not concealable";
                result += "\n";

                i++;
            }

            Notification notice = new WindowNotification()
            {
                Text       = result,
                BigLabel   = "Garden Performance",
                SmallLabel = "Revealed Grids"
            };

            notice.Raise();
        }
        // サブウィンドウを表示する
        private void ShowSubWindow(int windowId, bool isModal = true)
        {
            WindowNotification windowNotification = new WindowNotification();

            windowNotification.WindowId = windowId;
            windowNotification.IsModal  = isModal;
            ShowWindowRequest.Raise(windowNotification);
        }
Example #5
0
        /// <summary>
        /// FullCommand can change depending on command's position in the Tree
        /// </summary>
        /// <param name="security"></param>
        public override void Refresh(int security)
        {
            RefreshFullCommand();

            String fullCommandWithArgs = FullCommand + " " + String.Join(" ", ArgNames);

            InfoAsTop = fullCommandWithArgs + "\n\n" + LongInfo;
            //InfoBadusage = "Incorrect usage.\n\n" + InfoAsTop;
            InfoAsChild = fullCommandWithArgs + " - " + ShortInfo;
            InfoNotice  = new WindowNotification()
            {
                Text       = InfoAsTop,
                BigLabel   = BigLabel,
                SmallLabel = SmallLabel
            };

            ArgsErrorNotice = new ChatNotification()
            {
                Text = "Expected " + ArgCount + " arguments -\n" + fullCommandWithArgs
            };
        }
Example #6
0
        public override void Refresh(int security)
        {
            RefreshFullCommand();
            InfoAsTop = LongInfo;
            //InfoBadusage = InfoAsTop;
            //String unknownChildText = "Unknown subcommand for " + FullCommand +
            //    ", did you mean on of these? :";
            InfoAsChild  = FullCommand + " - " + ShortInfo;
            ChildrenInfo = "";

            if (Children.Count > 0)
            {
                foreach (Node child in Children)
                {
                    child.Refresh(security);
                    if (security >= child.Security)
                    {
                        ChildrenInfo += child.InfoAsChild + "\n";
                    }
                    ChildWords += " " + child.Word;
                }

                InfoAsTop += "\n\nCommands:\n\n" + ChildrenInfo;
                //InfoBadusage += "\n\n Incorrect usage. Commands: ";
                InfoAsChild += "\n" + ChildrenInfo;
            }

            InfoNotice = new WindowNotification()
            {
                Text       = InfoAsTop,
                BigLabel   = BigLabel,
                SmallLabel = SmallLabel
            };

            /*
             * UnknownChildNotice = new ChatNotification() {
             *  Text = unknownChildText
             * };
             * */
        }
        protected override Window CreateWindow(INotification notification)
        {
            WindowNotification windowNotification = (WindowNotification)notification;

            // モーダル
            IsModal = windowNotification.IsModal;

            // 生成するウィンドウ
            if (windowNotification.WindowId == WindowNotification.MAIN_WINDOW)
            {
                return(new MainWindow());
            }
            if (windowNotification.WindowId == WindowNotification.CAPTURE_WINDOW)
            {
                return(new CaptureWindow());
            }
            if (windowNotification.WindowId == WindowNotification.MY_PARTY_WINDOW)
            {
                return(new MyPartyWindow());
            }
            if (windowNotification.WindowId == WindowNotification.OPPONENT_PARTY_WINDOW)
            {
                return(new OpponentPartyWindow());
            }
            if (windowNotification.WindowId == WindowNotification.TODAY_BATTLE_RECORD_WINDOW)
            {
                return(new TodayBattleRecordWindow());
            }
            if (windowNotification.WindowId == WindowNotification.BATTLE_HISTORY_WINDOW)
            {
                return(new BattleHistoryWindow());
            }

            //TODO エラー画面を表示する?
            return(new Window());
        }
Example #8
0
 public static void PostMessage(IntPtr hWnd, WindowNotification message)
 {
     PostMessage(hWnd, (uint)message, IntPtr.Zero, IntPtr.Zero);
 }