New tweak: nestbox-color

develop
lethosor 2014-10-01 20:13:31 -04:00
parent e21613bf49
commit d2fb51f99e
5 changed files with 53 additions and 23 deletions

@ -5,7 +5,7 @@ DFHack future
category when discussing an import agreement with the liaison category when discussing an import agreement with the liaison
- manager-quantity: Removes the limit of 30 jobs per manager order - manager-quantity: Removes the limit of 30 jobs per manager order
- civ-view-agreement: Fixes overlapping text on the "view agreement" screen - civ-view-agreement: Fixes overlapping text on the "view agreement" screen
- nestbox-color: Fixes the color of built nestboxes
DFHack 0.40.13-r1 DFHack 0.40.13-r1
Internals: Internals:

@ -2006,7 +2006,10 @@ category when discussing an import agreement with the liaison</p>
</td> </td>
</tr> </tr>
<tr class="field"><th class="field-name" colspan="2">civ-view-agreement:</th></tr> <tr class="field"><th class="field-name" colspan="2">civ-view-agreement:</th></tr>
<tr class="field"><td>&nbsp;</td><td class="field-body"><p class="first last">Fixes overlapping text on the &quot;view agreement&quot; screen</p> <tr class="field"><td>&nbsp;</td><td class="field-body"><p class="first">Fixes overlapping text on the &quot;view agreement&quot; screen</p>
</td>
</tr>
<tr class="field"><th class="field-name">nestbox-color:</th><td class="field-body"><p class="first last">Fixes the color of built nestboxes</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>

@ -1286,7 +1286,7 @@ Subcommands that persist until disabled or DF quit:
category when discussing an import agreement with the liaison category when discussing an import agreement with the liaison
:manager-quantity: Removes the limit of 30 jobs per manager order :manager-quantity: Removes the limit of 30 jobs per manager order
:civ-view-agreement: Fixes overlapping text on the "view agreement" screen :civ-view-agreement: Fixes overlapping text on the "view agreement" screen
:nestbox-color: Fixes the color of built nestboxes
fix-armory fix-armory
---------- ----------

@ -82,6 +82,7 @@
#include "tweaks/import-priority-category.h" #include "tweaks/import-priority-category.h"
#include "tweaks/manager-quantity.h" #include "tweaks/manager-quantity.h"
#include "tweaks/military-assign.h" #include "tweaks/military-assign.h"
#include "tweaks/nestbox-color.h"
#include "tweaks/stable-cursor.h" #include "tweaks/stable-cursor.h"
using std::set; using std::set;
@ -133,42 +134,44 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
" tweak stable-cursor [disable]\n" " tweak stable-cursor [disable]\n"
" Keeps exact position of dwarfmode cursor during exits to main menu.\n" " Keeps exact position of dwarfmode cursor during exits to main menu.\n"
" E.g. allows switching between t/q/k/d without losing position.\n" " E.g. allows switching between t/q/k/d without losing position.\n"
" tweak fast-heat <max-ticks>\n"
" Further improves temperature updates by ensuring that 1 degree of\n"
" item temperature is crossed in no more than specified number of frames\n"
" when updating from the environment temperature. Use 0 to disable.\n"
/*" tweak fix-dimensions [disable]\n" /*" tweak fix-dimensions [disable]\n"
" Fixes subtracting small amount of thread/cloth/liquid from a stack\n" " Fixes subtracting small amount of thread/cloth/liquid from a stack\n"
" by splitting the stack and subtracting from the remaining single item.\n"*/ " by splitting the stack and subtracting from the remaining single item.\n"*/
" tweak adamantine-cloth-wear [disable]\n"
" Stops adamantine clothing from wearing out while being worn (bug 6481).\n"
" tweak advmode-contained [disable]\n" " tweak advmode-contained [disable]\n"
" Fixes custom reactions with container inputs in advmode. The issue is\n" " Fixes custom reactions with container inputs in advmode. The issue is\n"
" that the screen tries to force you to select the contents separately\n" " that the screen tries to force you to select the contents separately\n"
" from the container. This forcefully skips child reagents.\n" " from the container. This forcefully skips child reagents.\n"
" tweak civ-view-agreement\n"
" Fixes overlapping text on the \"view agreement\" screen\n"
" tweak craft-age-wear [disable]\n"
" Makes cloth and leather items wear out at the correct rate (bug 6003).\n"
" tweak farm-plot-select [disable]\n"
" Adds \"Select all\" and \"Deselect all\" options to farm plot menus\n"
" tweak fast-heat <max-ticks>\n"
" Further improves temperature updates by ensuring that 1 degree of\n"
" item temperature is crossed in no more than specified number of frames\n"
" when updating from the environment temperature. Use 0 to disable.\n"
" tweak fast-trade [disable]\n" " tweak fast-trade [disable]\n"
" Makes Shift-Enter in the Move Goods to Depot and Trade screens select\n" " Makes Shift-Enter in the Move Goods to Depot and Trade screens select\n"
" the current item (fully, in case of a stack), and scroll down one line.\n" " the current item (fully, in case of a stack), and scroll down one line.\n"
" tweak import-priority-category [disable]\n"
" When meeting with a liaison, makes Shift+Left/Right arrow adjust\n"
" the priority of an entire category of imports.\n"
" tweak manager-quantity [disable]\n"
" Removes the limit of 30 jobs per manager order\n"
" tweak nestbox-color [disable]\n"
" Makes built nestboxes use the color of their material\n"
" tweak military-color-assigned [disable]\n"
" Color squad candidates already assigned to other squads in brown/green\n"
" to make them stand out more in the list.\n"
" tweak military-stable-assign [disable]\n" " tweak military-stable-assign [disable]\n"
" Preserve list order and cursor position when assigning to squad,\n" " Preserve list order and cursor position when assigning to squad,\n"
" i.e. stop the rightmost list of the Positions page of the military\n" " i.e. stop the rightmost list of the Positions page of the military\n"
" screen from constantly jumping to the top.\n" " screen from constantly jumping to the top.\n"
" tweak military-color-assigned [disable]\n"
" Color squad candidates already assigned to other squads in brown/green\n"
" to make them stand out more in the list.\n"
// " tweak military-training [disable]\n" // " tweak military-training [disable]\n"
// " Speed up melee squad training, removing inverse dependency on unit count.\n" // " Speed up melee squad training, removing inverse dependency on unit count.\n"
" tweak farm-plot-select [disable]\n"
" Adds \"Select all\" and \"Deselect all\" options to farm plot menus\n"
" tweak manager-quantity [disable]\n"
" Removes the limit of 30 jobs per manager order\n"
" tweak import-priority-category [disable]\n"
" When meeting with a liaison, makes Shift+Left/Right arrow adjust\n"
" the priority of an entire category of imports.\n"
" tweak civ-view-agreement\n"
" Fixes overlapping text on the \"view agreement\" screen\n"
" tweak craft-age-wear [disable]\n"
" Makes cloth and leather items wear out at the correct rate (bug 6003).\n"
" tweak adamantine-cloth-wear [disable]\n"
" Stops adamantine clothing from wearing out while being worn (bug 6481).\n"
)); ));
TWEAK_HOOK("adamantine-cloth-wear", adamantine_cloth_wear_armor_hook, incWearTimer); TWEAK_HOOK("adamantine-cloth-wear", adamantine_cloth_wear_armor_hook, incWearTimer);
@ -202,6 +205,8 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
TWEAK_HOOK("military-stable-assign", military_assign_hook, feed); TWEAK_HOOK("military-stable-assign", military_assign_hook, feed);
TWEAK_HOOK("nestbox-color", nestbox_color_hook, drawBuilding);
TWEAK_HOOK("stable-cursor", stable_cursor_hook, feed); TWEAK_HOOK("stable-cursor", stable_cursor_hook, feed);
return CR_OK; return CR_OK;

@ -0,0 +1,22 @@
#include "df/building_flags.h"
#include "df/building_drawbuffer.h"
#include "df/building_nest_boxst.h"
using namespace df::enums;
struct nestbox_color_hook : df::building_nest_boxst {
typedef df::building_nest_boxst interpose_base;
DEFINE_VMETHOD_INTERPOSE(void, drawBuilding, (df::building_drawbuffer* db, int16_t unk))
{
INTERPOSE_NEXT(drawBuilding)(db, unk);
if (flags.bits.exists)
{
MaterialInfo mat(mat_type, mat_index);
db->fore[0][0] = mat.material->build_color[0];
db->back[0][0] = mat.material->build_color[1];
db->bright[0][0] = mat.material->build_color[2];
}
}
};
IMPLEMENT_VMETHOD_INTERPOSE(nestbox_color_hook, drawBuilding);