Skip to content

Commit

Permalink
ドロップアイテム表示制限対応、フレーム位置保存対応
Browse files Browse the repository at this point in the history
  • Loading branch information
weizlogy committed Feb 6, 2018
1 parent 5737af1 commit 51a788e
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 15 deletions.
2 changes: 1 addition & 1 deletion addons.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"name" : "Monster Status",
"file" : "monsterstatus",
"extension" : "ipf",
"fileVersion" : "v3.0.2",
"fileVersion" : "v3.0.3",
"releaseTag" : "monsterstatus",
"unicode" : "📖",
"description" : "ターゲット中のモンスターのステータスを表示します。シンプルなv2系もあります。",
Expand Down
10 changes: 7 additions & 3 deletions monsterstatus/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
## Latest Release Note.

### v3.0.2
### v3.0.3

#### 冒険日誌改変対応
#### ドロップアイテム表示制限対応

[jtos] 冒険日誌改変に対応しました。
未鑑定アイテムは表示されないように修正しました。

#### フレーム位置保存対応

フレーム位置の保存/復元に対応しました。

see [http://www.weizlogy.gq/tos/addon/monsterstatus/](http://www.weizlogy.gq/tos/addon/monsterstatus/)
28 changes: 22 additions & 6 deletions monsterstatus/monsterstatus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ function MonsterStatus.new(self)
local members = {};
members.X = -1;
members.Y = -1;

members.pathLoc = "../addons/monsterstatus/location.txt";

members.ArmorCompatibleMap = {
None_Cloth = 1.00,
None_Leather = 1.00,
Expand Down Expand Up @@ -49,6 +52,7 @@ function MonsterStatus.new(self)

--
members.LoadSettings = function(self)
dofile(self.pathLoc)
if (self.X ~= -1 and self.Y ~= -1) then
return;
end
Expand All @@ -63,6 +67,14 @@ function MonsterStatus.new(self)
local frame = ui.GetFrame("monsterstatus");
self.X = frame:GetX();
self.Y = frame:GetY();

local f, e = io.open(self.pathLoc, "w");
if (f == nil) then
return;
end
f:write(string.format("most.X = %d; most.Y = %d;", self.X, self.Y));
f:flush();
f:close();
end
--
members.Clear = function(self)
Expand Down Expand Up @@ -249,12 +261,16 @@ function MonsterStatus.new(self)
frame:Resize(frame:GetWidth(), droptitle:GetY() + droptitle:GetHeight() + 5);
if (next(journals.drops)) then
for i, item in ipairs(journals.drops) do
local drop = frame:CreateOrGetControl(
"richtext", "drop_"..i, 10, curHeight + (ctrlHeight * i), frame:GetWidth(), ctrlHeight);
drop:SetText(string.format("{s14}{ol}%s - %.2f %%", item[1].Name, item[2]));
drop:SetTooltipType('wholeitem');
drop:SetTooltipArg('', item[1].ClassID, 0);
frame:Resize(frame:GetWidth(), drop:GetY() + drop:GetHeight() + 5);
-- 未鑑定品を除く!
local needAppraisal = TryGetProp(item[1], "NeedAppraisal")
if (needAppraisal ~= 0) then
local drop = frame:CreateOrGetControl(
"richtext", "drop_"..i, 10, curHeight + (ctrlHeight * i), frame:GetWidth(), ctrlHeight);
drop:SetText(string.format("{s14}{ol}%s - %.2f %%", item[1].Name, item[2]));
drop:SetTooltipType('wholeitem');
drop:SetTooltipArg('', item[1].ClassID, 0);
frame:Resize(frame:GetWidth(), drop:GetY() + drop:GetHeight() + 5);
end
end
end

Expand Down
27 changes: 22 additions & 5 deletions monsterstatus/v2/monsterstatus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ function MonsterStatus.new(self)
members.X = -1;
members.Y = -1;


members.pathLoc = "../addons/monsterstatus/location.txt";

members.server = GetServerNation();

members.IsJpServer = function(self)
return self.server == "JP";
end

members.LoadSettings = function(self)
dofile(self.pathLoc)
if (self.X ~= -1 and self.Y ~= -1) then
return;
end
Expand All @@ -28,6 +32,14 @@ function MonsterStatus.new(self)
local frame = ui.GetFrame("monsterstatus");
self.X = frame:GetX();
self.Y = frame:GetY();

local f, e = io.open(self.pathLoc, "w");
if (f == nil) then
return;
end
f:write(string.format("most.X = %d; most.Y = %d;", self.X, self.Y));
f:flush();
f:close();
end

members.Clear = function(self)
Expand Down Expand Up @@ -77,11 +89,16 @@ function MonsterStatus.new(self)
frame:Resize(frame:GetWidth(), droptitle:GetY() + droptitle:GetHeight() + 5);
if (next(journals.drops)) then
for i, item in ipairs(journals.drops) do
local drop = frame:CreateOrGetControl("richtext", "drop_"..i, 10, 70 + (20 * i), frame:GetWidth(), 20);
drop:SetText(string.format("{s14}{ol}%s - %.2f %%", item[1].Name, item[2]));
drop:SetTooltipType('wholeitem');
drop:SetTooltipArg('', item[1].ClassID, 0);
frame:Resize(frame:GetWidth(), drop:GetY() + drop:GetHeight() + 5);
-- 未鑑定品を除く!
local needAppraisal = TryGetProp(item[1], "NeedAppraisal")
if (needAppraisal ~= 0) then
local drop = frame:CreateOrGetControl(
"richtext", "drop_"..i, 10, curHeight + (ctrlHeight * i), frame:GetWidth(), ctrlHeight);
drop:SetText(string.format("{s14}{ol}%s - %.2f %%", item[1].Name, item[2]));
drop:SetTooltipType('wholeitem');
drop:SetTooltipArg('', item[1].ClassID, 0);
frame:Resize(frame:GetWidth(), drop:GetY() + drop:GetHeight() + 5);
end
end
end

Expand Down

0 comments on commit 51a788e

Please sign in to comment.