Skip to content

Commit

Permalink
Update Trade Frame button
Browse files Browse the repository at this point in the history
And various tweaks.
  • Loading branch information
Anonomit committed Jun 23, 2022
1 parent 0e9200d commit 5374615
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 40 deletions.
Binary file modified Assets/Textures/Icon.tga
Binary file not shown.
Binary file added Assets/Textures/IconDice.tga
Binary file not shown.
9 changes: 2 additions & 7 deletions Server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LootReserve.Server =
UseGlobalProfile = false,
Phases = LootReserve:Deepcopy(LootReserve.Constants.DefaultPhases),
RollUsePhases = false,
RollPhases = {"Main-Spec", "Off-Spec"},
RollPhases = {"MainSpec", "OffSpec"},
RollAdvanceOnExpire = true,
RollLimitDuration = false,
RollDuration = 30,
Expand Down Expand Up @@ -768,7 +768,6 @@ function LootReserve.Server:PrepareLootTracking()
return;
end


local target = LootReserve:Player(UnitName("npc"));
local itemsToInsert = { };
local slotsFree = 6;
Expand Down Expand Up @@ -796,11 +795,7 @@ function LootReserve.Server:PrepareLootTracking()
if #itemsToInsert > 0 then
LootReserveTradeFrameAutoButton:Show();
LootReserveTradeFrameAutoButton:SetEnabled(slotsFree ~= 0);
if #itemsToInsert <= slotsFree then
LootReserveTradeFrameAutoButton:SetText(format("Insert %d |4item:items;", #itemsToInsert));
else
LootReserveTradeFrameAutoButton:SetText(format("Insert %d / %d |4item:items;", slotsFree, #itemsToInsert));
end
LootReserveTradeFrameAutoButton:SetText(format("|TInterface\\AddOns\\LootReserve\\Assets\\Textures\\IconDice:16:16:0:0|t Insert %s%d |4item:items;", #itemsToInsert > slotsFree and format("%d / ", slotsFree) or "", #itemsToInsert));
LootReserveTradeFrameAutoButton.ItemsToInsert = itemsToInsert;
else
LootReserveTradeFrameAutoButton:Hide();
Expand Down
1 change: 0 additions & 1 deletion Windows/RollRequestWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ local function RollRequested(self, sender, item, players, custom, duration, maxD
frame.LabelSender:SetText(format(custom and "%s offers for you to roll%s:" or "%s asks you to roll%s on a reserved item:", LootReserve:ColoredPlayer(sender), phase and format(" for |cFF00FF00%s|r", phase) or ""));
frame.ItemFrame.Icon:SetTexture(texture);
frame.ItemFrame.Name:SetText((link or name or "|cFFFF4000Loading...|r"):gsub("[%[%]]", ""));
frame.ItemFrame.Name:SetFontObject("GameFontNormal");
frame.ItemFrame.Misc:SetText(description);
frame.ButtonRoll:Disable();
frame.ButtonRoll:SetAlpha(0.25);
Expand Down
8 changes: 3 additions & 5 deletions Windows/ServerWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ function LootReserve.Server:UpdateReserveList(lockdown)
frame:SetAlpha(fade and 0.25 or 1);

frame.DurationFrame:SetShown(self:IsRolling(frame.Item) and self.RequestedRoll.MaxDuration and not self.RequestedRoll.Custom);
local durationHeight = frame.DurationFrame:IsShown() and 12 or 0;
frame.DurationFrame:SetHeight(math.max(durationHeight, 0.00001));
frame.DurationFrame:SetHeight(frame.DurationFrame:IsShown() and 12 or 0.00001);

local reservesHeight = 5 + 12 + 2;
local last = 0;
Expand Down Expand Up @@ -585,8 +584,7 @@ function LootReserve.Server:UpdateRollList(lockdown)
end

frame.DurationFrame:SetShown(not historical and self:IsRolling(frame.Item) and self.RequestedRoll.MaxDuration);
local durationHeight = frame.DurationFrame:IsShown() and 12 or 0;
frame.DurationFrame:SetHeight(math.max(durationHeight, 0.00001));
frame.DurationFrame:SetHeight(frame.DurationFrame:IsShown() and 12 or 0.00001);

local reservesHeight = 5 + 12 + 2;
local last = 0;
Expand Down Expand Up @@ -634,7 +632,7 @@ function LootReserve.Server:UpdateRollList(lockdown)
frame:SetHeight(6 + 32 + 2 + 20 + 5 + reservesHeight - 1);
frame.ReservesFrame:SetPoint("TOP", frame.DistributeButton, "BOTTOM", 0, -5);
elseif frame.DurationFrame:IsShown() then
frame:SetHeight(6 + 32 + 3 + 12 + 5 + reservesHeight - 1);
frame:SetHeight(6 + 32 + 12 + 5 + reservesHeight - 1);
frame.ReservesFrame:SetPoint("TOP", frame.DurationFrame, "BOTTOM", 0, -5);
else
frame:SetHeight(6 + 32 + 5 + reservesHeight - 1);
Expand Down
34 changes: 7 additions & 27 deletions Windows/ServerWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@
<Frame parentKey="DurationFrame">
<Size y="12" />
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.ItemFrame" relativePoint="BOTTOMLEFT" y="-3" />
<Anchor point="TOPLEFT" relativeKey="$parent.ItemFrame" relativePoint="BOTTOMLEFT" />
<Anchor point="RIGHT" x="-6" />
</Anchors>
<Frames>
Expand All @@ -635,18 +635,7 @@
<Anchor point="TOPLEFT" relativeKey="$parent.ItemFrame" relativePoint="BOTTOMLEFT" y="-2" />
</Anchors>
<Scripts>
<OnLoad>
self.GlowLeft:SetDesaturated(true);
self.GlowRight:SetDesaturated(true);
self.GlowLeft2:SetDesaturated(true);
self.GlowRight2:SetDesaturated(true);
self.SetGlow = function(self, glow)
self.GlowLeft:SetShown(glow);
self.GlowRight:SetShown(glow);
self.GlowLeft2:SetShown(glow);
self.GlowRight2:SetShown(glow);
end

<OnLoad inherit="prepend">
self.Text:SetPoint("CENTER", 0, 0); -- Fix the inherited offset of y=-1

self.SetState = function(self, text, enable, glow)
Expand Down Expand Up @@ -1030,22 +1019,13 @@
</Frame>
</Frames>
</Frame>
<Button name="LootReserveTradeFrameAutoButton" inherits="UIPanelButtonTemplate" text="Trade" frameLevel="2" hidden="false">
<Size x="80" y="16.5" />
<Button name="LootReserveTradeFrameAutoButton" inherits="UIPanelButtonTemplate" parent="TradeFrame" text="Trade" hidden="false">
<Size x="168" />
<Anchors>
<Anchor point="TOPLEFT" relativeTo="TradeFrameTradeButton" relativePoint="TOPLEFT" y="-22" />
<Anchor point="BOTTOMRIGHT" relativeTo="TradeFrameCancelButton" relativePoint="BOTTOMRIGHT" y="-22" />
<!-- <Anchor point="RIGHT" relativeTo="TradeFrameTradeButton" relativePoint="LEFT" y="-50" /> -->
<Anchor point="TOP" relativeTo="TradeFrameTradeButton" relativePoint="TOP" />
<Anchor point="BOTTOM" relativeTo="TradeFrameTradeButton" relativePoint="BOTTOM" />
<Anchor point="RIGHT" relativeTo="TradeFrameTradeButton" relativePoint="LEFT" x="-3" />
</Anchors>
<ButtonText parentKey="Text">
<Size x="0" y="10" />
<Anchors>
<Anchor point="CENTER" x="0" y="2" />
</Anchors>
</ButtonText>
<NormalFont style="GameFontNormalSmall" />
<HighlightFont style="GameFontHighlightSmall" />
<DisabledFont style="GameFontHighlightSmall" />
<Scripts>
<OnClick>
local i = 1;
Expand Down

0 comments on commit 5374615

Please sign in to comment.