Closed Ouaz closed 5 months ago
I'm not too sure about this as this isn't consistent with the rest of the UI. Though I agree the old style isn't either.
Maybe we should use a different image when it's not stockpiling? Like a cart or something. Then if the button is pressed the image is replaced with the current one.
Maybe we should use a different image when it's not stockpiling?
An "unlit" stockpile icon when stockpiling is disabled (same color as the panel background)
Click the button shows the "lit" icon (meaning stockpiling is enabled):
I like that more.
Just to make things perfect, maybe we can use a button like the one for mothball/ unmothball? I'm not sure we have just the button background available though.
maybe we can use a button like the one for mothball/ unmothball?
To be honest, I've never been a fan of using a 24x24 button for the mothball/unmothball order.
Because there's a visual discrepancy: 24x24 buttons on building panels are general UI buttons (e.g. Help, Exit, Go to advisor, etc.), whereas Mothball/Unmothball is an order (i.e. a building setting), though it is not a big deal, as it's the only one 24x24 order button so far.
Any other buttons related to orders are 20x20 (walker permissions, Military Academy settings, etc.).
So, I propose to move the stockpiling button in the upper right corner of the panel. There, it will be mirrored with the resource icon on the upper left corner, to check in a glimpse the production building setting ("use" or "stockpile"), far from the mothball button.
Because I'm a nerdy guy and I love saving 10x10 images, I think you can use a single image and color it in-game with nearly the same result.
How to do it:
The only image you'd provide is a black-and-white one, with the same shading as the colored one.
In the game, on line 615, you could do as follows:
image_draw(assets_get_image_id("UI", "Warehousing_off"), x + 4, y + 4, building_stockpiling_enabled(building_get(c->building_id)) ?
COLOR_MASK_WHATHEVER_COLOR_GIVES_THE_ICON_ITS_LOVELY_LIVELY_LOOK : COLOR_MASK_NONE, SCALE_NONE);
The game would show the nearly black and white one when stockpiling is disabled, the colored one when it's enabled and you'd save about 400 glorious bytes of VRAM!
The only image you'd provide is a black-and-white one, with the same shading as the colored one. In the game, on line 615, you could do as follows:
Note: I did not push the commit. I wanted to post how different it looks first.
So, I turned the colored image to black and white, playing with levels so the brighest color is pure white (#ffffff
):
Previously for comparison:
I pick the color #f5a46b
from the colored box (brightest color pixel who equals the white color location) and I replaced the full if
by:
image_draw(assets_get_image_id("UI", "Warehousing_off"), x + 4, y + 4, building_stockpiling_enabled(building_get(c->building_id)) ?
0xfff5a46b : COLOR_MASK_NONE, SCALE_NONE);
The applied color is correct in game, though the box color is less vibrant, as I can't cheat with color scale and saturation like I did with the colored box icon.
Previously for comparison:
Let me know if it's ok or not.
It looks good enough to me, but I'm color blind so I don't notice all the subtleties...
Make the "stockpiling to a warehouse" setting per building basis more noticeable.
OBSOLETE
Previously (unchecked)
Now (unchecked and checked)
Tested: works correctly (tooltip and stuff).