ThymonA/menuv

How do I define a uuid to a menu?

iWanheda opened this issue · 4 comments

Didn't find it on docs...

UUID is always random and generated dynamically. UUID should only be used as a getter and shouldn't be set manually. UUID is used to identify a specific item or menu without checking them in dept.

UUID = U:UUID(),
is calling this:
function Utilities:UUID()
randomseed(GET_GAME_TIMER() + random(30720, 92160))
---@type number[]
local bytes = {
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255),
random(0, 255)
}
bytes[7] = bitwise(bytes[7], 0x0f, {{0,0},{0,1}})
bytes[7] = bitwise(bytes[7], 0x40, {{0,1},{1,1}})
bytes[9] = bitwise(bytes[7], 0x3f, {{0,0},{0,1}})
bytes[9] = bitwise(bytes[7], 0x80, {{0,1},{1,1}})
return upper(('%s%s%s%s-%s%s-%s%s-%s%s-%s%s%s%s%s%s'):format(
tohex(bytes[1]), tohex(bytes[2]), tohex(bytes[3]), tohex(bytes[4]),
tohex(bytes[5]), tohex(bytes[6]),
tohex(bytes[7]), tohex(bytes[8]),
tohex(bytes[9]), tohex(bytes[10]),
tohex(bytes[11]), tohex(bytes[12]), tohex(bytes[13]), tohex(bytes[14]), tohex(bytes[15]), tohex(bytes[16])
))
end

UUID is automatically handled by MenuV itself and shouldn't be done manually.

Can you write an example when you need to open an unknown menu?

Contact with dopamine#1337 on Discord, will close this issue for now.