Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Commit

Permalink
Minimap now toggles size when right clicked
Browse files Browse the repository at this point in the history
This replaces the old collapsing functionality, the extra-large expand
button has also been reverted
  • Loading branch information
chaorace committed Nov 3, 2016
1 parent 0d8c236 commit 9c1828b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion UI/MinimapPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ local m_isMouseDragging :boolean = false; -- Was LMB clicked inside the minima
local m_hasMouseDragged :boolean = false; -- Has there been any movements since m_isMouseDragging became true?
local m_wasMouseInMinimap :boolean = false; -- Was the mouse over the minimap the last time we checked?

local CQUI_bigMinimap = true;
-- ===========================================================================
-- FUNCTIONS
-- ===========================================================================
Expand All @@ -63,6 +64,20 @@ function CQUI_OnToggleBindings(mode: number)
end
end

--CQUI Minimap size toggling logic
function CQUI_ToggleMinimapSize()
CQUI_bigMinimap = not CQUI_bigMinimap;
if(CQUI_bigMinimap) then
Controls.MinimapImage:SetSizeVal(512, 256);
Controls.MinimapBacking:SetSizeVal(555,340);
Controls.MinimapBacking:SetOffsetVal(-17,-125);
else
Controls.MinimapImage:SetSizeVal(256, 128);
Controls.MinimapBacking:SetSizeVal(282,201);
Controls.MinimapBacking:SetOffsetVal(-5,7);
end
end

-- ===========================================================================
function GetContinentsCache()
if m_ContinentsCache == nil then
Expand Down Expand Up @@ -688,7 +703,7 @@ function OnInputHandler( pInputStruct:table )
if msg == MouseEvents.RButtonDown then
local minix, miniy = GetMinimapMouseCoords( pInputStruct:GetX(), pInputStruct:GetY() );
if IsMouseInMinimap( minix, miniy ) then
OnCollapseToggle();
CQUI_ToggleMinimapSize();
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions UI/MinimapPanel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
<Container Size="300,200" ID="MiniMap" Anchor="L,B" Offset="-3,0" ConsumeMouse="0">
<SlideAnim Size="parent,parent" ID="CollapseAnim" Begin="0,0" End="0,195" Function="OutQuint" FunctionPower="1" Speed="2" Cycle="Once" Stopped="1">
<SlideAnim Size="parent,parent" ID="ExpandAnim" Begin="0,0" End="0,-195" Function="OutQuint" FunctionPower="3" Speed="2" Cycle="Once" Stopped="1">
<Image Texture="MiniMap_WoodBacking" Offset="-17,-125" Size="555,340"/>
<Image ID="MinimapBacking" Texture="MiniMap_WoodBacking" Offset="-17,-125" Size="555,340"/>
<Image ID="MinimapImage" Anchor ="L,B" Offset="18,21" Texture="MiniMap_BG.dds" ToolTip="LOC_HUD_MINIMAP_TOOLTIP" StretchMode="Fill" Sampler="Linear" Size="512,256">
<Button ID="CollapseButton" Anchor="R,T" AnchorSide="I,O" Offset="3,3" Size="47,16" Hidden="0" Texture="Controls_Collapse.dds" ToolTip="LOC_HUD_MINIMAP_COLLAPSE_TOOLTIP" />
<Button ID="ExpandButton" Anchor="R,T" AnchorSide="I,O" Offset="3,3" Size="300,16" Hidden="1" ConsumeAllMouse="1" Texture="Controls_ButtonExtend.dds" ToolTip="LOC_HUD_MINIMAP_EXPAND_TOOLTIP" />
<Button ID="ExpandButton" Anchor="R,T" AnchorSide="I,O" Offset="3,3" Size="47,16" Hidden="1" ConsumeAllMouse="1" Texture="Controls_ButtonExtend.dds" ToolTip="LOC_HUD_MINIMAP_EXPAND_TOOLTIP" />
<Grid Texture="MiniMap_Frame" Size="parent+10,parent+12" SliceCorner="18,40" SliceTextureSize="37,149" Offset="-5,-5"/>
<Stack ID="OptionsStack" Anchor="L,T" AnchorSide="I,O" Offset="0,-4" StackGrowth="Right" Padding="-2">
<CheckBox ID="LensButton" Offset="0,1" Anchor="L,C" UseSelectedTextures="1" ButtonSize="44,44" ButtonTexture="LaunchBar_Hook_ButtonMedium" Style="ButtonNormalText" ToolTip="LOC_HUD_LENSES" CheckTexture="Controls_Bolt" CheckColor="0,0,0,0">
Expand Down

0 comments on commit 9c1828b

Please sign in to comment.