Пример #1
0
        internal static void InitializeHooks()
        {
            On.RoR2.RoR2Application.UnitySystemConsoleRedirector.Redirect += orig => { };

            SurvivorAPI.InitHooks();
            AssetAPI.InitHooks();
            ItemDropAPI.InitHooks();
            InventoryAPI.InitHooks();
        }
        async void CallJoinTwoItems(InvItem fromItem, InvItem toItem)
        {
            InventoryAPI inventoryApi = new InventoryAPI(api);
            ErrorCodes   res          = await inventoryApi.JoinTwoItems(fromItem, toItem);

            if (res == ErrorCodes.Succes)
            {
                this.DialogResult = true;
            }
            UtilDisplay.ShowErrorCode(res);
        }
        void CallJoinTwoWareHouseOrLocation(InvWarehouse fromWareHouse = null, InvWarehouse copyToWareHouse = null, InvLocation fromLocation = null, InvLocation copyToLocation = null)
        {
            DeletePostedJournal delDialog = new DeletePostedJournal(true);

            delDialog.Closed += delegate
            {
                if (delDialog.DialogResult == true)
                {
                    var invApi = new InventoryAPI(crudApi);
                    if (isJoinWareHouse)
                    {
                        JoinResult = invApi.JoinTwoWarehouses(fromWareHouse, copyToWareHouse);
                    }
                    else
                    {
                        JoinResult = invApi.JoinTwoLocations(fromLocation, copyToWareHouse, copyToLocation);
                    }
                    this.DialogResult = true;
                }
            };
            delDialog.Show();
        }