View Single Post
Old 10-25-10, 02:09 PM   #1
RVCA18
A Murloc Raider
 
RVCA18's Avatar
Join Date: Oct 2010
Posts: 5
Post Dynamic Updating

Hi spiel2001,

I reworked some of the code to allow the map to be updated on the fly while you are in rainbow mode or as soon as you have entered one of the other slash commands.

This works out well when using the map in mini-mode.

The changes are below in red:

Code:
function worldMapFrame_UpdateOverlays(dtlFrame, ovrLay, scalingFactor, oAlpha)
    ...
    if(MozzFullWorldMap.colorStyle == 0) then
        texture:SetVertexColor(0.2,0.6,1.0) -- EMERALD
        MozzFullWorldMap.colorArray = {r=0.2,g=0.6,b=1.0}
    ...
end
Code:
function MozzFullWorldMap_Command(msg)
    ...
    WorldMapFrame_Update()
end
Code:
function MFWM_SetUpColourPicker()
    local col = MozzFullWorldMap.colorArray;
    ColorPickerFrame.hasOpacity = true;
    ColorPickerFrame.opacity = 1 - MozzFullWorldMap.transparency;
    ColorPickerFrame.func = MFWM_AcceptColour;
    ColorPickerFrame.opacityFunc = MFWM_AcceptColour;
    ColorPickerFrame.cancelFunc = MFWM_CancelColourPicker;
    -- if statement removed
    ColorPickerFrame.previousValues = { col.r, col.g, col.b, MozzFullWorldMap.transparency };
    ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG");
    ColorPickerFrame:SetColorRGB( col.r, col.g, col.b );
    OpacitySliderFrame:SetValue(ColorPickerFrame.opacity);
    ColorPickerFrame:Show();
end
Code:
function MFWM_AcceptColour()
    ...
    WorldMapFrame_Update()
end
Code:
function MFWM_CancelColourPicker(col)
    MozzFullWorldMap.transparency = tonumber(col[4]);
    -- if statement removed
    MozzFullWorldMap.colorArray = {};
    MozzFullWorldMap.colorArray.r = col[1];
    MozzFullWorldMap.colorArray.g = col[2];
    MozzFullWorldMap.colorArray.b = col[3];
    MozzFullWorldMap.colorStyle = 2;
    WorldMapFrame_Update()
end
Let me know if you have an issues trying this out, you may have to delete the saved variable file.

ps, I was wondering if you had a repository, maybe I could submit my file.
__________________

Last edited by RVCA18 : 10-25-10 at 10:15 PM.
RVCA18 is offline