Пример #1
0
        private static bool Prefix(Panel_ActionPicker __instance, GameObject objectInteractedWith, ref List <Panel_ActionPicker.ActionPickerItemData> ___m_ActionPickerItemDataList, ref GameObject ___m_ObjectInteractedWith)

        {
            Fire componentInChildren = objectInteractedWith.GetComponentInChildren <Fire>();

            Fire_RV.currentFire = componentInChildren;
            if (componentInChildren && componentInChildren.IsBurning() && GameManager.GetPlayerManagerComponent().PlayerHoldingTorchThatCanBeLit())
            {
                InterfaceManager.m_Panel_TorchLight.SetFireSourceToLightTorch(componentInChildren);
                InterfaceManager.m_Panel_TorchLight.Enable(true);
                return(false);
            }

            ___m_ActionPickerItemDataList.Clear();
            ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_feed_fire", "GAMEPLAY_AddFuel", new Action(() => AccessTools.Method(typeof(Panel_ActionPicker), "FireInteractCallback").Invoke(__instance, null))));

            if (componentInChildren && Fire_RV.canStokeFire(componentInChildren))
            {
                ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_campFireProgress", "Heap " + GetEmberStateAsText(componentInChildren), new Action(Fire_RV.tryHeapFire)));
            }
            if (componentInChildren && Fire_RV.canSpreadFire(componentInChildren))
            {
                ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_campFireProgress", "Spread " + GetEmberStateAsText(componentInChildren), new Action(Fire_RV.trySpreadFire)));
            }

            if (componentInChildren && Fire_RV.canbreakdownFire(componentInChildren))
            {
                ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_campFireProgress", "Breakdown", new Action(Fire_RV.tryBreakdownFire)));
            }

            if (componentInChildren && componentInChildren.CanTakeTorch())
            {
                ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_torch", "GAMEPLAY_TakeTorch", new Action(() => AccessTools.Method(typeof(Panel_ActionPicker), "TakeTorchCallback").Invoke(__instance, null))));
            }
            if (componentInChildren && Fire_RV.WulfFirePackInstalled())
            {
                ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_skills_fireStarting", "GAMEPLAY_TakeEmbers", new Action(TakeEmbers.ExecuteTakeEmbers)));
            }
            ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_cooking_pot", "GAMEPLAY_Cook", new Action(() => AccessTools.Method(typeof(Panel_ActionPicker), "FireCookCallback").Invoke(__instance, null))));
            ___m_ActionPickerItemDataList.Add(new Panel_ActionPicker.ActionPickerItemData("ico_water_prep", "GAMEPLAY_Water", new Action(() => AccessTools.Method(typeof(Panel_ActionPicker), "FireWaterCallback").Invoke(__instance, null))));
            ___m_ObjectInteractedWith = objectInteractedWith;



            AccessTools.Method(typeof(Panel_ActionPicker), "EnableWithCurrentList").Invoke(__instance, null);

            return(false);
        }