Exemplo n.º 1
0
        /// <summary>
        /// Process the select & go back/cancel buttons.
        /// </summary>
        /// <returns></returns>
        private async Task ProcessMainButtons()
        {
            UIMenu currentMenu = Cf.GetOpenMenu();

            if (currentMenu != null && !DontOpenMenus && Mp.IsAnyMenuOpen() && !NoClipEnabled)
            {
                if (currentMenu.Visible && !DisableControls)
                {
                    // Select / Enter
                    if (Game.IsDisabledControlJustReleased(0, Control.FrontendAccept) || Game.IsControlJustReleased(0, Control.FrontendAccept))
                    {
                        if (currentMenu.MenuItems.Count() > 0)
                        {
                            currentMenu.SelectItem();
                        }
                    }
                    // Cancel / Go Back
                    else if (Game.IsDisabledControlJustReleased(0, Control.PhoneCancel))
                    {
                        // Wait for the next frame to make sure the "cinematic camera" button doesn't get "re-enabled" before the menu gets closed.
                        await Delay(0);

                        currentMenu.GoBack();
                    }
                }
            }
            else
            {
                await Delay(0);
            }
        }
        // Is there a way to have a Task/void override
        protected override async void Run(Cmd cmd)
        {
            // We know track has value from checks before
            var track  = cmd.Arg.GetValueOrDefault().Lexeme;
            var album  = cmd.FlagArgs.ContainsKey(albumFlag) ? cmd.FlagArgs[albumFlag].Lexeme : null;
            var artist = cmd.FlagArgs.ContainsKey(artistFlag) ? cmd.FlagArgs[artistFlag].Lexeme : null;

            Clti.WriteLine($"Finding: {track} {album} {artist}");
            var tracks = (await db.LoadTracks())
                         .Where(x => artist?.Equals(x.Artist ?? "", StringComparison.OrdinalIgnoreCase) ?? true)
                         .Where(x => album?.Equals(x.Album ?? "", StringComparison.OrdinalIgnoreCase) ?? true)
                         .Where(x => track.Equals(x.Title ?? "", StringComparison.OrdinalIgnoreCase)).ToList();

            if (tracks.Count == 0)
            {
                Clti.WriteError("No tracks found matching criterion");
            }
            else if (tracks.Count > 1)
            {
                Clti.WriteLine("Multiple tracks found, please narrow criterion");
            }
            tracks.ForEach(Clti.WriteLine);
            if (tracks.Count == 1)
            {
                Mp.SetTrack(tracks[0]);
            }
        }
Exemplo n.º 3
0
    public void LoadStatus(SaveData LoadData)
    {
        Name      = new Name(LoadData.Name);
        Lv        = new Lv(LoadData.Lv);
        Hp        = new Hp(LoadData.MaxHp, LoadData.CurrentHp);
        Mp        = new Mp(LoadData.MaxMp, LoadData.CurrentMp);
        Str       = new Str(LoadData.Str);
        Vit       = new Vit(LoadData.Vit);
        Dex       = new Dex(LoadData.Dex);
        Int       = new Int(LoadData.Int);
        Exp       = new Exp(LoadData.NextExp, LoadData.CurrentExp);
        MoveSpeed = new MoveSpeed(3, 1);

        Direction = new Direction(Animator);

        ChargeSkill = new SwordChargeAtack();
        NormalAtack = new SwordNomalAtack();
        Skill       = NormalAtack;
        Charge      = GameObject.transform.Find("tame").GetComponent <Charge>();
        Weapon      = (GameObject)Resources.Load("prefab/Weapon/Sword");
        Equip       = new Equip();

        Equip.Weapon(LoadData.EquipWeapon);
        Equip.Head(LoadData.EquipHead);
        Equip.Body(LoadData.EquipBody);
        Equip.Hand(LoadData.EquipHand);
        Equip.Foot(LoadData.EquipFoot);
        Equip.Accessory(LoadData.EquipAccessory);
    }
Exemplo n.º 4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Hp != 0)
            {
                hash ^= Hp.GetHashCode();
            }
            if (Mp != 0)
            {
                hash ^= Mp.GetHashCode();
            }
            if (Attack != 0)
            {
                hash ^= Attack.GetHashCode();
            }
            if (Defend != 0)
            {
                hash ^= Defend.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Add the menu to the menu pool and set it up correctly.
 /// Also add and bind the menu buttons.
 /// </summary>
 /// <param name="submenu"></param>
 /// <param name="menuButton"></param>
 private void AddMenu(UIMenu submenu, UIMenuItem menuButton)
 {
     Menu.AddItem(menuButton);
     Menu.BindMenuToItem(submenu, menuButton);
     Mp.Add(submenu);
     submenu.RefreshIndex();
     submenu.UpdateScaleform();
 }
Exemplo n.º 6
0
 public void LvUp()
 {
     Lv.LvUp();
     Hp.LvUp(10);
     Mp.LvUp(5);
     Str.LvUp(5);
     Vit.LvUp(5);
     Dex.LvUp(3);
     Int.LvUp(1);
     DataManager.Save();
 }
        protected override void Run(Cmd cmd)
        {
            if (Mp.CurrentTrack == null)
            {
                Clti.WriteLine("No track is currently playing");
                return;
            }

            Mp.Pause();
            Clti.WriteLine("Paused");
        }
Exemplo n.º 8
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (AccountId != 0UL)
            {
                hash ^= AccountId.GetHashCode();
            }
            if (PlayerId != 0UL)
            {
                hash ^= PlayerId.GetHashCode();
            }
            if (Diamonds != 0)
            {
                hash ^= Diamonds.GetHashCode();
            }
            if (OldLevel != 0)
            {
                hash ^= OldLevel.GetHashCode();
            }
            if (OldExp != 0)
            {
                hash ^= OldExp.GetHashCode();
            }
            if (AddedExp != 0)
            {
                hash ^= AddedExp.GetHashCode();
            }
            if (Hp != 0)
            {
                hash ^= Hp.GetHashCode();
            }
            if (Mp != 0)
            {
                hash ^= Mp.GetHashCode();
            }
            if (Food != 0)
            {
                hash ^= Food.GetHashCode();
            }
            if (Gold != 0)
            {
                hash ^= Gold.GetHashCode();
            }
            hash ^= cards_.GetHashCode();
            hash ^= cardTemps_.GetHashCode();
            hash ^= items_.GetHashCode();
            hash ^= itemTemps_.GetHashCode();
            hash ^= buffs_.GetHashCode();
            hash ^= buffTemps_.GetHashCode();
            hash ^= equips_.GetHashCode();
            hash ^= equipTemps_.GetHashCode();
            return(hash);
        }
Exemplo n.º 9
0
        protected override void Run(Cmd cmd)
        {
            if (Mp.CurrentTrack == null)
            {
                Clti.WriteLine("No track is currently playing");
                return;
            }

            Clti.WriteLine($"Playing '{Mp.CurrentTrack.Title}'");
            Mp.Play();
        }
Exemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     ended   = false;
     counter = 0;
     round   = 0;
     PlayerPrefs.SetInt("rounds", totalRounds * sentencePerRound);
     scores = GetComponent <ScoreManager>();
     graph  = GetComponent <ScoreGraph>();
     speech = GetComponent <Speech> ();
     mp     = GetComponent <Mp> ();
 }
Exemplo n.º 11
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (AccountId != 0UL)
            {
                hash ^= AccountId.GetHashCode();
            }
            if (PlayerId != 0UL)
            {
                hash ^= PlayerId.GetHashCode();
            }
            if (Reason != 0)
            {
                hash ^= Reason.GetHashCode();
            }
            if (Diamonds != 0)
            {
                hash ^= Diamonds.GetHashCode();
            }
            if (Level != 0)
            {
                hash ^= Level.GetHashCode();
            }
            if (Exp != 0)
            {
                hash ^= Exp.GetHashCode();
            }
            if (Hp != 0)
            {
                hash ^= Hp.GetHashCode();
            }
            if (Mp != 0)
            {
                hash ^= Mp.GetHashCode();
            }
            if (Food != 0)
            {
                hash ^= Food.GetHashCode();
            }
            if (Gold != 0)
            {
                hash ^= Gold.GetHashCode();
            }
            hash ^= cards_.GetHashCode();
            hash ^= items_.GetHashCode();
            hash ^= buffs_.GetHashCode();
            hash ^= equips_.GetHashCode();
            return(hash);
        }
        protected override void Run(Cmd cmd)
        {
            if (Mp.CurrentTrack == null)
            {
                Clti.WriteError("There is no currently playing track");
                return;
            }

            if (Mp.Queue.IndexOf(Mp.CurrentTrack) == 0)
            {
                Clti.WriteError("There is no previous track in queue");
                return;
            }

            Mp.SkipToPrev();
            Clti.WriteLine($"Playing previous track {Mp.CurrentTrack.Title}");
        }
Exemplo n.º 13
0
        void Repeat(object o)
        {
            if (IsRepeated == false)
            {
                IsRepeated = true;
            }
            else if (IsRepeated == true && SliderValue != 1)
            {
                IsRepeated = false;
            }

            else if (IsRepeated == true && SliderValue == 1)
            {
                Mp.Open(new Uri(CurrentSong.PathS, UriKind.RelativeOrAbsolute));
                Mp.Play();
                Mp.MediaOpened += new EventHandler(mediaOpened);
            }
        }
Exemplo n.º 14
0
 RedSlime()
 {
     Name          = new Name("レッドスライム");
     Lv            = new Lv(5);
     Hp            = new Hp(20, 20);
     Mp            = new Mp(0, 0);
     Str           = new Str(20);
     Vit           = new Vit(20);
     Exp           = 10;
     Gold          = 10;
     DropItem      = 0;
     MoveSpeed     = 1;
     MoveStatus    = 0;
     AtackWaitTime = 1f;
     DeathCheck    = false;
     AtackOn       = false;
     MoveOn        = false;
     MoveOnX       = 0;
     MoveOnY       = 0;
 }
Exemplo n.º 15
0
    public void NewGame(string name)
    {
        Name      = new Name(name);
        Lv        = new Lv(1);
        Hp        = new Hp(50, 50);
        Mp        = new Mp(10, 10);
        Str       = new Str(1);
        Vit       = new Vit(1);
        Dex       = new Dex(1);
        Int       = new Int(1);
        Exp       = new Exp(100, 0);
        MoveSpeed = new MoveSpeed(3, 1);

        Equip = new Equip();

        Direction = new Direction(Animator);

        Weapon = (GameObject)Resources.Load("prefab/Weapon/Sword");

        ChargeSkill = new SwordChargeAtack();
        NormalAtack = new SwordNomalAtack();
        Skill       = NormalAtack;
        Charge      = GameObject.transform.Find("tame").GetComponent <Charge>();
    }
Exemplo n.º 16
0
        /// <summary>
        /// Main OnTick task runs every game tick and handles all the menu stuff.
        /// </summary>
        /// <returns></returns>
        private async Task OnTick()
        {
            #region FirstTick
            // Only run this the first tick.
            if (firstTick)
            {
                firstTick = false;
                // Clear all previous pause menu info/brief messages on resource start.
                ClearBrief();

                // Request the permissions data from the server.
                TriggerServerEvent("vMenu:RequestPermissions", PlayerId());

                // Wait until the data is received.
                while (!permissionsSetupDone || !optionsSetupDone || GetPlayerName(PlayerId()) == "**Invalid**" || GetPlayerName(PlayerId()) == "** Invalid **")
                {
                    await Delay(0);
                }

                // Create the main menu.
                Menu = new UIMenu(GetPlayerName(PlayerId()), "Main Menu", true)
                {
                    ScaleWithSafezone       = false,
                    MouseControlsEnabled    = false,
                    MouseEdgeEnabled        = false,
                    ControlDisablingEnabled = false
                };

                // Add the main menu to the menu pool.
                Mp.Add(Menu);

                Menu.RefreshIndex();
                Menu.UpdateScaleform();

                // Create all (sub)menus.
                CreateSubmenus();
            }
            #endregion

            // If the setup (permissions) is done, and it's not the first tick, then do this:
            if (permissionsSetupDone && optionsSetupDone && !firstTick)
            {
                #region Handle Opening/Closing of the menu.
                // If menus can be opened.
                if (!DontOpenMenus && !IsPauseMenuActive())
                {
                    // If the player is using Keyboard & Mouse and they pressed the M key (interaction menu button) then...
                    if (Game.CurrentInputMode == InputMode.MouseAndKeyboard && (Game.IsControlJustPressed(0, (Control)MenuToggleKey) || Game.IsDisabledControlJustPressed(0, (Control)MenuToggleKey)))
                    {
                        // If any menu is already open: close all menus.
                        if (Mp.IsAnyMenuOpen())
                        {
                            Mp.CloseAllMenus();
                        }
                        // Otherwise: toggle the main menu (to be safe, only open it if no other menus are open.)
                        else
                        {
                            Menu.Visible = !Mp.IsAnyMenuOpen();
                        }
                    }

                    // If the player is using a controller, and no menus are currently open.
                    else if (!Mp.IsAnyMenuOpen() && Game.CurrentInputMode == InputMode.GamePad)
                    {
                        // Create a timer and set it to 0.
                        //float timer = 0f;
                        int timer = GetGameTimer();

                        // While (and only if) the player keeps using only the controller, and keeps holding down the interactionmenu button (select on controller).
                        while (Game.CurrentInputMode == InputMode.GamePad && Game.IsControlPressed(0, Control.InteractionMenu))
                        {
                            // If debugging is enabled, show the progress using a timerbar.
                            if (DebugMode)
                            {
                                bt.Draw(0);
                                float percent = ((GetGameTimer() - timer) / 900f);
                                bt.Percentage = percent;
                                //Subtitle.Success(percent.ToString(), 0, true, "Progress:");
                            }

                            // If 900ms in real time have passed.
                            if (GetGameTimer() - timer > 900)
                            {
                                Menu.Visible = !Mp.IsAnyMenuOpen();
                                // Break the loop (resetting the timer).
                                break;
                            }

                            // Wait for the next game tick. This will make the timer only increment once per tick, so it'll take 60 game ticks for the menu to be open (60 frames is +/- 1 sec).
                            await Delay(0);
                        }
                    }
                }
                // If the pause menu is active or all menus should be closed, close all menus.
                else
                {
                    await Delay(3);

                    Mp.CloseAllMenus();
                }
                #endregion

                #region Disable Inputs when any menu is open.
                if (Mp.IsAnyMenuOpen())
                {
                    // Close all menus when the player dies.
                    if (Game.PlayerPed.IsDead)
                    {
                        Mp.CloseAllMenus();
                    }

                    // Disable Gamepad/Controller Specific controls:
                    if (Game.CurrentInputMode == InputMode.GamePad)
                    {
                        Game.DisableControlThisFrame(0, Control.MultiplayerInfo);
                        // when in a vehicle.
                        if (IsPedInAnyVehicle(PlayerPedId(), false))
                        {
                            Game.DisableControlThisFrame(0, Control.VehicleHeadlight);
                            Game.DisableControlThisFrame(0, Control.VehicleDuck);
                        }
                    }
                    // Disable Shared Controls

                    // Radio Inputs
                    Game.DisableControlThisFrame(0, Control.RadioWheelLeftRight);
                    Game.DisableControlThisFrame(0, Control.RadioWheelUpDown);
                    Game.DisableControlThisFrame(0, Control.VehicleNextRadio);
                    Game.DisableControlThisFrame(0, Control.VehicleRadioWheel);
                    Game.DisableControlThisFrame(0, Control.VehiclePrevRadio);

                    // Phone / Arrows Inputs
                    Game.DisableControlThisFrame(0, Control.Phone);
                    Game.DisableControlThisFrame(0, Control.PhoneCancel);
                    Game.DisableControlThisFrame(0, Control.PhoneDown);
                    Game.DisableControlThisFrame(0, Control.PhoneLeft);
                    Game.DisableControlThisFrame(0, Control.PhoneRight);

                    // Attack Controls
                    Game.DisableControlThisFrame(0, Control.Attack);
                    Game.DisableControlThisFrame(0, Control.Attack2);
                    Game.DisableControlThisFrame(0, Control.MeleeAttack1);
                    Game.DisableControlThisFrame(0, Control.MeleeAttack2);
                    Game.DisableControlThisFrame(0, Control.MeleeAttackAlternate);
                    Game.DisableControlThisFrame(0, Control.MeleeAttackHeavy);
                    Game.DisableControlThisFrame(0, Control.MeleeAttackLight);
                    Game.DisableControlThisFrame(0, Control.VehicleAttack);
                    Game.DisableControlThisFrame(0, Control.VehicleAttack2);
                    Game.DisableControlThisFrame(0, Control.VehicleFlyAttack);
                    Game.DisableControlThisFrame(0, Control.VehiclePassengerAttack);
                    Game.DisableControlThisFrame(0, Control.Aim);

                    // Menu toggle button.
                    Game.DisableControlThisFrame(0, (Control)MenuToggleKey);

                    // When in a vehicle
                    //if (IsPedInAnyVehicle(PlayerPedId(), false))
                    {
                        Game.DisableControlThisFrame(0, Control.VehicleSelectNextWeapon);
                        Game.DisableControlThisFrame(0, Control.VehicleSelectPrevWeapon);
                        Game.DisableControlThisFrame(0, Control.VehicleCinCam);
                    }
                }
                #endregion

                // Process the menu. Draw it and reset the menu width offset to make sure any newly generated menus always have the right width offset.
                Mp.WidthOffset = 50;
                Mp.Draw();
            }
        }
Exemplo n.º 17
0
 public void PlayTrackNext(ITrack track)
 {
     Mp.PlayTrackNext(track);
 }
Exemplo n.º 18
0
 public void AddTrackToQueue(ITrack track)
 {
     Mp.AddTrackToQueue(track);
 }
Exemplo n.º 19
0
 public async void ShuffleAll(object sender, EventArgs e)
 {
     Mp.SetTrackList(this, (await GetTracks()).ToList());
     Mp.ShuffleAll();
 }
Exemplo n.º 20
0
        /// <summary>
        /// Main OnTick task runs every game tick and handles all the menu stuff.
        /// </summary>
        /// <returns></returns>
        private async Task OnTick()
        {
            #region FirstTick
            // Only run this the first tick.
            if (firstTick)
            {
                firstTick = false;
                // Clear all previous pause menu info/brief messages on resource start.
                ClearBrief();

                // Request the permissions data from the server.
                TriggerServerEvent("vMenu:RequestPermissions", PlayerId());
                //TriggerServerEvent("vMenu:RequestBanList", PlayerId());

                // Wait until the data is received and the player's name is loaded correctly.
                while (!PreSetupComplete || GetPlayerName(PlayerId()) == "**Invalid**" || GetPlayerName(PlayerId()) == "** Invalid **")
                {
                    await Delay(0);
                }
                if ((Cf.IsAllowed(Permission.Staff) && GetSettingsBool(Setting.vmenu_menu_staff_only)) || GetSettingsBool(Setting.vmenu_menu_staff_only) == false)
                {
                    if (GetSettingsInt(Setting.vmenu_menu_toggle_key) != -1)
                    {
                        MenuToggleKey = GetSettingsInt(Setting.vmenu_menu_toggle_key);
                    }
                    if (GetSettingsInt(Setting.vmenu_noclip_toggle_key) != -1)
                    {
                        NoClipKey = GetSettingsInt(Setting.vmenu_noclip_toggle_key);
                    }
                    // Create the main menu.
                    Menu = new UIMenu("BigFam Crew", "Main Menu", true)
                    {
                        ScaleWithSafezone       = false,
                        MouseControlsEnabled    = false,
                        MouseEdgeEnabled        = false,
                        ControlDisablingEnabled = false
                    };

                    // Add the main menu to the menu pool.
                    Mp.Add(Menu);

                    Menu.RefreshIndex();
                    Menu.UpdateScaleform();

                    // Create all (sub)menus.
                    CreateSubmenus();
                }
            }
            #endregion


            // If the setup (permissions) is done, and it's not the first tick, then do this:
            if (PreSetupComplete && !firstTick)
            {
                #region Handle Opening/Closing of the menu.
                // If menus can be opened.
                if (!DontOpenMenus && !IsPauseMenuActive())
                {
                    // If the player is using Keyboard & Mouse and they pressed the M key (interaction menu button) then...
                    if (Game.CurrentInputMode == InputMode.MouseAndKeyboard && (Game.IsControlJustPressed(0, (Control)MenuToggleKey) || Game.IsDisabledControlJustPressed(0, (Control)MenuToggleKey)))
                    {
                        // If any menu is already open: close all menus.
                        if (Mp.IsAnyMenuOpen())
                        {
                            Mp.CloseAllMenus();
                        }
                        // Otherwise: toggle the main menu (to be safe, only open it if no other menus are open.)
                        else
                        {
                            Menu.Visible = !Mp.IsAnyMenuOpen();
                        }
                    }

                    // If the player is using a controller, and no menus are currently open.
                    else if (!Mp.IsAnyMenuOpen() && Game.CurrentInputMode == InputMode.GamePad)
                    {
                        // Create a timer and set it to the current game timer value.
                        int timer = GetGameTimer();

                        // While (and only if) the player keeps using only the controller, and keeps holding down the interactionmenu button (select on controller).
                        while (Game.CurrentInputMode == InputMode.GamePad && Game.IsControlPressed(0, Control.InteractionMenu))
                        {
                            // If debugging is enabled, show the progress using a timerbar.
                            if (DebugMode)
                            {
                                bt.Draw(0);
                                float percent = ((GetGameTimer() - timer) / 350f);
                                bt.Percentage = percent;
                            }

                            // If 900ms in real time have passed.
                            if (GetGameTimer() - timer > 350)
                            {
                                Menu.Visible = !Mp.IsAnyMenuOpen();
                                // Break the loop (resetting the timer).
                                break;
                            }

                            // Wait for the next game tick.
                            await Delay(0);
                        }
                    }

                    if (Game.CurrentInputMode == InputMode.MouseAndKeyboard)
                    {
                        if (Game.IsControlJustPressed(0, (Control)NoClipKey) && Cf.IsAllowed(Permission.NoClip))
                        {
                            if (IsPedInAnyVehicle(PlayerPedId(), false))
                            {
                                if (GetPedInVehicleSeat(Cf.GetVehicle(), -1) == PlayerPedId())
                                {
                                    NoClipEnabled = !Mp.IsAnyMenuOpen();
                                }
                                else
                                {
                                    NoClipEnabled = false;
                                    Notify.Error("You need to be the driver of this vehicle to enable noclip!");
                                }
                            }
                            else
                            {
                                NoClipEnabled = !Mp.IsAnyMenuOpen();
                            }
                        }
                    }

                    // Teleport to WP when F3 is pressed
                    if (Game.CurrentInputMode == InputMode.MouseAndKeyboard)
                    {
                        if (Game.IsControlJustPressed(0, Control.SaveReplayClip))
                        {
                            Cf.TeleportToWp();
                        }
                    }
                }
                // If the pause menu is active or all menus should be closed, close all menus.
                else
                {
                    await Delay(1);

                    Mp.CloseAllMenus();
                }
                #endregion

                // Menu toggle button.
                Game.DisableControlThisFrame(0, (Control)MenuToggleKey);

                #region Disable Inputs when any menu is open.
                if (Mp.IsAnyMenuOpen())
                {
                    // Close all menus when the player dies.
                    if (Game.PlayerPed.IsDead)
                    {
                        Mp.CloseAllMenus();
                    }

                    // Disable Gamepad/Controller Specific controls:
                    if (Game.CurrentInputMode == InputMode.GamePad)
                    {
                        Game.DisableControlThisFrame(0, Control.MultiplayerInfo);
                        // when in a vehicle.
                        if (IsPedInAnyVehicle(PlayerPedId(), false))
                        {
                            Game.DisableControlThisFrame(0, Control.VehicleHeadlight);
                            Game.DisableControlThisFrame(0, Control.VehicleDuck);
                        }
                    }
                    // Disable Shared Controls

                    // Radio Inputs
                    Game.DisableControlThisFrame(0, Control.RadioWheelLeftRight);
                    Game.DisableControlThisFrame(0, Control.RadioWheelUpDown);
                    Game.DisableControlThisFrame(0, Control.VehicleNextRadio);
                    Game.DisableControlThisFrame(0, Control.VehicleRadioWheel);
                    Game.DisableControlThisFrame(0, Control.VehiclePrevRadio);

                    // Phone / Arrows Inputs
                    Game.DisableControlThisFrame(0, Control.Phone);
                    Game.DisableControlThisFrame(0, Control.PhoneCancel);
                    Game.DisableControlThisFrame(0, Control.PhoneDown);
                    Game.DisableControlThisFrame(0, Control.PhoneLeft);
                    Game.DisableControlThisFrame(0, Control.PhoneRight);

                    // Attack Controls
                    Game.DisableControlThisFrame(0, Control.Attack);
                    Game.DisableControlThisFrame(0, Control.Attack2);
                    Game.DisableControlThisFrame(0, Control.MeleeAttack1);
                    Game.DisableControlThisFrame(0, Control.MeleeAttack2);
                    Game.DisableControlThisFrame(0, Control.MeleeAttackAlternate);
                    Game.DisableControlThisFrame(0, Control.MeleeAttackHeavy);
                    Game.DisableControlThisFrame(0, Control.MeleeAttackLight);
                    Game.DisableControlThisFrame(0, Control.VehicleAttack);
                    Game.DisableControlThisFrame(0, Control.VehicleAttack2);
                    Game.DisableControlThisFrame(0, Control.VehicleFlyAttack);
                    Game.DisableControlThisFrame(0, Control.VehiclePassengerAttack);
                    Game.DisableControlThisFrame(0, Control.Aim);

                    // When in a vehicle
                    if (IsPedInAnyVehicle(PlayerPedId(), false))
                    {
                        Game.DisableControlThisFrame(0, Control.VehicleSelectNextWeapon);
                        Game.DisableControlThisFrame(0, Control.VehicleSelectPrevWeapon);
                        Game.DisableControlThisFrame(0, Control.VehicleCinCam);
                    }
                }
                #endregion

                // Process the menu. Draw it and reset the menu width offset to make sure any newly generated menus always have the right width offset.
                Mp.WidthOffset = 50;
                if (Mp.IsAnyMenuOpen())
                {
                    Mp.Draw();
                }
            }
        }
Exemplo n.º 21
0
        void Play(object o)
        {
            Random rand = new Random();

            if (IsShuffled == true && o == null && flag == 0)
            {
                int n        = rand.Next(0, Songs.Count);
                int temprand = n;
                if (CurrentSong == Songs[n])
                {
                    while (temprand == n)
                    {
                        n = rand.Next(0, Songs.Count);
                    }
                }
                CurrentSong = Songs[n];

                Mp.Open(new Uri(Songs[n].PathS, UriKind.RelativeOrAbsolute));
                Mp.Play();
                Mp.MediaOpened += new EventHandler(mediaOpened);

                flag = 1;
            }
            else if ((o != null && (flag == 0)) || (o != temp && (flag == 2 || flag == 1)) && IsShuffled == true)
            {
                int n        = rand.Next(0, Songs.Count);
                int temprand = n;
                if (CurrentSong == Songs[n])
                {
                    while (temprand == n)
                    {
                        n = rand.Next(0, Songs.Count);
                    }
                }
                CurrentSong = Songs[n];

                Mp.Open(new Uri(Songs[n].PathS, UriKind.RelativeOrAbsolute));
                Mp.Play();
                Mp.MediaOpened += new EventHandler(mediaOpened);
                Isplaying       = true;
                flag            = 1;
            }

            else if ((o != null && (flag == 0)) || (o != temp && (flag == 2 || flag == 1)) && IsShuffled == false)
            {
                Song s = o as Song;
                CurrentSong = s;
                Mp.Open(new Uri(s.PathS, UriKind.RelativeOrAbsolute));
                Mp.Play();
                Mp.MediaOpened += new EventHandler(mediaOpened);
                Isplaying       = true;
                flag            = 1;
            }

            else if (o == null && flag == 0 && IsShuffled == false)
            {
                Mp.Open(new Uri(Songs[0].PathS, UriKind.RelativeOrAbsolute));
                CurrentSong = Songs[0];
                Mp.Play();
                Mp.MediaOpened += new EventHandler(mediaOpened);
                flag            = 1;
            }
            else if (flag == 1)
            {
                Mp.Pause();
                flag = 2;
            }
            else if (flag == 2)
            {
                Mp.Play();
                flag = 1;
            }


            Selecteds = CurrentSong;
            temp      = Selecteds;
        }
Exemplo n.º 22
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (PlayerId != 0UL)
            {
                hash ^= PlayerId.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (CharacterId != 0)
            {
                hash ^= CharacterId.GetHashCode();
            }
            if (Level != 0)
            {
                hash ^= Level.GetHashCode();
            }
            if (Exp != 0)
            {
                hash ^= Exp.GetHashCode();
            }
            if (Hp != 0)
            {
                hash ^= Hp.GetHashCode();
            }
            if (MaxHp != 0)
            {
                hash ^= MaxHp.GetHashCode();
            }
            if (Mp != 0)
            {
                hash ^= Mp.GetHashCode();
            }
            if (MaxMp != 0)
            {
                hash ^= MaxMp.GetHashCode();
            }
            if (Food != 0)
            {
                hash ^= Food.GetHashCode();
            }
            if (MaxFood != 0)
            {
                hash ^= MaxFood.GetHashCode();
            }
            if (Gold != 0)
            {
                hash ^= Gold.GetHashCode();
            }
            if (HeadIcon != 0)
            {
                hash ^= HeadIcon.GetHashCode();
            }
            if (MapSkillId != 0)
            {
                hash ^= MapSkillId.GetHashCode();
            }
            if (BattleSkillId != 0)
            {
                hash ^= BattleSkillId.GetHashCode();
            }
            hash ^= equips_.GetHashCode();
            return(hash);
        }
Exemplo n.º 23
0
 /// <summary>
 /// 簡易表示☆(^~^)
 /// </summary>
 /// <returns></returns>
 public string ToDisplay()
 {
     return($"leverX={LeverX} Y={LeverY} Lp={Lp.ToDisplay()} Mp={Mp.ToDisplay()} Hp={Hp.ToDisplay()} Lk={Lk.ToDisplay()} Mk={Mk.ToDisplay()} Hk={Hk.ToDisplay()} Pause={Pause.ToDisplay()} CancelMenu={CancelMenu.ToDisplay()}");
 }
Exemplo n.º 24
0
        /// <summary>
        /// Creates all the submenus depending on the permissions of the user.
        /// </summary>
        private void CreateSubmenus()
        {
            // Add the online players menu.
            if (Cf.IsAllowed(Permission.OPMenu))
            {
                OnlinePlayersMenu = new OnlinePlayers();
                UIMenu     menu   = OnlinePlayersMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Online Players", "All currently connected players.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
                Menu.OnItemSelect += (sender, item, index) =>
                {
                    if (item == button)
                    {
                        OnlinePlayersMenu.UpdatePlayerlist();
                        menu.RefreshIndex();
                        menu.UpdateScaleform();
                    }
                };
            }

            // Add the player options menu.
            if (Cf.IsAllowed(Permission.POMenu))
            {
                PlayerOptionsMenu = new PlayerOptions();
                UIMenu     menu   = PlayerOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Player Options", "Common player options can be accessed here.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the vehicle options Menu.
            if (Cf.IsAllowed(Permission.VOMenu))
            {
                VehicleOptionsMenu = new VehicleOptions();
                UIMenu     menu   = VehicleOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Vehicle Options", "Here you can change common vehicle options, as well as tune & style your vehicle.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            var vl = new Vehicles().VehicleClasses;

            // Add the vehicle spawner menu.
            if (Cf.IsAllowed(Permission.VSMenu))
            {
                VehicleSpawnerMenu = new VehicleSpawner();
                UIMenu     menu   = VehicleSpawnerMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Vehicle Spawner", "Spawn a vehicle by name or choose one from a specific category.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add Saved Vehicles menu.
            if (Cf.IsAllowed(Permission.SVMenu))
            {
                SavedVehiclesMenu = new SavedVehicles();
                UIMenu     menu   = SavedVehiclesMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Saved Vehicles", "Save new vehicles, or spawn or delete already saved vehicles.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the player appearance menu.
            if (Cf.IsAllowed(Permission.PAMenu))
            {
                PlayerAppearanceMenu = new PlayerAppearance();
                UIMenu     menu   = PlayerAppearanceMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Player Appearance", "Choose a ped model, customize it and save & load your customized characters.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the time options menu.
            // check for 'not true' to make sure that it _ONLY_ gets disabled if the owner _REALLY_ wants it disabled, not if they accidentally spelled "false" wrong or whatever.
            if (Cf.IsAllowed(Permission.TOMenu) && MenuOptions["disableSync"] != "true")
            {
                TimeOptionsMenu = new TimeOptions();
                UIMenu     menu   = TimeOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Time Options", "Change the time, and edit other time related options.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the weather options menu.
            // check for 'not true' to make sure that it _ONLY_ gets disabled if the owner _REALLY_ wants it disabled, not if they accidentally spelled "false" wrong or whatever.
            if (Cf.IsAllowed(Permission.WOMenu) && MenuOptions["disableSync"] != "true")
            {
                WeatherOptionsMenu = new WeatherOptions();
                UIMenu     menu   = WeatherOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Weather Options", "Change all weather related options here.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the weapons menu.
            if (Cf.IsAllowed(Permission.WPMenu))
            {
                WeaponOptionsMenu = new WeaponOptions();
                UIMenu     menu   = WeaponOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Weapon Options", "Add/remove weapons, modify weapons and set ammo options.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add misc settings menu.
            if (Cf.IsAllowed(Permission.MSMenu))
            {
                MiscSettingsMenu = new MiscSettings();
                UIMenu     menu   = MiscSettingsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Misc Settings", "Change general settings.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add Voice Chat Menu.
            if (Cf.IsAllowed(Permission.VCMenu))
            {
                VoiceChatSettingsMenu = new VoiceChat();
                UIMenu     menu   = VoiceChatSettingsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Voice Chat Settings", "Change Voice Chat options here.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add About Menu.
            AboutMenu = new About();
            UIMenu     sub = AboutMenu.GetMenu();
            UIMenuItem btn = new UIMenuItem("About vMenu", "Information about this menu and it's creators.");

            btn.SetRightLabel("→→→");
            AddMenu(sub, btn);

            // Refresh everything.
            Mp.RefreshIndex();
            Menu.UpdateScaleform();

            // Globally disable the native ui controls disabling.
            Mp.ControlDisablingEnabled = false;
            // Globally disable the "mouse edge" feature.
            Mp.MouseEdgeEnabled = false;
        }
Exemplo n.º 25
0
        /// <summary>
        /// Creates all the submenus depending on the permissions of the user.
        /// </summary>
        private void CreateSubmenus()
        {
            // Add the online players menu.
            if (Cf.IsAllowed(Permission.OPMenu))
            {
                OnlinePlayersMenu = new OnlinePlayers();
                UIMenu     menu   = OnlinePlayersMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Online Players", "All currently connected players.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
                Menu.OnItemSelect += (sender, item, index) =>
                {
                    if (item == button)
                    {
                        OnlinePlayersMenu.UpdatePlayerlist();
                        menu.RefreshIndex();
                        menu.UpdateScaleform();
                    }
                };
            }
            if (Cf.IsAllowed(Permission.OPUnban))
            {
                //TriggerServerEvent("vMenu:RequestBanList", PlayerId());
                BannedPlayersMenu = new BannedPlayers();
                UIMenu     menu   = BannedPlayersMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Banned Players", "View and manage all banned players in this menu.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
                Menu.OnItemSelect += (sender, item, index) =>
                {
                    if (item == button)
                    {
                        TriggerServerEvent("vMenu:RequestBanList", PlayerId());
                        menu.RefreshIndex();
                        menu.UpdateScaleform();
                    }
                };
            }

            // Add the player options menu.
            if (Cf.IsAllowed(Permission.POMenu))
            {
                PlayerOptionsMenu = new PlayerOptions();
                UIMenu     menu   = PlayerOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Player Options", "Common player options can be accessed here.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the vehicle options Menu.
            if (Cf.IsAllowed(Permission.VOMenu))
            {
                VehicleOptionsMenu = new VehicleOptions();
                UIMenu     menu   = VehicleOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Vehicle Options", "Here you can change common vehicle options, as well as tune & style your vehicle.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            var vl = new Vehicles().VehicleClasses;

            // Add the vehicle spawner menu.
            if (Cf.IsAllowed(Permission.VSMenu))
            {
                VehicleSpawnerMenu = new VehicleSpawner();
                UIMenu     menu   = VehicleSpawnerMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Vehicle Spawner", "Spawn a vehicle by name or choose one from a specific category.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add Saved Vehicles menu.
            if (Cf.IsAllowed(Permission.SVMenu))
            {
                SavedVehiclesMenu = new SavedVehicles();
                UIMenu     menu   = SavedVehiclesMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Saved Vehicles", "Save new vehicles, or spawn or delete already saved vehicles.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the player appearance menu.
            if (Cf.IsAllowed(Permission.PAMenu))
            {
                PlayerAppearanceMenu = new PlayerAppearance();
                UIMenu     menu   = PlayerAppearanceMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Player Appearance", "Choose a ped model, customize it and save & load your customized characters.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the time options menu.
            // check for 'not true' to make sure that it _ONLY_ gets disabled if the owner _REALLY_ wants it disabled, not if they accidentally spelled "false" wrong or whatever.
            if (Cf.IsAllowed(Permission.TOMenu) && GetSettingsBool(Setting.vmenu_enable_time_sync))
            {
                TimeOptionsMenu = new TimeOptions();
                UIMenu     menu   = TimeOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Time Options", "Change the time, and edit other time related options.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the weather options menu.
            // check for 'not true' to make sure that it _ONLY_ gets disabled if the owner _REALLY_ wants it disabled, not if they accidentally spelled "false" wrong or whatever.
            if (Cf.IsAllowed(Permission.WOMenu) && GetSettingsBool(Setting.vmenu_enable_weather_sync))
            {
                WeatherOptionsMenu = new WeatherOptions();
                UIMenu     menu   = WeatherOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Weather Options", "Change all weather related options here.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add the weapons menu.
            if (Cf.IsAllowed(Permission.WPMenu))
            {
                WeaponOptionsMenu = new WeaponOptions();
                UIMenu     menu   = WeaponOptionsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Weapon Options", "Add/remove weapons, modify weapons and set ammo options.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add Voice Chat Menu.
            if (Cf.IsAllowed(Permission.VCMenu))
            {
                VoiceChatSettingsMenu = new VoiceChat();
                UIMenu     menu   = VoiceChatSettingsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Voice Chat Settings", "Change Voice Chat options here.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            {
                RecordingMenu = new Recording();
                UIMenu     menu   = RecordingMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Recording Options", "In-game recording options.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }

            // Add misc settings menu.
            //if (Cf.IsAllowed(Permission.MSMenu))
            // removed the permissions check, because the misc menu should've never been restricted in the first place.
            // not sure why I even added this before... saving of preferences and similar functions should always be allowed.
            // no matter what.
            {
                MiscSettingsMenu = new MiscSettings();
                UIMenu     menu   = MiscSettingsMenu.GetMenu();
                UIMenuItem button = new UIMenuItem("Misc Settings", "Miscellaneous vMenu options/settings can be configured here. You can also save your settings in this menu.");
                button.SetRightLabel("→→→");
                AddMenu(menu, button);
            }



            // Add About Menu.
            AboutMenu = new About();
            UIMenu     sub = AboutMenu.GetMenu();
            UIMenuItem btn = new UIMenuItem("About vMenu", "Information about vMenu.");

            btn.SetRightLabel("→→→");
            AddMenu(sub, btn);

            // Refresh everything.
            Mp.RefreshIndex();
            Menu.UpdateScaleform();

            // Globally disable the native ui controls disabling.
            Mp.ControlDisablingEnabled = false;
            // Globally disable the "mouse edge" feature.
            Mp.MouseEdgeEnabled = false;

            if (!GetSettingsBool(Setting.vmenu_use_permissions))
            {
                Notify.Info("vMenu is set up to ignore permissions.");
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Process left/right/up/down buttons (also holding down buttons will speed up after 3 iterations)
        /// </summary>
        /// <returns></returns>
        private async Task ProcessDirectionalButtons()
        {
            // Get the currently open menu.
            UIMenu currentMenu = Cf.GetOpenMenu();

            // If it exists.
            if (currentMenu != null && !DontOpenMenus && Mp.IsAnyMenuOpen() && !NoClipEnabled)
            {
                if (currentMenu.Visible && !DisableControls)
                {
                    // Check if the Go Up controls are pressed.
                    if (Game.IsDisabledControlJustPressed(0, Control.Phone) || Game.IsControlJustPressed(0, Control.SniperZoomInSecondary))
                    {
                        // Update the currently selected item to the new one.
                        currentMenu.GoUp();
                        currentMenu.GoUpOverflow();

                        // Get the current game time.
                        var time  = GetGameTimer();
                        var times = 0;
                        var delay = 200;

                        // Do the following as long as the controls are being pressed.
                        while (Game.IsDisabledControlPressed(0, Control.Phone) && Cf.GetOpenMenu() != null)
                        {
                            // Update the current menu.
                            currentMenu = Cf.GetOpenMenu();

                            // Check if the game time has changed by "delay" amount.
                            if (GetGameTimer() - time > delay)
                            {
                                // Increment the "changed indexes" counter
                                times++;

                                // If the controls are still being held down after moving 3 indexes, reduce the delay between index changes.
                                if (times > 2)
                                {
                                    delay = 150;
                                }

                                // Update the currently selected item to the new one.
                                currentMenu.GoUp();
                                currentMenu.GoUpOverflow();

                                // Reset the time to the current game timer.
                                time = GetGameTimer();
                            }

                            // Wait for the next game tick.
                            await Delay(0);
                        }
                    }

                    // Check if the Go Left controls are pressed.
                    else if (Game.IsDisabledControlJustPressed(0, Control.PhoneLeft))
                    {
                        currentMenu.GoLeft();
                        var time  = GetGameTimer();
                        var times = 0;
                        var delay = 200;
                        while (Game.IsDisabledControlPressed(0, Control.PhoneLeft) && Cf.GetOpenMenu() != null)
                        {
                            currentMenu = Cf.GetOpenMenu();
                            if (GetGameTimer() - time > delay)
                            {
                                times++;
                                if (times > 2)
                                {
                                    delay = 150;
                                }
                                currentMenu.GoLeft();
                                time = GetGameTimer();
                            }
                            await Delay(0);
                        }
                    }

                    // Check if the Go Right controls are pressed.
                    else if (Game.IsDisabledControlJustPressed(0, Control.PhoneRight))
                    {
                        currentMenu.GoRight();
                        var time  = GetGameTimer();
                        var times = 0;
                        var delay = 200;
                        while (Game.IsDisabledControlPressed(0, Control.PhoneRight) && Cf.GetOpenMenu() != null)
                        {
                            currentMenu = Cf.GetOpenMenu();
                            if (GetGameTimer() - time > delay)
                            {
                                times++;
                                if (times > 2)
                                {
                                    delay = 150;
                                }
                                currentMenu.GoRight();
                                time = GetGameTimer();
                            }
                            await Delay(0);
                        }
                    }

                    // Check if the Go Down controls are pressed.
                    else if (Game.IsDisabledControlJustPressed(0, Control.PhoneDown) || Game.IsControlJustPressed(0, Control.SniperZoomOutSecondary))
                    {
                        currentMenu.GoDown();
                        currentMenu.GoDownOverflow();
                        var time  = GetGameTimer();
                        var times = 0;
                        var delay = 200;
                        while (Game.IsDisabledControlPressed(0, Control.PhoneDown) && Cf.GetOpenMenu() != null)
                        {
                            currentMenu = Cf.GetOpenMenu();
                            if (GetGameTimer() - time > delay)
                            {
                                times++;
                                if (times > 2)
                                {
                                    delay = 150;
                                }
                                currentMenu.GoDown();
                                currentMenu.GoDownOverflow();
                                time = GetGameTimer();
                            }
                            await Delay(0);
                        }
                    }
                }
                else
                {
                    await Delay(0);
                }
            }
            else
            {
                await Delay(0);
            }
        }
Exemplo n.º 27
0
        public void LoadIntellisenseResults(List <Diagnostic> hc)
        {
            lock (s_obs)
            {
                if (ef == null)
                {
                    return;
                }

                ScriptControl.ScriptControl scr = null;

                VSSolution vs = null;

                string filename = "";

                if (ef != null)
                {
                    if (ef.scr != null)
                    {
                        scr = ef.scr;
                    }
                }

                ToolStripComboBox b = toolStripComboBox1;

                int i = b.SelectedIndex;

                vs = ef.GetVSSolution();

                VSProject vp = null;
                //if (vs != null)
                //    vp = vs.MainVSProject;

                //dg.SuspendLayout();

                //LI = new ArrayList();

                //if (vp != null)
                //    if (i == 2)
                //    {
                //        foreach (IntErrors e in DD)
                //        {
                //            if (vp != null)
                //                if (e.vp != vp)
                //                    continue;

                //            int rowId = dg.Rows.Add();
                //            DataGridViewRow row = dg.Rows[rowId];

                //            row.Cells[0].Value = "";
                //            row.Cells[1].Value = ve_resource.Breakall_6323;
                //            row.Cells[2].Value = "e.Code";
                //            row.Cells[3].Value = e.e.Message;
                //            row.Cells[4].Value = Path.GetFileNameWithoutExtension(e.vp.FileName);
                //            row.Cells[5].Value = Path.GetFileName(e.file);
                //            row.Cells[6].Value = e.e.Region.BeginLine.ToString();
                //            row.Cells[7].Value = "project";

                //            string message = e.e.Message;

                //            //if (message.StartsWith("UnknownIdentifier") == true)
                //            //    MessageBox.Show("Unknown identifier");

                //            //v.Checked = true;

                //            row.Tag = e;

                //            //lv.Items.Add(v);
                //        }
                //        dg.ResumeLayout();
                //        return;
                //    }

                //if (i == 3 || i == 0)
                {
                    if (hc != null)
                    {
                    }

                    //filename = d.FileName;

                    foreach (/*IntErrors e in DD*/ Diagnostic hs in hc)
                    {
                        //if (filename != "")
                        //    if (e.file != filename)
                        //        continue;

                        Diagnostic dc = hs;// hc[hs];

                        filename = dc.Location.SourceTree.FilePath;

                        AvalonDocument d = scr.FileOpened(filename, false);

                        int hash = dc.GetMessage().GetHashCode();

                        if (hcd.ContainsKey(hash))
                        {
                            continue;
                        }

                        int    line = 0;
                        string file = "";
                        if (dc.Location != Microsoft.CodeAnalysis.Location.None)
                        {
                            if (dc.Location.SourceTree != null)
                            {
                                file = dc.Location.SourceTree.FilePath;// syntaxTree.FilePath;
                                FileLinePositionSpan c = dc.Location.GetLineSpan();
                                line = c.StartLinePosition.Line;
                            }
                        }

                        int             rowId = dg.Rows.Add();
                        DataGridViewRow row   = dg.Rows[rowId];
                        row.InheritedStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
                        //dg.Rows.Remove(row);
                        //dg.Rows.Insert(0, row);
                        row.Cells[0].Value = dc.Descriptor.Category;
                        if (dc.Severity.ToString() == "Error")
                        {
                            row.Cells[1].Value = new Bitmap(ve_resource.Breakall_6323, 15, 15);
                            Ep.Add(row);
                        }
                        else if (dc.Severity.ToString() == "Warning")
                        {
                            row.Cells[1].Value = new Bitmap(ve_resource.StatusWarning_16x, 15, 15);
                            Wp.Add(row);
                        }
                        else
                        {
                            row.Cells[1].Value = new Bitmap(ve_resource.StatusHelp_256x, 15, 15);
                            Mp.Add(row);
                        }

                        row.Cells[2].Value = dc.Descriptor.Id;
                        row.Cells[3].Value = dc.GetMessage();

                        if (dc.Location != Microsoft.CodeAnalysis.Location.None)
                        {
                            if (vp != null)
                            {
                                row.Cells[4].Value = Path.GetFileNameWithoutExtension(vp.FileName);
                            }
                            else if (dc.Location != Microsoft.CodeAnalysis.Location.None)
                            {
                                if (dc.Location.SourceTree != null)
                                {
                                    row.Cells[4].Value = Path.GetFileNameWithoutExtension(dc.Location.SourceTree.FilePath);
                                }
                            }
                        }
                        row.Cells[5].Value = Path.GetFileName(file);
                        if (line > 0)
                        {
                            row.Cells[6].Value = d.GetLineExtended(line) + 1;
                        }
                        row.Cells[7].Value = "project";

                        //row.Cells[0].Value = "";
                        //row.Cells[1].Value = ve_resource.Errors;
                        //row.Cells[2].Value = "e.Code";
                        //row.Cells[3].Value = e.e.Message;
                        //row.Cells[4].Value = Path.GetFileNameWithoutExtension(e.vp.FileName);
                        //row.Cells[5].Value = Path.GetFileName(e.file);
                        //row.Cells[6].Value = e.e.Region.BeginLine.ToString();
                        //row.Cells[7].Value = "project";

                        //ListViewItem v = new ListViewItem();
                        //v.Text = "";
                        //v.SubItems.Add("");
                        //v.SubItems.Add("e.Code");
                        //v.SubItems.Add(e.e.Message);
                        //v.SubItems.Add(Path.GetFileNameWithoutExtension(e.vp.FileName));
                        //v.SubItems.Add(Path.GetFileName(e.c.FileName));
                        //v.SubItems.Add(e.e.Region.BeginLine.ToString());
                        //v.SubItems.Add("project");

                        //v.Checked = true;

                        row.Tag = dc;

                        dg.Rows.Remove(row);
                        dg.Rows.Insert(0, row);

                        hcd.Add(hash, row);

                        //lv.Items.Add(v);
                    }

                    dg.ResumeLayout();

                    //ef.scr.FocusActiveDocument();
                    return;
                }

                //ArrayList F = ef.scr.GetOpenFiles();

                /*
                 * foreach (IntErrors e in DD)
                 * {
                 *  //ListViewItem v = new ListViewItem();
                 *  //v.Text = "";
                 *  //v.SubItems.Add("");
                 *  //v.SubItems.Add("e.Code");
                 *  //v.SubItems.Add(e.e.Message);
                 *  //v.SubItems.Add(Path.GetFileNameWithoutExtension(e.c.FileName));
                 *  //v.SubItems.Add(Path.GetFileName(e.c.FileName));
                 *  //v.SubItems.Add(e.e.Region.BeginLine.ToString());
                 *  //v.SubItems.Add("project");
                 *
                 *  //v.Checked = true;
                 *
                 *  int rowId = dg.Rows.Add();
                 *  DataGridViewRow row = dg.Rows[rowId];
                 *  row.InheritedStyle.BackColor = Color.FromKnownColor(KnownColor.Control);
                 *
                 *  row.Cells[0].Value = "";
                 *  row.Cells[1].Value = ve_resource.Errors;
                 *  row.Cells[2].Value = "e.Code";
                 *  row.Cells[3].Value = e.e.Message;
                 *  row.Cells[4].Value = Path.GetFileNameWithoutExtension(e.vp.FileName);
                 *  row.Cells[5].Value = Path.GetFileName(e.file);
                 *  row.Cells[6].Value = e.e.Region.BeginLine.ToString();
                 *  row.Cells[7].Value = "project";
                 *
                 *  //string message = e.e.Message;
                 *
                 *  //if (message.StartsWith("UnknownIdentifier") == true)
                 *  //{
                 *  //    // MessageBox.Show("Unknown identifier");
                 *
                 *  //    string[] cc = e.e.Message.Split(" ".ToCharArray());
                 *
                 *  //    Document d = ef.scr.FileOpened(e.c.FileName);
                 *
                 *  //    //foreach (Row r in d.Editor.Document)
                 *  //    //    foreach (Word w in r)
                 *  //    //        w.HasError = false;
                 *
                 *  //    if (d != null)
                 *  //    {
                 *  //        // MessageBox.Show("File has been found");
                 *
                 *  //        if (e.e.Region.BeginLine < 0)
                 *  //            continue;
                 *
                 *  //        d.SuspendLayout();
                 *
                 *  //        Row r = d.Editor.Document[e.e.Region.BeginLine];
                 *
                 *  //        foreach (Word w in r)
                 *  //        {
                 *  //            string[] bb = w.Text.Split(";".ToCharArray());
                 *
                 *  //            foreach (string dd in bb)
                 *
                 *  //                if (dd == cc[1])
                 *  //                {
                 *  //                    // MessageBox.Show("Identifier found");
                 *
                 *  //                    w.HasError = true;
                 *
                 *  //                    //d.Refresh();
                 *  //                }
                 *  //        }
                 *
                 *  //        d.ResumeLayout();
                 *  //    }
                 *
                 *  //}
                 *
                 *  row.Tag = e;
                 * }
                 *
                 * ef.scr.LoadErrors(DD);
                 *
                 * dg.ResumeLayout();
                 */
            }
        }