Keriew / augustus

An open source re-implementation of Caesar III
GNU Affero General Public License v3.0
1.54k stars 119 forks source link

Make Warehousing button more noticeable #1031

Closed Ouaz closed 5 months ago

Ouaz commented 8 months ago

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).

crudelios commented 8 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.

Ouaz commented 7 months ago

Maybe we should use a different image when it's not stockpiling?

crudelios commented 7 months ago

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.

Ouaz commented 7 months ago

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.

stockpile_off

Stockpile enabled
crudelios commented 5 months ago

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!

Ouaz commented 5 months ago

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): image

Previously for comparison: image

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. image

Previously for comparison: image

Let me know if it's ok or not.

crudelios commented 5 months ago

It looks good enough to me, but I'm color blind so I don't notice all the subtleties...