Skip to content

Commit

Permalink
StateChangeした時にアイコンの表示状態を即時反映するように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionas committed Aug 30, 2016
1 parent e832f54 commit 347942a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
38 changes: 26 additions & 12 deletions LionasFoodAndDrinkReminder/LionasFoodAndDrinkReminder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function OnIconMouseUp(self, mouseButton, upInside)

if mouseButton == 2 and upInside then -- right click

LioFADR.isNeverNotify = true
LioFADR.isNeverNotify = true
hideIcon()

end
Expand Down Expand Up @@ -364,6 +364,24 @@ local function notifyExpiredBuffs(currentBuffs)
end


-- show / hide icon
local function setIconVisibility()

if(((LioFADRCommon.getTableLength(LioFADR.notifyRemain) > 0) or
(LioFADRCommon.getTableLength(LioFADR.notifyClosed) > 0) or
(LioFADRCommon.getTableLength(LioFADR.notifyExpired)> 0)) and
not LioFADR.isNeverNotify) then

showIcon()

else

hideIcon()
end

end


-- Scan buffs
local function scanBuffs()

Expand Down Expand Up @@ -443,17 +461,7 @@ local function scanBuffs()
end

-- アイコンの表示判断
if(((LioFADRCommon.getTableLength(LioFADR.notifyRemain) > 0) or
(LioFADRCommon.getTableLength(LioFADR.notifyClosed) > 0) or
(LioFADRCommon.getTableLength(LioFADR.notifyExpired)> 0)) and
not LioFADR.isNeverNotify) then

showIcon()

else
hideIcon()
end

setIconVisibility()

end

Expand Down Expand Up @@ -586,6 +594,9 @@ local function initializeIcon()
LioFADR.isHideScene = true
end

-- アイコンの表示判断
setIconVisibility()

end
)
HUD_UI_SCENE:RegisterCallback("StateChange",
Expand All @@ -599,6 +610,9 @@ local function initializeIcon()
LioFADR.isHideReticle = false
end

-- アイコンの表示判断
setIconVisibility()

end
)

Expand Down
2 changes: 1 addition & 1 deletion LionasFoodAndDrinkReminder/LionasFoodAndDrinkReminder.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<GuiXml>
<Controls>
<TopLevelControl name="LioFADRContainer" mouseEnabled="true" movable="false" clampedToScreen="true" hidden="false" tier="2" layer="2" level="2" hidden="true" >
<TopLevelControl name="LioFADRContainer" mouseEnabled="true" movable="false" clampedToScreen="true" hidden="true" tier="2" layer="2" level="2">
<Dimensions x="1" y="1" />
<Anchor point="TOPLEFT" relativeTo="GuiRoot" relativePoint="CENTER" offsetX="0" offsetY="0"/>
</TopLevelControl>
Expand Down

0 comments on commit 347942a

Please sign in to comment.