-
Notifications
You must be signed in to change notification settings - Fork 202
Associate and use spawnable entity icons/traces #2495
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
Conversation
43a3574
to
9ce8ef8
Compare
lua_pop(L, 1); | ||
result.push_back({callback, label ? label : "", category ? category : "", description ? description : ""}); | ||
result.push_back({callback, label ? label : "", category ? category : "", description ? description : "", icon ? icon : ""}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what with the mouse cursor when this "" case is hit?
And how does it interact with the onGMClick
lua function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added handling of an empty icon string to default to mouse_create.png, and added an icon parameter to onGMClick that defaults to mouse_create.png if not set.
- Handle potential empty on_gm_click_cursor state - Add icon parameter to Lua onGMClick function
While they are looking cool, the downside is that the placement is now less precise. Not sure how often that will be relevant |
Don't think that's a huge issue. I was working on something yesterday, and I really liked that you have this clear indication that you are placing something. I think it's a huge UX improvement. |
Well, you had that indication of placing something already with the crosshair in #2494. Granted, now there is also a hint of what to place. So compared to that crosshair you gain info/awareness at the cost of precise placement. But I agree, compared to legacy, it is definitely a big improvement |
Cursor precision is generally a challenge because of the 32px cursor size. The default delta-shaped cursor is effectively only 16x16 px because the center of the 32px cursor image is the click point. The modal selection cursors were legible enough at 16x16 to put them next to the delta, but the ship traces less so. In practice I didn't feel limited in precision since the cursor places the ship where the cursor appears, though it would be even better if the ship's size and rotation could also be reflected in the cursor to effectively make it a stamp. That would require extending the cursor drawing code further. I had also considered drawing the ship icon next to the crosshair cursor to retain the precision, but it would require either compositing the radar trace and crosshair into one 32px texture at a loss of radar trace legibility (it would have to be smaller than 16px to fit), or more changes to the cursor rendering code to draw a larger cursor texture or multiple images at once. |
Speaking of size, I think the main reason it feels less precise is that the cursor is twice the size of the Icon. But maybe I just have to get used to it.
I wonder if using just the crosshair cursor while showing the icon right next to the cancel button would work? |
This PR builds on #2494.
Associate icons with
ShipSpawnInfo
andObjectSpawnInfo
, then use them in the GM entity creation screen lists:Also use them as the cursor state for entity creation on the GM screen:
Screencast_20250708_101832.webm
In the process, this sets an
on_gm_click_cursor
string ingameGlobalInfo
to define the cursor used on the GM screen whenon_gm_click
is defined. This is not yet exposed to scripting.