Example #1
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            foreach (Gizmo c in base.CompGetGizmosExtra())
            {
                yield return(c);
            }

            Designation existingDesignation = Find.VisibleMap.designationManager.DesignationOn(parent, DefDatabase <DesignationDef> .GetNamed("HaulToEnchant"));

            if (existingDesignation == null)
            {
                yield return(new Command_Action
                {
                    action = delegate
                    {
                        SoundDefOf.TickTiny.PlayOneShotOnCamera(null);
                        Map map = Find.VisibleMap;

                        map.designationManager.RemoveAllDesignationsOn(parent, false);
                        map.designationManager.AddDesignation(new Designation(parent, DesignationDef));
                    },
                    hotKey = KeyBindingDefOf.Misc1,
                    defaultDesc = DefaultDescriptionKey.Translate(),
                    icon = ContentFinder <Texture2D> .Get(IconPath, true),
                    defaultLabel = DefaultLabelKey.Translate()
                });
            }
        }
Example #2
0
        public override IEnumerable <Gizmo> CompGetGizmosExtra()
        {
            foreach (Gizmo c in base.CompGetGizmosExtra())
            {
                yield return(c);
            }

            yield return(new Command_Action
            {
                action = delegate
                {
                    SoundDefOf.TickTiny.PlayOneShotOnCamera(null);
                    Log.Error(string.Concat(new object[]
                    {
                        parent.LabelCap,
                        " is an ",
                        (parent.GetComp <CompCharacterClass>() != null) ? parent.GetComp <CompCharacterClass>().classRecord.def.defName : "CompCharacterClass was NULL",
                        " has ",
                        abilities.Count,
                        " abilities."
                    }));
                    foreach (Ability ability in abilities)
                    {
                        string tags = "";
                        foreach (TagDef tagDef in ((AbilityDef)ability.def).tags)
                        {
                            tags += tagDef.defName + ", ";
                        }

                        string categories = "";
                        foreach (AbilityCategoryDef abilityCategoryDef in ((AbilityDef)ability.def).abilityCategoryDefs)
                        {
                            categories += abilityCategoryDef.defName + ", ";
                        }

                        Log.Warning(string.Concat(new object[]
                        {
                            ability.LabelCap,
                            ", Tags: ",
                            tags,
                            " Categories: ",
                            categories
                        }));
                    }
                },
                hotKey = KeyBindingDefOf.Misc1,
                defaultDesc = DefaultDescriptionKey.Translate(),
                icon = ContentFinder <Texture2D> .Get(IconPath, true),
                defaultLabel = DefaultLabelKey.Translate()
            });
        }