Skip to content

Commit

Permalink
fix(client/scaleforms): Modular Apartment Select (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihyajb authored Feb 9, 2025
1 parent 6ec09c1 commit 4194c9e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions client/apartmentselect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,21 @@ local function SetupScaleform()
end

for i = StartingPoint, StartingPoint + 2 do
ScaleformMovieMethodAddParamTextureNameString(string.format('selection%s', i))
BeginTextCommandScaleformString('STRING')
AddTextComponentSubstringPlayerName(sharedConfig.apartmentOptions[i].label)
EndTextCommandScaleformString()
BeginTextCommandScaleformString('STRING')
AddTextComponentSubstringPlayerName(sharedConfig.apartmentOptions[i].description)
if sharedConfig.apartmentOptions[i] then
ScaleformMovieMethodAddParamTextureNameString(string.format('selection%s', i))
BeginTextCommandScaleformString('STRING')
AddTextComponentSubstringPlayerName(sharedConfig.apartmentOptions[i].label)
EndTextCommandScaleformString()
BeginTextCommandScaleformString('STRING')
AddTextComponentSubstringPlayerName(sharedConfig.apartmentOptions[i].description)
else
ScaleformMovieMethodAddParamTextureNameString('empty')
BeginTextCommandScaleformString('STRING')
AddTextComponentSubstringPlayerName('')
EndTextCommandScaleformString()
BeginTextCommandScaleformString('STRING')
AddTextComponentSubstringPlayerName('')
end
EndTextCommandScaleformString()
ScaleformMovieMethodAddParamInt(0)
end
Expand All @@ -120,9 +129,9 @@ local function SetupScaleform()

ScaleformMovieMethodAddParamInt(0)

ScaleformMovieMethodAddParamBool(true)
ScaleformMovieMethodAddParamBool(true)
ScaleformMovieMethodAddParamBool(true)
ScaleformMovieMethodAddParamBool(sharedConfig.apartmentOptions[StartingPoint])
ScaleformMovieMethodAddParamBool(sharedConfig.apartmentOptions[StartingPoint + 1])
ScaleformMovieMethodAddParamBool(sharedConfig.apartmentOptions[StartingPoint + 2])

-- Same "modular" bullshit here. Had no success with CURRENT_SELECTION nor CURRENT_ROLLOVER, not sure why.
for i = StartingPoint, StartingPoint + 2 do
Expand Down Expand Up @@ -243,4 +252,4 @@ RegisterNetEvent('apartments:client:setupSpawnUI', function()
StartScaleform()
SetupScaleform()
InputHandler()
end)
end)
Binary file modified stream/auto_shop_board.gfx
Binary file not shown.
Binary file modified stream/auto_shop_board_img.ytd
Binary file not shown.

0 comments on commit 4194c9e

Please sign in to comment.