Jerek
03-06-2005, 11:38 PM
I have a mod that's practically complete, and I'm trying to get it to use Cosmos to save and manage the options, but for some reason I get stack overflow errors when I try to load the mod. I commented out most of the options, and have just enabled this one checkbox. Can someone tell me what I'm doing wrong?
Cosmos_RegisterConfiguration(
"COS_JDHP_ShowMaxes", -- CVar
"CHECKBOX", -- Type
TEXT(JDHP_MAXES), -- Short description
TEXT(JDHP_MAXESL), -- Long description
JDHP_ShowMaxesToggle, -- Callback
0 -- Default Checked/Unchecked
);
The comments there are left as I found them on WoWWiki's Cosmos Developer's Guide. Although I'm uncertain as to what it means by "Callback". Is this supposed to be a funtion to handle when a checkbox is toggled? I assumed so, and wrote this function:
function JDHP_ShowMaxesToggle ()
JDHP_ShowMaxes = COS_JDHP_ShowMaxes_X;
if (JDHP_ShowMaxes == 1) then
Cosmos_UpdateValue("COS_JDHP_ShowMaxes",CSM_CHECKONOFF,0);
CosmosMaster_Save();
else
Cosmos_UpdateValue("COS_JDHP_ShowMaxes",CSM_CHECKONOFF,1);
CosmosMaster_Save();
end
end
Any ideas?
Cosmos_RegisterConfiguration(
"COS_JDHP_ShowMaxes", -- CVar
"CHECKBOX", -- Type
TEXT(JDHP_MAXES), -- Short description
TEXT(JDHP_MAXESL), -- Long description
JDHP_ShowMaxesToggle, -- Callback
0 -- Default Checked/Unchecked
);
The comments there are left as I found them on WoWWiki's Cosmos Developer's Guide. Although I'm uncertain as to what it means by "Callback". Is this supposed to be a funtion to handle when a checkbox is toggled? I assumed so, and wrote this function:
function JDHP_ShowMaxesToggle ()
JDHP_ShowMaxes = COS_JDHP_ShowMaxes_X;
if (JDHP_ShowMaxes == 1) then
Cosmos_UpdateValue("COS_JDHP_ShowMaxes",CSM_CHECKONOFF,0);
CosmosMaster_Save();
else
Cosmos_UpdateValue("COS_JDHP_ShowMaxes",CSM_CHECKONOFF,1);
CosmosMaster_Save();
end
end
Any ideas?