Add Food Overlay #86

Merged
TheBrokenRail merged 2 commits from bigjango13/minecraft-pi-reborn:apple-skin into master 2024-02-07 00:02:32 +00:00
Contributor

This adds a food overlay, like that of the AppleSkin mod. It works with both classic and non-classic GUI. an example of the mod in action, along a few other mods

This adds a food overlay, like that of the [AppleSkin](<https://www.curseforge.com/minecraft/mc-mods/appleskin>) mod. It works with both classic and non-classic GUI. ![an example of the mod in action, along a few other mods](https://cdn.discordapp.com/attachments/890737926013591572/1204526118712115210/2024-02-06_15.33.08.png)
bigjango13 added 1 commit 2024-02-06 22:54:18 +00:00
TheBrokenRail reviewed 2024-02-06 23:04:14 +00:00
TheBrokenRail left a comment
Owner

Overall, looks good!

Overall, looks good!
@ -22,0 +42,4 @@
Gui_renderHearts(gui);
}
Gui_blit_t Gui_blit_renderHearts_injection = NULL;

Maybe call this Gui_blit_renderHearts_original? _injection is a bit unclear IMO. Also, does it not let you do = Gui_blit in this line?

Maybe call this `Gui_blit_renderHearts_original`? `_injection` is a bit unclear IMO. Also, does it not let you do ` = Gui_blit` in this line?
Author
Contributor

Great minds think alike it seems 😉
I tried to do Gui_blit_t Gui_blit_renderHearts_injection = Gui_blit;, however C does not allow this, it requires global initializers to be constant, and the symbol split makes it no longer constant. As for the rename, it's been done.

Great minds think alike it seems 😉 I tried to do `Gui_blit_t Gui_blit_renderHearts_injection = Gui_blit;`, however C does not allow this, it requires global initializers to be constant, and the symbol split makes it no longer constant. As for the rename, it's been done.
bigjango13 marked this conversation as resolved
@ -22,0 +53,4 @@
heal_amount_drawing = 0;
} else if (heal_amount_drawing > 0) {
// Full heart
Gui_blit_renderHearts_injection(gui, x1, y1, 70, 0, w1, h1, w2, h2);

Should these constants (79, 70) be put in a macro so they're not repeated?

Should these constants (79, 70) be put in a macro so they're not repeated?
bigjango13 marked this conversation as resolved
@ -576,3 +638,3 @@
overwrite_call((void *) 0x267c8, (void *) Gui_renderHearts_GuiComponent_blit_hearts_injection);
overwrite_call((void *) 0x2656c, (void *) Gui_renderHearts_GuiComponent_blit_armor_injection);
overwrite_call((void *) 0x268c4, (void *) Gui_renderBubbles_GuiComponent_blit_injection);
if (!food_overlay) {

I'd suggest re-ordering this so that Classic HUD is setup first, then Food Overlay. That way, Food Overlay's overwrites can just replace Classic HUD's rather than Classic HUD's having to explicitly check.

I'd suggest re-ordering this so that `Classic HUD` is setup first, then `Food Overlay`. That way, `Food Overlay`'s overwrites can just replace `Classic HUD`'s rather than `Classic HUD`'s having to explicitly check.
bigjango13 marked this conversation as resolved
bigjango13 added 1 commit 2024-02-06 23:16:43 +00:00
Move food overlay to after classic HUD
All checks were successful
CI / Build (AMD64, Server) (push) Successful in 10m14s
CI / Build (AMD64, Client) (push) Successful in 10m26s
CI / Build (ARM64, Server) (push) Successful in 10m28s
CI / Build (ARM64, Client) (push) Successful in 10m38s
CI / Build (ARMHF, Server) (push) Successful in 7m6s
CI / Build (ARMHF, Client) (push) Successful in 9m47s
CI / Test (Client) (push) Successful in 13m41s
CI / Test (Server) (push) Successful in 11m12s
CI / Release (push) Has been skipped
CI / Build Example Mods (push) Successful in 6m15s
2d9d4a638a
TheBrokenRail merged commit 2d9d4a638a into master 2024-02-07 00:02:32 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: minecraft-pi-reborn/minecraft-pi-reborn#86
No description provided.