scalePhone - an iFruit Phone framework

Glad you like it! If you find any issues, let me know

1 Like

What’s the interior you are in the screen? it’s very cool :sunglasses:

That’s the GTA Online apartment on Alta St

1 Like

It’s not possibile to create custom icons for this phone right?

It…is possible to change the existing icons. You can stream a modified version of the phone’s .YTD file, and modify the icons there. I might include it in a future update.

1 Like

Ok if I will work on it I will send you in private to save time :blush:

And about add new icons, this is the problem right? I was looking for create like a second page of apps

At the moment, you can’t add more than 9 apps on the homepage. I’m still thinking of a way to increase that, but at the moment, you can use the “More Apps” menu, to add additional apps.

1 Like

Ok perfect this is great! :heart_eyes: Sorry for all this questions, but at moment is not possibile for example send a photo to someone right? (Messages, or something like social network)

It kinda is supported already.

Both the message and email view support texture loading, buuuuttttttt, you will have to load the image texture somehow, maybe with CreateRuntimeTextureFromDuiHandle - Natives @ Cfx.re Docs, then add that image into the text with html, like this: <img src='img://textureDirectory/textureName' height='128' width='244'/>

This post shows how scaleforms support html: Using HTML, images and blips in scaleform/texts

With the DUI, and some external Snapmatic image host, you can technically send images to other users, but you will need to create a messaging back-end that supports that. It should work, but I have not clue how to load external images.

1 Like

Update:


— Framework:

  • Added menu support for emailView and messageView templates. You now need to build them like this:
    TriggerEvent('scalePhone.BuildMessageView', {contact = "contact", message = "message", isentthat = false--[[or true]], canOpenMenu = false--[[or true]], selectEvent = "eventName"}, appID)
    
    TriggerEvent('scalePhone.BuildEmailView', {title = "title", from = "from", to = "to", message = "message", canOpenMenu = true--[[or false]], selectEvent = "eventName"}, appID)
    
    Just like the callscreen app, having canOpenMenu as true will let the user trigger selectEvent event with all app data as the param. You can find a working example in crit-phone.
  • On emailView, to param is now used, but keep in mind that the text gets truncated very fast. It’s probably not meant for text. Also, the “from:” hardcoded text is now removed.
  • Added support for finding and removing individual buttons. You can now use ‘scalePhone.RemoveButtonUsingData’ event, like this:
    TriggerEvent('scalePhone.RemoveButtonUsingData', {appID = "test", dataSample = "random String"})
    
    It will look through all the buttons inside the “test” appID, trying to find any value in “eventParams” matching the data sample. (dataSample can be the entire “eventParams” array too). You can find a working example in crit-phone.
  • Added findButtonIdUsingData(appID, sampleData) function export, for advanced use. It will return the found buttonID, or nil if no button was found (along with an error in client console).
  • Added reorderAppButtons(appID) function export, for advanced use. It will refresh the buttons list of appID, making sure the are no nil IDs.


— crit-phone:

  • You can now reply to messages directly, call the other person from the message menu, or delete the message.
  • numpadNumber variable should be a real number now.

If you are using the crit-phone resource, make sure that both the scalePhone framework, and crit-phone are updated. Please, let me know if you find any issues.

1 Like

Pretty nice project, mayb I’m going to use it with salty chat. Hope you’re going to update it

1 Like

Small Update:
— Framework:

  • Fix: You should no longer receive nil errors in console when pressing “select” inside empty menus.

  • Added a “tv” type app. Works exactly like the GPS app. No data or buttons required. Use “left” and “right” inputs to switch channels.

    TriggerEvent('scalePhone.BuildApp', appID, "tv", appName, appIcon, 0, "openEvent", "scalePhone.GoBackApp", {backApp = appID})
    

    This is mostly me testing ways to switch between the phone scaleform and other renders, in a way that will not break, desync or slow down the framework. So far, it works great, which means that I might implement a DUI app too…someday

DUI? I think you’re not talking about a “direct render ui”?

I do, actually. kgv-phone had a full browser implementation, so it does work. I think having a youtube player app template, for example, would be nice.

yeah, but the handling could be better. Always when I tried to go one page back, I had to reopen the whole browser

Another Update:
— Framework:

  • added exports.scalePhone:setPhoneDimensions(text, scale, x, y, z) export to set the phone frontend dimensions. text param can be “default”, “custom”, “small”, “large” or “huge”. when text == “custom”, scale, x, y, z params are used to set the phone dimensions. Check crit-phone resource for an example how it’s used.
  • added exports.scalePhone:getPhoneDimensions() export . It returns scale, x, y, z variables.
  • added exports.scalePhone:isPhoneOpened() export to check if the phone is currently opened. Returns boolean.
  • added exports.scalePhone:canPhoneBeOpened() export to check if the phone can be opened (either using the input, or by force-opening an app). Returns boolean.
  • added exports.scalePhone:shouldPhoneBeOpened(bool) export to set if the phone can be opened. You should be able to use this in some sort of “inventory” script.
  • I did some testing is event cancellation. It’s not really ready yet.

— crit-phone:

  • Added “Phone Size” option in the settings app.

Notes:

  • I’m working on a way to add custom wallpapers without having the user modify the framework. When it’s done, it should work with native or streamed .ytd, regular streamed .png files or DUI images directly.

If you have any questions, concerns or requests, let me know.

Any chance of a sim system like gcPhone? I love this phone but for roleplay will be great for example a number with sim that you can change