|
17 | 17 | local elementSizeBytes = 48 |
18 | 18 | local elementSizeBytesDPL = 112 -- bigger, isn't it? |
19 | 19 | local supportedVersion = {37049,37053,61862} |
| 20 | +local WiiVerMagic = 18000 |
20 | 21 | local typeNames = { |
21 | 22 | [1] = "Drawable", |
22 | 23 | [2] = "Reserved (on car)", |
@@ -50,7 +51,7 @@ function binaryHUDFile(buffer,ver) |
50 | 51 | Height = string.unpack("f",string.sub(buffer,15+8,64)), --720, |
51 | 52 | Elements = {} |
52 | 53 | } |
53 | | - print(string.format("Align: %d, Count: %d, Version: %d",align,count,HUD.Version)) |
| 54 | + print(string.format("Align: %d, Count: %d, Version: %d, Magic: %d",align,count,HUD.Version,HUD.Magic)) |
54 | 55 | local dpl = HUD.Version == 37053 or HUD.Version == 61862 |
55 | 56 | --local off = align |
56 | 57 | --[[ |
@@ -109,7 +110,7 @@ function binaryHUDFile(buffer,ver) |
109 | 110 | elseif HUD.Version == 37053 or HUD.Version == 61862 then |
110 | 111 | --print("DRIVER POROLOLELLAINES") |
111 | 112 | local fmt = elementFormatDPL |
112 | | - if HUD.Magic>=1800 then fmt = ">"..fmt end -- checks if it's Wii so we can make the order big-endian |
| 113 | + if HUD.Magic>=WiiVerMagic then fmt = ">"..fmt else fmt = elementFormatDPL end -- checks if it's Wii so we can make the order big-endian |
113 | 114 | r,g,b,a,x,y,w,h,input,unk1,sx,sy,unk2,unk3,id,flags,unk4,unk5,unk6,unk7,unk8,unk9,unk10,unk11,unk12,unk13,unk14,unk15 = string.unpack(fmt,string.sub(buffer,off,off+elementSizeBytesDPL+64)) |
114 | 115 | -- main |
115 | 116 | elemtable.Type = 0 |
@@ -168,7 +169,7 @@ function newBinaryHUDFile(HUD) |
168 | 169 | bin = string.pack(elementFormat,elemtable.Type, elemtable.Align,elemtable.Unk2,elemtable.Unk3,elemtable.Input,elemtable.ID,elemtable.X,elemtable.Y,elemtable.Width,elemtable.Height,elemtable.SizeX,elemtable.SizeY,elemtable.R,elemtable.G,elemtable.B,elemtable.A) |
169 | 170 | elseif HUD.Version == 37053 then |
170 | 171 | local fmt = elementFormatDPL |
171 | | - if HUD.Magic>=1800 then fmt = ">"..fmt end -- checks if it's Wii so we can make the order big-endian |
| 172 | + if HUD.Magic>=WiiVerMagic then fmt = ">"..fmt end -- checks if it's Wii so we can make the order big-endian |
172 | 173 | local r,g,b,a,x,y,w,h,input,unk1,sx,sy,unk2,unk3,id,flags,unk4,unk5,unk6,unk7,unk8,unk9,unk10,unk11,unk12,unk13,unk14,unk15 = elemtable.R, elemtable.G,elemtable.B,elemtable.A,elemtable.X,elemtable.Y,elemtable.Width,elemtable.Height,elemtable.Input,elemtable.Unk1,elemtable.SizeX,elemtable.SizeY,elemtable.Unk2,elemtable.Unk3,elemtable.ID,elemtable.Flags,elemtable.Unk4,elemtable.Unk5,elemtable.Unk6,elemtable.Unk7,elemtable.Unk8,elemtable.Unk9,elemtable.Unk10,elemtable.Unk11,elemtable.Unk12,elemtable.Unk13,elemtable.Unk14,elemtable.Unk15 |
173 | 174 | print(sx,sy,w,h) |
174 | 175 | print(id) |
@@ -392,9 +393,9 @@ local HelpMenu = ui.Menu() |
392 | 393 | win.menu:add("&Help").submenu = HelpMenu |
393 | 394 | local aboutButton = HelpMenu:add("&About\tF1") |
394 | 395 | local helpButton = HelpMenu:add("&How to Use") |
395 | | -local build = "Version 0.1B Oct. 31" --"Build October 27 9485" |
| 396 | +local build = "Version 0.1BA Oct. 31" --"Build October 27 9485" |
396 | 397 | function aboutButton:onClick() |
397 | | - ui.info("MADE IN BRAZIL\nMade with LuaRT Lua Framework v1.5.2\nAuthor: BuilderDemo7\nBeta Testers: NismoRacer00 & Sunrise_424\n\t"..build,"About") |
| 398 | + ui.info("Made with LuaRT Lua Framework v1.5.2\nAuthor: BuilderDemo7\nBeta Testers: NismoRacer00 & Sunrise_424\n\t"..build,"About") |
398 | 399 | end |
399 | 400 | win:shortcut("f1", aboutButton.onClick) |
400 | 401 | function helpButton:onClick() |
|
0 commit comments