diff --git a/NEWS b/NEWS index f98bef434..27d31d532 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ DFHack Future New Scripts modtools/reaction-product-trigger: triggers callbacks when products are produced (contrast with when reactions complete) New Tweaks + tradereq-pet-gender: Displays pet genders on the trade request screen Removed Misc Improvements diff --git a/Readme.rst b/Readme.rst index 04c910a08..cb84aaf96 100644 --- a/Readme.rst +++ b/Readme.rst @@ -1337,6 +1337,7 @@ Subcommands that persist until disabled or DF quit: :nestbox-color: Fixes the color of built nestboxes :eggs-fertile: Displays a fertility indicator on nestboxes :max-wheelbarrow: Allows assigning more than 3 wheelbarrows to a stockpile +:tradereq-pet-gender: Displays pet genders on the trade request screen fix-armory ---------- diff --git a/dfhack.init-example b/dfhack.init-example index adadfb6b5..1cbeebf97 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -180,6 +180,7 @@ tweak import-priority-category # Misc. UI tweaks tweak civ-view-agreement tweak max-wheelbarrow +tweak tradereq-pet-gender ########################### # Globally acting plugins # diff --git a/plugins/tweak/tweak.cpp b/plugins/tweak/tweak.cpp index a80e54180..1c89896e2 100644 --- a/plugins/tweak/tweak.cpp +++ b/plugins/tweak/tweak.cpp @@ -87,6 +87,7 @@ #include "tweaks/military-assign.h" #include "tweaks/nestbox-color.h" #include "tweaks/stable-cursor.h" +#include "tweaks/tradereq-pet-gender.h" using std::set; using std::vector; @@ -178,6 +179,8 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector civ_id); + vector& races = entity->resources.animals.pet_races; + vector& castes = entity->resources.animals.pet_castes; + for (int i = (good_idx / 17) * 17, y = 4; i < (good_idx / 17) * 17 + 17 && i < races.size(); i++, y++) { + int x = 30 + 1 + world->raws.creatures.all[races[i]]->caste[castes[i]]->caste_name[0].size(); + bool male = (bool)world->raws.creatures.all[races[i]]->caste[castes[i]]->gender; + OutputString((i == good_idx) ? COLOR_WHITE : COLOR_GREY, + x, y, male ? "\013" : "\014"); + } + } + } +}; + +IMPLEMENT_VMETHOD_INTERPOSE(pet_gender_hook, render);