mirror of
https://github.com/MarkuruThunderhoof/RecipeRadar.git
synced 2026-10-04 05:00:01 +00:00
v1.15
- Added square minimaps support for icons on minimap & for minimapbutton - Fixed first startup errors - More support for MBB
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
Recipe Radar (vanilla) ChangeLog
|
||||
|
||||
v1.15; 3.02.2017
|
||||
|
||||
- Added square minimaps support for icons on minimap & for minimapbutton
|
||||
- Fixed first startup errors
|
||||
- More support for MBB
|
||||
|
||||
v1.14; 2.02.2017
|
||||
|
||||
- Added MBB compatibility (better minimap button managment),
|
||||
|
||||
@@ -230,7 +230,7 @@ function RecipeRadar_Options_Init()
|
||||
|
||||
if (RecipeRadar_Options.ShowMinimapButton == nil) then
|
||||
RecipeRadar_Options.ShowMinimapButton = true
|
||||
RecipeRadarMinimapButtonFrame:Show()
|
||||
if (RecipeRadarMinimapButtonFrame) then RecipeRadarMinimapButtonFrame:Show() end
|
||||
end
|
||||
|
||||
if (not RecipeRadar_IsProfession(
|
||||
|
||||
+19
-12
@@ -147,19 +147,26 @@ function RecipeRadar_Minimap_GetPosition(offs_x, offs_y, scale_x, scale_y)
|
||||
local map_x, map_y = offs_x * scale_x, offs_y * scale_y
|
||||
local dist = RecipeRadar_Minimap_Pythagorean(map_x, map_y)
|
||||
|
||||
if (dist >= 57) then
|
||||
|
||||
local flip_axis = 1
|
||||
if (map_x == 0) then
|
||||
map_x = 0.0000000001
|
||||
elseif (map_x < 0) then
|
||||
flip_axis = -1
|
||||
local mapWidth = Minimap:GetWidth()/2;
|
||||
local mapHeight = Minimap:GetHeight()/2;
|
||||
if (Squeenix or (simpleMinimap_Skins and simpleMinimap_Skins:GetShape() == "square")
|
||||
or (pfUI and pfUI_config["disabled"]["minimap"] ~= "1")) then
|
||||
if (math.abs(map_x) > mapWidth) then
|
||||
map_x = (mapWidth)*((map_x<0 and -1) or 1);
|
||||
end
|
||||
|
||||
local angle = math.atan(map_y / map_x)
|
||||
map_x = math.cos(angle) * 58 * flip_axis
|
||||
map_y = math.sin(angle) * 58 * flip_axis
|
||||
|
||||
if (math.abs(map_y) > mapHeight) then
|
||||
map_y = (mapHeight)*((map_y<0 and -1) or 1);
|
||||
end
|
||||
elseif (mapDist >= mapWidth) then
|
||||
-- Remap it to just inside the minimap, by:converting dx,dy to angle,distance
|
||||
-- then truncate distance to 58 and convert angle,58 to dx,dy
|
||||
local flipAxis = 1;
|
||||
if (map_x == 0) then map_x = 0.0000000001;
|
||||
elseif (map_x < 0) then flipAxis = -1;
|
||||
end
|
||||
local angle = math.atan(map_y / map_x);
|
||||
map_x = math.cos(angle) * mapWidth * flipAxis;
|
||||
map_y = math.sin(angle) * mapHeight * flipAxis;
|
||||
end
|
||||
|
||||
return map_x, map_y
|
||||
|
||||
@@ -84,8 +84,17 @@ function RecipeRadar_MinimapButton_UpdatePosition()
|
||||
local scale = Minimap:GetEffectiveScale();
|
||||
local xdelta, ydelta = (xm - xmin)/2*scale, (ym - ymin) /2 * scale;
|
||||
local scale2 = RecipeRadarMinimapButton:GetEffectiveScale();
|
||||
local x = (xdelta * cos(RecipeRadar_Options.MinimapButtonPosition))/scale2;
|
||||
local y = (ydelta * sin(RecipeRadar_Options.MinimapButtonPosition))/scale2;
|
||||
RecipeRadarMinimapButton:SetPoint("TOPLEFT", "Minimap", "CENTER", x - 17 , y + 17)
|
||||
local angle = RecipeRadar_Options.MinimapButtonPosition
|
||||
local x,y =0,0;
|
||||
if (Squeenix or (simpleMinimap_Skins and simpleMinimap_Skins:GetShape() == "square")
|
||||
or (pfUI and pfUI_config["disabled"]["minimap"] ~= "1")) then
|
||||
x = math.max(-xdelta, math.min((xdelta*1.5) * cos(angle), xdelta))
|
||||
y = math.max(-ydelta, math.min((ydelta*1.5) * sin(angle), ydelta))
|
||||
else
|
||||
x= cos(angle)*xdelta
|
||||
y= sin(angle)*ydelta
|
||||
end
|
||||
|
||||
RecipeRadarMinimapButton:SetPoint("TOPLEFT", "Minimap", "CENTER", x/scale2 - 17 , y/scale2 + 17)
|
||||
|
||||
end
|
||||
|
||||
@@ -24,7 +24,11 @@ end
|
||||
-- This function safely initializes the player's personal skill database.
|
||||
-- If no player is supplied, the current player is assumed.
|
||||
function RecipeRadar_SkillDB_GetSafePlayerDB(player)
|
||||
|
||||
|
||||
if (not RecipeRadar_SkillDB) then
|
||||
RecipeRadar_SkillDB_Init()
|
||||
end
|
||||
|
||||
if (not player) then player = UnitName("player") end
|
||||
|
||||
local db = RecipeRadar_SkillDB[GetRealmName()]
|
||||
|
||||
Reference in New Issue
Block a user