Beispiel #1
0
        static public void registerAll()
        {
            Assembly.GetExecutingAssembly().GetTypes().Do(delegate(Type type) {
                List <HarmonyMethod> harmonyMethods = type.GetHarmonyMethods();
                if (harmonyMethods != null && harmonyMethods.Count <HarmonyMethod>() > 0)
                {
                    HarmonyPatchNamespace nsAttr;
                    if (type.TryGetAttribute(out nsAttr))
                    {
                        nsAttr.register();
                    }
                }
            });
            QOLModSettings settings = QOLMod.getSettings();

            if (settings.forbiddenPatchNamespaces.NullOrEmpty())
            {
                settings.forbiddenPatchNamespaces = new List <string>();
            }
            foreach (KeyValuePair <string, HarmonyPatchNamespaceProperties> p in namespaces)
            {
                if (settings.forbiddenPatchNamespaces.Contains(p.Key))
                {
                    p.Value.active = false;
                }
            }
        }
Beispiel #2
0
        public QOLMod(ModContentPack content) : base(content)
        {
            settings = GetSettings <QOLModSettings>();
            flow     = null;
            //minimalistic pawn that is used to generate tooltips
            dummyPawn        = new Pawn();
            dummyPawn.gender = Gender.Male;
            dummyPawn.Name   = new NameSingle("Malte");

            singleton = this;
            System.Reflection.FieldInfo fi = typeof(Text).GetField("lineHeights", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
            lineHeights       = (float[])fi.GetValue(null);
            tmpTextGUIContent = new GUIContent();
        }