Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Warehousing button more noticeable #1031

Merged
merged 4 commits into from
Apr 13, 2024
Merged

Conversation

Ouaz
Copy link

@Ouaz Ouaz commented Jan 28, 2024

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

to make the building setting more noticeable.
Use the checkmark icon for toggle on/off
Decrease saturation of Warehousing icon
@crudelios
Copy link
Collaborator

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.

Displayed when "stockpile to a warehouse" is not enabled
@Ouaz
Copy link
Author

Ouaz commented Feb 10, 2024

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

  • Click the button shows the "lit" icon (meaning stockpiling is enabled):
    image

@crudelios
Copy link
Collaborator

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
Copy link
Author

Ouaz commented Feb 12, 2024

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
Copy link
Collaborator

crudelios commented Apr 11, 2024

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
Copy link
Author

Ouaz commented Apr 13, 2024

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
Copy link
Collaborator

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

@crudelios crudelios merged commit 814364d into Keriew:master Apr 13, 2024
14 checks passed
@Ouaz Ouaz deleted the stockpile branch April 15, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants