Mercurial > wow > ouroloot
comparison verbage.lua @ 95:3546c7b55986
Move generation of the Help tab to the same file as the help text. Allow registration of arbitrary tab controls, not just text generation. Move some shared data out of the addon table into a 'gui' state table in preparation for more of the same. Clean some cruft out of the default itemfilter list.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Thu, 26 Jul 2012 03:34:56 +0000 |
parents | c9f955f9a285 |
children | 780b7e0eeeeb |
comparison
equal
deleted
inserted
replaced
94:db1d5d09e5f5 | 95:3546c7b55986 |
---|---|
1 local addon = select(2,...) | |
2 if addon.NOLOAD then return end | |
3 | |
4 -- Don't bother recording any of this loot: | |
5 addon.default_itemfilter = { | |
6 -- could probably remove most of this now | |
7 -- [29434] = true, -- Badge of Justice | |
8 -- [40752] = true, -- Emblem of Heroism | |
9 -- [40753] = true, -- Emblem of Valor | |
10 -- [45624] = true, -- Emblem of Conquest | |
11 -- [43228] = true, -- Stone Keeper's Shard | |
12 -- [47241] = true, -- Emblem of Triumph | |
13 -- [49426] = true, -- Emblem of Frost | |
14 } | |
15 | |
16 -- Mark these as straight to guild vault: | |
17 addon.default_itemvault = { | |
18 [52078] = true, -- Chaos Orb | |
19 [69237] = true, -- Living Ember | |
20 [71998] = true, -- Essence of Destruction | |
21 } | |
1 | 22 |
2 local todo = [[ | 23 local todo = [[ |
3 - When using slash command to go directly to a tab, accept additional arguments | |
4 and let the tab decide how to interpret them. (For starters, History should | |
5 search for a player's name and do the current "magnify" action.) | |
6 | |
7 - Right-clicking the [ouroloot] chat link could do something different than | 24 - Right-clicking the [ouroloot] chat link could do something different than |
8 the current left-clicking. Popup small menu in place? | 25 the current left-clicking. Popup small menu in place? |
9 | 26 |
10 - Break more methods out into private routines. | 27 - Break more methods out into private routines. |
11 | 28 |
12 - implement ack, then fallback to recording if not ack'd | 29 - implement ack, then fallback to recording if not ack'd |
13 | 30 |
14 - Being able to drag rows up and down the main loot grid would be awesome. Coding | 31 - Being able to drag rows up and down the main loot grid would be awesome. Coding |
15 that would be likely to drive me batshiat insane. | 32 that would be likely to drive me batshiat insane. |
16 ]] | 33 ]] |
17 | |
18 local addon = select(2,...) | |
19 if addon.NOLOAD then return end | |
20 | 34 |
21 addon.helptree = { | 35 addon.helptree = { |
22 { | 36 { |
23 value = "about", | 37 value = "about", |
24 text = "About", | 38 text = "About", |
112 ["<"]="|cff00ff00", -- light green, tab titles and generic highlighting | 126 ["<"]="|cff00ff00", -- light green, tab titles and generic highlighting |
113 [">"]="|r" } | 127 [">"]="|r" } |
114 local T={} | 128 local T={} |
115 T.about = [[ | 129 T.about = [[ |
116 Ouro Loot is the fault of Farmbuyer of Ouroboros on US-Kilrogg. Bug reports, | 130 Ouro Loot is the fault of Farmbuyer of Ouroboros on US-Kilrogg. Bug reports, |
117 comments, and suggestions are welcome at the project page at curse.com or send | 131 comments, and suggestions are welcome at the project page: |
118 them to <farmbuyer@gmail.com>. | 132 |
133 <www.curse.com/addons/wow/ouroloot> | |
134 | |
135 | |
136 or send them to <farmbuyer@gmail.com>. | |
119 ]] | 137 ]] |
120 | 138 |
121 T.basic = [[ | 139 T.basic = [[ |
122 The </ouroloot> (and </loot> by default) command opens this display. The buttons | 140 The </ouroloot> command opens this display. The buttons |
123 on the right side control operation and are mostly self-explanatory. Hovering over | 141 on the right side control operation and are mostly self-explanatory. Hovering over |
124 things will usually display some additional text in the gray line at the bottom. | 142 things will usually display some additional text in the gray line at the bottom. |
125 | 143 |
126 Each tab on the left side can additionally create extra contols in the lower right | 144 Each tab on the left side can additionally create extra contols in the lower right |
127 section (with the same name as the tab). | 145 section (with the same name as the tab). |
272 The simplest method of operation is only rebroadcasting the loot events that you | 290 The simplest method of operation is only rebroadcasting the loot events that you |
273 see, as you see them. Nothing is recorded in your local copy of the addon. | 291 see, as you see them. Nothing is recorded in your local copy of the addon. |
274 | 292 |
275 If you logout for any reason, the addon will not reactivate when you log back in. | 293 If you logout for any reason, the addon will not reactivate when you log back in. |
276 | 294 |
277 You can use </loot bcast> or </loot broadcast> to turn on rebroadcasting without | 295 You can use </ouroloot bcast> or </ouroloot broadcast> to turn on rebroadcasting |
278 opening the GUI. | 296 without opening the GUI. |
279 ]] | 297 ]] |
280 | 298 |
281 T.texts = [[ | 299 T.texts = [[ |
282 The middle tabs are simply large editable text boxes. Their text is initially | 300 The middle tabs are simply large editable text boxes. Their text is initially |
283 generated from | 301 generated from |
438 Shift-clicking an item in the <Loot> or <History> display will paste it into an | 456 Shift-clicking an item in the <Loot> or <History> display will paste it into an |
439 open chat editbox. | 457 open chat editbox. |
440 ]] | 458 ]] |
441 | 459 |
442 T.tips_slashies = [[ | 460 T.tips_slashies = [[ |
443 If you give an unrecognized argument to the </ouroloot> slash command, it will | 461 A field in the <Options> tab lets you use additional slash commands as a |
462 shortcut for </ouroloot>. The author prefers </ol>, as an example. The | |
463 default used to be </loot> until that became a builtin command in MoP. | |
464 | |
465 If you give an unrecognized argument to a slash command, it will | |
444 search the tab titles left to right for a title beginning with the same letters as | 466 search the tab titles left to right for a title beginning with the same letters as |
445 the argument, and open the display to that tab. For example, <"/loot a"> would | 467 the argument, and open the display to that tab. For example, <"/ol a"> would |
446 open the <Attendance> tab, and <"/loot ad"> would open the <Advanced> tab. If | 468 open the <Attendance> tab, and <"/ol ad"> would open the <Advanced> tab. If |
447 you had added a theoretical <EQDKP> tab, then <"/loot eq"> would be the fastest | 469 you had added a theoretical <EQDKP> tab, then <"/ol eq"> would be the fastest |
448 way to see it. | 470 way to see it. |
449 | 471 |
450 The </ouroloot> command can take arguments to do things without going through | 472 The </ouroloot> command can take arguments to do things without going through |
451 the UI. Parts given in *(angle brackets)* are required, parts in [square brackets] | 473 the UI. Parts given in *(angle brackets)* are required, parts in [square brackets] |
452 are optional: | 474 are optional: |
576 end | 598 end |
577 end -- do scope | 599 end -- do scope |
578 todo = nil | 600 todo = nil |
579 | 601 |
580 | 602 |
581 -- Don't bother recording any of this loot: | 603 -- Tab 5: Help |
582 addon.default_itemfilter = { | 604 do |
583 [29434] = true, -- Badge of Justice | 605 local AceGUI = LibStub("AceGUI-3.0") |
584 [40752] = true, -- Emblem of Heroism | 606 -- widget container status tables (will have things magically appear |
585 [40753] = true, -- Emblem of Valor | 607 -- inside them that we wish to preserve) |
586 [45624] = true, -- Emblem of Conquest | 608 local status_for_scroll = {} |
587 -- could probably remove most of this now | 609 local status_for_select = { treewidth = 145 } |
588 [43228] = true, -- Stone Keeper's Shard | 610 |
589 [47241] = true, -- Emblem of Triumph | 611 -- Clicking an entry on the left tree column. |
590 [49426] = true, -- Emblem of Frost | 612 local help_OnGroupSelected_func = function (treeg,event,category) |
591 } | 613 treeg:ReleaseChildren() |
592 | 614 local txt = AceGUI:Create("Label") |
593 -- Mark these as straight to guild vault: | 615 txt:SetFullWidth(true) |
594 addon.default_itemvault = { | 616 txt:SetFontObject(GameFontNormal)--Highlight) |
595 [52078] = true, -- Chaos Orb | 617 txt:SetText(addon.helptext[category]) |
596 [69237] = true, -- Living Ember | 618 local sf = AceGUI:Create("ScrollFrame") |
597 [71998] = true, -- Essence of Destruction | 619 sf:SetStatusTable(status_for_scroll) |
598 } | 620 sf:SetLayout("Fill") |
621 -- This forces the scrolling area to be bigger than the visible area; else | |
622 -- some of the text gets cut off without ever triggering the scrollbar. | |
623 sf.content:SetHeight(700) | |
624 sf:AddChild(txt) | |
625 treeg:AddChild(sf) | |
626 if treeg:GetUserData("help restore scroll") then | |
627 if status_for_scroll.scrollvalue then | |
628 sf:SetScroll(status_for_scroll.scrollvalue) | |
629 end | |
630 treeg:SetUserData("help restore scroll", false) | |
631 else | |
632 sf:SetScroll(0) | |
633 end | |
634 end | |
635 | |
636 -- Clicking the Help tab as a whole (tabs_OnGroupSelected["help"]). | |
637 local tabs_OGS = function(container,specials) | |
638 container:SetLayout("Fill") | |
639 local left = AceGUI:Create("TreeGroup") | |
640 left:SetStatusTable(status_for_select) | |
641 left:SetLayout("Fill") | |
642 left:SetFullWidth(true) | |
643 left:SetFullHeight(true) | |
644 left:EnableButtonTooltips(false) | |
645 left:SetTree(addon.helptree) | |
646 left:SetCallback("OnGroupSelected", help_OnGroupSelected_func) | |
647 container:AddChild(left) | |
648 if status_for_select.selected then | |
649 left:SetUserData("help restore scroll", true) | |
650 left:SelectByValue(status_for_select.selected) | |
651 else | |
652 left:SelectByValue("basic") | |
653 end | |
654 end | |
655 | |
656 local noob = [[ | |
657 Every tab across the top also gets its own special buttons here in the lower | |
658 right, under the same name as the tab. Some controls do not become visible | |
659 until that tab has data to work with.]] | |
660 | |
661 addon:register_tab_control_AT_END ("help", [[Help]], | |
662 [[Instructions, reminders, and tips for non-obvious features]], | |
663 tabs_OGS, --[[opt_noobtip=]]noob) | |
664 end | |
599 | 665 |
600 -- vim:noet | 666 -- vim:noet |