internal static void Postfix(Panel_PickWater __instance)
        {
            if (InputManager.GetEquipPressed(GameManager.Instance()))
            {
                Traverse traverse = Traverse.Create(__instance);

                GameObject gameObject = new GameObject();
                GearItem   gearItem   = gameObject.AddComponent <GearItem>();
                gearItem.m_LocalizedDisplayName = new LocalizedString {
                    m_LocalizationID = ""
                };

                WaterSourceSupply waterSourceSupply = gameObject.AddComponent <WaterSourceSupply>();
                waterSourceSupply.SetWaterSource(traverse.Field("m_WaterSource").GetValue <WaterSource>());

                gearItem.Awake();

                traverse.Method("ExitInterface").GetValue();

                GameManager.GetPlayerManagerComponent().UseInventoryItem(gearItem);
            }
        }
示例#2
0
        private static void ConfigureGearItem(ModComponent modComponent)
        {
            GearItem gearItem = ModUtils.GetOrCreateComponent <GearItem>(modComponent);

            gearItem.m_Type         = GetGearType(modComponent);
            gearItem.m_WeightKG     = modComponent.WeightKG;
            gearItem.m_MaxHP        = modComponent.MaxHP;
            gearItem.m_DailyHPDecay = GetDecayPerStep(modComponent.DaysToDecay, modComponent.MaxHP);
            gearItem.OverrideGearCondition(ModUtils.TranslateEnumValue <GearStartCondition, InitialCondition>(modComponent.InitialCondition));

            gearItem.m_LocalizedDisplayName = CreateLocalizedString(modComponent.DisplayNameLocalizationId);
            gearItem.m_LocalizedDescription = CreateLocalizedString(modComponent.DescriptionLocalizatonId);

            gearItem.m_PickUpAudio  = modComponent.PickUpAudio;
            gearItem.m_StowAudio    = modComponent.StowAudio;
            gearItem.m_PutBackAudio = modComponent.PickUpAudio;
            gearItem.m_WornOutAudio = modComponent.WornOutAudio;

            gearItem.m_ConditionTableType = GetConditionTableType(modComponent);
            gearItem.m_ScentIntensity     = ScentMapper.GetScentIntensity(modComponent);

            gearItem.Awake();
        }
示例#3
0
        private static void ConfigureGearItem(ModComponent modComponent)
        {
            GearItem gearItem = ComponentUtils.GetOrCreateComponent <GearItem>(modComponent);

            gearItem.m_Type         = GetGearType(modComponent);
            gearItem.m_WeightKG     = modComponent.WeightKG;
            gearItem.m_MaxHP        = modComponent.MaxHP;
            gearItem.m_DailyHPDecay = GetDecayPerStep(modComponent.DaysToDecay, modComponent.MaxHP);
            gearItem.OverrideGearCondition(EnumUtils.TranslateEnumValue <GearStartCondition, InitialCondition>(modComponent.InitialCondition), false);
            // OverrideGearCondition wanted to know if the item had been picked up yet; since Awake hadn't been called yet, I put false

            gearItem.m_LocalizedDisplayName = NameUtils.CreateLocalizedString(modComponent.DisplayNameLocalizationId);
            gearItem.m_LocalizedDescription = NameUtils.CreateLocalizedString(modComponent.DescriptionLocalizatonId);

            gearItem.m_PickUpAudio  = modComponent.PickUpAudio;
            gearItem.m_StowAudio    = modComponent.StowAudio;
            gearItem.m_PutBackAudio = modComponent.PickUpAudio;
            gearItem.m_WornOutAudio = modComponent.WornOutAudio;

            gearItem.m_ConditionTableType = GetConditionTableType(modComponent);
            gearItem.m_ScentIntensity     = ScentMapper.GetScentIntensity(modComponent);

            gearItem.Awake();
        }