Download
(28 Kb)
Download
Updated: 09/02/20 02:55 PM
Pictures
File Info
Compatibility:
Stonethorn (6.1.5)
Updated:09/02/20 02:55 PM
Created:10/14/19 10:49 PM
Monthly downloads:535
Total downloads:27,543
Favorites:32
MD5:
XL Gear Banker  Popular! (More than 5000 hits)
Version: 1.0.2
by: XL_Olsen [More]
Contact me for any questions and/or feedback (Either on ESOUI or directly through ingame whisper/mail @XL_Olsen on PC EU).

Description

XL Gear Banker (XLGB) is an ESO addon that strives to combat the tedious task of moving all your gear to another character.
Got multiple healer characters? Multiple tanks? DDs? This addon might be for you!

Before XLGB:
  • Log into character with the gear you need.
  • Go to bank or house storage chest
  • For every gear piece you need, find it in your inventory and manually put it into bank/chest.
  • Log into character that needs the gear.
  • Go to bank or house storage chest
  • For every gear piece you need, find it in your bank/chest and manually withdraw it from the bank/chest.
After XLGB:

- Step 3: Use UI or keybind to deposit all gear pieces at once.
- Step 6: Use UI or keybind to withdraw all gear pieces at once.

One button! Easy!

Demo gif showing XLGB in action! v0.9.3 (NOTE: This is now outdated! This version only had 'sets', but now there's the notion of both sets AND pages - concept similar to dressing room.)

Dependencies

This addon uses the following libraries:

- LibCustomMenu
- LibDialog
- LibShifterBox
- LibAddonMenu2-0

These libraries are required to run the addon.


Known Issues


Changes - Version 1.0.2
  • Option to open 'Page' and 'Set' windows when bank opens.
  • Resizing the 'Set' window.
  • Minor bugfixes



How to use the addon


Browsing sets
  • Open your chat and type in '/xlgb' to bring up the UI.
  • Use the arrows to browse your current sets

Edit sets (change name/remove items from set)
  • Open your chat and type in '/xlgb' to bring up the UI.
  • Press the edit icon (pen and paper thingy)
    • Now you can edit the name label to a choice of your own! (Press the label and edit away!)
    • Add items you currently wear using the button that states it does literally this.
    • Remove items using the 'X' icon to the right of the item you want removed. (If you regret your choice, you can discard your changes!)
  • Now you have a choice:
    • Discard changes by clicking the "cancel icon" that replaced the edit icon. (If you've made changes a dialog will pop up to confirm)
    • Accept changes by clicking the "accept icon". (If you've marked items for removal a dialog will pop up to confirm)
    • Remove the set by click the "minus icon". (If the set is not empty a dialog will pop up to confirm)

Adding new sets
  • Open your chat and type in '/xlgb' to bring up the UI.
  • Use the '+' to add a new set.
  • You now enter 'edit' mode. (Look above for explanation)

Removing sets

See "Edit sets" above at (3.3).

Add items to a gear set

(New in version 0.9.3+)
You can now add all your currently equipped items by opening the ui with "/xlgb", press the edit icon, and press the button "Add equipped items to set".

If you have atleast 1 set you can right-click any armor or weapon in your bank, inventory or even equipped items, an extra item in the drop-down menu will appear reading 'XLGB add >'.
If you hover over this menu you'll see all your sets, and if you click on of the sets the item you've right-clicked will be added to that set.

Remove items from a gear set

Accidentally added an item to the wrong set? Fear not!
As an alternative to removing items through the "edit mode" in the "/xlgb" UI I've kept the old way of removing items.
When an item belongs to a set a new menu item appears in the drop-down menu, similar to adding items, this menu item reads 'XLGB remove >'.
Clicking on one of the sets listed in the sub-menu will result in removing that gear piece from the set again.

Depositing/withdrawing gear

With UI 2.0 you can now deposit/withdraw currently displayed set directly through the UI! Open your bank/storage and the UI will appear with 2 buttons at the bottom of the UI saying "Deposit" and "Withdraw". These will deposit/withdraw the set you're currently looking at, easy as that! As an alternative to the UI, keybindings are also offered in keybindings menu that will deposit/withdraw specific sets.



List of slash_commands

/xlgb
Brings up the UI

/xlgb_debug
Toggles debug mode. (Note: quite verbose)

/xlgb_help
Prints out these commands in the chat.



Other
Github @ https://github.com/XLOlsen/XLGearBanker

Thanks to ESOUI wiki and other addon developers for inspiration, as this is my first ever addon, I've been reading through alot of code to get me started and help me write this addon.
Version 1.0.2
  • Option to open 'Page' and 'Set' windows when bank opens.
  • Resizing the 'Set' window.
  • Minor bugfixes

Version 1.0.1
  • Removed legacy keybinds
  • Minor bugfixes

Version 1.0.0 - UI Overhaul & Pages
  • Pages
  • Tooltips
  • Report of missing items (Items not found during withdraw/deposit)
  • Safe mode toggle (Turn off for good ol' fast withdraw/deposit that might get you server kicked)
  • Progress "loading" bar during withdraw/deposit
  • More UI changes (Hopefully you guys think it looks neat now as well)
  • Minor bugfixes

[size="4"]Version 0.9.3 - Add equipped items + Remove item rework
  • Added functionality for "Add equipped items to set". The button is visible during the "edit mode" in the UI.
  • Reworked item removal. Items are now removed in real time during "edit mode", the changes can be discarded still by pressing the "toggle edit" button again (or cycling left or right).

[size="4"]Version 0.9.1 - Hotfix
Fixed a bug where calculating amount of empty bagspaces was wrong. (This bug might also be the cause of not withdrawing/depositing all items in a set - awaiting further testing).

Version 0.9 - UI 2.0
Simplified alot of the ideas I had for this and got it down to two buttons "Deposit" and "Withdraw" that now appear when you open your bank/storage. These buttons will deposit the currently displayed set!
Other things:
  • Assign sets to storage now legacy feature
  • Adding new items to a set now sorts the set alphabetically. (To sort existing sets, just add an item and remove it again)
  • Button to toggle UI when Bank/Storage is open.
  • Fixed a bug where "Item amount" wouldn't update correctly when adding/removing items.



Version 0.8 - UI 1.0

Christmas is coming early with this new update (version 0.8). An XL change that alot of people I've talked to have asked for (including myself). The XLGB addon is getting its UI and is now not a complete mess to setup anymore! What this UI update includes is a UI that would help you track your sets, create new sets, and edit current sets easier than ever before! It's simple to use:

You can now actually see your sets! (BIIG)
  • Open your chat and type in '/xlgb' to bring up the UI.
  • Use the arrows to browse your current sets


New way to edit sets! (change name/remove items from set)
  • Open your chat and type in '/xlgb' to bring up the UI.
  • Press the edit icon (pen and paper thingy)
    • Now you can edit the name label to a choice of your own! (Press the label and edit away!)
    • Mark items for removal by using the 'X' icon to the right of the item you want removed. (If you regret your choice, press the cancel button to unmark it again!)
  • Now you have a choice:
    • Discard changes by clicking the "cancel icon" that replaced the edit icon. (If you've made changes a dialog will pop up to confirm)
    • Accept changes by clicking the "accept icon". (If you've marked items for removal a dialog will pop up to confirm)
    • Remove the set by click the "minus icon". (If the set is not empty a dialog will pop up to confirm)

Adding new sets (The EZ Clap way)
  • Open your chat and type in '/xlgb' to bring up the UI.
  • Use the '+' to add a new set.
  • You now enter 'edit' mode. (Look above for explanation)

Removing sets (YEET)

See "Edit sets" above at (3.3).

Roadmap
This is not the only change planned for the XLGB addon. I will further improve the user experience down the road with UI 2.0 as the next big goal that will assist in depositing/withdrawing sets easier (Which will phase out the confusing assigned set to chest thingy), as an alternative to depositing/withdrawing sets via keybinds. Below is a roadmap with features and improvements planned for the addon:
  • UI 2.0 (deposit/withdraw UI)
  • Settings menu
  • Multi-language support
  • UI polishing (Adding tooltips etc.)

Version 0.7.3.1 Hotfix!
  • Fixed bug when using /xlgb_removeset setNumber

Version 0.7.3
  • Editing gearSets now automatically updates the storage assigned sets aswell. (No need to manually reassign set to chest)
  • Added /xlgb_clearassigned command.
  • Updated /xlgb_help message
Optional Files (0)


Archived Files (8)
File Name
Version
Size
Uploader
Date
1.0.2
28kB
XL_Olsen
08/25/20 11:55 AM
1.0.0
29kB
XL_Olsen
07/29/20 01:58 PM
0.9.3
15kB
XL_Olsen
02/12/20 10:28 PM
0.9.1
14kB
XL_Olsen
01/29/20 08:02 AM
0.9
13kB
XL_Olsen
12/15/19 02:39 AM
0.8
15kB
XL_Olsen
12/13/19 12:46 AM
0.7.3.1
13kB
XL_Olsen
10/17/19 05:07 AM
0.7
14kB
XL_Olsen
10/14/19 10:49 PM


Post A Reply Comment Options
Unread 12/17/19, 01:43 AM  
XL_Olsen
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 11
Uploads: 1
Eyo again Baertram and thank you so much for your feedback !

As for the multi-line, never thought of that something similar to what Dressing Room has I assume - That'd definitely be easy to add

I initially fiddled around a bit with the ShifterBox (for deposit/withdraw purposes) but figured the 2 buttons on the main UI would be simpler. Though I might actually use it to make it easier to add items to sets as you also suggested previously. Another thing I'd like added is an "Add currently equipped item to set X", because alot of ppl already have predefined sets in AlphaGear/Dressing Room etc., and then they could just add a whole bunch of sets easily without starting all over from scratch

I wouldn't know how to actually go about implementing drag&drop from "basic" ESO UI to my UI, but I definitely do like the idea of it - Especially since the next "big update" would be an easier way to add items
+ adding tooltips to all the buttons and having items in my UI list display as items are being displayed in the basic ESO UI inventory. Speaking of, you wouldn't know a good place to look for an easy guide/a way to get started with tooltips (Maybe an addon that implements very simple tooltips) ?


Originally Posted by Baertram
Many thanks for this great addon, again!
I'm using it to store my sets accross characters.

And therefor I'd like to request another "comment" multiline editfield upon creation/changing of a set.
Maybe a text editbox below the headline of your UI and above the + - buttons. It should be editable always as the set was created and selected in the UI.
One can write the purpose/character names e.g. into it and directly sees which characters it was made for.
Or can add other information like "use with chars abc for dungeons xyz".
This would be awesome.

And if you can manage to get it to work, maybe allow drag&drop items to your UI list to add/remove them from inventories. But this is just a nice 2 have
Last edited by XL_Olsen : 12/17/19 at 01:49 AM.
Report comment to moderator  
Reply With Quote
Unread 12/16/19, 03:33 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
Many thanks for this great addon, again!
I'm using it to store my sets accross characters.

And therefor I'd like to request another "comment" multiline editfield upon creation/changing of a set.
Maybe a text editbox below the headline of your UI and above the + - buttons. It should be editable always as the set was created and selected in the UI.
One can write the purpose/character names e.g. into it and directly sees which characters it was made for.
Or can add other information like "use with chars abc for dungeons xyz".
This would be awesome.

And if you can manage to get it to work, maybe allow drag&drop items to your UI list to add/remove them from inventories. But this is just a nice 2 have
Last edited by Baertram : 12/16/19 at 03:36 AM.
Report comment to moderator  
Reply With Quote
Unread 10/24/19, 11:45 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
You could also use the LibAddonMenu-2.0 LAM library to create a settings panel for the overview of your sets in banks and handling them. It already provides standard controls and you can alsoa dd customd efined controls to the settings menu.
This library here is nice as it provides a listbox with 2 sides where you can drag&drop or move/add items to. It maybe good to e.g. show the different banks / storage chests on one side and the sets defined in another one so you can drag&drop them from one to another etc.
https://www.esoui.com/downloads/info...hifterBox.html


Originally Posted by XL_Olsen
Originally Posted by Baertram
This looks very prommissing, thanks!
Any chance you can add multi language support for the context menu?

You can have a look at pChat, there is an easy way to support multiple language "files" dynamically.
Just define in your addon's txt file an entry like
Code:
/lang/lang_base.lua  #Contains all the strings in EN e.g.
/lang/lang_$(language).lua  # Contains the translated strings in file lang_de.lua, or lang_fr.lua or lang_jp.lua etc.
See here for the possible variables in teh manifest txt file: https://wiki.esoui.com/Addon_manifes...able_Expansion
The constant $(language) will be replaced with the 2 character client language text, e.g. de, en, fr.
If the file does not exists it will be just skipped. You can also define an empty en.lua e.g. so it will be found but nothing is loaded. The base strings should ALWAYS be loaded with e.g. english so having a base file or alwaysLoaded file as fallback is a best practice.

Then check the pChat language folder files how to lpoad the base strings and then how to load the other strings in other language files. Define your own constants like SI_XLGB_CONTEXTMENU_ADD etc.

And in your addon replace the static english texts with GetString(SI_XLGB_CONTEXTMENU_ADD) and the game will handle the correct translations from the files for you.

For texts containing values (e.g. d("[XLGB] Item " .. itemLink .. " is already in " .. gearSetName) ) you can use string.format like this:
Define a string constant SI_XLGB_PREFIX = "[XLGB] ". This will be reused for all your leading prefix texts.
Define a string constant SI_XLGB_ALREADY_IN_SET = "Item %s is already in %s"

Lua Code:
  1. d(GetString(SI_XLGB_PREFIX) .. d(string.format(GetString(SI_XLGB_ALREADY_IN_SET), itemLink , gearSetName)


German translations:
--> Ideas:
As bank and storage chest messages are quite similar:
You could even use a placeholder for "bank" or "storage" or "chest" in your messages and define texts where you can use string.format
to dynamically replace the placeholder with "storage chest" or "bank" then.


-----Strings-----
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1st line English
2nd line German

... English
... German

and so on...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Code:
--Error mesages
d("[XLGB_ERROR] GearSetNumber is invalid. Got:", gearSetNumber)
d("[XLGB_FEHLER] GearSetNummmer ist ungültig: ", gearSetNumber)

d("[XLGB_ERROR] Enter a name for the set.")
d("[XLGB_FEHLER] Bitte gib einen Namen für das Set ein.")

d("[XLGB_ERROR] A set named ".. gearSetName .." does already exist! Set names should be unique.")
d("[XLGB_FEHLER] Ein Set mit Namen ".. gearSetName .." existiert bereits! Set Namen müssen eindeutig sein.")

d("[XLGB_ERROR] Trying to move " .. numberOfItemsToMove/#itemsToMove.. "items into a bag with " .. #availableBagSpaces/numberOfAvailableSpaces .." empty slots.")
d("[XLGB_FEHLER] Versuche " .. numberOfItemsToMove/#itemsToMove.. " Gegenstände in einen Beutel mit " .. #availableBagSpaces/numberOfAvailableSpaces .." freien Plätzen zu verschieben.")

d("[XLGB_ERROR] Bank is not open, abort!")
d("[XLGB_FEHLER] Bank ist nicht geöffnet, Abbruch!")

d("[XLGB_ERROR] Cannot assign set to storage. Trying to assign " .. #itemsNotAlreadyAssigned .. " items when only " .. storageBag.slotsLeft .. " are open for assignment.")
d("[XLGB_FEHLER] Kann Set nicht der Lagertruhe zuweisen. Versuche insgesamt " .. #itemsNotAlreadyAssigned .. " Gegenstände zuzuweisen, wobei nur " .. storageBag.slotsLeft .. " übrig sind für die Zuweisung.")

d("[XLGB_ERROR] House storage chest not open, abort!")
d("[XLGB_FEHLER] Haus Lagertruhe nicht geöffnet, Abbruch!")

d("[XLGB_ERROR] Gearset already assigned to this storage chest.")
d("[XLGB_FEHLER] Gearset ist bereits dieser Lagertruhe zugewiesen.")

d("[XLGB_ERROR] Set \'" .. gearSet.name .. "\' is already not assigned to this chest.")
d("[XLGB_FEHLER] Set \'" .. gearSet.name .. "\' ist noch nicht dieser Truhe zugewiesen.")

d("[XLGB_ERROR] On item update: Couldn't reassign set \'".. gearSetAfter.name .."\' to storageBag with ID: " .. storageBagID)
d("[XLGB_FEHLER] Bei Gegenstandsaktualisierung: Konnte das Set \'".. gearSetAfter.name .."\' nicht der Lagertruhe mit ID: " .. storageBagID .. " zuweisen.")


--Texts chat output etc.
d(Item " .. itemLink .. " is already in " .. gearSetName)
d(Gegenstand " .. itemLink .. " ist bereits in " .. gearSetName)

d("[XLGB] Assigned \'" .. gearSet.name .. "\' to chest.")
d("[XLGB] \'" .. gearSet.name .. "\' wurde Truhe zugewiesen.")

d("[XLGB] Depositing " .. gearSet.name)
d("[XLGB] Einlagerung " .. gearSet.name)

d("[XLGB] Set \'" .. gearSet.name .. "\' deposited!")
d("[XLGB] Set \'" .. gearSet.name .. "\' eingelagert!")

d("[XLGB] Withdrawing " .. gearSet.name)
d("[XLGB] Auslagerung " .. gearSet.name)

d("[XLGB] Set \'" .. gearSet.name .. "\' withdrawn!")
d("[XLGB] Set \'" .. gearSet.name .. "\' ausgelagert!")

d("[XLGB] Set \'" .. gearSet.name .. "\' is no longer assigned to this chest.")
d("[XLGB] Set \'" .. gearSet.name .. "\' ist nicht länger dieser Lagertruhe zugewiesen.")

d("[XLGB] Depositing assigned items from sets: ", storageBag.assignedSets)
d("[XLGB] Lagere zugewiesene Gegenstände des Sets ein: ", storageBag.assignedSets)

d("[XLGB] Assigned items deposited!")
d("[XLGB] Zugewiesene Gegenstände eingelagert!")

d("[XLGB] Withdrawing assigned items from sets", storageBag.assignedSets )   -->Here is missing the <space>: behind sets, or you should remove the : behind the sets: of "Depositing assigned items from sets: "
d("[XLGB] Lagere zugewiesene Gegenstände des Sets aus: ", storageBag.assignedSets )

d("[XLGB] Assigned items withdrawn!")
d("[XLGB] Zugewiesene Gegenstände ausgelagert!")

d("[XLGB] Cleared storage chest assigned sets.")
d("[XLGB] Zugeweisung der Sets zur Lagertruhe wurden aufgehoben.")

d("[XLGB] Chest contains the following assigned sets:")
d("[XLGB] Truhe beinhält die folgenden zugewiesenen Sets:")

d("[XLGB] Total sets: " .. #storageBag.assignedSets/totalGearSets)
d("[XLGB] Anzahl Sets: " .. #storageBag.assignedSets/totalGearSets)

d("[XLGB] Total items: " .. #storageBag.assignedItems .. " out of " .. storageBag.size)
d("[XLGB] Anzahl Gegenstände: " .. #storageBag.assignedItems .. " von " .. storageBag.size)

d("[XLGB] Created new set: " .. gearSetName)
d("[XLGB] Neues Set erstellt: " .. gearSetName)

d("[XLGB] Removed set: " .. gearSet.name)
d("[XLGB] Set entfernt: " .. gearSet.name)

d("[XLGB] Added item " .. itemLink .. " to " .. gearSet.name)
d("[XLGB] Gegenstand " .. itemLink .. " zu " .. gearSet.name .. " hinzugefügt")

d("[XLGB] Removed item " .. itemLink .. " from " .. gearSetName)
d("[XLGB] Gegenstand " .. itemLink .. " aus " .. gearSetName .. " entfernt")

d("Set " .. i .. " = " .. gearSet.name)
d("Set " .. i .. " = " .. gearSet.name)

d("Set \'" .. gearSet.name .. "\' contains the following items:")
d("Set \'" .. gearSet.name .. "\' beinhält die folgenden Gegenstände:")

d("[XLGB] Total items = " .. #gearSet.items)
d("[XLGB] Anzahl Gegenstände = " .. #gearSet.items)

--Context menu entries
self.ADD_ITEM_TO_GEARSET = "XLGB addItem"
self.ADD_ITEM_TO_GEARSET = "XLGB Hinzufügen"

self.REMOVE_ITEM_FROM_GEARSET = "XLGB removeItem"
self.REMOVE_ITEM_FROM_GEARSET = "XLGB Entfernen"

--Keybinds
name = "Deposit Assigned",
name = "Zugewiesene Einlagern",

name = "Withdraw Assigned",
name = "Zugewiesene Auslagern",

"Deposit Gear Set <number 1 to 9>"
"Lagere Gear Set <number 1 to 9> ein"

"Withdraw Gear Set <number 1 to 9>"
"Lagere Gear Set <number 1 to 9> aus"

--Slash commands
d("\'/xlgb_sets\': Prints out saved sets to chat.")
d("\'/xlgb_sets\': Chat Ausgabe gespeicherter Sets.")

d("\'/xlgb_items setNumber\': Prints out set #(setNumber)s items to chat.")
d("\'/xlgb_items setNumber\': Chat Ausgabe der Gegenstände des Sets #(setNummer).")

d("\'/xlgb_addset setName\': Creates a new set named (setName).")
d("\'/xlgb_addset setName\': Erstellt ein neues Set mit Namen (setName).")

d("\'/xlgb_removeset setNumber\': Removes set #(setNumber).")
d("\'/xlgb_removeset setNumber\': Entfernt Set #(setNummer).")

d("\'/xlgb_deposit setNumber\': Deposit all items from set #(setNumber) into the bank.")
d("\'/xlgb_deposit setNumber\': Einlagern aller Gegenstände des Sets #(setNummer) in die Bank.")

d("\'/xlgb_withdraw setNumber\': Withdraw all items from set #(setNumber) into the player inventory.")
d("\'/xlgb_withdraw setNumber\': Auslagern aller Gegenstände des Sets #(setNummer) in das Inventar.")

d("\'/xlgb_assign setNumber\': Assigns set #(setNumber) to opened chest.")
d("\'/xlgb_assign setNumber\': Weist Set #(setNummer) der geöffneten Truhe zu.")

d("\'/xlgb_unassign setNumber\': Unassigns set #(setNumber) from opened chest.")
d("\'/xlgb_unassign setNumber\': Hebt Zuweisung des Sets #(setNummmer) zur geöffneten Truhe auf.")

d("\'/xlgb_clearassigned\': Clears the list of sets assigned to opened chest.")
d("\'/xlgb_clearassigned\': Leert die Liste der zugewiesenen Sets der geöffneten Truhe.")

d("\'/xlgb_assignedsets\': Prints out the sets assigned to opened chest.")
d("\'/xlgb_assignedsets\': Chat Ausgabe der Truhen zugewiesenen Sets.")

d("\'/xlgb_debug\': Toggles debug mode. (Note: quite verbose)")
d("\'/xlgb_debug\': Debug Modus umschalten. (Notiz: sehr wortreich)")
Hey Baertram!
Thank you for your feedback!
For sure I will look into adding multi-lang support, didn't think I'd get noticed this quick, so didn't think it'd be needed !
I'm also working on a UI module to give a better overview of saved sets and items, similar to e.g. Dressing Room (Distinguish between sets) or Inventory Insight (the way the items are listed), but I ran into problems here - Would be nice to have something other than the slash_commands but I guess they'll work while the addon is in its infant stages.
Again - Thanks for the tips, translation and how to approach multi-lang support, it's appreciated!
Report comment to moderator  
Reply With Quote
Unread 10/17/19, 12:10 PM  
XL_Olsen
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 11
Uploads: 1
Originally Posted by Baertram
This looks very prommissing, thanks!
Any chance you can add multi language support for the context menu?

You can have a look at pChat, there is an easy way to support multiple language "files" dynamically.
Just define in your addon's txt file an entry like
Code:
/lang/lang_base.lua  #Contains all the strings in EN e.g.
/lang/lang_$(language).lua  # Contains the translated strings in file lang_de.lua, or lang_fr.lua or lang_jp.lua etc.
See here for the possible variables in teh manifest txt file: https://wiki.esoui.com/Addon_manifes...able_Expansion
The constant $(language) will be replaced with the 2 character client language text, e.g. de, en, fr.
If the file does not exists it will be just skipped. You can also define an empty en.lua e.g. so it will be found but nothing is loaded. The base strings should ALWAYS be loaded with e.g. english so having a base file or alwaysLoaded file as fallback is a best practice.

Then check the pChat language folder files how to lpoad the base strings and then how to load the other strings in other language files. Define your own constants like SI_XLGB_CONTEXTMENU_ADD etc.

And in your addon replace the static english texts with GetString(SI_XLGB_CONTEXTMENU_ADD) and the game will handle the correct translations from the files for you.

For texts containing values (e.g. d("[XLGB] Item " .. itemLink .. " is already in " .. gearSetName) ) you can use string.format like this:
Define a string constant SI_XLGB_PREFIX = "[XLGB] ". This will be reused for all your leading prefix texts.
Define a string constant SI_XLGB_ALREADY_IN_SET = "Item %s is already in %s"

Lua Code:
  1. d(GetString(SI_XLGB_PREFIX) .. d(string.format(GetString(SI_XLGB_ALREADY_IN_SET), itemLink , gearSetName)


German translations:
--> Ideas:
As bank and storage chest messages are quite similar:
You could even use a placeholder for "bank" or "storage" or "chest" in your messages and define texts where you can use string.format
to dynamically replace the placeholder with "storage chest" or "bank" then.


-----Strings-----
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1st line English
2nd line German

... English
... German

and so on...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Code:
--Error mesages
d("[XLGB_ERROR] GearSetNumber is invalid. Got:", gearSetNumber)
d("[XLGB_FEHLER] GearSetNummmer ist ungültig: ", gearSetNumber)

d("[XLGB_ERROR] Enter a name for the set.")
d("[XLGB_FEHLER] Bitte gib einen Namen für das Set ein.")

d("[XLGB_ERROR] A set named ".. gearSetName .." does already exist! Set names should be unique.")
d("[XLGB_FEHLER] Ein Set mit Namen ".. gearSetName .." existiert bereits! Set Namen müssen eindeutig sein.")

d("[XLGB_ERROR] Trying to move " .. numberOfItemsToMove/#itemsToMove.. "items into a bag with " .. #availableBagSpaces/numberOfAvailableSpaces .." empty slots.")
d("[XLGB_FEHLER] Versuche " .. numberOfItemsToMove/#itemsToMove.. " Gegenstände in einen Beutel mit " .. #availableBagSpaces/numberOfAvailableSpaces .." freien Plätzen zu verschieben.")

d("[XLGB_ERROR] Bank is not open, abort!")
d("[XLGB_FEHLER] Bank ist nicht geöffnet, Abbruch!")

d("[XLGB_ERROR] Cannot assign set to storage. Trying to assign " .. #itemsNotAlreadyAssigned .. " items when only " .. storageBag.slotsLeft .. " are open for assignment.")
d("[XLGB_FEHLER] Kann Set nicht der Lagertruhe zuweisen. Versuche insgesamt " .. #itemsNotAlreadyAssigned .. " Gegenstände zuzuweisen, wobei nur " .. storageBag.slotsLeft .. " übrig sind für die Zuweisung.")

d("[XLGB_ERROR] House storage chest not open, abort!")
d("[XLGB_FEHLER] Haus Lagertruhe nicht geöffnet, Abbruch!")

d("[XLGB_ERROR] Gearset already assigned to this storage chest.")
d("[XLGB_FEHLER] Gearset ist bereits dieser Lagertruhe zugewiesen.")

d("[XLGB_ERROR] Set \'" .. gearSet.name .. "\' is already not assigned to this chest.")
d("[XLGB_FEHLER] Set \'" .. gearSet.name .. "\' ist noch nicht dieser Truhe zugewiesen.")

d("[XLGB_ERROR] On item update: Couldn't reassign set \'".. gearSetAfter.name .."\' to storageBag with ID: " .. storageBagID)
d("[XLGB_FEHLER] Bei Gegenstandsaktualisierung: Konnte das Set \'".. gearSetAfter.name .."\' nicht der Lagertruhe mit ID: " .. storageBagID .. " zuweisen.")


--Texts chat output etc.
d(Item " .. itemLink .. " is already in " .. gearSetName)
d(Gegenstand " .. itemLink .. " ist bereits in " .. gearSetName)

d("[XLGB] Assigned \'" .. gearSet.name .. "\' to chest.")
d("[XLGB] \'" .. gearSet.name .. "\' wurde Truhe zugewiesen.")

d("[XLGB] Depositing " .. gearSet.name)
d("[XLGB] Einlagerung " .. gearSet.name)

d("[XLGB] Set \'" .. gearSet.name .. "\' deposited!")
d("[XLGB] Set \'" .. gearSet.name .. "\' eingelagert!")

d("[XLGB] Withdrawing " .. gearSet.name)
d("[XLGB] Auslagerung " .. gearSet.name)

d("[XLGB] Set \'" .. gearSet.name .. "\' withdrawn!")
d("[XLGB] Set \'" .. gearSet.name .. "\' ausgelagert!")

d("[XLGB] Set \'" .. gearSet.name .. "\' is no longer assigned to this chest.")
d("[XLGB] Set \'" .. gearSet.name .. "\' ist nicht länger dieser Lagertruhe zugewiesen.")

d("[XLGB] Depositing assigned items from sets: ", storageBag.assignedSets)
d("[XLGB] Lagere zugewiesene Gegenstände des Sets ein: ", storageBag.assignedSets)

d("[XLGB] Assigned items deposited!")
d("[XLGB] Zugewiesene Gegenstände eingelagert!")

d("[XLGB] Withdrawing assigned items from sets", storageBag.assignedSets )   -->Here is missing the <space>: behind sets, or you should remove the : behind the sets: of "Depositing assigned items from sets: "
d("[XLGB] Lagere zugewiesene Gegenstände des Sets aus: ", storageBag.assignedSets )

d("[XLGB] Assigned items withdrawn!")
d("[XLGB] Zugewiesene Gegenstände ausgelagert!")

d("[XLGB] Cleared storage chest assigned sets.")
d("[XLGB] Zugeweisung der Sets zur Lagertruhe wurden aufgehoben.")

d("[XLGB] Chest contains the following assigned sets:")
d("[XLGB] Truhe beinhält die folgenden zugewiesenen Sets:")

d("[XLGB] Total sets: " .. #storageBag.assignedSets/totalGearSets)
d("[XLGB] Anzahl Sets: " .. #storageBag.assignedSets/totalGearSets)

d("[XLGB] Total items: " .. #storageBag.assignedItems .. " out of " .. storageBag.size)
d("[XLGB] Anzahl Gegenstände: " .. #storageBag.assignedItems .. " von " .. storageBag.size)

d("[XLGB] Created new set: " .. gearSetName)
d("[XLGB] Neues Set erstellt: " .. gearSetName)

d("[XLGB] Removed set: " .. gearSet.name)
d("[XLGB] Set entfernt: " .. gearSet.name)

d("[XLGB] Added item " .. itemLink .. " to " .. gearSet.name)
d("[XLGB] Gegenstand " .. itemLink .. " zu " .. gearSet.name .. " hinzugefügt")

d("[XLGB] Removed item " .. itemLink .. " from " .. gearSetName)
d("[XLGB] Gegenstand " .. itemLink .. " aus " .. gearSetName .. " entfernt")

d("Set " .. i .. " = " .. gearSet.name)
d("Set " .. i .. " = " .. gearSet.name)

d("Set \'" .. gearSet.name .. "\' contains the following items:")
d("Set \'" .. gearSet.name .. "\' beinhält die folgenden Gegenstände:")

d("[XLGB] Total items = " .. #gearSet.items)
d("[XLGB] Anzahl Gegenstände = " .. #gearSet.items)

--Context menu entries
self.ADD_ITEM_TO_GEARSET = "XLGB addItem"
self.ADD_ITEM_TO_GEARSET = "XLGB Hinzufügen"

self.REMOVE_ITEM_FROM_GEARSET = "XLGB removeItem"
self.REMOVE_ITEM_FROM_GEARSET = "XLGB Entfernen"

--Keybinds
name = "Deposit Assigned",
name = "Zugewiesene Einlagern",

name = "Withdraw Assigned",
name = "Zugewiesene Auslagern",

"Deposit Gear Set <number 1 to 9>"
"Lagere Gear Set <number 1 to 9> ein"

"Withdraw Gear Set <number 1 to 9>"
"Lagere Gear Set <number 1 to 9> aus"

--Slash commands
d("\'/xlgb_sets\': Prints out saved sets to chat.")
d("\'/xlgb_sets\': Chat Ausgabe gespeicherter Sets.")

d("\'/xlgb_items setNumber\': Prints out set #(setNumber)s items to chat.")
d("\'/xlgb_items setNumber\': Chat Ausgabe der Gegenstände des Sets #(setNummer).")

d("\'/xlgb_addset setName\': Creates a new set named (setName).")
d("\'/xlgb_addset setName\': Erstellt ein neues Set mit Namen (setName).")

d("\'/xlgb_removeset setNumber\': Removes set #(setNumber).")
d("\'/xlgb_removeset setNumber\': Entfernt Set #(setNummer).")

d("\'/xlgb_deposit setNumber\': Deposit all items from set #(setNumber) into the bank.")
d("\'/xlgb_deposit setNumber\': Einlagern aller Gegenstände des Sets #(setNummer) in die Bank.")

d("\'/xlgb_withdraw setNumber\': Withdraw all items from set #(setNumber) into the player inventory.")
d("\'/xlgb_withdraw setNumber\': Auslagern aller Gegenstände des Sets #(setNummer) in das Inventar.")

d("\'/xlgb_assign setNumber\': Assigns set #(setNumber) to opened chest.")
d("\'/xlgb_assign setNumber\': Weist Set #(setNummer) der geöffneten Truhe zu.")

d("\'/xlgb_unassign setNumber\': Unassigns set #(setNumber) from opened chest.")
d("\'/xlgb_unassign setNumber\': Hebt Zuweisung des Sets #(setNummmer) zur geöffneten Truhe auf.")

d("\'/xlgb_clearassigned\': Clears the list of sets assigned to opened chest.")
d("\'/xlgb_clearassigned\': Leert die Liste der zugewiesenen Sets der geöffneten Truhe.")

d("\'/xlgb_assignedsets\': Prints out the sets assigned to opened chest.")
d("\'/xlgb_assignedsets\': Chat Ausgabe der Truhen zugewiesenen Sets.")

d("\'/xlgb_debug\': Toggles debug mode. (Note: quite verbose)")
d("\'/xlgb_debug\': Debug Modus umschalten. (Notiz: sehr wortreich)")
Hey Baertram!
Thank you for your feedback!
For sure I will look into adding multi-lang support, didn't think I'd get noticed this quick, so didn't think it'd be needed !
I'm also working on a UI module to give a better overview of saved sets and items, similar to e.g. Dressing Room (Distinguish between sets) or Inventory Insight (the way the items are listed), but I ran into problems here - Would be nice to have something other than the slash_commands but I guess they'll work while the addon is in its infant stages.
Again - Thanks for the tips, translation and how to approach multi-lang support, it's appreciated!
Report comment to moderator  
Reply With Quote
Unread 10/17/19, 06:06 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4989
File comments: 6040
Uploads: 78
This looks very prommissing, thanks!
Any chance you can add multi language support for the context menu?

You can have a look at pChat, there is an easy way to support multiple language "files" dynamically.
Just define in your addon's txt file an entry like
Code:
/lang/lang_base.lua  #Contains all the strings in EN e.g.
/lang/lang_$(language).lua  # Contains the translated strings in file lang_de.lua, or lang_fr.lua or lang_jp.lua etc.
See here for the possible variables in teh manifest txt file: https://wiki.esoui.com/Addon_manifes...able_Expansion
The constant $(language) will be replaced with the 2 character client language text, e.g. de, en, fr.
If the file does not exists it will be just skipped. You can also define an empty en.lua e.g. so it will be found but nothing is loaded. The base strings should ALWAYS be loaded with e.g. english so having a base file or alwaysLoaded file as fallback is a best practice.

Then check the pChat language folder files how to lpoad the base strings and then how to load the other strings in other language files. Define your own constants like SI_XLGB_CONTEXTMENU_ADD etc.

And in your addon replace the static english texts with GetString(SI_XLGB_CONTEXTMENU_ADD) and the game will handle the correct translations from the files for you.

For texts containing values (e.g. d("[XLGB] Item " .. itemLink .. " is already in " .. gearSetName) ) you can use string.format like this:
Define a string constant SI_XLGB_PREFIX = "[XLGB] ". This will be reused for all your leading prefix texts.
Define a string constant SI_XLGB_ALREADY_IN_SET = "Item %s is already in %s"

Lua Code:
  1. d(GetString(SI_XLGB_PREFIX) .. d(string.format(GetString(SI_XLGB_ALREADY_IN_SET), itemLink , gearSetName)


German translations:
--> Ideas:
As bank and storage chest messages are quite similar:
You could even use a placeholder for "bank" or "storage" or "chest" in your messages and define texts where you can use string.format
to dynamically replace the placeholder with "storage chest" or "bank" then.


-----Strings-----
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1st line English
2nd line German

... English
... German

and so on...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Code:
--Error mesages
d("[XLGB_ERROR] GearSetNumber is invalid. Got:", gearSetNumber)
d("[XLGB_FEHLER] GearSetNummmer ist ungültig: ", gearSetNumber)

d("[XLGB_ERROR] Enter a name for the set.")
d("[XLGB_FEHLER] Bitte gib einen Namen für das Set ein.")

d("[XLGB_ERROR] A set named ".. gearSetName .." does already exist! Set names should be unique.")
d("[XLGB_FEHLER] Ein Set mit Namen ".. gearSetName .." existiert bereits! Set Namen müssen eindeutig sein.")

d("[XLGB_ERROR] Trying to move " .. numberOfItemsToMove/#itemsToMove.. "items into a bag with " .. #availableBagSpaces/numberOfAvailableSpaces .." empty slots.")
d("[XLGB_FEHLER] Versuche " .. numberOfItemsToMove/#itemsToMove.. " Gegenstände in einen Beutel mit " .. #availableBagSpaces/numberOfAvailableSpaces .." freien Plätzen zu verschieben.")

d("[XLGB_ERROR] Bank is not open, abort!")
d("[XLGB_FEHLER] Bank ist nicht geöffnet, Abbruch!")

d("[XLGB_ERROR] Cannot assign set to storage. Trying to assign " .. #itemsNotAlreadyAssigned .. " items when only " .. storageBag.slotsLeft .. " are open for assignment.")
d("[XLGB_FEHLER] Kann Set nicht der Lagertruhe zuweisen. Versuche insgesamt " .. #itemsNotAlreadyAssigned .. " Gegenstände zuzuweisen, wobei nur " .. storageBag.slotsLeft .. " übrig sind für die Zuweisung.")

d("[XLGB_ERROR] House storage chest not open, abort!")
d("[XLGB_FEHLER] Haus Lagertruhe nicht geöffnet, Abbruch!")

d("[XLGB_ERROR] Gearset already assigned to this storage chest.")
d("[XLGB_FEHLER] Gearset ist bereits dieser Lagertruhe zugewiesen.")

d("[XLGB_ERROR] Set \'" .. gearSet.name .. "\' is already not assigned to this chest.")
d("[XLGB_FEHLER] Set \'" .. gearSet.name .. "\' ist noch nicht dieser Truhe zugewiesen.")

d("[XLGB_ERROR] On item update: Couldn't reassign set \'".. gearSetAfter.name .."\' to storageBag with ID: " .. storageBagID)
d("[XLGB_FEHLER] Bei Gegenstandsaktualisierung: Konnte das Set \'".. gearSetAfter.name .."\' nicht der Lagertruhe mit ID: " .. storageBagID .. " zuweisen.")


--Texts chat output etc.
d(Item " .. itemLink .. " is already in " .. gearSetName)
d(Gegenstand " .. itemLink .. " ist bereits in " .. gearSetName)

d("[XLGB] Assigned \'" .. gearSet.name .. "\' to chest.")
d("[XLGB] \'" .. gearSet.name .. "\' wurde Truhe zugewiesen.")

d("[XLGB] Depositing " .. gearSet.name)
d("[XLGB] Einlagerung " .. gearSet.name)

d("[XLGB] Set \'" .. gearSet.name .. "\' deposited!")
d("[XLGB] Set \'" .. gearSet.name .. "\' eingelagert!")

d("[XLGB] Withdrawing " .. gearSet.name)
d("[XLGB] Auslagerung " .. gearSet.name)

d("[XLGB] Set \'" .. gearSet.name .. "\' withdrawn!")
d("[XLGB] Set \'" .. gearSet.name .. "\' ausgelagert!")

d("[XLGB] Set \'" .. gearSet.name .. "\' is no longer assigned to this chest.")
d("[XLGB] Set \'" .. gearSet.name .. "\' ist nicht länger dieser Lagertruhe zugewiesen.")

d("[XLGB] Depositing assigned items from sets: ", storageBag.assignedSets)
d("[XLGB] Lagere zugewiesene Gegenstände des Sets ein: ", storageBag.assignedSets)

d("[XLGB] Assigned items deposited!")
d("[XLGB] Zugewiesene Gegenstände eingelagert!")

d("[XLGB] Withdrawing assigned items from sets", storageBag.assignedSets )   -->Here is missing the <space>: behind sets, or you should remove the : behind the sets: of "Depositing assigned items from sets: "
d("[XLGB] Lagere zugewiesene Gegenstände des Sets aus: ", storageBag.assignedSets )

d("[XLGB] Assigned items withdrawn!")
d("[XLGB] Zugewiesene Gegenstände ausgelagert!")

d("[XLGB] Cleared storage chest assigned sets.")
d("[XLGB] Zugeweisung der Sets zur Lagertruhe wurden aufgehoben.")

d("[XLGB] Chest contains the following assigned sets:")
d("[XLGB] Truhe beinhält die folgenden zugewiesenen Sets:")

d("[XLGB] Total sets: " .. #storageBag.assignedSets/totalGearSets)
d("[XLGB] Anzahl Sets: " .. #storageBag.assignedSets/totalGearSets)

d("[XLGB] Total items: " .. #storageBag.assignedItems .. " out of " .. storageBag.size)
d("[XLGB] Anzahl Gegenstände: " .. #storageBag.assignedItems .. " von " .. storageBag.size)

d("[XLGB] Created new set: " .. gearSetName)
d("[XLGB] Neues Set erstellt: " .. gearSetName)

d("[XLGB] Removed set: " .. gearSet.name)
d("[XLGB] Set entfernt: " .. gearSet.name)

d("[XLGB] Added item " .. itemLink .. " to " .. gearSet.name)
d("[XLGB] Gegenstand " .. itemLink .. " zu " .. gearSet.name .. " hinzugefügt")

d("[XLGB] Removed item " .. itemLink .. " from " .. gearSetName)
d("[XLGB] Gegenstand " .. itemLink .. " aus " .. gearSetName .. " entfernt")

d("Set " .. i .. " = " .. gearSet.name)
d("Set " .. i .. " = " .. gearSet.name)

d("Set \'" .. gearSet.name .. "\' contains the following items:")
d("Set \'" .. gearSet.name .. "\' beinhält die folgenden Gegenstände:")

d("[XLGB] Total items = " .. #gearSet.items)
d("[XLGB] Anzahl Gegenstände = " .. #gearSet.items)

--Context menu entries
self.ADD_ITEM_TO_GEARSET = "XLGB addItem"
self.ADD_ITEM_TO_GEARSET = "XLGB Hinzufügen"

self.REMOVE_ITEM_FROM_GEARSET = "XLGB removeItem"
self.REMOVE_ITEM_FROM_GEARSET = "XLGB Entfernen"

--Keybinds
name = "Deposit Assigned",
name = "Zugewiesene Einlagern",

name = "Withdraw Assigned",
name = "Zugewiesene Auslagern",

"Deposit Gear Set <number 1 to 9>"
"Lagere Gear Set <number 1 to 9> ein"

"Withdraw Gear Set <number 1 to 9>"
"Lagere Gear Set <number 1 to 9> aus"

--Slash commands
d("\'/xlgb_sets\': Prints out saved sets to chat.")
d("\'/xlgb_sets\': Chat Ausgabe gespeicherter Sets.")

d("\'/xlgb_items setNumber\': Prints out set #(setNumber)s items to chat.")
d("\'/xlgb_items setNumber\': Chat Ausgabe der Gegenstände des Sets #(setNummer).")

d("\'/xlgb_addset setName\': Creates a new set named (setName).")
d("\'/xlgb_addset setName\': Erstellt ein neues Set mit Namen (setName).")

d("\'/xlgb_removeset setNumber\': Removes set #(setNumber).")
d("\'/xlgb_removeset setNumber\': Entfernt Set #(setNummer).")

d("\'/xlgb_deposit setNumber\': Deposit all items from set #(setNumber) into the bank.")
d("\'/xlgb_deposit setNumber\': Einlagern aller Gegenstände des Sets #(setNummer) in die Bank.")

d("\'/xlgb_withdraw setNumber\': Withdraw all items from set #(setNumber) into the player inventory.")
d("\'/xlgb_withdraw setNumber\': Auslagern aller Gegenstände des Sets #(setNummer) in das Inventar.")

d("\'/xlgb_assign setNumber\': Assigns set #(setNumber) to opened chest.")
d("\'/xlgb_assign setNumber\': Weist Set #(setNummer) der geöffneten Truhe zu.")

d("\'/xlgb_unassign setNumber\': Unassigns set #(setNumber) from opened chest.")
d("\'/xlgb_unassign setNumber\': Hebt Zuweisung des Sets #(setNummmer) zur geöffneten Truhe auf.")

d("\'/xlgb_clearassigned\': Clears the list of sets assigned to opened chest.")
d("\'/xlgb_clearassigned\': Leert die Liste der zugewiesenen Sets der geöffneten Truhe.")

d("\'/xlgb_assignedsets\': Prints out the sets assigned to opened chest.")
d("\'/xlgb_assignedsets\': Chat Ausgabe der Truhen zugewiesenen Sets.")

d("\'/xlgb_debug\': Toggles debug mode. (Note: quite verbose)")
d("\'/xlgb_debug\': Debug Modus umschalten. (Notiz: sehr wortreich)")
Last edited by Baertram : 10/17/19 at 07:10 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: