Advertisement
Guest User

AW 1.08 Huds

a guest
Feb 8th, 2015
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1. public class Huds
  2. {
  3. public static class HUDS
  4. {
  5.  
  6.  
  7. public static class hud
  8. {
  9. public static uint active = 0x00,
  10. font = 0x04,
  11. alignOrg = 0x08,
  12. alignScreen = 0x0C,
  13. x = 0x10,
  14. y = 0x14,
  15. z = 0x18,
  16. type = 0x1C,
  17. clientNum = 0xB0,
  18. fontScale = 0x20,
  19. color = 0x30,
  20. fromColor = 0x34,
  21. fadeStartTime = 0x38,
  22. fadeTime = 0x3C,
  23. width = 0x44,
  24. height = 0x48,
  25. material = 0x4C,
  26. fromWidth = 0x50,
  27. fromHeight = 0x54,
  28. scaleStartTime = 0x58,
  29. scaleTime = 0x5C,
  30. fromX = 0x60,
  31. fromY = 0x64,
  32. fromAlignOrg = 0x68,
  33. fromAlignScreen = 0x6C,
  34. moveStartTime = 0x70,
  35. moveTime = 0x74,
  36. value = 0x80,
  37. text = 0x84,
  38. glowColor = 0x8C;
  39. }
  40. public static void hudDestroy(int index)
  41. {
  42. byte[] eraser = new byte[0xBC];
  43. PS3.SetMemory(Addresses.G_HudElems + (uint)index * 0xBC, eraser);
  44. }
  45.  
  46.  
  47.  
  48. public static Int16 G_LocalizedStringIndex(String Text)
  49. {
  50. return (Int16)RPC.Call(Addresses.G_LocalizedString, Text);
  51. }
  52.  
  53. public static void spawnText(int clientIndex, int index, string text, float x, float y, int font, float fontScale, int r, int g, int b, int a, int r1, int g1, int b1, int a1)
  54. {
  55.  
  56. uint elem = Addresses.G_HudElems + (uint)index * 0xBC;
  57. PS3.Extension.WriteInt32(elem + hud.clientNum, clientIndex);
  58. PS3.Extension.WriteInt32(elem + hud.text, G_LocalizedStringIndex(text));
  59. PS3.Extension.WriteFloat(elem + hud.x, x);
  60. PS3.Extension.WriteFloat(elem + hud.y, y);
  61. PS3.Extension.WriteInt32(elem + hud.font, font);
  62. PS3.Extension.WriteFloat(elem + hud.fontScale, fontScale);
  63. PS3.SetMemory(elem + hud.color, new byte[] { Convert.ToByte(r), Convert.ToByte(g), Convert.ToByte(b), Convert.ToByte(a) });
  64. PS3.SetMemory(elem + hud.glowColor, new byte[] { Convert.ToByte(r1), Convert.ToByte(g1), Convert.ToByte(b1), Convert.ToByte(a1) });
  65. PS3.Extension.WriteInt32(elem + hud.type, 1);
  66. PS3.Extension.WriteInt32(elem + hud.active, 1);
  67.  
  68.  
  69. }
  70. public static void spawnShader(int clientIndex, int index, int material, float x, float y, int width, int height, int r, int g, int b, int a)
  71. {
  72.  
  73. uint elem = Addresses.G_HudElems + (uint)index * 0xBC;
  74. PS3.Extension.WriteInt32(elem + hud.clientNum, clientIndex);
  75. PS3.Extension.WriteInt32(elem + hud.material, material);
  76. PS3.Extension.WriteFloat(elem + hud.x, x);
  77. PS3.Extension.WriteFloat(elem + hud.y, y);
  78. PS3.Extension.WriteInt32(elem + hud.width, width);
  79. PS3.Extension.WriteInt32(elem + hud.height, height);
  80. PS3.Extension.WriteInt32(elem + hud.height, height);
  81. PS3.Extension.WriteInt32(elem + hud.height, height);
  82. PS3.SetMemory(elem + hud.color, new byte[] { Convert.ToByte(r), Convert.ToByte(g), Convert.ToByte(b), Convert.ToByte(a) });
  83. PS3.Extension.WriteInt32(elem + hud.type, 4);
  84. PS3.Extension.WriteInt32(elem + hud.active, 1);
  85.  
  86.  
  87. }
  88.  
  89. public static void changeText(int Elem, string text)
  90. {
  91. uint elem = Addresses.G_HudElems + (uint)Elem * 0xBC;
  92. PS3.Extension.WriteInt32(elem + hud.text, G_LocalizedStringIndex(text));
  93. }
  94.  
  95.  
  96. public static uint GetLevelTime()
  97. {
  98. return PS3.Extension.ReadUInt32(Addresses.leveltime);//this is updated?
  99. }
  100.  
  101. public static uint MoveOverTime(int Elem, short Time, float X, float Y)
  102. {
  103. uint elem = Addresses.G_HudElems + ((uint)Elem) * 0xBC;
  104. PS3.Extension.WriteFloat(elem + hud.fromX, PS3.Extension.ReadFloat(elem + hud.x));
  105. PS3.Extension.WriteFloat(elem + hud.fromY, PS3.Extension.ReadFloat(elem + hud.y));
  106. PS3.Extension.WriteInt32(elem + hud.moveTime, Time);
  107. PS3.Extension.WriteInt32(elem + hud.moveStartTime, (Int32)GetLevelTime());
  108. PS3.Extension.WriteFloat(elem + hud.x, X);
  109. PS3.Extension.WriteFloat(elem + hud.y, Y);
  110. return (uint)Elem;
  111. }
  112.  
  113. public static uint MoveYOverTime(int Elem, short Time, float Y)
  114. {
  115. uint elem = Addresses.G_HudElems + ((uint)Elem) * 0xBC;
  116. PS3.Extension.WriteFloat(elem + hud.fromY, PS3.Extension.ReadFloat(elem + hud.y));
  117. PS3.Extension.WriteInt32(elem + hud.moveTime, Time);
  118. PS3.Extension.WriteInt32(elem + hud.moveStartTime, (Int32)GetLevelTime());
  119. PS3.Extension.WriteFloat(elem + hud.y, Y);
  120. return (uint)Elem;
  121. }
  122.  
  123. }
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement