/branches
if not desc.offsetright then desc.offsetright = 0; end |
if not desc.offsetbottom then desc.offsetbottom = 0; end |
local useperfectpixel = "nil"; if desc.perfectpixel then useperfectpixel = "true"; end |
local tooltipmouse = "nil"; if desc.tooltipmouse then tooltipmouse = "true"; end |
if not desc.anchorx then desc.anchorx = 200; end |
if not desc.anchory then desc.anchory = 200; end |
else |
WorldFrame:SetAllPoints(UIParent); |
end |
if ]] .. useperfectpixel .. [[ then |
SetCVar("uiScale", 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)")); |
end |
RDXDK.SetGameTooltipLocation(]] .. tooltipmouse .. [[, ]] .. desc.anchorx .. [[, ]] .. desc.anchory .. [[); |
--if desc and desc.uiscale then uiscale.editBox:SetText(desc.uiscale); end |
--ui:InsertFrame(uiscale); |
local chk_perfectpixel = VFLUI.Checkbox:new(ui); chk_perfectpixel:Show(); |
chk_perfectpixel:SetText(VFLI.i18n("Activate Perfect Pixel")); |
if desc and desc.perfectpixel then chk_perfectpixel:SetChecked(true); else chk_perfectpixel:SetChecked(); end |
ui:InsertFrame(chk_perfectpixel); |
--local chk_perfectpixel = VFLUI.Checkbox:new(ui); chk_perfectpixel:Show(); |
--chk_perfectpixel:SetText(VFLI.i18n("Activate Perfect Pixel")); |
--if desc and desc.perfectpixel then chk_perfectpixel:SetChecked(true); else chk_perfectpixel:SetChecked(); end |
--ui:InsertFrame(chk_perfectpixel); |
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("ViewPort"))); |
title = title.editBox:GetText(); |
--resolution = VFLUI.GetCurrentResolution(); |
--scale = VFLUI.GetCurrentEffectiveScale(); |
perfectpixel = chk_perfectpixel:GetChecked(); |
--perfectpixel = chk_perfectpixel:GetChecked(); |
viewport = chk_viewport:GetChecked(); |
--vanchor = dd_vanchor:GetSelection(); |
offsettop = offsettop.editBox:GetText(); |
SwitchState_Disable(RDXU.AUIState); |
end |
if RDXG.RDXopt and RDXG.RDXopt.upp then |
SetCVar("uiScale", 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)")); |
end |
end); |
if opt and opt.hmp then chk_hmp:SetChecked(true); else chk_hmp:SetChecked(); end |
ui:InsertFrame(chk_hmp); |
local er = VFLUI.EmbedRight(ui, VFLI.i18n("Backdrop Main panel")); |
local mbkd = VFLUI.MakeBackdropSelectButton(er, opt.mbkd); mbkd:Show(); |
er:EmbedChild(mbkd); er:Show(); |
ui:InsertFrame(er); |
local er = VFLUI.EmbedRight(ui, VFLI.i18n("Backdrop menu")); |
local bkd = VFLUI.MakeBackdropSelectButton(er, opt.bkd); bkd:Show(); |
er:EmbedChild(bkd); er:Show(); |
ui:InsertFrame(er); |
local chk_upp = VFLUI.Checkbox:new(ui); chk_upp:Show(); |
chk_upp:SetText(VFLI.i18n("Use Perfect Pixel")); |
if opt and opt.upp then chk_upp:SetChecked(true); else chk_upp:SetChecked(); end |
ui:InsertFrame(chk_upp); |
local er = VFLUI.EmbedRight(ui, VFLI.i18n("Font menu")); |
local font = VFLUI.MakeFontSelectButton(er, opt.font); font:Show(); |
er:EmbedChild(font); er:Show(); |
ui:InsertFrame(er); |
local chk_hidemenu = VFLUI.Checkbox:new(ui); chk_hidemenu:Show(); |
chk_hidemenu:SetText(VFLI.i18n("Hide Menu in Main Panel")); |
if opt and opt.hidemenu then chk_hidemenu:SetChecked(true); else chk_hidemenu:SetChecked(); end |
ui:InsertFrame(chk_hidemenu); |
local chk_hidebags = VFLUI.Checkbox:new(ui); chk_hidebags:Show(); |
chk_hidebags:SetText(VFLI.i18n("Hide Bags in Main Panel")); |
if opt and opt.hidebags then chk_hidebags:SetChecked(true); else chk_hidebags:SetChecked(); end |
ui:InsertFrame(chk_hidebags); |
VFLUI.ActivateScrollingCompoundFrame(ui, sf); |
dlg:Show(.2, true); |
VFL.EscapeTo(esch); |
end |
local btnClose = VFLUI.CloseButton:new(dlg); |
dlg:AddButton(btnClose); |
btnClose:SetScript("OnClick", function() VFL.EscapeTo(esch); end); |
-- OK |
local btnOK = VFLUI.OKButton:new(dlg); |
btnOK:SetHeight(25); btnOK:SetWidth(60); |
btnOK:SetPoint("BOTTOMRIGHT", dlg:GetClientArea(), "BOTTOMRIGHT", -15, 0); |
btnOK:SetText("OK"); btnOK:Show(); |
btnOK:SetScript("OnClick", function() |
--local save = VFL.copy(opt); |
local function Save() |
opt.asmp = chk_asmp:GetChecked(); |
opt.hmp = chk_hmp:GetChecked(); |
opt.mbkd = mbkd:GetSelectedBackdrop(); |
opt.bkd = bkd:GetSelectedBackdrop(); |
opt.font = font:GetSelectedFont(); |
opt.hidemenu = chk_hidemenu:GetChecked(); |
opt.hidebags = chk_hidebags:GetChecked(); |
opt.upp = chk_upp:GetChecked(); |
local mainPane = RDXPM.GetMainPane(); |
if mainPane then |
mainPane:Setmbkd(opt.mbkd); |
mainPane:Setbkd(opt.bkd); |
mainPane:Setfont(opt.font); |
mainPane:SetAllwaysShow(opt.asmp); |
end |
--if chk_hmp:GetChecked() ~= save.hmp then ReloadUI(); end |
--if chk_hidemenu:GetChecked() ~= save.hidemenu then ReloadUI(); end |
--if chk_hidebags:GetChecked() ~= save.hidebags then ReloadUI(); end |
if opt.upp then |
SetCVar("uiScale", 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)")); |
end |
VFL.EscapeTo(esch); |
end); |
end |
local savebtn = VFLUI.SaveButton:new() |
savebtn:SetScript("OnClick", Save); |
dlg:AddButton(savebtn); |
local closebtn = VFLUI.CloseButton:new(dlg); |
closebtn:SetScript("OnClick", function() VFL.EscapeTo(esch); end); |
dlg:AddButton(closebtn); |
-- Destructor |
dlg.Destroy = VFL.hook(function(s) |
btnOK:Destroy(); btnOK = nil; |
VFLUI.DestroyScrollingCompoundFrame(ui, sf); |
ui = nil; sf = nil; |
end, dlg.Destroy); |