Skip to content

Commit

Permalink
Multiple features by whiterabbit (#172) (#173)
Browse files Browse the repository at this point in the history
* Features 171 and 100 (#172)

* add enable/disable all buttons

* add enable/disable overlapping skills buttons #171

* remove unnecessary args in MapWindow

* improve nil handling of location coordinate map

* update mapwindow after changing enable state

* optimize mass enable/disable update performance

* refactor TravelDictionary

Move all logic out of language files.
Replace global location variables with a single global: TravelInfo.
Update TravelDictionary counts on every AddSkill().
Minor simplification to TravelShortcut ctor.
Refactored several places where code was duplicated.
Removed broken and unnecessary handling of skills being removed from game.

* replace LC ints with turbine named constants

* add feature to ignore escape to close the main window #100

---------

Co-authored-by: whiterabbit963 <[email protected]>

* Mini UI option (#174)

* swap out silver window for a minimalist window

Includes icon snapping to ensure the window is always minimally sized.
Updated list, carousel, and pulldown tabs to be take up less room.

* move travel and settings data out of TravelWindow

The necessary logic is executed in Main.lua.
Many of the functions while no longer a part of TravelWindow still
remain in TravelWindow.lua and should be moved to more appropriate files.

* move functions out of TravelWindow

* add option to toggle between minwindow and the normal one

* remove mini-window padding

* minor spacement adjustment on pulldown tab

* remove SetWantsUpdates() on controls that do not use it

* add variable fade out speed to min opacity

* remove Turbine.UI.Extensions.Window dependency

* fixup pulldowntab opacity

---------

Co-authored-by: whiterabbit963 <[email protected]>

* Feature 101 (#175)

* handle empty case in the pulldown tab

* add feature #101

* put TravelWindow on top on TravelButton and cli

* Pulldown tab bug fixes (#176)

* fixup handling of deprecated buttonPositionX/Y

* fix pulldown tab issue for travel-on-click

Also fixes some scrolling issues for the drop down window.

* triple the fade-out duration

* Bug fix #177 (#178)

* make NextY() a local method to prevent misuse outside of intended scope

* fix string matching of skill descriptions

* allow options text to fill available space

* force mainwindow update when loading global settings

* change the default sort to put racial & class skills after general skills

This should improve level progression sorting.

* fixed syntax error in French dictionary

* minor translation cleanup

* removed unused code for unobtainable glan vraig maps

* fixes #179

* updated default readme

* adding new screenshots for lotrointerface.com

* add metadata for v2.0.0 release

---------

Co-authored-by: whiterabbit963 <[email protected]>
Co-authored-by: whiterabbit963 <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2024
1 parent 83e129e commit c5c404c
Show file tree
Hide file tree
Showing 32 changed files with 2,321 additions and 2,311 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion TravelWindowII.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Information>
<Name>Travel Window II</Name>
<Author>Hyoss</Author>
<Version>v1.4.0</Version>
<Version>v2.0.0</Version>
<Description>
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.
Expand Down
2 changes: 1 addition & 1 deletion TravelWindowII.plugincompendium
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PluginConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Id>1113</Id>
<Name>Travel Window II</Name>
<Version>v1.4.0</Version>
<Version>v2.0.0</Version>
<Author>Hyoss</Author>
<InfoUrl>http://www.lotrointerface.com/downloads/info1113</InfoUrl>
<DownloadUrl>http://www.lotrointerface.com/downloads/download1113</DownloadUrl>
Expand Down
19 changes: 13 additions & 6 deletions doc/lotroforums.md
Original file line number Diff line number Diff line change
@@ -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].
26 changes: 14 additions & 12 deletions doc/lotrointerface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Binary file added screenshots/eriador-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/mini-caro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/mini-pulldown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/regular-caro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/regular-carousel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 36 additions & 1 deletion src/IndexedDictionary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading

0 comments on commit c5c404c

Please sign in to comment.