示例#1
0
        private void ElementChanged(object sender, ElementChangingEventArgs e)
        {
            var x     = e.X;
            var y     = e.Y;
            var value = e.Value;

            if (x > 8 || y > 8 || value > 9 || _data[x, y].IsPermanent)
            {
                return;
            }

            _data[x, y].Value = value;

            IMessage message = new ElementChangedMessage(x, y, value);

            BroadcastMessage(message);

            if (SudokuFieldIsFull())
            {
                if (Check())
                {
                    IMessage messageWin = new WinMessage();
                    BroadcastMessage(messageWin);
                }
            }
        }
示例#2
0
        private void OnWinMessageCallBack(WinMessage _winMessage)
        {
            string msg = string.Empty;// = $"\n Message {_winMessage.Message} {_winMessage.WParam} {_winMessage.LParam} {_winMessage.IsHandled}";

            switch (_winMessage.Message)
            {
            case WinProc_Message.WM_KEYDOWN:
                msg += $"\n {_winMessage.Message} {KeyInterop.KeyFromVirtualKey((int)_winMessage.WParam)}";
                break;

            case WinProc_Message.WM_KEYUP:
            case WinProc_Message.WM_SYSKEYDOWN:
            case WinProc_Message.WM_SYSKEYUP:
                msg += $"\n {_winMessage.Message} {KeyInterop.KeyFromVirtualKey((int)_winMessage.WParam)}";
                break;

            case WinProc_Message.WM_WTSSESSION_CHANGE:
                switch ((WParam_Message)_winMessage.WParam)
                {
                case WParam_Message.WTS_SESSION_LOCK:
                    msg += " User Lock";
                    break;

                case WParam_Message.WTS_SESSION_UNLOCK:
                    msg += " User UnLock";
                    break;
                }
                break;

            case WinProc_Message.WM_QUERYENDSESSION:
                switch ((LParam_Message)_winMessage.LParam)
                {
                case LParam_Message.ENDSESSION_CLOSEAPP:
                case LParam_Message.ENDSESSION_CRITICAL:
                    msg += " WM_QUERYENDSESSION Not process now";
                    break;

                case LParam_Message.ENDSESSION_LOGOFF:
                    msg += " WM_QUERYENDSESSION logging off";
                    break;
                }
                break;

            case WinProc_Message.WM_ENDSESSION:
                switch ((LParam_Message)_winMessage.LParam)
                {
                case LParam_Message.ENDSESSION_CLOSEAPP:
                case LParam_Message.ENDSESSION_CRITICAL:
                    msg += " WM_ENDSESSION Not process now";
                    break;

                case LParam_Message.ENDSESSION_LOGOFF:
                    msg += " WM_ENDSESSION logging off";
                    break;
                }
                break;
            }
            //_messageBox.MenuName += msg;
            LogTool.Logger(msg);
        }
示例#3
0
    void Start()
    {
        foreach (Transform child in transform)
        {
            if (child.gameObject.GetComponent <Text>())
            {
                _progressLabel = child.gameObject.GetComponent <Text>();
            }
        }
        _gameTimeSlider = GetComponent <Slider>();
        _musicManager   = FindObjectOfType <MusicManager>();
        _levelManager   = FindObjectOfType <LevelManager>();
        _winMessage     = FindObjectOfType <WinMessage>();

        if (_progressLabel == null)
        {
            Debug.LogError("ProgressLabel is not set.");
        }
        if (_musicManager == null)
        {
            Debug.LogWarning("MusicManager not found.");
        }
        if (_levelManager == null)
        {
            Debug.LogWarning("LevelManager not found.");
        }
        if (_winMessage == null)
        {
            Debug.LogWarning("WinMessage not found.");
        }
    }
示例#4
0
    void OnWin(NetworkMessage netMsg)
    {
        WinMessage msg = netMsg.ReadMessage <WinMessage>();

        if (msg.win)
        {
            TextAnnouncer announcer = GameObject.Find("Canvas").GetComponent <Canvas>().GetComponent <TextAnnouncer>();
            Invoke("Restart", announcer.displayTime);
            announcer.Display(msg.toDisplay);
        }
    }
示例#5
0
        public static void NavigateMyBrowser(FeedItem item)
        {
            item.IsRead = true;

            // 既読履歴を更新
            UpdateReadHistory(item);

            App.BrowseURL = item.Link;
            var bgw = WindowInfo.FindWindowByName(null, TITLE);

            WinMessage.Send(bgw, BROWSING_URL_MESSAGE, IntPtr.Zero, IntPtr.Zero);
        }
示例#6
0
    void OnWin(NetworkMessage netMsg)
    {
        WinMessage msg = netMsg.ReadMessage <WinMessage>();

        if (msg.win)
        {
            TextAnnouncer announcer = GameObject.Find("Canvas").GetComponent <Canvas>().GetComponent <TextAnnouncer>();
            GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>().Play("win");
            float displayTime = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManager>().GetSound("win").clip.length;
            Invoke("Restart", displayTime);
            announcer.DisplayWithTime(msg.toDisplay, displayTime);
        }
    }
    private void ProcessWin(IntPtr winnerPkt)
    {
        WinMessage wm = (WinMessage)Marshal.PtrToStructure(winnerPkt, typeof(WinMessage));

        if (wm.winner == guid)
        {
            SceneManager.LoadScene("Success");
        }
        else
        {
            SceneManager.LoadScene("Lose");
        }
    }
示例#8
0
        private void ShowWinLine(WinMessage message)
        {
            var buttons     = FieldGrid.Children.Cast <Button>().ToList();
            var borderBrush = new SolidColorBrush(Colors.Blue);

            foreach (var position in message.WinLine)
            {
                var button = buttons.FirstOrDefault(b => Grid.GetRow(b) == position.Row && Grid.GetColumn(b) == position.Column);
                if (button == null)
                {
                    continue;
                }

                button.BorderBrush = borderBrush;
            }
        }
示例#9
0
        /// <summary>
        /// Uriをもとにブラウザを起動する。
        /// </summary>
        /// <param name="item"></param>
        public static void StartBrowser(String browserPath, FeedItem item)
        {
            item.IsRead = true;

            // 既読履歴を更新
            UpdateReadHistory(item);

            // ブラウザを起動
            Process.Start(browserPath, $"{App.Configure?.BrowserOption ?? ""} {item.Link}");

            // 自動で最小化するオプション
            if (App.Configure?.IsAutoMinimize ?? false)
            {
                var bgw = WindowInfo.FindWindowByName(null, TITLE);
                WinMessage.Send(bgw, Window_MIN_MESSAGE, IntPtr.Zero, IntPtr.Zero);
            }
        }
示例#10
0
        /// <summary>
        /// RSSフィードのサイト選択変更
        /// </summary>
        private void SiteSelectBox_SelectionChanged(Object sender, SelectionChangedEventArgs e)
        {
            if (sender is ComboBox cmb)
            {
                if (!(cmb.SelectedItem is RssSiteInfo item))
                {
                    return;
                }

                UpdateListBox(item, LISTBOX_UPDATE);

                this.FeedList.SelectedIndex = 0;
                this.FeedList.ScrollIntoView(this.FeedList.SelectedItem);

                FilterClear();

                // メインウインドウにサイト変更メッセージを送信する
                var bgw = WindowInfo.FindWindowByName(null, TITLE);
                WinMessage.Send(bgw, CHANGE_MESSAGE, (IntPtr)item.ID, IntPtr.Zero);
            }
        }
示例#11
0
        /// <summary>
        /// Prints that user has solved maze
        /// </summary>
        static void Win()
        {
            Draw();

            Console.SetCursorPosition(WinLeft, WinTop);
            Console.ForegroundColor = WIN_FG;
            Console.BackgroundColor = WIN_BG;

            string[] _win = WinMessage.Split(new char[] { '\n' });
            for (int _i = 0; _i < _win.Length; _i++)
            {
                Console.SetCursorPosition(WinLeft, WinTop + _i);
                Console.Write(_win[_i]);
            }

            while (ConsoleKey.Enter != Console.ReadKey().Key)
            {
                //Spinning while input not [enter]
            }

            Console.Clear();
            Player.Reset();
            Console.ResetColor();
        }
示例#12
0
 void Awake()
 {
     Instance = this;
 }
示例#13
0
    // Use this for initialization
    void Start()
    {
        Game         = GameObject.Find("Game").GetComponent <Game>();
        ActionPopup  = GameObject.Find("GUI").GetComponent <ActionPopupMenu>();
        OptionsPopup = GameObject.Find("GUI").GetComponent <OptionsPopupMenu>();
        BuyMenu      = GameObject.Find("GUI").GetComponent <BuyMenu>();
        WinMessage   = GameObject.Find("GUI").GetComponent <WinMessage>();

        useGUILayout = false;

        StyleDefault.font     = Font;
        StyleDefault.fontSize = 24;

        // Colours
        Texture_Red          = new Texture2D(1, 1);
        Texture_Red.wrapMode = TextureWrapMode.Repeat;
        Texture_Red.SetPixel(0, 0, Color.red);
        Texture_Red.Apply();

        Texture_Blue          = new Texture2D(1, 1);
        Texture_Blue.wrapMode = TextureWrapMode.Repeat;
        Texture_Blue.SetPixel(0, 0, Color.blue);
        Texture_Blue.Apply();

        Texture_White          = new Texture2D(1, 1);
        Texture_White.wrapMode = TextureWrapMode.Repeat;
        Texture_White.SetPixel(0, 0, Color.white);
        Texture_White.Apply();

        // Team Banner
        SetTeam(Game.CurrentTeam, Game.GetCurrentTeam().Resources);

        // Resources
        Resources_Style                  = new GUIStyle(StyleDefault);
        Resources_Style.font             = Font2;
        Resources_Style.normal.textColor = Resources_FontColor;

        ResourcesTag_Style = new GUIStyle(Resources_Style);

        Resources_Style.alignment = TextAnchor.UpperRight;

        // Help
        Help_Style                  = new GUIStyle(StyleDefault);
        Help_Style.font             = Font2;
        Help_Style.normal.textColor = Color.white;
        Help_Style.fontSize         = 16;
        SetCurrentHelp(PROMPT_LEFTMOUSE, "MENU");

        // Tile Info
        TileInfoBox_Texture          = new Texture2D(1, 1);
        TileInfoBox_Texture.wrapMode = TextureWrapMode.Repeat;
        TileInfoBox_Texture.SetPixel(0, 0, new Color(0.2f, 0.2f, 0.2f, 0.5f));
        TileInfoBox_Texture.Apply();
        TileInfoBox_Style.normal.background = TileInfoBox_Texture;

        TileInfoName_Style = new GUIStyle(StyleDefault);
        TileInfoName_Style.normal.textColor = Color.white;
        TileInfoName_Style.fontSize         = 28;
        TileInfoName_Style.alignment        = TextAnchor.UpperCenter;
        TileInfoName_Style.contentOffset    = new Vector2(0, 12);

        TileInfoHitPoints_Style = new GUIStyle(StyleDefault);
        TileInfoHitPoints_Style.normal.textColor = Color.white;
        TileInfoHitPoints_Style.fontSize         = 20;
        TileInfoHitPoints_Style.alignment        = TextAnchor.UpperLeft;
        TileInfoHitPoints_Style.contentOffset    = new Vector2(0, 6);

        SetTileInfo("Plain");

        // Tutorial
        Tutorial_Style                  = new GUIStyle(StyleDefault);
        Tutorial_Style.fontSize         = 32;
        Tutorial_Style.normal.textColor = Color.white;
        Tutorial_Style.alignment        = TextAnchor.MiddleCenter;

        // Day Change
        Day_Style                  = new GUIStyle(StyleDefault);
        Day_Style.fontSize         = 120;
        Day_Style.normal.textColor = Color.white;
        Day_Style.alignment        = TextAnchor.MiddleCenter;

        // Hit Points
        HitPoints_Style = new GUIStyle(StyleDefault);
        HitPoints_Style.normal.textColor = Color.white;
    }
示例#14
0
 public static extern bool PeekMessage(out WinMessage msg, IntPtr hWnd, uint messageFilterMin, uint messageFilterMax, uint flags);
示例#15
0
    // Use this for initialization
    void Start()
    {
        Game = GameObject.Find("Game").GetComponent<Game>();
        ActionPopup = GameObject.Find("GUI").GetComponent<ActionPopupMenu>();
        OptionsPopup = GameObject.Find("GUI").GetComponent<OptionsPopupMenu>();
        BuyMenu = GameObject.Find("GUI").GetComponent<BuyMenu>();
        WinMessage = GameObject.Find("GUI").GetComponent<WinMessage>();

        useGUILayout = false;

        StyleDefault.font = Font;
        StyleDefault.fontSize = 24;

        // Colours
        Texture_Red = new Texture2D(1, 1);
        Texture_Red.wrapMode = TextureWrapMode.Repeat;
        Texture_Red.SetPixel(0, 0, Color.red);
        Texture_Red.Apply();

        Texture_Blue = new Texture2D(1, 1);
        Texture_Blue.wrapMode = TextureWrapMode.Repeat;
        Texture_Blue.SetPixel(0, 0, Color.blue);
        Texture_Blue.Apply();

        Texture_White = new Texture2D(1, 1);
        Texture_White.wrapMode = TextureWrapMode.Repeat;
        Texture_White.SetPixel(0, 0, Color.white);
        Texture_White.Apply();

        // Team Banner
        SetTeam(Game.CurrentTeam, Game.GetCurrentTeam().Resources);

        // Resources
        Resources_Style = new GUIStyle(StyleDefault);
        Resources_Style.font = Font2;
        Resources_Style.normal.textColor = Resources_FontColor;

        ResourcesTag_Style = new GUIStyle(Resources_Style);

        Resources_Style.alignment = TextAnchor.UpperRight;

        // Help
        Help_Style = new GUIStyle(StyleDefault);
        Help_Style.font = Font2;
        Help_Style.normal.textColor = Color.white;
        Help_Style.fontSize = 16;
        SetCurrentHelp(PROMPT_LEFTMOUSE, "MENU");

        // Tile Info
        TileInfoBox_Texture = new Texture2D(1, 1);
        TileInfoBox_Texture.wrapMode = TextureWrapMode.Repeat;
        TileInfoBox_Texture.SetPixel(0, 0, new Color(0.2f, 0.2f, 0.2f, 0.5f));
        TileInfoBox_Texture.Apply();
        TileInfoBox_Style.normal.background = TileInfoBox_Texture;

        TileInfoName_Style = new GUIStyle(StyleDefault);
        TileInfoName_Style.normal.textColor = Color.white;
        TileInfoName_Style.fontSize = 28;
        TileInfoName_Style.alignment = TextAnchor.UpperCenter;
        TileInfoName_Style.contentOffset = new Vector2(0, 12);

        TileInfoHitPoints_Style = new GUIStyle(StyleDefault);
        TileInfoHitPoints_Style.normal.textColor = Color.white;
        TileInfoHitPoints_Style.fontSize = 20;
        TileInfoHitPoints_Style.alignment = TextAnchor.UpperLeft;
        TileInfoHitPoints_Style.contentOffset = new Vector2(0, 6);

        SetTileInfo("Plain");

        // Tutorial
        Tutorial_Style = new GUIStyle(StyleDefault);
        Tutorial_Style.fontSize = 32;
        Tutorial_Style.normal.textColor = Color.white;
        Tutorial_Style.alignment = TextAnchor.MiddleCenter;

        // Day Change
        Day_Style = new GUIStyle(StyleDefault);
        Day_Style.fontSize = 120;
        Day_Style.normal.textColor = Color.white;
        Day_Style.alignment = TextAnchor.MiddleCenter;

        // Hit Points
        HitPoints_Style = new GUIStyle(StyleDefault);
        HitPoints_Style.normal.textColor = Color.white;
    }
 public static extern bool PeekMessage(out WinMessage msg, IntPtr hWnd, uint messageFilterMin, uint messageFilterMax, uint flags);