Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Offsets
- {
- public static uint
- FPS = 0x3979EC,
- G_LocalizedStringIndex = 0x275D24,
- G_HudElems = 0x15DDB00,
- HudelemSize = 0x88,
- G_MaterialIndex = 0x276020;
- }
- public class HudElements
- {
- public class HElems
- {
- public static uint ElemIndex = Offsets.G_HudElems;
- public static uint HudsLength = 0x88;
- public static uint abilityFlag = 0x84;
- public static uint alignOrg = 0x72;
- public static uint alignScreen = 0x73;
- public static uint color = 0x18;
- public static uint duration = 0x38;
- public static uint fadeStartTime = 0x20;
- public static uint fadeTime = 0x54;
- public static uint flag2 = 0x7A;
- public static uint flags = 0x4C;
- public static uint Font = 0x70;
- public static uint FontSize = 0xC;
- public static uint fontScaleStartTime = 0x14;
- public static uint fontScaleTime = 0x52;
- public static uint fromAlignOrg = 0x76;
- public static uint fromAlignScreen = 0x77;
- public static uint fromColor = 0x1C;
- public static uint fromFontScale = 0x10;
- public static uint fromHeight = 0x5e;
- public static uint fromWidth = 0x5c;
- public static uint fromX = 0x28;
- public static uint fromY = 0x2C;
- public static uint fxBirthTime = 0x48;
- public static uint fxDecayDuration = 0x6A;
- public static uint fxDecayStartTime = 0x68;
- public static uint fxLetterTime = 0x66;
- public static uint fxRedactDecayDuration = 110;
- public static uint fxRedactDecayStartTime = 0x6c;
- public static uint glowColor = 0x44;
- public static uint Height = 0x5A;
- public static uint label = 0x56;
- public static uint materialIndex = 0x71;
- public static uint moveStartTime = 0x30;
- public static uint moveTime = 0x62;
- public static uint offscreenMaterialIdx = 0x75;
- public static uint clientOffset = 0x7c;
- public static uint scaleStartTime = 0x24;
- public static uint scaleTime = 0x60;
- public static uint sort = 0x40;
- public static uint soundID = 0x78;
- public static uint targetEntNum = 80;
- public static uint team = 0x80;
- public static uint text = 0x62;
- public static uint time = 0x34;
- public static uint type = 0x6D;
- public static uint ui3dWindow = 0x4f;
- public static uint value = 60;
- public static uint Width = 0x58;
- public static uint X = 0x00;
- public static uint Y = 0x04;
- public static uint Z = 0x08;
- }
- public static byte[] RGBA(decimal R, decimal G, decimal B, decimal A)
- {
- byte[] RGBA = new byte[4];
- byte[] RVal = BitConverter.GetBytes(Convert.ToInt32(R));
- byte[] GVal = BitConverter.GetBytes(Convert.ToInt32(G));
- byte[] BVal = BitConverter.GetBytes(Convert.ToInt32(B));
- byte[] AVal = BitConverter.GetBytes(Convert.ToInt32(A));
- RGBA[0] = RVal[0];
- RGBA[1] = GVal[0];
- RGBA[2] = BVal[0];
- RGBA[3] = AVal[0];
- return RGBA;
- }
- private static uint HudElem_Alloc()
- {
- for (int i = 30; i < 0x400; i++)
- {
- uint offset = Offsets.G_HudElems + (uint)(i) * 0x88;
- if (PS3.Extension.ReadInt16(offset + 0x70) == 0)
- {
- PS3.SetMemory(offset, new byte[0x88]);
- return offset;
- }
- }
- return 0;
- }
- public static uint SetShader(int clientIndex, object Material, short width, short height, float x, float y, int r = 255, int g = 255, int b = 255, int a = 255)
- {
- uint elem = HudElem_Alloc();
- PS3.Extension.WriteInt32(elem + HElems.type, 8);//8 = Icon
- PS3.Extension.WriteInt32(elem + HElems.materialIndex, (int)Material);
- PS3.Extension.WriteInt16(elem + HElems.Height, height);
- PS3.Extension.WriteInt16(elem + HElems.Width, width);
- PS3.Extension.WriteFloat(elem + HElems.X, x);
- PS3.Extension.WriteFloat(elem + HElems.Y, y);
- PS3.Extension.WriteInt32(elem + HElems.clientOffset, clientIndex);
- PS3.SetMemory(elem + 0x79, new byte[] { 0xFF });
- PS3.SetMemory(elem + HElems.color, RGBA(r, g, b, a));
- return elem;
- }
- public static Int16 G_LocalizedStringIndex(string txt)
- {
- return (Int16)RPC.Call(Offsets.G_LocalizedStringIndex, txt);
- }
- public static uint SetText(int clientIndex, string Text, short Font, double FontSize, float x, float y, int r = 255, int g = 255, int b = 255, int a = 255, int glowr = 255, int glowg = 255, int glowb = 255, int glowa = 0)
- {
- uint elem = HudElem_Alloc();
- PS3.Extension.WriteInt32(elem + HElems.type, 1);//1 = Text
- PS3.Extension.WriteFloat(elem + HElems.FontSize, (float)FontSize);
- PS3.Extension.WriteInt16(elem + HElems.Font, Font);
- PS3.Extension.WriteFloat(elem + HElems.X, x);
- PS3.Extension.WriteFloat(elem + HElems.Y, y);
- PS3.Extension.WriteInt32(elem + HElems.clientOffset, clientIndex);
- PS3.Extension.WriteInt16(elem + HElems.text, G_LocalizedStringIndex(Text));
- PS3.SetMemory(elem + HElems.color, RGBA(r, g, b, a));
- PS3.SetMemory(elem + HElems.glowColor, RGBA(glowr, glowg, glowb, glowa));
- PS3.SetMemory(elem + 0x79, new byte[] { 0xFF });
- PS3.SetMemory(elem + HElems.Font, new byte[] { 0x01 });
- return elem;
- }
- public static int precacheShader(string Shader)
- {
- PS3.Extension.WriteInt32(0x1608100 + 0x40, 1);
- return RPC.Call(0x276020, Shader);
- }
- public static void DestroyElement(uint Element)
- {
- PS3.SetMemory(Element, new byte[HElems.HudsLength]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement