Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - gvendhor

#1
When i travel to a village and want to make a trade then the resulting mass usage show only the products (non-silver) changes, so didn't tell me can i move with more silvers after trade.
#2
Help / Check def in loaded mods
January 26, 2016, 01:50:19 AM
Hi!
I created a mod Animal Manager UI that replaces the Animals tab. I tried to make it compatible with other mods that change the animal tab. In my mod there is two tabs in animal tabwindow: my new tab and the tab modded by others (or the original if there is no mod that replaces it).

Here is the code where i want to determine the class of the other tab (not mine):


            IEnumerable<LoadedMod> mods = LoadedModManager.LoadedMods;


            //first tab should be the original window by default
            Type windowClass = typeof(MainTabWindow_Animals);


            //check is there a mod that change the MainTabWindow_Animals and replaces the first tab with that window
            foreach(LoadedMod mod in mods)
            {
                ModDefSet<MainTabDef> defSet = mod.DefSetOf<MainTabDef>();
               
                MainTabDef def = defSet.DefNamed("Animals");

                if (def != null)
                {
                    try {
                         if (def.windowClass != typeof(MainTabWindow_AnimalManager))
                               windowClass = def.windowClass;
                     }
                    catch (Exception e)
                    {
                        Log.Warning("Wrong with def.WindowClass");
                        Log.Notify_Exception(e);
                    }
                }
            }
            //create the first tab that should be a MainTabWindow
            MainTabWindow window = (MainTabWindow)Activator.CreateInstance(windowClass);


Problem is when i use the "DefNamed(string)" method game throws a warning if there is no such a def in that mod (most of the mod). It generally doesn't cause a problem because the method return null, and i can null check after it, but i want to disappaer the message.
Can I shut off a logger while i use the DefNamed(string) method or is there any method where i can check is there a MainTabDef with name "Animals" in that?
It's not a serious problem, but the mod will be better without it.
#3
Outdated / [A12d] Animal Manager UI
January 24, 2016, 11:21:19 PM
Animal Manager UI Mod

Download Link

I always had a problem with animals. If i don't watch, suddenly lot of chicken appear in my colony and i have to click individually on all unwanted chicks to slaughter. Or if i tame lot of animals i have to go one by one to animal windowtab to select the zone for the new animals.
This mod helps in these situations. You can set the desired quantity of tamed animals and default zones by races in a new tab.

Features


  • Add a new tab to the original animal window to help manage animals by races

    • Set default zone: set the zone of all newly tamed/bought/borned animals to her race's default zone.
    • Set desired quantity: set desired quantity of one races, it does nothing if you don't enable auto-tame and salughter
    • Enable auto-slaughter: If enabled, it designates to slaughter the oldest tamed animals of a race if quantity is below the adjusted desired quantity and removes designation if quantity is above the adjusted desired quantity.
    • Enable auto-tame: If enabled, it designates to slaughter the youngest pawns of a race if quantity  is above the adjusted desired quantity and removes designation if quantity is below the adjusted desired quantity.




Now auto-tame/slaughter is based on age, but likely will be changed, and payers will be more control over it. If you don't enable checkbox on desired quantity it does nothing with that race, so you can manage individually animals like dogs. If you enable automatic tame/slaughter, it not just make a designation but also removes it. So if you want tame animals manually you should remove automatic taming. If you set the default zone of a race, it doesn't change the zone of the earlier tamed animals. You should click to apply button to do this. Zone of newly borned animal is no longer set to her mother zone, but instead set to the default zone of the race. If there is interest, i will update my mod with plus feature like hunting and developed user interface.

If you find a bug, or  annoying grammar in the mod please write a post here.

Compatibility

This mod should be work with other mod that not change the animal tab, and should work with older save games. I also tried to make compatible with other mods that change the animal windows. The only mod that i know to change the animal window is the RW EnhancedTabs. The Animal Manager UI mod run with it, but doesn't open the filter dialog on the first tab (RW_EnhanchedTabs animals window).

License

You can freely use my mod in your mod or mod collection, but I like to see where are used in, so please let me know if you use my mod.


You can download my mod from moddb: Download Link


Update: I remove the red message, but i cannot remove the yellow message if i want to make my mod compatible with other mods that change the animal user interface.