comparison Devian.lua @ 91:bb403e03d82d

- /dvc command needed a pre-defined enclosure to properly work through SlashCmdList - /dvn <profile name> and /dvn save <profile name> should resolve to and update the correct profile. - set some globals indicating the name and index of the workspace in use - DEVIAN_WORKSPACE (bool) - DEVIAN_PNAME (string) - DEVIAN_PID (number)
author Nenue
date Wed, 10 Aug 2016 07:10:55 -0400
parents b3ed963f482d
children 4370eefcecdd
comparison
equal deleted inserted replaced
90:44bdeab03764 91:bb403e03d82d
1 --- Devian - Devian.lua 1 --- Devian - Devian.lua
2 -- @file-author@ 2 -- @file-author@
3 -- @project-revision@ @project-hash@ 3 -- @project-revision@ @project-hash@
4 -- @file-revision@ @file-hash@ 4 -- @file-revision@ @file-hash@
5 5
6 --GLOBALS: Devian, DevCon, DevianLoadMessage, DEVIAN_WORKSPACE 6 --GLOBALS: Devian, DevianLoadMessage, DEVIAN_WORKSPACE, DEVIAN_PNAME, DEVIAN_PID
7
8 DEVIAN_WORKSPACE = false
9 DEVIAN_PNAME = 'Dvn'
10 DEVIAN_PID = 0
7 11
8 local ADDON, D = ... 12 local ADDON, D = ...
9 local MAJOR, MINOR = 'Devian-2.0', 'r@project-revision@' 13 local MAJOR, MINOR = 'Devian-2.0', 'r@project-revision@'
10 local D = LibStub("AceAddon-3.0"):NewAddon(D, "Devian", "AceConsole-3.0", "AceEvent-3.0") 14 local D = LibStub("AceAddon-3.0"):NewAddon(D, "Devian", "AceConsole-3.0", "AceEvent-3.0")
11 local L = D.L 15 local L = D.L
15 local tinsert, tremove, rawset = tinsert, tremove, rawset 19 local tinsert, tremove, rawset = tinsert, tremove, rawset
16 local currentProfile 20 local currentProfile
17 local playerName = UnitName("player") 21 local playerName = UnitName("player")
18 local playerRealm = playerName .. '-' .. GetRealmName() 22 local playerRealm = playerName .. '-' .. GetRealmName()
19 local num_dock_tabs = 0 23 local num_dock_tabs = 0
20 DEVIAN_WORKSPACE = false
21 DEVIAN_PNAME = 'Dvn'
22 DEVIAN_PID = 0
23 24
24 25
25 DevianLoadMessage = setmetatable({}, { 26 DevianLoadMessage = setmetatable({}, {
26 __call = function(t, msg) 27 __call = function(t, msg)
27 rawset(t, #t+1, msg) 28 rawset(t, #t+1, msg)
224 225
225 226
226 currentProfile.char[playerRealm] = currentProfile.char[playerRealm] or {} 227 currentProfile.char[playerRealm] = currentProfile.char[playerRealm] or {}
227 if currentProfile.workspace then 228 if currentProfile.workspace then
228 DEVIAN_WORKSPACE = true 229 DEVIAN_WORKSPACE = true
229 DEVIAN_PNAME = name 230 DEVIAN_PNAME = currentProfile.name
230 DEVIAN_PID = id 231 DEVIAN_PID = id
231 setprinthandler(D.Message) 232 setprinthandler(D.Message)
232 else 233 else
233 DEVIAN_WORKSPACE = false 234 DEVIAN_WORKSPACE = false
234 DEVIAN_PNAME = '' 235 DEVIAN_PNAME = ''