Thread Tools Display Modes
03-13-05, 04:13 AM   #1
taii
A Defias Bandit
Join Date: Mar 2005
Posts: 2
Stand alones and the Cosmos UI

I was wondering if someone can help me. I see that several people that make stand alone add ons have the ability to have a "button" that appears on the cosmos screen (the screen you get when you click the mini-map button) such as the all-in-one inventory and the atlas add ons. Several of the add ons i use however do not so i was wondering if someone could show me the code behind creating this type of button. Really i would like a generic version and instructions on how to add the info in myself, or if someone could create this for the "characters viewer" add on and i can try and pick it apart myself. for the add ons i am most interested in, such as the character viewer, it has a slash command that brings up the ui so ideally what i am trying to do is go from a slash command to a button on the cosmos window.

any help is greatly appriciated
Taii
  Reply With Quote
03-13-05, 06:29 AM   #2
taii
A Defias Bandit
Join Date: Mar 2005
Posts: 2
update, i have gotten this much accomplished so far...
Code:
---------------------------------------------------------------------------------
-- 
-- Register with Cosmos UI
-- 
---------------------------------------------------------------------------------
function CharactersViewer_OnLoad()
   -- Register with Cosmos
   CharactersViewer_RegisterCosmos();
end

    Cosmos_RegisterButton (
   "Characters Viewer",
   "Toon Viewer",
   "Allows you to view the equipment of all your other characters no matter which one is online",
   "Interface\\Icons\\Spell_Holy_BlessingOfStrength",
   CharactersViewer_Toggle);
   
----------------------------------------------------------------------------------
-- 
-- Toggle hidden status
-- 
---------------------------------------------------------------------------------
function CharactersViewer_Toggle()
   if ( CharactersViewer:IsVisible() ) then
      CharactersViewer:Hide();
   else
      CharactersViewer:Show();
   end
end
and it is giving me a button where i want it, however i am unsure of how to get it to actually do what i want it do. right now it just gives me an error saying that line 63 of the cosmosbutton.lua search of "f" gives nil value. if some one could point me in the direction of having this simply open the "characters viewer" add on interface (can be reached using /cv) it would be greatly appriciated.


on a side note can anyone tell me where i can find / how i can view the pics used for the icons?? all add ons seem to reference some \\interface\icons\... area, where is this because i really don't want to have ten add on buttons with the blessing of strength icon. thanks again
  Reply With Quote
04-22-05, 08:23 AM   #3
Rayn
A Murloc Raider
Join Date: Apr 2005
Posts: 7
doh, my bad

Last edited by Rayn : 04-22-05 at 07:24 PM. Reason: eula
  Reply With Quote
04-22-05, 09:09 AM   #4
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Rayn, please don't get us wrong, we appreciate the help you've offered on some of these threads, but the manner in which you are doing so breaks some of the Rules of the site:
The condensed version, for those that aren't Monty Python fans.

1. Post with respect and courtesy. Debate is fine ... so long as when you disagree with someone, you respond in a civilized and constructive manner.

2. No slander. Don't come here and slam/flame anyone/thing. Don't come here sounding off that Blizz sucks, EQ sucks, mod_author_01 sucks, etc and so on. None of that. You want to post things like that, take it elsewhere, there are enough other boards that cater to that type of thing. This isn't FlameVault. See 1.
Please try to make your tone less agressive &/or condescending and stop with the slamming of Cosmos.

Thanks,
__________________
“Do what you feel in your heart to be right — for you’ll be criticized anyway.” ~ Eleanor Roosevelt
~~~~~~~~~~~~~~~~~~~
Co-Founder & Admin: MMOUI
FaceBook Profile, Page, Group
Avatar Image by RaffaeleMarinetti
  Reply With Quote
04-23-05, 07:51 PM   #5
airdragon
A Flamescale Wyrmkin
Join Date: Apr 2005
Posts: 147
I myself was just pondering doing this kind of stuff. Heres a piece of code I wrote for ReagentInfo to make a button for myself in Cosmos Control Panel.

--addded in OnEvent after myaddons support--

if (Cosmos_RegisterButton) then
Cosmos_RegisterButton(
"ReagentInfo",
"Item Info",
"Displays various proffessions and clas usage of an item.",
"Interface\\Icons\\INV_Misc_Map_01",
ReagentInfo_Proteus);
end


After this you know need a function to load the config fram... I wrote a simple one since one did not appear to already be in the code.


function ReagentInfo_Proteus()
if(ReagentInfo_ConfigFrame:IsVisible()) then
HideUIPanel(ReagentInfo_ConfigFrame);
else
ShowUIPanel(ReagentInfo_ConfigFrame);
end
end

This was just added to the end of the file. To say the least it works like a charm and I hope that this helps if you haven't already figured it out. Well off to see how to register things with CT_Mod..... mostly to play with CT_Mod really. Peace!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Stand alones and the Cosmos UI


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off