diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d04a03..4e3d909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## v2.0.0 +- adds a mini window option offering an alternative interface with minimal window size +- adds skills snapping for cleaner resizing of main and mini windows +- adds slider to control speed of fadeout to min opacity +- adds the ability to save a global preset so main options can be transferred to alts +- adds option to control whether Esc closes main Travel window +- adds enable/disable all buttons in enable options tab +- adds enable/disable button for overlapping class/reputation skills in enable options tab +- sets default sort so racial & class skills come after general skills to get closer to level progression sorting +- fixes Travel Window opening behind chat and Travel Button +- fixes missing Return to Dol Amroth (Western Gondor) in DE client +- significant code cleanup under the hood for more reliable and maintainable code + ## v1.4.0 - reintroduces a rewritten Map Window feature - thanks to @whiterabbit963 - toggle button will no longer be out of bounds after reducing client resolution - thanks to @whiterabbit963 diff --git a/README.md b/README.md index e5e1e0a..f091876 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,4 @@ Travel Window II LOTRO Interface Plugin -Travel Window II started out as Travel Window by D.H1cks also known as Dhor. As he stopped being able to maintain it -it was updated by other authors in the meantime. This version is an attempt to restart development of Travel Window, -keeping it up-to-date with LOTRO updates and hopefully adding some new features. +This is an interface plugin for the video game The Lord of the Rings Online. It creates a single UI window that contains all travel skills available to the character, including race, class, housing, and reputation skills. It is a fork and further development of the "Travel Window" plugin, that has been created by Dhor and worked on by multiple authors before. \ No newline at end of file diff --git a/TravelWindowII.plugin b/TravelWindowII.plugin index e06427d..7d50db3 100644 --- a/TravelWindowII.plugin +++ b/TravelWindowII.plugin @@ -3,7 +3,7 @@ Travel Window II Hyoss - v1.4.0 + v2.0.0 This plugin creates a single window that contains all the available travel skills, including the race, class and reputation skills. It is a further development of Travel Window, that has been worked on by multiple authors before. diff --git a/TravelWindowII.plugincompendium b/TravelWindowII.plugincompendium index a986d1e..fcd42d1 100644 --- a/TravelWindowII.plugincompendium +++ b/TravelWindowII.plugincompendium @@ -2,7 +2,7 @@ 1113 Travel Window II - v1.4.0 + v2.0.0 Hyoss http://www.lotrointerface.com/downloads/info1113 http://www.lotrointerface.com/downloads/download1113 diff --git a/doc/lotroforums.md b/doc/lotroforums.md index d2cf0ab..8b494ac 100644 --- a/doc/lotroforums.md +++ b/doc/lotroforums.md @@ -1,11 +1,18 @@ A new version is available! -v1.4.0 -- reintroduces a rewritten Map Window feature - thanks to @whiterabbit963 -- toggle button will no longer be out of bounds after reducing client resolution - thanks to @whiterabbit963 -- fixes error message on check untrained skills in options - thanks to @whiterabbit963 -- fixes Muster in Dale skill in DE client properly this time - thanks to @whiterabbit963 +v2.0.0 +- adds a mini window option offering an alternative interface with minimal window size +- adds skills snapping for cleaner resizing of main and mini windows +- adds slider to control speed of fadeout to min opacity +- adds the ability to save a global preset so main options can be transferred to alts +- adds option to control whether Esc closes main Travel window +- adds enable/disable all buttons in enable options tab +- adds enable/disable button for overlapping class/reputation skills in enable options tab +- sets default sort so racial & class skills come after general skills to get closer to level progression sorting +- fixes Travel Window opening behind chat and Travel Button +- fixes missing Return to Dol Amroth (Western Gondor) in DE client +- significant code cleanup under the hood for more reliable and maintainable code -This introduces an important milestone - Travel Window II is now free of known bugs for the first time since it was forked from Travel Window. Huge kudos to @whiterabbit963 for making this possible. +Huge kudos to @whiterabbit963 for making this release possible! Download it at [url=https://www.lotrointerface.com/downloads/fileinfo.php?id=1113]Lotrointerface[/url], [url=https://github.com/wduda/TravelWindowII/releases]GitHub[/url], via [url=https://github.com/JeremyStepp/OneLauncher]OneLauncher[/url] or via [url=https://www.lotrointerface.com/downloads/info663-LOTROPluginCompendium.html]Plugin Compendium[/url]. \ No newline at end of file diff --git a/doc/lotrointerface.md b/doc/lotrointerface.md index 53c951c..e0dc356 100644 --- a/doc/lotrointerface.md +++ b/doc/lotrointerface.md @@ -26,23 +26,25 @@ Why does my racial skill show up even though I do not have the racial trait equi [*]Because once the trait is acquired, it is classified as a "learned" skill by LOTRO itself, even though it is greyed out. Travel Window II, unfortunately, has no way of knowing if you have the racial trait equipped and the skill is usable. If you are not using the skill permanently, you can use the Enable/Disable options to hide it like any other skill. [/LIST] -Why does a reputation or store version of my racial skill show up even though I have not obtained or bought it? -[LIST] -[*]This is because the racial and those store-bought skills have identical names ingame (i.e. "Return to Bree") and the plugin obtains a list of learned skills for your character that includes that particular name at least once. Based on that name alone the plugin cannot know which of the two skills you have obtained, while you can get both through the Racial+Store combo. You can use the Enable/Disable options to hide the skill you do not have that is greyed out. -[/LIST] - How do I use the Carousel mode? [LIST] Use the mousewheel while hovering over the travel skill icon to change the selected skill. [/LIST] Version history: -v1.4.0 -- reintroduces a rewritten Map Window feature - thanks to @whiterabbit963 -- toggle button will no longer be out of bounds after reducing client resolution - thanks to @whiterabbit963 -- fixes error message on check untrained skills in options - thanks to @whiterabbit963 -- fixes Muster in Dale skill in DE client properly this time - thanks to @whiterabbit963 - -This introduces an important milestone - Travel Window II is now free of known bugs for the first time since it was forked from Travel Window. Huge kudos to @whiterabbit963 for making this possible. +v2.0.0 +- adds a mini window option offering an alternative interface with minimal window size +- adds skills snapping for cleaner resizing of main and mini windows +- adds slider to control speed of fadeout to min opacity +- adds the ability to save a global preset so main options can be transferred to alts +- adds option to control whether Esc closes main Travel window +- adds enable/disable all buttons in enable options tab +- adds enable/disable button for overlapping class/reputation skills in enable options tab +- sets default sort so racial & class skills come after general skills to get closer to level progression sorting +- fixes Travel Window opening behind chat and Travel Button +- fixes missing Return to Dol Amroth (Western Gondor) in DE client +- significant code cleanup under the hood for more reliable and maintainable code + +Huge kudos to @whiterabbit963 for making this release possible! Rest of changelog found [URL="https://github.com/wduda/TravelWindowII/blob/master/CHANGELOG.md"]here[/URL]. \ No newline at end of file diff --git a/screenshots/eriador-map.png b/screenshots/eriador-map.png new file mode 100644 index 0000000..89fdfee Binary files /dev/null and b/screenshots/eriador-map.png differ diff --git a/screenshots/mini-caro.png b/screenshots/mini-caro.png new file mode 100644 index 0000000..8647922 Binary files /dev/null and b/screenshots/mini-caro.png differ diff --git a/screenshots/mini-pulldown.png b/screenshots/mini-pulldown.png new file mode 100644 index 0000000..638efdd Binary files /dev/null and b/screenshots/mini-pulldown.png differ diff --git a/screenshots/options.png b/screenshots/options.png new file mode 100644 index 0000000..4c1c43f Binary files /dev/null and b/screenshots/options.png differ diff --git a/screenshots/regular-caro.png b/screenshots/regular-caro.png new file mode 100644 index 0000000..8bda326 Binary files /dev/null and b/screenshots/regular-caro.png differ diff --git a/screenshots/regular-carousel.png b/screenshots/regular-carousel.png new file mode 100644 index 0000000..003a7b0 Binary files /dev/null and b/screenshots/regular-carousel.png differ diff --git a/src/IndexedDictionary.lua b/src/IndexedDictionary.lua index d3e1720..7f97d74 100644 --- a/src/IndexedDictionary.lua +++ b/src/IndexedDictionary.lua @@ -2,7 +2,9 @@ specifically skill name, ID, label, description substring]] IndexedDictionary = class() -function IndexedDictionary:Constructor() +function IndexedDictionary:Constructor(parent) + self.parent = parent; + -- set default tables self.skillNames = {}; -- must be a list of unique names! self.skillIds = {}; @@ -29,6 +31,7 @@ function IndexedDictionary:AddSkill(name, id, label, desc) -- increase the number of datasets self.numberOfItems = self.numberOfItems + 1; + self.parent.skillCount = self.parent.skillCount + 1; -- insert the unique label into the list of skills table.insert(self.skillLabels, label); @@ -54,6 +57,7 @@ function IndexedDictionary:InsertSkill(index, name, id, label, desc) -- increase the number of datasets self.numberOfItems = self.numberOfItems + 1; + self.parent.skillCount = self.parent.skillCount + 1; -- insert the unique label into the list of skills at the specified index table.insert(self.skillLabels, index, label); @@ -82,6 +86,7 @@ function IndexedDictionary:RemoveSkillAtIndex(index) -- decrease the counters self.numberOfItems = self.numberOfItems - 1; + self.parent.skillCount = self.parent.skillCount - 1; end -- function to get the skill name at a specified index @@ -152,3 +157,33 @@ function IndexedDictionary:IndexByName(name) -- return -1 since we did not find a key return -1; end + +-- function to check if a table contains a specific element +function TableContains(tableToSearch, elementToSearchFor) + for i, value in pairs(tableToSearch) do + if (value == elementToSearchFor) then + return true; + end + end + return false; +end + +-- function to check if a table contains a specific element index +function TableIndex(tableToSearch, elementToSearchFor) + for i, value in pairs(tableToSearch) do + if (value == elementToSearchFor) then + return i; + end + end + return 0; +end + +function TableCopy(obj, seen) + if type(obj) ~= 'table' then return obj end + if seen and seen[obj] then return seen[obj] end + local s = seen or {} + local res = setmetatable({}, getmetatable(obj)) + s[obj] = res + for k, v in pairs(obj) do res[TableCopy(k, s)] = TableCopy(v, s) end + return res +end diff --git a/src/IndexedDictionaryDe.lua b/src/IndexedDictionaryDe.lua index 2ae1084..c95d030 100644 --- a/src/IndexedDictionaryDe.lua +++ b/src/IndexedDictionaryDe.lua @@ -13,18 +13,14 @@ eriadorMapTitleString = "Eriador Reiseziele"; rhovanionMapTitleString = "Rhovanion Reiseziele"; gondorMapTitleString = "Gondor Reiseziele"; --- strings for maps -glanMapString = "Genaue Karte nach Glân Vraig"; -glanMapItemString = "Genaue Karte nach Glân Vraig"; - skillNotTrainedString = "Nicht erlernte Fertigkeit: "; -- options window strings generalTabString = "Allgemein"; selectTabString = "Auswahl"; sortTabString = "Sortierung"; -hideString = "Verstecke Fenster beim Start"; -toggleString = "Zeige An/Aus-Knopf"; +hideString = "Verstecke Travel-Fenster beim Start"; +toggleString = "Zeige Travel-Knopf"; pulldownTravelString = "Reise wenn Pulldown-Fertigkeit selektiert"; hideOnTravelString = "Verstecke Fenster bei Reise"; hideOnCombatString = "Verstecke Fenster bei Kampfbeginn"; @@ -36,12 +32,21 @@ moveUpString = "hoch"; moveDownString = "runter"; moveTopString = "zum Anfang"; moveBottomString = "zum Ende"; -toggleSlidersString = "An/Aus-Knopf Transparenz"; +toggleSlidersString = "Travel-Knopf Transparenz"; mainSlidersString = "Hauptfenster Transparenz"; minString = "Min: "; maxString = "Max: "; resetSettingsString = "Rücksetzen auf Standard"; +saveGlobalDefaultsString = "Globale Standardwerte speichern"; +loadGlobalDefaultsString = "Globale Standardwerte laden"; checkSkillsString = "Nicht erlernte Fertigkeiten prüfen"; +enableRepSkillsString = "Überlappende Aktivieren"; +disableRepSkillsString = "Überlappende Deaktivieren"; +enableAllString = "Alle Aktivieren"; +disableAllString = "Alle Deaktivieren"; +ignoreEscString = "Escape schliesst Travel-Fenster nicht"; +minWindowString = "Mini-Fenster verwenden"; +fadeWindowString = "Geschwindigkeit des Fenster-Fadeouts"; -- menu strings menuFiltersString = "Filter"; @@ -66,318 +71,255 @@ menuSkillsString = "Nicht erlernte Fertigkeiten prüfen"; --[[ travel skills ]] -- --[[ Add all the travel skills ]] -- -TravelDictionaries = class() - -function TravelDictionaries:Constructor() - - -- create the indexed tables that store all the data - genLocations = IndexedDictionary(); - hunterLocations = IndexedDictionary(); - wardenLocations = IndexedDictionary(); - racialLocations = IndexedDictionary(); - repLocations = IndexedDictionary(); - creepLocations = IndexedDictionary(); - marinerLocations = IndexedDictionary(); - - -- a table to store the number of each type of travel skill - travelCount = { 0, 0, 0, 0, 0, 0, 0 }; - LocationsTotal = 0; - - self:CreateDictionaries(); - self:GetCounts(); -end - --- function to count the number of skills in total -function TravelDictionaries:GetCounts() - travelCount[1] = hunterLocations:GetCount(); - travelCount[2] = wardenLocations:GetCount(); - travelCount[3] = genLocations:GetCount(); - travelCount[4] = repLocations:GetCount(); - travelCount[5] = racialLocations:GetCount(); - travelCount[6] = creepLocations:GetCount(); - travelCount[7] = marinerLocations:GetCount(); - - LocationsTotal = travelCount[1] + travelCount[2] + travelCount[3] + travelCount[4] + travelCount[5] + travelCount[6] + travelCount[7]; -end - --- function to return the count of a specific type of travel -function TravelDictionaries:GetCount(index) - return travelCount[index]; -end - --- function to get the total number of travel skills -function TravelDictionaries:GetTotalCount() - return LocationsTotal; -end - --- function to return the 5 tables containing the travel skills -function TravelDictionaries:GetLocations() - return genLocations, hunterLocations, wardenLocations, racialLocations, repLocations, creepLocations, marinerLocations; -end - -- add the data to custom dictionaries to maintain the order -function TravelDictionaries:CreateDictionaries() +function TravelDictionary:CreateDictionaries() -- add the hunter locations - hunterLocations:AddSkill("Zurück zum Lager", "0x7000A2C1", "Zurück zum Lager"); - hunterLocations:AddSkill("Führer nach Bree", "0x70003F42", "Bree (Führer)"); - hunterLocations:AddSkill("Führer zu Thorins Halle", "0x70003F41", "Thorins Halle (Führer)"); - hunterLocations:AddSkill("Führer nach Michelbinge", "0x7000A2C3", "Michelbinge (Führer)"); - hunterLocations:AddSkill("Führer nach Esteldín", "0x70003F43", "Esteldín (Führer)"); - hunterLocations:AddSkill("Führer nach Evendim", "0x7000A2C4", "Evendim (Führer)"); - hunterLocations:AddSkill("Führer zur Feste Guruth", "0x7000A2C2", "Feste Guruth (Führer)"); - hunterLocations:AddSkill("Führer nach Bruchtal", "0x70003F44", "Bruchtal (Führer)"); - hunterLocations:AddSkill("Führer nach Sûri-kylä", "0x70017C82", "Sûri-kylä (Führer)"); - hunterLocations:AddSkill("Führer in das westliche Angmar", "0x7000A2C5", "West-Angmar (Führer)"); - hunterLocations:AddSkill("Führer nach Ost-Angmar", "0x7000A2C6", "Ost-Angmar (Führer)"); - hunterLocations:AddSkill("Führer nach Echad Dúnann", "0x70017C81", "Echad Dúnann (Führer)"); - hunterLocations:AddSkill("Führer zur Einundzwanzigsten Halle", "0x70017C7A", "Einundzwanzigste Halle (Führer)"); - hunterLocations:AddSkill("Führer zur Dunkelsenke", "0x7001F459", "Dunkelsenke (Führer)"); - hunterLocations:AddSkill("Führer nach Harndirion", "0x700235EF", "Harndirion (Führer)"); - hunterLocations:AddSkill("Führer nach Galtrev", "0x7002A93F", "Galtrev (Führer)"); - hunterLocations:AddSkill("Führer nach Stangard", "0x7002C62C", "Stangard (Führer)"); - hunterLocations:AddSkill("Führer nach Caras Galadhon", "0x7002E754", "Caras Galadhon (Führer)"); - hunterLocations:AddSkill("Führer ins Nebelgebirge", "0x7002E756", "Nebelgebirge (Führer)"); - hunterLocations:AddSkill("Führer nach Schneegrenze", "0x7003198E", "Schneegrenze (Führer)"); - hunterLocations:AddSkill("Führer nach Forlach", "0x70036B5D", "Forlach (Führer)"); - hunterLocations:AddSkill("Führer nach Aldburg", "0x7003DC71", "Aldburg (Führer)"); - hunterLocations:AddSkill("Führer nach Helms Klamm", "0x7003DC72", "Helms Klamm (Führer)"); - hunterLocations:AddSkill("Führer nach Dol Amroth", "0x70041197", "Dol Amroth (Führer)", - "nach Dol Amroth."); - hunterLocations:AddSkill("Führer nach Arnach", "0x70043A63", "Arnach (Führer)"); - hunterLocations:AddSkill("Führer nach Minas Tirith", "0x70044985", "Minas Tirith (Führer)"); - hunterLocations:AddSkill("Führer zum Kriegslager der Rohirrim", "0x700459AF", "Kriegslager der Rohirrim (Führer)"); - hunterLocations:AddSkill("Führer zum schlachtgezeichneten Minas Tirith", "0x70046CBB", "Minas Tirith nach der Schlacht (Führer)"); - hunterLocations:AddSkill("Führer zu Henneth Annûn", "0x70047077", "Henneth Annûn (Führer)"); - hunterLocations:AddSkill("Führer zum schlachtgezeichneten Osgiliath", "0x70047074", "Osgiliath nach der Schlacht (Führer)"); - hunterLocations:AddSkill("Führer zum Lager des Heeres", "0x70047BFA", "Lager des Heeres (Führer)"); - hunterLocations:AddSkill("Führer nach Haerondir", "0x70047C1D", "Haerondir (Führer)"); - hunterLocations:AddSkill("Führer zum Udûn-Brückenkopf", "0x7004AE1E", "Udûn-Brückenkopf (Führer)"); - hunterLocations:AddSkill("Führer nach Thal", "0x7004D73B", "Thal (Führer)"); - hunterLocations:AddSkill("Führer nach Járnfast", "0x7004FACC", "Járnfast (Führer)"); - hunterLocations:AddSkill("Führer nach Skarháld", "0x7004FACB", "Skarháld (Führer)"); - hunterLocations:AddSkill("Führer nach Beorningerhús", "0x70052F07", "Beorningerhús (Führer)"); - hunterLocations:AddSkill("Leitfaden für Hultvís", "0x70052F08", "Hultvís (Führer)"); - hunterLocations:AddSkill("Führer nach Estolad Lân", "0x700551F4", "Estolad Lân (Führer)"); - hunterLocations:AddSkill("Führer nach Limlók", "0x7005762D", "Limlók (Führer)"); - hunterLocations:AddSkill("Führer nach Annâk-khurfu", "0x70058571", "Annâk-khurfu (Führer)"); - hunterLocations:AddSkill("Führer zum Händlerkai", "0x70059D0C", "Händlerkai (Führer)"); - hunterLocations:AddSkill("Führer nach Schragen", "0x70059D16", "Schragen (Führer)"); - hunterLocations:AddSkill("Führer nach Akrâz-zahar", "0x7005AA91", "Akrâz-zahar (Führer)"); - hunterLocations:AddSkill("Führer nach Azanulbizar", "0x7005AA95", "Azanulbizar (Führer)"); - hunterLocations:AddSkill("Führer zum Prachttor", "0x7005D487", "Prachttor (Führer)"); - hunterLocations:AddSkill("Führer nach Leitstáth", "0x7005D47D", "Leitstáth (Führer)"); - hunterLocations:AddSkill("Führer nach Tornhad", "0x70060EA6", "Tornhad (Führer)"); - hunterLocations:AddSkill("Führer nach Neuhausen", "0x7006133F", "Neuhausen (Führer)"); - hunterLocations:AddSkill("Führer nach Andrath", "0x7006323C", "Andrath (Führer)"); - hunterLocations:AddSkill("Führer nach Schwanenfleet", "0x700634AA", "Schwanenfleet (Führer)"); - hunterLocations:AddSkill("Führer nach Cardolan", "0x700634A7", "Cardolan (Führer)"); - hunterLocations:AddSkill("Führer nach Carn Dûm", "0x70064AC8", "Carn Dûm (Führer)"); - hunterLocations:AddSkill("Führer nach Clegur", "0x70064F4C", "Clegur (Führer)"); - hunterLocations:AddSkill("Führer nach Pelargir", "0x700658EA", "Pelargir (Führer)"); - hunterLocations:AddSkill("Führer nach Dol Amroth", "0x70068711", "Königreich Dol Amroth (Führer U38)", - "Königreich Gondor"); - hunterLocations:AddSkill("Führer nach Halrax", "0x70068713", "Halrax (Führer)"); - hunterLocations:AddSkill("Führer nach Lond Cirion", "0x70068717", "Lond Cirion (Führer)"); - hunterLocations:AddSkill("Führer nach Umbar", "0x70068718", "Umbar (Führer)"); - hunterLocations:AddSkill("Führer nach Jax Phanâl", "0x70068719", "Jax Phanâl (Führer)"); - hunterLocations:AddSkill("Führer zur Taverne \"Zum Blutigen Adler\"", "0x700697EF", "Zum Blutigen Adler (Führer)"); + self.hunter:AddSkill("Zurück zum Lager", "0x7000A2C1", "Zurück zum Lager"); + self.hunter:AddSkill("Führer nach Bree", "0x70003F42", "Bree (Führer)"); + self.hunter:AddSkill("Führer zu Thorins Halle", "0x70003F41", "Thorins Halle (Führer)"); + self.hunter:AddSkill("Führer nach Michelbinge", "0x7000A2C3", "Michelbinge (Führer)"); + self.hunter:AddSkill("Führer nach Esteldín", "0x70003F43", "Esteldín (Führer)"); + self.hunter:AddSkill("Führer nach Evendim", "0x7000A2C4", "Evendim (Führer)"); + self.hunter:AddSkill("Führer zur Feste Guruth", "0x7000A2C2", "Feste Guruth (Führer)"); + self.hunter:AddSkill("Führer nach Bruchtal", "0x70003F44", "Bruchtal (Führer)"); + self.hunter:AddSkill("Führer nach Sûri-kylä", "0x70017C82", "Sûri-kylä (Führer)"); + self.hunter:AddSkill("Führer in das westliche Angmar", "0x7000A2C5", "West-Angmar (Führer)"); + self.hunter:AddSkill("Führer nach Ost-Angmar", "0x7000A2C6", "Ost-Angmar (Führer)"); + self.hunter:AddSkill("Führer nach Echad Dúnann", "0x70017C81", "Echad Dúnann (Führer)"); + self.hunter:AddSkill("Führer zur Einundzwanzigsten Halle", "0x70017C7A", "Einundzwanzigste Halle (Führer)"); + self.hunter:AddSkill("Führer zur Dunkelsenke", "0x7001F459", "Dunkelsenke (Führer)"); + self.hunter:AddSkill("Führer nach Harndirion", "0x700235EF", "Harndirion (Führer)"); + self.hunter:AddSkill("Führer nach Galtrev", "0x7002A93F", "Galtrev (Führer)"); + self.hunter:AddSkill("Führer nach Stangard", "0x7002C62C", "Stangard (Führer)"); + self.hunter:AddSkill("Führer nach Caras Galadhon", "0x7002E754", "Caras Galadhon (Führer)"); + self.hunter:AddSkill("Führer ins Nebelgebirge", "0x7002E756", "Nebelgebirge (Führer)"); + self.hunter:AddSkill("Führer nach Schneegrenze", "0x7003198E", "Schneegrenze (Führer)"); + self.hunter:AddSkill("Führer nach Forlach", "0x70036B5D", "Forlach (Führer)"); + self.hunter:AddSkill("Führer nach Aldburg", "0x7003DC71", "Aldburg (Führer)"); + self.hunter:AddSkill("Führer nach Helms Klamm", "0x7003DC72", "Helms Klamm (Führer)"); + self.hunter:AddSkill("Führer nach Dol Amroth", "0x70041197", "Dol Amroth (Führer)", "nach Dol Amroth."); + self.hunter:AddSkill("Führer nach Arnach", "0x70043A63", "Arnach (Führer)"); + self.hunter:AddSkill("Führer nach Minas Tirith", "0x70044985", "Minas Tirith (Führer)"); + self.hunter:AddSkill("Führer zum Kriegslager der Rohirrim", "0x700459AF", "Kriegslager der Rohirrim (Führer)"); + self.hunter:AddSkill("Führer zum schlachtgezeichneten Minas Tirith", "0x70046CBB", "Minas Tirith nach der Schlacht (Führer)"); + self.hunter:AddSkill("Führer zu Henneth Annûn", "0x70047077", "Henneth Annûn (Führer)"); + self.hunter:AddSkill("Führer zum schlachtgezeichneten Osgiliath", "0x70047074", "Osgiliath nach der Schlacht (Führer)"); + self.hunter:AddSkill("Führer zum Lager des Heeres", "0x70047BFA", "Lager des Heeres (Führer)"); + self.hunter:AddSkill("Führer nach Haerondir", "0x70047C1D", "Haerondir (Führer)"); + self.hunter:AddSkill("Führer zum Udûn-Brückenkopf", "0x7004AE1E", "Udûn-Brückenkopf (Führer)"); + self.hunter:AddSkill("Führer nach Thal", "0x7004D73B", "Thal (Führer)"); + self.hunter:AddSkill("Führer nach Járnfast", "0x7004FACC", "Járnfast (Führer)"); + self.hunter:AddSkill("Führer nach Skarháld", "0x7004FACB", "Skarháld (Führer)"); + self.hunter:AddSkill("Führer nach Beorningerhús", "0x70052F07", "Beorningerhús (Führer)"); + self.hunter:AddSkill("Leitfaden für Hultvís", "0x70052F08", "Hultvís (Führer)"); + self.hunter:AddSkill("Führer nach Estolad Lân", "0x700551F4", "Estolad Lân (Führer)"); + self.hunter:AddSkill("Führer nach Limlók", "0x7005762D", "Limlók (Führer)"); + self.hunter:AddSkill("Führer nach Annâk-khurfu", "0x70058571", "Annâk-khurfu (Führer)"); + self.hunter:AddSkill("Führer zum Händlerkai", "0x70059D0C", "Händlerkai (Führer)"); + self.hunter:AddSkill("Führer nach Schragen", "0x70059D16", "Schragen (Führer)"); + self.hunter:AddSkill("Führer nach Akrâz-zahar", "0x7005AA91", "Akrâz-zahar (Führer)"); + self.hunter:AddSkill("Führer nach Azanulbizar", "0x7005AA95", "Azanulbizar (Führer)"); + self.hunter:AddSkill("Führer zum Prachttor", "0x7005D487", "Prachttor (Führer)"); + self.hunter:AddSkill("Führer nach Leitstáth", "0x7005D47D", "Leitstáth (Führer)"); + self.hunter:AddSkill("Führer nach Tornhad", "0x70060EA6", "Tornhad (Führer)"); + self.hunter:AddSkill("Führer nach Neuhausen", "0x7006133F", "Neuhausen (Führer)"); + self.hunter:AddSkill("Führer nach Andrath", "0x7006323C", "Andrath (Führer)"); + self.hunter:AddSkill("Führer nach Schwanenfleet", "0x700634AA", "Schwanenfleet (Führer)"); + self.hunter:AddSkill("Führer nach Cardolan", "0x700634A7", "Cardolan (Führer)"); + self.hunter:AddSkill("Führer nach Carn Dûm", "0x70064AC8", "Carn Dûm (Führer)"); + self.hunter:AddSkill("Führer nach Clegur", "0x70064F4C", "Clegur (Führer)"); + self.hunter:AddSkill("Führer nach Pelargir", "0x700658EA", "Pelargir (Führer)"); + self.hunter:AddSkill("Führer nach Dol Amroth", "0x70068711", "Königreich Dol Amroth (Führer U38)", "Königreich Gondor"); + self.hunter:AddSkill("Führer nach Halrax", "0x70068713", "Halrax (Führer)"); + self.hunter:AddSkill("Führer nach Lond Cirion", "0x70068717", "Lond Cirion (Führer)"); + self.hunter:AddSkill("Führer nach Umbar", "0x70068718", "Umbar (Führer)"); + self.hunter:AddSkill("Führer nach Jax Phanâl", "0x70068719", "Jax Phanâl (Führer)"); + self.hunter:AddSkill("Führer zur Taverne \"Zum Blutigen Adler\"", "0x700697EF", "Zum Blutigen Adler (Führer)"); -- add the Warden locations - wardenLocations:AddSkill("Appell in der Feste Guruth", "0x70014786", "Feste Guruth (Appell)"); - wardenLocations:AddSkill("Appell in Esteldín", "0x70014798", "Esteldín (Appell)"); - wardenLocations:AddSkill("Appell in Evendim", "0x7001478E", "Evendim (Appell)"); - wardenLocations:AddSkill("Appell in Bruchtal", "0x70014791", "Bruchtal (Appell)"); - wardenLocations:AddSkill("Appell in Sûri-kylä", "0x700237D4", "Sûri-kylä (Appell)"); - wardenLocations:AddSkill("Appell in der Einundzwanzigsten Halle", "0x7001819E", "21. Halle (Appell)"); - wardenLocations:AddSkill("Appell in der Dunkelsenke", "0x7001F45C", "Dunkelsenke (Appell)"); - wardenLocations:AddSkill("Appell in Harndirion", "0x700235EB", "Harndirion (Appell)"); - wardenLocations:AddSkill("Appell in Galtrev", "0x7002A90A", "Galtrev (Appell)"); - wardenLocations:AddSkill("Appell in Stangard", "0x7002C646", "Stangard (Appell)"); - wardenLocations:AddSkill("Appell in Caras Galadhon", "0x700303DF", "Caras Galadhon (Appell)"); - wardenLocations:AddSkill("Appell im Nebelgebirge", "0x700303DD", "Nebelgebirge (Appell)"); - wardenLocations:AddSkill("Appell in Schneegrenze", "0x7003198D", "Schneegrenze (Appell)"); - wardenLocations:AddSkill("Appell in Forlach", "0x70036B5B", "Forlach (Appell)"); - wardenLocations:AddSkill("Appell in Aldburg", "0x7003DC7A", "Aldburg (Appell)"); - wardenLocations:AddSkill("Appell in Helms Klamm", "0x7003DC79", "Helms Klamm (Appell)"); - wardenLocations:AddSkill("Appell in Dol Amroth", "0x70041198", "Dol Amroth (Appell)", - "West-Gondor zu reisen"); - wardenLocations:AddSkill("Appell in Arnach", "0x70043A66", "Arnach (Appell)"); - wardenLocations:AddSkill("Appell in Minas Tirith", "0x70044982", "Minas Tirith (Appell)"); - wardenLocations:AddSkill("Appell im Kriegslager", "0x700459AA", "Kriegslager der Rohirrim (Appell)"); - wardenLocations:AddSkill("Appell im schlachtgezeichneten Minas Tirith", "0x70046CBF", "Minas Tirith nach der Schlacht (Appell)"); - wardenLocations:AddSkill("Appell in Henneth Annûn", "0x70047075", "Henneth Annûn (Appell)"); - wardenLocations:AddSkill("Appell im schlachtgezeichneten Osgiliath", "0x70047076", "Osgiliath nach der Schlacht (Appell)"); - wardenLocations:AddSkill("Appell im Lager des Heeres", "0x70047BFC", "Lager des Heeres (Appell)"); - wardenLocations:AddSkill("Appell in Haerondir", "0x70047C23", "Haerondir (Appell)"); - wardenLocations:AddSkill("Appell am Udûn-Brückenkopf", "0x7004AE1F", "Udûn-Brückenkopf (Appell)"); - wardenLocations:AddSkill("Appell in Thal", "0x7004D73A", "Thal (Appell)"); - wardenLocations:AddSkill("Appell in Járnfast", "0x7004FACA", "Jarnfast (Appell)"); - wardenLocations:AddSkill("Appell in Skarháld", "0x7004FACD", "Skarhald (Appell)"); - wardenLocations:AddSkill("Appell im Beorningerhús", "0x70052F0A", "Beorningerhús (Appell)"); - wardenLocations:AddSkill("Appell in Hultvís", "0x70052F06", "Hultvís (Appell)"); - wardenLocations:AddSkill("Appell in Estolad Lân", "0x700551F2", "Estolad Lân (Appell)"); - wardenLocations:AddSkill("Appell in Limlók", "0x70057635", "Limlók (Appell)"); - wardenLocations:AddSkill("Appell in Annâk-khurfu", "0x70058572", "Annâk-khurfu (Appell)"); - wardenLocations:AddSkill("Appell am Händlerkai", "0x70059D09", "Händlerkai (Appell)"); - wardenLocations:AddSkill("Appell in Schragen", "0x70059D10", "Schragen (Appell)"); - wardenLocations:AddSkill("Appell in Akrâz-zahar", "0x7005AA8F", "Akrâz-zahar (Appell)"); - wardenLocations:AddSkill("Appell in Azanulbizar", "0x7005AA8C", "Azanulbizar (Appell)"); - wardenLocations:AddSkill("Appell am Prachttor", "0x7005D48A", "Prachttor (Appell)"); - wardenLocations:AddSkill("Appell in Leitstáth", "0x7005D488", "Leitstáth (Appell)"); - wardenLocations:AddSkill("Appell in Tornhad", "0x70060EA5", "Tornhad (Appell)"); - wardenLocations:AddSkill("Appell in Neuhausen", "0x7006133E", "Neuhausen (Appell)"); - wardenLocations:AddSkill("Appell in Andrath", "0x70063242", "Andrath (Appell)"); - wardenLocations:AddSkill("Appell in Schwanenfleet", "0x700634B6", "Schwanenfleet (Appell)"); - wardenLocations:AddSkill("Appell in Cardolan", "0x700634AD", "Cardolan (Appell)"); - wardenLocations:AddSkill("Appell in Carn Dûm", "0x70064ACB", "Carn Dûm (Appell)"); - wardenLocations:AddSkill("Appell in Clegur", "0x70064F4D", "Clegur (Appell)"); - wardenLocations:AddSkill("Heerschau in Pelargir", "0x700658E8", "Pelargir (Appell)"); - wardenLocations:AddSkill("Appell in Jax Phanâl","0x7006870C", "Jax Phanâl (Appell)"); - wardenLocations:AddSkill("Appell in Umbar","0x7006870F","Umbar (Appell)"); - wardenLocations:AddSkill("Appell in Halrax","0x70068710", "Halrax (Appell)"); - wardenLocations:AddSkill("Appell in Dol Amroth","0x70068712", "Königreich Dol Amroth (Appell)", - "Königreich Gondor"); - wardenLocations:AddSkill("Appell in Lond Cirion","0x70068715", "Lond Cirion (Appell)"); - wardenLocations:AddSkill("Appell in der Taverne \"Zum Blutigen Adler\"","0x700697F3", "Zum Blutigen Adler (Appell)"); + self.warden:AddSkill("Appell in der Feste Guruth", "0x70014786", "Feste Guruth (Appell)"); + self.warden:AddSkill("Appell in Esteldín", "0x70014798", "Esteldín (Appell)"); + self.warden:AddSkill("Appell in Evendim", "0x7001478E", "Evendim (Appell)"); + self.warden:AddSkill("Appell in Bruchtal", "0x70014791", "Bruchtal (Appell)"); + self.warden:AddSkill("Appell in Sûri-kylä", "0x700237D4", "Sûri-kylä (Appell)"); + self.warden:AddSkill("Appell in der Einundzwanzigsten Halle", "0x7001819E", "21. Halle (Appell)"); + self.warden:AddSkill("Appell in der Dunkelsenke", "0x7001F45C", "Dunkelsenke (Appell)"); + self.warden:AddSkill("Appell in Harndirion", "0x700235EB", "Harndirion (Appell)"); + self.warden:AddSkill("Appell in Galtrev", "0x7002A90A", "Galtrev (Appell)"); + self.warden:AddSkill("Appell in Stangard", "0x7002C646", "Stangard (Appell)"); + self.warden:AddSkill("Appell in Caras Galadhon", "0x700303DF", "Caras Galadhon (Appell)"); + self.warden:AddSkill("Appell im Nebelgebirge", "0x700303DD", "Nebelgebirge (Appell)"); + self.warden:AddSkill("Appell in Schneegrenze", "0x7003198D", "Schneegrenze (Appell)"); + self.warden:AddSkill("Appell in Forlach", "0x70036B5B", "Forlach (Appell)"); + self.warden:AddSkill("Appell in Aldburg", "0x7003DC7A", "Aldburg (Appell)"); + self.warden:AddSkill("Appell in Helms Klamm", "0x7003DC79", "Helms Klamm (Appell)"); + self.warden:AddSkill("Appell in Dol Amroth", "0x70041198", "Dol Amroth (Appell)", "West-Gondor zu reisen"); + self.warden:AddSkill("Appell in Arnach", "0x70043A66", "Arnach (Appell)"); + self.warden:AddSkill("Appell in Minas Tirith", "0x70044982", "Minas Tirith (Appell)"); + self.warden:AddSkill("Appell im Kriegslager", "0x700459AA", "Kriegslager der Rohirrim (Appell)"); + self.warden:AddSkill("Appell im schlachtgezeichneten Minas Tirith", "0x70046CBF", "Minas Tirith nach der Schlacht (Appell)"); + self.warden:AddSkill("Appell in Henneth Annûn", "0x70047075", "Henneth Annûn (Appell)"); + self.warden:AddSkill("Appell im schlachtgezeichneten Osgiliath", "0x70047076", "Osgiliath nach der Schlacht (Appell)"); + self.warden:AddSkill("Appell im Lager des Heeres", "0x70047BFC", "Lager des Heeres (Appell)"); + self.warden:AddSkill("Appell in Haerondir", "0x70047C23", "Haerondir (Appell)"); + self.warden:AddSkill("Appell am Udûn-Brückenkopf", "0x7004AE1F", "Udûn-Brückenkopf (Appell)"); + self.warden:AddSkill("Appell in Thal", "0x7004D73A", "Thal (Appell)"); + self.warden:AddSkill("Appell in Járnfast", "0x7004FACA", "Jarnfast (Appell)"); + self.warden:AddSkill("Appell in Skarháld", "0x7004FACD", "Skarhald (Appell)"); + self.warden:AddSkill("Appell im Beorningerhús", "0x70052F0A", "Beorningerhús (Appell)"); + self.warden:AddSkill("Appell in Hultvís", "0x70052F06", "Hultvís (Appell)"); + self.warden:AddSkill("Appell in Estolad Lân", "0x700551F2", "Estolad Lân (Appell)"); + self.warden:AddSkill("Appell in Limlók", "0x70057635", "Limlók (Appell)"); + self.warden:AddSkill("Appell in Annâk-khurfu", "0x70058572", "Annâk-khurfu (Appell)"); + self.warden:AddSkill("Appell am Händlerkai", "0x70059D09", "Händlerkai (Appell)"); + self.warden:AddSkill("Appell in Schragen", "0x70059D10", "Schragen (Appell)"); + self.warden:AddSkill("Appell in Akrâz-zahar", "0x7005AA8F", "Akrâz-zahar (Appell)"); + self.warden:AddSkill("Appell in Azanulbizar", "0x7005AA8C", "Azanulbizar (Appell)"); + self.warden:AddSkill("Appell am Prachttor", "0x7005D48A", "Prachttor (Appell)"); + self.warden:AddSkill("Appell in Leitstáth", "0x7005D488", "Leitstáth (Appell)"); + self.warden:AddSkill("Appell in Tornhad", "0x70060EA5", "Tornhad (Appell)"); + self.warden:AddSkill("Appell in Neuhausen", "0x7006133E", "Neuhausen (Appell)"); + self.warden:AddSkill("Appell in Andrath", "0x70063242", "Andrath (Appell)"); + self.warden:AddSkill("Appell in Schwanenfleet", "0x700634B6", "Schwanenfleet (Appell)"); + self.warden:AddSkill("Appell in Cardolan", "0x700634AD", "Cardolan (Appell)"); + self.warden:AddSkill("Appell in Carn Dûm", "0x70064ACB", "Carn Dûm (Appell)"); + self.warden:AddSkill("Appell in Clegur", "0x70064F4D", "Clegur (Appell)"); + self.warden:AddSkill("Heerschau in Pelargir", "0x700658E8", "Pelargir (Appell)"); + self.warden:AddSkill("Appell in Jax Phanâl","0x7006870C", "Jax Phanâl (Appell)"); + self.warden:AddSkill("Appell in Umbar","0x7006870F","Umbar (Appell)"); + self.warden:AddSkill("Appell in Halrax","0x70068710", "Halrax (Appell)"); + self.warden:AddSkill("Appell in Dol Amroth","0x70068712", "Königreich Dol Amroth (Appell)", "Königreich Gondor"); + self.warden:AddSkill("Appell in Lond Cirion","0x70068715", "Lond Cirion (Appell)"); + self.warden:AddSkill("Appell in der Taverne \"Zum Blutigen Adler\"","0x700697F3", "Zum Blutigen Adler (Appell)"); -- add the Mariner locations - marinerLocations:AddSkill("Segelt nach Celondim", "0x70066100", "Celondim (Segeln)") - marinerLocations:AddSkill("Segelt in die Braunen Lande", "0x70066101", "Braune Lande (Segeln)") - marinerLocations:AddSkill("Segelt zum Händlerkai", "0x70066105", "Händlerkai (Segel)") - marinerLocations:AddSkill("Segelt ins schlachtgezeichnete Osgiliath", "0x70066109", "Schlachtgezeichnetes Osgiliath (Segeln)") - marinerLocations:AddSkill("Segelt nach Seestadt.", "0x7006610C", "Seestadt (Segeln)") - marinerLocations:AddSkill("Segelt zur Dunkelsenke", "0x7006610E", "Dunkelsenke (Segeln)") - marinerLocations:AddSkill("Segelt nach Tinnudir", "0x7006610F", "Tinnundir (Segeln)") - marinerLocations:AddSkill("Segelt nach Dol Amroth", "0x70066117", "Dol Amroth (Segeln)", - "nach Dol Amroth.") - marinerLocations:AddSkill("Segelt nach Bockland", "0x7006611A", "Bockland (Segeln)") - marinerLocations:AddSkill("Segelt nach Pelargir", "0x7006611B", "Pelargir (Segeln)") - marinerLocations:AddSkill("Segelt nach Sûri-kylä", "0x7006611C", "Sûri-kylä (Segeln)") - marinerLocations:AddSkill("Segelt nach Lothlórien", "0x7006611E", "Lothlórien (Segeln)") - marinerLocations:AddSkill("Nach Tharbad segeln", "0x70066120", "Tharbad (Segeln)") - marinerLocations:AddSkill("Segelt nach Schneegrenze", "0x70066121", "Schneegrenze (Segeln)") - marinerLocations:AddSkill("Nach Umbar segeln", "0x700687BB", "Umbar (Segeln)") - marinerLocations:AddSkill("Nach Lond Cirion segeln", "0x700687BD", "Lond Cirion (Segeln)") - marinerLocations:AddSkill("Nach Jax Phanâl segeln", "0x700687C0", "Jax Phanâl (Segeln)") - marinerLocations:AddSkill("Segelt nach Dol Amroth", "0x700687C1", "Königreich Dol Amroth (Segeln)", - "Königreich Gondor") - marinerLocations:AddSkill("Nach Halrax segeln", "0x700687C3", "Halrax (Segeln)") + self.mariner:AddSkill("Segelt nach Celondim", "0x70066100", "Celondim (Segeln)") + self.mariner:AddSkill("Segelt in die Braunen Lande", "0x70066101", "Braune Lande (Segeln)") + self.mariner:AddSkill("Segelt zum Händlerkai", "0x70066105", "Händlerkai (Segel)") + self.mariner:AddSkill("Segelt ins schlachtgezeichnete Osgiliath", "0x70066109", "Schlachtgezeichnetes Osgiliath (Segeln)") + self.mariner:AddSkill("Segelt nach Seestadt.", "0x7006610C", "Seestadt (Segeln)") + self.mariner:AddSkill("Segelt zur Dunkelsenke", "0x7006610E", "Dunkelsenke (Segeln)") + self.mariner:AddSkill("Segelt nach Tinnudir", "0x7006610F", "Tinnundir (Segeln)") + self.mariner:AddSkill("Segelt nach Dol Amroth", "0x70066117", "Dol Amroth (Segeln)", "nach Dol Amroth.") + self.mariner:AddSkill("Segelt nach Bockland", "0x7006611A", "Bockland (Segeln)") + self.mariner:AddSkill("Segelt nach Pelargir", "0x7006611B", "Pelargir (Segeln)") + self.mariner:AddSkill("Segelt nach Sûri-kylä", "0x7006611C", "Sûri-kylä (Segeln)") + self.mariner:AddSkill("Segelt nach Lothlórien", "0x7006611E", "Lothlórien (Segeln)") + self.mariner:AddSkill("Nach Tharbad segeln", "0x70066120", "Tharbad (Segeln)") + self.mariner:AddSkill("Segelt nach Schneegrenze", "0x70066121", "Schneegrenze (Segeln)") + self.mariner:AddSkill("Nach Umbar segeln", "0x700687BB", "Umbar (Segeln)") + self.mariner:AddSkill("Nach Lond Cirion segeln", "0x700687BD", "Lond Cirion (Segeln)") + self.mariner:AddSkill("Nach Jax Phanâl segeln", "0x700687C0", "Jax Phanâl (Segeln)") + self.mariner:AddSkill("Segelt nach Dol Amroth", "0x700687C1", "Königreich Dol Amroth (Segeln)", "Königreich Gondor") + self.mariner:AddSkill("Nach Halrax segeln", "0x700687C3", "Halrax (Segeln)") - racialLocations:AddSkill("Rückkehr nach Bree", "0x700062F6", "Bree (Rasse)", - "Ihr könnt schnell nach Bree"); - racialLocations:AddSkill("Rückkehr ins Auenland", "0x700062C8", "Michelbinge (Rasse)"); - racialLocations:AddSkill("Rückkehr zu Thorins Tor", "0x70006346", "Thorins Tor (Rasse Zwerg)", - "Hiermit gelangt Ihr schnell"); - racialLocations:AddSkill("Rückkehr nach Bruchtal", "0x7000631F", "Bruchtal (Rasse)", - "Hiermit gelangt Ihr schnell"); - racialLocations:AddSkill("Zum 1. Heim zurückkehren", "0x70041A22", "Grimbeorns Hütte (Rasse)"); - racialLocations:AddSkill("Reise nach Caras Galadhon in Lothlórien", "0x70048C8C", "Caras Galadhon (Rasse)"); - racialLocations:AddSkill("Reise zu Thorins Halle", "0x70053C0F", "Thorins Halle (Rasse Starkaxt)"); - racialLocations:AddSkill("Kehrt zu Lyndelby zurück.", "0x70066D31", "Lyndelby (Rasse)") + -- add the racial travel skills + self.allRaces:AddSkill("Rückkehr nach Bree", "0x700062F6", "Bree (Rasse)", "Ihr könnt schnell nach Bree"); + self.allRaces:AddSkill("Rückkehr ins Auenland", "0x700062C8", "Michelbinge (Rasse)"); + self.allRaces:AddSkill("Rückkehr zu Thorins Tor", "0x70006346", "Thorins Tor (Rasse Zwerg)", "Hiermit gelangt Ihr schnell"); + self.allRaces:AddSkill("Rückkehr nach Bruchtal", "0x7000631F", "Bruchtal (Rasse)", "Hiermit gelangt Ihr schnell"); + self.allRaces:AddSkill("Zum 1. Heim zurückkehren", "0x70041A22", "Grimbeorns Hütte (Rasse)"); + self.allRaces:AddSkill("Reise nach Caras Galadhon in Lothlórien", "0x70048C8C", "Caras Galadhon (Rasse)"); + self.allRaces:AddSkill("Reise zu Thorins Halle", "0x70053C0F", "Thorins Halle (Rasse Starkaxt)"); + self.allRaces:AddSkill("Kehrt zu Lyndelby zurück.", "0x70066D31", "Lyndelby (Rasse)") - genLocations:AddSkill("Zum 1. Heim zurückkehren", "0x700256BA", "1. Markstein"); - genLocations:AddSkill("Zum 2. Heim zurückkehren", "0x70025792", "2. Markstein"); - genLocations:AddSkill("Zum 3. Heim zurückkehren", "0x70025793", "3. Markstein"); - genLocations:AddSkill("Zum 4. Heim zurückkehren", "0x70025794", "4. Markstein"); - genLocations:AddSkill("Zum 5. Heim zurückkehren", "0x70025795", "5. Markstein"); - genLocations:AddSkill("Zum 6. Heim zurückkehren", "0x70025796", "6. Markstein"); - genLocations:AddSkill("Zum 7. Heim zurückkehren", "0x7002FF62", "7. Markstein"); - genLocations:AddSkill("Zum 8. Heim zurückkehren", "0x7002FF61", "8. Markstein"); - genLocations:AddSkill("Zum 9. Heim zurückkehren", "0x7002FF60", "9. Markstein"); - genLocations:AddSkill("Zum 10. Heim zurückkehren", "0x7002FF5F", "10. Markstein"); - genLocations:AddSkill("Zum 11. Heim zurückkehren", "0x7002FF63", "11. Markstein"); - genLocations:AddSkill("Reist zu Eurem eigenen Heim", "0x7000D046", "Eigenes Heim"); - genLocations:AddSkill("Reist zu Eurem Premiumheim", "0x70046EE4", "Premiumheim"); - genLocations:AddSkill("Reist zum Haus Eurer Sippe", "0x7000D047", "Heim Eurer Sippe"); - genLocations:AddSkill("Zum Haus des Sippenmitglieds reisen", "0x70057C36", "Heim des Sippenmitglieds"); + -- add the Return Home and housing skills + self.gen:AddSkill("Zum 1. Heim zurückkehren", "0x700256BA", "1. Markstein"); + self.gen:AddSkill("Zum 2. Heim zurückkehren", "0x70025792", "2. Markstein"); + self.gen:AddSkill("Zum 3. Heim zurückkehren", "0x70025793", "3. Markstein"); + self.gen:AddSkill("Zum 4. Heim zurückkehren", "0x70025794", "4. Markstein"); + self.gen:AddSkill("Zum 5. Heim zurückkehren", "0x70025795", "5. Markstein"); + self.gen:AddSkill("Zum 6. Heim zurückkehren", "0x70025796", "6. Markstein"); + self.gen:AddSkill("Zum 7. Heim zurückkehren", "0x7002FF62", "7. Markstein"); + self.gen:AddSkill("Zum 8. Heim zurückkehren", "0x7002FF61", "8. Markstein"); + self.gen:AddSkill("Zum 9. Heim zurückkehren", "0x7002FF60", "9. Markstein"); + self.gen:AddSkill("Zum 10. Heim zurückkehren", "0x7002FF5F", "10. Markstein"); + self.gen:AddSkill("Zum 11. Heim zurückkehren", "0x7002FF63", "11. Markstein"); + self.gen:AddSkill("Reist zu Eurem eigenen Heim", "0x7000D046", "Eigenes Heim"); + self.gen:AddSkill("Reist zu Eurem Premiumheim", "0x70046EE4", "Premiumheim"); + self.gen:AddSkill("Reist zum Haus Eurer Sippe", "0x7000D047", "Heim Eurer Sippe"); + self.gen:AddSkill("Zum Haus des Sippenmitglieds reisen", "0x70057C36", "Heim des Sippenmitglieds"); - repLocations:AddSkill("Rückkehr zu Thorins Tor", "0x7001BF91", "Thorins Tor (Ruf)", - "Dank Eurer Freundschaft"); - repLocations:AddSkill("Rückkehr nach Bree", "0x7001BF90", "Bree (Ruf)", - "Dank Eurer Freundschaft"); - repLocations:AddSkill("Kehrt zu Lalias Markt zurück", "0x700364B1", "Lalias Markt (Mithril)"); - repLocations:AddSkill("Rückkehr nach Michelbinge", "0x70023262", "Michelbinge (Shop)"); - repLocations:AddSkill("Rückkehr nach Bruchtal", "0x70023263", "Bruchtal (Shop)", - "Dank Eurer Freundschaft"); - repLocations:AddSkill("Rückkehr zur Feste Guruth", "0x70020441", "Feste Guruth (Ruf)"); - repLocations:AddSkill("Rückkehr zum Düsterwald", "0x7001F374", "Düsterwald (Ruf)"); - repLocations:AddSkill("Rückkehr nach Enedwaith", "0x70021FA2", "Enedwaith (Ruf)"); - repLocations:AddSkill("Kehrt nach Galtrev zurück", "0x7002C647", "Galtrev (Ruf)"); - repLocations:AddSkill("Kehrt nach Stangard zurück", "0x7002C65D", "Stangard (Ruf)"); - repLocations:AddSkill("Kehrt nach Schneegrenze zurück", "0x70031A46", "Schneegrenze (Ruf)"); - repLocations:AddSkill("Rückkehr nach Forlach", "0x70036B5E", "Forlach (Ruf)"); - repLocations:AddSkill("Kehrt nach Aldburg zurück", "0x7003DC81", "Aldburg (Ruf)"); - repLocations:AddSkill("Rückkehr ins Geheimnistal", "0x7004128F", "Geheimnistal (Ruf)"); - repLocations:AddSkill("Kehrt nach Helms Klamm zurück", "0x7003DC82", "Helms Klamm (Ruf)"); - repLocations:AddSkill("Rückkehr nach Dol Amroth", "0x700411AC", "Dol Amroth (Ruf)", - "West-Gondor zurückkehren"); - repLocations:AddSkill("Rückkehr nach Arnach", "0x70043A6A", "Arnach (Ruf)"); - repLocations:AddSkill("Kehrt nach Minas Tirith zurück.", "0x7004497E", "Minas Tirith (Ruf)"); - repLocations:AddSkill("Zurück zum Kriegslager der Rohirrim", "0x700459A9", "Kriegslager der Rohirrim (Ruf)"); - repLocations:AddSkill("Rückkehr ins schlachtgezeichnete Minas Tirith", "0x70046CC0", "Minas Tirith nach der Schlacht (Ruf)"); - repLocations:AddSkill("Rückkehr nach Henneth Annûn", "0x70047080", "Henneth Annûn (Ruf)"); - repLocations:AddSkill("Rückkehr ins schlachtgezeichnete Osgiliath", "0x7004707D", "Osgiliath nach der Schlacht (Ruf)"); - repLocations:AddSkill("Rückkehr ins Lager des Heeres", "0x70047BF4", "Lager des Heeres (Ruf)"); - repLocations:AddSkill("Rückkehr nach Haerondir", "0x70047C1B", "Haerondir (Ruf)"); - repLocations:AddSkill("Zurück zum Udûn-Brückenkopf", "0x7004AE1D", "Udûn-Brückenkopf (Ruf)"); - repLocations:AddSkill("Reise zum Hof von Lothlórien", "0x7004B8C2", "Hof von Lothlórien (Ruf)"); - repLocations:AddSkill("Reise zur Halle des Königs", "0x7004B8C3", "Halle des Königs (Ruf)"); - repLocations:AddSkill("Reise zur Halle unter dem Berg", "0x7004B8C4", "Halle unter dem Berg (Ruf)"); - repLocations:AddSkill("Reise nach Bâr Thorenion", "0x7004B8C5", "Bâr Thorenion (Ruf)"); - repLocations:AddSkill("Rückkehr nach Thal", "0x7004D738", "Thal (Ruf)"); - repLocations:AddSkill("Rückkehr nach Járnfast", "0x7004FAC3", "Járnfast (Ruf)"); - repLocations:AddSkill("Kehrt nach Skarháld zurück.", "0x7004FAC5", "Skarháld (Ruf)"); - repLocations:AddSkill("Kehrt zum Beorningerhús zurück.", "0x70052F12", "Beorningerhús (Ruf)"); - repLocations:AddSkill("Kehrt zum Hultvís zurück.", "0x70052F04", "Hultvís (Ruf)"); - repLocations:AddSkill("Zurück nach Estolad Lân", "0x700551F8", "Estolad Lân (Ruf)"); - repLocations:AddSkill("Rückkehr nach Limlók", "0x70057629", "Limlók (Ruf)"); - repLocations:AddSkill("Rückkehr nach Annâk-khurfu", "0x7005856F", "Annâk-khurfu (Ruf)"); - repLocations:AddSkill("Kehrt zum Händlerkai zurück.", "0x70059D0E", "Händlerkai (Ruf)"); - repLocations:AddSkill("Kehrt nach Schragen zurück.", "0x70059D12", "Schragen (Ruf)"); - repLocations:AddSkill("Rückkehr nach Akrâz-zahar", "0x7005AA90", "Akrâz-zahar (Ruf)"); - repLocations:AddSkill("Rückkehre nach Azanulbizar", "0x7005AA92", "Azanulbizar (Ruf)"); - repLocations:AddSkill("Reise zur Halle Vérnozal", "0x7005A596", "Vérnozal (Aufgabe)"); - repLocations:AddSkill("Rückkehr zum Prachttor", "0x7005D47C", "Prachttor (Ruf)"); - repLocations:AddSkill("Rückkehr nach Leitstáth", "0x7005D484", "Leitstáth (Ruf)"); - repLocations:AddSkill("Kehrt nach Tornhad zurück.", "0x70060EA8", "Tornhad (Ruf)"); - repLocations:AddSkill("Kehrt nach Neuhausen zurück.", "0x70061340", "Neuhausen (Ruf)"); - repLocations:AddSkill("Rückkehr nach Andrath", "0x7006323D", "Andrath (Ruf)"); - repLocations:AddSkill("Rückkehr nach Schwanenfleet", "0x700634A4", "Swanfleet (Ruf)"); - repLocations:AddSkill("Rückkehr nach Cardolan", "0x700634AE", "Cardolan (Ruf)"); - repLocations:AddSkill("Rückkehr zu den Filigranmuster-Archiven in Bruchtal", "0x700634A5", "Filigranmuster-Archiv (Delving)"); - repLocations:AddSkill("Rückkehr nach Carn Dûm", "0x70064ACA", "Carn Dûm (Ruf)"); - repLocations:AddSkill("Rückkehr nach Clegur", "0x70064F47", "Clegur (Ruf)"); - repLocations:AddSkill("Nach Glân Vraig zurückkehren", "0x7005B38E", "Glân Vraig (Aufgabe)"); - repLocations:AddSkill("Rückkehr nach Pelargir", "0x700658EB", "Pelargir (Ruf)"); - repLocations:AddSkill("Zum Orden des Adlers reisen", "0x700686FE", "Orden des Adlers (Ruf)"); - repLocations:AddSkill("Nach Umbar zurückkehren", "0x700686FF", "Umbar (Ruf)"); - repLocations:AddSkill("Rückkehr nach Dol Amroth", "0x70068700", "Königreich Dol Amroth (Ruf U38)", - "Königreich Gondor"); - repLocations:AddSkill("Nach Jax Phanâl zurückkehren", "0x70068701", "Jax Phanâl (Ruf)"); - repLocations:AddSkill("Kehrt zu Halrax zurück.", "0x70068702", "Halrax (Ruf)"); - repLocations:AddSkill("Nach Lond Cirion zurückkehren", "0x70068703", "Lond Cirion (Ruf)"); - repLocations:AddSkill("Zu den Buchhütern reisen", "0x70068704", "Ledger-Keepers (Ruf)"); - repLocations:AddSkill("Rückkehr zur Taverne \"Zum Blutigen Adler\"", "0x700697F2", "Zum Blutigen Adler (Ruf)"); + -- add the obtainable travel skills + self.rep:AddSkill("Rückkehr zu Thorins Tor", "0x7001BF91", "Thorins Tor (Ruf)", "Dank Eurer Freundschaft"); + self.rep:AddSkill("Rückkehr nach Bree", "0x7001BF90", "Bree (Ruf)", "Dank Eurer Freundschaft"); + self.rep:AddSkill("Kehrt zu Lalias Markt zurück", "0x700364B1", "Lalias Markt (Mithril)"); + self.rep:AddSkill("Rückkehr nach Michelbinge", "0x70023262", "Michelbinge (Shop)"); + self.rep:AddSkill("Rückkehr nach Bruchtal", "0x70023263", "Bruchtal (Shop)", "Dank Eurer Freundschaft"); + self.rep:AddSkill("Rückkehr zur Feste Guruth", "0x70020441", "Feste Guruth (Ruf)"); + self.rep:AddSkill("Rückkehr zum Düsterwald", "0x7001F374", "Düsterwald (Ruf)"); + self.rep:AddSkill("Rückkehr nach Enedwaith", "0x70021FA2", "Enedwaith (Ruf)"); + self.rep:AddSkill("Kehrt nach Galtrev zurück", "0x7002C647", "Galtrev (Ruf)"); + self.rep:AddSkill("Kehrt nach Stangard zurück", "0x7002C65D", "Stangard (Ruf)"); + self.rep:AddSkill("Kehrt nach Schneegrenze zurück", "0x70031A46", "Schneegrenze (Ruf)"); + self.rep:AddSkill("Rückkehr nach Forlach", "0x70036B5E", "Forlach (Ruf)"); + self.rep:AddSkill("Kehrt nach Aldburg zurück", "0x7003DC81", "Aldburg (Ruf)"); + self.rep:AddSkill("Rückkehr ins Geheimnistal", "0x7004128F", "Geheimnistal (Ruf)"); + self.rep:AddSkill("Kehrt nach Helms Klamm zurück", "0x7003DC82", "Helms Klamm (Ruf)"); + self.rep:AddSkill("Rückkehr nach Dol Amroth", "0x700411AC", "Dol Amroth (Ruf)", "West-Gondor zurückkehren"); + self.rep:AddSkill("Rückkehr nach Arnach", "0x70043A6A", "Arnach (Ruf)"); + self.rep:AddSkill("Kehrt nach Minas Tirith zurück.", "0x7004497E", "Minas Tirith (Ruf)"); + self.rep:AddSkill("Zurück zum Kriegslager der Rohirrim", "0x700459A9", "Kriegslager der Rohirrim (Ruf)"); + self.rep:AddSkill("Rückkehr ins schlachtgezeichnete Minas Tirith", "0x70046CC0", "Minas Tirith nach der Schlacht (Ruf)"); + self.rep:AddSkill("Rückkehr nach Henneth Annûn", "0x70047080", "Henneth Annûn (Ruf)"); + self.rep:AddSkill("Rückkehr ins schlachtgezeichnete Osgiliath", "0x7004707D", "Osgiliath nach der Schlacht (Ruf)"); + self.rep:AddSkill("Rückkehr ins Lager des Heeres", "0x70047BF4", "Lager des Heeres (Ruf)"); + self.rep:AddSkill("Rückkehr nach Haerondir", "0x70047C1B", "Haerondir (Ruf)"); + self.rep:AddSkill("Zurück zum Udûn-Brückenkopf", "0x7004AE1D", "Udûn-Brückenkopf (Ruf)"); + self.rep:AddSkill("Reise zum Hof von Lothlórien", "0x7004B8C2", "Hof von Lothlórien (Ruf)"); + self.rep:AddSkill("Reise zur Halle des Königs", "0x7004B8C3", "Halle des Königs (Ruf)"); + self.rep:AddSkill("Reise zur Halle unter dem Berg", "0x7004B8C4", "Halle unter dem Berg (Ruf)"); + self.rep:AddSkill("Reise nach Bâr Thorenion", "0x7004B8C5", "Bâr Thorenion (Ruf)"); + self.rep:AddSkill("Rückkehr nach Thal", "0x7004D738", "Thal (Ruf)"); + self.rep:AddSkill("Rückkehr nach Járnfast", "0x7004FAC3", "Járnfast (Ruf)"); + self.rep:AddSkill("Kehrt nach Skarháld zurück.", "0x7004FAC5", "Skarháld (Ruf)"); + self.rep:AddSkill("Kehrt zum Beorningerhús zurück.", "0x70052F12", "Beorningerhús (Ruf)"); + self.rep:AddSkill("Kehrt zum Hultvís zurück.", "0x70052F04", "Hultvís (Ruf)"); + self.rep:AddSkill("Zurück nach Estolad Lân", "0x700551F8", "Estolad Lân (Ruf)"); + self.rep:AddSkill("Rückkehr nach Limlók", "0x70057629", "Limlók (Ruf)"); + self.rep:AddSkill("Rückkehr nach Annâk-khurfu", "0x7005856F", "Annâk-khurfu (Ruf)"); + self.rep:AddSkill("Kehrt zum Händlerkai zurück.", "0x70059D0E", "Händlerkai (Ruf)"); + self.rep:AddSkill("Kehrt nach Schragen zurück.", "0x70059D12", "Schragen (Ruf)"); + self.rep:AddSkill("Rückkehr nach Akrâz-zahar", "0x7005AA90", "Akrâz-zahar (Ruf)"); + self.rep:AddSkill("Rückkehre nach Azanulbizar", "0x7005AA92", "Azanulbizar (Ruf)"); + self.rep:AddSkill("Reise zur Halle Vérnozal", "0x7005A596", "Vérnozal (Aufgabe)"); + self.rep:AddSkill("Rückkehr zum Prachttor", "0x7005D47C", "Prachttor (Ruf)"); + self.rep:AddSkill("Rückkehr nach Leitstáth", "0x7005D484", "Leitstáth (Ruf)"); + self.rep:AddSkill("Kehrt nach Tornhad zurück.", "0x70060EA8", "Tornhad (Ruf)"); + self.rep:AddSkill("Kehrt nach Neuhausen zurück.", "0x70061340", "Neuhausen (Ruf)"); + self.rep:AddSkill("Rückkehr nach Andrath", "0x7006323D", "Andrath (Ruf)"); + self.rep:AddSkill("Rückkehr nach Schwanenfleet", "0x700634A4", "Swanfleet (Ruf)"); + self.rep:AddSkill("Rückkehr nach Cardolan", "0x700634AE", "Cardolan (Ruf)"); + self.rep:AddSkill("Rückkehr zu den Filigranmuster-Archiven in Bruchtal", "0x700634A5", "Filigranmuster-Archiv (Delving)"); + self.rep:AddSkill("Rückkehr nach Carn Dûm", "0x70064ACA", "Carn Dûm (Ruf)"); + self.rep:AddSkill("Rückkehr nach Clegur", "0x70064F47", "Clegur (Ruf)"); + self.rep:AddSkill("Nach Glân Vraig zurückkehren", "0x7005B38E", "Glân Vraig (Aufgabe)"); + self.rep:AddSkill("Rückkehr nach Pelargir", "0x700658EB", "Pelargir (Ruf)"); + self.rep:AddSkill("Zum Orden des Adlers reisen", "0x700686FE", "Orden des Adlers (Ruf)"); + self.rep:AddSkill("Nach Umbar zurückkehren", "0x700686FF", "Umbar (Ruf)"); + self.rep:AddSkill("Rückkehr nach Dol Amroth", "0x70068700", "Königreich Dol Amroth (Ruf U38)", "Königreich Gondor"); + self.rep:AddSkill("Nach Jax Phanâl zurückkehren", "0x70068701", "Jax Phanâl (Ruf)"); + self.rep:AddSkill("Kehrt zu Halrax zurück.", "0x70068702", "Halrax (Ruf)"); + self.rep:AddSkill("Nach Lond Cirion zurückkehren", "0x70068703", "Lond Cirion (Ruf)"); + self.rep:AddSkill("Zu den Buchhütern reisen", "0x70068704", "Ledger-Keepers (Ruf)"); + self.rep:AddSkill("Rückkehr zur Taverne \"Zum Blutigen Adler\"", "0x700697F2", "Zum Blutigen Adler (Ruf)"); -- monster player maps - creepLocations:AddSkill("Kartenskizze zum Gramfuss", "0x70028BBC"); - creepLocations:AddSkill("Karte zum Gramfuss", "0x70028BC1"); - - creepLocations:AddSkill("Kartenskizze zur Isenbinge", "0x70028BB3"); - creepLocations:AddSkill("Grobe Karte zur Feste Tol Ascarnen", "0x70028BB6"); - creepLocations:AddSkill("Kartenskizze zur Feste Lugazag", "0x70028BB7"); - creepLocations:AddSkill("Grobe Karte zur Feste Tirith Rhaw", "0x70028BBE"); - creepLocations:AddSkill("Kartenskizze zum Grimmwald", "0x70028BBF"); - - creepLocations:AddSkill("Minderwertige Karte zur Isenbinge", "0x70028BAF"); - creepLocations:AddSkill("Minderwertige Karte zur Feste Tol Ascarnen", "0x70028BB1"); - creepLocations:AddSkill("Minderwertige Karte zur Feste Lugazag", "0x70028BB2"); - creepLocations:AddSkill("Minderwertige Karte zur Feste Tirith Rhaw", "0x70028BB4"); - creepLocations:AddSkill("Minderwertige Karte zum Grimmwald", "0x70028BB9"); - - creepLocations:AddSkill("Gute Karte zur Isenbinge", "0x70028BC0"); - creepLocations:AddSkill("Gute Karte zur Feste Tol Ascarnen", "0x70028BC2"); - creepLocations:AddSkill("Gute Karte zur Feste Lugazag", "0x70028BB5"); - creepLocations:AddSkill("Gute Karte zur Feste Tirith Rhaw", "0x70028BB0"); - creepLocations:AddSkill("Gute Karte zum Grimmwald", "0x70028BBD"); + self.creep:AddSkill("Kartenskizze zum Gramfuss", "0x70028BBC"); + self.creep:AddSkill("Karte zum Gramfuss", "0x70028BC1"); + self.creep:AddSkill("Kartenskizze zur Isenbinge", "0x70028BB3"); + self.creep:AddSkill("Grobe Karte zur Feste Tol Ascarnen", "0x70028BB6"); + self.creep:AddSkill("Kartenskizze zur Feste Lugazag", "0x70028BB7"); + self.creep:AddSkill("Grobe Karte zur Feste Tirith Rhaw", "0x70028BBE"); + self.creep:AddSkill("Kartenskizze zum Grimmwald", "0x70028BBF"); + self.creep:AddSkill("Minderwertige Karte zur Isenbinge", "0x70028BAF"); + self.creep:AddSkill("Minderwertige Karte zur Feste Tol Ascarnen", "0x70028BB1"); + self.creep:AddSkill("Minderwertige Karte zur Feste Lugazag", "0x70028BB2"); + self.creep:AddSkill("Minderwertige Karte zur Feste Tirith Rhaw", "0x70028BB4"); + self.creep:AddSkill("Minderwertige Karte zum Grimmwald", "0x70028BB9"); + self.creep:AddSkill("Gute Karte zur Isenbinge", "0x70028BC0"); + self.creep:AddSkill("Gute Karte zur Feste Tol Ascarnen", "0x70028BC2"); + self.creep:AddSkill("Gute Karte zur Feste Lugazag", "0x70028BB5"); + self.creep:AddSkill("Gute Karte zur Feste Tirith Rhaw", "0x70028BB0"); + self.creep:AddSkill("Gute Karte zum Grimmwald", "0x70028BBD"); end diff --git a/src/IndexedDictionaryEn.lua b/src/IndexedDictionaryEn.lua index c0d4c83..d78f8f4 100644 --- a/src/IndexedDictionaryEn.lua +++ b/src/IndexedDictionaryEn.lua @@ -13,18 +13,14 @@ eriadorMapTitleString = "Eriador Destinations"; rhovanionMapTitleString = "Rhovanion Destinations"; gondorMapTitleString = "Gondor Destinations" --- strings for maps -glanMapString = "Glân Vraig Map"; -glanMapItemString = "Map to Glân Vraig"; - skillNotTrainedString = "Skills not trained: "; -- options window strings generalTabString = "General"; selectTabString = "Enable"; sortTabString = "Sort"; -hideString = "Hide main window at startup"; -toggleString = "Show Toggle Button"; +hideString = "Hide Travel window at startup"; +toggleString = "Show Travel Button"; pulldownTravelString = "Travel when pulldown skill selected"; hideOnTravelString = "Hide main window on travel"; hideOnCombatString = "Hide main window when entering combat"; @@ -40,8 +36,17 @@ toggleSlidersString = "Toggle Button Opacity"; mainSlidersString = "Main Window Opacity"; minString = "Min: "; maxString = "Max: "; -resetSettingsString = "Reset all to default"; +resetSettingsString = "Reset to Defaults"; +saveGlobalDefaultsString = "Save Global Defaults"; +loadGlobalDefaultsString = "Load Global Defaults"; checkSkillsString = "Check Untrained Skills"; +enableRepSkillsString = "Enable Overlapping"; +disableRepSkillsString = "Disable Overlapping"; +enableAllString = "Enable All"; +disableAllString = "Disable All"; +ignoreEscString = "Escape does not close main window"; +minWindowString = "Use Mini-Window"; +fadeWindowString = "Fade Window Speed"; -- menu strings menuFiltersString = "Filters"; @@ -66,321 +71,255 @@ menuSkillsString = "Check Untrained Skills"; --[[ travel skills ]] -- --[[ Add all the travel skills ]] -- -TravelDictionaries = class() - -function TravelDictionaries:Constructor() - - -- create the indexed tables that store all the data - genLocations = IndexedDictionary(); - hunterLocations = IndexedDictionary(); - wardenLocations = IndexedDictionary(); - racialLocations = IndexedDictionary(); - repLocations = IndexedDictionary(); - creepLocations = IndexedDictionary(); - marinerLocations = IndexedDictionary(); - - -- a table to store the number of each type of travel skill - travelCount = { 0, 0, 0, 0, 0, 0, 0 }; - LocationsTotal = 0; - - self:CreateDictionaries(); - self:GetCounts(); -end - --- function to count the number of skills in total -function TravelDictionaries:GetCounts() - travelCount[1] = hunterLocations:GetCount(); - travelCount[2] = wardenLocations:GetCount(); - travelCount[3] = genLocations:GetCount(); - travelCount[4] = repLocations:GetCount(); - travelCount[5] = racialLocations:GetCount(); - travelCount[6] = creepLocations:GetCount(); - travelCount[7] = marinerLocations:GetCount(); - - LocationsTotal = travelCount[1] + travelCount[2] + travelCount[3] + travelCount[4] + travelCount[5] + travelCount[6] + travelCount[7]; -end - --- function to return the count of a specific type of travel -function TravelDictionaries:GetCount(index) - return travelCount[index]; -end - --- function to get the total number of travel skills -function TravelDictionaries:GetTotalCount() - return LocationsTotal; -end - --- function to return the 5 tables containing the travel skills -function TravelDictionaries:GetLocations() - return genLocations, hunterLocations, wardenLocations, racialLocations, repLocations, creepLocations, marinerLocations; -end - -- add the data to custom dictionaries to maintain the order -function TravelDictionaries:CreateDictionaries() +function TravelDictionary:CreateDictionaries() -- add the hunter locations - hunterLocations:AddSkill("Return to Camp", "0x7000A2C1", "Return to Camp"); - hunterLocations:AddSkill("Guide to Bree", "0x70003F42", "Bree (Guide)"); - hunterLocations:AddSkill("Guide to Thorin's Hall", "0x70003F41", "Thorin's Hall (Guide)"); - hunterLocations:AddSkill("Guide to Michel Delving", "0x7000A2C3", "Michel Delving (Guide)"); - hunterLocations:AddSkill("Guide to Esteldín", "0x70003F43", "Esteldín (Guide)"); - hunterLocations:AddSkill("Guide to Evendim", "0x7000A2C4", "Evendim (Guide)"); - hunterLocations:AddSkill("Guide to Ost Guruth", "0x7000A2C2", "Ost Guruth (Guide)"); - hunterLocations:AddSkill("Guide to Rivendell", "0x70003F44", "Rivendell (Guide)"); - hunterLocations:AddSkill("Guide to Sûri-kylä", "0x70017C82", "Sûri-kylä (Guide)"); - hunterLocations:AddSkill("Guide to West Angmar", "0x7000A2C5", "West Angmar (Guide)"); - hunterLocations:AddSkill("Guide to East Angmar", "0x7000A2C6", "East Angmar (Guide)"); - hunterLocations:AddSkill("Guide to Echad Dúnann", "0x70017C81", "Echad Dúnann (Guide)"); - hunterLocations:AddSkill("Guide to the Twenty-first Hall", "0x70017C7A", "Twenty-first Hall (Guide)"); - hunterLocations:AddSkill("Guide to Mirk-eaves", "0x7001F459", "Mirk-eaves (Guide)"); - hunterLocations:AddSkill("Guide to Harndirion", "0x700235EF", "Harndirion (Guide)"); - hunterLocations:AddSkill("Guide to Galtrev", "0x7002A93F", "Galtrev (Guide)"); - hunterLocations:AddSkill("Guide to Stangard", "0x7002C62C", "Stangard (Guide)"); - hunterLocations:AddSkill("Guide to Caras Galadhon", "0x7002E754", "Caras Galadhon (Guide)"); - hunterLocations:AddSkill("Guide to the Misty Mountains", "0x7002E756", "Misty Mountains (Guide)"); - hunterLocations:AddSkill("Guide to Snowbourn", "0x7003198E", "Snowbourn (Guide)"); - hunterLocations:AddSkill("Guide to Forlaw", "0x70036B5D", "Forlaw (Guide)"); - hunterLocations:AddSkill("Guide to Aldburg", "0x7003DC71", "Aldburg (Guide)"); - hunterLocations:AddSkill("Guide to Helm's Deep", "0x7003DC72", "Helm's Deep (Guide)"); - hunterLocations:AddSkill("Guide to Dol Amroth", "0x70041197", "Dol Amroth (Guide)", - "Dol Amroth in western Gondor"); - hunterLocations:AddSkill("Guide to Arnach", "0x70043A63", "Arnach (Guide)"); - hunterLocations:AddSkill("Guide to Minas Tirith", "0x70044985", "Minas Tirith (Guide)"); - hunterLocations:AddSkill("Guide to the War-stead", "0x700459AF", "War-stead (Guide)"); - hunterLocations:AddSkill("Guide to after-battle Minas Tirith", "0x70046CBB", "Minas Tirith after battle (Guide)"); - hunterLocations:AddSkill("Guide to Henneth Annûn", "0x70047077", "Henneth Annûn (Guide)"); - hunterLocations:AddSkill("Guide to after-battle Osgiliath", "0x70047074", "Osgiliath after battle (Guide)"); - hunterLocations:AddSkill("Guide to the Camp of the Host", "0x70047BFA", "Camp of the Host (Guide)"); - hunterLocations:AddSkill("Guide to Haerondir", "0x70047C1D", "Haerondir (Guide)"); - hunterLocations:AddSkill("Guide to the Udûn Foothold", "0x7004AE1E", "Udûn Foothold (Guide)"); - hunterLocations:AddSkill("Guide to Dale", "0x7004D73B", "Dale (Guide)"); - hunterLocations:AddSkill("Guide to Járnfast", "0x7004FACC", "Járnfast (Guide)"); - hunterLocations:AddSkill("Guide to Skarháld", "0x7004FACB", "Skarháld (Guide)"); - hunterLocations:AddSkill("Guide to Beorninghús", "0x70052F07", "Beorninghús (Guide)"); - hunterLocations:AddSkill("Guide to Hultvís", "0x70052F08", "Hultvís (Guide)"); - hunterLocations:AddSkill("Guide to Estolad Lân", "0x700551F4", "Estolad Lân (Guide)"); - hunterLocations:AddSkill("Guide to Limlók", "0x7005762D", "Limlók (Guide)"); - hunterLocations:AddSkill("Guide to Annâk-khurfu", "0x70058571", "Annâk-khurfu (Guide)"); - hunterLocations:AddSkill("Guide to Trader's Wharf", "0x70059D0C", "Trader's Wharf (Guide)"); - hunterLocations:AddSkill("Guide to Trestlebridge", "0x70059D16", "Trestlebridge (Guide)"); - hunterLocations:AddSkill("Guide to Akrâz-zahar", "0x7005AA91", "Akrâz-zahar (Guide)"); - hunterLocations:AddSkill("Guide to Azanulbizar", "0x7005AA95", "Azanulbizar (Guide)"); - hunterLocations:AddSkill("Guide to the Noble Gate", "0x7005D487", "Noble Gate (Guide)"); - hunterLocations:AddSkill("Guide to Leitstáth", "0x7005D47D", "Leitstáth (Guide)"); - hunterLocations:AddSkill("Guide to Tornhad", "0x70060EA6", "Tornhad (Guide)"); - hunterLocations:AddSkill("Guide to Nobottle", "0x7006133F", "Nobottle (Guide)"); - hunterLocations:AddSkill("Guide to Andrath", "0x7006323C", "Andrath (Guide)"); - hunterLocations:AddSkill("Guide to Swanfleet", "0x700634AA", "Swanfleet (Guide)"); - hunterLocations:AddSkill("Guide to Cardolan", "0x700634A7", "Cardolan (Guide)"); - hunterLocations:AddSkill("Guide to Carn Dûm", "0x70064AC8", "Carn Dûm (Guide)"); - hunterLocations:AddSkill("Guide to Clegur", "0x70064F4C", "Clegur (Guide)"); - hunterLocations:AddSkill("Guide to Pelargir", "0x700658EA", "Pelargir (Guide)"); - hunterLocations:AddSkill("Guide to Dol Amroth", "0x70068711", "King's Dol Amroth (Guide U38)", - "King's Gondor"); - hunterLocations:AddSkill("Guide to Halrax", "0x70068713", "Halrax (Guide)"); - hunterLocations:AddSkill("Guide to Lond Cirion", "0x70068717", "Lond Cirion (Guide)"); - hunterLocations:AddSkill("Guide to Umbar", "0x70068718", "Umbar (Guide)"); - hunterLocations:AddSkill("Guide to Jax Phanâl", "0x70068719", "Jax Phanâl (Guide)"); - hunterLocations:AddSkill("Guide to the Bloody Eagle Tavern", "0x700697EF", "Bloody Eagle Tavern (Guide)"); + self.hunter:AddSkill("Return to Camp", "0x7000A2C1", "Return to Camp"); + self.hunter:AddSkill("Guide to Bree", "0x70003F42", "Bree (Guide)"); + self.hunter:AddSkill("Guide to Thorin's Hall", "0x70003F41", "Thorin's Hall (Guide)"); + self.hunter:AddSkill("Guide to Michel Delving", "0x7000A2C3", "Michel Delving (Guide)"); + self.hunter:AddSkill("Guide to Esteldín", "0x70003F43", "Esteldín (Guide)"); + self.hunter:AddSkill("Guide to Evendim", "0x7000A2C4", "Evendim (Guide)"); + self.hunter:AddSkill("Guide to Ost Guruth", "0x7000A2C2", "Ost Guruth (Guide)"); + self.hunter:AddSkill("Guide to Rivendell", "0x70003F44", "Rivendell (Guide)"); + self.hunter:AddSkill("Guide to Sûri-kylä", "0x70017C82", "Sûri-kylä (Guide)"); + self.hunter:AddSkill("Guide to West Angmar", "0x7000A2C5", "West Angmar (Guide)"); + self.hunter:AddSkill("Guide to East Angmar", "0x7000A2C6", "East Angmar (Guide)"); + self.hunter:AddSkill("Guide to Echad Dúnann", "0x70017C81", "Echad Dúnann (Guide)"); + self.hunter:AddSkill("Guide to the Twenty-first Hall", "0x70017C7A", "Twenty-first Hall (Guide)"); + self.hunter:AddSkill("Guide to Mirk-eaves", "0x7001F459", "Mirk-eaves (Guide)"); + self.hunter:AddSkill("Guide to Harndirion", "0x700235EF", "Harndirion (Guide)"); + self.hunter:AddSkill("Guide to Galtrev", "0x7002A93F", "Galtrev (Guide)"); + self.hunter:AddSkill("Guide to Stangard", "0x7002C62C", "Stangard (Guide)"); + self.hunter:AddSkill("Guide to Caras Galadhon", "0x7002E754", "Caras Galadhon (Guide)"); + self.hunter:AddSkill("Guide to the Misty Mountains", "0x7002E756", "Misty Mountains (Guide)"); + self.hunter:AddSkill("Guide to Snowbourn", "0x7003198E", "Snowbourn (Guide)"); + self.hunter:AddSkill("Guide to Forlaw", "0x70036B5D", "Forlaw (Guide)"); + self.hunter:AddSkill("Guide to Aldburg", "0x7003DC71", "Aldburg (Guide)"); + self.hunter:AddSkill("Guide to Helm's Deep", "0x7003DC72", "Helm's Deep (Guide)"); + self.hunter:AddSkill("Guide to Dol Amroth", "0x70041197", "Dol Amroth (Guide)", "Dol Amroth in western Gondor"); + self.hunter:AddSkill("Guide to Arnach", "0x70043A63", "Arnach (Guide)"); + self.hunter:AddSkill("Guide to Minas Tirith", "0x70044985", "Minas Tirith (Guide)"); + self.hunter:AddSkill("Guide to the War-stead", "0x700459AF", "War-stead (Guide)"); + self.hunter:AddSkill("Guide to after-battle Minas Tirith", "0x70046CBB", "Minas Tirith after battle (Guide)"); + self.hunter:AddSkill("Guide to Henneth Annûn", "0x70047077", "Henneth Annûn (Guide)"); + self.hunter:AddSkill("Guide to after-battle Osgiliath", "0x70047074", "Osgiliath after battle (Guide)"); + self.hunter:AddSkill("Guide to the Camp of the Host", "0x70047BFA", "Camp of the Host (Guide)"); + self.hunter:AddSkill("Guide to Haerondir", "0x70047C1D", "Haerondir (Guide)"); + self.hunter:AddSkill("Guide to the Udûn Foothold", "0x7004AE1E", "Udûn Foothold (Guide)"); + self.hunter:AddSkill("Guide to Dale", "0x7004D73B", "Dale (Guide)"); + self.hunter:AddSkill("Guide to Járnfast", "0x7004FACC", "Járnfast (Guide)"); + self.hunter:AddSkill("Guide to Skarháld", "0x7004FACB", "Skarháld (Guide)"); + self.hunter:AddSkill("Guide to Beorninghús", "0x70052F07", "Beorninghús (Guide)"); + self.hunter:AddSkill("Guide to Hultvís", "0x70052F08", "Hultvís (Guide)"); + self.hunter:AddSkill("Guide to Estolad Lân", "0x700551F4", "Estolad Lân (Guide)"); + self.hunter:AddSkill("Guide to Limlók", "0x7005762D", "Limlók (Guide)"); + self.hunter:AddSkill("Guide to Annâk-khurfu", "0x70058571", "Annâk-khurfu (Guide)"); + self.hunter:AddSkill("Guide to Trader's Wharf", "0x70059D0C", "Trader's Wharf (Guide)"); + self.hunter:AddSkill("Guide to Trestlebridge", "0x70059D16", "Trestlebridge (Guide)"); + self.hunter:AddSkill("Guide to Akrâz-zahar", "0x7005AA91", "Akrâz-zahar (Guide)"); + self.hunter:AddSkill("Guide to Azanulbizar", "0x7005AA95", "Azanulbizar (Guide)"); + self.hunter:AddSkill("Guide to the Noble Gate", "0x7005D487", "Noble Gate (Guide)"); + self.hunter:AddSkill("Guide to Leitstáth", "0x7005D47D", "Leitstáth (Guide)"); + self.hunter:AddSkill("Guide to Tornhad", "0x70060EA6", "Tornhad (Guide)"); + self.hunter:AddSkill("Guide to Nobottle", "0x7006133F", "Nobottle (Guide)"); + self.hunter:AddSkill("Guide to Andrath", "0x7006323C", "Andrath (Guide)"); + self.hunter:AddSkill("Guide to Swanfleet", "0x700634AA", "Swanfleet (Guide)"); + self.hunter:AddSkill("Guide to Cardolan", "0x700634A7", "Cardolan (Guide)"); + self.hunter:AddSkill("Guide to Carn Dûm", "0x70064AC8", "Carn Dûm (Guide)"); + self.hunter:AddSkill("Guide to Clegur", "0x70064F4C", "Clegur (Guide)"); + self.hunter:AddSkill("Guide to Pelargir", "0x700658EA", "Pelargir (Guide)"); + self.hunter:AddSkill("Guide to Dol Amroth", "0x70068711", "King's Dol Amroth (Guide U38)", "King's Gondor"); + self.hunter:AddSkill("Guide to Halrax", "0x70068713", "Halrax (Guide)"); + self.hunter:AddSkill("Guide to Lond Cirion", "0x70068717", "Lond Cirion (Guide)"); + self.hunter:AddSkill("Guide to Umbar", "0x70068718", "Umbar (Guide)"); + self.hunter:AddSkill("Guide to Jax Phanâl", "0x70068719", "Jax Phanâl (Guide)"); + self.hunter:AddSkill("Guide to the Bloody Eagle Tavern", "0x700697EF", "Bloody Eagle Tavern (Guide)"); -- add the Warden locations - wardenLocations:AddSkill("Muster in Ost Guruth", "0x70014786", "Ost Guruth (Muster)"); - wardenLocations:AddSkill("Muster in Esteldín", "0x70014798", "Esteldín (Muster)"); - wardenLocations:AddSkill("Muster in Evendim", "0x7001478E", "Evendim (Muster)"); - wardenLocations:AddSkill("Muster in Rivendell", "0x70014791", "Rivendell (Muster)"); - wardenLocations:AddSkill("Muster in Sûri-kylä", "0x700237D4", "Sûri-kylä (Muster)"); - wardenLocations:AddSkill("Muster in the Twenty-first Hall", "0x7001819E", "Twenty-first Hall (Muster)"); - wardenLocations:AddSkill("Muster in Mirk-eaves", "0x7001F45C", "Mirk-Eaves (Muster)"); - wardenLocations:AddSkill("Muster in Harndirion", "0x700235EB", "Harndirion (Muster)"); - wardenLocations:AddSkill("Muster in Galtrev", "0x7002A90A", "Galtrev (Muster)"); - wardenLocations:AddSkill("Muster in Stangard", "0x7002C646", "Stangard (Muster)"); - wardenLocations:AddSkill("Muster in Caras Galadhon", "0x700303DF", "Caras Galadhon (Muster)"); - wardenLocations:AddSkill("Muster in the Misty Mountains", "0x700303DD", "Misty Mountains (Muster)"); - wardenLocations:AddSkill("Muster in Snowbourn", "0x7003198D", "Snowbourn (Muster)"); - wardenLocations:AddSkill("Muster in Forlaw", "0x70036B5B", "Forlaw (Muster)"); - wardenLocations:AddSkill("Muster in Aldburg", "0x7003DC7A", "Aldburg (Muster)"); - wardenLocations:AddSkill("Muster in Helm's Deep", "0x7003DC79", "Helm's Deep (Muster)"); - wardenLocations:AddSkill("Muster in Dol Amroth", "0x70041198", "Dol Amroth (Muster)", - "Dol Amroth in western Gondor"); - wardenLocations:AddSkill("Muster in Arnach", "0x70043A66", "Arnach (Muster)"); - wardenLocations:AddSkill("Muster in Minas Tirith", "0x70044982", "Minas Tirith (Muster)"); - wardenLocations:AddSkill("Muster in the War-stead", "0x700459AA", "War-stead (Muster)"); - wardenLocations:AddSkill("Muster in after-battle Minas Tirith", "0x70046CBF", "Minas Tirith after battle (Muster)"); - wardenLocations:AddSkill("Muster in Henneth Annûn", "0x70047075", "Henneth Annûn (Muster)"); - wardenLocations:AddSkill("Muster in after-battle Osgiliath", "0x70047076", "Osgiliath after battle (Muster)"); - wardenLocations:AddSkill("Muster in the Camp of the Host", "0x70047BFC", "Camp of the Host (Muster)"); - wardenLocations:AddSkill("Muster in Haerondir", "0x70047C23", "Haerondir (Muster)"); - wardenLocations:AddSkill("Muster in the Udûn Foothold", "0x7004AE1F", "Udûn Foothold (Muster)"); - wardenLocations:AddSkill("Muster in Dale", "0x7004D73A", "Dale (Muster)"); - wardenLocations:AddSkill("Muster in Járnfast", "0x7004FACA", "Járnfast (Muster)"); - wardenLocations:AddSkill("Muster in Skarháld", "0x7004FACD", "Skarháld (Muster)"); - wardenLocations:AddSkill("Muster in Beorninghús", "0x70052F0A", "Beorninghús (Muster)"); - wardenLocations:AddSkill("Muster in Hultvís", "0x70052F06", "Hultvís (Muster)"); - wardenLocations:AddSkill("Muster in Estolad Lân", "0x700551F2", "Estolad Lân (Muster)"); - wardenLocations:AddSkill("Muster in Limlók", "0x70057635", "Limlók (Muster)"); - wardenLocations:AddSkill("Muster in Annâk-khurfu", "0x70058572", "Annâk-khurfu (Muster)"); - wardenLocations:AddSkill("Muster in Trader's Wharf", "0x70059D09", "Trader's Wharf (Muster)"); - wardenLocations:AddSkill("Muster in Trestlebridge", "0x70059D10", "Trestlebridge (Muster)"); - wardenLocations:AddSkill("Muster in Akrâz-zahar", "0x7005AA8F", "Akrâz-zahar (Muster)"); - wardenLocations:AddSkill("Muster in Azanulbizar", "0x7005AA8C", "Azanulbizar (Muster)"); - wardenLocations:AddSkill("Muster at the Noble Gate", "0x7005D48A", "Noble Gate (Muster)"); - wardenLocations:AddSkill("Muster at Leitstáth", "0x7005D488", "Leitstáth (Muster)"); - wardenLocations:AddSkill("Muster at Tornhad", "0x70060EA5", "Tornhad (Muster)"); - wardenLocations:AddSkill("Muster at Nobottle", "0x7006133E", "Nobottle (Muster)"); - wardenLocations:AddSkill("Muster at Andrath", "0x70063242", "Andrath (Muster)"); - wardenLocations:AddSkill("Muster at Swanfleet", "0x700634B6", "Swanfleet (Muster)"); - wardenLocations:AddSkill("Muster at Cardolan", "0x700634AD", "Cardolan (Muster)"); - wardenLocations:AddSkill("Muster at Carn Dûm", "0x70064ACB", "Carn Dûm (Muster)"); - wardenLocations:AddSkill("Muster at Clegur", "0x70064F4D", "Clegur (Muster)"); - wardenLocations:AddSkill("Muster at Pelargir", "0x700658E8", "Pelargir (Muster)"); - wardenLocations:AddSkill("Muster at Jax Phanâl","0x7006870C", "Jax Phanâl (Muster)"); - wardenLocations:AddSkill("Muster at Umbar","0x7006870F","Umbar (Muster)"); - wardenLocations:AddSkill("Muster at Halrax","0x70068710", "Halrax (Muster)"); - wardenLocations:AddSkill("Muster at Dol Amroth","0x70068712", "King's Dol Amroth (Muster)", - "King's Gondor"); - wardenLocations:AddSkill("Muster at Lond Cirion","0x70068715", "Lond Cirion (Muster)"); - wardenLocations:AddSkill("Muster at the Bloody Eagle Tavern","0x700697F3", "Bloody Eagle Tavern (Muster)"); + self.warden:AddSkill("Muster in Ost Guruth", "0x70014786", "Ost Guruth (Muster)"); + self.warden:AddSkill("Muster in Esteldín", "0x70014798", "Esteldín (Muster)"); + self.warden:AddSkill("Muster in Evendim", "0x7001478E", "Evendim (Muster)"); + self.warden:AddSkill("Muster in Rivendell", "0x70014791", "Rivendell (Muster)"); + self.warden:AddSkill("Muster in Sûri-kylä", "0x700237D4", "Sûri-kylä (Muster)"); + self.warden:AddSkill("Muster in the Twenty-first Hall", "0x7001819E", "Twenty-first Hall (Muster)"); + self.warden:AddSkill("Muster in Mirk-eaves", "0x7001F45C", "Mirk-Eaves (Muster)"); + self.warden:AddSkill("Muster in Harndirion", "0x700235EB", "Harndirion (Muster)"); + self.warden:AddSkill("Muster in Galtrev", "0x7002A90A", "Galtrev (Muster)"); + self.warden:AddSkill("Muster in Stangard", "0x7002C646", "Stangard (Muster)"); + self.warden:AddSkill("Muster in Caras Galadhon", "0x700303DF", "Caras Galadhon (Muster)"); + self.warden:AddSkill("Muster in the Misty Mountains", "0x700303DD", "Misty Mountains (Muster)"); + self.warden:AddSkill("Muster in Snowbourn", "0x7003198D", "Snowbourn (Muster)"); + self.warden:AddSkill("Muster in Forlaw", "0x70036B5B", "Forlaw (Muster)"); + self.warden:AddSkill("Muster in Aldburg", "0x7003DC7A", "Aldburg (Muster)"); + self.warden:AddSkill("Muster in Helm's Deep", "0x7003DC79", "Helm's Deep (Muster)"); + self.warden:AddSkill("Muster in Dol Amroth", "0x70041198", "Dol Amroth (Muster)", "Dol Amroth in western Gondor"); + self.warden:AddSkill("Muster in Arnach", "0x70043A66", "Arnach (Muster)"); + self.warden:AddSkill("Muster in Minas Tirith", "0x70044982", "Minas Tirith (Muster)"); + self.warden:AddSkill("Muster in the War-stead", "0x700459AA", "War-stead (Muster)"); + self.warden:AddSkill("Muster in after-battle Minas Tirith", "0x70046CBF", "Minas Tirith after battle (Muster)"); + self.warden:AddSkill("Muster in Henneth Annûn", "0x70047075", "Henneth Annûn (Muster)"); + self.warden:AddSkill("Muster in after-battle Osgiliath", "0x70047076", "Osgiliath after battle (Muster)"); + self.warden:AddSkill("Muster in the Camp of the Host", "0x70047BFC", "Camp of the Host (Muster)"); + self.warden:AddSkill("Muster in Haerondir", "0x70047C23", "Haerondir (Muster)"); + self.warden:AddSkill("Muster in the Udûn Foothold", "0x7004AE1F", "Udûn Foothold (Muster)"); + self.warden:AddSkill("Muster in Dale", "0x7004D73A", "Dale (Muster)"); + self.warden:AddSkill("Muster in Járnfast", "0x7004FACA", "Járnfast (Muster)"); + self.warden:AddSkill("Muster in Skarháld", "0x7004FACD", "Skarháld (Muster)"); + self.warden:AddSkill("Muster in Beorninghús", "0x70052F0A", "Beorninghús (Muster)"); + self.warden:AddSkill("Muster in Hultvís", "0x70052F06", "Hultvís (Muster)"); + self.warden:AddSkill("Muster in Estolad Lân", "0x700551F2", "Estolad Lân (Muster)"); + self.warden:AddSkill("Muster in Limlók", "0x70057635", "Limlók (Muster)"); + self.warden:AddSkill("Muster in Annâk-khurfu", "0x70058572", "Annâk-khurfu (Muster)"); + self.warden:AddSkill("Muster in Trader's Wharf", "0x70059D09", "Trader's Wharf (Muster)"); + self.warden:AddSkill("Muster in Trestlebridge", "0x70059D10", "Trestlebridge (Muster)"); + self.warden:AddSkill("Muster in Akrâz-zahar", "0x7005AA8F", "Akrâz-zahar (Muster)"); + self.warden:AddSkill("Muster in Azanulbizar", "0x7005AA8C", "Azanulbizar (Muster)"); + self.warden:AddSkill("Muster at the Noble Gate", "0x7005D48A", "Noble Gate (Muster)"); + self.warden:AddSkill("Muster at Leitstáth", "0x7005D488", "Leitstáth (Muster)"); + self.warden:AddSkill("Muster at Tornhad", "0x70060EA5", "Tornhad (Muster)"); + self.warden:AddSkill("Muster at Nobottle", "0x7006133E", "Nobottle (Muster)"); + self.warden:AddSkill("Muster at Andrath", "0x70063242", "Andrath (Muster)"); + self.warden:AddSkill("Muster at Swanfleet", "0x700634B6", "Swanfleet (Muster)"); + self.warden:AddSkill("Muster at Cardolan", "0x700634AD", "Cardolan (Muster)"); + self.warden:AddSkill("Muster at Carn Dûm", "0x70064ACB", "Carn Dûm (Muster)"); + self.warden:AddSkill("Muster at Clegur", "0x70064F4D", "Clegur (Muster)"); + self.warden:AddSkill("Muster at Pelargir", "0x700658E8", "Pelargir (Muster)"); + self.warden:AddSkill("Muster at Jax Phanâl","0x7006870C", "Jax Phanâl (Muster)"); + self.warden:AddSkill("Muster at Umbar","0x7006870F","Umbar (Muster)"); + self.warden:AddSkill("Muster at Halrax","0x70068710", "Halrax (Muster)"); + self.warden:AddSkill("Muster at Dol Amroth","0x70068712", "King's Dol Amroth (Muster)", "King's Gondor"); + self.warden:AddSkill("Muster at Lond Cirion","0x70068715", "Lond Cirion (Muster)"); + self.warden:AddSkill("Muster at the Bloody Eagle Tavern","0x700697F3", "Bloody Eagle Tavern (Muster)"); -- add the Mariner locations - marinerLocations:AddSkill("Sail to Celondim", "0x70066100", "Celondim (Sail)") - marinerLocations:AddSkill("Sail to the Brown Lands", "0x70066101", "Brown Lands (Sail)") - marinerLocations:AddSkill("Sail to Trader's Wharf", "0x70066105", "Trader's Wharf (Sail)") - marinerLocations:AddSkill("Sail to after-battle Osgiliath", "0x70066109", "After-battle Osgiliath (Sail)") - marinerLocations:AddSkill("Sail to Lake-town", "0x7006610C", "Lake-town (Sail)") - marinerLocations:AddSkill("Sail to the Mirk-eaves", "0x7006610E", "Mirk-eaves (Sail)") - marinerLocations:AddSkill("Sail to Tinnudir", "0x7006610F", "Tinnudir (Sail)") - marinerLocations:AddSkill("Sail to Dol Amroth", "0x70066117", "Dol Amroth (Sail)", - "Dol Amroth with nearby") - marinerLocations:AddSkill("Sail to Buckland", "0x7006611A", "Buckland (Sail)") - marinerLocations:AddSkill("Sail to Pelargir", "0x7006611B", "Pelargir (Sail)") - marinerLocations:AddSkill("Sail to Sûri-kylä", "0x7006611C", "Sûri-kylä (Sail)") - marinerLocations:AddSkill("Sail to Lothlórien", "0x7006611E", "Lothlórien (Sail)") - marinerLocations:AddSkill("Sail to Tharbad", "0x70066120", "Tharbad (Sail)") - marinerLocations:AddSkill("Sail to Snowbourn", "0x70066121", "Snowbourn (Sail)") - marinerLocations:AddSkill("Sail to Umbar", "0x700687BB", "Umbar (Sail)") - marinerLocations:AddSkill("Sail to Lond Cirion", "0x700687BD", "Lond Cirion (Sail)") - marinerLocations:AddSkill("Sail to Jax Phanâl", "0x700687C0", "Jax Phanâl (Sail)") - marinerLocations:AddSkill("Sail to Dol Amroth", "0x700687C1", "King's Dol Amroth (Sail)", - "King's Gondor") - marinerLocations:AddSkill("Sail to Halrax", "0x700687C3", "Halrax (Sail)") + self.mariner:AddSkill("Sail to Celondim", "0x70066100", "Celondim (Sail)") + self.mariner:AddSkill("Sail to the Brown Lands", "0x70066101", "Brown Lands (Sail)") + self.mariner:AddSkill("Sail to Trader's Wharf", "0x70066105", "Trader's Wharf (Sail)") + self.mariner:AddSkill("Sail to after-battle Osgiliath", "0x70066109", "After-battle Osgiliath (Sail)") + self.mariner:AddSkill("Sail to Lake-town", "0x7006610C", "Lake-town (Sail)") + self.mariner:AddSkill("Sail to the Mirk-eaves", "0x7006610E", "Mirk-eaves (Sail)") + self.mariner:AddSkill("Sail to Tinnudir", "0x7006610F", "Tinnudir (Sail)") + self.mariner:AddSkill("Sail to Dol Amroth", "0x70066117", "Dol Amroth (Sail)", "Dol Amroth with nearby") + self.mariner:AddSkill("Sail to Buckland", "0x7006611A", "Buckland (Sail)") + self.mariner:AddSkill("Sail to Pelargir", "0x7006611B", "Pelargir (Sail)") + self.mariner:AddSkill("Sail to Sûri-kylä", "0x7006611C", "Sûri-kylä (Sail)") + self.mariner:AddSkill("Sail to Lothlórien", "0x7006611E", "Lothlórien (Sail)") + self.mariner:AddSkill("Sail to Tharbad", "0x70066120", "Tharbad (Sail)") + self.mariner:AddSkill("Sail to Snowbourn", "0x70066121", "Snowbourn (Sail)") + self.mariner:AddSkill("Sail to Umbar", "0x700687BB", "Umbar (Sail)") + self.mariner:AddSkill("Sail to Lond Cirion", "0x700687BD", "Lond Cirion (Sail)") + self.mariner:AddSkill("Sail to Jax Phanâl", "0x700687C0", "Jax Phanâl (Sail)") + self.mariner:AddSkill("Sail to Dol Amroth", "0x700687C1", "King's Dol Amroth (Sail)", "King's Gondor") + self.mariner:AddSkill("Sail to Halrax", "0x700687C3", "Halrax (Sail)") -- add the racial travel skills - racialLocations:AddSkill("Return to Bree", "0x700062F6", "Bree (Racial)", - "This enables you to quickly return"); -- human - racialLocations:AddSkill("Return to the Shire", "0x700062C8", "Shire (Racial)"); -- hobbit - racialLocations:AddSkill("Return to Thorin's Gate", "0x70006346", "Thorin's Gate (Racial)", - "This enables you to quickly return"); -- dwarf - racialLocations:AddSkill("Return to Rivendell", "0x7000631F", "Rivendell (Racial)", - "This enables you to quickly return"); --elf - racialLocations:AddSkill("Return Home", "0x70041A22", "Beorning Home (Racial)"); -- beorning - racialLocations:AddSkill("Travel to Caras Galadhon in Lothlórien", "0x70048C8C", "Caras Galadhon (Racial)"); -- high-elf - racialLocations:AddSkill("Travel to Thorin's Hall", "0x70053C0F", "Thorin's Hall (Racial)"); -- stoutaxe - racialLocations:AddSkill("Return to Lyndelby", "0x70066D31", "Lyndelby (Racial)") -- river hobbit + self.allRaces:AddSkill("Return to Bree", "0x700062F6", "Bree (Racial)", "This enables you to quickly return"); -- human + self.allRaces:AddSkill("Return to the Shire", "0x700062C8", "Shire (Racial)"); -- hobbit + self.allRaces:AddSkill("Return to Thorin's Gate", "0x70006346", "Thorin's Gate (Racial)", "This enables you to quickly return"); -- dwarf + self.allRaces:AddSkill("Return to Rivendell", "0x7000631F", "Rivendell (Racial)", "This enables you to quickly return"); --elf + self.allRaces:AddSkill("Return Home", "0x70041A22", "Beorning Home (Racial)"); -- beorning + self.allRaces:AddSkill("Travel to Caras Galadhon in Lothlórien", "0x70048C8C", "Caras Galadhon (Racial)"); -- high-elf + self.allRaces:AddSkill("Travel to Thorin's Hall", "0x70053C0F", "Thorin's Hall (Racial)"); -- stoutaxe + self.allRaces:AddSkill("Return to Lyndelby", "0x70066D31", "Lyndelby (Racial)") -- river hobbit -- add the Return Home and housing skills - genLocations:AddSkill("Return Home", "0x700256BA", "Return Home"); - genLocations:AddSkill("Return Home 2", "0x70025792", "Return Home 2"); - genLocations:AddSkill("Return Home 3", "0x70025793", "Return Home 3"); - genLocations:AddSkill("Return Home 4", "0x70025794", "Return Home 4"); - genLocations:AddSkill("Return Home 5", "0x70025795", "Return Home 5"); - genLocations:AddSkill("Return Home 6", "0x70025796", "Return Home 6"); - genLocations:AddSkill("Return Home 7", "0x7002FF62", "Return Home 7"); - genLocations:AddSkill("Return Home 8", "0x7002FF61", "Return Home 8"); - genLocations:AddSkill("Return Home 9", "0x7002FF60", "Return Home 9"); - genLocations:AddSkill("Return Home 10", "0x7002FF5F", "Return Home 10"); - genLocations:AddSkill("Return Home 11", "0x7002FF63", "Return Home 11"); - genLocations:AddSkill("Travel to Personal House", "0x7000D046", "Personal House"); - genLocations:AddSkill("Travel to Premium House", "0x70046EE4", "Premium House"); - genLocations:AddSkill("Travel to Kinship House", "0x7000D047", "Kinship House"); - genLocations:AddSkill("Travel to Kinship Member's House", "0x70057C36", "Kinship Member's House"); + self.gen:AddSkill("Return Home", "0x700256BA", "Return Home"); + self.gen:AddSkill("Return Home 2", "0x70025792", "Return Home 2"); + self.gen:AddSkill("Return Home 3", "0x70025793", "Return Home 3"); + self.gen:AddSkill("Return Home 4", "0x70025794", "Return Home 4"); + self.gen:AddSkill("Return Home 5", "0x70025795", "Return Home 5"); + self.gen:AddSkill("Return Home 6", "0x70025796", "Return Home 6"); + self.gen:AddSkill("Return Home 7", "0x7002FF62", "Return Home 7"); + self.gen:AddSkill("Return Home 8", "0x7002FF61", "Return Home 8"); + self.gen:AddSkill("Return Home 9", "0x7002FF60", "Return Home 9"); + self.gen:AddSkill("Return Home 10", "0x7002FF5F", "Return Home 10"); + self.gen:AddSkill("Return Home 11", "0x7002FF63", "Return Home 11"); + self.gen:AddSkill("Travel to Personal House", "0x7000D046", "Personal House"); + self.gen:AddSkill("Travel to Premium House", "0x70046EE4", "Premium House"); + self.gen:AddSkill("Travel to Kinship House", "0x7000D047", "Kinship House"); + self.gen:AddSkill("Travel to Kinship Member's House", "0x70057C36", "Kinship Member's House"); -- add the obtainable travel skills - repLocations:AddSkill("Return to Thorin's Gate", "0x7001BF91", "Thorin's Gate (Rep)", - "Thanks to your friendship"); - repLocations:AddSkill("Return to Bree", "0x7001BF90", "Bree (Rep)", - "Thanks to your friendship"); - repLocations:AddSkill("Return to Lalia's Market", "0x700364B1", "Lalia's Market (Mithril)"); - repLocations:AddSkill("Return to Michel Delving", "0x70023262", "Shire (Store)"); - repLocations:AddSkill("Return to Rivendell", "0x70023263", "Rivendell (Store)", - "Thanks to your friendship"); - repLocations:AddSkill("Return to Ost Guruth", "0x70020441", "Ost Guruth (Rep)"); - repLocations:AddSkill("Return to Mirkwood", "0x7001F374", "Mirkwood (Rep)"); - repLocations:AddSkill("Return to Enedwaith", "0x70021FA2", "Enedwaith (Rep)"); - repLocations:AddSkill("Return to Galtrev", "0x7002C647", "Galtrev (Rep)"); - repLocations:AddSkill("Return to Stangard", "0x7002C65D", "Stangard (Rep)"); - repLocations:AddSkill("Return to Snowbourn", "0x70031A46", "Snowbourn (Rep)"); - repLocations:AddSkill("Return to Forlaw", "0x70036B5E", "Forlaw (Rep)"); - repLocations:AddSkill("Return to Aldburg", "0x7003DC81", "Aldburg (Rep)"); - repLocations:AddSkill("Return to Derndingle", "0x7004128F", "Derndingle (Rep)"); - repLocations:AddSkill("Return to Helm's Deep", "0x7003DC82", "Helm's Deep (Rep)"); - repLocations:AddSkill("Return to Dol Amroth", "0x700411AC", "Dol Amroth (Rep)", - "Dol Amroth in western Gondor"); - repLocations:AddSkill("Return to Arnach", "0x70043A6A", "Arnach (Rep)"); - repLocations:AddSkill("Return to Minas Tirith", "0x7004497E", "Minas Tirith (Rep)"); - repLocations:AddSkill("Return to the War-stead", "0x700459A9", "War-stead (Rep)"); - repLocations:AddSkill("Return to after-battle Minas Tirith", "0x70046CC0", "Minas Tirith after-battle (Rep)"); - repLocations:AddSkill("Return to Henneth Annûn", "0x70047080", "Henneth Annûn (Rep)"); - repLocations:AddSkill("Return to after-battle Osgiliath", "0x7004707D", "Osgiliath after-battle (Rep)"); - repLocations:AddSkill("Return to the Camp of the Host", "0x70047BF4", "Camp of the Host (Rep)"); - repLocations:AddSkill("Return to Haerondir", "0x70047C1B", "Haerondir (Rep)"); - repLocations:AddSkill("Return to the Udûn Foothold", "0x7004AE1D", "Udûn Foothold (Rep)"); - repLocations:AddSkill("Journey to the Court of Lothlórien", "0x7004B8C2", "Court of Lothlórien (Rep)"); - repLocations:AddSkill("Journey to the Hall of the King", "0x7004B8C3", "Hall of the King (Rep)"); - repLocations:AddSkill("Journey to the Hall Under the Mountain", "0x7004B8C4", "Hall Under the Mountain (Rep)"); - repLocations:AddSkill("Journey to Bâr Thorenion", "0x7004B8C5", "Bâr Thorenion (Rep)"); - repLocations:AddSkill("Return to Dale", "0x7004D738", "Dale (Rep)"); - repLocations:AddSkill("Return to Járnfast", "0x7004FAC3", "Járnfast (Rep)"); - repLocations:AddSkill("Return to Skarháld", "0x7004FAC5", "Skarháld (Rep)"); - repLocations:AddSkill("Return to Beorninghús", "0x70052F12", "Beorninghús (Rep)"); - repLocations:AddSkill("Return to Hultvís", "0x70052F04", "Hultvís (Rep)"); - repLocations:AddSkill("Return to Estolad Lân", "0x700551F8", "Estolad Lân (Rep)"); - repLocations:AddSkill("Return to Limlók", "0x70057629", "Limlók (Rep)"); - repLocations:AddSkill("Return to Annâk-khurfu", "0x7005856F", "Annâk-khurfu (Rep)"); - repLocations:AddSkill("Return to Trader's Wharf", "0x70059D0E", "Trader's Wharf (Rep)"); - repLocations:AddSkill("Return to Trestlebridge", "0x70059D12", "Trestlebridge (Rep)"); - repLocations:AddSkill("Return to Akrâz-zahar", "0x7005AA90", "Akrâz-zahar (Rep)"); - repLocations:AddSkill("Return to Azanulbizar", "0x7005AA92", "Azanulbizar (Rep)"); - repLocations:AddSkill("Journey to the Hall of Vérnozal", "0x7005A596", "Vérnozal (Quest)"); - repLocations:AddSkill("Return to the Noble Gate", "0x7005D47C", "Noble Gate (Rep)"); - repLocations:AddSkill("Return to Leitstáth", "0x7005D484", "Leitstáth (Rep)"); - repLocations:AddSkill("Return to Tornhad", "0x70060EA8", "Tornhad (Rep)"); - repLocations:AddSkill("Return to Nobottle", "0x70061340", "Nobottle (Rep)"); - repLocations:AddSkill("Return to Andrath", "0x7006323D", "Andrath (Rep)"); - repLocations:AddSkill("Return to Swanfleet", "0x700634A4", "Swanfleet (Rep)"); - repLocations:AddSkill("Return to Cardolan", "0x700634AE", "Cardolan (Rep)"); - repLocations:AddSkill("Return to the Tracery Archives in Rivendell", "0x700634A5", "Tracery Archive (Delving)"); - repLocations:AddSkill("Return to Carn Dûm", "0x70064ACA", "Carn Dûm (Rep)"); - repLocations:AddSkill("Return to Clegur", "0x70064F47", "Clegur (Rep)"); - repLocations:AddSkill("Return to Glân Vraig", "0x7005B38E", "Glân Vraig (Quest)"); - repLocations:AddSkill("Return to Pelargir", "0x700658EB", "Pelargir (Rep)"); - repLocations:AddSkill("Journey to the Order of the Eagle", "0x700686FE", "Order of the Eagle (Rep)"); - repLocations:AddSkill("Return to Umbar", "0x700686FF", "Umbar (Rep)"); - repLocations:AddSkill("Return to Dol Amroth", "0x70068700", "King's Dol Amroth (Rep U38)", - "King's Gondor"); - repLocations:AddSkill("Return to Jax Phanâl", "0x70068701", "Jax Phanâl (Rep)"); - repLocations:AddSkill("Return to Halrax", "0x70068702", "Halrax (Rep)"); - repLocations:AddSkill("Return to Lond Cirion", "0x70068703", "Lond Cirion (Rep)"); - repLocations:AddSkill("Journey to the Ledger-keepers", "0x70068704", "Ledger-Keepers (Rep)"); - repLocations:AddSkill("Return to the Bloody Eagle Tavern", "0x700697F2", "Bloody Eagle Tavern (Rep)"); + self.rep:AddSkill("Return to Thorin's Gate", "0x7001BF91", "Thorin's Gate (Rep)", "Thanks to your friendship"); + self.rep:AddSkill("Return to Bree", "0x7001BF90", "Bree (Rep)", "Thanks to your friendship"); + self.rep:AddSkill("Return to Lalia's Market", "0x700364B1", "Lalia's Market (Mithril)"); + self.rep:AddSkill("Return to Michel Delving", "0x70023262", "Shire (Store)"); + self.rep:AddSkill("Return to Rivendell", "0x70023263", "Rivendell (Store)", "Thanks to your friendship"); + self.rep:AddSkill("Return to Ost Guruth", "0x70020441", "Ost Guruth (Rep)"); + self.rep:AddSkill("Return to Mirkwood", "0x7001F374", "Mirkwood (Rep)"); + self.rep:AddSkill("Return to Enedwaith", "0x70021FA2", "Enedwaith (Rep)"); + self.rep:AddSkill("Return to Galtrev", "0x7002C647", "Galtrev (Rep)"); + self.rep:AddSkill("Return to Stangard", "0x7002C65D", "Stangard (Rep)"); + self.rep:AddSkill("Return to Snowbourn", "0x70031A46", "Snowbourn (Rep)"); + self.rep:AddSkill("Return to Forlaw", "0x70036B5E", "Forlaw (Rep)"); + self.rep:AddSkill("Return to Aldburg", "0x7003DC81", "Aldburg (Rep)"); + self.rep:AddSkill("Return to Derndingle", "0x7004128F", "Derndingle (Rep)"); + self.rep:AddSkill("Return to Helm's Deep", "0x7003DC82", "Helm's Deep (Rep)"); + self.rep:AddSkill("Return to Dol Amroth", "0x700411AC", "Dol Amroth (Rep)", "Dol Amroth in western Gondor"); + self.rep:AddSkill("Return to Arnach", "0x70043A6A", "Arnach (Rep)"); + self.rep:AddSkill("Return to Minas Tirith", "0x7004497E", "Minas Tirith (Rep)"); + self.rep:AddSkill("Return to the War-stead", "0x700459A9", "War-stead (Rep)"); + self.rep:AddSkill("Return to after-battle Minas Tirith", "0x70046CC0", "Minas Tirith after-battle (Rep)"); + self.rep:AddSkill("Return to Henneth Annûn", "0x70047080", "Henneth Annûn (Rep)"); + self.rep:AddSkill("Return to after-battle Osgiliath", "0x7004707D", "Osgiliath after-battle (Rep)"); + self.rep:AddSkill("Return to the Camp of the Host", "0x70047BF4", "Camp of the Host (Rep)"); + self.rep:AddSkill("Return to Haerondir", "0x70047C1B", "Haerondir (Rep)"); + self.rep:AddSkill("Return to the Udûn Foothold", "0x7004AE1D", "Udûn Foothold (Rep)"); + self.rep:AddSkill("Journey to the Court of Lothlórien", "0x7004B8C2", "Court of Lothlórien (Rep)"); + self.rep:AddSkill("Journey to the Hall of the King", "0x7004B8C3", "Hall of the King (Rep)"); + self.rep:AddSkill("Journey to the Hall Under the Mountain", "0x7004B8C4", "Hall Under the Mountain (Rep)"); + self.rep:AddSkill("Journey to Bâr Thorenion", "0x7004B8C5", "Bâr Thorenion (Rep)"); + self.rep:AddSkill("Return to Dale", "0x7004D738", "Dale (Rep)"); + self.rep:AddSkill("Return to Járnfast", "0x7004FAC3", "Járnfast (Rep)"); + self.rep:AddSkill("Return to Skarháld", "0x7004FAC5", "Skarháld (Rep)"); + self.rep:AddSkill("Return to Beorninghús", "0x70052F12", "Beorninghús (Rep)"); + self.rep:AddSkill("Return to Hultvís", "0x70052F04", "Hultvís (Rep)"); + self.rep:AddSkill("Return to Estolad Lân", "0x700551F8", "Estolad Lân (Rep)"); + self.rep:AddSkill("Return to Limlók", "0x70057629", "Limlók (Rep)"); + self.rep:AddSkill("Return to Annâk-khurfu", "0x7005856F", "Annâk-khurfu (Rep)"); + self.rep:AddSkill("Return to Trader's Wharf", "0x70059D0E", "Trader's Wharf (Rep)"); + self.rep:AddSkill("Return to Trestlebridge", "0x70059D12", "Trestlebridge (Rep)"); + self.rep:AddSkill("Return to Akrâz-zahar", "0x7005AA90", "Akrâz-zahar (Rep)"); + self.rep:AddSkill("Return to Azanulbizar", "0x7005AA92", "Azanulbizar (Rep)"); + self.rep:AddSkill("Journey to the Hall of Vérnozal", "0x7005A596", "Vérnozal (Quest)"); + self.rep:AddSkill("Return to the Noble Gate", "0x7005D47C", "Noble Gate (Rep)"); + self.rep:AddSkill("Return to Leitstáth", "0x7005D484", "Leitstáth (Rep)"); + self.rep:AddSkill("Return to Tornhad", "0x70060EA8", "Tornhad (Rep)"); + self.rep:AddSkill("Return to Nobottle", "0x70061340", "Nobottle (Rep)"); + self.rep:AddSkill("Return to Andrath", "0x7006323D", "Andrath (Rep)"); + self.rep:AddSkill("Return to Swanfleet", "0x700634A4", "Swanfleet (Rep)"); + self.rep:AddSkill("Return to Cardolan", "0x700634AE", "Cardolan (Rep)"); + self.rep:AddSkill("Return to the Tracery Archives in Rivendell", "0x700634A5", "Tracery Archive (Delving)"); + self.rep:AddSkill("Return to Carn Dûm", "0x70064ACA", "Carn Dûm (Rep)"); + self.rep:AddSkill("Return to Clegur", "0x70064F47", "Clegur (Rep)"); + self.rep:AddSkill("Return to Glân Vraig", "0x7005B38E", "Glân Vraig (Quest)"); + self.rep:AddSkill("Return to Pelargir", "0x700658EB", "Pelargir (Rep)"); + self.rep:AddSkill("Journey to the Order of the Eagle", "0x700686FE", "Order of the Eagle (Rep)"); + self.rep:AddSkill("Return to Umbar", "0x700686FF", "Umbar (Rep)"); + self.rep:AddSkill("Return to Dol Amroth", "0x70068700", "King's Dol Amroth (Rep U38)","King's Gondor"); + self.rep:AddSkill("Return to Jax Phanâl", "0x70068701", "Jax Phanâl (Rep)"); + self.rep:AddSkill("Return to Halrax", "0x70068702", "Halrax (Rep)"); + self.rep:AddSkill("Return to Lond Cirion", "0x70068703", "Lond Cirion (Rep)"); + self.rep:AddSkill("Journey to the Ledger-keepers", "0x70068704", "Ledger-Keepers (Rep)"); + self.rep:AddSkill("Return to the Bloody Eagle Tavern", "0x700697F2", "Bloody Eagle Tavern (Rep)"); -- monster player maps - creepLocations:AddSkill("Crude Map to Gramsfoot", "0x70028BBC"); - creepLocations:AddSkill("Map to Gramsfoot", "0x70028BC1"); - - creepLocations:AddSkill("Crude Map to Isendeep", "0x70028BB3"); - creepLocations:AddSkill("Crude Map to Tol Ascarnen", "0x70028BB6"); - creepLocations:AddSkill("Crude Map to Lugazag", "0x70028BB7"); - creepLocations:AddSkill("Crude Map to Tirith Rhaw", "0x70028BBE"); - creepLocations:AddSkill("Crude Map to Grimwood", "0x70028BBF"); - - creepLocations:AddSkill("Poor Map to Isendeep", "0x70028BAF"); - creepLocations:AddSkill("Poor Map to Tol Ascarnen", "0x70028BB1"); - creepLocations:AddSkill("Poor Map to Lugazag", "0x70028BB2"); - creepLocations:AddSkill("Poor Map to Tirith Rhaw", "0x70028BB4"); - creepLocations:AddSkill("Poor Map to Grimwood", "0x70028BB9"); - - creepLocations:AddSkill("Good Map to Isendeep", "0x70028BC0"); - creepLocations:AddSkill("Good Map to Tol Ascarnen", "0x70028BC2"); - creepLocations:AddSkill("Good Map to Lugazag", "0x70028BB5"); - creepLocations:AddSkill("Good Map to Tirith Rhaw", "0x70028BB0"); - creepLocations:AddSkill("Good Map to Grimwood", "0x70028BBD"); + self.creep:AddSkill("Crude Map to Gramsfoot", "0x70028BBC"); + self.creep:AddSkill("Map to Gramsfoot", "0x70028BC1"); + self.creep:AddSkill("Crude Map to Isendeep", "0x70028BB3"); + self.creep:AddSkill("Crude Map to Tol Ascarnen", "0x70028BB6"); + self.creep:AddSkill("Crude Map to Lugazag", "0x70028BB7"); + self.creep:AddSkill("Crude Map to Tirith Rhaw", "0x70028BBE"); + self.creep:AddSkill("Crude Map to Grimwood", "0x70028BBF"); + self.creep:AddSkill("Poor Map to Isendeep", "0x70028BAF"); + self.creep:AddSkill("Poor Map to Tol Ascarnen", "0x70028BB1"); + self.creep:AddSkill("Poor Map to Lugazag", "0x70028BB2"); + self.creep:AddSkill("Poor Map to Tirith Rhaw", "0x70028BB4"); + self.creep:AddSkill("Poor Map to Grimwood", "0x70028BB9"); + self.creep:AddSkill("Good Map to Isendeep", "0x70028BC0"); + self.creep:AddSkill("Good Map to Tol Ascarnen", "0x70028BC2"); + self.creep:AddSkill("Good Map to Lugazag", "0x70028BB5"); + self.creep:AddSkill("Good Map to Tirith Rhaw", "0x70028BB0"); + self.creep:AddSkill("Good Map to Grimwood", "0x70028BBD"); end diff --git a/src/IndexedDictionaryFr.lua b/src/IndexedDictionaryFr.lua index 1a8e3bb..2c9f106 100644 --- a/src/IndexedDictionaryFr.lua +++ b/src/IndexedDictionaryFr.lua @@ -13,10 +13,6 @@ eriadorMapTitleString = "Carte de l'Eriador"; rhovanionMapTitleString = "Carte du Rhovanion"; gondorMapTitleString = "Carte du Gondor" --- strings for maps -glanMapString = "Carte précise pour aller à Glân Vraig"; -glanMapItemString = "Carte précise pour aller à Glân Vraig"; - skillNotTrainedString = "Compétence non utilisée: "; -- options window strings @@ -41,7 +37,16 @@ mainSlidersString = "Modifier l'opacité de la fenêtre"; minString = "Min: "; maxString = "Max: "; resetSettingsString = "Remise a zéro"; +saveGlobalDefaultsString = "Enregistrer par défaut globales"; +loadGlobalDefaultsString = "Charger par défaut globales"; checkSkillsString = "Vérification des compétences non utilisées"; +enableRepSkillsString = "Activer le chevauchement"; +disableRepSkillsString = "Désactiver le chevauchement"; +enableAllString = "Activer tout"; +disableAllString = "Désactiver tout"; +ignoreEscString = "Escape ne pas fermer la fenêtre principale"; +minWindowString = "Utiliser la mini-fenêtre"; +fadeWindowString = "Fondu de la vitesse de la fenêtre"; -- menu strings menuFiltersString = "Filtres"; @@ -66,316 +71,255 @@ menuSkillsString = "Vérification des compétences non utilisées"; --[[ travel skills ]] -- --[[ Add all the travel skills ]] -- -TravelDictionaries = class() - -function TravelDictionaries:Constructor() - - -- create the indexed tables that store all the data - genLocations = IndexedDictionary(); - hunterLocations = IndexedDictionary(); - wardenLocations = IndexedDictionary(); - racialLocations = IndexedDictionary(); - repLocations = IndexedDictionary(); - creepLocations = IndexedDictionary(); - marinerLocations = IndexedDictionary(); - - -- a table to store the number of each type of travel skill - travelCount = { 0, 0, 0, 0, 0, 0, 0 }; - LocationsTotal = 0; - - self:CreateDictionaries(); - self:GetCounts(); -end - --- function to count the number of skills in total -function TravelDictionaries:GetCounts() - travelCount[1] = hunterLocations:GetCount(); - travelCount[2] = wardenLocations:GetCount(); - travelCount[3] = genLocations:GetCount(); - travelCount[4] = repLocations:GetCount(); - travelCount[5] = racialLocations:GetCount(); - travelCount[6] = creepLocations:GetCount(); - travelCount[7] = marinerLocations:GetCount(); - - LocationsTotal = travelCount[1] + travelCount[2] + travelCount[3] + travelCount[4] + travelCount[5] + travelCount[6] + travelCount[7]; -end - --- function to return the count of a specific type of travel -function TravelDictionaries:GetCount(index) - return travelCount[index]; -end - --- function to get the total number of travel skills -function TravelDictionaries:GetTotalCount() - return LocationsTotal; -end - --- function to return the 5 tables containing the travel skills -function TravelDictionaries:GetLocations() - return genLocations, hunterLocations, wardenLocations, racialLocations, repLocations, creepLocations, marinerLocations; -end - -- add the data to custom dictionaries to maintain the order -function TravelDictionaries:CreateDictionaries() - hunterLocations:AddSkill("Retour au campement", "0x7000A2C1", "Retour au campement"); - hunterLocations:AddSkill("Guide vers Bree", "0x70003F42", "Bree (Guide)"); - hunterLocations:AddSkill("Guide vers le Palais de Thorin", "0x70003F41", "Palais de Thorin (Guide)"); - hunterLocations:AddSkill("Guide vers Grand'Cave", "0x7000A2C3", "Grand'Cave (Guide)"); - hunterLocations:AddSkill("Guide vers Esteldin", "0x70003F43", "Esteldin (Guide)"); - hunterLocations:AddSkill("Guide vers Evendim", "0x7000A2C4", "Evendim (Guide)"); - hunterLocations:AddSkill("Guide vers Ost Guruth", "0x7000A2C2", "Ost Guruth (Guide)"); - hunterLocations:AddSkill("Guide vers Fondcombe", "0x70003F44", "Fondcombe (Guide)"); - hunterLocations:AddSkill("Guide vers Sûri-kylä", "0x70017C82", "Sûri-kylä (Guide)"); - hunterLocations:AddSkill("Guide vers l'ouest d'Angmar", "0x7000A2C5", "Angmar ouest (Guide)"); - hunterLocations:AddSkill("Guide vers l'est d'Angmar", "0x7000A2C6", "Angmar est (Guide)"); - hunterLocations:AddSkill("Guide vers Echad Dunann", "0x70017C81", "Echad Dunann (Guide)"); - hunterLocations:AddSkill("Guide vers la vingt et unième salle", "0x70017C7A", "Vingt et unième salle (Guide)"); - hunterLocations:AddSkill("Guide vers l'Orée noire", "0x7001F459", "Orée noire (Guide)"); - hunterLocations:AddSkill("Guide vers Harndirion", "0x700235EF", "Harndirion (Guide)"); - hunterLocations:AddSkill("Guide pour Galtrev", "0x7002A93F", "Galtrev (Guide)"); - hunterLocations:AddSkill("Guide vers Stangarde", "0x7002C62C", "Stangarde (Guide)"); - hunterLocations:AddSkill("Guide vers Caras Galadhon", "0x7002E754", "Caras Galadhon (Guide)"); - hunterLocations:AddSkill("Guide vers les Monts Brumeux", "0x7002E756", "Monts Brumeux (Guide)"); - hunterLocations:AddSkill("Guide vers Neigebronne", "0x7003198E", "Neigebronne (Guide)"); - hunterLocations:AddSkill("Guide vers Forloi", "0x70036B5D", "Forloi (Guide)"); - hunterLocations:AddSkill("Guide vers Aldburg", "0x7003DC71", "Aldburg (Guide)"); - hunterLocations:AddSkill("Guide vers le Gouffre de Helm", "0x7003DC72", "Gouffre de Helm (Guide)"); - hunterLocations:AddSkill("Guide vers Dol Amroth", "0x70041197", "Dol Amroth (Guide)", - "l'Ouest du Gondor"); - hunterLocations:AddSkill("Guide pour Arnach", "0x70043A63", "Arnach (Guide)"); - hunterLocations:AddSkill("Guide vers Minas Tirith", "0x70044985", "Minas Tirith (Guide)"); - hunterLocations:AddSkill("Guide pour se rendre au camp militaire", "0x700459AF", "Camp militaire (Guide)"); - hunterLocations:AddSkill("Guide de Minas Tirith après la bataille", "0x70046CBB", "Minas Tirith après la bataille (Guide)"); - hunterLocations:AddSkill("Guide vers Henneth Annûn", "0x70047077", "Henneth Annûn (Guide)"); - hunterLocations:AddSkill("Guide vers Osgiliath après la bataille", "0x70047074", "Osgiliath après la bataille (Guide)"); - hunterLocations:AddSkill("Guide vers le Camp de l'armée", "0x70047BFA", "Camp de l'armée (Guide)"); - hunterLocations:AddSkill("Guide vers Haerondir", "0x70047C1D", "Haerondir (Guide)"); - hunterLocations:AddSkill("Guide vers le fort d'Udûn", "0x7004AE1E", "Fort d'Udûn (Guide)"); - hunterLocations:AddSkill("Guide vers Dale", "0x7004D73B", "Dale (Guide)"); - hunterLocations:AddSkill("Guide vers Jarnfast", "0x7004FACC", "Jarnfast (Guide)"); - hunterLocations:AddSkill("Guide vers Skarhald", "0x7004FACB", "Skarhald (Guide)"); - hunterLocations:AddSkill("Guide pour Beorninghus", "0x70052F07", "Beorninghus (Guide)"); - hunterLocations:AddSkill("Guide de Hultvis", "0x70052F08", "Hultvis (Guide)"); - hunterLocations:AddSkill("Guide vers Estolad Lân", "0x700551F4", "Estolad Lân (Guide)"); - hunterLocations:AddSkill("Guide de Limlok", "0x7005762D", "Limlok (Guide)"); - hunterLocations:AddSkill("Guide vers Annâk-khurfu", "0x70058571", "Annâk-khurfu (Guide)"); - hunterLocations:AddSkill("Guide vers le Quai des marchands", "0x70059D0C", "Quai des marchands (Guide)"); - hunterLocations:AddSkill("Guide vers Pont-à-Tréteaux", "0x70059D16", "Pont-à-Tréteaux (Guide)"); - hunterLocations:AddSkill("Guide vers Akrâz-zahar", "0x7005AA91", "Akrâz-zahar (Guide)"); - hunterLocations:AddSkill("Guide vers Azanulbizar", "0x7005AA95", "Azanulbizar (Guide)"); - hunterLocations:AddSkill("Guide vers la Porte Noble", "0x7005D487", "Porte Noble (Guide)"); - hunterLocations:AddSkill("Guide vers Leitstath", "0x7005D47D", "Leitstath (Guide)"); - hunterLocations:AddSkill("Guide vers Tornhad", "0x70060EA6", "Tornhad (Guide)"); - hunterLocations:AddSkill("Guide vers Bourdeneuve", "0x7006133F", "Bourdeneuve (Guide)"); - hunterLocations:AddSkill("Guide vers Andrath", "0x7006323C", "Andrath (Guide)"); - hunterLocations:AddSkill("Guide vers les Noues des cygnes", "0x700634AA", "Noues des cygnes (Guide)"); - hunterLocations:AddSkill("Guide vers le Cardolan", "0x700634A7", "Cardolan (Guide)"); - hunterLocations:AddSkill("Guide vers Carn Dûm", "0x70064AC8", "Carn Dûm (Guide)"); - hunterLocations:AddSkill("Guide vers Clegur", "0x70064F4C", "Clegur (Guide)"); - hunterLocations:AddSkill("Guide vers Pelargir", "0x700658EA", "Pelargir (Guide)"); - hunterLocations:AddSkill("Guide vers Dol Amroth", "0x70068711", "Dol Amroth royal (Guide U38)", - "le Gondor royal"); - hunterLocations:AddSkill("Guide vers Halrax", "0x70068713", "Halrax (Guide)"); - hunterLocations:AddSkill("Guide vers Lond Cirion", "0x70068717", "Lond Cirion (Guide)"); - hunterLocations:AddSkill("Guide vers Umbar", "0x70068718", "Umbar (Guide)"); - hunterLocations:AddSkill("Guide vers Jax Phanâl", "0x70068719", "Jax Phanâl (Guide)"); - hunterLocations:AddSkill("Guide vers la taverne de l'Aigle sanglant", "0x700697EF", "Taverne de l'Aigle sanglant (Guide)"); +function TravelDictionary:CreateDictionaries() + -- add the hunter locations + self.hunter:AddSkill("Retour au campement", "0x7000A2C1", "Retour au campement"); + self.hunter:AddSkill("Guide vers Bree", "0x70003F42", "Bree (Guide)"); + self.hunter:AddSkill("Guide vers le Palais de Thorin", "0x70003F41", "Palais de Thorin (Guide)"); + self.hunter:AddSkill("Guide vers Grand'Cave", "0x7000A2C3", "Grand'Cave (Guide)"); + self.hunter:AddSkill("Guide vers Esteldin", "0x70003F43", "Esteldin (Guide)"); + self.hunter:AddSkill("Guide vers Evendim", "0x7000A2C4", "Evendim (Guide)"); + self.hunter:AddSkill("Guide vers Ost Guruth", "0x7000A2C2", "Ost Guruth (Guide)"); + self.hunter:AddSkill("Guide vers Fondcombe", "0x70003F44", "Fondcombe (Guide)"); + self.hunter:AddSkill("Guide vers Sûri-kylä", "0x70017C82", "Sûri-kylä (Guide)"); + self.hunter:AddSkill("Guide vers l'ouest d'Angmar", "0x7000A2C5", "Angmar ouest (Guide)"); + self.hunter:AddSkill("Guide vers l'est d'Angmar", "0x7000A2C6", "Angmar est (Guide)"); + self.hunter:AddSkill("Guide vers Echad Dunann", "0x70017C81", "Echad Dunann (Guide)"); + self.hunter:AddSkill("Guide vers la vingt et unième salle", "0x70017C7A", "Vingt et unième salle (Guide)"); + self.hunter:AddSkill("Guide vers l'Orée noire", "0x7001F459", "Orée noire (Guide)"); + self.hunter:AddSkill("Guide vers Harndirion", "0x700235EF", "Harndirion (Guide)"); + self.hunter:AddSkill("Guide pour Galtrev", "0x7002A93F", "Galtrev (Guide)"); + self.hunter:AddSkill("Guide vers Stangarde", "0x7002C62C", "Stangarde (Guide)"); + self.hunter:AddSkill("Guide vers Caras Galadhon", "0x7002E754", "Caras Galadhon (Guide)"); + self.hunter:AddSkill("Guide vers les Monts Brumeux", "0x7002E756", "Monts Brumeux (Guide)"); + self.hunter:AddSkill("Guide vers Neigebronne", "0x7003198E", "Neigebronne (Guide)"); + self.hunter:AddSkill("Guide vers Forloi", "0x70036B5D", "Forloi (Guide)"); + self.hunter:AddSkill("Guide vers Aldburg", "0x7003DC71", "Aldburg (Guide)"); + self.hunter:AddSkill("Guide vers le Gouffre de Helm", "0x7003DC72", "Gouffre de Helm (Guide)"); + self.hunter:AddSkill("Guide vers Dol Amroth", "0x70041197", "Dol Amroth (Guide)", "l'Ouest du Gondor"); + self.hunter:AddSkill("Guide pour Arnach", "0x70043A63", "Arnach (Guide)"); + self.hunter:AddSkill("Guide vers Minas Tirith", "0x70044985", "Minas Tirith (Guide)"); + self.hunter:AddSkill("Guide pour se rendre au camp militaire", "0x700459AF", "Camp militaire (Guide)"); + self.hunter:AddSkill("Guide de Minas Tirith après la bataille", "0x70046CBB", "Minas Tirith après la bataille (Guide)"); + self.hunter:AddSkill("Guide vers Henneth Annûn", "0x70047077", "Henneth Annûn (Guide)"); + self.hunter:AddSkill("Guide vers Osgiliath après la bataille", "0x70047074", "Osgiliath après la bataille (Guide)"); + self.hunter:AddSkill("Guide vers le Camp de l'armée", "0x70047BFA", "Camp de l'armée (Guide)"); + self.hunter:AddSkill("Guide vers Haerondir", "0x70047C1D", "Haerondir (Guide)"); + self.hunter:AddSkill("Guide vers le fort d'Udûn", "0x7004AE1E", "Fort d'Udûn (Guide)"); + self.hunter:AddSkill("Guide vers Dale", "0x7004D73B", "Dale (Guide)"); + self.hunter:AddSkill("Guide vers Jarnfast", "0x7004FACC", "Jarnfast (Guide)"); + self.hunter:AddSkill("Guide vers Skarhald", "0x7004FACB", "Skarhald (Guide)"); + self.hunter:AddSkill("Guide pour Beorninghus", "0x70052F07", "Beorninghus (Guide)"); + self.hunter:AddSkill("Guide de Hultvis", "0x70052F08", "Hultvis (Guide)"); + self.hunter:AddSkill("Guide vers Estolad Lân", "0x700551F4", "Estolad Lân (Guide)"); + self.hunter:AddSkill("Guide de Limlok", "0x7005762D", "Limlok (Guide)"); + self.hunter:AddSkill("Guide vers Annâk-khurfu", "0x70058571", "Annâk-khurfu (Guide)"); + self.hunter:AddSkill("Guide vers le Quai des marchands", "0x70059D0C", "Quai des marchands (Guide)"); + self.hunter:AddSkill("Guide vers Pont-à-Tréteaux", "0x70059D16", "Pont-à-Tréteaux (Guide)"); + self.hunter:AddSkill("Guide vers Akrâz-zahar", "0x7005AA91", "Akrâz-zahar (Guide)"); + self.hunter:AddSkill("Guide vers Azanulbizar", "0x7005AA95", "Azanulbizar (Guide)"); + self.hunter:AddSkill("Guide vers la Porte Noble", "0x7005D487", "Porte Noble (Guide)"); + self.hunter:AddSkill("Guide vers Leitstath", "0x7005D47D", "Leitstath (Guide)"); + self.hunter:AddSkill("Guide vers Tornhad", "0x70060EA6", "Tornhad (Guide)"); + self.hunter:AddSkill("Guide vers Bourdeneuve", "0x7006133F", "Bourdeneuve (Guide)"); + self.hunter:AddSkill("Guide vers Andrath", "0x7006323C", "Andrath (Guide)"); + self.hunter:AddSkill("Guide vers les Noues des cygnes", "0x700634AA", "Noues des cygnes (Guide)"); + self.hunter:AddSkill("Guide vers le Cardolan", "0x700634A7", "Cardolan (Guide)"); + self.hunter:AddSkill("Guide vers Carn Dûm", "0x70064AC8", "Carn Dûm (Guide)"); + self.hunter:AddSkill("Guide vers Clegur", "0x70064F4C", "Clegur (Guide)"); + self.hunter:AddSkill("Guide vers Pelargir", "0x700658EA", "Pelargir (Guide)"); + self.hunter:AddSkill("Guide vers Dol Amroth", "0x70068711", "Dol Amroth royal (Guide U38)", "le Gondor royal"); + self.hunter:AddSkill("Guide vers Halrax", "0x70068713", "Halrax (Guide)"); + self.hunter:AddSkill("Guide vers Lond Cirion", "0x70068717", "Lond Cirion (Guide)"); + self.hunter:AddSkill("Guide vers Umbar", "0x70068718", "Umbar (Guide)"); + self.hunter:AddSkill("Guide vers Jax Phanâl", "0x70068719", "Jax Phanâl (Guide)"); + self.hunter:AddSkill("Guide vers la taverne de l'Aigle sanglant", "0x700697EF", "Taverne de l'Aigle sanglant (Guide)"); - wardenLocations:AddSkill("Rassemblement : Ost Guruth", "0x70014786", "Ost Guruth (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Esteldin", "0x70014798", "Esteldin (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : La région d'Evendim", "0x7001478E", "Evendim (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Fondcombe", "0x70014791", "Fondcombe (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Sûri-kylä", "0x700237D4", "Sûri-kylä (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : La vingt et unième salle", "0x7001819E", "Vingt et unième salle (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : L'Orée noire", "0x7001F45C", "Orée noire (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Harndirion", "0x700235EB", "Harndirion (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Galtrev", "0x7002A90A", "Galtrev (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Stangarde", "0x7002C646", "Stangarde (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Caras Galadhon", "0x700303DF", "Caras Galadhon (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Les Monts Brumeux", "0x700303DD", "Monts Brumeux (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Neigebronne", "0x7003198D", "Neigebronne (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Forloi", "0x70036B5B", "Forloi (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Aldburg", "0x7003DC7A", "Aldburg (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Gouffre de Helm", "0x7003DC79", "Gouffre de Helm (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Dol Amroth", "0x70041198", "Dol Amroth (Rassemblement)", - "l'Ouest du Gondor"); - wardenLocations:AddSkill("Rassemblement : Arnach", "0x70043A66", "Arnach (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Minas Tirith", "0x70044982", "Minas Tirith (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Camp militaire", "0x700459AA", "Camp militaire (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Minas Tirith après la bataille", "0x70046CBF", "Minas Tirith après la bataille (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Henneth Annûn", "0x70047075", "Henneth Annûn (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Osgiliath après la bataille", "0x70047076", "Osgiliath après la bataille (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Camp de l'armée", "0x70047BFC", "Camp de l'armée (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Haerondir", "0x70047C23", "Haerondir (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Le fort d'Udûn", "0x7004AE1F", "Fort d'Udûn (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Dale", "0x7004D73A", "Dale (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Jarnfast", "0x7004FACA", "Jarnfast (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Skarhald", "0x7004FACD", "Skarhald (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Beorninghus", "0x70052F0A", "Beorninghus (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Hultvis", "0x70052F06", "Hultvis (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Estolad Lân", "0x700551F2", "Estolad Lân (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Limlok", "0x70057635", "Limlok (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Annâk-khurfu", "0x70058572", "Annâk-khurfu (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Quai des marchands", "0x70059D09", "Quai des marchands (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Pont-à-Tréteaux", "0x70059D10", "Pont-à-Tréteaux (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Akrâz-zahar", "0x7005AA8F", "Akrâz-zahar (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Azanulbizar", "0x7005AA8C", "Azanulbizar (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : La Porte Noble", "0x7005D48A", "Porte Noble (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Leitstath", "0x7005D488", "Leitstath (Rassemblement)"); - wardenLocations:AddSkill("Retour à Tornhad", "0x70060EA5", "Tornhad (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Bourdeneuve", "0x7006133E", "Bourdeneuve (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Andrath", "0x70063242", "Andrath (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement aux Noues des cygnes", "0x700634B6", "Noues des cygnes (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement au Cardolan", "0x700634AD", "Cardolan (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement : Carn Dûm", "0x70064ACB", "Carn Dûm (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Clegur", "0x70064F4D", "Clegur (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Pelargir", "0x700658E8", "Pelargir (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Jax Phanâl","0x7006870C", "Jax Phanâl (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Umbar","0x7006870F","Umbar (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Halrax","0x70068710", "Halrax (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à Dol Amroth","0x70068712", "Dol Amroth royal (Rassemblement)", - "le Gondor royal"); - wardenLocations:AddSkill("Rassemblement à Lond Cirion","0x70068715", "Lond Cirion (Rassemblement)"); - wardenLocations:AddSkill("Rassemblement à la taverne de l'Aigle sanglant","0x700697F3", "Taverne de l'Aigle sanglant (Rassemblement)"); + -- add the Warden locations + self.warden:AddSkill("Rassemblement : Ost Guruth", "0x70014786", "Ost Guruth (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Esteldin", "0x70014798", "Esteldin (Rassemblement)"); + self.warden:AddSkill("Rassemblement : La région d'Evendim", "0x7001478E", "Evendim (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Fondcombe", "0x70014791", "Fondcombe (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Sûri-kylä", "0x700237D4", "Sûri-kylä (Rassemblement)"); + self.warden:AddSkill("Rassemblement : La vingt et unième salle", "0x7001819E", "Vingt et unième salle (Rassemblement)"); + self.warden:AddSkill("Rassemblement : L'Orée noire", "0x7001F45C", "Orée noire (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Harndirion", "0x700235EB", "Harndirion (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Galtrev", "0x7002A90A", "Galtrev (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Stangarde", "0x7002C646", "Stangarde (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Caras Galadhon", "0x700303DF", "Caras Galadhon (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Les Monts Brumeux", "0x700303DD", "Monts Brumeux (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Neigebronne", "0x7003198D", "Neigebronne (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Forloi", "0x70036B5B", "Forloi (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Aldburg", "0x7003DC7A", "Aldburg (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Gouffre de Helm", "0x7003DC79", "Gouffre de Helm (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Dol Amroth", "0x70041198", "Dol Amroth (Rassemblement)", "l'Ouest du Gondor"); + self.warden:AddSkill("Rassemblement : Arnach", "0x70043A66", "Arnach (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Minas Tirith", "0x70044982", "Minas Tirith (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Camp militaire", "0x700459AA", "Camp militaire (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Minas Tirith après la bataille", "0x70046CBF", "Minas Tirith après la bataille (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Henneth Annûn", "0x70047075", "Henneth Annûn (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Osgiliath après la bataille", "0x70047076", "Osgiliath après la bataille (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Camp de l'armée", "0x70047BFC", "Camp de l'armée (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Haerondir", "0x70047C23", "Haerondir (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Le fort d'Udûn", "0x7004AE1F", "Fort d'Udûn (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Dale", "0x7004D73A", "Dale (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Jarnfast", "0x7004FACA", "Jarnfast (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Skarhald", "0x7004FACD", "Skarhald (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Beorninghus", "0x70052F0A", "Beorninghus (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Hultvis", "0x70052F06", "Hultvis (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Estolad Lân", "0x700551F2", "Estolad Lân (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Limlok", "0x70057635", "Limlok (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Annâk-khurfu", "0x70058572", "Annâk-khurfu (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Quai des marchands", "0x70059D09", "Quai des marchands (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Pont-à-Tréteaux", "0x70059D10", "Pont-à-Tréteaux (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Akrâz-zahar", "0x7005AA8F", "Akrâz-zahar (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Azanulbizar", "0x7005AA8C", "Azanulbizar (Rassemblement)"); + self.warden:AddSkill("Rassemblement : La Porte Noble", "0x7005D48A", "Porte Noble (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Leitstath", "0x7005D488", "Leitstath (Rassemblement)"); + self.warden:AddSkill("Retour à Tornhad", "0x70060EA5", "Tornhad (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Bourdeneuve", "0x7006133E", "Bourdeneuve (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Andrath", "0x70063242", "Andrath (Rassemblement)"); + self.warden:AddSkill("Rassemblement aux Noues des cygnes", "0x700634B6", "Noues des cygnes (Rassemblement)"); + self.warden:AddSkill("Rassemblement au Cardolan", "0x700634AD", "Cardolan (Rassemblement)"); + self.warden:AddSkill("Rassemblement : Carn Dûm", "0x70064ACB", "Carn Dûm (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Clegur", "0x70064F4D", "Clegur (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Pelargir", "0x700658E8", "Pelargir (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Jax Phanâl","0x7006870C", "Jax Phanâl (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Umbar","0x7006870F","Umbar (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Halrax","0x70068710", "Halrax (Rassemblement)"); + self.warden:AddSkill("Rassemblement à Dol Amroth","0x70068712", "Dol Amroth royal (Rassemblement)", "le Gondor royal"); + self.warden:AddSkill("Rassemblement à Lond Cirion","0x70068715", "Lond Cirion (Rassemblement)"); + self.warden:AddSkill("Rassemblement à la taverne de l'Aigle sanglant","0x700697F3", "Taverne de l'Aigle sanglant (Rassemblement)"); - marinerLocations:AddSkill("Naviguer vers Celondim", "0x70066100", "Celondim (Naviguer)") - marinerLocations:AddSkill("Naviguer vers les Terres brunes", "0x70066101", "Terres brunes (Naviguer)") - marinerLocations:AddSkill("Naviguer vers le Quai des marchands", "0x70066105", "Quai des marchands (Naviguer)") - marinerLocations:AddSkill("Naviguer vers Osgiliath après la bataille", "0x70066109", "Osgiliath après la bataille (Naviguer)") - marinerLocations:AddSkill("Cap sur la Ville du Lac", "0x7006610C", "Ville du Lac (Naviguer)") - marinerLocations:AddSkill("Naviguer vers l'Orée Noire", "0x7006610E", "Orée Noire (Naviguer)") - marinerLocations:AddSkill("Naviguer vers Tinnudir", "0x7006610F", "Tinnudir (Naviguer)") - marinerLocations:AddSkill("Naviguer vers Dol Amroth", "0x70066117", "Dol Amroth (Naviguer)", - "Dol Amroth en bonne compagnie.") - marinerLocations:AddSkill("Naviguer vers le Pays de Bouc", "0x7006611A", "Pays de Bouc (Naviguer)") - marinerLocations:AddSkill("Naviguer vers Pelargir", "0x7006611B", "Pelargir (Naviguer)") - marinerLocations:AddSkill("Naviguer vers Sûri-kylä", "0x7006611C", "Sûri-kylä (Naviguer)") - marinerLocations:AddSkill("Naviguer vers la Lothlorien", "0x7006611E", "Lothlorien (Naviguer)") - marinerLocations:AddSkill("Naviguer vers le Gué de Sarn", "0x70066120", "le Gué de Sarn (Naviguer)") - marinerLocations:AddSkill("Naviguer vers Neigebronne", "0x70066121", "Neigebronne (Naviguer)") - marinerLocations:AddSkill("Naviguer vers Umbar", "0x700687BB", "Umbar (Naviguer)"); - marinerLocations:AddSkill("Naviguer vers Lond Cirion", "0x700687BD", "Lond Cirion (Naviguer)"); - marinerLocations:AddSkill("Naviguer vers Jax Phanâl", "0x700687C0", "Jax Phanâl (Naviguer)"); - marinerLocations:AddSkill("Naviguer vers Dol Amroth", "0x700687C1", "Dol Amroth royal (Naviguer)", - "le Gondor royal"); - marinerLocations:AddSkill("Naviguer vers Halrax", "0x700687C3", "Halrax (Naviguer)"); + -- add the Mariner locations + self.mariner:AddSkill("Naviguer vers Celondim", "0x70066100", "Celondim (Naviguer)") + self.mariner:AddSkill("Naviguer vers les Terres brunes", "0x70066101", "Terres brunes (Naviguer)") + self.mariner:AddSkill("Naviguer vers le Quai des marchands", "0x70066105", "Quai des marchands (Naviguer)") + self.mariner:AddSkill("Naviguer vers Osgiliath après la bataille", "0x70066109", "Osgiliath après la bataille (Naviguer)") + self.mariner:AddSkill("Cap sur la Ville du Lac", "0x7006610C", "Ville du Lac (Naviguer)") + self.mariner:AddSkill("Naviguer vers l'Orée Noire", "0x7006610E", "Orée Noire (Naviguer)") + self.mariner:AddSkill("Naviguer vers Tinnudir", "0x7006610F", "Tinnudir (Naviguer)") + self.mariner:AddSkill("Naviguer vers Dol Amroth", "0x70066117", "Dol Amroth (Naviguer)", "Dol Amroth en bonne compagnie.") + self.mariner:AddSkill("Naviguer vers le Pays de Bouc", "0x7006611A", "Pays de Bouc (Naviguer)") + self.mariner:AddSkill("Naviguer vers Pelargir", "0x7006611B", "Pelargir (Naviguer)") + self.mariner:AddSkill("Naviguer vers Sûri-kylä", "0x7006611C", "Sûri-kylä (Naviguer)") + self.mariner:AddSkill("Naviguer vers la Lothlorien", "0x7006611E", "Lothlorien (Naviguer)") + self.mariner:AddSkill("Naviguer vers le Gué de Sarn", "0x70066120", "le Gué de Sarn (Naviguer)") + self.mariner:AddSkill("Naviguer vers Neigebronne", "0x70066121", "Neigebronne (Naviguer)") + self.mariner:AddSkill("Naviguer vers Umbar", "0x700687BB", "Umbar (Naviguer)"); + self.mariner:AddSkill("Naviguer vers Lond Cirion", "0x700687BD", "Lond Cirion (Naviguer)"); + self.mariner:AddSkill("Naviguer vers Jax Phanâl", "0x700687C0", "Jax Phanâl (Naviguer)"); + self.mariner:AddSkill("Naviguer vers Dol Amroth", "0x700687C1", "Dol Amroth royal (Naviguer)", "le Gondor royal"); + self.mariner:AddSkill("Naviguer vers Halrax", "0x700687C3", "Halrax (Naviguer)"); - racialLocations:AddSkill("Retour à Bree", "0x700062F6", "Bree (Race)", - "Permet de retourner"); - racialLocations:AddSkill("Retournez dans la Comté", "0x700062C8", "Comté (Race)"); - racialLocations:AddSkill("Retour : Porte de Thorin", "0x70006346", "Porte de Thorin (Race)", - "Ceci vous permet de retourner"); - racialLocations:AddSkill("Retour à Fondcombe", "0x7000631F", "Fondcombe (Race)", - "Ceci vous permet de retourner"); - racialLocations:AddSkill("Retour à la maison", "0x70041A22", "Maison Beorning (Race)"); - racialLocations:AddSkill("Voyage vers Caras Galadhon, en Lothlórien", "0x70048C8C", "Caras Galadhon (Race)"); - racialLocations:AddSkill("Aller au Palais de Thorin", "0x70053C0F", "Palais de Thorin (Race)"); - racialLocations:AddSkill("Retour à Lyndelby", "0x70066d31", "Lyndelby (Race)") -- river hobbit + -- add the racial travel skills + self.allRaces:AddSkill("Retour à Bree", "0x700062F6", "Bree (Race)", "Permet de retourner"); + self.allRaces:AddSkill("Retournez dans la Comté", "0x700062C8", "Comté (Race)"); + self.allRaces:AddSkill("Retour : Porte de Thorin", "0x70006346", "Porte de Thorin (Race)", "Ceci vous permet de retourner"); + self.allRaces:AddSkill("Retour à Fondcombe", "0x7000631F", "Fondcombe (Race)", "Ceci vous permet de retourner"); + self.allRaces:AddSkill("Retour à la maison", "0x70041A22", "Maison Beorning (Race)"); + self.allRaces:AddSkill("Voyage vers Caras Galadhon, en Lothlórien", "0x70048C8C", "Caras Galadhon (Race)"); + self.allRaces:AddSkill("Aller au Palais de Thorin", "0x70053C0F", "Palais de Thorin (Race)"); + self.allRaces:AddSkill("Retour à Lyndelby", "0x70066d31", "Lyndelby (Race)") -- river hobbit - genLocations:AddSkill("Retour à la maison", "0x700256BA", "Point de repère 1"); - genLocations:AddSkill("Retour à la maison 2", "0x70025792", "Point de repère 2"); - genLocations:AddSkill("Retour à la maison 3", "0x70025793", "Point de repère 3"); - genLocations:AddSkill("Retour à la maison 4", "0x70025794", "Point de repère 4"); - genLocations:AddSkill("Retour à la maison 5", "0x70025795", "Point de repère 5"); - genLocations:AddSkill("Retour à la maison 6", "0x70025796", "Point de repère 6"); - genLocations:AddSkill("Retour à la maison 7", "0x7002FF62", "Point de repère 7"); - genLocations:AddSkill("Retour à la maison 8", "0x7002FF61", "Point de repère 8"); - genLocations:AddSkill("Retour à la maison 9", "0x7002FF60", "Point de repère 9"); - genLocations:AddSkill("Retour à la maison 10", "0x7002FF5F", "Point de repère 10"); - genLocations:AddSkill("Retour à la maison 11", "0x7002FF63", "Point de repère 11"); - genLocations:AddSkill("Retour à la maison personnelle", "0x7000D046", "Maison personnelle"); - genLocations:AddSkill("Aller à une maison premium", "0x70046EE4", "Maison premium"); - genLocations:AddSkill("Retour à la maison de confrérie", "0x7000D047", "Maison de confrérie"); - genLocations:AddSkill("Retour à la maison d'un membre de confrérie", "0x70057C36", "Maison d'un membre de confrérie"); + -- add the Return Home and housing skills + self.gen:AddSkill("Retour à la maison", "0x700256BA", "Point de repère 1"); + self.gen:AddSkill("Retour à la maison 2", "0x70025792", "Point de repère 2"); + self.gen:AddSkill("Retour à la maison 3", "0x70025793", "Point de repère 3"); + self.gen:AddSkill("Retour à la maison 4", "0x70025794", "Point de repère 4"); + self.gen:AddSkill("Retour à la maison 5", "0x70025795", "Point de repère 5"); + self.gen:AddSkill("Retour à la maison 6", "0x70025796", "Point de repère 6"); + self.gen:AddSkill("Retour à la maison 7", "0x7002FF62", "Point de repère 7"); + self.gen:AddSkill("Retour à la maison 8", "0x7002FF61", "Point de repère 8"); + self.gen:AddSkill("Retour à la maison 9", "0x7002FF60", "Point de repère 9"); + self.gen:AddSkill("Retour à la maison 10", "0x7002FF5F", "Point de repère 10"); + self.gen:AddSkill("Retour à la maison 11", "0x7002FF63", "Point de repère 11"); + self.gen:AddSkill("Retour à la maison personnelle", "0x7000D046", "Maison personnelle"); + self.gen:AddSkill("Aller à une maison premium", "0x70046EE4", "Maison premium"); + self.gen:AddSkill("Retour à la maison de confrérie", "0x7000D047", "Maison de confrérie"); + self.gen:AddSkill("Retour à la maison d'un membre de confrérie", "0x70057C36", "Maison d'un membre de confrérie"); - repLocations:AddSkill("Retour : Porte de Thorin", "0x7001BF91", "Porte de Thorin (Rep/Shop)", - "Grâce à l'amitié qui vous"); - repLocations:AddSkill("Retour à Bree", "0x7001BF90", "Retour à Bree (Rep/Shop)", - "Grâce à votre amitié"); - repLocations:AddSkill("Retour au Marché de Lalia", "0x700364B1", "Retour au Marché de Lalia (Mithril)"); - repLocations:AddSkill("Retour à Grand'Cave", "0x70023262", "Retour à Grand'Cave (Shop)"); - repLocations:AddSkill("Retour à Fondcombe", "0x70023263", "Retour à Fondcombe (Shop)", - "Grâce à votre amitié avec"); - repLocations:AddSkill("Retournez à Ost Guruth", "0x70020441", "Retournez à Ost Guruth (Rep)"); - repLocations:AddSkill("Retour dans la Forêt Noire", "0x7001F374", "Retour dans la Forêt Noire (Rep)"); - repLocations:AddSkill("Retour en Enedwaith", "0x70021FA2", "Retour en Enedwaith (Rep)"); - repLocations:AddSkill("Retour à Galtrev", "0x7002C647", "Retour à Galtrev (Rep)"); - repLocations:AddSkill("Retour à Stangarde", "0x7002C65D", "Retour à Stangarde (Rep)"); - repLocations:AddSkill("Retourner à Neigebronne", "0x70031A46", "Retourner à Neigebronne (Rep)"); - repLocations:AddSkill("Retour à Forloi", "0x70036B5E", "Retour à Forloi (Rep)"); - repLocations:AddSkill("Retour à Aldburg", "0x7003DC81", "Aldburg (Rep)"); - repLocations:AddSkill("Retour à Derunant", "0x7004128F", "Derunant (Rep)"); - repLocations:AddSkill("Retour au Gouffre de Helm", "0x7003DC82", "Gouffre de Helm(Rep)"); - repLocations:AddSkill("Retour à Dol Amroth", "0x700411AC", "Dol Amroth (Rep)", - "l'Ouest du Gondor"); - repLocations:AddSkill("Retournez à Arnach", "0x70043A6A", "Arnach (Rep)"); - repLocations:AddSkill("Retour à Minas Tirith", "0x7004497E", "Retour à Minas Tirith (Rep)"); - repLocations:AddSkill("Retour au camp militaire", "0x700459A9", "Camp militaire (Rep)"); - repLocations:AddSkill("Retour à Minas Tirith après la bataille", "0x70046CC0", "Minas Tirith après la bataille (Rep)"); - repLocations:AddSkill("Retour à Henneth Annûn", "0x70047080", "Henneth Annûn (Rep)"); - repLocations:AddSkill("Retour à Osgiliath après la bataille", "0x7004707D", "Osgiliath après la bataille (Rep)"); - repLocations:AddSkill("Retour au Camp de l'armée", "0x70047BF4", "Camp de l'armée (Rep)"); - repLocations:AddSkill("Retour à Haerondir", "0x70047C1B", "Haerondir (Rep)"); - repLocations:AddSkill("Retour au fort d'Udûn", "0x7004AE1D", "Fort d'Udûn (Rep)"); - repLocations:AddSkill("Voyager jusqu'à la Cour de Lothlórien", "0x7004B8C2", "Cour de Lothlórien (Rep)"); - repLocations:AddSkill("Voyager jusqu'au Palais du roi", "0x7004B8C3", "Palais du roi (Rep)"); - repLocations:AddSkill("Voyager jusqu'au Palais sous la Montagne", "0x7004B8C4", "Palais sous la Montagne (Rep)"); - repLocations:AddSkill("Voyager jusqu'à Bâr Thorenion", "0x7004B8C5", "Bâr Thorenion (Rep)"); - repLocations:AddSkill("Revenir à Dale", "0x7004D738", "Dale (Rep)"); - repLocations:AddSkill("Revenir à Jarnfast", "0x7004FAC3", "Jarnfast (Rep)"); - repLocations:AddSkill("Revenir à Skarhald", "0x7004FAC5", "Skarhald (Rep)"); - repLocations:AddSkill("Retournez auprès de Beorninghus", "0x70052F12", "Beorninghus (Rep)"); - repLocations:AddSkill("Retournez auprès de Hultvis", "0x70052F04", "Hultvis (Rep)"); - repLocations:AddSkill("Retour à Estolad Lân", "0x700551F8", "Estolad Lân (Rep)"); - repLocations:AddSkill("Retour à Limlok", "0x70057629", "Limlok (Rep)"); - repLocations:AddSkill("Retournez à Annâk-khurfu", "0x7005856F", "Annâk-khurfu (Rep)"); - repLocations:AddSkill("Retournez au Quai des marchands", "0x70059D0E", "Quai des marchands (Rep)"); - repLocations:AddSkill("Retournez à Pont-à-Tréteaux", "0x70059D12", "Pont-à-Tréteaux (Rep)"); - repLocations:AddSkill("Retour à Akrâz-zahar", "0x7005AA90", "Akrâz-zahar (Rep)"); - repLocations:AddSkill("Retour à Azanulbizar", "0x7005AA92", "Azanulbizar (Rep)"); - repLocations:AddSkill("Voyage jusqu'à la Grande salle de Vérnozal", "0x7005A596", "Vérnozal (Quête)"); - repLocations:AddSkill("Retourner à la Porte Noble", "0x7005D47C", "Porte Noble (Rep)"); - repLocations:AddSkill("Retourner à Leitstath", "0x7005D484", "Leitstath (Rep)"); - repLocations:AddSkill("Retournez voir Tornhad", "0x70060EA8", "Tornhad (Rep)"); - repLocations:AddSkill("Retour à Bourdeneuve", "0x70061340", "Bourdeneuve (Rep)"); - repLocations:AddSkill("Retour à Andrath", "0x7006323D", "Andrath (Rep)"); - repLocations:AddSkill("Retour aux Noues des cygnes", "0x700634A4", "Noues des cygnes (Rep)"); - repLocations:AddSkill("Retour au Cardolan", "0x700634AE", "Cardolan (Rep)"); - repLocations:AddSkill("Retour aux Archives de gravures de Fondcombe", "0x700634A5", "Archives de gravures (Delving)"); - repLocations:AddSkill("Retour à Carn Dûm", "0x70064ACA", " Carn Dûm (Rep)"); - repLocations:AddSkill("Retournez voir Clegur", "0x70064F47", "Clegur (Rep)"); - repLocations:AddSkill("Retour à Glân Vraig", "0x7005B38E", "Glân Vraig (Quête)"); - repLocations:AddSkill("Retournez à Pelargir", "0x700658EB", "Pelargir (Rep)"); - repLocations:AddSkill("Voyager vers l'Ordre de l'Aigle", "0x700686FE", "L'Ordre de l'Aigle (Rep)"); - repLocations:AddSkill("Retour à Umbar", "0x700686FF", "Umbar (Rep)"); - repLocations:AddSkill("Retour à Dol Amroth", "0x70068700", "Dol Amroth royal (Rep U38)", - "le Gondor royal"); - repLocations:AddSkill("Retour à Jax Phanâl", "0x70068701", "Jax Phanâl (Rep)"); - repLocations:AddSkill("Retournez voir Halrax", "0x70068702", "Halrax (Rep)"); - repLocations:AddSkill("Retour à Lond Cirion", "0x70068703", "Lond Cirion (Rep)"); - repLocations:AddSkill("Voyager vers les Gardiens des écrits", "0x70068704", "Gardiens des écrits (Rep)"); - repLocations:AddSkill("Retour à la taverne de l'Aigle Sanglant", "0x700697F2", "Taverne de l'Aigle Sanglant (Rep)"); + -- add the obtainable travel skills + self.rep:AddSkill("Retour : Porte de Thorin", "0x7001BF91", "Porte de Thorin (Rep/Shop)", "Grâce à l'amitié qui vous"); + self.rep:AddSkill("Retour à Bree", "0x7001BF90", "Retour à Bree (Rep/Shop)", "Grâce à votre amitié"); + self.rep:AddSkill("Retour au Marché de Lalia", "0x700364B1", "Retour au Marché de Lalia (Mithril)"); + self.rep:AddSkill("Retour à Grand'Cave", "0x70023262", "Retour à Grand'Cave (Shop)"); + self.rep:AddSkill("Retour à Fondcombe", "0x70023263", "Retour à Fondcombe (Shop)", "Grâce à votre amitié avec"); + self.rep:AddSkill("Retournez à Ost Guruth", "0x70020441", "Retournez à Ost Guruth (Rep)"); + self.rep:AddSkill("Retour dans la Forêt Noire", "0x7001F374", "Retour dans la Forêt Noire (Rep)"); + self.rep:AddSkill("Retour en Enedwaith", "0x70021FA2", "Retour en Enedwaith (Rep)"); + self.rep:AddSkill("Retour à Galtrev", "0x7002C647", "Retour à Galtrev (Rep)"); + self.rep:AddSkill("Retour à Stangarde", "0x7002C65D", "Retour à Stangarde (Rep)"); + self.rep:AddSkill("Retourner à Neigebronne", "0x70031A46", "Retourner à Neigebronne (Rep)"); + self.rep:AddSkill("Retour à Forloi", "0x70036B5E", "Retour à Forloi (Rep)"); + self.rep:AddSkill("Retour à Aldburg", "0x7003DC81", "Aldburg (Rep)"); + self.rep:AddSkill("Retour à Derunant", "0x7004128F", "Derunant (Rep)"); + self.rep:AddSkill("Retour au Gouffre de Helm", "0x7003DC82", "Gouffre de Helm(Rep)"); + self.rep:AddSkill("Retour à Dol Amroth", "0x700411AC", "Dol Amroth (Rep)", "l'Ouest du Gondor"); + self.rep:AddSkill("Retournez à Arnach", "0x70043A6A", "Arnach (Rep)"); + self.rep:AddSkill("Retour à Minas Tirith", "0x7004497E", "Retour à Minas Tirith (Rep)"); + self.rep:AddSkill("Retour au camp militaire", "0x700459A9", "Camp militaire (Rep)"); + self.rep:AddSkill("Retour à Minas Tirith après la bataille", "0x70046CC0", "Minas Tirith après la bataille (Rep)"); + self.rep:AddSkill("Retour à Henneth Annûn", "0x70047080", "Henneth Annûn (Rep)"); + self.rep:AddSkill("Retour à Osgiliath après la bataille", "0x7004707D", "Osgiliath après la bataille (Rep)"); + self.rep:AddSkill("Retour au Camp de l'armée", "0x70047BF4", "Camp de l'armée (Rep)"); + self.rep:AddSkill("Retour à Haerondir", "0x70047C1B", "Haerondir (Rep)"); + self.rep:AddSkill("Retour au fort d'Udûn", "0x7004AE1D", "Fort d'Udûn (Rep)"); + self.rep:AddSkill("Voyager jusqu'à la Cour de Lothlórien", "0x7004B8C2", "Cour de Lothlórien (Rep)"); + self.rep:AddSkill("Voyager jusqu'au Palais du roi", "0x7004B8C3", "Palais du roi (Rep)"); + self.rep:AddSkill("Voyager jusqu'au Palais sous la Montagne", "0x7004B8C4", "Palais sous la Montagne (Rep)"); + self.rep:AddSkill("Voyager jusqu'à Bâr Thorenion", "0x7004B8C5", "Bâr Thorenion (Rep)"); + self.rep:AddSkill("Revenir à Dale", "0x7004D738", "Dale (Rep)"); + self.rep:AddSkill("Revenir à Jarnfast", "0x7004FAC3", "Jarnfast (Rep)"); + self.rep:AddSkill("Revenir à Skarhald", "0x7004FAC5", "Skarhald (Rep)"); + self.rep:AddSkill("Retournez auprès de Beorninghus", "0x70052F12", "Beorninghus (Rep)"); + self.rep:AddSkill("Retournez auprès de Hultvis", "0x70052F04", "Hultvis (Rep)"); + self.rep:AddSkill("Retour à Estolad Lân", "0x700551F8", "Estolad Lân (Rep)"); + self.rep:AddSkill("Retour à Limlok", "0x70057629", "Limlok (Rep)"); + self.rep:AddSkill("Retournez à Annâk-khurfu", "0x7005856F", "Annâk-khurfu (Rep)"); + self.rep:AddSkill("Retournez au Quai des marchands", "0x70059D0E", "Quai des marchands (Rep)"); + self.rep:AddSkill("Retournez à Pont-à-Tréteaux", "0x70059D12", "Pont-à-Tréteaux (Rep)"); + self.rep:AddSkill("Retour à Akrâz-zahar", "0x7005AA90", "Akrâz-zahar (Rep)"); + self.rep:AddSkill("Retour à Azanulbizar", "0x7005AA92", "Azanulbizar (Rep)"); + self.rep:AddSkill("Voyage jusqu'à la Grande salle de Vérnozal", "0x7005A596", "Vérnozal (Quête)"); + self.rep:AddSkill("Retourner à la Porte Noble", "0x7005D47C", "Porte Noble (Rep)"); + self.rep:AddSkill("Retourner à Leitstath", "0x7005D484", "Leitstath (Rep)"); + self.rep:AddSkill("Retournez voir Tornhad", "0x70060EA8", "Tornhad (Rep)"); + self.rep:AddSkill("Retour à Bourdeneuve", "0x70061340", "Bourdeneuve (Rep)"); + self.rep:AddSkill("Retour à Andrath", "0x7006323D", "Andrath (Rep)"); + self.rep:AddSkill("Retour aux Noues des cygnes", "0x700634A4", "Noues des cygnes (Rep)"); + self.rep:AddSkill("Retour au Cardolan", "0x700634AE", "Cardolan (Rep)"); + self.rep:AddSkill("Retour aux Archives de gravures de Fondcombe", "0x700634A5", "Archives de gravures (Delving)"); + self.rep:AddSkill("Retour à Carn Dûm", "0x70064ACA", " Carn Dûm (Rep)"); + self.rep:AddSkill("Retournez voir Clegur", "0x70064F47", "Clegur (Rep)"); + self.rep:AddSkill("Retour à Glân Vraig", "0x7005B38E", "Glân Vraig (Quête)"); + self.rep:AddSkill("Retournez à Pelargir", "0x700658EB", "Pelargir (Rep)"); + self.rep:AddSkill("Voyager vers l'Ordre de l'Aigle", "0x700686FE", "L'Ordre de l'Aigle (Rep)"); + self.rep:AddSkill("Retour à Umbar", "0x700686FF", "Umbar (Rep)"); + self.rep:AddSkill("Retour à Dol Amroth", "0x70068700", "Dol Amroth royal (Rep U38)", "le Gondor royal"); + self.rep:AddSkill("Retour à Jax Phanâl", "0x70068701", "Jax Phanâl (Rep)"); + self.rep:AddSkill("Retournez voir Halrax", "0x70068702", "Halrax (Rep)"); + self.rep:AddSkill("Retour à Lond Cirion", "0x70068703", "Lond Cirion (Rep)"); + self.rep:AddSkill("Voyager vers les Gardiens des écrits", "0x70068704", "Gardiens des écrits (Rep)"); + self.rep:AddSkill("Retour à la taverne de l'Aigle Sanglant", "0x700697F2", "Taverne de l'Aigle Sanglant (Rep)"); -- monster player maps - creepLocations:AddSkill("Carte grossière pour aller au Pied de Gram", "0x70028BBC"); - creepLocations:AddSkill("Carte pour aller au Pied de Gram", "0x70028BC1"); - - creepLocations:AddSkill("Carte grossière pour aller au Gouffre d'Isen", "0x70028BB3"); - creepLocations:AddSkill("Carte grossière pour aller à Tol Ascarnen", "0x70028BB6"); - creepLocations:AddSkill("Carte grossière pour aller à Lugazag", "0x70028BB7"); - creepLocations:AddSkill("Carte grossière pour aller à Tirith Rhaw", "0x70028BBE"); - creepLocations:AddSkill("Carte grossière pour aller au Bois Funeste", "0x70028BBF"); - - creepLocations:AddSkill("Piètre carte pour aller au Gouffre d'Isen", "0x70028BAF"); - creepLocations:AddSkill("Piètre carte pour aller à Tol Ascarnen", "0x70028BB1"); - creepLocations:AddSkill("Piètre carte pour aller à Lugazag", "0x70028BB2"); - creepLocations:AddSkill("Piètre carte pour aller à Tirith Rhaw", "0x70028BB4"); - creepLocations:AddSkill("Piètre carte pour aller au Bois Funeste", "0x70028BB9"); - - creepLocations:AddSkill("Bonne carte pour aller au Gouffre d'Isen", "0x70028BC0"); - creepLocations:AddSkill("Bonne carte pour aller à Tol Ascarnen", "0x70028BC2"); - creepLocations:AddSkill("Bonne carte pour aller à Lugazag", "0x70028BB5"); - creepLocations:AddSkill("Bonne carte pour aller à Tirith Rhaw", "0x70028BB0"); - creepLocations:AddSkill("Bonne carte pour aller au Bois Funeste", "0x70028BBD"); - + self.creep:AddSkill("Carte grossière pour aller au Pied de Gram", "0x70028BBC"); + self.creep:AddSkill("Carte pour aller au Pied de Gram", "0x70028BC1"); + self.creep:AddSkill("Carte grossière pour aller au Gouffre d'Isen", "0x70028BB3"); + self.creep:AddSkill("Carte grossière pour aller à Tol Ascarnen", "0x70028BB6"); + self.creep:AddSkill("Carte grossière pour aller à Lugazag", "0x70028BB7"); + self.creep:AddSkill("Carte grossière pour aller à Tirith Rhaw", "0x70028BBE"); + self.creep:AddSkill("Carte grossière pour aller au Bois Funeste", "0x70028BBF"); + self.creep:AddSkill("Piètre carte pour aller au Gouffre d'Isen", "0x70028BAF"); + self.creep:AddSkill("Piètre carte pour aller à Tol Ascarnen", "0x70028BB1"); + self.creep:AddSkill("Piètre carte pour aller à Lugazag", "0x70028BB2"); + self.creep:AddSkill("Piètre carte pour aller à Tirith Rhaw", "0x70028BB4"); + self.creep:AddSkill("Piètre carte pour aller au Bois Funeste", "0x70028BB9"); + self.creep:AddSkill("Bonne carte pour aller au Gouffre d'Isen", "0x70028BC0"); + self.creep:AddSkill("Bonne carte pour aller à Tol Ascarnen", "0x70028BC2"); + self.creep:AddSkill("Bonne carte pour aller à Lugazag", "0x70028BB5"); + self.creep:AddSkill("Bonne carte pour aller à Tirith Rhaw", "0x70028BB0"); + self.creep:AddSkill("Bonne carte pour aller au Bois Funeste", "0x70028BBD"); end diff --git a/src/Main.lua b/src/Main.lua index eb6f1e7..c784587 100644 --- a/src/Main.lua +++ b/src/Main.lua @@ -1,11 +1,66 @@ import "TravelWindowII.src"; +-- create shortcuts to the bitop functions +bit = TravelWindowII.bit; +hasbit = TravelWindowII.hasbit; +setbit = TravelWindowII.setbit; +clearbit = TravelWindowII.clearbit; +togglebit = TravelWindowII.togglebit; + +DefAlpha = 0.92; +Settings = {}; +AccountSettingsStrings = {}; +TravelShortcuts = {}; -- put all the shortcuts into one table +TrainedSkills = Turbine.Gameplay.SkillList; + +-- get the player class and race +player = Turbine.Gameplay.LocalPlayer.GetInstance(); +PlayerClass = player:GetClass(); +PlayerAlignment = player:GetAlignment(); +PlayerRace = player:GetRace(); +-- set the racial index used later in multiple places +SetPlayerRaceKey(); +-- get the list of trained skills the player has +if (Turbine.Gameplay.LocalPlayer.GetTrainedSkills ~= nil) then + TrainedSkills = player:GetTrainedSkills(); +end + +-- create the lists of travel locations and the shortcuts +-- that are used to execute them +TravelInfo = TravelDictionary(); + +-- load the player saved settings +LoadSettings(); + +-- set up all the shortcuts +InitShortcuts(); + +CreateOptionsWindow(); + +-- create the external toggle button +ToggleButton = TravelWindowII.src.TravelButton(); + -- create the travel window -_G.travel = TravelWindow(); +_G.travel = TravelWindow(Settings.useMinWindow); + +NewShortcutEvent = function() + _G.travel.dirty = true; -- reset list of shortcuts + _G.travel:SetItems(); -- redraw current window +end + +MapWindow:VerifyMapSkillIds("Hunter"); +MapWindow:VerifyMapSkillIds("Warden"); +MapWindow:VerifyMapSkillIds("Mariner"); +MapWindow:VerifyMapSkillIds("Reputation"); + +Plugins["Travel Window II"].Load = function(sender, args) + Turbine.Shell.WriteLine("Travel Window II " .. Plugins["Travel Window II"]:GetVersion() .. + " by Hyoss"); +end -- handle unload event and save settings plugin.Unload = function() - _G.travel:SaveSettings(); + SaveSettings(); end -- create a new command line command for the travel window @@ -14,12 +69,14 @@ TravelCommand = Turbine.ShellCommand(); -- handle the travel commands function TravelCommand:Execute(command, arguments) if (arguments == "show") then - _G.travel:CheckSkills(false); + CheckSkills(false); _G.travel:SetVisible(true); + _G.travel:Activate(); elseif (arguments == "hide") then _G.travel:SetVisible(false); elseif (arguments == "toggle") then _G.travel:SetVisible(not _G.travel:IsVisible()); + _G.travel:Activate(); elseif (arguments == "dump") then _G.travel:DoDump(); elseif (arguments == "scan") then diff --git a/src/MapWindow.lua b/src/MapWindow.lua index 8c63d8c..32b91b6 100644 --- a/src/MapWindow.lua +++ b/src/MapWindow.lua @@ -18,17 +18,14 @@ MapType = { HARADWAITH = 7, }; -function MapWindow:Constructor(parent, map, class, race) +function MapWindow:Constructor(map) Turbine.UI.Window.Constructor(self); -- add a check to see if we load completely self.loaded = false; - self.mainWindow = parent; self.mapType = map; - self.PlayerClass = class; - self.PlayerRaceKey = race; -- mapped as racialMap index - self.debug = false; + self.debug = false; -- enable to position shortcuts on the map -- set size of window self.width = 1024; @@ -102,9 +99,7 @@ function MapWindow:Constructor(parent, map, class, race) local name = self:DebugNameLookup(shortcut:GetData()); coordinates[i] = {name, self.quickslots[i]:GetPosition()} end - pcall(function() - PatchDataSave(Turbine.DataScope.Character, "TravelWindowIIDebugCoords", coordinates); - end); + PatchDataSave(Turbine.DataScope.Character, "TravelWindowIIDebugCoords", coordinates); end end @@ -164,11 +159,13 @@ function MapWindow:AddLocations(name) local sType = Turbine.UI.Lotro.ShortcutType.Skill; local map = self:GetLocations(name); for i = 1, #map do - local id = map[i][1]; -- @TODO should handle map being nil better - for r = 1, #map[i][2] do -- @TODO should handle map being nil better - local item = map[i][2][r]; -- @TODO should handle map being nil better - if self.mapType == item[1] and self:IsShortcutEnabled(id) then - self:AddSingleShortcut(item, Turbine.UI.Lotro.Shortcut(sType, id)); + if #map[i] == 2 then + local id = map[i][1]; + for r = 1, #map[i][2] do + local item = map[i][2][r]; + if item ~= nil and #item == 3 and self.mapType == item[1] then + self:AddSingleShortcut(item, Turbine.UI.Lotro.Shortcut(sType, id)); + end end end end @@ -176,11 +173,11 @@ end function MapWindow:AddClassLocations() local name = ""; - if self.PlayerClass == Turbine.Gameplay.Class.Hunter then + if PlayerClass == Turbine.Gameplay.Class.Hunter then name = "Hunter"; - elseif self.PlayerClass == Turbine.Gameplay.Class.Warden then + elseif PlayerClass == Turbine.Gameplay.Class.Warden then name = "Warden"; - elseif self.PlayerClass == Turbine.Gameplay.Class.Mariner then + elseif PlayerClass == Turbine.Gameplay.Class.Mariner then name = "Mariner"; else -- nothing to add for other classes @@ -439,11 +436,11 @@ function MapWindow:AddRacialLocation() {"0x70066D31", {MapType.RHOVANION, 155, 165}}, -- Lyndelby }; - if #racialMap > self.PlayerRaceKey then - if #racialMap ~= racialLocations:GetCount() then - Turbine.Shell.WriteLine("Error: Missing other Racial locations " .. (racialLocations:GetCount() - #racialMap)); + if #racialMap > PlayerRaceKey then + if #racialMap ~= TravelInfo.allRaces:GetCount() then + Turbine.Shell.WriteLine("Error: Missing other Racial locations " .. (TravelInfo.allRaces:GetCount() - #racialMap)); end - local item = racialMap[self.PlayerRaceKey]; + local item = racialMap[PlayerRaceKey]; if self.mapType == item[2][1] then local id = item[1] if self:IsShortcutTrained(id) then @@ -453,7 +450,7 @@ function MapWindow:AddRacialLocation() end end else - Turbine.Shell.WriteLine("Error: Missing Racial locations " .. (racialLocations:GetCount() - #racialMap)); + Turbine.Shell.WriteLine("Error: Missing Racial locations " .. (TravelInfo.allRaces:GetCount() - #racialMap)); end end @@ -462,17 +459,6 @@ function MapWindow:AddGlanVraigMap() -- Moors Map {MapType.ERIADOR, 865, 245} -- Ettenmoors }; - - if self.mapType == moorsMap[1][1] then - for i = 1, #TravelShortcuts, 1 do - if TravelShortcuts[i]:GetName() == glanMapString then - if self:IsShortcutEnabled(TravelShortcuts[i]:GetData()) then - self:AddSingleShortcut(moorsMap[1], TravelShortcuts[i]); - break - end - end - end - end end function MapWindow:AddCreepShortcuts() @@ -518,7 +504,7 @@ function MapWindow:AddSingleShortcut(location, shortcut) self.quickslots[index]:SetSize(32, 32); self.quickslots[index]:SetPosition(location[2], location[3]); self.quickslots[index]:SetZOrder(98); - self.quickslots[index]:SetVisible(true); + self.quickslots[index]:SetVisible(self:IsShortcutEnabled(shortcut:GetData())); self.quickslots[index].MouseClick = function(sender, args) self:SetVisible(false); @@ -535,12 +521,19 @@ function MapWindow:AddSingleShortcut(location, shortcut) end end +function MapWindow:UpdateShortcut(id, enable) + for i = 1, #self.quickslots do + if self.quickslots[i]:GetShortcut():GetData() == id then + self.quickslots[i]:SetVisible(enable); + end + end +end + function MapWindow:IsShortcutEnabled(id) for i = 1, #TravelShortcuts, 1 do local shortcut = TravelShortcuts[i] if shortcut:GetData() == id then - -- must be user enabled return shortcut:IsEnabled() end end @@ -553,8 +546,7 @@ function MapWindow:IsShortcutTrained(id) for i = 1, #TravelShortcuts, 1 do local shortcut = TravelShortcuts[i] if shortcut:GetData() == id then - if shortcut:IsEnabled() and shortcut.found then - -- must be user enabled and trained + if shortcut.found then return true; end return false; @@ -578,13 +570,13 @@ end function MapWindow:VerifyMapSkillIds(name) local skills; if name == "Hunter" then - skills = hunterLocations; + skills = TravelInfo.hunter; elseif name == "Warden" then - skills = wardenLocations; + skills = TravelInfo.warden; elseif name == "Mariner" then - skills = marinerLocations; + skills = TravelInfo.mariner; elseif name == "Reputation" then - skills = repLocations; + skills = TravelInfo.rep; else return; -- invalid option end diff --git a/src/OptionsPanel.lua b/src/OptionsPanel.lua index 9b064ab..64fe541 100644 --- a/src/OptionsPanel.lua +++ b/src/OptionsPanel.lua @@ -8,11 +8,12 @@ import "TravelWindowII.src.utils.BitOps"; OptionsPanel = class(Turbine.UI.Control); -function OptionsPanel:Constructor(parent) +function OptionsPanel:Constructor() Turbine.UI.Control.Constructor(self); -- add a check to see if we load completely self.loaded = false; + self.disableUpdates = false; -- set size of window self.width = 800; @@ -22,10 +23,11 @@ function OptionsPanel:Constructor(parent) self.height = self.windowHeight - 20; end + self.overlapGroup = {}; + -- create array of labels and check boxes self.labels = {}; self.checks = {}; - self.mainWindow = parent; -- keep track of which item is selected on the sort tab self.sortSelectedIndex = 1; @@ -62,6 +64,8 @@ function OptionsPanel:Constructor(parent) self.scrollBar:SetHeight(self.ListBox:GetHeight()) self.ListBox:SetVerticalScrollBar(self.scrollBar) + self:SetupOverlapLinks(); + -- populate each tab self:AddGeneralItems(); self:AddBoxes(); @@ -81,15 +85,6 @@ function OptionsPanel:Constructor(parent) self:SetVisible(true); - -- have the main window close the options - self.VisibleChanged = function(sender, args) - if (self:IsVisible() == false) then - if (parent ~= nil) then - parent:CloseOptions(); - end - end - end - self.loaded = true; end @@ -99,10 +94,35 @@ end -- function to add items to the general tab function OptionsPanel:AddGeneralItems() + local optionHeight = 0; + local NextY = function(offset) + optionHeight = optionHeight + offset; + return optionHeight; + end + + local labelWidth = 420; + + -- label for hide window on start option + self.UseMinWindowLabel = Turbine.UI.Label(); + self.UseMinWindowLabel:SetSize(labelWidth, 20); + self.UseMinWindowLabel:SetPosition(20, NextY(20)); + self.UseMinWindowLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); + self.UseMinWindowLabel:SetParent(self.GeneralTab); + self.UseMinWindowLabel:SetText(minWindowString); + self.UseMinWindowLabel:SetVisible(true); + + -- checkbox for hide window on start option + self.UseMinWindowCheck = Turbine.UI.Lotro.CheckBox(); + self.UseMinWindowCheck:SetSize(19, 19); + self.UseMinWindowCheck:SetPosition(450, NextY(0)); + self.UseMinWindowCheck:SetChecked(Settings.useMinWindow == 1); + self.UseMinWindowCheck:SetParent(self.GeneralTab); + self.UseMinWindowCheck:SetVisible(true); + -- label for hide window on start option self.HideOnStartLabel = Turbine.UI.Label(); - self.HideOnStartLabel:SetSize(300, 20); - self.HideOnStartLabel:SetPosition(20, 20); + self.HideOnStartLabel:SetSize(labelWidth, 20); + self.HideOnStartLabel:SetPosition(20, NextY(30)); self.HideOnStartLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.HideOnStartLabel:SetParent(self.GeneralTab); self.HideOnStartLabel:SetText(hideString); @@ -111,15 +131,15 @@ function OptionsPanel:AddGeneralItems() -- checkbox for hide window on start option self.HideOnStartCheck = Turbine.UI.Lotro.CheckBox(); self.HideOnStartCheck:SetSize(19, 19); - self.HideOnStartCheck:SetPosition(450, 20); + self.HideOnStartCheck:SetPosition(450, NextY(0)); self.HideOnStartCheck:SetChecked(Settings.hideOnStart == 1); self.HideOnStartCheck:SetParent(self.GeneralTab); self.HideOnStartCheck:SetVisible(true); -- label for hide on combat option self.HideOnCombatLabel = Turbine.UI.Label(); - self.HideOnCombatLabel:SetSize(300, 20); - self.HideOnCombatLabel:SetPosition(20, 50); + self.HideOnCombatLabel:SetSize(labelWidth, 20); + self.HideOnCombatLabel:SetPosition(20, NextY(30)); self.HideOnCombatLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.HideOnCombatLabel:SetParent(self.GeneralTab); self.HideOnCombatLabel:SetText(hideOnCombatString); @@ -128,15 +148,15 @@ function OptionsPanel:AddGeneralItems() -- checkbox for hide on combat option self.HideOnCombatCheck = Turbine.UI.Lotro.CheckBox(); self.HideOnCombatCheck:SetSize(19, 19); - self.HideOnCombatCheck:SetPosition(450, 50); + self.HideOnCombatCheck:SetPosition(450, NextY(0)); self.HideOnCombatCheck:SetChecked(Settings.hideOnCombat == 1); self.HideOnCombatCheck:SetParent(self.GeneralTab); self.HideOnCombatCheck:SetVisible(true); -- label for option to close window on travel skill use self.hideOnTravelLabel = Turbine.UI.Label(); - self.hideOnTravelLabel:SetSize(300, 20); - self.hideOnTravelLabel:SetPosition(20, 80); + self.hideOnTravelLabel:SetSize(labelWidth, 20); + self.hideOnTravelLabel:SetPosition(20, NextY(30)); self.hideOnTravelLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.hideOnTravelLabel:SetParent(self.GeneralTab); self.hideOnTravelLabel:SetText(hideOnTravelString); @@ -145,15 +165,32 @@ function OptionsPanel:AddGeneralItems() -- checkbox for option to close window on travel skill use self.hideOnTravelCheck = Turbine.UI.Lotro.CheckBox(); self.hideOnTravelCheck:SetSize(19, 19); - self.hideOnTravelCheck:SetPosition(450, 80); + self.hideOnTravelCheck:SetPosition(450, NextY(0)); self.hideOnTravelCheck:SetChecked(Settings.hideOnTravel == 1); self.hideOnTravelCheck:SetParent(self.GeneralTab); self.hideOnTravelCheck:SetVisible(true); + -- label for ignore escape to close option + self.ignoreEscLabel = Turbine.UI.Label(); + self.ignoreEscLabel:SetSize(labelWidth, 20); + self.ignoreEscLabel:SetPosition(20, NextY(30)); + self.ignoreEscLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); + self.ignoreEscLabel:SetParent(self.GeneralTab); + self.ignoreEscLabel:SetText(ignoreEscString); + self.ignoreEscLabel:SetVisible(true); + + -- checkbox for ignore escape to close option + self.ignoreEscCheck = Turbine.UI.Lotro.CheckBox(); + self.ignoreEscCheck:SetSize(19, 19); + self.ignoreEscCheck:SetPosition(450, NextY(0)); + self.ignoreEscCheck:SetChecked(Settings.ignoreEsc == 1); + self.ignoreEscCheck:SetParent(self.GeneralTab); + self.ignoreEscCheck:SetVisible(true); + -- label for show toggle button option self.ShowButtonLabel = Turbine.UI.Label(); - self.ShowButtonLabel:SetSize(300, 20); - self.ShowButtonLabel:SetPosition(20, 110); + self.ShowButtonLabel:SetSize(labelWidth, 20); + self.ShowButtonLabel:SetPosition(20, NextY(30)); self.ShowButtonLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.ShowButtonLabel:SetParent(self.GeneralTab); self.ShowButtonLabel:SetText(toggleString); @@ -162,15 +199,15 @@ function OptionsPanel:AddGeneralItems() -- checkbox for show toggle button option self.ShowButtonCheck = Turbine.UI.Lotro.CheckBox(); self.ShowButtonCheck:SetSize(19, 19); - self.ShowButtonCheck:SetPosition(450, 110); + self.ShowButtonCheck:SetPosition(450, NextY(0)); self.ShowButtonCheck:SetChecked(Settings.showButton == 1); self.ShowButtonCheck:SetParent(self.GeneralTab); self.ShowButtonCheck:SetVisible(true); -- label for option to fire skill on pulldown selection self.PulldownTravelLabel = Turbine.UI.Label(); - self.PulldownTravelLabel:SetSize(300, 20); - self.PulldownTravelLabel:SetPosition(20, 140); + self.PulldownTravelLabel:SetSize(labelWidth, 20); + self.PulldownTravelLabel:SetPosition(20, NextY(30)); self.PulldownTravelLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.PulldownTravelLabel:SetParent(self.GeneralTab); self.PulldownTravelLabel:SetText(pulldownTravelString); @@ -179,15 +216,15 @@ function OptionsPanel:AddGeneralItems() -- checkbox for option to fire skill on pulldown selection self.PulldownTravelCheck = Turbine.UI.Lotro.CheckBox(); self.PulldownTravelCheck:SetSize(19, 19); - self.PulldownTravelCheck:SetPosition(450, 140); + self.PulldownTravelCheck:SetPosition(450, NextY(0)); self.PulldownTravelCheck:SetChecked(Settings.pulldownTravel == 1); self.PulldownTravelCheck:SetParent(self.GeneralTab); self.PulldownTravelCheck:SetVisible(true); -- label for toggle button sliders self.toggleSlidersLabel = Turbine.UI.Label(); - self.toggleSlidersLabel:SetSize(300, 20); - self.toggleSlidersLabel:SetPosition(20, 170); + self.toggleSlidersLabel:SetSize(labelWidth, 20); + self.toggleSlidersLabel:SetPosition(20, NextY(30)); self.toggleSlidersLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.toggleSlidersLabel:SetParent(self.GeneralTab); self.toggleSlidersLabel:SetText(toggleSlidersString); @@ -196,7 +233,7 @@ function OptionsPanel:AddGeneralItems() -- toggle button min slider label self.toggleMinSlidersLabel = Turbine.UI.Label(); self.toggleMinSlidersLabel:SetSize(50, 20); - self.toggleMinSlidersLabel:SetPosition(20, 190); + self.toggleMinSlidersLabel:SetPosition(20, NextY(20)); self.toggleMinSlidersLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.toggleMinSlidersLabel:SetParent(self.GeneralTab); self.toggleMinSlidersLabel:SetText(minString); @@ -206,7 +243,7 @@ function OptionsPanel:AddGeneralItems() self.toggleMinScrollBar = Turbine.UI.Lotro.ScrollBar(); self.toggleMinScrollBar:SetOrientation(Turbine.UI.Orientation.Horizontal); self.toggleMinScrollBar:SetSize(400, 10); - self.toggleMinScrollBar:SetPosition(70, 195); + self.toggleMinScrollBar:SetPosition(70, NextY(5)); self.toggleMinScrollBar:SetMinimum(0); self.toggleMinScrollBar:SetMaximum(100); self.toggleMinScrollBar:SetValue(Settings.toggleMinOpacity * 100); @@ -215,7 +252,7 @@ function OptionsPanel:AddGeneralItems() -- toggle button max slider self.toggleMaxSlidersLabel = Turbine.UI.Label(); self.toggleMaxSlidersLabel:SetSize(50, 20); - self.toggleMaxSlidersLabel:SetPosition(20, 210); + self.toggleMaxSlidersLabel:SetPosition(20, NextY(15)); self.toggleMaxSlidersLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.toggleMaxSlidersLabel:SetParent(self.GeneralTab); self.toggleMaxSlidersLabel:SetText(maxString); @@ -225,7 +262,7 @@ function OptionsPanel:AddGeneralItems() self.toggleMaxScrollBar = Turbine.UI.Lotro.ScrollBar(); self.toggleMaxScrollBar:SetOrientation(Turbine.UI.Orientation.Horizontal); self.toggleMaxScrollBar:SetSize(400, 10); - self.toggleMaxScrollBar:SetPosition(70, 215); + self.toggleMaxScrollBar:SetPosition(70, NextY(5)); self.toggleMaxScrollBar:SetMinimum(0); self.toggleMaxScrollBar:SetMaximum(100); self.toggleMaxScrollBar:SetValue(Settings.toggleMaxOpacity * 100); @@ -233,8 +270,8 @@ function OptionsPanel:AddGeneralItems() -- label for main window sliders self.SlidersLabel = Turbine.UI.Label(); - self.SlidersLabel:SetSize(300, 20); - self.SlidersLabel:SetPosition(20, 240); + self.SlidersLabel:SetSize(labelWidth, 20); + self.SlidersLabel:SetPosition(20, NextY(25)); self.SlidersLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.SlidersLabel:SetParent(self.GeneralTab); self.SlidersLabel:SetText(mainSlidersString); @@ -243,52 +280,107 @@ function OptionsPanel:AddGeneralItems() -- main window min slider label self.mainMinSlidersLabel = Turbine.UI.Label(); self.mainMinSlidersLabel:SetSize(50, 20); - self.mainMinSlidersLabel:SetPosition(20, 260); + self.mainMinSlidersLabel:SetPosition(20, NextY(20)); self.mainMinSlidersLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.mainMinSlidersLabel:SetParent(self.GeneralTab); self.mainMinSlidersLabel:SetText(minString); self.mainMinSlidersLabel:SetVisible(true); - -- toggle button min slider + -- main window min slider self.mainMinScrollBar = Turbine.UI.Lotro.ScrollBar(); self.mainMinScrollBar:SetOrientation(Turbine.UI.Orientation.Horizontal); self.mainMinScrollBar:SetSize(400, 10); - self.mainMinScrollBar:SetPosition(70, 265); + self.mainMinScrollBar:SetPosition(70, NextY(5)); self.mainMinScrollBar:SetMinimum(0); self.mainMinScrollBar:SetMaximum(100); self.mainMinScrollBar:SetValue(Settings.mainMinOpacity * 100); self.mainMinScrollBar:SetParent(self.GeneralTab); - -- toggle button max slider + -- main window max slider label self.mainMaxSlidersLabel = Turbine.UI.Label(); self.mainMaxSlidersLabel:SetSize(50, 20); - self.mainMaxSlidersLabel:SetPosition(20, 280); + self.mainMaxSlidersLabel:SetPosition(20, NextY(15)); self.mainMaxSlidersLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); self.mainMaxSlidersLabel:SetParent(self.GeneralTab); self.mainMaxSlidersLabel:SetText(maxString); self.mainMaxSlidersLabel:SetVisible(true); - -- toggle button max slider + -- main window max slider self.mainMaxScrollBar = Turbine.UI.Lotro.ScrollBar(); self.mainMaxScrollBar:SetOrientation(Turbine.UI.Orientation.Horizontal); self.mainMaxScrollBar:SetSize(400, 10); - self.mainMaxScrollBar:SetPosition(70, 285); + self.mainMaxScrollBar:SetPosition(70, NextY(5)); self.mainMaxScrollBar:SetMinimum(0); self.mainMaxScrollBar:SetMaximum(100); self.mainMaxScrollBar:SetValue(Settings.mainMaxOpacity * 100); self.mainMaxScrollBar:SetParent(self.GeneralTab); + -- fade out slider label + self.mainFadeSlidersLabel = Turbine.UI.Label(); + self.mainFadeSlidersLabel:SetSize(labelWidth, 20); + self.mainFadeSlidersLabel:SetPosition(20, NextY(25)); + self.mainFadeSlidersLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); + self.mainFadeSlidersLabel:SetParent(self.GeneralTab); + self.mainFadeSlidersLabel:SetText(fadeWindowString); + self.mainFadeSlidersLabel:SetVisible(true); + + -- fade out slider + self.mainFadeScrollBar = Turbine.UI.Lotro.ScrollBar(); + self.mainFadeScrollBar:SetOrientation(Turbine.UI.Orientation.Horizontal); + self.mainFadeScrollBar:SetSize(450, 10); + self.mainFadeScrollBar:SetPosition(20, NextY(25)); + self.mainFadeScrollBar:SetMinimum(1); + self.mainFadeScrollBar:SetMaximum(151); + self.mainFadeScrollBar:SetValue(Settings.fadeOutSteps); + self.mainFadeScrollBar:SetParent(self.GeneralTab); + -- reset all setting button self.resetButton = Turbine.UI.Lotro.Button(); - self.resetButton:SetSize(200, 20); - self.resetButton:SetPosition(150, 690); + self.resetButton:SetSize(220, 20); + self.resetButton:SetPosition(20, 690); self.resetButton:SetText(resetSettingsString); self.resetButton:SetParent(self.GeneralTab); self.resetButton:SetVisible(true); + self.saveGlobal = Turbine.UI.Lotro.Button(); + self.saveGlobal:SetSize(220, 20); + self.saveGlobal:SetPosition(250, 690); + self.saveGlobal:SetText(saveGlobalDefaultsString); + self.saveGlobal:SetParent(self.GeneralTab); + self.saveGlobal:SetVisible(true); + + self.loadGlobal = Turbine.UI.Lotro.Button(); + self.loadGlobal:SetSize(220, 20); + self.loadGlobal:SetPosition(480, 690); + self.loadGlobal:SetText(loadGlobalDefaultsString); + self.loadGlobal:SetParent(self.GeneralTab); + self.loadGlobal:SetVisible(true); + + self:UpdateSettings(); + -- do the settings reset self.resetButton.Click = function(sender, args) - self.mainWindow:ResetSettings(); + _G.travel:ResetSettings(); + end + + self.saveGlobal.Click = function(sender, args) + SaveSettings(Turbine.DataScope.Account); + end + + self.loadGlobal.Click = function(sender, args) + SetSettings(AccountSettingsStrings); + SyncUIFromSettings(); + end + + self.UseMinWindowCheck.CheckedChanged = function(sender, args) + if (sender:IsChecked()) then + Settings.useMinWindow = 1; + else + Settings.useMinWindow = 0; + end + _G.travel:Close(); + _G.travel = nil; + _G.travel = TravelWindow(Settings.useMinWindow); end -- set the hide on start option when changed @@ -298,7 +390,7 @@ function OptionsPanel:AddGeneralItems() else Settings.hideOnStart = 0; end - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); end -- set the hide on combat option when changed @@ -308,7 +400,7 @@ function OptionsPanel:AddGeneralItems() else Settings.hideOnCombat = 0; end - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); end -- set the close on travel option when changed @@ -318,7 +410,17 @@ function OptionsPanel:AddGeneralItems() else Settings.hideOnTravel = 0; end - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); + end + + -- set the ignore escape to close option when changed + self.ignoreEscCheck.CheckedChanged = function(sender, args) + if (sender:IsChecked()) then + Settings.ignoreEsc = 1; + else + Settings.ignoreEsc = 0; + end + _G.travel:UpdateSettings(); end -- set the show toggle button option when changed @@ -328,8 +430,8 @@ function OptionsPanel:AddGeneralItems() else Settings.showButton = 0; end - self.mainWindow:UpdateSettings(); - self.mainWindow.ToggleButton:SetVisible(sender:IsChecked()); + _G.travel:UpdateSettings(); + ToggleButton:SetVisible(sender:IsChecked()); end -- set the fire on pulldown selection option when changed @@ -339,7 +441,7 @@ function OptionsPanel:AddGeneralItems() else Settings.pulldownTravel = 0; end - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); end -- update settings when sliders change @@ -352,8 +454,8 @@ function OptionsPanel:AddGeneralItems() -- do updates Settings.toggleMinOpacity = self.toggleMinScrollBar:GetValue() / 100; - self.mainWindow:UpdateOpacity(); - self.mainWindow:UpdateSettings(); + _G.travel:UpdateOpacity(); + _G.travel:UpdateSettings(); end self.toggleMaxScrollBar.ValueChanged = function(sender, args) @@ -365,8 +467,8 @@ function OptionsPanel:AddGeneralItems() -- do updates Settings.toggleMaxOpacity = self.toggleMaxScrollBar:GetValue() / 100; - self.mainWindow:UpdateOpacity(); - self.mainWindow:UpdateSettings(); + _G.travel:UpdateOpacity(); + _G.travel:UpdateSettings(); end @@ -380,8 +482,8 @@ function OptionsPanel:AddGeneralItems() -- do updates Settings.mainMinOpacity = self.mainMinScrollBar:GetValue() / 100; - self.mainWindow:UpdateOpacity(); - self.mainWindow:UpdateSettings(); + _G.travel:UpdateOpacity(); + _G.travel:UpdateSettings(); end self.mainMaxScrollBar.ValueChanged = function(sender, args) @@ -393,112 +495,102 @@ function OptionsPanel:AddGeneralItems() -- do updates Settings.mainMaxOpacity = self.mainMaxScrollBar:GetValue() / 100; - self.mainWindow:UpdateOpacity(); - self.mainWindow:UpdateSettings(); + _G.travel:UpdateOpacity(); + _G.travel:UpdateSettings(); + end + + self.mainFadeScrollBar.ValueChanged = function(sender, args) + Settings.fadeOutSteps = self.mainFadeScrollBar:GetValue(); + _G.travel:UpdateOpacity(); + _G.travel:UpdateSettings(); end end +function OptionsPanel:UpdateSettings() + self.UseMinWindowCheck:SetChecked(Settings.useMinWindow == 1); + self.HideOnStartCheck:SetChecked(Settings.hideOnStart == 1); + self.HideOnCombatCheck:SetChecked(Settings.hideOnCombat == 1); + self.hideOnTravelCheck:SetChecked(Settings.hideOnTravel == 1); + self.ignoreEscCheck:SetChecked(Settings.ignoreEsc == 1); + self.ShowButtonCheck:SetChecked(Settings.showButton == 1); + self.PulldownTravelCheck:SetChecked(Settings.pulldownTravel == 1); + self.toggleMinScrollBar:SetValue(Settings.toggleMinOpacity * 100); + self.toggleMaxScrollBar:SetValue(Settings.toggleMaxOpacity * 100); + self.mainMinScrollBar:SetValue(Settings.mainMinOpacity * 100); + self.mainMaxScrollBar:SetValue(Settings.mainMaxOpacity * 100); + self.mainFadeScrollBar:SetValue(Settings.fadeOutSteps); +end + -- function to add all the travel shortcuts that can be toggled -- to the enabled tab function OptionsPanel:AddItems() - local counter = 1; - - -- use an offset counter to set the final position of the skill on the tab - local offsetCounter = 0; - - -- add the generic travels skills if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then - for i = 1, travelCount[3], 1 do - self:AddSkillItemForEnabling(counter, genLocations:IdAtIndex(i), genLocations:LabelAtIndex(i)); - counter = counter + 1; - offsetCounter = offsetCounter + 1; - end - end + -- add the generic travels skills + self:AddSkillsForEnabling(TravelInfo.gen); - -- add the hunter guide skills if the character is a hunter - if (PlayerClass == Turbine.Gameplay.Class.Hunter) then - offsetCounter = 0; - for i = 1, travelCount[1], 1 do - self:AddSkillItemForEnabling(counter, hunterLocations:IdAtIndex(i), hunterLocations:LabelAtIndex(i)); - counter = counter + 1; - offsetCounter = offsetCounter + 1; - end - end - -- add the warden muster skills if the character is a warden - if (PlayerClass == Turbine.Gameplay.Class.Warden) then - for i = 1, travelCount[2], 1 do - self:AddSkillItemForEnabling(counter, wardenLocations:IdAtIndex(i), wardenLocations:LabelAtIndex(i)); - counter = counter + 1; - end - end - -- add the mariner sailing skills if the character is a mariner - if (PlayerClass == Turbine.Gameplay.Class.Mariner) then - for i = 1, travelCount[7], 1 do - self:AddSkillItemForEnabling(counter, marinerLocations:IdAtIndex(i), marinerLocations:LabelAtIndex(i)); - counter = counter + 1; - end - end + -- add class specific travel skills + self:AddSkillsForEnabling(TravelInfo:GetClassSkills()); - -- add the reputation travel skills - if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then - for i = 1, travelCount[4], 1 do - self:AddSkillItemForEnabling(counter, repLocations:IdAtIndex(i), repLocations:LabelAtIndex(i)); - counter = counter + 1; - end - end + -- add the reputation travel skills + self:AddSkillsForEnabling(TravelInfo.rep); - -- add the race specific travel skill for the character - if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then - self:AddSkillItemForEnabling(counter, racialLocations:IdAtIndex(PlayerRaceKey), - racialLocations:LabelAtIndex(PlayerRaceKey)); - counter = counter + 1; + -- add the race specific travel skill for the character + self:AddSkillItemForEnabling(TravelInfo.racial.id, TravelInfo.racial.label); end - -- add the creep travel skills if (PlayerAlignment == Turbine.Gameplay.Alignment.MonsterPlayer) then - for i = 1, travelCount[6], 1 do - self:AddSkillItemForEnabling(counter, creepLocations:IdAtIndex(i), creepLocations:LabelAtIndex(i)); - counter = counter + 1; - end + -- add the creep travel skills + self:AddSkillsItemForEnabling(TravelInfo.creep); end end --- add a single shortcut to the enabled tab at the given location -function OptionsPanel:AddSkillItemForEnabling(index, id, label) +function OptionsPanel:AddSkillsForEnabling(skills) + if skills == nil then return end + for i = 1, skills:GetCount() do + self:AddSkillItemForEnabling(skills:IdAtIndex(i), skills:LabelAtIndex(i)); + end +end - control = Turbine.UI.Label(); +-- add a single shortcut to the enabled tab at the given location +function OptionsPanel:AddSkillItemForEnabling(id, label) + local control = Turbine.UI.Label(); control:SetSize(self.ListBox:GetWidth() - 20, 20); -- create the label for the shortcut setting - self.labels[index] = Turbine.UI.Label(); - self.labels[index]:SetSize(control:GetWidth() - 20, 20); - self.labels[index]:SetPosition(30, 0) - self.labels[index]:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); - self.labels[index]:SetParent(control); - self.labels[index]:SetText(label); - self.labels[index]:SetVisible(true); + local slabel = Turbine.UI.Label(); + slabel:SetSize(control:GetWidth() - 20, 20); + slabel:SetPosition(30, 0) + slabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); + slabel:SetParent(control); + slabel:SetText(label); + slabel:SetVisible(true); + table.insert(self.labels, slabel); -- create the checkbox for the shortcut setting - self.checks[index] = Turbine.UI.Lotro.CheckBox(); - self.checks[index]:SetSize(19, 19); - self.checks[index]:SetPosition(10, 0); - self.checks[index]:SetChecked(Settings.enabled[id]); - self.checks[index]:SetParent(control); - self.checks[index]:SetWantsUpdates(true); - self.checks[index]:SetVisible(true); + local check = Turbine.UI.Lotro.CheckBox(); + check:SetSize(19, 19); + check:SetPosition(10, 0); + check:SetChecked(Settings.enabled[id]); + check:SetParent(control); + check:SetVisible(true); + check.skillId = id; + table.insert(self.checks, check); self.ListBox:AddItem(control) -- handle the event of the check box value changing - self.checks[index].CheckedChanged = function(sender, args) + check.CheckedChanged = function(sender, args) -- change the setting on the main window Settings.enabled[id] = sender:IsChecked(); - shortcutIndex = self.mainWindow:TableIndex(Settings.order, id); + shortcutIndex = TableIndex(Settings.order, id); TravelShortcuts[shortcutIndex]:SetEnabled(sender:IsChecked()); - self.mainWindow.dirty = true; - - -- update the main window settings - self.mainWindow:UpdateSettings(); + _G.travel.dirty = true; + if not self.disableUpdates then + _G.travel:UpdateSettings(); + end + if _G.travel.mapWindow ~= nil then + _G.travel.mapWindow:UpdateShortcut(id, sender:IsChecked()); + end end end @@ -561,8 +653,220 @@ function OptionsPanel:AddBoxes() -- do the check skills self.checkSkillsButton.Click = function(sender, args) - self.mainWindow:CheckSkills(true); + CheckSkills(true); + end + + local next = next; -- optimization + if next(self.overlapGroup) ~= nil then + -- add an enable overlapping skills button + self.enableRepSkillsButton = Turbine.UI.Lotro.Button(); + self.enableRepSkillsButton:SetSize(200, 20); + self.enableRepSkillsButton:SetPosition(520, 90); + self.enableRepSkillsButton:SetText(enableRepSkillsString); + self.enableRepSkillsButton:SetParent(self.EnabledTab); + self.enableRepSkillsButton:SetVisible(true); + + self.enableRepSkillsButton.Click = function(sender, args) + self:EnableOverlapSkills(true); + end + + -- add a disable overlapping skills button + self.disableRepSkillsButton = Turbine.UI.Lotro.Button(); + self.disableRepSkillsButton:SetSize(200, 20); + self.disableRepSkillsButton:SetPosition(520, 120); + self.disableRepSkillsButton:SetText(disableRepSkillsString); + self.disableRepSkillsButton:SetParent(self.EnabledTab); + self.disableRepSkillsButton:SetVisible(true); + + self.disableRepSkillsButton.Click = function(sender, args) + self:EnableOverlapSkills(false); + end + end + + self.enableAllButton = Turbine.UI.Lotro.Button(); + self.enableAllButton:SetSize(200, 20); + self.enableAllButton:SetPosition(520, 30); + self.enableAllButton:SetText(enableAllString); + self.enableAllButton:SetParent(self.EnabledTab); + self.enableAllButton:SetVisible(true); + + self.enableAllButton.Click = function(sender, args) + self:EnableAll(true); + end + + self.disableAllButton = Turbine.UI.Lotro.Button(); + self.disableAllButton:SetSize(200, 20); + self.disableAllButton:SetPosition(520, 60); + self.disableAllButton:SetText(disableAllString); + self.disableAllButton:SetParent(self.EnabledTab); + self.disableAllButton:SetVisible(true); + + self.disableAllButton.Click = function(sender, args) + self:EnableAll(false); + end +end + +function OptionsPanel:AddOverlapLinks(id, repLinks) + local locations = TravelInfo:GetClassSkills(); + if locations == nil then return end + + if not locations:VerifyId(id) then + Turbine.Shell.WriteLine("Overlap Invalid ID " .. id); + return + end + + self.overlapGroup[id] = repLinks; +end + +function OptionsPanel:SetupOverlapLinks() + if PlayerClass == Turbine.Gameplay.Class.Hunter then + self:AddOverlapLinks("0x70003F42", {"0x700062F6", "0x7001BF90", "0x700364B1"}); -- Bree + self:AddOverlapLinks("0x70003F41", {"0x70006346", "0x70053C0F", "0x7001BF91"}); -- Thorin's Hall + self:AddOverlapLinks("0x7000A2C3", {"0x700062C8", "0x70023262"}); -- Michel Delving + self:AddOverlapLinks("0x7000A2C2", {"0x70020441"}); -- Ost Guruth + self:AddOverlapLinks("0x70003F44", {"0x7000631F", "0x70023263"}); -- Rivendell + self:AddOverlapLinks("0x7002A93F", {"0x7002C647"}); -- Galtrev + self:AddOverlapLinks("0x7002C62C", {"0x7002C65D"}); -- Stangard + self:AddOverlapLinks("0x7002E754", {"0x70048C8C"}); -- Caras Galadhon + self:AddOverlapLinks("0x7003198E", {"0x70031A46"}); -- Snowbourn + self:AddOverlapLinks("0x70036B5D", {"0x70036B5E"}); -- Forlaw + self:AddOverlapLinks("0x7003DC71", {"0x7003DC81"}); -- Aldburg + self:AddOverlapLinks("0x7003DC72", {"0x7003DC82"}); -- Helm's Deep + self:AddOverlapLinks("0x70041197", {"0x700411AC"}); -- Dol Amroth + self:AddOverlapLinks("0x70043A63", {"0x70043A6A"}); -- Arnach + self:AddOverlapLinks("0x70044985", {"0x7004497E"}); -- Minas Tirith + self:AddOverlapLinks("0x700459AF", {"0x700459A9"}); -- War-stead + self:AddOverlapLinks("0x70046CBB", {"0x70046CC0"}); -- After-battle Minas Tirith + self:AddOverlapLinks("0x70047077", {"0x70047080"}); -- Henneth Annûn + self:AddOverlapLinks("0x70047074", {"0x7004707D"}); -- After-battle Osgiliath + self:AddOverlapLinks("0x70047BFA", {"0x70047BF4"}); -- Camp of the Host + self:AddOverlapLinks("0x70047C1D", {"0x70047C1B"}); -- Haerondir + self:AddOverlapLinks("0x7004AE1E", {"0x7004AE1D"}); -- Udûn Foothold + self:AddOverlapLinks("0x7004D73B", {"0x7004D738"}); -- Dale + self:AddOverlapLinks("0x7004FACC", {"0x7004FAC3"}); -- Járnfast + self:AddOverlapLinks("0x7004FACB", {"0x7004FAC5"}); -- Skarháld + self:AddOverlapLinks("0x70052F07", {"0x70041A22", "0x70052F12"}); -- Beorninghús + self:AddOverlapLinks("0x70052F08", {"0x70052F04"}); -- Hultvís + self:AddOverlapLinks("0x700551F4", {"0x700551F8"}); -- Estolad Lân + self:AddOverlapLinks("0x7005762D", {"0x70057629"}); -- Limlók + self:AddOverlapLinks("0x70058571", {"0x7005856F"}); -- Annâk-khurfu + self:AddOverlapLinks("0x70059D0C", {"0x70059D0E"}); -- Trader's Wharf + self:AddOverlapLinks("0x70059D16", {"0x70059D12"}); -- Trestlebridge + self:AddOverlapLinks("0x7005AA91", {"0x7005AA90"}); -- Akrâz-zahar + self:AddOverlapLinks("0x7005AA95", {"0x7005AA92"}); -- Azanulbizar + self:AddOverlapLinks("0x7005D487", {"0x7005D47C"}); -- Noble Gate + self:AddOverlapLinks("0x7005D47D", {"0x7005D484"}); -- Leitstáth + self:AddOverlapLinks("0x70060EA6", {"0x70060EA8"}); -- Tornhad + self:AddOverlapLinks("0x7006133F", {"0x70061340"}); -- Nobottle + self:AddOverlapLinks("0x7006323C", {"0x7006323D"}); -- Andrath + self:AddOverlapLinks("0x700634AA", {"0x700634A4"}); -- Swanfleet + self:AddOverlapLinks("0x700634A7", {"0x700634AE"}); -- Cardolan + self:AddOverlapLinks("0x70064AC8", {"0x70064ACA"}); -- Carn Dûm + self:AddOverlapLinks("0x70064F4C", {"0x70064F47"}); -- Clegur + self:AddOverlapLinks("0x700658EA", {"0x700658EB"}); -- Pelargir + self:AddOverlapLinks("0x70068711", {"0x70068700"}); -- King's Dol Amroth + self:AddOverlapLinks("0x70068713", {"0x70068702"}); -- Halrax + self:AddOverlapLinks("0x70068717", {"0x70068703"}); -- Lond Cirion + self:AddOverlapLinks("0x70068718", {"0x700686FF"}); -- Umbar + self:AddOverlapLinks("0x70068719", {"0x70068701"}); -- Jax Phanâl + self:AddOverlapLinks("0x700697EF", {"0x700697F2"}); -- Bloody Eagle Tavern + elseif PlayerClass == Turbine.Gameplay.Class.Warden then + self:AddOverlapLinks("0x70014786", {"0x70020441"}); -- Ost Guruth + self:AddOverlapLinks("0x70014791", {"0x7000631F", "0x70023263"}); -- Rivendell + self:AddOverlapLinks("0x7002A90A", {"0x7002C647"}); -- Galtrev + self:AddOverlapLinks("0x7002C646", {"0x7002C65D"}); -- Stangard + self:AddOverlapLinks("0x700303DF", {"0x70048C8C"}); -- Caras Galadhon + self:AddOverlapLinks("0x7003198D", {"0x70031A46"}); -- Snowbourn + self:AddOverlapLinks("0x70036B5B", {"0x70036B5E"}); -- Forlaw + self:AddOverlapLinks("0x7003DC7A", {"0x7003DC81"}); -- Aldburg + self:AddOverlapLinks("0x7003DC79", {"0x7003DC82"}); -- Helm's Deep + self:AddOverlapLinks("0x70041198", {"0x700411AC"}); -- Dol Amroth + self:AddOverlapLinks("0x70043A66", {"0x70043A6A"}); -- Arnach + self:AddOverlapLinks("0x70044982", {"0x7004497E"}); -- Minas Tirith + self:AddOverlapLinks("0x700459AA", {"0x700459A9"}); -- War-stead + self:AddOverlapLinks("0x70046CBF", {"0x70046CC0"}); -- After battle Minas Tirith + self:AddOverlapLinks("0x70047075", {"0x70047080"}); -- Henneth Annûn + self:AddOverlapLinks("0x70047076", {"0x7004707D"}); -- After battle Osgiliath + self:AddOverlapLinks("0x70047BFC", {"0x70047BF4"}); -- Camp of the Host + self:AddOverlapLinks("0x70047C23", {"0x70047C1B"}); -- Haerondir + self:AddOverlapLinks("0x7004AE1F", {"0x7004AE1D"}); -- Udûn Foothold + self:AddOverlapLinks("0x7004D73A", {"0x7004D738"}); -- Dale + self:AddOverlapLinks("0x7004FACA", {"0x7004FAC3"}); -- Járnfast + self:AddOverlapLinks("0x7004FACD", {"0x7004FAC5"}); -- Skarháld + self:AddOverlapLinks("0x70052F0A", {"0x70041A22", "0x70052F12"}); -- Beorninghús + self:AddOverlapLinks("0x70052F06", {"0x70052F04"}); -- Hultvís + self:AddOverlapLinks("0x700551F2", {"0x700551F8"}); -- Estolad Lân + self:AddOverlapLinks("0x70057635", {"0x70057629"}); -- Limlók + self:AddOverlapLinks("0x70058572", {"0x7005856F"}); -- Annâk-khurfu + self:AddOverlapLinks("0x70059D09", {"0x70059D0E"}); -- Trader's Wharf + self:AddOverlapLinks("0x70059D10", {"0x70059D12"}); -- Trestlebridge + self:AddOverlapLinks("0x7005AA8F", {"0x7005AA90"}); -- Akrâz-zahar + self:AddOverlapLinks("0x7005AA8C", {"0x7005AA92"}); -- Azanulbizar + self:AddOverlapLinks("0x7005D48A", {"0x7005D47C"}); -- Noble Gate + self:AddOverlapLinks("0x7005D488", {"0x7005D484"}); -- Leitstáth + self:AddOverlapLinks("0x70060EA5", {"0x70060EA8"}); -- Tornhad + self:AddOverlapLinks("0x7006133E", {"0x70061340"}); -- Nobottle + self:AddOverlapLinks("0x70063242", {"0x7006323D"}); -- Andrath + self:AddOverlapLinks("0x700634B6", {"0x700634A4"}); -- Swanfleet + self:AddOverlapLinks("0x700634AD", {"0x700634AE"}); -- Cardolan + self:AddOverlapLinks("0x70064ACB", {"0x70064ACA"}); -- Carn Dûm + self:AddOverlapLinks("0x70064F4D", {"0x70064F47"}); -- Clegur + self:AddOverlapLinks("0x700658E8", {"0x700658EB"}); -- Pelargir + self:AddOverlapLinks("0x7006870C", {"0x70068701"}); -- Jax Phanâl + self:AddOverlapLinks("0x7006870F", {"0x700686FF"}); -- Umbar + self:AddOverlapLinks("0x70068710", {"0x70068702"}); -- Halrax + self:AddOverlapLinks("0x70068712", {"0x70068700"}); -- King's Dol Amroth + self:AddOverlapLinks("0x70068715", {"0x70068703"}); -- Lond Cirion + self:AddOverlapLinks("0x700697F3", {"0x700697F2"}); -- Bloody Eagle Tavern + elseif PlayerClass == Turbine.Gameplay.Class.Mariner then + self:AddOverlapLinks("0x70066105", {"0x70059D0E"}); -- Trader's Wharf + self:AddOverlapLinks("0x70066109", {"0x7004707D"}); -- After-battle Osgiliath + self:AddOverlapLinks("0x7006610C", {"0x7004D738"}); -- Lake-town + self:AddOverlapLinks("0x70066117", {"0x700411AC"}); -- Dol Amroth + self:AddOverlapLinks("0x7006611B", {"0x700658EB"}); -- Pelargir + self:AddOverlapLinks("0x7006611E", {"0x70048C8C"}); -- Lothlórien + self:AddOverlapLinks("0x70066121", {"0x70031A46"}); -- Snowbourn + self:AddOverlapLinks("0x700687BB", {"0x700686FF"}); -- Umbar + self:AddOverlapLinks("0x700687BD", {"0x70068703"}); -- Lond Cirion + self:AddOverlapLinks("0x700687C0", {"0x70068701"}); -- Jax Phanâl + self:AddOverlapLinks("0x700687C1", {"0x70068700"}); -- King's Dol Amroth + self:AddOverlapLinks("0x700687C3", {"0x70068702"}); -- Halrax + end +end + +function OptionsPanel:EnableOverlapSkills(enable) + self.disableUpdates = true; + for id, group in pairs(self.overlapGroup) do + for i = 1, #group do + for j = 1, #self.checks do + if self.checks[j].skillId == group[i] then + self.checks[j]:SetChecked(enable); + break + end + end + end + end + self.disableUpdates = false; + _G.travel:UpdateSettings(); -- force an update now +end + +function OptionsPanel:EnableAll(enable) + self.disableUpdates = true; + for i = 1, #self.checks do + self.checks[i]:SetChecked(enable); + end + self.disableUpdates = false; + _G.travel:UpdateSettings(); -- force an update now +end + +function OptionsPanel:EnableFromSettings() + self.disableUpdates = true; + for i = 1, #self.checks do + local id = self.checks[i].skillId; + self.checks[i]:SetChecked(Settings.enabled[id]); end + self.disableUpdates = false; + -- TravelWindow:UpdateSettings() will be called later end -- function to add the list of shortcuts to the sort tab @@ -667,7 +971,7 @@ function OptionsPanel:AddSortButtons() end -- update the main window shortcuts and settings - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); end -- handle the move up button click @@ -681,7 +985,7 @@ function OptionsPanel:AddSortButtons() self:SwapShortcuts(self.sortSelectedIndex, self.sortSelectedIndex - 1); -- update the main window shortcuts and settings - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); -- decrease the selected index self.sortSelectedIndex = self.sortSelectedIndex - 1; @@ -698,7 +1002,7 @@ function OptionsPanel:AddSortButtons() self:SwapShortcuts(self.sortSelectedIndex, self.sortSelectedIndex + 1); -- update the main window shortcuts and settings - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); -- increase the selected index self.sortSelectedIndex = self.sortSelectedIndex + 1; @@ -716,7 +1020,7 @@ function OptionsPanel:AddSortButtons() end -- update the main window shortcuts and settings - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); end end @@ -743,6 +1047,6 @@ function OptionsPanel:SwapShortcuts(first, second) local tempShortcut = TravelShortcuts[first]; TravelShortcuts[first] = TravelShortcuts[second]; TravelShortcuts[second] = tempShortcut; - self.mainWindow.dirty = true; + _G.travel.dirty = true; end end diff --git a/src/OptionsWindow.lua b/src/OptionsWindow.lua index de78bdd..5984859 100644 --- a/src/OptionsWindow.lua +++ b/src/OptionsWindow.lua @@ -8,7 +8,7 @@ import "TravelWindowII.src.utils.BitOps"; OptionsWindow = class(Turbine.UI.Lotro.Window); -function OptionsWindow:Constructor(parent) +function OptionsWindow:Constructor() Turbine.UI.Lotro.Window.Constructor(self); self.loaded = false; @@ -27,25 +27,37 @@ function OptionsWindow:Constructor(parent) self:SetOpacity(1); -- add the main options panel to the window - self.Panel = TravelWindowII.src.OptionsPanel(parent); + self.Panel = TravelWindowII.src.OptionsPanel(); self.Panel:SetParent(self); self.Panel:SetPosition(0, 35); -- set the window to be visible self:SetVisible(false); - -- have the main window close the options - self.VisibleChanged = function(sender, args) - if (self:IsVisible() == false) then - if (parent ~= nil) then - parent:CloseOptions(); - end - end - end - self.loaded = true; end function OptionsWindow:GetLoaded() return self.loaded; end + +function CreateOptionsWindow() + local PluginManagerOptionsPanel = Turbine.UI.Control() + PluginManagerOptionsPanel:SetSize(500, 200) + + plugin.GetOptionsPanel = function() + return PluginManagerOptionsPanel; + end + + local OptionsButton = Turbine.UI.Lotro.Button() + OptionsButton:SetParent(PluginManagerOptionsPanel) + OptionsButton:SetPosition(100, 100) + OptionsButton:SetSize(200,15) + OptionsButton:SetText(menuOptionsString) + OptionsButton:SetVisible(true) + + OptionsWindow = TravelWindowII.src.OptionsWindow(); + OptionsButton.Click = function() + OptionsWindow:SetVisible(true); + end +end diff --git a/src/OrendarUIMods/ComboBox.lua b/src/OrendarUIMods/ComboBox.lua index d004ea1..d6a033d 100644 --- a/src/OrendarUIMods/ComboBox.lua +++ b/src/OrendarUIMods/ComboBox.lua @@ -18,17 +18,18 @@ ComboBox.BlackColor = Turbine.UI.Color(1, 0, 0, 0); function ComboBox:Constructor(toplevel) Turbine.UI.Control.Constructor(self); + self.itemHeight = 20; self:SetBackColor(ComboBox.DisabledColor); self.quickslots = {}; self.labels = {}; - self.hoverIndex = 0; self.topLevelWindow = toplevel; -- state self.dropped = false; self.selection = -1; - self.travelOnSelect = 0; + self.hoverIndex = 0; + self.hoverScroll = false; -- text label self.label = TravelWindowII.src.extensions.DLabel(); @@ -51,17 +52,19 @@ function ComboBox:Constructor(toplevel) self.arrow:SetMouseVisible(false); -- drop down window - self.dropDownWindow = Turbine.UI.Extensions.SimpleWindow(); + self.dropDownWindow = Turbine.UI.Window(); self.dropDownWindow:SetBackColor(ComboBox.DisabledColor); self.dropDownWindow:SetZOrder(98); self.dropDownWindow:SetVisible(false); - self.dropDownWindow:SetFadeSpeed(0.01); -- list scroll bar self.scrollBar = Turbine.UI.Lotro.ScrollBar(); self.scrollBar:SetOrientation(Turbine.UI.Orientation.Vertical); - self.scrollBar:SetParent(self.dropDownWindow); self.scrollBar:SetBackColor(ComboBox.BlackColor); + self.scrollBar:SetParent(self.dropDownWindow); + self.scrollBar:SetLargeChange(self.itemHeight); + self.scrollBar:SetSmallChange(self.itemHeight); + self.scrollBar:SetVisible(false); -- list to contain the drop down items self.listBox = Turbine.UI.Control(); @@ -77,18 +80,25 @@ function ComboBox:Constructor(toplevel) end self.FocusLost = function(sender, args) - if self.dropped then - if self.hoverIndex > 0 then - local msArgs = { Button = Turbine.UI.MouseButton.None }; - self.labels[self.hoverIndex]:MouseClick(sender, args) - else - self:CloseDropDown() - end + if self.dropped and self.hoverIndex == 0 and not self.hoverScroll then + self:CloseDropDown() end end -end -function ComboBox:SetTravelOnSelect(value) self.travelOnSelect = value; end + -- FIXME: The window should remain opaque while grabbing the thumb button. + -- However, when the thumb button is grabbed, leaving the scrollbar + -- triggers a MouseLeave event on the dropDownWindow, which triggers a FadeOut(). + -- Further, ScrollBar.MouseDown/Up do not work when grabbing the thumb button. + self.scrollBar.MouseEnter = function(sender, args) + self.hoverScroll = true; + end + self.scrollBar.MouseLeave = function(sender, args) + self.hoverScroll = false; + end + self.scrollBar.ValueChanged = function(sender, args) + self:UpdateSubWindow(); + end +end function ComboBox:MouseEnter(args) if (not self:IsEnabled()) then return; end @@ -150,92 +160,78 @@ end function ComboBox:ClearItems() self.labels = {}; self.quickslots = {}; + self.listBox:GetControls():Clear(); + self.label:SetText(""); end -function ComboBox:AddItem(shortcut, index, value) +function ComboBox:AddItem(shortcut, value) local width, height = self:GetSize(); - self.quickslots[index] = Turbine.UI.Lotro.Quickslot(); - self.quickslots[index]:SetSize(width, 20); - self.quickslots[index]:SetPosition(0, ((index - 1) * (20))); - self.quickslots[index]:SetZOrder(90); - self.quickslots[index]:SetOpacity(1); - self.quickslots[index]:SetUseOnRightClick(false); - self.quickslots[index]:SetParent(self.listBox); - self.quickslots[index]:SetShortcut(shortcut); - - -- self.labels[index] = Turbine.UI.Label(); - self.labels[index] = TravelWindowII.src.extensions.DLabel(); - self.labels[index]:SetSize(width, 20); - self.labels[index]:SetPosition(0, ((index - 1) * (20))); - self.labels[index]:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleCenter); - self.labels[index]:SetForeColor(ComboBox.ItemColor); - self.labels[index]:SetFont(Turbine.UI.Lotro.Font.TrajanPro14); - self.labels[index]:SetOutlineColor(ComboBox.HighlightColor); - self.labels[index]:SetBackColor(Turbine.UI.Color(0.87, 0, 0, 0)); - self.labels[index]:SetText(shortcut:GetSkillLabel()); - self.labels[index]:SetZOrder(100); - self.labels[index]:SetMouseVisible(self.travelOnSelect == 0); - self.labels[index]:SetParent(self.listBox); - - self.quickslots[index]:SetAllowDrop(false); - self.quickslots[index]:SetVisible(true); - - self.labels[index].MouseEnter = function(sender, args) - sender:SetFontStyle(Turbine.UI.FontStyle.Outline); - sender:SetForeColor(ComboBox.ItemColor); - sender:SetText(sender:GetText()); - self.hoverIndex = index; - end - - self.labels[index].MouseLeave = function(sender, args) - sender:SetFontStyle(Turbine.UI.FontStyle.None); - if (index == self.selection) then - sender:SetForeColor(ComboBox.SelectionColor); - end - sender:SetText(sender:GetText()); - self.hoverIndex = 0; - end - - self.labels[index].MouseClick = function(sender, args) - if (args.Button == Turbine.UI.MouseButton.Left) then - self:ItemSelected(index); - self:FireEvent(); - if (self.travelOnSelect == 1 and Settings.hideOnTravel == 1) then - self.topLevelWindow:SetVisible(false); - end - end - end - - self.labels[index].MouseWheel = function(sender, args) - self:DoScroll(sender, args); - end - self.quickslots[index].MouseWheel = function(sender, args) + local index = #self.labels + 1; + local label = TravelWindowII.src.extensions.DLabel(); + label:SetSize(width, self.itemHeight); + label:SetPosition(0, ((index - 1) * (self.itemHeight))); + label:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleCenter); + label:SetForeColor(ComboBox.ItemColor); + label:SetFont(Turbine.UI.Lotro.Font.TrajanPro14); + label:SetOutlineColor(ComboBox.HighlightColor); + label:SetBackColor(Turbine.UI.Color(0.87, 0, 0, 0)); + label:SetText(shortcut:GetSkillLabel()); + label:SetMouseVisible(Settings.pulldownTravel == 0); + label:SetParent(self.listBox); + + label.MouseWheel = function(sender, args) self:DoScroll(sender, args); end - self.quickslots[index].MouseEnter = function(sender, args) + label.MouseEnter = function(sender, args) self.labels[index]:SetFontStyle(Turbine.UI.FontStyle.Outline); self.labels[index]:SetForeColor(ComboBox.ItemColor); - self.labels[index]:SetText(self.labels[index]:GetText()); + self.hoverIndex = index; end - self.quickslots[index].MouseLeave = function(sender, args) + + label.MouseLeave = function(sender, args) self.labels[index]:SetFontStyle(Turbine.UI.FontStyle.None); if (index == self.selection) then self.labels[index]:SetForeColor(ComboBox.SelectionColor); + else + self.labels[index]:SetForeColor(ComboBox.ItemColor); end - self.labels[index]:SetText(self.labels[index]:GetText()); + self.hoverIndex = 0; end - self.quickslots[index].MouseClick = function(sender, args) + label.MouseClick = function(sender, args) if (args.Button == Turbine.UI.MouseButton.Left) then self:ItemSelected(index); self:FireEvent(); - self.topLevelWindow:SetVisible(false); + if (Settings.pulldownTravel == 1 and Settings.hideOnTravel == 1) then + self.topLevelWindow:SetVisible(false); + end end end - self.labels[index]:SetIndex(value); + if Settings.pulldownTravel == 1 then + label:SetZOrder(100); + local quickslot = Turbine.UI.Lotro.Quickslot(); + quickslot:SetZOrder(90); + quickslot:SetSize(width, self.itemHeight); + quickslot:SetPosition(0, ((index - 1) * (self.itemHeight))); + quickslot:SetOpacity(0); + quickslot:SetUseOnRightClick(false); + quickslot:SetParent(self.listBox); + quickslot:SetShortcut(shortcut); + quickslot:SetAllowDrop(false); + quickslot:SetVisible(true); + + quickslot.MouseWheel = label.MouseWheel; + quickslot.MouseEnter = label.MouseEnter; + quickslot.MouseLeave = label.MouseLeave; + quickslot.MouseClick = label.MouseClick; + self.quickslots[index] = quickslot; + end + + label:SetIndex(value); + self.labels[index] = label; end function ComboBox:RemoveItem(value) @@ -339,9 +335,11 @@ function ComboBox:Layout() self.dropDownWindow:SetSize(width, listHeight + 4); self.scrollBar:SetPosition(width - 12, 2); + for i = 1, #self.labels, 1 do + self.labels[i]:SetSize(width, self.itemHeight); + end for i = 1, #self.quickslots, 1 do - self.quickslots[i]:SetSize(width, 20); - self.labels[i]:SetSize(width, 20); + self.quickslots[i]:SetSize(width, self.itemHeight); end end @@ -380,8 +378,7 @@ function ComboBox:ShowDropDown() -- scrollbar self.scrollBar:SetSize(10, listHeight); self.scrollBar:SetPosition(width - 12, 2); - self.scrollBar:SetMinimum(0); - self.scrollBar:SetMaximum(itemCount * 20 - 200); + self.scrollBar:SetMaximum(itemCount * self.itemHeight - listHeight); -- position local parent = self:GetParent(); @@ -397,10 +394,6 @@ function ComboBox:ShowDropDown() self.dropDownWindow:SetPosition(screenX, screenY + cbHeight + 3); self.dropDownWindow:SetVisible(true); - - self.scrollBar.ValueChanged = function(sender, args) - self:UpdateSubWindow(); - end end end @@ -417,7 +410,7 @@ end function ComboBox:DoScroll(sender, args) -- calculate how far to move the scrollbar - local newValue = self.scrollBar:GetValue() - args.Direction * 20; + local newValue = self.scrollBar:GetValue() - args.Direction * self.itemHeight; -- make sure the value does not go below zero if (newValue < 0) then newValue = 0; end @@ -433,14 +426,10 @@ function ComboBox:DoScroll(sender, args) end function ComboBox:UpdateSubWindow() - -- loop through all the quickslots + for i = 1, #self.labels, 1 do + self.labels[i]:SetTop((i - 1) * self.itemHeight - self.scrollBar:GetValue()); + end for i = 1, #self.quickslots, 1 do - -- get the number of rows - local row = math.ceil(i / 1); - - -- set the top position of the quickslots based on row - -- number and the value of the scrollbar - self.quickslots[i]:SetTop((row - 1) * 20 - self.scrollBar:GetValue()); - self.labels[i]:SetTop((row - 1) * 20 - self.scrollBar:GetValue()); + self.quickslots[i]:SetTop((i - 1) * self.itemHeight - self.scrollBar:GetValue()); end end diff --git a/src/SettingsMenu.lua b/src/SettingsMenu.lua index 6965a41..727aee4 100644 --- a/src/SettingsMenu.lua +++ b/src/SettingsMenu.lua @@ -6,13 +6,6 @@ SettingsMenu = class(Turbine.UI.ContextMenu) function SettingsMenu:Constructor(parentWindow) Turbine.UI.ContextMenu.Constructor(self); - -- create shortcuts to the bitop functions - bit = TravelWindowII.bit; - hasbit = TravelWindowII.hasbit; - setbit = TravelWindowII.setbit; - clearbit = TravelWindowII.clearbit; - togglebit = TravelWindowII.togglebit; - -- set the default values self.mode = 1; self.filters = 0x0F; @@ -154,9 +147,9 @@ function SettingsMenu:Update(string) -- elseif (string == menuMapString) then @TODO has to be reintroduced -- self.parent:SetMapHome(); elseif (string == menuOptionsString) then - self.parent:OpenOptions(); + OptionsWindow:SetVisible(true); elseif (string == menuSkillsString) then - self.parent:CheckSkills(true); + CheckSkills(true); elseif (string == moorMapString) then self.parent:OpenMapWindow(MapType.CREEPS); elseif (string == eriadorMapString) then @@ -180,3 +173,296 @@ function SettingsMenu:Update(string) self.parent:SetOpacity(Settings.mainMinOpacity); end +function SetPlayerRaceKey() + -- map player race to racial travel skill index for insertion into available travel skills + if (PlayerRace == Turbine.Gameplay.Race.Dwarf) then + PlayerRaceKey = 3; + elseif (PlayerRace == Turbine.Gameplay.Race.Elf) then + PlayerRaceKey = 4; + elseif (PlayerRace == Turbine.Gameplay.Race.Hobbit) then + PlayerRaceKey = 2; + elseif (PlayerRace == Turbine.Gameplay.Race.Man) then + PlayerRaceKey = 1; + elseif (PlayerRace == Turbine.Gameplay.Race.Beorning) then + PlayerRaceKey = 5; + elseif (PlayerRace == Turbine.Gameplay.Race.HighElf) then + PlayerRaceKey = 6; + elseif (PlayerRace == Turbine.Gameplay.Race.StoutAxe) then + PlayerRaceKey = 7; + elseif (PlayerRace == Turbine.Gameplay.Race.RiverHobbit) then + PlayerRaceKey = 8; + else + PlayerRaceKey = 1; -- default to man race to prevent errors + end +end + +function InitDefaultSettings() + -- set all settings to default values + Settings = {}; + Settings.lastLoadedVersion = Plugins["Travel Window II"]:GetVersion(); + Settings.gridCols = 0; + Settings.gridRows = 0; + Settings.listWidth = 0; + Settings.listRows = 0; + Settings.positionX = Turbine.UI.Display.GetWidth() * 0.75; + Settings.positionY = Turbine.UI.Display.GetHeight() * 0.75; + Settings.buttonRelativeX = 0.95; + Settings.buttonRelativeY = 0.75; + Settings.useMinWindow = 0; + Settings.hideOnStart = 0; + Settings.hideOnCombat = 0; + Settings.pulldownTravel = 0; + Settings.hideOnTravel = 0; + Settings.ignoreEsc = 0; + Settings.showButton = 1; + Settings.mode = 2; + Settings.filters = 0x0F; + Settings.enabled = {}; + Settings.order = {}; + Settings.mainMaxOpacity = 1; + Settings.mainMinOpacity = 0.5; + Settings.fadeOutSteps = 1; + Settings.toggleMaxOpacity = 1; + Settings.toggleMinOpacity = 0.5; + + -- clear the maps + Settings.mapGlanVraig = nil; +end + +function InitNumberSetting(strTable, name, forceDefault) + if not strTable[name] or strTable[name] == "nil" then + if forceDefault == nil then + strTable[name] = tostring(Settings[name]); + else + strTable[name] = tostring(forceDefault); + end + end + if type(strTable[name]) == "string" then + Settings[name] = tonumber(strTable[name]); + else + Settings[name] = strTable[name]; + end +end + +function LoadSettings() + -- if a value is not available, use a default value + InitDefaultSettings(); + + -- load TWII settings file + local settingsStrings = PatchDataLoad(Turbine.DataScope.Character, "TravelWindowIISettings"); + AccountSettingsStrings = PatchDataLoad(Turbine.DataScope.Account, "TravelWindowIISettings"); + + -- save a daily backup of settings + if (settingsStrings) then + settingsStrings.backupTime = "#" .. Turbine.Engine.GetGameTime(); + local dateInfo = Turbine.Engine.GetDate(); + PatchDataSave(Turbine.DataScope.Character, "TravelWindowIISettings_backup" .. dateInfo.DayOfWeek, + settingsStrings); + end + + -- try importing Travel Window I settings if new settings were not found + local importOldSettings = false; + if (settingsStrings == nil) then + local result; + importOldSettings, result = pcall(function() + settingsStrings = PatchDataLoad(Turbine.DataScope.Character, "TravelWindowSettings"); + end); + end + + AccountSettingsStrings = SetSettings(AccountSettingsStrings); + SetSettings(settingsStrings, importOldSettings); + CheckEnabledSettings(); +end + +function SetSettings(settingsArg, importOldSettings) + -- initialze any uninitialized settings strings + if (type(settingsArg) ~= "table") then + settingsArg = {}; + end + + if (not settingsArg.lastLoadedVersion or settingsArg.lastLoadedVersion == "nil") then + settingsArg.lastLoadedVersion = tostring(Plugins["Travel Window II"]:GetVersion()); + end + + -- fixup deprecated buttonPositionX + local buttonRelativeX = Settings.buttonRelativeX; + if settingsArg.buttonPositionX and settingsArg.buttonPositionX ~= "nil" then + local screenWidth = Turbine.UI.Display.GetWidth(); + if tonumber(settingsArg.buttonPositionX) < screenWidth then + -- not perfect, but assuming the same resolution, this will approximately convert to a relative value + buttonRelativeX = tonumber(settingsArg.buttonPositionX) / screenWidth; + if buttonRelativeX > 1.0 then + buttonRelativeX = Settings.buttonRelativeX; + end + end + settingsArg.buttonPositionX = nil; + end + + -- fixup deprecated buttonPositionY + local buttonRelativeY = Settings.buttonRelativeY; + if settingsArg.buttonPositionY and settingsArg.buttonPositionY ~= "nil" then + local screenHeight = Turbine.UI.Display.GetHeight(); + if tonumber(settingsArg.buttonPositionY) < screenHeight then + -- not perfect, but assuming the same resolution, this will approximately convert to a relative value + buttonRelativeY = tonumber(settingsArg.buttonPositionY) / screenHeight; + if buttonRelativeY > 1.0 then + buttonRelativeY = Settings.buttonRelativeY; + end + end + settingsArg.buttonPositionY = nil; + end + + InitNumberSetting(settingsArg, "gridCols"); + InitNumberSetting(settingsArg, "gridRows"); + InitNumberSetting(settingsArg, "listWidth"); + InitNumberSetting(settingsArg, "listRows"); + InitNumberSetting(settingsArg, "positionX"); + InitNumberSetting(settingsArg, "positionY"); + InitNumberSetting(settingsArg, "buttonRelativeX", buttonRelativeX); + InitNumberSetting(settingsArg, "buttonRelativeY", buttonRelativeY); + InitNumberSetting(settingsArg, "useMinWindow"); + InitNumberSetting(settingsArg, "hideOnStart"); + InitNumberSetting(settingsArg, "hideOnCombat"); + InitNumberSetting(settingsArg, "pulldownTravel"); + InitNumberSetting(settingsArg, "hideOnTravel"); + InitNumberSetting(settingsArg, "ignoreEsc"); + InitNumberSetting(settingsArg, "showButton"); + InitNumberSetting(settingsArg, "mode"); + InitNumberSetting(settingsArg, "filters"); + InitNumberSetting(settingsArg, "mainMaxOpacity"); + InitNumberSetting(settingsArg, "mainMinOpacity"); + InitNumberSetting(settingsArg, "fadeOutSteps"); + InitNumberSetting(settingsArg, "toggleMaxOpacity"); + InitNumberSetting(settingsArg, "toggleMinOpacity"); + + if (settingsArg.mapGlanVraig ~= nil) then + Settings.mapGlanVraig = settingsArg.mapGlanVraig; + end + + if (not settingsArg.enabled or importOldSettings) then + settingsArg.enabled = {}; + end + + if ((not settingsArg.order) or importOldSettings) then + settingsArg.order = {}; + end + + Settings.lastLoadedVersion = settingsArg.lastLoadedVersion; + Settings.enabled = TableCopy(settingsArg.enabled); + + local convertTableIndex = false; + for i, v in pairs(settingsArg.order) do + if (type(i) == "string") then + convertTableIndex = true; + end + end + + if (convertTableIndex) then + Settings.order = OrderTableNumberIndex(settingsArg); + else + Settings.order = TableCopy(settingsArg.order); + end + return settingsArg; +end + +function SaveSettings(scope) + local settingsStrings = {}; + settingsStrings.lastLoadedVersion = tostring(Settings.lastLoadedVersion); + settingsStrings.gridCols = tostring(Settings.gridCols); + settingsStrings.gridRows = tostring(Settings.gridRows); + settingsStrings.listWidth = tostring(Settings.listWidth); + settingsStrings.listRows = tostring(Settings.listRows); + settingsStrings.positionX = tostring(Settings.positionX); + settingsStrings.positionY = tostring(Settings.positionY); + settingsStrings.buttonRelativeX = tostring(Settings.buttonRelativeX); + settingsStrings.buttonRelativeY = tostring(Settings.buttonRelativeY); + settingsStrings.useMinWindow = tostring(Settings.useMinWindow); + settingsStrings.hideOnStart = tostring(Settings.hideOnStart); + settingsStrings.hideOnCombat = tostring(Settings.hideOnCombat); + settingsStrings.pulldownTravel = tostring(Settings.pulldownTravel); + settingsStrings.hideOnTravel = tostring(Settings.hideOnTravel); + settingsStrings.ignoreEsc = tostring(Settings.ignoreEsc); + settingsStrings.showButton = tostring(Settings.showButton); + settingsStrings.mode = tostring(Settings.mode); + settingsStrings.filters = tostring(Settings.filters); + settingsStrings.mainMaxOpacity = tostring(Settings.mainMaxOpacity); + settingsStrings.mainMinOpacity = tostring(Settings.mainMinOpacity); + settingsStrings.fadeOutSteps = tostring(Settings.fadeOutSteps); + settingsStrings.toggleMaxOpacity = tostring(Settings.toggleMaxOpacity); + settingsStrings.toggleMinOpacity = tostring(Settings.toggleMinOpacity); + settingsStrings.enabled = TableCopy(Settings.enabled); + settingsStrings.mapGlanVraig = tostring(Settings.mapGlanVraig); + + settingsStrings.order = OrderTableStringIndex(); + + if scope == nil then + scope = Turbine.DataScope.Character; + end + if scope == Turbine.DataScope.Character then + CharacterSettingsStrings = settingsStrings; + elseif scope == Turbine.DataScope.Account then + AccountSettingsStrings = settingsStrings; + end + + -- save the settings + PatchDataSave(scope, "TravelWindowIISettings", settingsStrings); +end + +function OrderTableStringIndex() + order = {} + for i, v in ipairs(Settings.order) do + order[tostring(i)] = v; + end + return order; +end + +function OrderTableNumberIndex(settingsArg) + order = {}; + + for i, v in pairs(settingsArg.order) do + order[tonumber(i)] = v; + end + return order; +end + +-- this method influences the default sorting order of skills +function CheckEnabledSettings() + if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then + -- update generic travel settings + AddNewSettings(TravelInfo.gen); + + -- update racial travel settings + local racialId = TravelInfo.racial.id; + if (Settings.enabled[racialId] == nil) then + Settings.enabled[racialId] = true; + end + if (TableContains(Settings.order, racialId) == false) then + table.insert(Settings.order, racialId); + end + + -- update class travel settings + AddNewSettings(TravelInfo:GetClassSkills()); + + -- update reputation travel settings + AddNewSettings(TravelInfo.rep); + else + -- update creep travel settings + AddNewSettings(TravelInfo.creep); + end +end + +function AddNewSettings(skills) + if skills == nil then return end + for i = 1, skills:GetCount() do + local id = skills:IdAtIndex(i); + -- if the enabled setting for the skill is nil, set it to true as default + if (Settings.enabled[id] == nil) then + Settings.enabled[id] = true; + end + + -- if the skill is not in the order list, add it + if (TableContains(Settings.order, id) == false) then + table.insert(Settings.order, id); + end + end +end diff --git a/src/TravelButton.lua b/src/TravelButton.lua index b7a7801..0b58e70 100644 --- a/src/TravelButton.lua +++ b/src/TravelButton.lua @@ -9,26 +9,22 @@ import "TravelWindowII.src.utils.BitOps"; --[[ This is the simple window that can be used to toggle ]] -- --[[ the main Travel Window visible.]] -- -TravelButton = class(Turbine.UI.Extensions.SimpleWindow); +TravelButton = class(Turbine.UI.Window); -function TravelButton:Constructor(parent) - Turbine.UI.Extensions.SimpleWindow.Constructor(self); - - -- keep track of our parent window - self.mainWindow = parent; +function TravelButton:Constructor() + Turbine.UI.Window.Constructor(self); -- set defaults self:SetSize(32, 32); self:SetBackground("TravelWindowII/src/resources/travel.tga"); self:SetBackColorBlendMode(Turbine.UI.BlendMode.Multiply); self:SetBackColor(Turbine.UI.Color(0, 0.5, 0.5, 0.5)); - self:SetWantsUpdates(true); self:SetZOrder(1); local screenWidth = Turbine.UI.Display.GetWidth(); local screenHeight = Turbine.UI.Display.GetHeight(); - local buttonPositionX = SettingsStrings.buttonRelativeX * screenWidth; - local buttonPositionY = SettingsStrings.buttonRelativeY * screenHeight; + local buttonPositionX = Settings.buttonRelativeX * screenWidth; + local buttonPositionY = Settings.buttonRelativeY * screenHeight; if buttonPositionX + self:GetWidth() > screenWidth then buttonPositionX = screenWidth - self:GetWidth(); end @@ -50,23 +46,6 @@ function TravelButton:Constructor(parent) local x = 0; local y = 0; - function TravelButton:Update(sender, args) - - if (isMoving) then - if (not isHighlighted) then - if (Turbine.Engine.GetGameTime() - buttonDownTime > 0.4) then - self:SetBackColor(Turbine.UI.Color(1.0, 0.5, 0.5, 0.95)); - isHighlighted = true; - hasMoved = true; - else - self:SetWantsUpdates(true); - end - end - else - Turbine.UI.Extensions.SimpleWindow.Update(self, args); - end - end - -- go to full opacity if mouse is over self.MouseEnter = function(sender, args) self:SetOpacity(Settings.toggleMaxOpacity); @@ -81,7 +60,6 @@ function TravelButton:Constructor(parent) self.MouseDown = function(sender, args) if (args.Button == Turbine.UI.MouseButton.Left) then buttonDownTime = Turbine.Engine.GetGameTime(); - self:SetWantsUpdates(true); isMoving = true; x = args.X; y = args.Y; @@ -93,7 +71,6 @@ function TravelButton:Constructor(parent) if (args.Button == Turbine.UI.MouseButton.Left) then isMoving = false; isHighlighted = false; - self:SetWantsUpdates(false); -- if the window moved, update the settings, but do not toggle -- the visibility of the button @@ -102,16 +79,17 @@ function TravelButton:Constructor(parent) local screenWidth, screenHeight = Turbine.UI.Display.GetSize(); Settings.buttonRelativeX = one / screenWidth; Settings.buttonRelativeY = two / screenHeight; - self.mainWindow:UpdateSettings(); + _G.travel:UpdateSettings(); hasMoved = false; self:SetBackColor(Turbine.UI.Color(0, 0.5, 0.5, 0.5)); else - if not self.mainWindow:IsVisible() then - self.mainWindow:CheckSkills(false); - self.mainWindow:SetOpacity(Settings.mainMinOpacity); + if not _G.travel:IsVisible() then + CheckSkills(false); + _G.travel:SetOpacity(Settings.mainMinOpacity); end - self.mainWindow:SetVisible(not self.mainWindow:IsVisible()); + _G.travel:SetVisible(not _G.travel:IsVisible()); + _G.travel:Activate(); end else Menu:ShowMenu(); diff --git a/src/TravelCaroTab.lua b/src/TravelCaroTab.lua index d06b2ea..98d446f 100644 --- a/src/TravelCaroTab.lua +++ b/src/TravelCaroTab.lua @@ -24,6 +24,12 @@ function TravelCaroTab:Constructor(toplevel) -- need top level window in order to close it self.parent = toplevel; + if self.parent.isMinWindow then + self.wPadding = 4; + else + self.wPadding = 0; + end + -- this label is used to catch wheel moves self.scrollLabel = Turbine.UI.Label(); self.scrollLabel:SetSize(180, 155); @@ -35,9 +41,6 @@ function TravelCaroTab:Constructor(toplevel) --[[ EVENT HANDLERS ]] -- - -- make sure we listen for key presses - self:SetWantsUpdates(true); - -- check for a right mouse button event to open menu self.MouseClick = function(sender, args) if (args.Button == Turbine.UI.MouseButton.Right) then @@ -205,27 +208,33 @@ end function TravelCaroTab:SetSize(width, height) Turbine.UI.Control.SetSize(self, width, height); + local offset = 40; -- adjust the size and location of the 5 quickslots self.quickslots[1]:SetStretchMode(1); self.quickslots[1]:SetSize(22, 22); - self.quickslots[1]:SetPosition(self:GetWidth() / 2 - 67, (self:GetHeight() - 20) / 2); + self.quickslots[1]:SetPosition(self:GetWidth() / 2 - 71 + self.wPadding, (self:GetHeight() - offset) / 2); self.quickslots[2]:SetStretchMode(1); self.quickslots[2]:SetSize(28, 28); - self.quickslots[2]:SetPosition(self:GetWidth() / 2 - 45, (self:GetHeight() - 20) / 2 + 3); + self.quickslots[2]:SetPosition(self:GetWidth() / 2 - 49 + self.wPadding, (self:GetHeight() - offset) / 2 + 3); - self.quickslots[3]:SetStretchMode(1); -- makes fuzzy but keeps lack of opacity consistent with other icons showing self.quickslots[3]:SetSize(36, 36); - self.quickslots[3]:SetPosition(self:GetWidth() / 2 - 18, (self:GetHeight() - 20) / 2 + 5); + self.quickslots[3]:SetPosition(self:GetWidth() / 2 - 22 + self.wPadding, (self:GetHeight() - offset) / 2 + 5); self.quickslots[4]:SetStretchMode(1); self.quickslots[4]:SetSize(28, 28); - self.quickslots[4]:SetPosition(self:GetWidth() / 2 + 17, (self:GetHeight() - 20) / 2 + 3); + self.quickslots[4]:SetPosition(self:GetWidth() / 2 + 13 + self.wPadding, (self:GetHeight() - offset) / 2 + 3); self.quickslots[5]:SetStretchMode(1); self.quickslots[5]:SetSize(22, 22); - self.quickslots[5]:SetPosition(self:GetWidth() / 2 + 45, (self:GetHeight() - 20) / 2); + self.quickslots[5]:SetPosition(self:GetWidth() / 2 + 40 + self.wPadding, (self:GetHeight() - offset) / 2); +end - Turbine.UI.Control.SetOpacity(self, 1); +function TravelCaroTab:SetOpacityItems(value) + -- quickslots in stretch mode do not get updated opacity from + -- the parent; update them here + for i = 1, #self.quickslots do + self.quickslots[i]:SetOpacity(value); + end end diff --git a/src/TravelDictionary.lua b/src/TravelDictionary.lua new file mode 100644 index 0000000..9bc05f9 --- /dev/null +++ b/src/TravelDictionary.lua @@ -0,0 +1,40 @@ +TravelDictionary = class() + +function TravelDictionary:Constructor() + -- create the indexed tables that store all the data + self.gen = IndexedDictionary(self); + self.rep = IndexedDictionary(self); + self.hunter = IndexedDictionary(self); + self.warden = IndexedDictionary(self); + self.mariner = IndexedDictionary(self); + + self.allRaces = IndexedDictionary(self); + self.racial = {} + if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then + self.creep = IndexedDictionary(self); + end + + self.skillCount = 0; + + self:CreateDictionaries(); + self.racial.id = self.allRaces:IdAtIndex(PlayerRaceKey); + self.racial.name = self.allRaces:NameAtIndex(PlayerRaceKey); + self.racial.desc = self.allRaces:DescAtIndex(PlayerRaceKey); + self.racial.label = self.allRaces:LabelAtIndex(PlayerRaceKey); +end + +-- function to return the count of a specific type of travel +function TravelDictionary:GetCount() + return self.skillCount; +end + +function TravelDictionary:GetClassSkills() + if PlayerClass == Turbine.Gameplay.Class.Hunter then + return TravelInfo.hunter; + elseif PlayerClass == Turbine.Gameplay.Class.Warden then + return TravelInfo.warden; + elseif PlayerClass == Turbine.Gameplay.Class.Mariner then + return TravelInfo.mariner; + end + return nil; +end diff --git a/src/TravelGridTab.lua b/src/TravelGridTab.lua index e5314b2..22f3ee1 100644 --- a/src/TravelGridTab.lua +++ b/src/TravelGridTab.lua @@ -20,12 +20,19 @@ function TravelGridTab:Constructor(toplevel) self.quickslots = {}; self.selected = {}; self.numOfCols = 0; + self.numOfRows = 0; self.maxScroll = 0; + self.colWidth = 35; + self.scrollChunk = self.colWidth; + self.minCols = 5; if self.parent == nil then -- need top level window in order to close it self.parent = toplevel; end + if self.parent.isMinWindow then + self.minCols = 4; + end -- a subwindow (now a control) for containing all the quickslots self.SubWindow = Turbine.UI.Control(); @@ -37,6 +44,8 @@ function TravelGridTab:Constructor(toplevel) self.myScrollBar = Turbine.UI.Lotro.ScrollBar(); self.myScrollBar:SetOrientation(Turbine.UI.Orientation.Vertical); self.myScrollBar:SetMinimum(0); + self.myScrollBar:SetLargeChange(self.scrollChunk); + self.myScrollBar:SetSmallChange(self.scrollChunk); self.myScrollBar:SetVisible(false); self.myScrollBar.MouseClick = function(sender, args) @@ -75,9 +84,6 @@ function TravelGridTab:Constructor(toplevel) --[[ EVENT HANDLERS ]] -- - -- make sure we check for updates - self:SetWantsUpdates(true); - -- check for a right mouse button event to open menu self.MouseClick = function(sender, args) if (args.Button == Turbine.UI.MouseButton.Right) then @@ -88,9 +94,8 @@ end -- function to handle mouse scrollwheel events function TravelGridTab:DoScroll(sender, args) - -- calculate how far to move the scrollbar - local newValue = self.myScrollBar:GetValue() - args.Direction * 20; + local newValue = self.myScrollBar:GetValue() - args.Direction * self.scrollChunk; -- make sure the value does not go below zero if newValue < 0 then @@ -112,7 +117,7 @@ function TravelGridTab:UpdateSubWindow() -- set the top position of the quickslots based on row -- number and the value of the scrollbar - self.quickslots[i]:SetTop((row - 1) * 38 - self.myScrollBar:GetValue()); + self.quickslots[i]:SetTop((row - 1) * self.colWidth - self.myScrollBar:GetValue()); end end @@ -125,10 +130,7 @@ function TravelGridTab:SetItems() if not(self.parent.dirty) then local prevNumOfCols = self.numOfCols; - self:UpdateBounds(#self.selected); - if self.parent.MainPanel.selectedPage == 2 and self.numOfCols ~= prevNumOfCols then - self.parent.dirty = true; - end + self:UpdateBounds(); end self.row = 1; @@ -146,19 +148,17 @@ function TravelGridTab:SetItems() if shortcut.found and shortcut:IsEnabled() then -- apply skill type filter if set in options if hasbit(Settings.filters, bit(shortcut:GetTravelType())) then - self.selected[#self.selected + 1] = shortcut; + table.insert(self.selected, shortcut); end end end -- update controls - self:UpdateBounds(#self.selected); + self:UpdateBounds(); self.SubWindow:SetSize(self:GetWidth(), self:GetHeight()); self.myScrollBar:SetParent(self.SubWindow); - self.myScrollBar:SetSize(10, self:GetHeight()); + self.myScrollBar:SetSize(10, self:GetHeight() - 10); self.myScrollBar:SetPosition(self:GetWidth() - 10, 0); - self.myScrollBar:SetSmallChange(24); - self.myScrollBar:SetLargeChange(24); self.myScrollBar:SetMaximum(self.maxScroll); self.myScrollBar:SetVisible(self.maxScroll > 0); self.myLabel:SetParent(self.SubWindow); @@ -168,10 +168,8 @@ function TravelGridTab:SetItems() self.quickslots = {}; else self.SubWindow:SetSize(self:GetWidth(), self:GetHeight()); - self.myScrollBar:SetSize(10, self:GetHeight()); + self.myScrollBar:SetSize(10, self:GetHeight() - 10); self.myScrollBar:SetPosition(self:GetWidth() - 10, 0); - self.myScrollBar:SetSmallChange(24); - self.myScrollBar:SetLargeChange(24); self.myScrollBar:SetMaximum(self.maxScroll); self.myScrollBar:SetVisible(self.maxScroll > 0); self.myLabel:SetSize(self:GetWidth() - 10, self:GetHeight()); @@ -190,16 +188,16 @@ function TravelGridTab:AddItem(shortcut, margin) local index = (self.row - 1) * self.numOfCols + self.col; + local x = margin + ((self.col - 1) * self.colWidth) - 1; + local y = ((self.row - 1) * self.colWidth - self.myScrollBar:GetValue()) - 1; if not(self.parent.dirty) then - self.quickslots[index]:SetPosition(margin + ((self.col - 1) * 38), - ((self.row - 1) * 38 - self.myScrollBar:GetValue())); + self.quickslots[index]:SetPosition(x, y); else -- create new quickslots setting the position -- based on the row and column locations self.quickslots[index] = Turbine.UI.Lotro.Quickslot(); self.quickslots[index]:SetSize(36, 36); - self.quickslots[index]:SetPosition(margin + ((self.col - 1) * 38), - ((self.row - 1) * 38 - self.myScrollBar:GetValue())); + self.quickslots[index]:SetPosition(x, y); self.quickslots[index]:SetZOrder(90); self.quickslots[index]:SetUseOnRightClick(false); self.quickslots[index]:SetParent(self.SubWindow); @@ -241,23 +239,75 @@ function TravelGridTab:AddItem(shortcut, margin) end end -function TravelGridTab:UpdateBounds(numOfShortcuts) - -- calculate number of columns - local padding = 4; - local marginOffset = 1; - self.numOfCols = math.floor((self:GetWidth() - padding) / 38); - local numOfRows = math.ceil(numOfShortcuts / self.numOfCols); +function TravelGridTab:GetPixelSize() + local width = self.numOfCols * self.colWidth + self.parent.wPadding + 10; + local height = self.numOfRows * self.colWidth + self.parent.hPadding; + return width, height; +end + +function TravelGridTab:FitToPixels(width, height) + local wPadding = self.parent.wPadding; + local hPadding = self.parent.hPadding; + local cols, rows, maxScroll = self:GetGridDims(width - wPadding, height - hPadding); + if not self.parent.isMinWindow or maxScroll > 0 then + wPadding = wPadding + 10; + end + self.numOfCols = cols; + self.numOfRows = rows; + local sX = cols * self.colWidth + wPadding; + local sY = rows * self.colWidth + hPadding; + return sX, sY; +end + +function TravelGridTab:GetGridDims(width, height) + if width < self.minCols * self.colWidth then width = self.minCols * self.colWidth end + if height < self.colWidth then height = self.colWidth end + + local scrollPadding = 0; + if not self.parent.isMinWindow then + scrollPadding = 10; + end + local numOfShortcuts = #self.selected; + local numOfCols = math.floor((width - scrollPadding) / self.colWidth); + local numOfRows = math.ceil(numOfShortcuts / numOfCols); -- set the maximum scroll of the scrollbar - self.maxScroll = numOfRows * 38 - self:GetHeight(); - if self.maxScroll < 1 then - self.maxScroll = 0; - else + local maxScroll = numOfRows * self.colWidth - height; + if maxScroll < 0 then + maxScroll = 0; + elseif self.parent.isMinWindow and maxScroll > 0 then -- include scrollbar width - self.numOfCols = math.floor((self:GetWidth() - padding - 10) / 38); - numOfRows = math.ceil(numOfShortcuts / self.numOfCols); - self.maxScroll = numOfRows * 38 - self:GetHeight(); + scrollPadding = 10; + numOfCols = math.floor((width - scrollPadding) / self.colWidth); + numOfRows = math.ceil(numOfShortcuts / numOfCols); + maxScroll = numOfRows * self.colWidth - height; + end + + -- set min/max bounds + if maxScroll < 0 then + maxScroll = 0; + elseif maxScroll > 0 then + numOfRows = math.floor(height / self.colWidth); + end + if numOfRows < 1 then + numOfRows = 1; end + if numOfCols > #self.selected then + numOfCols = #self.selected + end + if numOfCols < self.minCols then + numOfCols = self.minCols; + end + return numOfCols, numOfRows, maxScroll; +end + +function TravelGridTab:UpdateBounds() + local width = self.parent:GetWidth() - self.parent.wPadding; + local height = self.parent:GetHeight() - self.parent.hPadding; + local c, r, m = self:GetGridDims(width, height); + self.numOfCols = c; + self.numOfRows = r; + self.maxScroll = m; end function TravelGridTab:GetMargin(numOfShortcuts) @@ -267,13 +317,10 @@ function TravelGridTab:GetMargin(numOfShortcuts) cols = numOfShortcuts; end local width = self:GetWidth(); - local marginOffset = 1; - if self.maxScroll < 1 then - marginOffset = 0; - else - width = width - 12; -- remove width of scrollbar + if not self.parent.isMinWindow or self.maxScroll > 0 then + width = width - 10; -- remove width of scrollbar end - return math.floor((width - cols * 38) / 2.0) - marginOffset; + return math.floor((width - cols * self.colWidth) / 2.0); end -- function to adjust the size of the tab and all items in the tab diff --git a/src/TravelListTab.lua b/src/TravelListTab.lua index 9157c1f..80e64ef 100644 --- a/src/TravelListTab.lua +++ b/src/TravelListTab.lua @@ -22,6 +22,12 @@ function TravelListTab:Constructor(toplevel) TravelGridTab.Constructor(self); self.itemHeight = 22; + self.scrollChunk = self.itemHeight; + + self.itemAlpha = DefAlpha; + if self.parent.isMinWindow then + self.itemAlpha = 1; + end -- set up the scrollbar for the list self.myScrollBar = Turbine.UI.Lotro.ScrollBar(); @@ -87,7 +93,7 @@ function TravelListTab:AddItem(shortcut) self.labels[index]:SetZOrder(100); self.labels[index]:SetMouseVisible(false); self.labels[index]:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); - self.labels[index]:SetBackColor(Turbine.UI.Color(DefAlpha, 0, 0, 0)); + self.labels[index]:SetBackColor(Turbine.UI.Color(self.itemAlpha, 0, 0, 0)); self.labels[index]:SetText(shortcut:GetSkillLabel()); self.labels[index]:SetParent(self.SubWindow); @@ -114,12 +120,12 @@ function TravelListTab:AddItem(shortcut) -- change the background colour of the label with the mouse enters self.quickslots[index].MouseEnter = function(sender, args) - self.labels[index]:SetBackColor(Turbine.UI.Color(DefAlpha, 0.17, 0.17, 0.17)); + self.labels[index]:SetBackColor(Turbine.UI.Color(self.itemAlpha, 0.17, 0.17, 0.17)); end -- return the background colour when the mouse leaves the label self.quickslots[index].MouseLeave = function(sender, args) - self.labels[index]:SetBackColor(Turbine.UI.Color(DefAlpha, 0, 0, 0)); + self.labels[index]:SetBackColor(Turbine.UI.Color(self.itemAlpha, 0, 0, 0)); end end @@ -127,14 +133,45 @@ function TravelListTab:AddItem(shortcut) self.row = self.row + 1; end -function TravelListTab:UpdateBounds(numOfShortcuts) +function TravelListTab:GetPixelSize() + local height = self.numOfRows * self.itemHeight + self.parent.hPadding; + return self.pixelWidth, height; +end + +function TravelListTab:FitToPixels(width, height) + local rowHeight = self.itemHeight; + local minHeight = self.parent.hPadding + rowHeight * 6; + local maxHeight = self.parent.hPadding + rowHeight * #self.selected; + height = height - self.parent.hPadding; + local dy = height % rowHeight; + if dy < rowHeight / 2 then + height = height - dy; + else + height = height + (rowHeight - dy); + end + if height < minHeight then + height = minHeight; + elseif height > maxHeight then + height = maxHeight; + end + self.pixelWidth = width; + self.numOfRows = math.floor(height / rowHeight); + return width, height; +end + +function TravelListTab:UpdateBounds() -- set the maximum value of the scrollbar -- based on the number of rows in the subwindow - self.maxScroll = numOfShortcuts * 22 - self:GetHeight(); + local numOfShortcuts = #self.selected; + self.maxScroll = numOfShortcuts * self.itemHeight - self.parent:GetHeight(); if self.maxScroll < 0 then -- the maxScroll cannot be less than one self.maxScroll = 0; + self.numOfRows = #self.selected; + elseif self.maxScroll > 0 then + self.numOfRows = math.floor(self.parent:GetHeight() / self.itemHeight); end + self.pixelWidth = self.parent:GetWidth(); end function TravelListTab:GetMargin(numOfShortcuts) @@ -147,8 +184,8 @@ function TravelListTab:UpdateSubWindow() -- set the top position of the quickslots based on row -- number and the value of the scrollbar - self.quickslots[i]:SetTop((i - 1) * 22 - self.myScrollBar:GetValue()); - self.labels[i]:SetTop((i - 1) * 22 - self.myScrollBar:GetValue()); + self.quickslots[i]:SetTop((i - 1) * self.itemHeight - self.myScrollBar:GetValue()); + self.labels[i]:SetTop((i - 1) * self.itemHeight - self.myScrollBar:GetValue()); end end @@ -159,6 +196,4 @@ function TravelListTab:SetSize(width, height) Turbine.UI.Control.SetSize(self, width, height); self:SetItems(); - - Turbine.UI.Control.SetOpacity(self, 1); end diff --git a/src/TravelPulldownTab.lua b/src/TravelPulldownTab.lua index 5194095..4d573c0 100644 --- a/src/TravelPulldownTab.lua +++ b/src/TravelPulldownTab.lua @@ -20,23 +20,29 @@ function TravelPulldownTab:Constructor(toplevel) -- need top level window in order to close it self.parent = toplevel; + if self.parent.isMinWindow then + self.wPadding = 3; + else + self.wPadding = 0; + end + + self.travelOnSelect = 0; + -- this label is used to catch wheel moves self.scrollLabel = Turbine.UI.Label(); - self.scrollLabel:SetSize(180, 155); self.scrollLabel:SetPosition(0, 0); self.scrollLabel:SetParent(self); -- the pulldown box - self.pulldown = TravelWindowII.src.OrendarUIMods.ComboBox(self); - self.pulldown:SetPosition(10, 20); - self.pulldown:SetSize(self:GetWidth() - 20, 30); + self.pulldown = TravelWindowII.src.OrendarUIMods.ComboBox(toplevel); + self.pulldown:SetPosition(43 + self.wPadding, 5); self.pulldown:SetParent(self); self.pulldown:SetVisible(true); - self.pulldown:SetTravelOnSelect(Settings.pulldownTravel); -- the quickslot for the shortcut self.quickslot = Turbine.UI.Lotro.Quickslot(); self.quickslot:SetSize(36, 36); + self.quickslot:SetPosition(self.wPadding, 1); self.quickslot:SetZOrder(98); self.quickslot:SetUseOnRightClick(false); self.quickslot:SetParent(self); @@ -44,9 +50,6 @@ function TravelPulldownTab:Constructor(toplevel) --[[ EVENT HANDLERS ]] -- - -- make sure we listen for key presses - self:SetWantsUpdates(true); - -- check for a right mouse button event to open menu self.MouseClick = function(sender, args) if (args.Button == Turbine.UI.MouseButton.Right) then @@ -105,26 +108,33 @@ end function TravelPulldownTab:SetItems() - if self.tabId ~= self.parent.MainPanel.selectedPage or not(self.parent.dirty) then + if self.tabId ~= self.parent.MainPanel.selectedPage then return end + -- refresh items if dirty or pulldownTravel option changed + -- pulldownTravel requires hidden quickslots to be added + if Settings.pulldownTravel == self.travelOnSelect and not(self.parent.dirty) then + return + end + + self.travelOnSelect = Settings.pulldownTravel; self.pulldown:ClearItems(); -- add the shortcuts to the combo box - local shortcutIndex = 1; for i = 1, #TravelShortcuts, 1 do if TravelShortcuts[i].found and TravelShortcuts[i]:IsEnabled() then if (hasbit(Settings.filters, bit(TravelShortcuts[i]:GetTravelType()))) then - self.pulldown:AddItem(TravelShortcuts[i], shortcutIndex, i); - shortcutIndex = shortcutIndex + 1; + self.pulldown:AddItem(TravelShortcuts[i], i); end end end - if #self.pulldown.quickslots > 0 then + if #self.pulldown.labels > 0 then self.pulldown:ItemSelected(1); self.pulldown:FireEvent(); + else + self.quickslot:SetShortcut(nil); end end @@ -135,12 +145,13 @@ function TravelPulldownTab:SetSize(width, height) Turbine.UI.Control.SetSize(self, width, height); -- set the size of the labels - self.pulldown:SetSize(self:GetWidth() - 20, 30); self.scrollLabel:SetSize(self:GetWidth(), self:GetHeight()); - -- center the quickslot - self.quickslot:SetPosition(self:GetWidth() / 2.0 - 18, 55); + self.pulldown:SetSize(self:GetWidth() - 58 + self.wPadding * 2, 30); +end - Turbine.UI.Control.SetOpacity(self, 1); +function TravelPulldownTab:SetOpacity(value) + Turbine.UI.Control.SetOpacity(self, value); + self.pulldown.dropDownWindow:SetOpacity(value); end -- function to close the pulldown if necessary diff --git a/src/TravelShortcut.lua b/src/TravelShortcut.lua index 23ced10..653fd7a 100644 --- a/src/TravelShortcut.lua +++ b/src/TravelShortcut.lua @@ -3,15 +3,15 @@ --[[ and enabled status ]] -- TravelShortcut = class(Turbine.UI.Lotro.Shortcut); -function TravelShortcut:Constructor(sType, data, name, tType, index, enabled, skillLabel, desc) +function TravelShortcut:Constructor(sType, tType, data, name, skillLabel, desc) Turbine.UI.Lotro.Shortcut.Constructor(self); -- the data to keep track of self.Name = name; self.desc = desc; self.travelType = tType; - self.Index = index; - self.Enabled = enabled; + self.Index = TableIndex(Settings.order, data); + self.Enabled = Settings.enabled[data]; self.skillLabel = skillLabel; self.found = false; @@ -84,3 +84,134 @@ function TravelShortcut:GetTravelType() return self.travelType; end +function InitShortcuts() + -- set default values + TravelShortcuts = {}; + + -- set the either the travel skills for free people or monsters + if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then + -- set the generic travel items + AddTravelSkills(TravelInfo.gen, 1); + + -- add the race travel to the list + table.insert(TravelShortcuts, + TravelShortcut( + Turbine.UI.Lotro.ShortcutType.Skill, + 2, + TravelInfo.racial.id, + TravelInfo.racial.name, + TravelInfo.racial.label, + TravelInfo.racial.desc)); + + -- set the reputation travel items + AddTravelSkills(TravelInfo.rep, 3); + else + -- set the creep travel items + AddTravelSkills(TravelInfo.creep, 3); + end + + -- set the class travel items + local classSkills = TravelInfo:GetClassSkills(); + if classSkills ~= nil then + AddTravelSkills(classSkills, 4); + end + + SortShortcuts(); + CheckSkills(false); +end + +function AddTravelSkills(skills, filter) + for i = 1, skills:GetCount() do + table.insert(TravelShortcuts, + TravelShortcut( + Turbine.UI.Lotro.ShortcutType.Skill, + filter, + skills:IdAtIndex(i), + skills:NameAtIndex(i), + skills:LabelAtIndex(i), + skills:DescAtIndex(i))); + end +end + +function SortFromSettings() + for i = 1, #TravelShortcuts do + local id = TravelShortcuts[i]:GetData(); + TravelShortcuts[i].Index = TableIndex(Settings.order, id); + end + SortShortcuts(); +end + +-- TravelShortcuts are sorted by an internal index value +function SortShortcuts() + -- perform an optimized bubble sort + local n = #TravelShortcuts; + while n > 2 do + local new_n = 1; + for i = 2, n do + if TravelShortcuts[i - 1]:GetIndex() > TravelShortcuts[i]:GetIndex() then + local temp = TravelShortcuts[i - 1]; + TravelShortcuts[i - 1] = TravelShortcuts[i]; + TravelShortcuts[i] = temp; + new_n = i; + end + end + n = new_n; + end +end + +function CheckSkills(report) + local newShortcut = false; + -- loop through all the shortcuts and list those those that are not learned + for i = 1, #TravelShortcuts, 1 do + local wasFound = TravelShortcuts[i].found; + if (FindSkill(TravelShortcuts[i])) then + if not wasFound then + newShortcut = true; + end + elseif report then + Turbine.Shell.WriteLine(skillNotTrainedString .. TravelShortcuts[i]:GetName()) + end + end + + if newShortcut and NewShortcutEvent then + NewShortcutEvent(); + end +end + +function FindSkill(shortcut) + if shortcut.found then + return true; + end + + for i = 1, TrainedSkills:GetCount(), 1 do + local skillInfo = TrainedSkills:GetItem(i):GetSkillInfo(); + if skillInfo:GetName() == shortcut:GetName() then + local desc = shortcut:GetDescription(); + if desc ~= nil then + if string.find(skillInfo:GetDescription(), desc, 1, true) ~= nil then + shortcut.found = true; + return true; + end + else + shortcut.found = true; + return true; + end + end + end + + return false; +end + +function ListTrainedSkills() + + Turbine.Shell.WriteLine("\n\nTrained Skills\n\n"); + + for i = 1, TrainedSkills:GetCount(), 1 do + local skill = Turbine.Gameplay.Skill; + local skillInfo = Turbine.Gameplay.SkillInfo; + skill = TrainedSkills:GetItem(i); + + Turbine.Shell.WriteLine(skill:GetSkillInfo():GetName()); + + end +end diff --git a/src/TravelWindow.lua b/src/TravelWindow.lua index d308a05..6ec4f09 100644 --- a/src/TravelWindow.lua +++ b/src/TravelWindow.lua @@ -14,85 +14,58 @@ import "TravelWindowII.src.EuroNormalize"; --[[ creating the lists of travel shortcuts, creates ]] -- --[[ and handles the context menu. ]] -- -TravelWindow = class(Turbine.UI.Lotro.Window); +TravelWindow = class(Turbine.UI.Window); -function TravelWindow:Constructor() - Turbine.UI.Lotro.Window.Constructor(self); - - DefAlpha = 0.92; - Settings = {}; - SettingsStrings = {}; - TravelShortcuts = {}; -- put all the shortcuts into one table - TrainedSkills = Turbine.Gameplay.SkillList; -- TODO: update list on window open or maybe a timer +function TravelWindow:Constructor(useMinWindow) + if useMinWindow == 1 then + Turbine.UI.Window.Constructor(self); + else + Turbine.UI.Lotro.Window.Constructor(self); + end self.reloadGVMap = false; - self.options = nil; self.dirty = true; self.isMouseDown = false; + self.isDragging = false; self.isResizing = false; - - -- create the lists of travel locations and the shortcuts - -- that are used to execute them - TravelInfo = TravelDictionaries(); - - -- load the player saved settings - self:LoadSettings(); + self.isMinWindow = useMinWindow == 1; + if self.isMinWindow then + self.wPos = -1; + self.hPos = 20; + self.wPadding = -1; + self.hPadding = 20; + self.resizeLabelSize = 13; + self.backColor = Turbine.UI.Color(1, 0, 0, 0); + else + self.wPos = 15; + self.hPos = 40; + self.wPadding = 20; + self.hPadding = 60; + self.resizeLabelSize = 20; + end -- configure the main window self:SetPosition(Settings.positionX, Settings.positionY); - self:SetSize(Settings.width, Settings.height); self:SetText(mainTitleString); - self:SetOpacity(Settings.mainMinOpacity); - self:SetResizable(true); + self:SetBackColor(self.backColor); if (Settings.hideOnStart == 1) then self:SetVisible(false); else self:SetVisible(true); end - -- configure the external toggle button - self.ToggleButton = TravelWindowII.src.TravelButton(self); - - -- if the player has a PvMP map, then insert it into the list - -- if ((.mapGlanVraig ~= nil) and (.mapGlanVraig ~= "nil")) then - -- self.reloadGVMap = true; - -- genLocations:InsertSkill(2, glanMapString, .mapGlanVraig, "skip"); - -- end - - -- redo the counts - TravelInfo:GetCounts(); - - -- get the player class and race - player = Turbine.Gameplay.LocalPlayer.GetInstance(); - PlayerClass = player:GetClass(); - PlayerAlignment = player:GetAlignment(); - PlayerRace = player:GetRace(); - - -- set the racial index used later in multiple places - self:SetPlayerRaceKey(); - - -- get the list of trained skills the player has - if (Turbine.Gameplay.LocalPlayer.GetTrainedSkills ~= nil) then - TrainedSkills = player:GetTrainedSkills(); - end - -- save the player's combat states for managing hiding the window -- when the player enters combat self.previousCombatState = false; self.wasOpenBeforeCombat = false; - -- set up all the shortcuts - self:CheckEnabledSettings(); - self:SetShortcuts(); - -- create a single context menu to use on all panels Menu = SettingsMenu(self); Menu:SetSettings(Settings.mode, Settings.filters); -- create the tabbed panel to hold all the other panels self.MainPanel = TravelWindowII.src.extensions.DPanel(); - self.MainPanel:SetSize(Settings.width - 20, Settings.height - 60); - self.MainPanel:SetPosition(10, 40); + self.MainPanel:SetPosition(self.wPos, self.hPos); self.MainPanel:SetButtonsVisible(false) -- make sure to hide the tab buttons self.MainPanel:SetParent(self); @@ -111,43 +84,37 @@ function TravelWindow:Constructor() self.GridTab.tabId = 2; self.CaroTab.tabId = 3; self.PullTab.tabId = 4; + self.GridTab.numOfCols = Settings.gridCols; + self.GridTab.numOfRows = Settings.gridRows; + self.ListTab.pixelWidth = Settings.listWidth; + self.ListTab.numOfRows = Settings.listRows; - -- display the tab that was last selected self.MainPanel:SetTab(Settings.mode); - self.MainPanel:SetSize(self:GetWidth() - 20, self:GetHeight() - 60); - self.MainPanel:UpdateTabs(); - self:CheckSkills(false); - self:UpdateSettings(); + self:SetItems(); + self:UpdateMinimum(); + self:SetOpacity(Settings.mainMinOpacity); -- track the hidden state of the UI, manage previous states for window and -- the button self.hidden = false; self.currentVisState = self:IsVisible(); - self.optionsWindow = TravelWindowII.src.OptionsWindow(self); - - local PluginManagerOptionsPanel = Turbine.UI.Control() - PluginManagerOptionsPanel:SetSize(500, 200) - - local OptionsButton = Turbine.UI.Lotro.Button() - OptionsButton:SetParent(PluginManagerOptionsPanel) - OptionsButton:SetPosition(100, 100) - OptionsButton:SetSize(200,15) - OptionsButton:SetText(menuOptionsString) - OptionsButton:SetVisible(true) - - OptionsButton.Click = function() - self.optionsWindow:SetVisible(true); - end + self.titleLabel = Turbine.UI.Label(); + self.titleLabel:SetParent(self); + self.titleLabel:SetVisible(self.isMinWindow); + self.titleLabel:SetPosition(0, 0); + self.titleLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleCenter); + self.titleLabel:SetFont(Turbine.UI.Lotro.Font.TrajanPro15); + self.titleLabel:SetText("Travel Window II"); - plugin.GetOptionsPanel = function(self) - return PluginManagerOptionsPanel; - end + self.resizeLabel = Turbine.UI.Label(); + self.resizeLabel:SetParent(self); + self.resizeLabel:SetSize(self.resizeLabelSize, self.resizeLabelSize); + self.resizeLabel:SetOpacity(0); + self.resizeLabel:SetZOrder(100); -- put above the shortcuts; which are set to 90 --[[ Event Handlers ]] -- - -- make sure we listen for updates - self:SetWantsUpdates(true); self:SetWantsKeyEvents(true); -- check if our position has changed, and save the settings if so @@ -161,34 +128,34 @@ function TravelWindow:Constructor() -- manage hiding the UI self.KeyDown = function(sender, args) if (args.Action == Turbine.UI.Lotro.Action.Escape) then - self:SetVisible(false); - self.optionsWindow:SetVisible(false); - self:CloseOptions(); + if Settings.ignoreEsc == 0 then + self:SetVisible(false); + end + OptionsWindow:SetVisible(false); self:CloseMapWindow(); if (self.hidden == true) then self.hidden = false; self:SetVisible(self.currentVisState); - self.ToggleButton:SetVisible(Settings.showButton == 1); + ToggleButton:SetVisible(Settings.showButton == 1); end elseif (args.Action == Turbine.UI.Lotro.Action.UI_Toggle) then if (self.hidden == false) then self.currentVisState = self:IsVisible(); self.hidden = true; self:SetVisible(false); - self.optionsWindow:SetVisible(false); - self.ToggleButton:SetVisible(false); + OptionsWindow:SetVisible(false); + ToggleButton:SetVisible(false); if self.mapWindow ~= nil then self.mapWindow:SetVisible(false); end else self.hidden = false; self:SetVisible(self.currentVisState); - self.ToggleButton:SetVisible(Settings.showButton == 1); + ToggleButton:SetVisible(Settings.showButton == 1); if self.mapWindow ~= nil then self.mapWindow:SetVisible(true); end end - else end end @@ -228,6 +195,17 @@ function TravelWindow:Constructor() end AddCallback(player, "InCombatChanged", IncombatChangedHandler); + self.Update = function(sender, args) + -- handle opacity fade out + local stepSize = (Settings.mainMaxOpacity - Settings.mainMinOpacity) / Settings.fadeOutSteps; + local opacity = self:GetOpacity() - stepSize; + if opacity < Settings.mainMinOpacity then + opacity = Settings.mainMinOpacity + self:SetWantsUpdates(false); + end + self:SetOpacity(opacity); + end + -- if the visible status of the window changes, close the pulldown tab self.VisibleChanged = function(sender, args) if (self:IsVisible() == false) then @@ -247,460 +225,158 @@ function TravelWindow:Constructor() -- go to full opacity if mouse is over self.MouseEnter = function(sender, args) - self:SetOpacity(Settings.mainMaxOpacity); + self:SetMaxOpacity(); end -- go to low opacity when mouse is not over self.MouseLeave = function(sender, args) - local mX, mY = self:GetMousePosition(); - local winX, winY = self:GetSize(); - if not self.isMouseDown then - self:SetOpacity(Settings.mainMinOpacity); + self:FadeOut(); end end + self.PullTab.pulldown.dropDownWindow.MouseEnter = self.MouseEnter; + self.PullTab.pulldown.dropDownWindow.MouseLeave = self.MouseLeave; self.MouseDown = function(sender, args) self.isMouseDown = true; - end + if (args.Button == Turbine.UI.MouseButton.Left) then + self.dragStartX, self.dragStartY = self:GetMousePosition(); + if Settings.mode == 1 or Settings.mode == 2 then + local mX, mY = self:GetMousePosition(); + self.resizeStartX, self.resizeStartY = self:GetSize(); + if self.resizeStartX - mX < self.resizeLabelSize + 1 and + self.resizeStartY - mY < self.resizeLabelSize + 1 then + self.isResizing = true; + end + end + if not self.isResizing then + self.isDragging = true; + end + end + end + self.MouseMove = function(sender, args) + if self.isDragging then + local left, top = self:GetPosition(); + local mX, mY = self:GetMousePosition(); + local x = left + (mX - self.dragStartX); + local y = top + (mY - self.dragStartY); + self:SetPosition(x, y); + elseif self.isResizing then + local sX, sY = self:GetSize(); + local mX, mY = self:GetMousePosition(); + sX = self.resizeStartX + (mX - self.dragStartX); + sY = self.resizeStartY + (mY - self.dragStartY); + if Settings.mode == 1 then + sX, sY = self.ListTab:FitToPixels(sX, sY); + elseif Settings.mode == 2 then + sX, sY = self.GridTab:FitToPixels(sX, sY); + end + self:SetSize(sX, sY); + end + end self.MouseUp = function(sender, args) local mX, mY = self:GetMousePosition(); local winX, winY = self:GetSize(); local outsideWindow = mX < 1 or mY < 1 or mX > winX - 1 or mY > winY - 1; - if outsideWindow then - self:SetOpacity(Settings.mainMinOpacity); + self:FadeOut(); end self.isMouseDown = false; + self.isDragging = false; self.isResizing = false; end + self.titleLabel.MouseDown = self.MouseDown; + self.titleLabel.MouseMove = self.MouseMove; + self.titleLabel.MouseUp = self.MouseUp; + self.titleLabel.MouseClick = self.MouseClick; + self.resizeLabel.MouseDown = self.MouseDown; + self.resizeLabel.MouseMove = self.MouseMove; + self.resizeLabel.MouseUp = self.MouseUp; + self.resizeLabel.MouseClick = self.MouseClick; self.SizeChanged = function(sender, args) - if self.isMouseDown then - self.isResizing = true; - end - if Settings.mode == 1 or Settings.mode == 2 then - -- only save dimensions for list & grid tabs - Settings.width = self:GetWidth(); - Settings.height = self:GetHeight(); - end - self.MainPanel:SetSize(self:GetWidth() - 20, self:GetHeight() - 60); + if Settings.mode == 1 then + Settings.listWidth = self.ListTab.pixelWidth; + Settings.listRows = self.ListTab.numOfRows; + elseif Settings.mode == 2 then + Settings.gridCols = self.GridTab.numOfCols; + Settings.gridRows = self.GridTab.numOfRows; + end + self.MainPanel:SetSize(self:GetWidth() - self.wPadding, self:GetHeight() - self.hPadding); self.MainPanel:UpdateTabs(); + self.titleLabel:SetSize(self:GetWidth(), 20); + self.resizeLabel:SetPosition(self:GetWidth() - self.resizeLabel:GetWidth(), + self:GetHeight() - self.resizeLabel:GetHeight()); end - - Plugins["Travel Window II"].Load = function(sender, args) - Turbine.Shell.WriteLine("Travel Window II " .. Plugins["Travel Window II"]:GetVersion() .. - " by Hyoss"); - - MapWindow:VerifyMapSkillIds("Hunter"); - MapWindow:VerifyMapSkillIds("Warden"); - MapWindow:VerifyMapSkillIds("Mariner"); - MapWindow:VerifyMapSkillIds("Reputation"); + self:SizeChanged(); -- explicitly call to ensure correct positioning + if Settings.mode == 1 then + self:SetSize(self.ListTab:FitToPixels(self:GetSize())); + elseif Settings.mode == 2 then + self:SetSize(self.GridTab:FitToPixels(self:GetSize())); end end -function TravelWindow:SetPlayerRaceKey() - -- map player race to racial travel skill index for insertion into available travel skills - if (PlayerRace == Turbine.Gameplay.Race.Dwarf) then - PlayerRaceKey = 3; - elseif (PlayerRace == Turbine.Gameplay.Race.Elf) then - PlayerRaceKey = 4; - elseif (PlayerRace == Turbine.Gameplay.Race.Hobbit) then - PlayerRaceKey = 2; - elseif (PlayerRace == Turbine.Gameplay.Race.Man) then - PlayerRaceKey = 1; - elseif (PlayerRace == Turbine.Gameplay.Race.Beorning) then - PlayerRaceKey = 5; - elseif (PlayerRace == Turbine.Gameplay.Race.HighElf) then - PlayerRaceKey = 6; - elseif (PlayerRace == Turbine.Gameplay.Race.StoutAxe) then - PlayerRaceKey = 7; - elseif (PlayerRace == Turbine.Gameplay.Race.RiverHobbit) then - PlayerRaceKey = 8; - else - PlayerRaceKey = 1; -- default to man race to prevent errors - end +function TravelWindow:SetMaxOpacity() + self:SetOpacity(Settings.mainMaxOpacity); + self:SetWantsUpdates(false); +end + +function TravelWindow:FadeOut() + self:SetWantsUpdates(true); end function TravelWindow:SetItems() if Settings.mode == 1 then + self:SetSize(self.ListTab:GetPixelSize()); self.ListTab:SetItems(); elseif Settings.mode == 2 then + self:SetSize(self.GridTab:GetPixelSize()); self.GridTab:SetItems(); elseif Settings.mode == 3 then self.CaroTab:SetItems(); - else + elseif Settings.mode == 4 then self.PullTab:SetItems(); end end -function TravelWindow:UpdateSize() +function TravelWindow:UpdateMinimum() -- update the page that is showing if Settings.mode == 1 then - self.minWidth = 245; - self.minHeight = 150; - elseif Settings.mode == 2 then self.minWidth = 200; - self.minHeight = 100; + self.minHeight = 75; elseif Settings.mode == 3 then - self.minWidth = 200; - self.minHeight = 110; + if self.isMinWindow then + self.minWidth = 150; + self.minHeight = 75; + else + self.minWidth = 200; + self.minHeight = 110; + end + elseif Settings.mode == 4 then + if self.isMinWindow then + self.minWidth = 360; + self.minHeight = 65; + else + self.minWidth = 360; + self.minHeight = 105; + end else - self.minWidth = 360; - self.minHeight = 150; + self.minWidth = 100; + self.minHeight = 40; end self:SetMinimumSize(self.minWidth, self.minHeight); if Settings.mode == 3 or Settings.mode == 4 then - self:SetResizable(false); self:SetSize(self.minWidth, self.minHeight); - else - self:SetResizable(true); - - -- check that the window is not smaller than min width - if (self:GetWidth() < self.minWidth) then - self:SetWidth(self.minWidth); - end - - -- check that the window is not smaller than min height - if (self:GetHeight() < self.minHeight) then - self:SetHeight(self.minHeight); - end end end -function TravelWindow:SetMapHome() - - -- also close the options window - self:CloseOptions(); - - -- create the window used to add the map - self.MapWindow = Turbine.UI.Control(); - self.MapWindow:SetPosition(10, 35); - self.MapWindow:SetSize(Settings.width - 20, Settings.height - 60); - self.MapWindow:SetBackColor(Turbine.UI.Color(1, 0.1, 0.1, 0.1)); - self.MapWindow:SetParent(self); - self.MapWindow:SetZOrder(300); - - -- add a label to the window for instructions - self.mapLabel = Turbine.UI.Label(); - self.mapLabel:SetForeColor(Turbine.UI.Color(1, 0.2, 0.2, 0.6)); - self.mapLabel:SetPosition(0, 15); - self.mapLabel:SetSize(Settings.width - 20, self.MapWindow:GetHeight() - 90); - self.mapLabel:SetParent(self.MapWindow); - self.mapLabel:SetVisible(true); - self.mapLabel:SetFont(Turbine.UI.Lotro.Font.Verdana14); - self.mapLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft); - self.mapLabel:SetMultiline(true); - self.mapLabel:SetText("@TODO"); - - -- add an empty quickslot to the window - self.mapQuickSlot1 = Turbine.UI.Lotro.Quickslot(); - self.mapQuickSlot1:SetPosition(self.MapWindow:GetWidth() / 2 - 18, self.MapWindow:GetHeight() - 80); - self.mapQuickSlot1:SetSize(36, 36); - self.mapQuickSlot1:SetParent(self.MapWindow); - self.mapQuickSlot1:SetUseOnRightClick(false); - self.mapQuickSlot1:SetVisible(true); - - -- add a button to the window - self.mapButton = Turbine.UI.Lotro.Button(); - self.mapButton:SetSize(60, 50); - self.mapButton:SetPosition(self.MapWindow:GetWidth() / 2 - self.mapButton:GetWidth() / 2, - self.MapWindow:GetHeight() - 35); - self.mapButton:SetText("OK"); - self.mapButton:SetParent(self.MapWindow); - self.mapButton:SetVisible(true); - - -- when the button is pressed, update the settings - -- with the new skill, and reset everything - self.mapButton.Click = function(sender, args) - - -- check if there is a shortcut in the quickslot - if (self.mapQuickSlot1:GetShortcut():GetType() ~= Turbine.UI.Lotro.ShortcutType.Undef) then - - -- save the shortcut data to the settings - self:SaveMapHome(self.mapQuickSlot1:GetShortcut()); - end - - -- update the shortcuts list - self:UpdateSettings(); - - -- close this window - self.MapWindow:SetVisible(false); - self.MapWindow = nil; - end -end - -function TravelWindow:SaveMapHome(shortcut) - - local mapItem = shortcut:GetItem(); - - -- do this if it is the glan vraig map - if (string.find(mapItem:GetName(), glanMapItemString)) then - - -- remove the old shortcut if it exists - if (genLocations:IndexByName(glanMapString) == 2) then - genLocations:RemoveSkillAtIndex(2); - end - - -- set the value - Settings.mapGlanVraig = shortcut:GetData(); - - -- update the location lists - genLocations:InsertData(2, glanMapString, Settings.mapGlanVraig); - TravelInfo:GetCounts(); - - -- else, do nothing but report the error - else - Turbine.Shell.WriteLine("@TODO"); - end - -- update and save everything - self:UpdateSettings(); -end - -function TravelWindow:SetShortcuts() - -- set default values - TravelShortcuts = {}; - local sType = Turbine.UI.Lotro.ShortcutType.Skill; - local shortcutIndex = 1; - - -- set the either the travel skills for free people or monsters - if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then - -- set the generic travel items - for i = 1, travelCount[3], 1 do - -- get the order number for the item - shortcutIndex = self:TableIndex(Settings.order, genLocations:IdAtIndex(i)); - - -- set the shortcut for the quickslot, check - -- if the shortcut is the glan vraig map or not - if (string.len(genLocations:IdAtIndex(i)) > 12) then - local sItem = Turbine.UI.Lotro.ShortcutType.Item; - table.insert(TravelShortcuts, - TravelShortcut(sItem, genLocations:IdAtIndex(i), genLocations:NameAtIndex(i), 1, - shortcutIndex, Settings.enabled[genLocations:IdAtIndex(i)], - genLocations:LabelAtIndex(i))); - else - table.insert(TravelShortcuts, - TravelShortcut(sType, genLocations:IdAtIndex(i), genLocations:NameAtIndex(i), 1, - shortcutIndex, Settings.enabled[genLocations:IdAtIndex(i)], - genLocations:LabelAtIndex(i))); - end - end - - -- add the race travel to the list - local racialShortcutIndex = self:TableIndex(Settings.order, racialLocations:IdAtIndex(PlayerRaceKey)); - table.insert(TravelShortcuts, - TravelShortcut(sType, racialLocations:IdAtIndex(PlayerRaceKey), - racialLocations:NameAtIndex(PlayerRaceKey), 2, racialShortcutIndex, - Settings.enabled[racialLocations:IdAtIndex(PlayerRaceKey)], - racialLocations:LabelAtIndex(PlayerRaceKey))); - - -- set the reputation travel items - for i = 1, travelCount[4], 1 do - shortcutIndex = self:TableIndex(Settings.order, repLocations:IdAtIndex(i)); - table.insert(TravelShortcuts, - TravelShortcut(sType, repLocations:IdAtIndex(i), repLocations:NameAtIndex(i), 3, shortcutIndex, - Settings.enabled[repLocations:IdAtIndex(i)], repLocations:LabelAtIndex(i), - repLocations:DescAtIndex(i))); - end - else - -- set the creep travel items - for i = 1, travelCount[6], 1 do - shortcutIndex = self:TableIndex(Settings.order, creepLocations:IdAtIndex(i)); - table.insert(TravelShortcuts, - TravelShortcut(sType, creepLocations:IdAtIndex(i), creepLocations:NameAtIndex(i), 3, - shortcutIndex, Settings.enabled[creepLocations:IdAtIndex(i)], - creepLocations:LabelAtIndex(i))); - end - end - - -- set the hunter travel items - if (PlayerClass == Turbine.Gameplay.Class.Hunter) then - for i = 1, travelCount[1], 1 do - shortcutIndex = self:TableIndex(Settings.order, hunterLocations:IdAtIndex(i)); - table.insert(TravelShortcuts, - TravelShortcut(sType, hunterLocations:IdAtIndex(i), hunterLocations:NameAtIndex(i), 4, - shortcutIndex, Settings.enabled[hunterLocations:IdAtIndex(i)], - hunterLocations:LabelAtIndex(i), hunterLocations:DescAtIndex(i))); - end - end - - -- set the warden travel items - if (PlayerClass == Turbine.Gameplay.Class.Warden) then - for i = 1, travelCount[2], 1 do - shortcutIndex = self:TableIndex(Settings.order, wardenLocations:IdAtIndex(i)); - table.insert(TravelShortcuts, - TravelShortcut(sType, wardenLocations:IdAtIndex(i), wardenLocations:NameAtIndex(i), 4, - shortcutIndex, Settings.enabled[wardenLocations:IdAtIndex(i)], - wardenLocations:LabelAtIndex(i), wardenLocations:DescAtIndex(i))); - end - end - - -- set the mariner travel items - if (PlayerClass == Turbine.Gameplay.Class.Mariner) then - for i = 1, travelCount[7], 1 do - shortcutIndex = self:TableIndex(Settings.order, marinerLocations:IdAtIndex(i)); - table.insert(TravelShortcuts, - TravelShortcut(sType, marinerLocations:IdAtIndex(i), marinerLocations:NameAtIndex(i), 4, - shortcutIndex, Settings.enabled[marinerLocations:IdAtIndex(i)], - marinerLocations:LabelAtIndex(i), marinerLocations:DescAtIndex(i))); - end - end - - -- sort the shortcuts - self:SortShortcuts() -end - -function TravelWindow:CheckEnabledSettings() - -- count the min number of items that should be in the list - ItemCount = 0; - if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then - -- generic skills + reputation skills + one racial skill - ItemCount = travelCount[3] + travelCount[4] + 1; - if (PlayerClass == Turbine.Gameplay.Class.Hunter) then - -- hunters have hunter skills - ItemCount = ItemCount + travelCount[1]; - elseif (PlayerClass == Turbine.Gameplay.Class.Warden) then - -- wardens have warden skills - ItemCount = ItemCount + travelCount[2] - elseif (PlayerClass == Turbine.Gameplay.Class.Mariner) then - -- mariners have mariner skills - ItemCount = ItemCount + travelCount[7] - end - else - -- monster player skills - ItemCount = travelCount[6] + 1; - end - - -- remove superfluous entries in order list in case skills get deleted from game - if (#Settings.order > ItemCount) then - for id, order in pairs(Settings.order) do - if (not genLocations:VerifyId(id) and not wardenLocations:VerifyId(id) and not repLocations:VerifyId(id) and - not hunterLocations:VerifyId(id) and not marinerLocations:VerifyId(id)) then - Settings.order[id] = nil; - end - end - end - - -- remove superfluous entries in enabled list in case skills get deleted from game - if (#Settings.enabled > ItemCount) then - for id, status in pairs(Settings.enabled) do - if (not genLocations:VerifyId(id) and not wardenLocations:VerifyId(id) and not repLocations:VerifyId(id) and - not hunterLocations:VerifyId(id) and not marinerLocations:VerifyId(id)) then - Settings.enabled[id] = nil; - end - end - end - - -- need to find the highest sort number now - local counter = #Settings.order + 1; - - if (PlayerAlignment == Turbine.Gameplay.Alignment.FreePeople) then - -- update generic travel settings - for i = 1, travelCount[3], 1 do - -- if the enabled setting for the skill is nil, set it to true as default - if (Settings.enabled[genLocations:IdAtIndex(i)] == nil) then - Settings.enabled[genLocations:IdAtIndex(i)] = true; - end - - -- if the skill is not in the order list, add it and increase the counter - if (self:TableContains(Settings.order, genLocations:IdAtIndex(i)) == false) then - table.insert(Settings.order, counter, genLocations:IdAtIndex(i)); - counter = counter + 1; - end - end - - -- update reputation travel settings - for i = 1, travelCount[4], 1 do - if (Settings.enabled[repLocations:IdAtIndex(i)] == nil) then - Settings.enabled[repLocations:IdAtIndex(i)] = true; - end - if (self:TableContains(Settings.order, repLocations:IdAtIndex(i)) == false) then - table.insert(Settings.order, counter, repLocations:IdAtIndex(i)); - counter = counter + 1; - end - end - - -- update racial travel settings - if (Settings.enabled[racialLocations:IdAtIndex(PlayerRaceKey)] == nil) then - Settings.enabled[racialLocations:IdAtIndex(PlayerRaceKey)] = true; - end - if (self:TableContains(Settings.order, racialLocations:IdAtIndex(PlayerRaceKey)) == false) then - table.insert(Settings.order, counter, racialLocations:IdAtIndex(PlayerRaceKey)); - counter = counter + 1; - end - - -- update hunter travel settings - if (PlayerClass == Turbine.Gameplay.Class.Hunter) then - for i = 1, travelCount[1], 1 do - if (Settings.enabled[hunterLocations:IdAtIndex(i)] == nil) then - Settings.enabled[hunterLocations:IdAtIndex(i)] = true; - end - if (self:TableContains(Settings.order, hunterLocations:IdAtIndex(i)) == false) then - table.insert(Settings.order, counter, hunterLocations:IdAtIndex(i)); - counter = counter + 1; - end - end - end - - -- update warden travel settings - if (PlayerClass == Turbine.Gameplay.Class.Warden) then - for i = 1, travelCount[2], 1 do - if (Settings.enabled[wardenLocations:IdAtIndex(i)] == nil) then - Settings.enabled[wardenLocations:IdAtIndex(i)] = true; - end - if (self:TableContains(Settings.order, wardenLocations:IdAtIndex(i)) == false) then - table.insert(Settings.order, counter, wardenLocations:IdAtIndex(i)); - counter = counter + 1; - end - end - end - - -- update mariner travel settings - if (PlayerClass == Turbine.Gameplay.Class.Mariner) then - for i = 1, travelCount[7], 1 do - if (Settings.enabled[marinerLocations:IdAtIndex(i)] == nil) then - Settings.enabled[marinerLocations:IdAtIndex(i)] = true; - end - if (self:TableContains(Settings.order, marinerLocations:IdAtIndex(i)) == false) then - table.insert(Settings.order, counter, marinerLocations:IdAtIndex(i)); - counter = counter + 1; - end - end - end - else - -- update creep travel settings - for i = 1, travelCount[6], 1 do - if (Settings.enabled[creepLocations:IdAtIndex(i)] == nil) then - Settings.enabled[creepLocations:IdAtIndex(i)] = true; - end - if (self:TableContains(Settings.order, creepLocations:IdAtIndex(i)) == false) then - table.insert(Settings.order, counter, creepLocations:IdAtIndex(i)); - counter = counter + 1; - end - end - end -end - --- simple function to open the options window -function TravelWindow:OpenOptions() - self.optionsWindow:SetVisible(true); -end - --- function to close the options window if it exists -function TravelWindow:CloseOptions() - if (self.options ~= nil) then - self.options:SetVisible(false); - end - self.options = nil; -end - function TravelWindow:OpenMapWindow(map) self:CloseMapWindow(); - self.mapWindow = TravelWindowII.src.MapWindow(self, map, PlayerClass, PlayerRaceKey); + self.mapWindow = TravelWindowII.src.MapWindow(map); self.mapWindow:SetVisible(true); end @@ -713,339 +389,15 @@ function TravelWindow:CloseMapWindow() self.mapWindow = nil; end --- function to check if a table contains a specific element -function TravelWindow:TableContains(tableToSearch, elementToSearchFor) - for i, value in pairs(tableToSearch) do - if (value == elementToSearchFor) then - return true; - end - end - return false; -end - --- function to check if a table contains a specific element index -function TravelWindow:TableIndex(tableToSearch, elementToSearchFor) - for i, value in pairs(tableToSearch) do - if (value == elementToSearchFor) then - return i; - end - end - return 0; -end - -function TravelWindow:SortShortcuts() - -- perform an optimized bubble sort - local n = #TravelShortcuts; - while n > 2 do - local new_n = 1; - for i = 2, n do - if TravelShortcuts[i - 1]:GetIndex() > TravelShortcuts[i]:GetIndex() then - self.dirty = true; - local temp = TravelShortcuts[i - 1]; - TravelShortcuts[i - 1] = TravelShortcuts[i]; - TravelShortcuts[i] = temp; - new_n = i; - end - end - n = new_n; - end -end - function TravelWindow:UpdateOpacity() self:SetOpacity(Settings.mainMinOpacity); - self.ToggleButton:UpdateOpacity(); -end - -function TravelWindow:LoadSettings() - -- load the self.settings - -- if a value is not available, set a default value - - -- load TWII settings file - pcall(function() - SettingsStrings = PatchDataLoad(Turbine.DataScope.Character, "TravelWindowIISettings"); - end); - - -- save a daily backup of settings - if (SettingsStrings) then - SettingsStrings.backupTime = "#" .. Turbine.Engine.GetGameTime(); - local dateInfo = Turbine.Engine.GetDate(); - PatchDataSave(Turbine.DataScope.Character, "TravelWindowIISettings_backup" .. dateInfo.DayOfWeek, - SettingsStrings); - end - - -- try importing Travel Window I settings if new settings were not found - local importOldSettings = false; - if (SettingsStrings == nil) then - local result; - importOldSettings, result = pcall(function() - SettingsStrings = PatchDataLoad(Turbine.DataScope.Character, "TravelWindowSettings"); - end); - end - - if (type(SettingsStrings) ~= "table") then - SettingsStrings = {}; - end - - if (not SettingsStrings.lastLoadedVersion or SettingsStrings.lastLoadedVersion == "nil") then - SettingsStrings.lastLoadedVersion = tostring(Plugins["Travel Window II"]:GetVersion()); - end - - if (not SettingsStrings.width or SettingsStrings.width == "nil") then - if self.minWidth == nil then self.minWidth = 245; end - SettingsStrings.width = tostring(self.minWidth); - end - - if (not SettingsStrings.height or SettingsStrings.height == "nil") then - if self.minHeight == nil then self.minHeight = 150; end - SettingsStrings.height = tostring(self.minHeight); - end - - if (not SettingsStrings.positionX or SettingsStrings.positionX == "nil") then - SettingsStrings.positionX = tostring((Turbine.UI.Display.GetWidth() - self:GetWidth()) * 0.75); - end - - if (not SettingsStrings.positionY or SettingsStrings.positionY == "nil") then - SettingsStrings.positionY = tostring((Turbine.UI.Display.GetHeight() - self:GetHeight()) * 0.75); - end - - local screenWidth = Turbine.UI.Display.GetWidth(); - local screenHeight = Turbine.UI.Display.GetHeight(); - if not SettingsStrings.buttonRelativeX or SettingsStrings.buttonRelativeX == "nil" then - if SettingsStrings.buttonPositionX and SettingsStrings.buttonPositionX ~= "nil" and - tonumber(SettingsStrings.buttonPositionX) < screenWidth then - -- not perfect, but assuming the same resolution, this will approximately convert to a relative value - SettingsStrings.buttonRelativeX = tonumber(SettingsStrings.buttonPositionX) / screenWidth; - if SettingsStrings.buttonRelativeX > 1.0 then - SettingsStrings.buttonRelativeX = 0.95; - end - SettingsStrings.buttonRelativeX = tostring(SettingsStrings.buttonRelativeX); - else - SettingsStrings.buttonRelativeX = "0.95"; - end - end - - if not SettingsStrings.buttonRelativeY or SettingsStrings.buttonRelativeY == "nil" then - if SettingsStrings.buttonPositionY and SettingsStrings.buttonPositionY ~= "nil" and - tonumber(SettingsStrings.buttonPositionY) < screenHeight then - -- not perfect, but assuming the same resolution, this will approximately convert to a relative value - SettingsStrings.buttonRelativeY = tonumber(SettingsStrings.buttonPositionY) / screenHeight; - if SettingsStrings.buttonRelativeY > 1.0 then - SettingsStrings.buttonRelativeY = 0.75; - end - SettingsStrings.buttonRelativeY = tostring(SettingsStrings.buttonRelativeY); - else - SettingsStrings.buttonRelativeY = "0.75"; - end - end - - if (not SettingsStrings.hideOnStart or SettingsStrings.hideOnStart == "nil") then - SettingsStrings.hideOnStart = tostring(0); - end - - if (not SettingsStrings.hideOnCombat or SettingsStrings.hideOnCombat == "nil") then - SettingsStrings.hideOnCombat = tostring(0); - end - - if (not SettingsStrings.pulldownTravel or SettingsStrings.pulldownTravel == "nil") then - SettingsStrings.pulldownTravel = tostring(0); - end - - if (not SettingsStrings.hideOnTravel or SettingsStrings.hideOnTravel == "nil") then - SettingsStrings.hideOnTravel = tostring(0); - end - - if (not SettingsStrings.showButton or SettingsStrings.showButton == "nil") then - SettingsStrings.showButton = tostring(1); - end - - if (not SettingsStrings.mode or SettingsStrings.mode == "nil") then - SettingsStrings.mode = tostring(2); - end - - if (not SettingsStrings.filters or SettingsStrings.filters == "nil") then - SettingsStrings.filters = tostring(0x0F); - end - - if (not SettingsStrings.enabled or importOldSettings) then - SettingsStrings.enabled = {}; - end - - if ((not SettingsStrings.order) or importOldSettings) then - SettingsStrings.order = {}; - end - - if (not SettingsStrings.mainMaxOpacity or SettingsStrings.mainMaxOpacity == "nil") then - SettingsStrings.mainMaxOpacity = tostring(1); - end - - if (not SettingsStrings.mainMinOpacity or SettingsStrings.mainMinOpacity == "nil") then - SettingsStrings.mainMinOpacity = tostring(0.5); - end - - if (not SettingsStrings.toggleMaxOpacity or SettingsStrings.toggleMaxOpacity == "nil") then - SettingsStrings.toggleMaxOpacity = tostring(1); - end - - if (not SettingsStrings.toggleMinOpacity or SettingsStrings.toggleMinOpacity == "nil") then - SettingsStrings.toggleMinOpacity = tostring(0.2); - end - - -- convert from strings if necessary - if (type(SettingsStrings.width) == "string") then - Settings.width = tonumber(SettingsStrings.width); - else - Settings.width = SettingsStrings.width; - end - - if (type(SettingsStrings.height) == "string") then - Settings.height = tonumber(SettingsStrings.height); - else - Settings.height = SettingsStrings.height; - end - - if (type(SettingsStrings.positionX) == "string") then - Settings.positionX = tonumber(SettingsStrings.positionX); - else - Settings.positionX = SettingsStrings.positionX; - end - - if (type(SettingsStrings.positionY) == "string") then - Settings.positionY = tonumber(SettingsStrings.positionY); - else - Settings.positionY = SettingsStrings.positionY; - end - - if (type(SettingsStrings.buttonRelativeX) == "string") then - Settings.buttonRelativeX = tonumber(SettingsStrings.buttonRelativeX); - else - Settings.buttonRelativeX = SettingsStrings.buttonRelativeX; - end - - if (type(SettingsStrings.buttonRelativeY) == "string") then - Settings.buttonRelativeY = tonumber(SettingsStrings.buttonRelativeY); - else - Settings.buttonRelativeY = SettingsStrings.buttonRelativeY; - end - - if (type(SettingsStrings.hideOnStart) == "string") then - Settings.hideOnStart = tonumber(SettingsStrings.hideOnStart); - else - Settings.hideOnStart = SettingsStrings.hideOnStart; - end - - if (type(SettingsStrings.hideOnCombat) == "string") then - Settings.hideOnCombat = tonumber(SettingsStrings.hideOnCombat); - else - Settings.hideOnCombat = SettingsStrings.hideOnCombat; - end - - if (type(SettingsStrings.pulldownTravel) == "string") then - Settings.pulldownTravel = tonumber(SettingsStrings.pulldownTravel); - else - Settings.pulldownTravel = SettingsStrings.pulldownTravel; - end - - if (type(SettingsStrings.hideOnTravel) == "string") then - Settings.hideOnTravel = tonumber(SettingsStrings.hideOnTravel); - else - Settings.hideOnTravel = SettingsStrings.hideOnTravel; - end - - if (type(SettingsStrings.showButton) == "string") then - Settings.showButton = tonumber(SettingsStrings.showButton); - else - Settings.showButton = SettingsStrings.showButton; - end - - if (type(SettingsStrings.mode) == "string") then - Settings.mode = tonumber(SettingsStrings.mode); - else - Settings.mode = SettingsStrings.mode; - end - - if (type(SettingsStrings.filters) == "string") then - Settings.filters = tonumber(SettingsStrings.filters); - else - Settings.filters = SettingsStrings.filters; - end - - if (type(SettingsStrings.mainMaxOpacity) == "string") then - Settings.mainMaxOpacity = EuroNormalize(SettingsStrings.mainMaxOpacity); - else - Settings.mainMaxOpacity = SettingsStrings.mainMaxOpacity; - end - - if (type(SettingsStrings.mainMinOpacity) == "string") then - Settings.mainMinOpacity = EuroNormalize(SettingsStrings.mainMinOpacity); - else - Settings.mainMinOpacity = SettingsStrings.mainMinOpacity; - end - - if (type(SettingsStrings.toggleMaxOpacity) == "string") then - Settings.toggleMaxOpacity = EuroNormalize(SettingsStrings.toggleMaxOpacity); - else - Settings.toggleMaxOpacity = SettingsStrings.toggleMaxOpacity; - end - - if (type(SettingsStrings.toggleMinOpacity) == "string") then - Settings.toggleMinOpacity = EuroNormalize(SettingsStrings.toggleMinOpacity); - else - Settings.toggleMinOpacity = SettingsStrings.toggleMinOpacity; - end - - if (SettingsStrings.mapGlanVraig ~= nil) then - Settings.mapGlanVraig = SettingsStrings.mapGlanVraig; - end - - Settings.lastLoadedVersion = SettingsStrings.lastLoadedVersion; - Settings.enabled = SettingsStrings.enabled; - - local convertTableIndex = false; - for i, v in pairs(SettingsStrings.order) do - if (type(i) == "string") then - convertTableIndex = true; - end - end - - if (convertTableIndex) then - self:OrderTableNumberIndex(); - else - Settings.order = SettingsStrings.order; - end - - + ToggleButton:UpdateOpacity(); end -function TravelWindow:SaveSettings() - - -- make sure to delete old settings to delete unused fields - SettingsStrings = {}; - -- convert the settings to strings - SettingsStrings.lastLoadedVersion = tostring(Settings.lastLoadedVersion); - SettingsStrings.height = tostring(Settings.height); - SettingsStrings.width = tostring(Settings.width); - SettingsStrings.positionX = tostring(Settings.positionX); - SettingsStrings.positionY = tostring(Settings.positionY); - SettingsStrings.buttonRelativeX = tostring(Settings.buttonRelativeX); - SettingsStrings.buttonRelativeY = tostring(Settings.buttonRelativeY); - SettingsStrings.hideOnStart = tostring(Settings.hideOnStart); - SettingsStrings.hideOnCombat = tostring(Settings.hideOnCombat); - SettingsStrings.pulldownTravel = tostring(Settings.pulldownTravel); - SettingsStrings.hideOnTravel = tostring(Settings.hideOnTravel); - SettingsStrings.showButton = tostring(Settings.showButton); - SettingsStrings.mode = tostring(Settings.mode); - SettingsStrings.filters = tostring(Settings.filters); - SettingsStrings.mainMaxOpacity = tostring(Settings.mainMaxOpacity); - SettingsStrings.mainMinOpacity = tostring(Settings.mainMinOpacity); - SettingsStrings.toggleMaxOpacity = tostring(Settings.toggleMaxOpacity); - SettingsStrings.toggleMinOpacity = tostring(Settings.toggleMinOpacity); - SettingsStrings.enabled = Settings.enabled; - SettingsStrings.mapGlanVraig = tostring(Settings.mapGlanVraig); - - self:OrderTableStringIndex(); - - -- save the settings - PatchDataSave(Turbine.DataScope.Character, "TravelWindowIISettings", SettingsStrings); +function TravelWindow:SetOpacity(value) + Turbine.UI.Window.SetOpacity(self, value); + self.CaroTab:SetOpacityItems(value); + self.PullTab:SetOpacity(value); end function TravelWindow:UpdateSettings() @@ -1055,153 +407,40 @@ function TravelWindow:UpdateSettings() Settings.mode, Settings.filters = Menu:GetSettings(); if prevMode ~= Settings.mode then self.dirty = true; - if (prevMode == 3 or prevMode == 4) and (Settings.mode == 1 or Settings.mode == 2) then - -- restore previous size - self:SetSize(Settings.width, Settings.height); - end end -- set which page of the tab panel to show self.MainPanel:SetTab(Settings.mode); - self:UpdateSize(); + self:UpdateMinimum(); self:SetItems(); + if Settings.mode == 1 then + self:SetSize(self.ListTab:FitToPixels(self:GetSize())); + elseif Settings.mode == 2 then + self:SetSize(self.GridTab:FitToPixels(self:GetSize())); + end - self.MainPanel:SetSize(self:GetWidth() - 20, self:GetHeight() - 60); + self.MainPanel:SetSize(self:GetWidth() - self.wPadding, self:GetHeight() - self.hPadding); self.MainPanel:UpdateTabs(); end function TravelWindow:ResetSettings() - -- close the option window - self:CloseOptions() - - -- set all saved settings to default values - Settings = {}; - Settings.lastLoadedVersion = Plugins["Travel Window II"]:GetVersion(); - Settings.width = self.minWidth; - Settings.height = self.minHeight; - Settings.positionX = Turbine.UI.Display.GetWidth() - self:GetWidth() - 50; - Settings.positionY = Turbine.UI.Display.GetHeight() - self:GetHeight() - 50 * 1.5; - Settings.buttonRelativeX = 0.95; - Settings.buttonRelativeY = 0.75; - Settings.hideOnStart = 0; - Settings.hideOnCombat = 0; - Settings.pulldownTravel = 0; - Settings.hideOnTravel = 0; - Settings.showButton = 1; - Settings.mode = 2; - Settings.filters = 0x0F; - Settings.enabled = {}; - Settings.order = {}; - Settings.mainMaxOpacity = 1; - Settings.mainMinOpacity = 0.5; - Settings.toggleMaxOpacity = 1; - Settings.toggleMinOpacity = 0.5; - - -- clear the maps - Settings.mapGlanVraig = nil; - - -- move the toggle button and main window - local buttonPositionX = Turbine.UI.Display.GetWidth() * SettingsStrings.buttonRelativeX; - local buttonPositionY = Turbine.UI.Display.GetHeight() * SettingsStrings.buttonRelativeY; - self.ToggleButton:SetPosition(buttonPositionX, buttonPositionY); - self:SetPosition(Settings.positionX, Settings.positionY); - self:SetSize(Settings.width, Settings.height); - - -- get the player class and race - player = Turbine.Gameplay.LocalPlayer.GetInstance(); - PlayerClass = player:GetClass(); - PlayerRace = player:GetRace(); - self:SetPlayerRaceKey(); - - -- update everything - self:CheckEnabledSettings() - self:SetShortcuts(); - self:CheckSkills(false) - self:UpdateSettings(); -end - -function TravelWindow:OrderTableStringIndex() - - SettingsStrings.order = {}; - - for i, v in ipairs(Settings.order) do - SettingsStrings.order[tostring(i)] = v; - end -end - -function TravelWindow:OrderTableNumberIndex() - - Settings.order = {}; - - for i, v in pairs(SettingsStrings.order) do - Settings.order[tonumber(i)] = v; - end + InitDefaultSettings(); + SyncUIFromSettings(); end -function TravelWindow:AddGVMap() - -- if the player has a PvMP map, then insert it into the list - if ((Settings.mapGlanVraig ~= nil) and (Settings.mapGlanVraig ~= "nil")) then - self.reloadGVMap = false; - genLocations:InsertSkill(2, glanMapString, Settings.mapGlanVraig, "Glan Vraig"); - end -end - -function TravelWindow:CheckSkills(report) - local newShortcut = false; - -- loop through all the shortcuts and list those those that are not learned - for i = 1, #TravelShortcuts, 1 do - local wasFound = TravelShortcuts[i].found; - if (TravelWindow:FindSkill(TravelShortcuts[i])) then - if not wasFound then - newShortcut = true; - end - elseif report then - Turbine.Shell.WriteLine(skillNotTrainedString .. TravelShortcuts[i]:GetName()) - end - end - - if newShortcut then - self.dirty = true; -- reset list of shortcuts - self:SetItems(); -- redraw current window - end -end - -function TravelWindow:FindSkill(shortcut) - if shortcut.found then - return true; - end - - for i = 1, TrainedSkills:GetCount(), 1 do - local skillInfo = TrainedSkills:GetItem(i):GetSkillInfo(); - if skillInfo:GetName() == shortcut:GetName() then - local desc = shortcut:GetDescription(); - if desc ~= nil then - if string.match(skillInfo:GetDescription(), desc) then - shortcut.found = true; - return true; - end - else - shortcut.found = true; - return true; - end - end - end - - return false; -end - -function TravelWindow:ListTrainedSkills() - - Turbine.Shell.WriteLine("\n\nTrained Skills\n\n"); - - for i = 1, TrainedSkills:GetCount(), 1 do - local skill = Turbine.Gameplay.Skill; - local skillInfo = Turbine.Gameplay.SkillInfo; - skill = TrainedSkills:GetItem(i); - - Turbine.Shell.WriteLine(skill:GetSkillInfo():GetName()); - - end +function SyncUIFromSettings() + local buttonPositionX = Turbine.UI.Display.GetWidth() * Settings.buttonRelativeX; + local buttonPositionY = Turbine.UI.Display.GetHeight() * Settings.buttonRelativeY; + ToggleButton:SetPosition(buttonPositionX, buttonPositionY); + CheckEnabledSettings(); + OptionsWindow.Panel:UpdateSettings(); + OptionsWindow.Panel:EnableFromSettings(); + SortFromSettings(); + OptionsWindow.Panel:AddSortList(); + Menu:SetSettings(Settings.mode, Settings.filters); + _G.travel:SetPosition(Settings.positionX, Settings.positionY); + _G.travel.dirty = true; + _G.travel:UpdateSettings(); end -- for debug purposes diff --git a/src/__init__.lua b/src/__init__.lua index f42380d..1b26e37 100644 --- a/src/__init__.lua +++ b/src/__init__.lua @@ -5,12 +5,13 @@ import "TravelWindowII.src.TravelGridTab"; import "TravelWindowII.src.TravelCaroTab"; import "TravelWindowII.src.TravelPulldownTab" import "TravelWindowII.src.IndexedDictionary" +import "TravelWindowII.src.TravelDictionary" -- get language from Turbine API to load corresponding translated strings GLocale = Turbine.Engine.GetLanguage(); -if GLocale == 268435459 then +if GLocale == Turbine.Language.French then import "TravelWindowII.src.IndexedDictionaryFr"; -elseif GLocale == 268435460 then +elseif GLocale == Turbine.Language.German then import "TravelWindowII.src.IndexedDictionaryDe"; else import "TravelWindowII.src.IndexedDictionaryEn"; diff --git a/src/extensions/DPanel.lua b/src/extensions/DPanel.lua index 6729b73..6fea3fa 100644 --- a/src/extensions/DPanel.lua +++ b/src/extensions/DPanel.lua @@ -1,7 +1,6 @@ import "Turbine"; import "Turbine.Gameplay"; import "Turbine.UI"; -import "Turbine.UI.Extensions"; import "Turbine.UI.Lotro"; import "TravelWindowII.src.extensions";