Quantcast is there away to script a SET function for nameplates - WoWInterface
 
Thread Tools Display Modes
05-14-19, 08:51 AM   #1
Mandraxon
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 10
is there away to script a SET function for nameplates

Hello people.
I am working on some modifications to the default Nameplates.
I am using Set veriables to change the scale at this moment.
i usualy play with the small sized blizzard nameplates but i want to have the option to use the large nameplates without having to change the SetCVar("nameplateGlobalScale when i tick the "Use large name plates in the game interface.

is there a way to script so that i dont have "Large nameplates ticked" i use one Set config and if i have it ticked the addon wil then force another set function and if so how would i code that?

Here is what i am using so far..

-- Nameplate rezice

local Frame = CreateFrame("Frame")
Frame:RegisterEvent("PLAYER_LOGIN")

Frame:SetScript("OnEvent", function(...)
SetCVar("nameplateMaxDistance", 45)
SetCVar("nameplateMaxScale", 1.0)
SetCVar("nameplateMinScale", 0.9)
SetCVar("nameplateLargerScale", 1.1)
SetCVar("nameplateGlobalScale", 1.4)
SetCVar("nameplateSelfTopInset",0.62)
SetCVar("nameplateSelfBottomInset",0.32)

end)

-- Hide Realmname in nameplates

hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
if ShouldShowName(frame) then
if frame.optionTable.colorNameBySelection then
frame.name:SetText(GetUnitName(frame.unit))
end
end
end)




Thanks in advanced /J
  Reply With Quote
05-22-19, 11:23 AM   #2
Sylen
A Cyclonian
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 43
Check if the box is ticked or not, then do what you want to do in either case

Lua Code:
  1. if InterfaceOptionsNamesPanelUnitNameplatesMakeLarger:GetValue() == "1" then
  2.     --Do stuff here
  3. elseif InterfaceOptionsNamesPanelUnitNameplatesMakeLarger:GetValue() == "0" then
  4.     --Do other stuff here
  5. end
  Reply With Quote
05-23-19, 01:41 AM   #3
Mandraxon
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 10
hmm. looks to be what i am after however.

--Set scale depending on if you ticked use large nameplates in interface options

if InterfaceOptionsNamesPanelUnitNameplatesMakeLarger:GetValue() == "1" then
SetCVar("nameplateGlobalScale", 1.0)
elseif InterfaceOptionsNamesPanelUnitNameplatesMakeLarger:GetValue() == "0" then
SetCVar("nameplateGlobalScale", 1.4)

end

did not work.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » is there away to script a SET function for nameplates

Thread Tools
Display Modes

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