multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 437 forks source link

HUD Customization #3836

Open FileEX opened 3 weeks ago

FileEX commented 3 weeks ago

Closes #3682

This PR adds customization for the default HUD in GTA. Eventually, all components are intended to be modifiable. Currently, the PR is in progress, and the following properties are available:

Syntax

bool setPlayerHudComponentProperty(string component, string property, mixed value)
mixed getPlayerHudComponentProperty(string component, string property)
bool resetPlayerHudComponentProperty(string component, string property)

I also plan to create a HUD visualization in the settings where changes will be possible. However, I think that will be part of a separate PR.

With this PR, it will also be possible to easily fix issues like #3807 without the need to patch values in memory.

image

setPlayerHudComponentProperty('health', 'fillColor', tocolor(50, 168, 82, 255));
setPlayerHudComponentProperty('breath', 'fillColor', tocolor(167, 189, 58, 255));
setPlayerHudComponentProperty('armour', 'fillColor', tocolor(53, 130, 171, 255));

setPlayerHudComponentProperty('armour', 'drawPercentage', true);

setPlayerHudComponentProperty('health', 'position', 300, 200);
setPlayerHudComponentProperty('health', 'size', 100, 20);

setPlayerHudComponentProperty('breath', 'position', 300, 240);
setPlayerHudComponentProperty('armour', 'position', 300, 280);

setPlayerHudComponentProperty('armour', 'size', 300, 20);
Fernando-A-Rocha commented 3 weeks ago

Nice, what about #3444 ?

Proxy-99 commented 3 weeks ago

Nice, what about #3444 ?

this is a patch for wide screens has nothing to do with customization

Fernando-A-Rocha commented 3 weeks ago

Nice, what about #3444 ?

this is a patch for wide screens has nothing to do with customization

This PR alters HUD component sizes, won't it conflict with wide screen HUD sizing PR?

Proxy-99 commented 3 weeks ago

Nice, what about #3444 ?

this is a patch for wide screens has nothing to do with customization

This PR alters HUD component sizes, won't it conflict with wide screen HUD sizing PR?

this is normal but we compare conflicts according to multitheftauto:master rely on which pr will be merged first other pr has to adjuct to the new changes