[免费] [独立] 现代UI界面

:artist_palette: 现代界面 (s4_ui) – 为您的整个服务器提供统一的界面层

服务器上的所有通知、对话框、菜单和进度条 – 统一外观,统一API,零依赖。

直接放入即可,所有脚本使用相同的视觉语言。无需React运行时。无需数据库。无需框架锁定。如果您已经运行 ox_lib,s4_ui 可以渲染其 全部 界面,而无需触碰 ox_lib 或任何调用它的脚本。

ensure s4_ui
ensure ox_lib

:sparkles: 为什么选择 s4_ui?

  • :puzzle_piece: 12个组件,一个导出API – 通知、菜单、对话框、技能检查、径向菜单等
  • :repeat_button: ox_lib接管 – 一行代码即可重新设计整个服务器,无需修改
  • :artist_palette: 完全可定制和可重新定位 – 任何内容都不是硬编码的
  • :memo: 通知和菜单中的Markdown – 粗体、代码、链接和列表
  • :hand_with_fingers_splayed: 玩家UI编辑器 (/editui) – 玩家可以自定义自己的HUD,每个玩家保存设置
  • :high_voltage: 0.00ms空闲 – 无帧轮询,无数据库,独立运行

:puzzle_piece: 组件

组件 导出 返回
通知 notify 提示ID
文本UI textUI –
进度条 progress 完成状态 (布尔值)
圆形进度条 circleProgress 完成状态 (布尔值)
技能检查 skillCheck 成功状态 (布尔值)
警告对话框 alert '确认' / '取消' / nil
输入对话框 input 值数组 / nil
上下文菜单 context 选择项
列表菜单 menu {选中项, 值}
径向菜单 radial –
复制板 clipboard –
缓存 (onCache风格) getCache + 事件 值

所有内容均可定制和重新定位 – 任何内容都不是硬编码的。


:repeat_button: ox_lib接管 – 两行代码即可重新设计整个服务器

确保 s4_ui 在 ox_lib 之前加载,并且所有 lib.notify、lib.progressBar、lib.showContext、lib.inputDialog、lib.skillCheck 等内容都以 s4_ui 渲染 – 无需修改 ox_lib 和调用它的脚本。

ensure s4_ui
ensure ox_lib

ox_lib中的其他内容 – 回调、区域、点、本地化、cache、数学和表格辅助功能 – 保持不变且继续工作。Font Awesome 图标名称会自动翻译为其 Boxicons 对应版本,以便现有脚本保留图标。每个模块可以在配置中单独交还给 ox_lib。


:memo: Markdown & 每次调用样式

文本字段渲染Markdown – 粗体、斜体、内联代码、链接、列表、标题和换行 – 在通知、Text UI、对话框和菜单中。

exports.s4_ui:notify({
    title   = 'Sale complete',
    message = 'Sold **Sultan RS** for `$45,000`.',
})

notify、textUI 和 alert 还接受一个 style 表来重新设置单个调用,而无需触碰CSS – camelCase属性、直接数字作为像素、支持嵌套选择器:

exports.s4_ui:notify({
    title   = 'Custom',
    message = 'One-off look.',
    style   = {
        backgroundColor  = '#141517',
        color            = '#f8f9fa',
        borderRadius     = 14,
        ['.description'] = { color = '#909296' },
    },
})

:hammer_and_wrench: 开发者API

-- Blocking exports return their value directly - no callback wiring
local answer = exports.s4_ui:alert({ title = 'Confirm', message = 'Are you sure?' })
local ok     = exports.s4_ui:skillCheck({ difficulty = 'medium', key = 'e' })
local values = exports.s4_ui:input({ title = 'Details', fields = { ... } })
  • 菜单和径向菜单上的每个项目的 onSelect / onChange 回调
  • 与ox_lib兼容的字段名称 – 大多数代码片段无需修改即可迁移
  • 客户端和服务器事件,用于跨资源触发
  • Text UI窗口属于打开它的资源,因此另一个脚本的清理循环无法关闭您的提示

:hand_with_fingers_splayed: 玩家UI编辑器

内置 /editui 命令。玩家可以在对齐网格上拖动、调整大小和定制每个元素,布局会使用FiveM KVP 在玩家自己的机器上按每个玩家保存。无需数据库,服务器端无需任何操作。


:high_voltage: 性能

空闲状态 0.00ms
活跃状态 (通知/菜单打开) 0.01ms
线程 一个共享缓存轮询 (可配置,默认200ms)
数据库 无需
框架 Standalone
构建 Cerulean,Lua 5.4

UI层中没有每帧轮询循环。单个共享缓存线程取代了其他资源会自行运行的 while true / Wait(500) 循环。


:framed_picture: 预览 (使用接管功能)

🔔 Notifications

💬 Text UI

图片[1]-[免费] [独立] 现代UI界面-Fivem论坛
图片[2]-[免费] [独立] 现代UI界面-Fivem论坛

⏳ Progress bar

⭕ Circular progress

🎯 Skill check

⚠️ Alert dialog

⌨️ Input dialog

📋 Context menu

📃 List menu

🎛️ Radial menu

🖐️ Player UI editor


:gear: 配置

一个文件 – config/shared.lua:

  • 主题颜色和暗/亮预设
  • 角落半径、UI缩放、动画速度
  • 字体和可选的UI声音钩子
  • 组件默认值 (位置、持续时间、难度)
  • 径向键绑定和编辑器命令
  • ox_lib接管 – 全局开启或按模块开启
  • Text UI所有权行为

:package: 安装

  1. 将 s4_ui 放入您的 resources/ 文件夹
  2. 在 server.cfg 中添加 ensure s4_ui,在它之前加载任何使用它的资源
  3. 启动服务器 – 您应该会看到:
[s4_ui] loaded - Modern UI by S4Development

:warning:正在使用ox_lib接管? s4_ui 必须在 ox_lib 之前加载。


:link: 链接

:shopping_cart: 下载 s4development
:books: 文档 Docs
:play_button: 视频 YouTube

代码可访问 否
基于订阅 否
代码行数(约) ~5,200
需求与依赖 无需 (ox_lib可选)
支持 是
查看英文原文 (Original)

:artist_palette: Modern UI (s4_ui) – One clean interface layer for your entire server

Every notification, dialog, menu and progress bar on your server – one look, one API, zero dependencies.

Drop it in and every script speaks the same visual language. No React runtime. No database. No framework lock-in. And if you already run ox_lib, s4_ui can render its entire interface for you – without touching ox_lib or a single script calling it.

ensure s4_ui
ensure ox_lib

:sparkles: Why s4_ui?

  • :puzzle_piece: 12 components, one export API – notify, menus, dialogs, skill check, radial & more
  • :repeat_button: ox_lib takeover – instant reskin of your whole server, no edits required
  • :artist_palette: Fully themeable & repositionable – nothing is hardcoded
  • :memo: Markdown everywhere – bold, code, links & lists inside notifications and menus
  • :hand_with_fingers_splayed: Player UI editor (/editui) – players theme their own HUD, saved per player
  • :high_voltage: 0.00ms idle – no per-frame polling, no database, standalone

:puzzle_piece: Components

Component Export Returns
Notifications notify toast id
Text UI textUI –
Progress bar progress completed (boolean)
Circular progress circleProgress completed (boolean)
Skill check skillCheck success (boolean)
Alert dialog alert 'confirm' / 'cancel' / nil
Input dialog input array of values / nil
Context menu context selection
List menu menu { selected, values }
Radial menu radial –
Clipboard clipboard –
Cache (onCache-style) getCache + events value

Everything is themeable and repositionable – nothing is hardcoded.


:repeat_button: ox_lib takeover – reskin your whole server in two lines

Ensure s4_ui above ox_lib and every lib.notify, lib.progressBar, lib.showContext, lib.inputDialog, lib.skillCheck and the rest renders as s4_ui – no edits to ox_lib and no edits to the scripts calling it.

ensure s4_ui
ensure ox_lib

Everything else in ox_lib – callbacks, zones, points, locales, cache, math and table helpers – is untouched and keeps working. Font Awesome icon names are auto-translated to their Boxicons equivalent, so existing scripts keep their icons. Each module can be handed back to ox_lib individually in the config.


:memo: Markdown & per-call styling

Text fields render markdown – bold, italics, inline code, links, lists, headings and line breaks – in notifications, Text UI, dialogs and menus.

exports.s4_ui:notify({
    title   = 'Sale complete',
    message = 'Sold **Sultan RS** for `$45,000`.',
})

notify, textUI and alert also take a style table to restyle a single call without touching CSS – camelCase properties, bare numbers as pixels, nested selectors supported:

exports.s4_ui:notify({
    title   = 'Custom',
    message = 'One-off look.',
    style   = {
        backgroundColor  = '#141517',
        color            = '#f8f9fa',
        borderRadius     = 14,
        ['.description'] = { color = '#909296' },
    },
})

:hammer_and_wrench: Developer API

-- Blocking exports return their value directly - no callback wiring
local answer = exports.s4_ui:alert({ title = 'Confirm', message = 'Are you sure?' })
local ok     = exports.s4_ui:skillCheck({ difficulty = 'medium', key = 'e' })
local values = exports.s4_ui:input({ title = 'Details', fields = { ... } })
  • Per-item onSelect / onChange callbacks on menus and radials
  • ox_lib-compatible field names – most snippets port over unchanged
  • Client and server events for cross-resource triggering
  • The Text UI window belongs to the resource that opened it, so another script’s cleanup loop can’t close your prompt

:hand_with_fingers_splayed: Player UI editor

Built-in /editui command. Players drag, resize and theme every element on a snapping grid, and the layout is saved per player using FiveM KVP on their own machine. No database, nothing server-side.


:high_voltage: Performance

Idle 0.00ms
Active (notification / menu open) 0.01ms
Threads One shared cache poll (configurable, default 200ms)
Database Not required
Framework Standalone
Build Cerulean, Lua 5.4

There is no per-frame polling loop in the UI layer. The single shared cache thread replaces the while true / Wait(500) loops other resources would each run themselves.


:framed_picture: Preview ( Takeover used )

🔔 Notifications

💬 Text UI

图片[1]-[免费] [独立] 现代UI界面-Fivem论坛
图片[2]-[免费] [独立] 现代UI界面-Fivem论坛

⏳ Progress bar

⭕ Circular progress

🎯 Skill check

⚠️ Alert dialog

⌨️ Input dialog

📋 Context menu

📃 List menu

🎛️ Radial menu

🖐️ Player UI editor


:gear: Configuration

One file – config/shared.lua:

  • Theme colours and dark/light presets
  • Corner radius, UI scale, animation speed
  • Fonts and optional UI sound hooks
  • Component defaults (position, duration, difficulty)
  • Radial keybind and editor command
  • ox_lib takeover – on/off globally or per module
  • Text UI ownership behaviour

:package: Installation

  1. Drop s4_ui into your resources/ folder
  2. Add ensure s4_ui to server.cfg, before any resource that uses it
  3. Start the server – you should see:
[s4_ui] loaded - Modern UI by S4Development

:warning: Using the ox_lib takeover? s4_ui must be ensured above ox_lib.


:link: Links

:shopping_cart: Download s4development
:books: Documentation Docs
:play_button: Video YouTube

Code is accessible No
Subscription-based No
Lines (approximately) ~5,200
Requirements & dependencies None (ox_lib optional)
Support Yes

本文资源搬运自 CFX.re FiveM 官方论坛,原作者:S4Development。原帖地址:https://forum.cfx.re/t/free-standalone-modern-ui-interface/5426235

THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容