Mercurial > wow > wowdb-profiler
comparison Main.lua @ 270:e1566483082c
Added visual menu for selecting a comment subject via minimap icon (defaults to off), LDB icon, or the /comment command without an argument.
| author | James D. Callahan III <jcallahan@curse.com> |
|---|---|
| date | Thu, 21 Mar 2013 15:11:34 -0500 |
| parents | 03f1fbe64104 |
| children | 495108578530 |
comparison
equal
deleted
inserted
replaced
| 269:463b0f117b1b | 270:e1566483082c |
|---|---|
| 48 } | 48 } |
| 49 | 49 |
| 50 local DATABASE_DEFAULTS = { | 50 local DATABASE_DEFAULTS = { |
| 51 char = {}, | 51 char = {}, |
| 52 global = { | 52 global = { |
| 53 config = { | |
| 54 minimap_icon = { | |
| 55 hide = true, | |
| 56 }, | |
| 57 }, | |
| 53 items = {}, | 58 items = {}, |
| 54 npcs = {}, | 59 npcs = {}, |
| 55 objects = {}, | 60 objects = {}, |
| 56 quests = {}, | 61 quests = {}, |
| 57 spells = {}, | 62 spells = {}, |
| 297 unit = {} | 302 unit = {} |
| 298 global_db[data_type][unit_id] = unit | 303 global_db[data_type][unit_id] = unit |
| 299 end | 304 end |
| 300 return unit | 305 return unit |
| 301 end | 306 end |
| 307 | |
| 302 private.DBEntry = DBEntry | 308 private.DBEntry = DBEntry |
| 303 | 309 |
| 304 local NPCEntry | 310 local NPCEntry |
| 305 do | 311 do |
| 306 local npc_prototype = {} | 312 local npc_prototype = {} |
| 371 if not item_link then | 377 if not item_link then |
| 372 return | 378 return |
| 373 end | 379 end |
| 374 return tonumber(item_link:match("item:(%d+)")) | 380 return tonumber(item_link:match("item:(%d+)")) |
| 375 end | 381 end |
| 382 | |
| 376 private.ItemLinkToID = ItemLinkToID | 383 private.ItemLinkToID = ItemLinkToID |
| 377 | 384 |
| 378 local function UnitTypeIsNPC(unit_type) | 385 local function UnitTypeIsNPC(unit_type) |
| 379 return unit_type == private.UNIT_TYPES.NPC or unit_type == private.UNIT_TYPES.VEHICLE | 386 return unit_type == private.UNIT_TYPES.NPC or unit_type == private.UNIT_TYPES.VEHICLE |
| 380 end | 387 end |
| 708 | 715 |
| 709 -- METHODS ------------------------------------------------------------ | 716 -- METHODS ------------------------------------------------------------ |
| 710 | 717 |
| 711 function WDP:OnInitialize() | 718 function WDP:OnInitialize() |
| 712 local db = LibStub("AceDB-3.0"):New("WoWDBProfilerData", DATABASE_DEFAULTS, "Default") | 719 local db = LibStub("AceDB-3.0"):New("WoWDBProfilerData", DATABASE_DEFAULTS, "Default") |
| 720 private.db = db | |
| 713 global_db = db.global | 721 global_db = db.global |
| 714 char_db = db.char | 722 char_db = db.char |
| 715 | 723 |
| 716 local raw_db = _G["WoWDBProfilerData"] | 724 local raw_db = _G.WoWDBProfilerData |
| 717 local build_num = tonumber(private.build_num) | 725 local build_num = tonumber(private.build_num) |
| 718 | 726 |
| 719 if (raw_db.version and raw_db.version < DB_VERSION) or (raw_db.build_num and raw_db.build_num < build_num) then | 727 if (raw_db.version and raw_db.version < DB_VERSION) or (raw_db.build_num and raw_db.build_num < build_num) then |
| 720 for entry in pairs(DATABASE_DEFAULTS.global) do | 728 for entry in pairs(DATABASE_DEFAULTS.global) do |
| 721 global_db[entry] = {} | 729 global_db[entry] = {} |
| 723 end | 731 end |
| 724 raw_db.build_num = build_num | 732 raw_db.build_num = build_num |
| 725 raw_db.version = DB_VERSION | 733 raw_db.version = DB_VERSION |
| 726 | 734 |
| 727 if DEBUGGING then -- TODO: Remove this when comment subsystem is finished. | 735 if DEBUGGING then -- TODO: Remove this when comment subsystem is finished. |
| 736 private.InitializeCommentSystem() | |
| 728 self:RegisterChatCommand("comment", private.ProcessCommentCommand) | 737 self:RegisterChatCommand("comment", private.ProcessCommentCommand) |
| 729 end | 738 end |
| 730 end | 739 end |
| 731 | 740 |
| 732 | 741 |
