Mercurial > wow > askmrrobot
comparison ui/Ui.lua @ 124:e31b02b24488
Updated for 8.0 pre-patch and BfA.
| author | yellowfive |
|---|---|
| date | Tue, 17 Jul 2018 09:57:39 -0700 |
| parents | f1da233629be |
| children | a0894ffebd15 |
comparison
equal
deleted
inserted
replaced
| 123:7a6364917f86 | 124:e31b02b24488 |
|---|---|
| 166 f:SetScale(scale) | 166 f:SetScale(scale) |
| 167 end | 167 end |
| 168 | 168 |
| 169 -- some status text | 169 -- some status text |
| 170 local lblStatus = AceGUI:Create("AmrUiLabel") | 170 local lblStatus = AceGUI:Create("AmrUiLabel") |
| 171 f:AddChild(lblStatus) | |
| 171 lblStatus:SetWidth(900) | 172 lblStatus:SetWidth(900) |
| 172 lblStatus:SetFont(Amr.CreateFont("Italic", 12, Amr.Colors.TextTan)) | 173 lblStatus:SetFont(Amr.CreateFont("Italic", 12, Amr.Colors.TextTan)) |
| 173 lblStatus:SetText("Ask Mr. Robot " .. L.MainStatusText("v" .. GetAddOnMetadata(Amr.ADDON_NAME, "Version"), "https://www.askmrrobot.com/wow/addon")) | 174 lblStatus:SetText("Ask Mr. Robot " .. L.MainStatusText("v" .. GetAddOnMetadata(Amr.ADDON_NAME, "Version"), "https://www.askmrrobot.com/wow/addon")) |
| 174 lblStatus:SetJustifyH("CENTER") | 175 lblStatus:SetJustifyH("CENTER") |
| 175 lblStatus:SetWordWrap(false) | 176 lblStatus:SetWordWrap(false) |
| 176 lblStatus:SetPoint("TOP", f.content, "BOTTOM") | 177 lblStatus:SetPoint("TOP", f.content, "BOTTOM") |
| 177 f:AddChild(lblStatus) | |
| 178 | 178 |
| 179 -- create the main UI container | 179 -- create the main UI container |
| 180 local c = AceGUI:Create("AmrUiPanel") | 180 local c = AceGUI:Create("AmrUiPanel") |
| 181 c:SetLayout("Fill") | 181 c:SetLayout("Fill") |
| 182 c:SetBackgroundColor(Amr.Colors.Black, 0) | 182 c:SetBackgroundColor(Amr.Colors.Black, 0) |
| 183 f:AddChild(c) | |
| 183 c:SetPoint("TOPLEFT", f.content, "TOPLEFT") | 184 c:SetPoint("TOPLEFT", f.content, "TOPLEFT") |
| 184 c:SetPoint("BOTTOMRIGHT", f.content, "BOTTOMRIGHT") | 185 c:SetPoint("BOTTOMRIGHT", f.content, "BOTTOMRIGHT") |
| 185 f:AddChild(c) | |
| 186 | 186 |
| 187 -- create the main tab strip | 187 -- create the main tab strip |
| 188 local t = AceGUI:Create("AmrUiTabGroup") | 188 local t = AceGUI:Create("AmrUiTabGroup") |
| 189 c:AddChild(t) | |
| 189 t:SetLayout("None") | 190 t:SetLayout("None") |
| 190 t:SetTabs({ | 191 t:SetTabs({ |
| 191 {text=L.TabExportText, value="Export"}, | 192 {text=L.TabExportText, value="Export"}, |
| 192 {text=L.TabGearText, value="Gear"}, | 193 {text=L.TabGearText, value="Gear"}, |
| 193 {text=L.TabLogText, value="Log"}, | 194 {text=L.TabLogText, value="Log"}, |
| 194 --{text=L.TabTeamText, value="Team"}, | 195 --{text=L.TabTeamText, value="Team"}, |
| 195 {text=L.TabOptionsText, value="Options"} | 196 {text=L.TabOptionsText, value="Options"} |
| 196 }) | 197 }) |
| 197 t:SetCallback("OnGroupSelected", onMainTabSelected) | 198 t:SetCallback("OnGroupSelected", onMainTabSelected) |
| 198 c:AddChild(t) | |
| 199 | 199 |
| 200 -- create the cover/overlay container | 200 -- create the cover/overlay container |
| 201 c = AceGUI:Create("AmrUiPanel") | 201 c = AceGUI:Create("AmrUiPanel") |
| 202 c:SetLayout("None") | 202 c:SetLayout("None") |
| 203 c:EnableMouse(true) | 203 c:EnableMouse(true) |
| 204 c:SetBackgroundColor(Amr.Colors.Black, 0.75) | 204 c:SetBackgroundColor(Amr.Colors.Black, 0.75) |
| 205 f:AddChild(c) | |
| 205 c:SetPoint("TOPLEFT", f.frame, "TOPLEFT") | 206 c:SetPoint("TOPLEFT", f.frame, "TOPLEFT") |
| 206 c:SetPoint("BOTTOMRIGHT", f.frame, "BOTTOMRIGHT") | 207 c:SetPoint("BOTTOMRIGHT", f.frame, "BOTTOMRIGHT") |
| 207 f:AddChild(c) | |
| 208 | 208 |
| 209 -- after adding, set cover to sit on top of everything, then hide it | 209 -- after adding, set cover to sit on top of everything, then hide it |
| 210 c:SetStrata("FULLSCREEN_DIALOG") | 210 c:SetStrata("FULLSCREEN_DIALOG") |
| 211 c:SetLevel(Amr.FrameLevels.High) | 211 c:SetLevel(Amr.FrameLevels.High) |
| 212 c:SetVisible(false) | 212 c:SetVisible(false) |
| 213 | 213 |
| 214 -- put standard cover ui elements (label, cancel button) | 214 -- put standard cover ui elements (label, cancel button) |
| 215 local coverMsg = AceGUI:Create("AmrUiLabel") | 215 local coverMsg = AceGUI:Create("AmrUiLabel") |
| 216 c:AddChild(coverMsg) | |
| 216 coverMsg:SetWidth(600) | 217 coverMsg:SetWidth(600) |
| 217 coverMsg:SetFont(Amr.CreateFont("Regular", 16, Amr.Colors.TextTan)) | 218 coverMsg:SetFont(Amr.CreateFont("Regular", 16, Amr.Colors.TextTan)) |
| 218 coverMsg:SetJustifyH("MIDDLE") | 219 coverMsg:SetJustifyH("MIDDLE") |
| 219 coverMsg:SetJustifyV("MIDDLE") | 220 coverMsg:SetJustifyV("MIDDLE") |
| 220 coverMsg:SetText("") | 221 coverMsg:SetText("") |
| 221 coverMsg:SetPoint("CENTER", c.frame, "CENTER", 0, 20) | 222 coverMsg:SetPoint("CENTER", c.frame, "CENTER", 0, 20) |
| 222 c:AddChild(coverMsg) | |
| 223 | 223 |
| 224 local coverCancel = AceGUI:Create("AmrUiTextButton") | 224 local coverCancel = AceGUI:Create("AmrUiTextButton") |
| 225 coverCancel:SetWidth(200) | 225 coverCancel:SetWidth(200) |
| 226 coverCancel:SetHeight(20) | 226 coverCancel:SetHeight(20) |
| 227 coverCancel:SetText(L.CoverCancel) | 227 coverCancel:SetText(L.CoverCancel) |
| 228 coverCancel:SetFont(Amr.CreateFont("Italic", 14, Amr.Colors.TextHeaderDisabled)) | 228 coverCancel:SetFont(Amr.CreateFont("Italic", 14, Amr.Colors.TextHeaderDisabled)) |
| 229 coverCancel:SetHoverFont(Amr.CreateFont("Italic", 14, Amr.Colors.TextHeaderActive)) | 229 coverCancel:SetHoverFont(Amr.CreateFont("Italic", 14, Amr.Colors.TextHeaderActive)) |
| 230 c:AddChild(coverCancel) | |
| 230 coverCancel:SetPoint("CENTER", c.frame, "CENTER", 0, -20) | 231 coverCancel:SetPoint("CENTER", c.frame, "CENTER", 0, -20) |
| 231 c:AddChild(coverCancel) | |
| 232 | 232 |
| 233 coverCancel:SetCallback("OnClick", function(widget) | 233 coverCancel:SetCallback("OnClick", function(widget) |
| 234 Amr:HideCover() | 234 Amr:HideCover() |
| 235 end) | 235 end) |
| 236 | 236 |
| 237 -- create cover content area for custom cover ui (sort of like a modal dialog) | 237 -- create cover content area for custom cover ui (sort of like a modal dialog) |
| 238 local coverContent = AceGUI:Create("AmrUiPanel") | 238 local coverContent = AceGUI:Create("AmrUiPanel") |
| 239 coverContent:SetLayout("None") | 239 coverContent:SetLayout("None") |
| 240 coverContent:SetBackgroundColor(Amr.Colors.Black, 0) | 240 coverContent:SetBackgroundColor(Amr.Colors.Black, 0) |
| 241 c:AddChild(coverContent) | |
| 241 coverContent:SetPoint("TOPLEFT", c.frame, "TOPLEFT") | 242 coverContent:SetPoint("TOPLEFT", c.frame, "TOPLEFT") |
| 242 coverContent:SetPoint("BOTTOMRIGHT", c.frame, "BOTTOMRIGHT") | 243 coverContent:SetPoint("BOTTOMRIGHT", c.frame, "BOTTOMRIGHT") |
| 243 c:AddChild(coverContent) | |
| 244 | 244 |
| 245 _mainFrame = f | 245 _mainFrame = f |
| 246 _mainTabs = t | 246 _mainTabs = t |
| 247 _mainCover = { | 247 _mainCover = { |
| 248 panel = c, | 248 panel = c, |
| 286 local border = AceGUI:Create("AmrUiPanel") | 286 local border = AceGUI:Create("AmrUiPanel") |
| 287 border:SetLayout("None") | 287 border:SetLayout("None") |
| 288 border:SetBackgroundColor(Amr.Colors.BorderBlue) | 288 border:SetBackgroundColor(Amr.Colors.BorderBlue) |
| 289 border:SetWidth(400) | 289 border:SetWidth(400) |
| 290 border:SetHeight(150) | 290 border:SetHeight(150) |
| 291 container:AddChild(border) | |
| 291 border:SetPoint("CENTER", container.frame, "CENTER") | 292 border:SetPoint("CENTER", container.frame, "CENTER") |
| 292 container:AddChild(border) | |
| 293 | 293 |
| 294 local bg = AceGUI:Create("AmrUiPanel") | 294 local bg = AceGUI:Create("AmrUiPanel") |
| 295 bg:SetLayout("None") | 295 bg:SetLayout("None") |
| 296 bg:SetBackgroundColor(Amr.Colors.Bg) | 296 bg:SetBackgroundColor(Amr.Colors.Bg) |
| 297 border:AddChild(bg) | |
| 297 bg:SetPoint("TOPLEFT", border.frame, "TOPLEFT", 1, -1) | 298 bg:SetPoint("TOPLEFT", border.frame, "TOPLEFT", 1, -1) |
| 298 bg:SetPoint("BOTTOMRIGHT", border.frame, "BOTTOMRIGHT", -1, 1) | 299 bg:SetPoint("BOTTOMRIGHT", border.frame, "BOTTOMRIGHT", -1, 1) |
| 299 border:AddChild(bg) | |
| 300 | 300 |
| 301 local lbl = AceGUI:Create("AmrUiLabel") | 301 local lbl = AceGUI:Create("AmrUiLabel") |
| 302 bg:AddChild(lbl) | |
| 302 lbl:SetWidth(360) | 303 lbl:SetWidth(360) |
| 303 lbl:SetFont(Amr.CreateFont("Regular", 16, Amr.Colors.Text)) | 304 lbl:SetFont(Amr.CreateFont("Regular", 16, Amr.Colors.Text)) |
| 304 lbl:SetJustifyH("CENTER") | 305 lbl:SetJustifyH("CENTER") |
| 305 lbl:SetText(message) | 306 lbl:SetText(message) |
| 306 lbl:SetPoint("TOP", bg.content, "TOP", 0, -20) | 307 lbl:SetPoint("TOP", bg.content, "TOP", 0, -20) |
| 307 bg:AddChild(lbl) | |
| 308 | 308 |
| 309 local btn = AceGUI:Create("AmrUiButton") | 309 local btn = AceGUI:Create("AmrUiButton") |
| 310 btn:SetBackgroundColor(Amr.Colors.Orange) | 310 btn:SetBackgroundColor(Amr.Colors.Orange) |
| 311 btn:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White)) | 311 btn:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White)) |
| 312 btn:SetWidth(120) | 312 btn:SetWidth(120) |
| 313 btn:SetHeight(26) | 313 btn:SetHeight(26) |
| 314 btn:SetText(btnText) | 314 btn:SetText(btnText) |
| 315 bg:AddChild(btn) | |
| 315 btn:SetPoint("BOTTOM", bg.content, "BOTTOM", 0, 20) | 316 btn:SetPoint("BOTTOM", bg.content, "BOTTOM", 0, 20) |
| 316 bg:AddChild(btn) | |
| 317 | 317 |
| 318 btn:SetCallback("OnClick", function(widget) | 318 btn:SetCallback("OnClick", function(widget) |
| 319 Amr:HideCover() | 319 Amr:HideCover() |
| 320 end) | 320 end) |
| 321 end) | 321 end) |
| 408 local border = AceGUI:Create("AmrUiPanel") | 408 local border = AceGUI:Create("AmrUiPanel") |
| 409 border:SetLayout("None") | 409 border:SetLayout("None") |
| 410 border:SetBackgroundColor(Amr.Colors.BorderBlue) | 410 border:SetBackgroundColor(Amr.Colors.BorderBlue) |
| 411 border:SetWidth(width + 2) | 411 border:SetWidth(width + 2) |
| 412 border:SetHeight(height + 2) | 412 border:SetHeight(height + 2) |
| 413 container:AddChild(border) | |
| 413 border:SetPoint("CENTER", container.frame, "CENTER") | 414 border:SetPoint("CENTER", container.frame, "CENTER") |
| 414 container:AddChild(border) | |
| 415 | 415 |
| 416 local bg = AceGUI:Create("AmrUiPanel") | 416 local bg = AceGUI:Create("AmrUiPanel") |
| 417 bg:SetLayout("None") | 417 bg:SetLayout("None") |
| 418 bg:SetBackgroundColor(Amr.Colors.Bg) | 418 bg:SetBackgroundColor(Amr.Colors.Bg) |
| 419 border:AddChild(bg) | |
| 419 bg:SetPoint("TOPLEFT", border.frame, "TOPLEFT", 1, -1) | 420 bg:SetPoint("TOPLEFT", border.frame, "TOPLEFT", 1, -1) |
| 420 bg:SetPoint("BOTTOMRIGHT", border.frame, "BOTTOMRIGHT", -1, 1) | 421 bg:SetPoint("BOTTOMRIGHT", border.frame, "BOTTOMRIGHT", -1, 1) |
| 421 border:AddChild(bg) | |
| 422 | 422 |
| 423 return bg, border | 423 return bg, border |
| 424 end | 424 end |
