• 0

    posted a message on wanted. addon tracker
    Good afternoon.
    bonjour.


    I search function that saves the name of the mob where I click a file in LUA.
    Je recherche la fonction qui sauve le nom du mob sur lequel je clique, dans un fichier LUA.

    sorry for my english. translated by Google.

    thank you for your help
    Posted in: AddOn HELP!
  • 0

    posted a message on Draw tactical map
    un grand merci.
    tout fonctionne bien.
    mais je n'arrive pas a afficher la texture de iconview

    One thank you.
    Everything works well.
    But I do not arrive has to show the texture of iconview
    Posted in: Addon Ideas
  • 0

    posted a message on Draw tactical map
    Selon le choix sélectionner dans dropdownmenu cela affiche une texture dans iconview.
    par la suite si je clique dans le frame corpdtm cela crée un frame avec la texture de iconview et cela a chaque fois que je clique dans le frame corpdtm.
    l ' idée et de faire comme art pad mais sans le dessin et avec un choix plus grand d'icon.

    According to the choice to select in dropdownmenu it posts(shows) a texture in iconview.
    Afterward if I click in the corpdtm frame it creates a frame with the texture of iconview and it has every time I click in the corpdtm frame.
    The idea and to make as art pad but without the drawing and with a bigger choice of icon.


    si cela peut aider a comprendre ce que j'aimerais faire.
    voici tous les fichiers de mon addon.
    If it can help has to understand(include) what I would like to make.
    Here are all the files of my addon.


    DrawTacticalMap.toc
    ## Interface: 30300
    ## Title: DrawTacticalMap
    ## Notes: Draw Tactical Map. thx WowAce Forum: OrionShock, jerry, Phanx, Xinhuan
    ## Author: Andfinnel
    ## Version: BetaTest
    DrawTacticalMap.lua



    DrawTacticalMap.lua
    --[[Draw Tactical Map (DTM)
    Addon de dessin de tactique, à suivre sur carte ]]--
    
    -- CorpDTM --
    -- CorpDTMFrame --
    local CorpDTM = CreateFrame("BUTTON","CorpDTM",WorldMapDetailFrame);
    CorpDTM:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",
    edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
    tile = true, 
    tileSize = 16, edgeSize = 16,insets = { left = 4, right = 4, top = 4, bottom = 4 }}
    ); 
    CorpDTM:SetBackdropColor(1,1,1,0.60); -- couleur de la frame (red,green,blue,alpha)
    CorpDTM:SetPoint("CENTER",0,0); -- position de la frame
    CorpDTM:SetWidth(1002); -- longeur de la frame
    CorpDTM:SetHeight(668); -- largeur de la frame
    CorpDTM:EnableMouse(true); -- empeche le clique sourie au travers de la frame
    CorpDTM:SetFrameStrata("FULLSCREEN_DIALOG"); -- niveau d'affichage
    -- CorpDTM Frame end --
    
    -- IconViewFrame --
    local IconView = CreateFrame("FRAME","IconView",CorpDTM);
    IconView:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",
    edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
    tile = true, 
    tileSize = 16, edgeSize = 16,insets = { left = 4, right = 4, top = 4, bottom = 4 }}); 
    IconView:SetBackdropColor(0,0,0,0.90); -- couleur de la frame (red,green,blue,alpha)
    IconView:SetPoint("BOTTOMRIGHT",-10,10); -- position de la frame
    IconView:SetWidth(50); -- longeur de la frame
    IconView:SetHeight(50); -- largeur de la frame
    -- IconViewFrame end --
    
    -- Close button frame --
    local CloseBtn = CreateFrame("BUTTON","CloseBtn",CorpDTM,"UIPanelCloseButton");
    CloseBtn:SetPoint("TOPRIGHT",0,0);
    CloseBtn:SetWidth(30);
    CloseBtn:SetHeight(30);
    -- Close button frame end --
         -- Close button Script --
         CloseBtn:SetScript("OnClick",
         function(self)
         PlaySound("MINIMAPCLOSE"); 
         self:GetParent():Hide();
         ChatFrame1:AddMessage("Fermer");
         StartDTM:EnableMouse(true);
         end);
         -- Close button Script end --
         
    -- Start Button frame --
    StartDTM = CreateFrame("Button","StartDTM",WorldMapQuestShowObjectives,"UIPanelButtonTemplate");
    StartDTM:SetPoint("RIGHT",-20,0);
    StartDTM:SetWidth(120);
    StartDTM:SetHeight(18);
    StartDTM:SetText("Draw Tactic Map");
    -- Start button frame end --
         -- Start button Script --
         StartDTM:SetScript("OnClick",
         function()
         ChatFrame1:AddMessage("Start");
         CorpDTM:Show();
         StartDTM:EnableMouse(false);
         PlaySound("MINIMAPOPEN");
         end);
        -- Start button Script end --
        
    ---------------- DropDownMenu ----------------
    
    -- Function IMG DropDownMenu --
    FunctionImg_1 = {0, 0.2617, 0.2617, 0.5234}; --Croix
    FunctionImg_2 = {0.5234, 0.2617, 0.2617, 0.5234}; --point 
    FunctionImg_3 = {0.5234, 0.2617, 0, 0.2617}; --Rond
    FunctionImg_4 = {0, 1, 0, 1}; 
    FunctionImg_5 = {0, 1, 0, 1}; 
      
    FunctionTex_1 = "Interface\\LFGFrame\\UI-LFG-ICON-ROLES"
    FunctionTex_2 = "Interface\\LFGFrame\\UI-LFG-ICON-ROLES"
    FunctionTex_3 = "Interface\\LFGFrame\\UI-LFG-ICON-ROLES"
    FunctionTex_4 = "Interface\\LootFrame\\LootPanel-Icon"
    FunctionTex_5 = "Interface\\TARGETINGFRAME\\UI-TargetingFrame-Skull"
    
    IconView:CreateTexture("FunctionImgTex");
    FunctionImgTex:SetAllPoints();
    FunctionImgTex:Hide();
    -- Function IMG DropDownMenu end --
    
    -- Function Raid DropDownMenu frame --
    FUNCTION_1 = "Tank"
    FUNCTION_2 = "Dps"
    FUNCTION_3 = "Heal"
    FUNCTION_4 = "Big Boss"
    FUNCTION_5 = "Mini Boss"
    
    local FunctionRaidMenu = CreateFrame("Frame", "FunctionRaidMenu", CorpDTM, "UIDropDownMenuTemplate");
    FunctionRaidMenu:ClearAllPoints();
    FunctionRaidMenu:SetPoint("TOPLEFT", CorpDTM, 10, -10);
    FunctionRaidMenu:Show();
    
    UIDropDownMenu_SetWidth(FunctionRaidMenu, 110);
    UIDropDownMenu_SetButtonWidth(FunctionRaidMenu, 124);
    UIDropDownMenu_JustifyText(FunctionRaidMenu, "LEFT");
    UIDropDownMenu_SetText(FunctionRaidMenu, "Select Function");
    
    local checkedArg = nil
    
    local function isChecked(index)
          if index == checkedArg then
            return true
        else
            return false
        end;
    end;
    local function onClickFunc(self, arg1, ...)
        print("Non-localized id: ", arg1 );
        print("Selected: ", _G["FUNCTION_"..arg1] );
        FunctionImgTex:SetTexCoord(unpack(_G["FunctionImg_"..arg1]));
        FunctionImgTex:SetTexture( _G["FunctionTex_"..arg1]);
        RaidImgTex:Hide();
        ArrowImgTex:Hide();
        FunctionImgTex:Show();
        checkedArg = arg1
        UIDropDownMenu_SetText(FunctionRaidMenu, UIDropDownMenuButton_GetName(self) );
    end;
    
    local FunctionList = {
        {text = NONE, func = onClickFunc, checked = function() return isChecked("NONE") end, arg1 = "NONE" },
        {text = FUNCTION_1, func = onClickFunc, checked = function() return isChecked(1) end, arg1 = 1 },
        {text = FUNCTION_2, func = onClickFunc, checked = function() return isChecked(2) end, arg1 = 2 },
        {text = FUNCTION_3, func = onClickFunc, checked = function() return isChecked(3) end, arg1 = 3 },
        {text = FUNCTION_4, func = onClickFunc, checked = function() return isChecked(4) end, arg1 = 4 },
        {text = FUNCTION_5, func = onClickFunc, checked = function() return isChecked(5) end, arg1 = 5 },
    }
    
    FunctionRaidMenuButton:SetScript("OnClick", function(self, button, ...)
        if UIDropDownMenu_GetCurrentDropDown() == FunctionRaidMenu and DropDownList1:IsShown() then
            CloseDropDownMenus();
        else
            EasyMenu(FunctionList, FunctionRaidMenu, self:GetName(), 0, 0, nil);
        end;
    end);
    -- Function Raid DropDownMenu frame end--
    
    -----------------------------------------------------------
    
    -- IconRaid IMG DropDownMenu --
    RaidImg_1 = {0,0.25,0,0.25}; --étoile
    RaidImg_2 = {0.5,0.25,0,0.25}; --rond
    RaidImg_3 = {0.75,0.5,0,0.25}; --losange
    RaidImg_4 = {1,0.75,0,0.25}; --triangle
    RaidImg_5 = {0,0.25,0.25,0.5}; --lune
    RaidImg_6 = {0.25,0.5,0.25,0.5}; --carré
    RaidImg_7 = {0.5,0.75,0.25,0.5}; --croix
    RaidImg_8 = {0.75,1,0.25,0.5}; --crâne
    
    IconView:CreateTexture("RaidImgTex");
    RaidImgTex:SetAllPoints();
    RaidImgTex:SetTexture("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcons");
    RaidImgTex:Hide();
    -- IconRaid IMG DropDownMenu end --
    
    -- Icon Raid DropDownMenu frame --
    local IconRaidMenu = CreateFrame("Frame", "IconRaidMenu", CorpDTM, "UIDropDownMenuTemplate");
    IconRaidMenu:ClearAllPoints();
    IconRaidMenu:SetPoint("TOPLEFT", CorpDTM, 160, -10);
    IconRaidMenu:Show();
    
    UIDropDownMenu_SetWidth(IconRaidMenu, 100);
    UIDropDownMenu_SetButtonWidth(IconRaidMenu, 124);
    UIDropDownMenu_JustifyText(IconRaidMenu, "LEFT");
    UIDropDownMenu_SetText(IconRaidMenu, "Select Icons");
    
    local checkedArg = nil
    
    local function isChecked(index)
        if index == checkedArg then
            return true
        else
            return false
        end;
    end;
    local function onClickFunc(self, arg1, ...)
        print("Non-localized id: ", arg1 );
        print("Selected: ", _G["RAID_TARGET_"..arg1] );
        RaidImgTex:SetTexCoord(unpack(_G["RaidImg_"..arg1]));
        FunctionImgTex:Hide();
        ArrowImgTex:Hide();
        RaidImgTex:Show();
        checkedArg = arg1
        UIDropDownMenu_SetText(IconRaidMenu, UIDropDownMenuButton_GetName(self) );
    end;
    
    local IconRaidMenuList = {
        {text = NONE, func = onClickFunc, checked = function() return isChecked("NONE") end, arg1 = "NONE" },
        {text = RAID_TARGET_1, func = onClickFunc, checked = function() return isChecked(1) end, arg1 = 1 },
        {text = RAID_TARGET_2, func = onClickFunc, checked = function() return isChecked(2) end, arg1 = 2 },
        {text = RAID_TARGET_3, func = onClickFunc, checked = function() return isChecked(3) end, arg1 = 3 },
        {text = RAID_TARGET_4, func = onClickFunc, checked = function() return isChecked(4) end, arg1 = 4 },
        {text = RAID_TARGET_5, func = onClickFunc, checked = function() return isChecked(5) end, arg1 = 5 },
        {text = RAID_TARGET_6, func = onClickFunc, checked = function() return isChecked(6) end, arg1 = 6 },
        {text = RAID_TARGET_7, func = onClickFunc, checked = function() return isChecked(7) end, arg1 = 7 },
        {text = RAID_TARGET_8, func = onClickFunc, checked = function() return isChecked(8) end, arg1 = 8 },
    }
    
    IconRaidMenuButton:SetScript("OnClick", function(self, button, ...)
        if UIDropDownMenu_GetCurrentDropDown() == IconRaidMenu and DropDownList1:IsShown() then
            CloseDropDownMenus();
        else
            EasyMenu(IconRaidMenuList, IconRaidMenu, self:GetName(), 0, 0, nil);
        end;
    end);  
    -- Icon Raid DropDownMenu frame end --
    
    -----------------------------------------------------------
    
    -- Arrow IMG DropDownMenu --
    ArrowTrac_1 = {0, 0.5, 0.5, 0}; --Croix
    ArrowTrac_2 = {0, 0.5, 0.5, 1}; --point 
    ArrowTrac_3 = {1, 0.5, 0.5, 0}; --Rond
    
    IconView:CreateTexture("ArrowImgTex");
    ArrowImgTex:SetAllPoints();
    ArrowImgTex:SetTexture("Interface\\Glues\\LOADINGSCREENS\\DynamicElements");
    ArrowImgTex:Hide();
    -- Arrow IMG DropDownMenu end --
    
    -- Arrow Raid DropDownMenu frame --
    ARROW_1 = "Départ"
    ARROW_2 = "Tracer"
    ARROW_3 = "Arrivée"
    
    local ArrowRaidMenu = CreateFrame("Frame", "ArrowRaidMenu", CorpDTM, "UIDropDownMenuTemplate");
    ArrowRaidMenu:ClearAllPoints();
    ArrowRaidMenu:SetPoint("TOPLEFT", CorpDTM, 300, -10);
    ArrowRaidMenu:Show();
    
    UIDropDownMenu_SetWidth(ArrowRaidMenu, 100);
    UIDropDownMenu_SetButtonWidth(ArrowRaidMenu, 124);
    UIDropDownMenu_JustifyText(ArrowRaidMenu, "LEFT");
    UIDropDownMenu_SetText(ArrowRaidMenu, "Select Arrow");
    
    local checkedArg = nil
    
    local function isChecked(index)
        if index == checkedArg then
            return true
        else
            return false
        end;
    end;
    local function onClickFunc(self, arg1, ...)
        print("Non-localized id: ", arg1 );
        print("Selected: ", _G["ARROW_"..arg1] );
        ArrowImgTex:SetTexCoord(unpack(_G["ArrowTrac_"..arg1]));
        FunctionImgTex:Hide();
        RaidImgTex:Hide();
        ArrowImgTex:Show();
        checkedArg = arg1
        UIDropDownMenu_SetText(ArrowRaidMenu, UIDropDownMenuButton_GetName(self) );  
     end;
    
    
    local ArrowRaidMenuList = {
        {text = NONE, func = onClickFunc, checked = function() return isChecked("NONE") end, arg1 = "NONE" },
        {text = ARROW_1, func = onClickFunc, checked = function() return isChecked(1) end, arg1 = 1 },
        {text = ARROW_2, func = onClickFunc, checked = function() return isChecked(2) end, arg1 = 2 },
        {text = ARROW_3, func = onClickFunc, checked = function() return isChecked(3) end, arg1 = 3 },
    }
    
    ArrowRaidMenuButton:SetScript("OnClick", function(self, button, ...)
        if UIDropDownMenu_GetCurrentDropDown() == ArrowRaidMenu and DropDownList1:IsShown() then
            CloseDropDownMenus();
        else
            EasyMenu(ArrowRaidMenuList, ArrowRaidMenu, self:GetName(), 0, 0, nil);
        end;
    end);  
    -- Arrow Raid DropDownMenu frame end --
    
    ---------------- DropDownMenu end ----------------
    
    -- Mouse enter in frame
    
    -- ZoneClick Frame --
    
    -- ZoneClick Script --
    CorpDTM:RegisterForClicks("anyUp");
    
    CorpDTM:SetScript("OnClick", function(self, button)
    
    
           if button == "RightButton" then
    
               local x, y = GetCursorPosition()
               local scale = self:GetEffectiveScale()
               x = x / scale
               y = y / scale
               
               IconCreat = CreateFrame("FRAME","IconCreat",CorpDTM);
               IconCreat:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background"});
               IconCreat:SetBackdropColor(1,1,1,1); -- couleur de la frame (red,green,blue,alpha)
               --IconView:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x, y); -- position de la frame
               IconCreat:SetWidth(50); -- longeur de la frame
               IconCreat:SetHeight(50); -- largeur de la frame
               --IconView:ClearAllPoints()
               IconCreat:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x, y); -- position de la frame
    
    
       
               -- do something // alors affiche quelque chose
              ChatFrame1:AddMessage("RightButton");
              elseif button == "LeftButton" then
              -- do something else // alors affiche autre chose
              ChatFrame1:AddMessage("LeftButton");
           end;
    
    end);
    
    CorpDTM:SetScript("OnEnter", function(self, button)
    
            
        ChatFrame1:AddMessage("Mouse in Frame");
    end);
    -- ZoneClick Script end --
     -- Mouse Out Frame
    CorpDTM:SetScript("OnLeave", function(self)
           
            
       ChatFrame1:AddMessage("Mouse out frame");
    end);
    
    --------------------------------------------------
    
    --CorpDTM end --
    Posted in: Addon Ideas
  • 0

    posted a message on Draw tactical map
    merci.
    pour les coordonnées cela fonctionne correctement.
    Pour le frame ce n ' est pas ce que je recherche.
    Cela ne fait que déplacer le frame alors que je voudrais créer un copie ou un duplicata du frame.
    Ou utiliser la texture du frame IconView sur le frame créé

    Thank you.
    For coordinates it works correctly.
    For the frame it is not what I look for.
    It is only moving the frame while I would like to create one copy or a duplicate of the frame.
    Or use the texture of the frame IconView on the created frame
    Posted in: Addon Ideas
  • 0

    posted a message on Draw tactical map
    je vois bien "RightButton» ou «LeftButton» imprimé sur la fenêtre de tchat.
    existe il une fonction pour copier ou cloner une frame et sa texture pour remplacer mon code?

    I see good "RightButton" or "LeftButton" printed on the window of chat.
    Exists he(it) a function(office) to copy or clone a frame and its texture to replace my code?
    Posted in: Addon Ideas
  • 0

    posted a message on Draw tactical map
    ok voici mon codage.
    mais l'icon ne s ' affiche que en bas à gauche du frame corpDTM.
    pourquoi ?

    OK here is my coding.
    But Icon not ' posts(shows) that below on the left of the corpDTM frame.
    Why?


           if button == "RightButton" then
    
            local x, y = GetCursorPosition()
            local left, top = CorpDTM:GetLeft(), CorpDTM:GetTop()
            local width = CorpDTM:GetWidth()
            local height = CorpDTM:GetHeight()
            local scale = CorpDTM:GetEffectiveScale()
            local cx = (x/scale - left) / width
            local cy = (top - y/scale) / height
            
    IconCreat = CreateFrame("FRAME","IconCreat",CorpDTM);
    IconCreat:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background"});
    IconCreat:SetBackdropColor(1,1,1,1); -- couleur de la frame (red,green,blue,alpha)
    IconCreat:SetPoint("CENTER", CorpDTM, "BOTTOMLEFT", cx, cy); -- position de la frame
    IconCreat:SetWidth(30); -- longeur de la frame
    IconCreat:SetHeight(30); -- largeur de la frame
    
       
            -- do something // alors affiche quelque chose
            ChatFrame1:AddMessage("RightButton");
        elseif button == "LeftButton" then
            -- do something else // alors affiche autre chose
            ChatFrame1:AddMessage("LeftButton");
        end;
    
    end);


    ps : code pris de l ' addon TOMTOM
    Ps: code taken by the addon TOMTOM
    Posted in: Addon Ideas
  • 0

    posted a message on Draw tactical map
    ok cela fonctionne mais j'ai un décalage avec mon frame quand la carte est réduite.
    y a-t-il un moyen de corriger le décalage ?

    OK it works but I have a gap with my frame when the map is reduced.
    Is there a means to correct the gap?
    Posted in: Addon Ideas
  • 0

    posted a message on Draw tactical map
    Quote from Phanx
    GetCursorPosition() returns the current X, Y coordinates of the cursor, relative to the bottom left corner of the UIParent.


    ok thx Phanx

    [COLOR="Red"]local x,y = GetCursorCoords();[/COLOR]	   
    IconCreat = CreateFrame("FRAME","IconCreat",CorpDTM);
    IconCreat:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background"});
    IconCreat:SetBackdropColor(1,1,1,1); -- couleur de la frame (red,green,blue,alpha)
    IconCreat:SetPoint("CENTER",[COLOR="Red"]x[/COLOR],[COLOR="Red"]y[/COLOR]); -- position de la frame
    IconCreat:SetWidth(30); -- longeur de la frame
    IconCreat:SetHeight(30); -- largeur de la frame


    Mais il ne se passe rien ?
    But there is not anything?
    Posted in: Addon Ideas
  • 0

    posted a message on Draw tactical map
    ok cela affiche bien un frame au centre de corpDTM
    Mais comment afficher le frame a la position du curseur ?
    OK it shows well a frame in the center of corpDTM
    But how to show the frame has the position of the cursor?



    if button == "RightButton" then
    	   
    IconCreat = CreateFrame("FRAME","IconCreat",CorpDTM);
    IconCreat:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background"});
    IconCreat:SetBackdropColor(1,1,1,1); -- couleur de la frame (red,green,blue,alpha)
    IconCreat:SetPoint("CENTER",0,0); -- position de la frame
    IconCreat:SetWidth(30); -- longeur de la frame
    IconCreat:SetHeight(30); -- largeur de la frame
    Posted in: Addon Ideas
  • 0

    posted a message on SetScript for Frame
    ok cela affiche bien un frame au centre de corpDTM
    Mais comment afficher le frame a la position du curseur ?
    OK it shows well a frame in the center of corpDTM
    But how to show the frame has the position of the cursor?


           if button == "RightButton" then
    	   
    IconCreat = CreateFrame("FRAME","IconCreat",CorpDTM);
    IconCreat:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background"});
    IconCreat:SetBackdropColor(1,1,1,1); -- couleur de la frame (red,green,blue,alpha)
    IconCreat:SetPoint("CENTER",0,0); -- position de la frame
    IconCreat:SetWidth(30); -- longeur de la frame
    IconCreat:SetHeight(30); -- largeur de la frame
    Posted in: AddOn HELP!
  • 0

    posted a message on SetScript for Frame
    Bon ... Maintenant comment afficher dans corpDTM l'icon choisi par le dropdownmenu. ???
    Voucher... Now how to show in corpDTM the icon chosen by the dropdownmenu.

    DropDownMenu :
    -- Arrow IMG DropDownMenu --
    ArrowTrac_1 = {0, 0.5, 0.5, 0}; --Croix
    ArrowTrac_2 = {0, 0.5, 0.5, 1}; --point 
    ArrowTrac_3 = {1, 0.5, 0.5, 0}; --Rond
    
    IconView:CreateTexture("ArrowImgTex");
    ArrowImgTex:SetAllPoints();
    ArrowImgTex:SetTexture("Interface\\Glues\\LOADINGSCREENS\\DynamicElements");
    ArrowImgTex:Hide();
    -- Arrow IMG DropDownMenu end --
    
    -- Arrow Raid DropDownMenu frame --
    ARROW_1 = "Départ"
    ARROW_2 = "Tracer"
    ARROW_3 = "Arrivée"
    
    local ArrowRaidMenu = CreateFrame("Frame", "ArrowRaidMenu", CorpDTM, "UIDropDownMenuTemplate");
    ArrowRaidMenu:ClearAllPoints();
    ArrowRaidMenu:SetPoint("TOPLEFT", CorpDTM, 300, -10);
    ArrowRaidMenu:Show();
    
    UIDropDownMenu_SetWidth(ArrowRaidMenu, 100);
    UIDropDownMenu_SetButtonWidth(ArrowRaidMenu, 124);
    UIDropDownMenu_JustifyText(ArrowRaidMenu, "LEFT");
    UIDropDownMenu_SetText(ArrowRaidMenu, "Select Arrow");
    
    local checkedArg = nil
    
    local function isChecked(index)
        if index == checkedArg then
            return true
        else
            return false
        end;
    end;
    local function onClickFunc(self, arg1, ...)
        print("Non-localized id: ", arg1 );
        print("Selected: ", _G["ARROW_"..arg1] );
    	ArrowImgTex:SetTexCoord(unpack(_G["ArrowTrac_"..arg1]));
    	FunctionImgTex:Hide();
    	RaidImgTex:Hide();
        ArrowImgTex:Show();
        checkedArg = arg1
        UIDropDownMenu_SetText(ArrowRaidMenu, UIDropDownMenuButton_GetName(self) );  
     end;
    
    
    local ArrowRaidMenuList = {
        {text = NONE, func = onClickFunc, checked = function() return isChecked("NONE") end, arg1 = "NONE" },
        {text = ARROW_1, func = onClickFunc, checked = function() return isChecked(1) end, arg1 = 1 },
        {text = ARROW_2, func = onClickFunc, checked = function() return isChecked(2) end, arg1 = 2 },
        {text = ARROW_3, func = onClickFunc, checked = function() return isChecked(3) end, arg1 = 3 },
    }
    
    ArrowRaidMenuButton:SetScript("OnClick", function(self, button, ...)
        if UIDropDownMenu_GetCurrentDropDown() == ArrowRaidMenu and DropDownList1:IsShown() then
            CloseDropDownMenus();
        else
            EasyMenu(ArrowRaidMenuList, ArrowRaidMenu, self:GetName(), 0, 0, nil);
        end;
    end);  
    -- Arrow Raid DropDownMenu frame end --


    Script show in frame:
    CorpDTM:RegisterForClicks("anyUp");
    
    CorpDTM:SetScript("OnClick", function(self, button)
           if button == "RightButton" then
            -- Show Icon in Frame
    		ChatFrame1:AddMessage("RightButton");
        elseif button == "LeftButton" then
            -- do something else
    		ChatFrame1:AddMessage("LeftButton");
        end;
    
    end);
    Posted in: AddOn HELP!
  • 0

    posted a message on SetScript for Frame
    encore merci Phanx.
    J'ai compris pourquoi cela ne fonctionné pas.
    j'ai changer
    Still thank you Phanx.
    I understood why it not worked not.
    I have to change

    local CorpDTM = CreateFrame("[COLOR="Red"]FRAME[/COLOR]","CorpDTM",WorldMapDetailFrame);

    par
    By
    local CorpDTM = CreateFrame("[COLOR="SeaGreen"]BUTTON[/COLOR]","CorpDTM",WorldMapDetailFrame);


    et la sa fonctionne.
    And his(her,its) work.
    Posted in: AddOn HELP!
  • 0

    posted a message on SetScript for Frame
    Je ne comprend pas la fonction et...
    je ne sais pas ou la placer.
    I does not include the function and...
    I do not know how to or place her(it).


    je recherche la fonction qui ...
    si je clique droite sur le frame (corpDTM) alors affiche quelque chose ou alors si
    je clique gauche sur le frame (coprDTM) alors affiche autre chose

    I to look for
    If I click rightButton in frame ( corpdtm ) then show something. else
    if I click leftButton in frame ( coprDTM ) then show the other thing


    i am noob in programming
    Posted in: AddOn HELP!
  • 0

    posted a message on SetScript for Frame
    merci Phanx.
    Tes deux proposition me sont très utile mais OnClick ne marche pas cela est peut-être dû au faite que mon frame CoprDTM est CorpDTM:EnableMouse(1)
    si oui alors je dois créer une zone cliquable dans CorpDTM. ?

    Thank Phanx.
    you two proposition are me very useful but OnClick does not work it is maybe due in made that my frame CoprDTM is CorpDTM:EnableMouse ( 1 )
    if yes then I have to create a clickable zone in CorpDTM. ?


    -- Mouse enter in frame
    CorpDTM:SetScript("OnEnter", function(self, button)
         		
            if button == "LeftButton" then
    		ChatFrame1:AddMessage("Click left in Frame")
    		elseif button == "RightButton" then
    		ChatFrame1:AddMessage("Click right in Frame")
    		end
    		
        ChatFrame1:AddMessage("Mouse in Frame")
    end)
    Posted in: AddOn HELP!
  • 0

    posted a message on SetScript for Frame
    tanks Phanx :D

    -- Arrow IMG DropDownMenu frame --
      ArrowTrac_1 = {0, 0.5, 0.5, 0} --Croix
      ArrowTrac_2 = {0, 0.5, 0.5, 1} --point 
      ArrowTrac_3 = {1, 0.5, 0.5, 0} --Rond
    
    
     CreateFrame("Frame","ArrowImg",IconView)
    ArrowImg:SetWidth(30)
    ArrowImg:SetHeight(30)
    ArrowImg:SetPoint("CENTER",0,0)
    ArrowImg:CreateTexture("ArrowImgTex")
    ArrowImgTex:SetAllPoints()
    ArrowImgTex:SetTexture("Interface\\Glues\\LOADINGSCREENS\\DynamicElements")
    ArrowImg:Hide()
    -- Arrow IMG DropDownMenu frame end --
    
    -- Arrow Raid DropDownMenu frame --
    
    ARROW_1 = "Départ"
    ARROW_2 = "Tracer"
    ARROW_3 = "Arrivée"
    
    local ArrowRaidMenu = CreateFrame("Frame", "ArrowRaidMenu", CorpDTM, "UIDropDownMenuTemplate")
    
    ArrowRaidMenu:ClearAllPoints()
    ArrowRaidMenu:SetPoint("TOPLEFT", CorpDTM, 300, -10)
    ArrowRaidMenu:Show()
    
    UIDropDownMenu_SetWidth(ArrowRaidMenu, 100);
    UIDropDownMenu_SetButtonWidth(ArrowRaidMenu, 124)
    UIDropDownMenu_JustifyText(ArrowRaidMenu, "LEFT")
    UIDropDownMenu_SetText(ArrowRaidMenu, "Select Arrow")
    
    local checkedArg = nil
    
    local function isChecked(index)
    
        if index == checkedArg then
            return true
        else
            return false
        end
    end
    local function onClickFunc(self, arg1, ...)
        print("Non-localized id: ", arg1 )
        print("Selected: ", _G["ARROW_"..arg1] )
    	ArrowImgTex:SetTexCoord(unpack(_G["ArrowTrac_"..arg1]))
    	RaidImg:Hide()
    	FunctionImg:Hide()
    	ArrowImg:Show()
        checkedArg = arg1
        UIDropDownMenu_SetText(ArrowRaidMenu, UIDropDownMenuButton_GetName(self) )
    
    end
    
    local ArrowRaidMenuList = {
    
        {text = NONE, func = onClickFunc, checked = function() return isChecked("NONE") end, arg1 = "NONE" },
        {text = ARROW_1, func = onClickFunc, checked = function() return isChecked(1) end, arg1 = 1 },
        {text = ARROW_2, func = onClickFunc, checked = function() return isChecked(2) end, arg1 = 2 },
        {text = ARROW_3, func = onClickFunc, checked = function() return isChecked(3) end, arg1 = 3 },
    
    }
    
    ArrowRaidMenuButton:SetScript("OnClick", function(self, button, ...)
        if UIDropDownMenu_GetCurrentDropDown() == ArrowRaidMenu and DropDownList1:IsShown() then
            CloseDropDownMenus()
        else
            EasyMenu(ArrowRaidMenuList, ArrowRaidMenu, self:GetName(), 0, 0, nil)
        end
    end)  
    -- Arrow Raid DropDownMenu frame end --


    Comment afficher icon = Tank dans frame si arg1 = 1
    How to show icon = Tank in frame if arg1 = 1

    CorpDTM:SetScript("OnEnter", function(self)
    
    [COLOR="Red"]If CorpDTM:SetScript(OneClick", function(self)
    arg1=1 then "show tank icon" in CorpDTM in Coordinated Mouse
    or if arg1=2 then "show DPS icon" in CorpDTM in Coordinated Mouse
    or if arg1=2 then "show Heal icon" in CorpDTM in Coordinated Mouse
    end)[/COLOR]
    
    end)
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.