Skip to content

refactor: integrate global Medal.tv auto-clipping & remove local implementation#115

Open
rwixy wants to merge 2 commits into
esx-framework:1.14.1from
rwixy:esx_ambulancejob-medal-fix-clean
Open

refactor: integrate global Medal.tv auto-clipping & remove local implementation#115
rwixy wants to merge 2 commits into
esx-framework:1.14.1from
rwixy:esx_ambulancejob-medal-fix-clean

Conversation

@rwixy

@rwixy rwixy commented Jul 18, 2026

Copy link
Copy Markdown

Description

Removes the local, standalone Medal.tv auto-clipping assets and scripts from esx_ambulancejob and refactors the death clip trigger to consume the centralized global xLib.medal module.


Motivation

Previously, esx_ambulancejob maintained its own local NUI files (html/medal.html, html/medal.js), dedicated client script (client/medal.lua), and duplicate configuration blocks to handle saving clips upon player death. Centralizing the Medal.tv functionality inside esx_lib allows esx_ambulancejob to decouple itself from standalone clip logic, cleaning up the resource structure and aligning with the global library standards.


Implementation Details

  • Cleaned Assets: Deleted local NUI files html/medal.html and html/medal.js and removed their declarations from fxmanifest.lua.

  • Script Removal: Deleted client/medal.lua and removed its reference.

  • Centralized configuration: Removed the Config.Medal configuration block from config.lua to prevent configuration redundancy.

  • Library Import: Added @esx_lib/imports.lua to shared_scripts in fxmanifest.lua to give the resource access to the global xLib helper modules.

  • Refactored Death Clip: Simplified TriggerMedalDeathClip() in client/main.lua to call xLib.medal.triggerClip() without arguments, offloading all clip invocation, API details, and default settings to esx_lib.


Usage Example

-- TriggerMedalDeathClip has been simplified to delegate directly to the global esx_lib API
function TriggerMedalDeathClip()
  xLib.medal.triggerClip()
end

PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

@rwixy
rwixy changed the base branch from main to 1.14.1 July 19, 2026 06:00
@rwixy
rwixy force-pushed the esx_ambulancejob-medal-fix-clean branch from 354af31 to c32dfbe Compare July 21, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant