👔 Colorways
Documentation relating to the jo_clothingstore_colorways add-on for Clothing store script.
1. Installation
WARNING
Clothing store script is required to use this add-on
To install jo_clothingstore_colorways:
- Drag and drop the resource into your resources folder
- jo_clothingstore_colorways
- Add this ensure in your server.cfg after
ensure jo_clothingstoreensure jo_clothingstore_colorways
Congratulation, the Colorways add-on is ready to be used!
2. Usage
- Go in a clothing store and press
Config.keys.colorways(default :C) to open the colorways menu - New color variations will be added to the current item variations slider
3. Configuration
The configuration file is config.lua in the resource root. Do not edit this file directly as your changes may be lost during updates. Instead, use overwriteConfig.lua to store your customizations.
config.lua- Default configuration maintained by developers. Do not modify this file.overwriteConfig.lua- This is where you place only the values you want to override.
How to customize the configuration
- Open
/overwriteConfig.lua - Find the value you want to change in
config.lua(e.g.,Config.language) - Copy only that line into
overwriteConfig.lua - Edit the copied value to your liking
The script loads config.lua first, then overwriteConfig.lua overwrites only the values you redefine. This ensures your customizations are preserved when updating the script.
Language Configuration
The script supports full translation through the language system. To override any text:
- Find the key you want to change in
config/_default.lock/lang.lua - Copy
lang.luatoconfig/custom/and add only the keys you want to override
Example:
Lang.colorways = "Цветовая гамма"
Lang.customColor = "Пользовательский цвет"
Lang.noPalette = "Вы не можете получить доступ к цветовой гамме"Available translation categories include:
- General UI & Common Terms
- Palettes names
💡Only change the key you need to translate
You only need to include the specific keys you want to change in config/custom/lang.lua. Don't copy the entire language file if you don't need to.
4. For developers
Actions
Actions are one of the two types of Hooks. They provide a way for running a function at a specific point in the execution of scripts. Callback functions for an Action do not return anything back to the calling Action hook. They are the counterpart to Filters.
Below is a complete list of all available actions in the jo_clothingstore script.
Client init
Triggered when the addon is initialized
exports.jo_clothingstore_colorways:registerAction('init', function()
-- Your code here
end)Filters
Filters allow you to modify data or permissions synchronously at specific points in the script. Below is the complete list of jo_clothingstore filters and how to use them.
Client canOpenColorPalette
Manage who can open the custom color menu
-- @param canAccess - boolean
exports.jo_clothingstore_colorways:registerFilter('canOpenColorPalette', function(canAccess)
--return false to disable the access of the menu
return canAccess
end)Client paletteValues
Manage the values of the palettes
-- @param values - table
exports.jo_clothingstore_colorways:registerFilter('paletteValues', function(values)
-- manipulates values to add/remove/replace data and return new palettes values
return values
end)Client updateHashpreviewBeforeBuy
Update hash preview before buying
-- @param hashpreview - table
-- @param currentData - table
exports.jo_clothingstore_colorways:registerFilter('updateHashpreviewBeforeBuy', function(hashpreview,currentData)
return hashpreview
end)