dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

hive-color.h

Open Vettlingr opened this issue 4 years ago • 9 comments

Hives are normally shown as yellow, regardless of tool material. As with nestboxes, this should change how the games show hives, making it possible to see what material the hives are made of.

Needs testing.

Vettlingr avatar Nov 07 '21 18:11 Vettlingr

This change looks like it will also affect hives which are queued for construction - the original version of this vmethod checks whether getBuildStage() is equal to 0 or 1 in order to decide between these.

A better way of fixing this would be to override the "getNameColor" vmethod (which sets gps.screenf+gps.screenb+gps.screenbright to the desired material color (which should also be done for the Nest Box tweak).

quietust avatar Nov 07 '21 19:11 quietust

What getbuildStage() does not seem to be an issue for the nest-box tweak. Its graphical representation shows up as it should while under construction. Not sure why, but I think it has to do with how df handles colors. Wether or not this also applies to hives is a matter of testing though.

I'm not sure on where to but in the getBuildStage()==1 to address this issue as I have no idea how vmethod works :S

Vettlingr avatar Nov 07 '21 19:11 Vettlingr

I'm guessing by intuition -- if (flags.bits.exists) and building.getBuildingStage()==1 then

But its a shot in the dark

Vettlingr avatar Nov 07 '21 19:11 Vettlingr

Hi again. It might be an idea to do the same for cage traps, weapon traps and stone-fall traps?

Vettlingr avatar Nov 18 '21 12:11 Vettlingr

I'm not quite sure why that would be desirable - the color of traps is already used to distinguish between the different types of traps.

lethosor avatar Nov 19 '21 04:11 lethosor

You can change the graphics of the trap tile with TWBT through certain override lines. That is the only reason.

Vettlingr avatar Nov 19 '21 12:11 Vettlingr

I have not been able to test this yet, and I am unsure how it can be tested without compiling. I cannot compile properly on my mac for the moment, so I am just relying on the Nest-box code to be transferable to hives for that reason. Hence I don't have any interest on diverging from the already proven solution. If quietust have certain preferences that deviate from the nest-box colour code, I would suggest him implementing that himself since I haven't figured out how to test this code yet.

Vettlingr avatar Jun 05 '22 16:06 Vettlingr

Where are you getting stuck on compiling? Do the instructions at https://docs.dfhack.org/en/stable/docs/Compile.html#macos need updating?

myk002 avatar Jun 05 '22 19:06 myk002

+1. We don't have a lot of people compiling on macOS, so we rely on those that do to help keep the instructions up-to-date. There isn't a way to test this other than compiling DFHack.

lethosor avatar Jun 08 '22 05:06 lethosor