-
-
Notifications
You must be signed in to change notification settings - Fork 631
feat(api-v3): Blip.GetPropertyFlag (public) and Blip.SetPropertyFlag (private) #1628
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
base: main
Are you sure you want to change the base?
Conversation
kagikn
left a comment
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.
Sorry, but we can't expose GetPropertyFlag without considering how the gold tick flag changes the enum definition in b2699. I would hide the method to avoid potential flag shifts. We need to adjust bit indices by the running game version if it's being publicly exposed, that's for sure.
| /// <summary> | ||
| /// Shows a gold tick indicator on the <see cref="Blip"/>. | ||
| /// </summary> | ||
| ShowGoldTick, |
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.
This flag isn't present in b2628 or earlier game versions. I tested in both b2628 and b2699 by watching which bit SHOW_HEADING_INDICATOR_ON_BLIP changes even.
|
I’ve converted this PR to a draft for now due to the ShowGoldTick issue. |
|
I archive old builds myself. I've downloaded depots with GTA5.exe files from Steam about 10 times to download builds I forgot to archive, though. I have a lot of memory-dumped exe files even, so I can search them for something I need to find quickly when I have to see (though that source code leak reduces the need). |
|
Fortunately, we have an alternative way to achieve what blip natives that change some property flags do with direct memory editing. Since we know trigger flags listed below and every flag except enum eBLIP_TRIGGER_FLAG
{
BLIP_FLAG_VALUE_CHANGED_COLOUR = 33, // when a colour changes
BLIP_FLAG_VALUE_CHANGED_FLASH, // when the flash changes
BLIP_FLAG_VALUE_REINIT_STAGE, // when blip must be re-initialised on the stage
BLIP_FLAG_VALUE_REMOVE_FROM_STAGE, // when blip must be removed from the stage prior to destroying the object
BLIP_FLAG_VALUE_DESTROY_BLIP_OBJECT, // when blip object is to completely destoryed
BLIP_FLAG_ON_STAGE, // set if the blip was on the stage last time the minimap was rendered
BLIP_FLAG_VALUE_CHANGED_PULSE, // blip flagged to pulse
BLIP_FLAG_UPDATE_ALPHA_ONLY, // update alpha directly without invoking SET_RADIUS_BLIP_COLOUR
BLIP_FLAG_VALUE_SET_NUMBER, // when to reinitialise the number shown on a blip
BLIP_FLAG_EXECUTED_VIA_DLC, // will be TRUE once the blip has been executed on the drawlist
BLIP_FLAG_EXECUTED_VIA_DLC_LAST_FRAME, // when blip was sent to the renderthread last frame
BLIP_FLAG_UPDATE_STAGE_DEPTH, // blip has had its priority (or hover state) tweaked and needs its depth adjusted on the stage
BLIP_FLAG_VALUE_CHANGED_TICK, // when the tick changes and needs to be updated
BLIP_FLAG_VALUE_CHANGED_GOLD_TICK, // when the gold tick changes and needs to be updated
BLIP_FLAG_VALUE_CHANGED_FOR_SALE, // when the for sale icon on a blip should be updated
BLIP_FLAG_VALUE_CHANGED_OUTLINE_INDICATOR,
BLIP_FLAG_VALUE_CHANGED_FRIEND_INDICATOR,
BLIP_FLAG_VALUE_CHANGED_CREW_INDICATOR,
BLIP_FLAG_UPDATED_LOW_FREQ_FLAGS, // optimization; true when we've thrown a few less common flags
BLIP_FLAG_VALUE_TURNED_OFF_SHOW_HEIGHT, // when the SHOW_HEIGHT property is turned off - used to make sure the height blip is returned to level
// omitted since we consider only final builds for SHVDN and not any builds where `__BANK` is set to true
#if __BANK
#endif // __BANK
MAX_BLIP_TRIGGER_FLAGS
};For the crew indicator you can test it with |

Added GetPropertyFlag(BlipPropertyFlag flag) — allows reading whether a specific blip property flag is set.
Added SetPropertyFlag(BlipPropertyFlag flag, bool value) — private setter for internal use; note that updating flags this way does not immediately refresh the blip visually atleast for some.
Originally intended as a refactor, but GetPropertyFlag could be useful as a public feature.
Refactoring and related bug fixes will be addressed in separate follow-up PRs.