[Release] [Free] [Standalone] TextUI! (momof-textui)

It’s 2022 what’s up with us using “[E]” everywhere? I made this resource to automatically convert all “[E]” or any other keys in square brackets to a cleaner looking keyboard key. This works with anything surrounded by the square brackets, eg, "[ALT] + [F4] to quit".

Installation: Drag + Drop and edit the config.lua! Instructions included for modifying qb-core and qb-doorlock too!

Documentation

Momof-TextUI Documentation

For easier access and ability for other developers to build on this, I have created a guide and exported events that are not used in the script for easier access building on top of the script.

Client Events

  • momof-textui:client:ShowText
    Sets the TextUI with the provided text, position, and theme. Omitting the position or theme will default to show on the left with the default theme
    Example Server Call: TriggerClientEvent('momof-textui:client:ShowText', src, 'Hello World!, 'left', 'default')
    Example Client Call: TriggerEvent('momof-textui:client:ShowText', 'Hello World!, 'left', 'default')

  • momof-textui:client:HideText
    Closes the current TextUI open.
    Example Server Call: TriggerClientEvent('momof-textui:client:HideText', src)
    Example Client Call: TriggerEvent('momof-textui:client:HideText')


Client Exports

  • ShowText
    Opens the TextUI with the provided text, at the position, with the theme. Omitting the position or theme will default to show on the left with the default theme
    Example Call: exports['momof-multijob']:ShowText('Hello World!, 'left', 'default')

  • HideText
    Closes the current TextUI open.
    Example Call: exports['momof-multijob']:HideText()


Script Transitions Instructions

QB-Core drawtext

After making this change, all default QBCore notifies will use this TextUI instead (this means you can use exports['qb-core']:DrawText(...) the same way you would exports['momof-multijob']:ShowText(...)). In qb-core > client > drawtext.lua replace the hideText, drawText, and changeText functions with the following:

local function hideText()
    exports['momof-textui']:HideText()
end

local function drawText(text, position, theme)
    exports['momof-textui']:ShowText(text, position, theme)
end

local function changeText(text, position, theme)
    exports['momof-textui']:ShowText(text, position, theme)
end

QB-Doorlock

This will change door locks to use this TextUI instead. I have also included the 3 default themes that come with qb-doorlock in the config. In qb-doorlock > client > main.lua replace the displayNUIText and hideNUI with the below:

local function displayNUIText(text)
  local themeName = Config.ChangeColor and (closestDoor.data.locked and "LockedDoorTheme" or "UnlockedDoorTheme") or "DefaultDoorTheme"
  exports['momof-textui']:ShowText(text, "left", themeName)
end

local function hideNUI()
  exports['momof-textui']:HideText()
end
Config
Config = Config or {}

-- This config determines if a enclosed key like `[E]` should automatically be displayed as a key in the UI. If you 
-- disable this, keys will be displayed as text.
Config.allowKBD = true

-- Theme Attributes:
-- backgroundColor: accepts RGB, RGBA, HEX, or HTML color codes and will be the background color of the UI.
-- color: accepts RGB, RGBA, HEX, or HTML color codes and will be the text color on the UI.
-- top: accepts percentage, or pixels and is the distance away from the top of the screen the notification will show up.

-- Global theme that will apply to all of the custom themes below. Custom themes with the same attributes overwrite the
-- global theme's attribute.
Config.globalTheme = {
  top = "40%",
}

-- Color themes for the text color and background color
-- WARNING: ALWAYS KEEP A DEFAULT THEME, you may modify it but make sure you have a theme that is named 'default'.
Config.themes = {
  ['default'] = {
    backgroundColor = 'rgba(23, 23, 23, 90%)',
    color = 'white',
  },
  ['DefaultDoorTheme'] = {
    backgroundColor = 'rgb(19, 28, 74)',
    color = 'white',
  },
  ['LockedDoorTheme'] = {
    backgroundColor = 'rgb(219 58 58)',
    color = 'white',
  },
  ['UnlockedDoorTheme'] = {
    backgroundColor = 'rgb(27 195 63)',
    color = 'white',
  },
}

Screenshot:
Tebex Image

Features:

  • Open source client code, comes with compiled JavaScript. Payment is NOT needed, very customizable without it!
  • Free (Type in $0.00 for price and it’s completely free!)
  • Configurable (You can even add your own themes!)
  • Optimized
  • Free updates and support
  • Drag and drop easy installation
  • Includes instructions for updating QB-Core DrawText and QB-Doorlock to work with it!
  • Custom written React front-end which you can buy for super cheap if you want to mess with it, or just learn!

Dependencies:

  • None

Open source, but can buy the React project too!
Showcase Video: Video
Pay what you want (Put 0.00 to get it Free): Tebex
Source + React: Tebex $10

Code is accessible Yes
Subscription-based No
Lines (approximately) 40 client/ 200 React
Requirements None
Support Yes
4 Likes

Goated!! This is clutch, thanks bro!

1 Like
  • Open Source

Source + React: Tebex $10

Hmm, something contradicts here

3 Likes

Something is wrong here, it says [ Standalone ] and than [ FREE ] or im seeing the worng thing.

The client lua is open source, and it comes with a compiled version of the javascript. The bottom option allows you to buy the react project that was used to build it. TBH if anyone reached out and wanted it for learning purposes I’d hand it out for free, idrc, just thought most poeple would want it pre-compiled and ready to use. Especially since I spent a bunch of time supporting custom styling from the config.

It might be slightly misleading, but it definitely was not my intentions

Not sure what you mean, I flipped them around in the title, is that what you meant?

So it’s not open source but source available if you are charging people for access. Open source would be software which is free with source access through a site like github

We got clickbaited :joy:

It is free and it is standalone? You can put $0.00 and get it free. The client code is open source, and the javascript is just compiled? Like I’m giving a free resource and you guys are still finding a way to complain. This blows my mind hahaha

Amazing resource, appreciate everything you share!

2 Likes

Oh sorry my bad, first i saw Tebex $10 and i thinked that its not free and you miss typed the title.

You’re paywalling your jsx, that’s the opposite of open source. This upsets me greatly

No worries :slight_smile: