It's best to check first before putting too much work into code changes. Because otherwise you won't know beforehand if the feature will make it into the AddOn.
You can:
- open an issue (bug report, or feature request)
- start a discussion here or on ESOUI
- create a small draft PR
- 🍴 fork the latest dev branch (default)
- 🛠️ update your branch with your changes
- I recommend a rebase before you make the PR, like
git fetch --all
followed bygit rebase upstream/dev
upstream
usually means the main repository andorigin
is your fork- you can set the upstream like so:
git remote set-url upstream https://github.com/manavortex/FurnitureCatalogue.git
- or without setting the upstream:
git pull --rebase https://github.com/manavortex/FurnitureCatalogue.git dev
- I recommend a rebase before you make the PR, like
- 📬 send a PR pointing to the dev branch
- 🔎 check the changes
- you can still push changes into your branch, they will also be updated in your PR
- 🤝 merge PR into dev (or wait for merge)
- 🏁 You did it! Congratulations 🎉
- ⬇️ if you are a maintainer or you just like reading, you can continue with Recommended Release Flow
- ⭐ rebase (preferred)
- puts all changes on top of the latest code
- can be more difficult when there are many merge conflicts
- easier if you regularly
rebase
instead ofpull
to update your local repo
- merge
- creates a commit including the changes from the PR
- easier conflict resolution compared to
rebase
, if youpull
regularly
- squash
- combines all commits of the PR into one commit to the target branch
- useful if you want to combine many little commits that don't do much on their own
- 📦 dev
PR me
fork this
- the default branch used for staging
- regular PRs should always point to dev
- most PRs should always be merged into dev instead of master
- code here should be in working order so that it can be released at any time
- should never be behind master (except for maintenance updates)
- 🔐 master
- protected branch, for releases only
- release PRs should point to master (usually done by 🤖)
- maintenance commits like README updates can still be done directly on master, no problem (just update dev when you're done)
- 🤖 release/x.y.z
- generated by the bot and used to create a PR to
master
- automatically deleted after a release
- generated by the bot and used to create a PR to
- 🛠️ other branches
- can be used for new features and playing around
- usually it is a branch on your fork (origin repo)
- if it's just a hotfix, you can use dev directly on the upstream (main repo)
- clean master branch and the latest code is just like on ESOUI
- easier versioning, only master bumps versions
- easier release automation
- dev being up to date with master avoids people accidentally forking work in progress
- they can still do, but on purpose
The automated release flow has the phases: Prepare
, Package
and Publish
. We only have to take care of merging PRs from contributors 1️⃣, creating PRs to master 2️⃣ and merging release PRs from the bot 3️⃣ (see diagram above).
To get the full 🤖 bot experience you can follow the recommended steps:
- 📬 create a PR from dev to master - 2️⃣
- if you are not a maintainer, make the PR to dev instead (see udpate flow) - 1️⃣
- 🏷️ add label
actions:RELEASE
- 🏷️ also add
version:MAJOR
orversion:PATCH
if it applies
- 🏷️ also add
- ☑️ go through checklist in Release Template
- 📝 notes entered here make it into the changelog
- 🤝 merge PR into master (will trigger CreateReleasePR) - 2️⃣
- 🤖 the next few steps are automated:
- 🤖 version of main AddOn is increased in all relevant files
- 🤖 CHANGELOG is updated (if there are notes)
- 🤖 missing translation strings are generated
- 🤖 autocompletion definitions are generated
- 🤖 all lua files are formatted
- 🤖 updated files are commited
- 🤖 a temporary release branch is created like
release/1.0.0
- 🤖 a release PR is created, containing all necessary infos
- 🔎 check the release PR - 3️⃣
- 🔎 one last quick check to see if anything broke
- 🔎 the PR should not have the
actions:RELEASE
label, or else the bot might mistake it for steps 2-4 ⚠️ leave this PR note empty/unchanged, as it will not be updated in the changelogs- ⏪ if you missed anything better to just close it, then go back to step 1 with a new PR
- 🤝 merge the release PR into master (will trigger PackageRelease) - 3️⃣
- 🤖 only automated steps should follow now
- 🤖 the AddOn will be packaged into a release zip
- 🤖 a GitHub release with a version tag will be created and the zip added to it
- 🤖 PublishToESOUI is triggered
- 🤖 the AddOn and new changelog will be uploaded to ESOUI
- 🤖 the temporary release branch is deleted
- 🤖 the dev branch is synced with the master
- 🔎 quick check on ESOUI to see if it worked
- it has to be cleared by the ESOUI team before it shows up in Minion
- ⭐ feel free to edit the release description, if the autogenerated one is bad
- it contains detailed changes between the releases
- it does not show up on ESOUI, just on GitHub
-
Versioning:
-
major: breaking changes to SavedVars, API functions, the AddOn directory structure or just a lot of code changes altogether
- increases major version (eg.
$1.23.4 \to 2.0.0$ ) -
🏷️
version:MAJOR
- increases major version (eg.
-
minor: regular code changes
- increases minor version (eg.
$1.23.4 \to 1.24.0$ ) -
🏷️
version:MINOR
(no need to set it, it is the default version increase)
- increases minor version (eg.
-
patch: small incremental changes like DB updates
- increases patch version (eg.
$1.23.4 \to 1.23.5$ ) -
🏷️
version:PATCH
- increases patch version (eg.
-
AddonVersion:
- used by the game client to decide which dependency to load if two have the same name
- positive number like
$12345$
-
major: breaking changes to SavedVars, API functions, the AddOn directory structure or just a lot of code changes altogether
-
merge dev into master:
- means the current code of the dev branch will be merged with the current code in master and the changes will be written to the master
- it looks like this in a GitHub PullRequest:
-
base: master
⬅️compare: dev
-
If some other terms are unclear just feel free to ask and we'll add them here.
- the part below may be out of date in some sections
- but it also describes the local development process in more detail so it's worth a look
- the mentioned tools should be up to date and in working order (but there are no guarantees)
- scripts and deployment tools are now in the .scripts folder
- when in doubt, you can just talk to us
This is a guide that assumes you have little to no idea about coding, but want to help. If you know how to achieve the end results, feel free to skip any intermediary steps.
- an account at github.com (so if you burn out or go MIA, the next volunteer can take over from you)
- Notepad++ for file editing (trust me, it's so much better than regular notepad)
- VSCode is also a good alternative as it offers IDE and LuaDoc support
- git: https://git-scm.com/download/win.
- Install with default options, except for "chosing the default editor used by git" - you'll want to select notepad or notepad++
- a client. I'll walk you through how to use https://www.syntevo.com/smartgit/download/ here.
- sidTools: Required for datamining (getting the furniture items and recipes from code) https://www.esoui.com/downloads/info1210-sidTools.html
- LibDebugLogger: You probably already have this. It will make troubleshooting easier. https://www.esoui.com/downloads/info2275-LibDebugLogger.html
- DebugLogViewer: Lets you access LibDebugLogger's output. Alternatively, use https://sir.insidi.at/or/logviewer/ after reloadUI. (No, I'm kidding, don't do that.) https://www.esoui.com/downloads/info2389-DebugLogViewer.html
- Mer Torchbug (optional): Lets you run scripts inside ESO and display variables and even tables.
Alternatively, you can run LUA from chat by prefixing it with
/script
, but that is cumbersome. https://www.esoui.com/downloads/info2601-MerTorchbug-FixedandImprovedIngamevariableinspectormuchmore.html
To set up local dependencies/requirements, you can also run devUtils_setup.cmd
!
- go to https://github.com/manavortex/FurnitureCatalogue
- the "fork" button is on github, TOPRIGHT corner, directly below your avatar
- this will give you an own copy of my repository: https://github.com/yourusername/FurnitureCatalogue
- You need this because you can't write to mine, and I'm not turning it on for the general public. You push your changes to your copy, then create a pull request. I'll review and put it back into the main code base. :)
- For this, first delete all the files from the AddOn that you have installed via Minion. (The first step to developing the AddOn is to delete the AddOn!)
You can get there by pressing windows+R and executing the command
explorer %USERPROFILE%\Documents\Elder Scrolls Online\live\AddOns\FurnitureCatalogue
- In your browser on github, the green "code" button gives you an URL to copy.
It will look like
https://github.com/YOUR_USERNAME/FurnitureCatalogue.git
- Open smartgit. Use the default settings unless indicated otherwise.
- You're a non-commercial user.
- Style: You want "Working Tree", I think.
- Click "Clone a repo".
- Path: Click "browse", then open the explorer bar and enter
%USERPROFILE%\Documents\Elder Scrolls Online\live\AddOns\FurnitureCatalogue
. - URL: the one you copied from the browser in the step above.
- Minion: if you have automatic updates enabled you should tell it to ignore updates to FurnitureCatalogue while you're working on it
This allows you to fetch changes from my repository, in case we're working on this together.
- click Remote -> Add -> and enter
You don't need to know anything about programming but how to operate it, but this bit here is crucial. Fortunately, it's straightforward as well.
In LUA, everything is a table. Tables look like this:
local tbl = {
["Key"] = "Value",
}
- the key is how you access stuff in the table
- the value is the stored value
- keys are always left of the
=
tbl["Key"]
does the same thing astbl.Key
Your #1
cause of error will be commas. If Lua sees a line ending in a table, it assumes that more table will follow.
Within a table, any lines but the last must end with a comma:
local tblCorrect = {
key1 = "value1",
key2 = "value2
}
local tblWrong = {
key1 = "value1" -- missing comma here
key2 = "value2" -- ESO will complain about this line
}
local tbl3 = { }
The last line of a table need not end in a comma. Unlike JSON, LUA won't mind, though. On the top level however, tables must not be followed by a comma:
local tblOK = {
key1 = "value1",
key2 = "value2", -- trailing comma inside the table is ok
}
local tblWrong = {
key1 = "value1",
key2 = "value2"
}, -- trailing comma outside of tables is not ok
local tbl3 = { } -- ESO will complain about this line
- copy
Custom.example
toCustom.lua
- Run the command
/sidtools items show
or run/sidtools
and open the "ItemViewer" via menu - let it scan from Id Range
0
to200000
- type
/dumpfurniture
- Increment the nummeric value in both fields by 200k, rinse and repeat until the window shows up empty or you're bored
- when it's done, reload the UI via
reloadUI
For now, we will stay in Custom.lua so you can fuck around and find out. As for how to properly set up the files, see below.
- go to
../../SavedVariables/sidTools.lua
- the relevant entries are
furnitureRecipes
andfurniture
- fix up the items and recipes (see Fix up the items and Fix up the recipes below)
- copy them to the corresponding tables in your
data\Custom.lua
. You'll see differences in formatting – you need to make sure that the generated entries have the same format as the regular ones
- mark all the items
- for Notepad++ fastest way is to click the "-" on the left side and to select the collapsed region
- Press Ctrl+H (Search&Replace)
- Check "In selection"-box
- Select the third entry under "Search Mode": Regular expression
- Find what:
((?<=\] = )")|(",$)
- Replace with:
- alternative in 1 go, without affecting recipes
- Find what:
(?<=\[(\d+)\]\s*=\s*)"(\w+),\s*(--\s*.+)",$
- Replace with:
$2, $3
- Find what:
Result:
-- before:
[123456] = "rumourSource, -- Some, item",
-- after
[123456] = rumourSource, -- Some, item"
- mark all the recipes
- for Notepad++ fastest way is to click the "-" on the left side and to select the collapsed region
- Press Ctrl+H (Search&Replace)
- Check "In selection"-box
- Select the third entry under "Search Mode": Regular expression
- Find what:
\[|(\] = "rumourSource)|",$
- Replace with:
- alternative to do it in 1 go without affecting furniture
- Find what:
(?<=\[(\d+)\]\s*=\s*)"(\d+),\s*(--\s*.+)",$
- Replace with:
$1, $3
- Find what:
Result:
-- before:
[123456] = "123456, -- Plan: some, plan",
-- after
123456, -- Plan: some, plan
In FurnitureCatalogue\_Constants.lua
, add a line like this:
FURC_FOOBAR = FURC_LASTLINE+1 -- <number in previous line +1>
The thing on the left of the =
is your new entry. The thing on the right of the = is the value in the line below.
The comment on the right is to see the number at first glance if you Ctrl+F
for the constant.
In FurnitureCatalogue\locale\en.lua
, find the list that starts with SI_FURC_FILTER_VERSION_OFF
.
It should be around line 223.
Add SI_FURC_FILTER_VERSION_FOOBAR
at the end of the block (you can duplicate the previous line), and change the text.
Now, find the list that starts with SI_FURC_FILTER_VERSION_OFF_TT
. It should be around line 265 somewhere.
Add SI_FURC_FILTER_VERSION_FOOBAR_TT
at the end of the block (you can duplicate the previous line), and change the text.
In FurnitureCatalogue\startup.lua
, find FurC.DropdownData
around line 131.
At the bottom of each list, add a line with the constant from the previous step.
If you didn't make any mistakes, the new version entry should show up in the dropdown menus now. If it doesn't, check for spelling mistakes. If all menu entries are gone, you forgot a comma.
- Create a new lua file in the
data/
folder and give it a name that makes sense (after the AddOn). Please don't use spaces! - Open FurnitureCatalogue.txt and add an entry above
data\$(APIVersion).lua
, but after the other data files. This will tell the game to load it.
This file will hold the item database.
- Open data/Recipes.lua and create a new list with your constant as a key. Put the recipes in there.
- You're done.
- Find data/Rolis.lua and create a new list with your constant as a key. Create new table entries for each item in their inventory.
- The key is the item ID, and the value is the number of vouchers they want.
-- For example:
[159501] = 125, -- Praxis: Khajiit Sigil, Moon Cycle
-- This means that this blueprint costs 125 vouchers
- Open the git client of your choice. There should be a panel to the right.
- Next to "Unstaged changes", click "Stage all changes" or highlight single files and press the button there.
- Enter a commit message.
- Click the button below "Commit changes to
<num>
files". - Click "Push" in the UI.
- Open your github repository in your browser.
- Find the second tab "Pull requests" (ctrl+f if the UI confuses you)
- Click the green "new pull request" button
- Click on the link "compare across forks"
- On the left, select "manavortex/FurnitureCatalogue"
- On the right, select "yourusername/FurnitureCatalogue"
- Click "Create Pull Request"
- If you haven't heard from us (or there's a new FurC release) within a week, do get in touch to remind us
If you are running into any problems with FurC data, the answer is going to be "you're missing a comma" in 95% of all cases.
You're probably missing a comma in one of the data files. That will lead to the scan function failing and an empty database. To fix this, open DebugViewer and look for the first FurC related error you see.
1: Search for one of the preexisitng items in the table. Does it show up? Yes: Make sure that you got the nesting right. Everything needs to be on the right level. If you put entries into other entries, they'll be ignored. No: You're missing a comma.
If it's not a missing comma, it is probably improper nesting or an unterminated string. Use Notepad++ code folding to find the culprit, and look above the line where the error occurred.
- Make sure that your top level tables do not end with a comma.
Any table that's assigned (
= {
) needs to close in}
without a trailing comma. As soon as Lua sees a comma, it will expect more list items. If it gets an assignment instead, it will complain. - Make sure that every line inside your tables ends with a comma. When a line does not end with a comma, Lua expects the table to close now. If you've forgotten one, it will complain.
In the left margin of the text editor, you will see little -
icons that collapse a region. Do this, starting at the innermost level of tables, working your way up to the top. You will spot the one where you made a mistake.
Check if /script d(FurC)
shows an output. If it doesn't, then you (or I via remote debugging) managed to break something in the toplevel folder.
Use your git client to discard (or stash) any changes in the toplevel folder.