illenium-appearance patch
How to apply the illenium-appearance patch Eleven Outfits needs: with the patch command or by pasting two blocks by hand, and how to check that it works.
Why it is needed
Out of the box, illenium-appearance does not expose what the catalog needs: the shop price, whether the player stands at a clothing shop, and a way to save an outfit into "My outfits". The patch adds that, plus the menu entry. It does not change anything illenium already does: it only adds new code.
| illenium-appearance file | What it adds |
|---|---|
server/server.lua | Three exports: GetClothingCost, IsNearShop and AddPlayerOutfit. |
client/client.lua | An Outfit catalog entry in the shop menu, shown only while outfit-catalog is running. |
Everything is in outfit-catalog/illenium-appearance-patch/:
| File | Used for |
|---|---|
outfit-catalog.patch | The patch, ready for the patch command (option A). |
manual/server_exports.lua | The server block to paste by hand (option B). |
manual/client_menu.lua | The client block to paste by hand (option B). |
README.md | This same guide, in short. |
LICENSE-illenium-appearance-MIT.txt | illenium-appearance's MIT license. |
Warning
Back up your illenium-appearance folder before you start. If anything goes wrong, restore it and try the other option.
Which option? If you run the official illenium-appearance (v5.7.0 or close), option A is a single command. If yours is heavily modified, you are on Windows without Git Bash, or the command fails, use option B: two paste jobs, about five minutes.
Option A: the patch command
Open a terminal inside your illenium-appearance folder (the one that contains server/ and client/) and run the dry run first. It changes nothing:
patch -p1 --dry-run < /path/to/outfit-catalog/illenium-appearance-patch/outfit-catalog.patch
If it prints this, everything fits:
checking file server/server.lua
checking file client/client.lua
Then apply it for real:
patch -p1 < /path/to/outfit-catalog/illenium-appearance-patch/outfit-catalog.patch
If it fails
| Message | What to do |
|---|---|
Line ending complaints or Hunk #1 FAILED on the dry run | illenium's files use Windows line endings (CRLF). Run the dry run again with --ignore-whitespace. |
Hunk FAILED even with --ignore-whitespace | Your illenium differs from the official one. Restore your backup (or delete any .rej and .orig files it left) and use option B. |
Reversed (or previously applied) patch detected | The patch is already applied. Answer n and do not apply it again. |
patch: command not found (Windows) | Use the Git Bash terminal from Git for Windows, which ships patch, or use option B. |
Option B: paste the blocks by hand
1. Server
- Open
illenium-appearance/server/server.lua. - Go to the end of the file. The last line is:
lib.versionCheck("iLLeniumStudios/illenium-appearance") - Paste the whole content of
manual/server_exports.luaright above that line.
It has to go in that exact file: it uses functions and variables that are local to server.lua (getMoneyForShop, getOutfitsForPlayer and outfitCache).
2. Client
- Open
illenium-appearance/client/client.lua. - Find the
OpenMenufunction and, inside it, theif menuType == "default" thenblock. - Locate the menu item that opens the shop (
event = "illenium-appearance:client:openClothingShop") and thefor i = 0, #outfitMenuItems, 1 doloop right after it. - Paste the content of
manual/client_menu.luabetween the two.
It should end up like this:
event = "illenium-appearance:client:openClothingShop",
args = isPedMenu
}
-- outfit-catalog: ready-made outfits to try on and buy
if not isPedMenu and GetResourceState("outfit-catalog") == "started" then
menuItems[#menuItems + 1] = {
title = "Outfit catalog",
description = "Ready-made outfits to try on and buy",
event = "outfit-catalog:client:open"
}
end
for i = 0, #outfitMenuItems, 1 do
menuItems[#menuItems + 1] = outfitMenuItems[i]
end
After patching
- Restart
illenium-appearance, thenoutfit-catalog. The safest moment is your next server restart: do not restart illenium while players are inside the clothing editor. - Check the server console. With a correct patch, this red message does not appear:
[outfit-catalog] illenium-appearance is not patched: apply outfit-catalog/illenium-appearance-patch/ (see its README) and restart both resources. - In game, at a clothing shop, the menu should show Outfit catalog.
Tip
The entry's text ("Outfit catalog" / "Ready-made outfits to try on and buy") lives in your illenium client/client.lua, not in the catalog's language files. To translate it, change title and description there.
The entry does not show in the ped menu (isPedMenu) or while outfit-catalog is stopped.
When you update illenium-appearance
Updating illenium-appearance overwrites server/server.lua and client/client.lua, so the patch is lost. Apply it again after every update (option A or B). If the catalog stops opening after an illenium update, this is almost always why.
License
illenium-appearance is MIT licensed, © 2021 snakewiz (full text in LICENSE-illenium-appearance-MIT.txt). The patch modifies its source files; the MIT notice must stay with any copy of illenium-appearance you distribute. outfit-catalog itself does not include any illenium-appearance code.