I am trying to get working this function: GetScaleformMovieCursorSelection
I have tried the following scaleformIds: MP_RESULTS_PANEL, COLOUR_SWITCHER_02, MP_NEXT_JOB_SELECTION No luck working for me
I am aware I need to enable the following controls: 239, 240, 237, 238
I’ve been searching on internet for a way to get GetScaleformMovieCursorSelection
working, however may failed attempts. My guess is that I’m using wrong scaleformId/missing code/wrong padIndex.
If someone could help me get this working for c# that would be awesome!
Here is the code I want to get working:
public Main()
{
initScaleform();
Tick += tickTask;
}
private async Task tickTask()
{
scaleFormTest();
await Task.FromResult(0);
}
Scaleform scaleform = new Scaleform("SC_LEADERBOARD");
bool hasScaleForm = false;
private void initScaleform()
{
scaleform = new Scaleform("SC_LEADERBOARD");
int padIndex = 1;//0 is correct padIndex?
EnableControlAction(padIndex, 239, true);
EnableControlAction(padIndex, 240, true);
EnableControlAction(padIndex, 237, true);
EnableControlAction(padIndex, 238, true);
}
private void scaleFormTest()
{
if (!hasScaleForm)
{
hasScaleForm = HasScaleformMovieLoaded(scaleform.Handle);
}
else
{
int eventType = 0;
int itemId = 0;
int context = 0;
OutputArgument _eventType = new OutputArgument();
OutputArgument _context = new OutputArgument();
OutputArgument _itemId = new OutputArgument();
OutputArgument _itemId2 = new OutputArgument();
bool success = Function.Call<bool>(Hash._GET_SCALEFORM_MOVIE_CURSOR_SELECTION, scaleform.Handle, _eventType, _context, _itemId);
if (success)
{
eventType = _eventType.GetResult<int>();
itemId = _itemId.GetResult<int>();
context = _context.GetResult<int>();
}
string result = "check " + success + " eventType " + eventType + " itemid " + itemId + " context " + context;
drawText(result, 0, 0.5f, 1, 2, Color.FromArgb(255, 255, 255, 255));
//Debug.WriteLine(result);
}
}
public void drawText(string text, float x, float y, float scale, int font, Color col)
{
SetTextFont(font);
SetTextScale(scale, scale);
SetTextColour(col.R, col.G, col.B, col.A);
SetTextDropShadow();
SetTextWrap(0.0f, 1.0f);
SetTextEntry("STRING");
AddTextComponentString(text);
EndTextComponent();
DrawText(x, y);
}