Post: [1.02/RELEASE] SPRX Hud Elems
11-01-2015, 08:03 PM #1
Swaqq
Professional Thanker
(adsbygoogle = window.adsbygoogle || []).push({}); You must login or register to view this content.

Hello Everyone!

I know Black Ops 3 hasn't been released and all but I reversed these hud elements, and realized that they were the same as black ops 2. I haven't tested them, but they should work. So here they are. I'd show a screenshot, but I don't actually have the game. So have fun! Update: The text is confirmed working, but not the shaders. Please give me some time to verify. Thanks.



    

#pragma region Hud Elements
struct color_t
{
char r;
char g;
char b;
char a;
};
union hudelem_color_t
{
color_t color;
int rgba;
};




struct hudelem_s
{
float x;//0x00
float y;//0x04
float z;//0x08;
float fontScale;//0xC
float fromFontScale;//0x10
int fontScaleStartTime;//0x14
hudelem_color_t color;//0x18
hudelem_color_t fromColor;//0x1C
int fadeStartTime;//0x20
int scaleStartTime;//0x24
float fromX;//0x28
float fromY;//0x2C
int moveStartTime;//0x30
int time;//0x34
int duration;//0x38
float value;//0x3C
float sort;//0x40
hudelem_color_t glowColor;//0x44
int fxBirthTime;//0x48
int flags;//0x4C
short targetEntNum;//0x50
short fontScaleTime;//0x52
short fadeTime;//0x54
short label;//0x56
short width;//0x58
short height; //0x5A
short fromWidth;//0x5C
short fromHeight;//0x5E
short scaleTime;//0x60
short moveTime;//0x62
short text;//0x64
short fxLetterTime;//0x66
short fxDecayStartTime;//0x68
short fxDecayDuration;//0x6A
short fxRedactDecayStartTime;//0x6C
short fxRedactDecayDuration;//0x6E
unsigned char type;//0x70
unsigned char font;//0x71
unsigned char alignOrg;//0x72
unsigned char alignScreen;//0x73
short materialIndex;//0x74
short offscreenMaterialIndex;//0x76
unsigned char fromAlignOrg;//0x78
unsigned char fromAlignScreen;//0x79
unsigned char soundID;//0x7A
};
typedef struct game_hudelem_s
{
hudelem_s elem;//0x00 - 0x7B
int clientNum;//0x7C
int team;//0x80
int abilityFlag;//0x84
};


game_hudelem_s* HudElem_Alloc()
{
for (int i = 120; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x176F348 + (i * 0x8Cool Man (aka Tustin));
if (elem->elem.type == 0)
{
printf("\nHud: %i\n", i);
return elem;
}
}
return (game_hudelem_s*)0;
}


#define G_LocalizedStringIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388C14))(Text)
#define G_MaterialIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388CFCool Man (aka Tustin))(Text)

int GetLevelTime(){
return *(int*)(0x1780B00 + 0x98C);//BO3 1.01
}
void ChangeText(game_hudelem_s* elem, const char* text){
elem->elem.text = G_LocalizedStringIndex(text);
}

game_hudelem_s* SetShader(int client, const char* shader, float x, float y, short width, short height, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = 8;
elem->elem.materialIndex = G_MaterialIndex(shader);
elem->elem.width = width;
elem->elem.height = height;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.alignOrg = 0;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}

game_hudelem_s* SetText(int client, const char* Text, int font, float fontSize, float x, float y, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = 1;
elem->elem.text = G_LocalizedStringIndex(Text);
elem->elem.font = font;
elem->elem.fontScale = fontSize;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}

void fadeOverTime(game_hudelem_s * Elem, int Time, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.color.r = R;
Elem->elem.color.color.g = G;
Elem->elem.color.color.b = B;
Elem->elem.color.color.a = A;
Elem->elem.fadeTime = Time;
Elem->elem.fadeStartTime = GetLevelTime();
}

void moveOverTime(game_hudelem_s * elem, int time, float X, float Y)
{
elem->elem.fromX = elem->elem.x;
elem->elem.fromY = elem->elem.y;
elem->elem.moveStartTime = GetLevelTime();
elem->elem.moveTime = time;
elem->elem.x = X;
elem->elem.y = Y;
}
void scaleOverTime(game_hudelem_s* elem, int time, short width, short height){
elem->elem.fromWidth = elem->elem.width;
elem->elem.fromHeight = elem->elem.height;
elem->elem.scaleStartTime = GetLevelTime();
elem->elem.scaleTime = time;
elem->elem.width = width;
elem->elem.height = height;
}
#pragma endregion


Credits:
    
Sabotage & John - Some addresses
Last edited by Swaqq ; 11-09-2015 at 12:41 AM. Reason: fixed em

The following 27 users say thank you to Swaqq for this useful post:

anxify, mason, Bigmoneyhustlin, Red-EyeX32, Cmd-X, Sabotage, dom_m3hdy_xx3, EternalHabit, Father Luckeyy, iDontRte, Im_YouViolateMe, ImPiffHD, Joren, LaughTracks, Loz, Nana, Next To Nothing, NickBeHaxing, John, oStankyModz, Pianist Prodigy, RoRoH_AR, Specter, basshead4ever, Laser, xexDELL
11-09-2015, 02:10 PM #29
Originally posted by Swaqq View Post

EDIT: I took out your shitty enum so you get no credit.


Lmao gg 10/10 professional

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo