Skip to content

Commit 45d67d8

Browse files
authored
Merge pull request #75 from wduda/develop
v1.0.12beta
2 parents 6ea44fc + 78dd566 commit 45d67d8

9 files changed

+161
-36
lines changed

CHANGELOG.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# Changelog
2-
v1.0.11hotfix2
2+
3+
## v1.0.12beta
4+
- fixed unloadable settings for 64bit DE and FR clients (bugfix)
5+
- fixed label of Hultvis hunter guide in FR client (enhancement)
6+
7+
## v1.0.11hotfix2
38
- fixing plugincompendium version data
49

510
## v1.0.11hotfix1
611
- fixed one French U29 skill - thanks homeopatix for the bug report
712

813
## v1.0.11beta
914
- full U29 travel skills support for DE and FR (enhancement)
10-
## v1.0.11beta
11-
- full U29 travel skills support for DE and FR (enhancement)
15+
1216
## v1.0.10beta
1317
- U29 travel skills support for EN (enhancement)
1418
- attempted U29 travel skills support for DE and FR - no translations for skills were available on Bullroarer (enhancement)

TravelWindowII.plugin

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Information>
44
<Name>Travel Window II</Name>
55
<Author>Hyoss</Author>
6-
<Version>v1.0.11hotfix2</Version>
6+
<Version>v1.0.12beta</Version>
77
<Description>
88
This plugin creates a single window that contains all the available travel skills, including the race, class and reputation skills.
99
It is a further development of Travel Window, that has been worked on by multiple authors before.

TravelWindowII.plugincompendium

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PluginConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
33
<Id>1113</Id>
44
<Name>Travel Window II</Name>
5-
<Version>v1.0.11hotfix2</Version>
5+
<Version>v1.0.12beta</Version>
66
<Author>Hyoss</Author>
77
<InfoUrl>http://www.lotrointerface.com/downloads/info1113</InfoUrl>
88
<DownloadUrl>http://www.lotrointerface.com/downloads/download1113</DownloadUrl>

doc/lotrointerface.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,8 @@ How to handle the settings reset introduced by v1.0.7beta?
4141
[/LIST]
4242

4343
Version history:
44-
v1.0.11hotfix2
45-
- fixing plugincompendium version data
46-
47-
v1.0.11hotfix1
48-
- fixed one French U29 skill - thanks homeopatix for the bug report
49-
50-
v1.0.11beta
51-
- full U29 travel skills support for DE and FR (enhancement)
52-
53-
v1.0.10beta
54-
- U29 travel skills support for EN (enhancement)
55-
- attempted U29 travel skills support for DE and FR - no translations for skills were available on Bullroarer (enhancement)
56-
- checking for untrained skills both through the options button and menu item will now add newly learned skills immediately (enhancement)
57-
- fixed bug in text list mode where only the last skill was highlighted on mouseover (bugfix)
58-
- fixed bug that caused skill enabled list and skill order to reset after SSG releases an update (bugfix)
59-
- automated GitHub builds to create GitHub releases for easy access to finished zip (internal)
60-
- cleaned up a lot of global/local internal variables and names (internal)
44+
v1.0.12beta
45+
- fixed unloadable settings for 64bit DE and FR clients (bugfix)
46+
- fixed label of Hultvis hunter guide in FR client (bugfix)
6147

6248
Rest of changelog found [URL="https://github.com/wduda/TravelWindowII/blob/master/CHANGELOG.md"]here[/URL].

src/EuroNormalize.lua

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
if (tonumber("1,000") == 1) then
2+
function EuroNormalize(value)
3+
local retcode
4+
if value ~= nil then
5+
retcode = tonumber((string.gsub(value, "%.", ",")))
6+
end
7+
return retcode
8+
end
9+
else
10+
function EuroNormalize(value)
11+
local retcode
12+
if value ~= nil then
13+
retcode = tonumber((string.gsub(value, ",", ".")))
14+
end
15+
return retcode
16+
end
17+
end

src/IndexedDictionaryFr.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function TravelDictionaries:CreateDictionaries()
148148
hunterLocations:AddSkill("Guide vers Jarnfast", "0x7004FACC", "Jarnfast (Guide)");
149149
hunterLocations:AddSkill("Guide vers Skarhald", "0x7004FACB", "Skarhald (Guide)");
150150
hunterLocations:AddSkill("Guide pour Beorninghus", "0x70052F07", "Beorninghus (Guide)");
151-
hunterLocations:AddSkill("Guide de Hultvis", "0x70052F08", "Guide vers Hultvis (Guide)");
151+
hunterLocations:AddSkill("Guide de Hultvis", "0x70052F08", "Hultvis (Guide)");
152152
hunterLocations:AddSkill("Guide vers Estolad Lân", "0x700551F4", "Estolad Lân (Guide)");
153153
hunterLocations:AddSkill("Guide de Limlok", "0x7005762D", "Limlok (Guide)");
154154
hunterLocations:AddSkill("Guide vers Annâk-khurfu", "0x70058571", "Annâk-khurfu (Guide)");

src/Main.lua

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ function travelCommand:Execute(command, arguments)
2121
end
2222
end
2323

24-
function travelCommand:GetHelp()
25-
Turbine.Shell.WriteLine(helpString);
26-
end
24+
function travelCommand:GetHelp() Turbine.Shell.WriteLine(helpString); end
2725

2826
-- add the command to the shell
2927
Turbine.Shell.AddCommand("trav,travel", travelCommand);
30-
31-

src/TravelWindow.lua

+11-8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import "Turbine.UI";
55
import "Turbine.UI.Lotro";
66
import "TravelWindowII.src.extensions";
77
import "TravelWindowII.src.utils.BitOps";
8+
import "TravelWindowII.src.VindarPatch";
9+
import "TravelWindowII.src.EuroNormalize";
810

911

1012
--[[ This is the main window for the Travel Window UI ]] --
@@ -338,19 +340,20 @@ function TravelWindow:UpdateSize()
338340
end
339341

340342
function TravelWindow:LoadSettings()
341-
-- load the self.settings. If a value is not available, set a default value
343+
-- load the self.settings
344+
-- If a value is not available, set a default value
342345

343346
-- load TWII settings file
344347
pcall(function()
345-
SettingsStrings = Turbine.PluginData.Load(Turbine.DataScope.Character, "TravelWindowIISettings");
348+
SettingsStrings = PatchDataLoad(Turbine.DataScope.Character, "TravelWindowIISettings");
346349
end);
347350

348351
-- try loading old settings if new settings could not be loaded
349352
local importOldSettings = false;
350353
if(SettingsStrings == nil) then
351354
local result;
352355
importOldSettings, result = pcall(function()
353-
SettingsStrings = Turbine.PluginData.Load(Turbine.DataScope.Character, "TravelWindowSettings");
356+
SettingsStrings = PatchDataLoad(Turbine.DataScope.Character, "TravelWindowSettings");
354357
end);
355358
end
356359

@@ -508,25 +511,25 @@ function TravelWindow:LoadSettings()
508511
end
509512

510513
if (type(SettingsStrings.mainMaxOpacity) == "string") then
511-
settings.mainMaxOpacity = tonumber(SettingsStrings.mainMaxOpacity);
514+
settings.mainMaxOpacity = EuroNormalize(SettingsStrings.mainMaxOpacity);
512515
else
513516
settings.mainMaxOpacity = SettingsStrings.mainMaxOpacity;
514517
end
515518

516519
if (type(SettingsStrings.mainMinOpacity) == "string") then
517-
settings.mainMinOpacity = tonumber(SettingsStrings.mainMinOpacity);
520+
settings.mainMinOpacity = EuroNormalize(SettingsStrings.mainMinOpacity);
518521
else
519522
settings.mainMinOpacity = SettingsStrings.mainMinOpacity;
520523
end
521524

522525
if (type(SettingsStrings.toggleMaxOpacity) == "string") then
523-
settings.toggleMaxOpacity = tonumber(SettingsStrings.toggleMaxOpacity);
526+
settings.toggleMaxOpacity = EuroNormalize(SettingsStrings.toggleMaxOpacity);
524527
else
525528
settings.toggleMaxOpacity = SettingsStrings.toggleMaxOpacity;
526529
end
527530

528531
if (type(SettingsStrings.toggleMinOpacity) == "string") then
529-
settings.toggleMinOpacity = tonumber(SettingsStrings.toggleMinOpacity);
532+
settings.toggleMinOpacity = EuroNormalize(SettingsStrings.toggleMinOpacity);
530533
else
531534
settings.toggleMinOpacity = SettingsStrings.toggleMinOpacity;
532535
end
@@ -594,7 +597,7 @@ function TravelWindow:SaveSettings()
594597
self:OrderTableStringIndex();
595598

596599
-- save the settings
597-
Turbine.PluginData.Save(Turbine.DataScope.Character, "TravelWindowIISettings", SettingsStrings);
600+
PatchDataSave(Turbine.DataScope.Character, "TravelWindowIISettings", SettingsStrings);
598601
end
599602

600603
function TravelWindow:UpdateSettings()

src/VindarPatch.lua

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
--[[ Vindar, 11/2010
2+
A patch for the Turbine.PluginData bug for europeen clients. It's dirty but it seems to works :)
3+
]] --
4+
-- return a copy of the object obj in a safe format
5+
local function _convSafe(obj)
6+
if type(obj) == "number" then return (tostring(obj)) end
7+
if type(obj) ~= "string" then return (obj) end
8+
local res = ""
9+
for i, v in ipairs({obj:byte(1, -1)}) do
10+
if (v < 32) or (v > 125) then
11+
res = res .. "#" .. tonumber(v) .. "#"
12+
else
13+
res = res .. string.char(v)
14+
if v == 35 then res = res .. "#" end
15+
end
16+
end
17+
if res:byte(1, 1) == 35 then return ("#" .. res) end
18+
if (tonumber(res) ~= nil) then return ("#" .. res) end
19+
return res
20+
end
21+
local function _copySafe(obj)
22+
if type(obj) ~= "table" then
23+
return _convSafe(obj)
24+
elseif lookupSafe[obj] then
25+
return lookupSafe[obj]
26+
end
27+
local newt = {}
28+
lookupSafe[obj] = newt
29+
for i, v in pairs(obj) do newt[_copySafe(i)] = _copySafe(v) end
30+
return setmetatable(newt, getmetatable(obj))
31+
end
32+
function convSafe(obj)
33+
lookupSafe = {}
34+
local retVal = _copySafe(obj)
35+
lookupSafe = nil;
36+
return retVal;
37+
end
38+
39+
-- the inverse operation
40+
local function _convBack(obj)
41+
if type(obj) ~= "string" then return obj end
42+
if obj == "" then return "" end
43+
local num = tonumber(obj)
44+
if num ~= nil then return num end
45+
local res = ""
46+
if obj:byte(1, 1) == 35 then obj = string.sub(obj, 2, -1) end
47+
while string.len(obj) ~= 0 do
48+
if obj:byte(1, 1) ~= 35 then
49+
res = res .. string.char(obj:byte(1, 1));
50+
obj = string.sub(obj, 2, -1)
51+
elseif obj:byte(2, 2) == 35 then
52+
res = res .. "#";
53+
obj = string.sub(obj, 3, -1)
54+
else
55+
obj = string.sub(obj, 2, -1)
56+
local k = 1;
57+
while (obj:byte(k, k) ~= nil) and (obj:byte(k, k) ~= 35) do
58+
k = k + 1
59+
end
60+
if obj:byte(k, k) == nil then
61+
error("convBack : parse error 1 !")
62+
end
63+
local v = tonumber(string.sub(obj, 1, k - 1))
64+
if v == nil then error("convBack : parse error 2 !") end
65+
res = res .. string.char(v)
66+
obj = string.sub(obj, k + 1, -1)
67+
end
68+
end
69+
return res;
70+
end
71+
local function _copyBack(obj)
72+
if type(obj) ~= "table" then
73+
return _convBack(obj)
74+
elseif lookupBack[obj] then
75+
return lookupBack[obj]
76+
end
77+
local newt = {}
78+
lookupBack[obj] = newt
79+
for i, v in pairs(obj) do newt[_copyBack(i)] = _copyBack(v) end
80+
return setmetatable(newt, getmetatable(obj))
81+
end
82+
function convBack(obj)
83+
lookupBack = {}
84+
local retVal = _copyBack(obj)
85+
lookupBack = nil;
86+
return retVal
87+
end
88+
89+
-- Replacement for Turbine.PluginData.Load
90+
function PatchDataLoad(a, b, c)
91+
local success, results;
92+
success, results = pcall(Turbine.PluginData.Load, a, b, c);
93+
if success then
94+
success, results = pcall(convBack, results);
95+
if success then
96+
return results;
97+
else
98+
Turbine.Shell.WriteLine("Error:" .. tostring(results))
99+
Turbine.Shell.WriteLine(
100+
"While processing convBack(Turbine.PluginData.Load(" ..
101+
tostring(a) .. ", " .. tostring(b) .. ", " .. tostring(c) ..
102+
"))")
103+
return nil;
104+
end
105+
else
106+
Turbine.Shell.WriteLine("Error:" .. tostring(results))
107+
Turbine.Shell.WriteLine("While processing Turbine.PluginData.Load(" ..
108+
tostring(a) .. ", " .. tostring(b) .. ", " ..
109+
tostring(c) .. ")")
110+
return nil;
111+
end
112+
end
113+
114+
-- Replacement for Turbine.PluginData.Save
115+
function PatchDataSave(a, b, c, d)
116+
return Turbine.PluginData.Save(a, b, convSafe(c), d)
117+
end
118+
119+
-- end of file

0 commit comments

Comments
 (0)