• 0

    posted a message on New dev tool - Addon Studio for World of Warcraft
    Sorry for that
    Posted in: Frameworks
  • 0

    posted a message on New dev tool - Addon Studio for World of Warcraft
    Personnaly I tried the Addon Studio for World of Warcraft 3.0 (version for visual studio 2010) as I am myself a noob in lua programming, but as others rightly said it will do more harm to your programming skills than doing it "the hard way". Even on their own claim the visual xml editor is not working properly. Like trying to make it movable: if you do not also select the title bar toggle, it will not be movable at all. If you change the sizeable prpoerty to true, it will not respond to any mouse click or drag. You'll end up moving the camera in the game, just as if you would not have any addon activated.

    Now that I am trying to learn it by coding by hand, it is easier to figure out what does and what doesn't work. So for now on I use the Ace3.0 libraries to create addons, and Notepad++ to enter my code. IMHO coding everything by hand is the best way to learn how to create addons, and sometimes it can even be the fastest way. Makes me remember programming BASIC on a TRS80 Color Computer 3. There was no IDE at all, no internet to get information about how to create programs. But it came with a handy user guide with all the keywords, tutorials, examples on most of the different keywords, and how to do some usefull stuff with it. And of course some magazines where available at the time (Rainbow, Hot Coco; those twp where dedicated to TRS80 coco 2 or coco 3 programming).

    It might be a good evolution to have visual programming like the Visual Studio software, but we might leave it to the very languages that are intended for it. But for addon creation, it is still best to avoid this, since any graphical aid for that matter will still be a limited way of doing things. Windows Form Application is a good way to go with a WYSIWYG, because it seems to be the best approach concerning Windows applications programming. And still there is a lot of hand coding involved.

    Until a complete, fully implemented, good working visual programming interface sees light, hand coding everything is still the way to go for a long while.

    And FYI, the next Addon Studio will be called Lua Studio, without the visual designer. They themselve say that it was too hard to be correctly implemented, so they will just cancel the visual xml designer.
    Posted in: Frameworks
  • 0

    posted a message on WelcomeHome - Your first Ace3 Addon
    Quote from Cowberty
    okay so here's what I got...http://wowace.pastey.net/102175

    but it's only just an exact copy of the code that's at the end of the tutorial. It wasn't working through the progression of the tutorial so i just decided to copy and paste the final code to see if that worked...but nothing..=(


    Delete that line:

     if GetBindLocation() == GetSubZoneText() then

    That if statement only works when using your heart stone to actually go home.



    Here is the correct full code:
    WelcomeHome = LibStub("AceAddon-3.0"):NewAddon("WelcomeHome", "AceConsole-3.0", "AceEvent-3.0")
    local L = LibStub("AceLocale-3.0"):GetLocale("WelcomeHome")
    
    
    local options = {
        name = "WelcomeHome",
        handler = WelcomeHome,
        type = 'group',
        args = {
            msg = {
                type = 'input',
                name = L['Message'],
                desc = L['The message to be displayed when you get home.'],
                usage = L['<Your message>'],
                get = 'GetMessage',
                set = 'SetMessage',
            },
            showInChat = {
                type = 'toggle',
                name = L['Show in Chat'],
                desc = L['Toggles the display of the message in the chat window.'],
                get = 'IsShowInChat',
                set = 'ToggleShowInChat',
            },
            showOnScreen = {
                type = 'toggle',
                name = L['Show on Screen'],
                desc = L['Toggles the display of the message on the screen.'],
                get = 'IsShowOnScreen',
                set = 'ToggleShowOnScreen',
            },
        },
    }
    
    local defaults = {
        profile =  {
            message = L["Welcome Home!"],
            showInChat = true,
            showOnScreen = true,
        },
    }
    
    function WelcomeHome:OnInitialize()
        -- Called when the addon is loaded
        self.db = LibStub("AceDB-3.0"):New("WelcomeHomeDB", defaults, "Default")
    
        LibStub("AceConfig-3.0"):RegisterOptionsTable("WelcomeHome", options, [COLOR="Red"]{"wh", "WelcomeHome"}[/COLOR])
        self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("WelcomeHome", "WelcomeHome")
        self:RegisterChatCommand("wh", "ChatCommand")
        self:RegisterChatCommand("welcomehome", "ChatCommand")
    end
    
    function WelcomeHome:OnEnable()
        -- Called when the addon is enabled
    	self:Print("OnEnabled Called with Zone")
        self:RegisterEvent("ZONE_CHANGED")
    end
    
    function WelcomeHome:ZONE_CHANGED()
        
            if self.db.profile.showInChat then
                self:Print(self.db.profile.message)
            end
    
            if self.db.profile.showOnScreen then
                UIErrorsFrame:AddMessage(self.db.profile.message, 1.0, 1.0, 1.0, 5.0)
            end
       
    end
    
    function WelcomeHome:ChatCommand(input)
        if not input or input:trim() == "" then
            InterfaceOptionsFrame_OpenToCategory(self.optionsFrame)
        else
            LibStub("AceConfigCmd-3.0").HandleCommand(WelcomeHome, "wh", "WelcomeHome", input)
        end
    end
    
    function WelcomeHome:GetMessage(info)
        return self.db.profile.message
    end
    
    function WelcomeHome:SetMessage(info, newValue)
        self.db.profile.message = newValue
    end
    
    function WelcomeHome:IsShowInChat(info)
        return self.db.profile.showInChat
    end
    
    function WelcomeHome:ToggleShowInChat(info, value)
        self.db.profile.showInChat = value
    end
    
    function WelcomeHome:IsShowOnScreen(info)
        return self.db.profile.showOnScreen
    end
    
    function WelcomeHome:ToggleShowOnScreen(info, value)
        self.db.profile.showOnScreen = value
    end
    





    See the part I highligted in red color? that's what was missing in order for the chat command to actually work, you have to add them when you register you options table. I also found that the if statement at the beginning of the WelcomeHome:ZONED_CHANGED() was not needed, and caused the addon to not work, so no zone changing was detected at all. Now it should work.

    And change the ##Interface: 30000 to 40000 in the toc file, so the addon won't trigger an outdated statement to the WoW engine. Don't forget to change it to 40100 when the 4.1.0 patch gets released.

    Here is a variant that prints the location in the chat and on the screen. I took out the 'message' option and instead print a greetings message when you enter in any zone.

    WelcomeHome = LibStub("AceAddon-3.0"):NewAddon("WelcomeHome", "AceConsole-3.0", "AceEvent-3.0")
    local L = LibStub("AceLocale-3.0"):GetLocale("WelcomeHome")
    
    
    local options = {
        name = "WelcomeHome",
        handler = WelcomeHome,
        type = 'group',
        args = {
            
            showInChat = {
                type = 'toggle',
                name = L['Show in Chat'],
                desc = L['Toggles the display of the message in the chat window.'],
                get = 'IsShowInChat',
                set = 'ToggleShowInChat',
            },
            showOnScreen = {
                type = 'toggle',
                name = L['Show on Screen'],
                desc = L['Toggles the display of the message on the screen.'],
                get = 'IsShowOnScreen',
                set = 'ToggleShowOnScreen',
            },
        },
    }
    
    local defaults = {
        profile =  {
            
            showInChat = true,
            showOnScreen = true,
        },
    }
    
    function WelcomeHome:OnInitialize()
        -- Called when the addon is loaded
        self.db = LibStub("AceDB-3.0"):New("WelcomeHomeDB", defaults, "Default")
    
        LibStub("AceConfig-3.0"):RegisterOptionsTable("WelcomeHome", options, {"wh", "WelcomeHome"})
        self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("WelcomeHome", "WelcomeHome")
        self:RegisterChatCommand("wh", "ChatCommand")
        self:RegisterChatCommand("welcomehome", "ChatCommand")
    end
    
    function WelcomeHome:OnEnable()
        -- Called when the addon is enabled
    	self:Print("OnEnabled Called with Zone")
        self:RegisterEvent("ZONE_CHANGED")
    	self:RegisterEvent("ZONE_CHANGED_INDOORS")
    end
    function WelcomeHome:ZONE_CHANGED()
    		-- Prints a welcome to <subzone> : <mainzone> message 
    		if GetSubZoneText() ~= "" then 
    			if self.db.profile.showInChat then
    				self:Print("Bienvenue à" .. " " .. GetSubZoneText() .. " : " .. GetRealZoneText())
    			
    			end
    
    			if self.db.profile.showOnScreen then
    				UIErrorsFrame:AddMessage(("Bienvenue à" .. " " .. GetSubZoneText() .. " : " .. GetRealZoneText()), 1.0, 1.0, 1.0, 5.0)
    			end
    			
    		end
    		-- Print only the mainzone if GetZubZone returns nothing
    		if GetSubZoneText() == "" then 
    			if self.db.profile.showInChat then
    				self:Print("Bienvenue à" .. " " .. GetRealZoneText())
    			
    			end
    
    			if self.db.profile.showOnScreen then
    				UIErrorsFrame:AddMessage(("Bienvenue à" .. " " .. GetRealZoneText()), 1.0, 1.0, 1.0, 5.0)
    			end
    			
    		end
    	end	
    function WelcomeHome:ZONE_CHANGED_INDOORS()
    			-- prints the welcome message when entering a city, or an indoor zone
    			if self.db.profile.showInChat then
    				self:Print("Bienvenue à" .. " " .. GetMinimapZoneText() .. "  :  " .. GetRealZoneText())
    			
    			end
    
    			if self.db.profile.showOnScreen then
    				UIErrorsFrame:AddMessage(("Bienvenue à" .. " " .. GetMinimapZoneText() .. "  :  " .. GetRealZoneText()), 1.0, 1.0, 1.0, 5.0)
    			end
    			
    		
    		
    end
    
    
    
    function WelcomeHome:ChatCommand(input)
        if not input or input:trim() == "" then
            InterfaceOptionsFrame_OpenToCategory(self.optionsFrame)
        else
            LibStub("AceConfigCmd-3.0").HandleCommand(WelcomeHome, "wh", "WelcomeHome", input)
        end
    end
    
    
    
    function WelcomeHome:IsShowInChat(info)
    	return self.db.profile.showInChat
    end
    function WelcomeHome:ToggleShowInChat(info, value)
        self.db.profile.showInChat = value
    end
    
    function WelcomeHome:IsShowOnScreen(info)
        return self.db.profile.showOnScreen
    end
    
    function WelcomeHome:ToggleShowOnScreen(info, value)
        self.db.profile.showOnScreen = value
    end


    That version prints the subzone followed by the main zone in the chat and on screen. I added comments to describe what the if statements do.
    Posted in: Ace3
  • To post a comment, please or register a new account.