Example #1
0
        internal static bool Prefix(Panel_ActionsRadial __instance, ref List <GearItem> __result)
        {
            __result = new List <GearItem>();

            for (int index = 0; index < GameManager.GetInventoryComponent().m_Items.Count; ++index)
            {
                GearItem component = GameManager.GetInventoryComponent().m_Items[index];
                if (component.m_FoodItem != null && component.m_FoodItem.m_IsDrink)
                {
                    if (component.m_IsInSatchel)
                    {
                        __result.Insert(0, component);
                    }
                    else
                    {
                        __result.Add(component);
                    }
                }

                if (WaterUtils.ContainsWater(component))
                {
                    if (component.m_IsInSatchel)
                    {
                        __result.Insert(0, component);
                    }
                    else
                    {
                        __result.Add(component);
                    }
                }
            }

            return(false);
        }
Example #2
0
        internal void ShowGearItems()
        {
            Panel_ActionsRadial radial = InterfaceManager.m_Panel_ActionsRadial;

            radial.m_Queue.Add(new System.Action(ShowGearItems));
            GearItem[] array = GetGearItems();
            radial.Enable(true, false);
            for (int j = 0; j < array.Length; j++)
            {
                if (j >= radial.m_RadialArms.Length - 1)
                {
                    break;
                }
                if (!(array[j] == null))
                {
                    Panel_ActionsRadial.RadialGearDelegate radialGearDelegate = new System.Action <GearItem>(radial.UseItem);
                    radial.AddRadialSelectionGear(Utils.GetInventoryIconTexture(array[j]).name, radialGearDelegate, array[j], false, false, 1);
                }
            }

            for (int k = 0; k < radial.m_RadialArms.Length; k++)
            {
                radial.m_RadialArms[k].SetHoverColor(false);
            }
        }
Example #3
0
            static void PanelActionsRadial_ShowPlaceItemRadial_Postfix(Panel_ActionsRadial __instance)
            {
                if (!containerIconVisible)
                {
                    return;
                }

                if (__instance.m_RadialArms.FirstOrDefault(arm => arm.m_RadialInfo.m_RadialElement == Panel_ActionsRadial.RadialType.Shelter) is not RadialMenuArm arm)
                {
                    return;
                }

                Panel_ActionsRadial.RadialInfo info = new() { m_RadialElement = Panel_ActionsRadial.RadialType.Shelter };
                info.m_SpriteName      = info.m_SpriteNameHover = "icoMap_container";
                info.m_IconActiveColor = info.m_IconActiveHoverColor = shouldDisableRadialButton()? Color.gray: colorUI;

                Action action = shouldDisableRadialButton()
                                                                        ? new (() => GameUtils.showErrorMessage("Can't place container here"))
                                                                        : new (() => MovableContainerManager.dropContainer());

                arm.SetRadialInfo(info, action, false, false);
                arm.m_NameWhenHoveredOver = "place " + Localization.Get(MovableContainerManager.pickedContainerName);
            }
        }
Example #4
0
 public static void Postfix(Panel_ActionsRadial __instance)
 {
     RadialConfigurator.InsertAllGears();
 }