Download
(12Kb)
Download
Updated: 07-02-06 02:11 PM
Pictures
File Info
Updated:07-02-06 02:11 PM
Created:unknown
Downloads:3,305
Favorites:12
MD5:

MyMinimapButton

Version: 1.0
by: Gello [More]

MyMinimapButton is an embedded library to make creating and managing minimap buttons easy for mod authors.

By embedded library, it's one single lua file (MyMinimapButton.lua) that you toss into your addon's folder and use without dependencies or worrying about other mods using the same library.

Any number of mods can include this file, older or newer versions. Multiple copies aren't made, it just uses the most recent version. Every attempt will be made to keep it backwards compatable from this point forward.

To demonstrate MyMinimapButton's use, this download includes a mod called MyMinimapButton-Demo. This demo adds a 'Minimap' button to the macro edit window. When you select a macro and click the button, it creates a minimap button that will attempt to run the macro when clicked. (It can only run macros entirely in /script form -- it doesn't include a parser for slash commands)

Also included in the download is a zip file named TestMod that demonstrates different ways of creating buttons.

To use:
1. Toss MyMinimapButton.lua into your addon's folder
2. Include the file in your .toc
3. Use the API to create and manipulate the button.

An example of use:

Code:
MyMinimapButton:Create("MyMod",MyMod_Settings)
MyMinimapButton:SetIcon("MyMod","Interface\\AddOns\\MyMod\\MyIcon")
MyMinimapButton:SetLeftClick("MyMod",MyMod_MinimapButton_OnClick)
This will create a minimap button referenced as "MyMod", saving its settings in MyMod_Settings, with the icon MyIcon, that runs MyMod_MinimapButton_OnClick when left clicked.

MyMinimapButton will handle the positioning of the button, whether it's visible or not, its tooltip and all movement. You can if you choose alter any of this behavior with the MyMinimapButton API (see its readme).

__ Changes __
1.0, 7/2/06, release
0.7, lowered frameStrata of buttons to "LOW"
0.6, added toplevel support
0.5, 4/7/06, added SetLock, removed "NONE" as drag option, added
SetEnable and removed Enable/Disable. Changed "ON"/"OFF" to 1/nil,
added SetTopLevel for 1.10.2.
0.4, 3/7/06, bug fixed: Minimap parent, changed: Buttons shrunk slightly
0.3, 3/6/06, initial beta

Optional Files (0)


Post A Reply Comment Options
Unread 03-13-07, 11:27 AM  
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view AddOns

Forum posts: 219
File comments: 158
Uploads: 3
My Minimap is too crowded

I don't know about anyone else but my Minimap is getting too crowded with buttons!

I have modified MyMinimapButton.lua to allow the radius to be changed while dragging the button if the Alt key is pressed (i.e. Alt-Click-Drag). I also modified the initialization code so this change is upward compatible.

I'd be happy to provide my changes to the author if he would like them.

Regards,

Brad Morgan
Report comment to moderator  
Reply With Quote
Unread 01-21-07, 11:14 AM  
p80
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 2
Uploads: 1
this is a real great work!! I love it!!

Only thing i had to change was line 66 of MyMinimapButton.lua to:
for i in pairs( modSettings) do

The rest worked very good for me
Report comment to moderator  
Reply With Quote
Unread 08-21-06, 06:21 PM  
GrusPer
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Yes - I and have made
All is true
There was a button on minimap
--------------------
By pressing it does not work
Also does not execute a command

============================
Only macros entirely in /script from will run from minimap .
This doesn`t include a parser for the macro slash commands itself
====================================
this LOG chat
Last edited by GrusPer : 08-22-06 at 03:37 AM.
Report comment to moderator  
Reply With Quote
Unread 08-21-06, 06:06 PM  
Gello
A Molten Giant
AddOn Author - Click to view AddOns

Forum posts: 521
File comments: 582
Uploads: 75
If you install the mod:
1. Create the macros to do the various things (/hello)
2. After it's created, click the Minimap button between 'Delete' and 'New' (highlighted on last screenshot to right)
3. Then the macro should be added as a minimap button

As mentioned it's a demo of the library so not totally fleshed out, but it should do what you're after.
Report comment to moderator  
Reply With Quote
Unread 08-21-06, 03:09 PM  
GrusPer
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Greetings!
At me a question
As I can execute a command on your module
---------------------------------
Example!
===================
/tb
===================
or an example!
=====================
/hello
====================
or an example!
====================
/QLP
=================
If I wish to execute it that I should do
How to make macros?
I tried
At me not that
It has not turned out
-----------------------------------------------------------
Help me!
Report comment to moderator  
Reply With Quote
Unread 06-14-06, 04:41 PM  
Gello
A Molten Giant
AddOn Author - Click to view AddOns

Forum posts: 521
File comments: 582
Uploads: 75
Oh yeah that's an easy and worthwhile change. Thanks!
Report comment to moderator  
Reply With Quote
Unread 06-14-06, 10:16 AM  
docthis
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 9
Uploads: 1
Icons appear a bit too front

The created icons appear above all other layers, I think it should be pushed down a bit. For example when I open all my inventory bags, the icon will still appear on screen, partially covering a bag slot.

So, it would be nice to either set it appear a bit lower or add a parameter for it.

Nice library

Update: changing line 33 to

frame:SetFrameStrata("MEDIUM")

seems to solve the problem, at least so far.
Last edited by docthis : 06-14-06 at 10:39 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: