Exemplo n.º 1
0
 private void AssetDump_OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index, UIMenuItem itemToControl, string asset)
 {
     if (selectedItem == itemToControl)
     {
         PTFXDumpToXML.DumpToCamxxCoreStyleTxt(asset);
         UI.ShowSubtitle("Dumping " + asset + "...");
         Wait(2000);
         PTFXDumpToXML.ConvertToXML();
         UI.Notify("PTFX Dump Done! Restart script with the INS key to see changes, or continue dumping more assets.");
         Wait(150);
     }
 }
Exemplo n.º 2
0
        void OnTick(object sender, EventArgs e)                                                 // This is where most of your script goes
        {
            if (Function.Call <bool>(Hash._0x557E43C447E700A8, Game.GenerateHash("ptfx_menu"))) // _HAS_CHEAT_STRING_JUST_BEEN_ENTERED
            {
                _menuPool.OpenCloseLastMenu();
                Wait(150);
            }

            if (Function.Call <bool>(Hash._0x557E43C447E700A8, Game.GenerateHash("ptfx_dump"))) // _HAS_CHEAT_STRING_JUST_BEEN_ENTERED
            {
                PTFXDumpToXML.ConvertToXML();
                UI.Notify("PTFX Dump Done! Restart script with the INS key.");
                Wait(150);
            }

            if (PtfxPlayerComm.IsEventTriggered())
            {
                _menuPool.OpenCloseLastMenu();

                PtfxPlayerComm.BlockScriptCommunicatorModMenu();
                PtfxPlayerComm.ResetEvent();
                Wait(300);
            }

            if (!allowMenuDraw)
            {
                //AdjustMenu();

                if (doSearch)
                {
                    SetupSearchMenu(); doSearch = false;
                }
                if (rebuildFavourites)
                {
                    FavouritesMenu.ResetIndexPosition();
                    FavouritesMenu.SelectedItem = null;
                    FavouritesMenu.UIMenuItemList.Clear();
                    Re_BuildFavouritesMenu();
                    FavouritesMenu.SetIndexPosition(favLastIndex <= FavouritesMenu.UIMenuItemList.Count - 1 ? favLastIndex : FavouritesMenu.UIMenuItemList.Count - 1);
                    rebuildFavourites = false;
                }

                allowMenuDraw = true;
            }
            if (allowMenuDraw)
            {
                _menuPool.ProcessMenus();

                if (JustPressedMenuControls())
                {
                    if (_menuPool.IsAnyMenuOpen())
                    {
                        _menuPool.CloseAllMenus();
                    }
                    else
                    {
                        if (!SCHelperExists)
                        {
                            _menuPool.LastUsedMenu.IsVisible = !_menuPool.LastUsedMenu.IsVisible;
                        }
                    }

                    InputTimer = DateTime.Now.AddMilliseconds(300);
                }

                if (_menuPool.LastUsedMenu.IsVisible)
                {
                    PtfxPlayerComm.BlockScriptCommunicatorModMenu();
                }
                else
                {
                    if (PtfxPlayerComm.ScriptCommunicatorMenuIsBlocked())
                    {
                        //Wait(300);
                        PtfxPlayerComm.UnblockScriptCommunicatorModMenu();
                    }
                }
            }
        }