yeah i delted my last post cuase i thought i had it... >.>
It took me a bit to get my logic right but for future referance i did
function hideTooltip()
if MouseIsOver(tooltip) then return end
tooltip:SetScript("OnLeave", nil)
tooltip:Hide()
QTC:Release(tooltip)
tooltip = nil
end
function combatFeed:OnClick(button)
if button == "RightButton" then
if IsControlKeyDown() then
core:ABHS();
else
--makeTooltip();
tooltip = QTC:Acquire("cfTip", 5,"CENTER")
tooltip:Clear()
tooltip:SmartAnchorTo(self)
tooltip:SetScript("OnLeave", hideTooltip)
tooltip:Hide()
tooltip:Show()
tooltip:SetCallback("OnMouseDown", RCHandlerFunc)
for k,v in pairs(RC_Classdata) do
local y, x = tooltip:AddLine()
y, x = tooltip:SetCell(y, x, k, function() return k end, "CENTER")
end
end
else
local Welmenu = GHM_NewFrame(RC_WelMenu)
Welmenu.ClearAll()
Welmenu:Show();
end
end
for an OnLeave you have to set it to a custom handler/function
okay I am trying to dry code something up for an RP mod i am working on
it inculdes character sheets, Now I am trying to set up a system so they can change chracter sheets (right now the assumed limit is they can have up to five at a time), Assuming LibQtip/LibQTC can do this.
Now confusions on my end is i store these sheets in a non-acdb(IE standerd savedvar DB) way, so i am gonna have to parse through the sheets and get them into the tooltip. So when they click that sheet, it will set the approitate varible and make the proper update function call.
Now as i am writeing this, the other family units of my house have declared we are going out to eat, so here is my drycode(whitch is basiclly me copiing off the getting started pages)..what am i not doing and what do i need to do?
Enlighten me oh Gurus of code.
local icon = LibStub("LibDBIcon-1.0");
local QTC = LibStub('LibQTipClick-1.0');
local ldb = LibStub:GetLibrary("LibDataBroker-1.1");
ldb:NewDataObject("RollCrafter", {
type = "launcher",
icon = "Interface\\Icons\\Spell_Nature_StormReach",
OnClick = function(clickedframe, button)
InterfaceOptionsFrame_OpenToFrame(RollCraft_BlizzOptions)
if button == "RightButton" then
local Welmenu = GHM_NewFrame(RC_WelMenu)
Welmenu.ClearAll()
Welmenu:Show();
end,
})
combatFeed = ldb:NewDataObject("RollCrafter", {
type = "data feed",
icon = "Interface\\Icons\\Spell_Nature_StormReach",
label = "",
})
combatFeed.OnEnter = function(frame, button)
tooltip = QTC:Acquire("cfTip", 5, "LEFT", "LEFT", "LEFT", "LEFT","LEFT")
tooltip:Clear()
tooltip:SmartAnchorTo(self)
tooltip:SetScript("OnLeave", HideTooltip)
DisplayTooltip()
tooltip:SetCallback("OnMouseDown", myHandlerFunc)
local y, x = tooltip:AddLine()
y, x = tooltip:SetCell(y, 1, "", function() return "You pressed button 1!" end)
y, x = tooltip:SetCell(y, 2, "Button 2", function() return "You pressed button 2!" end)
y, x = tooltip:SetCell(y, 3, "Button 3", function() return "You pressed button 3!" end)
end,
OnLeave = (tt)
if MouseIsOver(tooltip) then return end
tooltip:SetScript("OnLeave", nil)
tooltip:Hide()
QTC:Release(tooltip)
tooltip = nil
end,
end,
)
)
I am still having problems, though its for a new part of the addon by same deal. I do know that the tables i want are not copying into the new temp table i am setting up.
my current savedvar format that i am going for is RCclassdata[<class>][<skill>] or to put into another form RCclassdata={ [<class>] = {[<skill>]={<skilldata>} } }
now in the frame i am working in, i have a dropdown which is dynamically populated with <class>, now when the user clicks a button after selecting a class, it SUPPOSED to go through copy the data from <skill> (whitch i use as the skill name) and the data in its table (i actually just need one part of it but eh) into a temp table so i can force it into a list (to be used to select for editing).
The data is not going into my temp table
My set up is like this:
test = {};
test = copy(RC_Classdata[tclass]);
^ the calls
local function copy(source)
local newTable = {}
for index, value in pairs(source) do
newTable[index] = type(value) == "table" and copy(value) or value
print(index);
print(value);
end
print(#newTable);
return newTable
end
^the current copy function (revision number URGGG)
the prints are there for me to see if/what its doing
print(index);
print(value);
will return the proper values/data of the table i am copying
print(#newTable);
returns 0 meaning after all that, nothings actually in the table..
bassiclly what i am trying to do is put the stuff here:
["skills"] = {
["Warrior"] = {
},
["Character"] = {
},
["NPC"] = {
},
["Hunter"] = {
},
["DemonHunter"] = {
["hhh"] = {
["emAtp"] = "poke",
["Atkk"] = 499,
["emFail"] = "miss",
["emSucc"] = "hit",
},
},
},
into a table, these are kind of class sheets for my addon, but all i am interested in are the classes ie: Hunter,Demonhunter.
That way i can get those names dynamiclly as opposed to a static list.
local Roll_Classes = {"Warrior","Hunter","DemonHunter"};
--RollCurr_Classes = {};
is at the top of one of my files, the first one is static(and right now lilttle) and used by the dropdown in my initial character sheet creator
now on some of my editors i do not want the static list, i want to make a list by the classes that person has made on that char,cuase they might not use one from the static list.
I may let the user just input the name of a class they want to make and not have the static dropdown for that..but thats later.
I am so sorry for being confusing.
and by straight lua i ment without Ace3 DB as i don't really implement any profile switching, but the values will be diffrent between chars as needed. (i am playing with the non Ace3DB method now)
Edit:Again..think i am getting the hang of it, it just something about me feels wrong for not useing the Ace libs.
If i were to post all my code it would confuse many people..
edit3:
for i = 1, #(RC_Classdata.classes) do
tinsert(RollCurr_Classes,RC_Classdata.classes[i]);
end
yeah copying the values into a temp table. i should probly rearrange it to use the straight up lua for things like this.
but an example would be
a temp table
my saved vars table
going through the table inserting the values into the temp.
like
temp={}
self.db.char.fruit (containing various fruits), it would also have self.db.char.fruit[fruitname][otherfruit], so self.db.char.fruit.banana might have a banana peel in its table
i only want the banana to go into my temp table, basically just storing those names, so i can put them in a dropdown later.
But the more i think on it i might want to use straight lua for this...meaning i have to change my mindset from the Ace3 to the raw. though that would be as simple as referanceing the Savedvar name in my toc when i got to set something yes?
okay i am back got it working..one problem is with custom positioning
if (core.db.char.abPos.y and core.db.char.abPos.x) then
f:SetPoint("BOTTOMLEFT",core.db.char.abPos.x,core.db.char.abPos.y);
else
f:SetPoint("CENTER");
end
is my code in my OnInit, its like its not wanting to use the savedVars like i think it should (whitch is most likely wrong) and when i have repositioned the bar for the first time then do a reload, the bar is just gone not there..poof...
Edit::NM i had done somthign silly and fixed it on my own after not thinking on it for awhile
I would have to send like half my code..but hold on..I know Role playing addon strangeness.
The mod is made for 'Free form' or emoted combat, kinda with rolling like in table top gameplay. basiclly something to help set a scene up and try to avoid long drawn out dbz style fights where no one hits each other.
two ways of attacking/emoteing in this are a custom emote and a custom set up skill or ability, both right now can be accessed by a slash command indepent of the base addon command.
SLASH_RC_ME1 = "/Rcoll"
SlashCmdList["RC_ME"] = function (input)
core:RandRoll(input)
end--end slashfunc
usage is /rcoll <emote> or /rcoll <skill>, I would love to do /rcoll <skill> <emote> but i haven't figured out that one yet(heck maybe even random emotes).
an example skill taken from out very simple ruleset (that will be expanded on later) is
Ability Name: "Sword Attack"
Attack: 500
Attempt Emote: "/e swings the heavy sword, striking at %t."
Success Emote: "/e hits %t hard with the blade."
Failure Emote: "/e 's swing goes wide, missing %t.
currently these are being saved into my DB in the format of <class>={<skill>={<skill data>}}(core.pSkills[currClass][skillname]), and class can be custom or not but is constant for the most part.
A class would be pretty much a character sheet, a user can have a select number of sheets and will not be able to switch to them while fighting (i am setting up a timer for that one), I am still trying to figure out a nice graphical user friendly switching mechnisim for this..and it makes my head hurt.
anyway i figured, an option i could provide was a bar of buttons for these skills so it wasn't just all typing. in the editor for them (that i am still laying out, so right now i am hardcoding alot), a person could have like 5 skills but i want to limit the buttons to four, so i would make them pick four from that skill set.
These four would display on the bar (that can be shown and hidden when fighting and not fighting) using the info saved on them from the Savedvars(the name of the skill mostly), and when clicked would pass the buttons skillname to my rolling function.
Before my code some apologies, I apologise for my typing, I apologise for being a newb coder annnddd I apologise for being confusing.
--=====Declare namespace and liberarys.
core = LibStub("AceAddon-3.0"):NewAddon("RollCraft", "AceConsole-3.0", "AceEvent-3.0", "AceComm-3.0", "AceSerializer-3.0")
LBO = LibStub("LibBlizzOptions-1.0");
--=======
core.comms = {};
local function D(msg)
DEFAULT_CHAT_FRAME:AddMessage("|cff33FF66Rollcrafter:|r "..msg)
end
--=====Profile Setup========
local RCdefaults = {
char ={
firstRun = true,
emDef = nil,
emAttk = 1,
pBcast = 1,
currSheet = "",
stats = {},
skills = {
},
abScale = 1,
abPadd = 1,
abLock = 1,
abPos = {},
abButtons = {},
},
profile = {
},
}
--======Options Table Setup==============
core.options = {
name = "RollCrafter",
type = 'group',
handler = core,
order = 1,
childGroups = "tree",
args = {
lock = {
type = "input",
name = "Attack Target",
desc = "Set the target to attack",
set = function(info,v)
core.rolls.name = v
D("name is now:"..core.rolls.name)
end,
},
}--args
}--options
local engaged = "OOC";
local CommsIO
local btnSize = 36;
local ComPFix = "RCCom"
local currClass = "Demonhunter"
--====addon startup========
-----=============
function core:OnInitialize()
-- Called when the addon is loaded
--if we need to register systme events we do them the last thing here
self.db = LibStub("AceDB-3.0"):New("RCDB", RCdefaults) --create DB
---shortcuts---
self.pStats = self.db.char.stats
self.pSkills = self.db.char.skills
self.rDef = self.db.char.emDef
self.rAttk = self.db.char.emAttk
self.pBC = self.db.char.pBcast
self.scale = self.db.char.abScale
self.pad = self.db.char.abPadd
self.buttons = self.db.char.abButtons
self.sheet = self.db.char.currSheet
self.posi = self.db.char.abPos
-----------------
LibStub("AceConfig-3.0"):RegisterOptionsTable("RollCraft", core.options)
self:RegisterChatCommand("rc", "ChatCommand")
self:RegisterChatCommand("rollcraft", "ChatCommand")
self:RegisterComm(ComPFix,"OnComm")
end
--RCActionBar
local f = CreateFrame("Frame",core,UIParent);
f:SetMovable(1);
f:SetToplevel(1);
f:SetFrameStrata("MEDIUM");
f:SetScale(1);
local function OnMouseUp(self,button)
f:StopMovingOrSizing();
self.posi.left, self.posi.bottom = f:GetLeft(), f:GetBottom();
end
f:SetScript("OnMouseDown",function(self,button) f:StartMoving(); end);
f:SetScript("OnMouseUp",OnMouseUp);
function core:setScale(input)
f:SetScale(input);
core.scale = input;
end
-- Lock Frame
local function SetLocked(lock)
if (lock) then
f:EnableMouse(nil);
f:SetBackdrop(nil);
else
f:EnableMouse(1);
f:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = 1, tileSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 } });
f:SetBackdropColor(0.1,0.22,0.35,1);
end
end
f.items = {}
local function Button_OnClick(self,button)
---do stuff
local skill = self.name;
RandRoll(self.pSkills[currClass][skill])
end
local function MakeItemButton()
local b = CreateFrame("Button",core,f,"SecureActionButtonTemplate");
b:SetWidth(btnSize);
b:SetHeight(btnSize);
b:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square");
b:RegisterForClicks("LeftButtonUp","RightButtonUp");
b:HookScript("OnClick",Button_OnClick);
b.icon = b:CreateTexture(nil,"ARTWORK");
b.icon:SetAllPoints();
--b.count = b:CreateFontString(nil,"ARTWORK","NumberFontNormal");
--.count:SetPoint("BOTTOMRIGHT",b.icon,-3,3);
if (#f.items == 0) then
b:SetPoint("TOPLEFT",f,8,-8);
end
tinsert(f.items,b);
return b;
end
local function AddButton(index,skillname)
button = f.items[index] or MakeItemButton();
button.icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")--self.pSkills[class][skill].icon
button.name = core.pSkills[currClass][skillname]; --debug hardcode--skillname --currclass will always reflect the current class, skill will be done by editor
if (index > 1) then
button:ClearAllPoints();
button:SetPoint("LEFT",f.items[index - 1],"RIGHT",1,0);
end
--show IC otherwise hide
button:Show();
end
function f.UpdateButtons()
if (InCombatLockdown()) then
return;
end
-- locals
local index = 1;
---bunch of stuff
shownItems = (index - 1);
for i = index, #f.items do
f.items[i]:Hide();
end
-- Set Frame Dimention
x = (btnSize * shownItems + (shownItems - 1) * 1 + 16);
y = (btnSize + 16);
f:SetWidth(y or x);
f:SetHeight(x or y);
---morestuff
end
------------------------
function core:OnEnable()
-- Called when the addon is enabled
if (self.posi.left and self.posi.bottom) then
f:SetPoint("BOTTOMLEFT",self.posi.left,self.posi.bottom);
else
f:SetPoint("CENTER");
end
f:SetScale(core.scale)
--LBO params
local params = {
Mod = "Rollcraft",
Title = "Rollcraft:Instances and Aspects",
Description = "A Roleplaying addon allowing pen and paper style in game",
Version = "v0 Alpha",
Author = "Tharion Greyseer, Lannia Winterstorm, Fethas Ravenmoon.ER-US",
Credits = "Pilus for helping out Fethas and letting us use GHM",
Execute = function()local Optmenu = GHM_NewFrame(RC_OptMenu); Optmenu.ClearAll()
Optmenu.ForceLabel("attk_rand",core.db.char.emAttk);
Optmenu.ForceLabel("def_rand",core.db.char.emDef);
Optmenu.ForceLabel("pbroad",core.db.char.pbcast) ;
Optmenu:Show();
end,
ExecuteText = "Options",
}--end params
LBO:CreateBlizzardOptions(params);
----LBO
AddButton(1,"hhh");
f:Show();
SLASH_RC_ME1 = "/Rcoll"
SlashCmdList["RC_ME"] = function (input)
core:RandRoll(input)
end--end slashfunc
end
Currently working on a roleplaying addon, Virtual combat skills are invovled..so i figure i would make a mini actionbar so the only access to these skills wouldn't just be from a commandline. Ran into some trouble as i do not think it wanting to access the savedvars(Ace3) like i want it too..
i was using code stripped down from a mod named Qbar (http://www.wowinterface.com/downloads/info8645-QBar.html)
so if anyone could tell me what i am doing wrong or a better way to do things would be appreciated. I almost have a feeling its cuase i set it between my oninit and onenable parts of the addon (as i am calling some things for it including a test in the onenable and my db is setting up in on init)
--RCActionBar
local f = CreateFrame("Frame",core,UIParent);
f:SetMovable(1);
f:SetToplevel(1);
f:SetFrameStrata("MEDIUM");
f:SetScale(1);
local function OnMouseUp(self,button)
f:StopMovingOrSizing();
self.posi.left, self.posi.bottom = f:GetLeft(), f:GetBottom();
end
f:SetScript("OnMouseDown",function(self,button) f:StartMoving(); end);
f:SetScript("OnMouseUp",OnMouseUp);
function core:setScale(input)
f:SetScale(input);
core.scale = input;
end
-- Lock Frame
local function SetLocked(lock)
if (lock) then
f:EnableMouse(nil);
f:SetBackdrop(nil);
else
f:EnableMouse(1);
f:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = 1, tileSize = 16, insets = { left = 0, right = 0, top = 0, bottom = 0 } });
f:SetBackdropColor(0.1,0.22,0.35,1);
end
end
f.items = {}
local function Button_OnClick(self,button)
---do stuff
local skill = self.name;
RandRoll(self.pSkills[currClass][skill])
end
local function MakeItemButton()
local b = CreateFrame("Button",core,f,"SecureActionButtonTemplate");
b:SetWidth(btnSize);
b:SetHeight(btnSize);
b:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square");
b:RegisterForClicks("LeftButtonUp","RightButtonUp");
b:HookScript("OnClick",Button_OnClick);
b.icon = b:CreateTexture(nil,"ARTWORK");
b.icon:SetAllPoints();
--b.count = b:CreateFontString(nil,"ARTWORK","NumberFontNormal");
--.count:SetPoint("BOTTOMRIGHT",b.icon,-3,3);
if (#f.items == 0) then
b:SetPoint("TOPLEFT",f,8,-8);
end
tinsert(f.items,b);
return b;
end
local function AddButton(index,skillname)
button = f.items[index] or MakeItemButton();
button.icon:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")--self.pSkills[class][skill].icon
button.name = core.pSkills[currClass][skillname]; --debug hardcode--skillname --currclass will always reflect the current class, skill will be done by editor
if (index > 1) then
button:ClearAllPoints();
button:SetPoint("LEFT",f.items[index - 1],"RIGHT",1,0);
end
--show IC otherwise hide
button:Show();
end
function f.UpdateButtons()
if (InCombatLockdown()) then
return;
end
-- locals
local index = 1;
---bunch of stuff
shownItems = (index - 1);
for i = index, #f.items do
f.items[i]:Hide();
end
-- Set Frame Dimention
x = (btnSize * shownItems + (shownItems - 1) * 1 + 16);
y = (btnSize + 16);
f:SetWidth(y or x);
f:SetHeight(x or y);
---morestuff
end
------------------------
0
It took me a bit to get my logic right but for future referance i did
function hideTooltip()
if MouseIsOver(tooltip) then return end
tooltip:SetScript("OnLeave", nil)
tooltip:Hide()
QTC:Release(tooltip)
tooltip = nil
end
function combatFeed:OnClick(button)
if button == "RightButton" then
if IsControlKeyDown() then
core:ABHS();
else
--makeTooltip();
tooltip = QTC:Acquire("cfTip", 5,"CENTER")
tooltip:Clear()
tooltip:SmartAnchorTo(self)
tooltip:SetScript("OnLeave", hideTooltip)
tooltip:Hide()
tooltip:Show()
tooltip:SetCallback("OnMouseDown", RCHandlerFunc)
for k,v in pairs(RC_Classdata) do
local y, x = tooltip:AddLine()
y, x = tooltip:SetCell(y, x, k, function() return k end, "CENTER")
end
end
else
local Welmenu = GHM_NewFrame(RC_WelMenu)
Welmenu.ClearAll()
Welmenu:Show();
end
end
for an OnLeave you have to set it to a custom handler/function
0
><
Anyway thanks for enduring that.
0
okay I am trying to dry code something up for an RP mod i am working on
it inculdes character sheets, Now I am trying to set up a system so they can change chracter sheets (right now the assumed limit is they can have up to five at a time), Assuming LibQtip/LibQTC can do this.
Now confusions on my end is i store these sheets in a non-acdb(IE standerd savedvar DB) way, so i am gonna have to parse through the sheets and get them into the tooltip. So when they click that sheet, it will set the approitate varible and make the proper update function call.
Now as i am writeing this, the other family units of my house have declared we are going out to eat, so here is my drycode(whitch is basiclly me copiing off the getting started pages)..what am i not doing and what do i need to do?
Enlighten me oh Gurus of code.
0
I get a spanking for newbie error there
and i wasn't sure how to do it without a temp table (another spanking), i assume just a pairs loop?
Edit:and i remembered why i was using a temp table is how the framework i am using for my list worked, though probly won't hurt to try the otherway,
edit2:got it..yay thankjoo.
0
I am still having problems, though its for a new part of the addon by same deal. I do know that the tables i want are not copying into the new temp table i am setting up.
my current savedvar format that i am going for is RCclassdata[<class>][<skill>] or to put into another form RCclassdata={ [<class>] = {[<skill>]={<skilldata>} } }
now in the frame i am working in, i have a dropdown which is dynamically populated with <class>, now when the user clicks a button after selecting a class, it SUPPOSED to go through copy the data from <skill> (whitch i use as the skill name) and the data in its table (i actually just need one part of it but eh) into a temp table so i can force it into a list (to be used to select for editing).
The data is not going into my temp table
My set up is like this:
test = {};
test = copy(RC_Classdata[tclass]);
^ the calls
local function copy(source)
local newTable = {}
for index, value in pairs(source) do
newTable[index] = type(value) == "table" and copy(value) or value
print(index);
print(value);
end
print(#newTable);
return newTable
end
^the current copy function (revision number URGGG)
the prints are there for me to see if/what its doing
print(index);
print(value);
will return the proper values/data of the table i am copying
print(#newTable);
returns 0 meaning after all that, nothings actually in the table..
...Halp?
0
--RollCurr_Classes = {};
--for i = 1, #(core.db.char.skills) do
--tinsert(RollCurr_Classes,core.db.char.skills);
--end
my savedvars (excuse the junk, alot of its from previous testing)
["Fethas - Earthen Ring"] = {
["emDef"] = false,
["stats"] = {
["DefPer"] = 86,
["Def"] = 181,
["Hit"] = 87,
},
["abPos"] = {
["y"] = 80.94849465864159,
["x"] = 766.3403969058335,
["left"] = 102.0618232777443,
["bottom"] = -249.4845162408871,
},
["skills"] = {
["Warrior"] = {
},
["Character"] = {
},
["NPC"] = {
},
["Hunter"] = {
},
["DemonHunter"] = {
["hhh"] = {
["emAtp"] = "poke",
["Atkk"] = 499,
["emFail"] = "miss",
["emSucc"] = "hit",
},
},
},
["pBcast"] = false,
["firstRun"] = false,
},
bassiclly what i am trying to do is put the stuff here:
["skills"] = {
["Warrior"] = {
},
["Character"] = {
},
["NPC"] = {
},
["Hunter"] = {
},
["DemonHunter"] = {
["hhh"] = {
["emAtp"] = "poke",
["Atkk"] = 499,
["emFail"] = "miss",
["emSucc"] = "hit",
},
},
},
into a table, these are kind of class sheets for my addon, but all i am interested in are the classes ie: Hunter,Demonhunter.
That way i can get those names dynamiclly as opposed to a static list.
local Roll_Classes = {"Warrior","Hunter","DemonHunter"};
--RollCurr_Classes = {};
is at the top of one of my files, the first one is static(and right now lilttle) and used by the dropdown in my initial character sheet creator
now on some of my editors i do not want the static list, i want to make a list by the classes that person has made on that char,cuase they might not use one from the static list.
I may let the user just input the name of a class they want to make and not have the static dropdown for that..but thats later.
I am so sorry for being confusing.
and by straight lua i ment without Ace3 DB as i don't really implement any profile switching, but the values will be diffrent between chars as needed. (i am playing with the non Ace3DB method now)
Edit:Again..think i am getting the hang of it, it just something about me feels wrong for not useing the Ace libs.
If i were to post all my code it would confuse many people..
edit3:
for i = 1, #(RC_Classdata.classes) do
tinsert(RollCurr_Classes,RC_Classdata.classes[i]);
end
and
RC_Classdata.stats = {
["Def"] = f.GetLabel("lDef"),
["DefPer"] = f.GetLabel("lDefp"),
["Hit"] = f.GetLabel("lHitp")
};
RC_Classdata.classes = {};
RC_Classdata.classes[class][skillName]={
["Attk"] = f.GetLabel("lAttk"),
["emAtp"] = f.GetLabel("lAtp"),
["emSucc"] = f.GetLabel("lSucc"),
["emFail"] = f.GetLabel("lFail")
};
the above(non-AceDB way) is actually saving correctly, still working on that for loop thing.
not sure if i am doing it right still...
so maybe i can use the AceDB for some lilttle things (like the postion of an miniactionbar i got in this thing)
0
but an example would be
a temp table
my saved vars table
going through the table inserting the values into the temp.
like
temp={}
self.db.char.fruit (containing various fruits), it would also have self.db.char.fruit[fruitname][otherfruit], so self.db.char.fruit.banana might have a banana peel in its table
i only want the banana to go into my temp table, basically just storing those names, so i can put them in a dropdown later.
But the more i think on it i might want to use straight lua for this...meaning i have to change my mindset from the Ace3 to the raw. though that would be as simple as referanceing the Savedvar name in my toc when i got to set something yes?
0
Trying to pass the top level of a table in my DB into a temp.Table so i can use that in other things (IE, Passing the it to a DDown).
tried various methods of for looping..and now my head hurts from this brick wall.
0
if (core.db.char.abPos.y and core.db.char.abPos.x) then
f:SetPoint("BOTTOMLEFT",core.db.char.abPos.x,core.db.char.abPos.y);
else
f:SetPoint("CENTER");
end
is my code in my OnInit, its like its not wanting to use the savedVars like i think it should (whitch is most likely wrong) and when i have repositioned the bar for the first time then do a reload, the bar is just gone not there..poof...
Edit::NM i had done somthign silly and fixed it on my own after not thinking on it for awhile
0
so thank you very very much!
*gives out gingerbread cookies*
0
do i just make it from
local b = CreateFrame("Button",core,f,"SecureActionButtonTemplate");
to
local b = CreateFrame("Button",core,f,);
cuase i got the errors to stop..now the whole..getting it to show up thing...
And thank you for the help by the way....
0
I am still messing with it..still haveing a bit of trouble but i almost think i am making progress
0
The mod is made for 'Free form' or emoted combat, kinda with rolling like in table top gameplay. basiclly something to help set a scene up and try to avoid long drawn out dbz style fights where no one hits each other.
two ways of attacking/emoteing in this are a custom emote and a custom set up skill or ability, both right now can be accessed by a slash command indepent of the base addon command.
SLASH_RC_ME1 = "/Rcoll"
SlashCmdList["RC_ME"] = function (input)
core:RandRoll(input)
end--end slashfunc
usage is /rcoll <emote> or /rcoll <skill>, I would love to do /rcoll <skill> <emote> but i haven't figured out that one yet(heck maybe even random emotes).
an example skill taken from out very simple ruleset (that will be expanded on later) is
Ability Name: "Sword Attack"
Attack: 500
Attempt Emote: "/e swings the heavy sword, striking at %t."
Success Emote: "/e hits %t hard with the blade."
Failure Emote: "/e 's swing goes wide, missing %t.
currently these are being saved into my DB in the format of <class>={<skill>={<skill data>}}(core.pSkills[currClass][skillname]), and class can be custom or not but is constant for the most part.
A class would be pretty much a character sheet, a user can have a select number of sheets and will not be able to switch to them while fighting (i am setting up a timer for that one), I am still trying to figure out a nice graphical user friendly switching mechnisim for this..and it makes my head hurt.
anyway i figured, an option i could provide was a bar of buttons for these skills so it wasn't just all typing. in the editor for them (that i am still laying out, so right now i am hardcoding alot), a person could have like 5 skills but i want to limit the buttons to four, so i would make them pick four from that skill set.
These four would display on the bar (that can be shown and hidden when fighting and not fighting) using the info saved on them from the Savedvars(the name of the skill mostly), and when clicked would pass the buttons skillname to my rolling function.
Before my code some apologies, I apologise for my typing, I apologise for being a newb coder annnddd I apologise for being confusing.
0
i was using code stripped down from a mod named Qbar (http://www.wowinterface.com/downloads/info8645-QBar.html)
so if anyone could tell me what i am doing wrong or a better way to do things would be appreciated. I almost have a feeling its cuase i set it between my oninit and onenable parts of the addon (as i am calling some things for it including a test in the onenable and my db is setting up in on init)
0
@slyv: give me an example of your function delayCall(delay, func)
...and not a hard example....cuase i am sure i can use that combined with Xinhuans.
Thank you for putting up with my questions guys!
(Oh BTW even though its hard to tell over the interwebs, "She", yes we DO exist)