mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
add basic support for RedM (RSGCore)
This commit is contained in:
@@ -78,6 +78,47 @@ function makeInstructionalButtons(info)
|
||||
DrawScaleformMovieFullscreen(build, 255, 255, 255, 255, 0)
|
||||
end
|
||||
|
||||
-- EXPERIMENTAL --
|
||||
-- RedM Button Prompts --
|
||||
-- Creates the promot, then shows it, this needs to be run in a loop
|
||||
local promptGroups = {}
|
||||
|
||||
function makeRedInstructionalButtons(info, title)
|
||||
if not promptGroups[title] then -- Create group if not exists
|
||||
promptGroups[title] = {
|
||||
title = CreateVarString(10, 'LITERAL_STRING', title),
|
||||
id = GetRandomIntInRange(0, 0xffffff),
|
||||
prompts = {},
|
||||
}
|
||||
for i = 1, #info do
|
||||
promptGroups[title].prompts[i] = {
|
||||
keys = info[i].keys,
|
||||
text = info[i].text,
|
||||
}
|
||||
local keyTitle = CreateVarString(10, 'LITERAL_STRING', info[i].text)
|
||||
-- Create one prompt per entry
|
||||
local promptSet = UiPromptRegisterBegin()
|
||||
-- Register all keys for this prompt
|
||||
for k = 1, #info[i].keys do
|
||||
PromptSetControlAction(promptSet, info[i].keys[k])
|
||||
end
|
||||
PromptSetText(promptSet, keyTitle)
|
||||
PromptSetEnabled(promptSet, true)
|
||||
PromptSetVisible(promptSet, true)
|
||||
PromptSetGroup(promptSet, promptGroups[title].id)
|
||||
PromptRegisterEnd(promptSet)
|
||||
end
|
||||
end
|
||||
PromptSetActiveGroupThisFrame(promptGroups[title].id, promptGroups[title].title)
|
||||
end
|
||||
|
||||
onResourceStop(function()
|
||||
for k, v in pairs(promptGroups) do
|
||||
print("^5GTAUI^7: ^2Removing Prompt Group^7: ^3" .. k .. "^7")
|
||||
PromptDelete(promptGroups[k].id, 1)
|
||||
end
|
||||
end, true)
|
||||
|
||||
-------------------------------------------------------------
|
||||
-- Debug Text Display Functionality
|
||||
-------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user