From ff207c6acb4ffe4ff942828dc772c077e560452a Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Wed, 1 Sep 2010 04:53:23 +0000 Subject: [PATCH] Use ResourceServer --- Driver.lua | 2 ++ LCD4WoW.toc | 2 +- config.lua | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Driver.lua b/Driver.lua index 62a8c0a..afbe34a 100644 --- a/Driver.lua +++ b/Driver.lua @@ -379,6 +379,8 @@ function mod:StartDisplays() if k:match("^display_") then if v.driver == "QTip" then local display = LibDriverQTip:New(self, self.environment, k, self.db.profile.config, LCD4WoW.db.profile.errorLevel) + display.environment.GetMemUsage = ResourceTools and ResourceTools.GetMemUsage or display.environment.GetMemUsage + display.environment.GetCPUUsage = ResourceTools and ResourceTools.GetCPUUsage or display.environment.GetCPUUsage display:Show() tinsert(displays, display) end diff --git a/LCD4WoW.toc b/LCD4WoW.toc index b118cd1..110f051 100644 --- a/LCD4WoW.toc +++ b/LCD4WoW.toc @@ -4,7 +4,7 @@ ## Author: Starlon ## Version: 1.0 ## X-LCD4WoW-Version: @project-version@ -## OptionalDeps: Ace3, LibTalentQuery-1.0, LibMobHealth-4.0, DBM-Core, BigWigs, StarLibs-1.0, StarTip +## OptionalDeps: Ace3, LibTalentQuery-1.0, LibMobHealth-4.0, DBM-Core, BigWigs, StarLibs-1.0, StarTip, ResourceServer ## SavedVariables: LCD4WoWDB Localization\enUS.lua diff --git a/config.lua b/config.lua index 6598ea9..7574b7e 100644 --- a/config.lua +++ b/config.lua @@ -128,7 +128,7 @@ LCD4WoW.config = { ["widget_mem"] = { type = "text", value = [[ -do return random(100) .. "%" end +--do return random(100) .. "%" end mem = GetMemUsage("StarTip") if mem then return memshort(tonumber(format("%.2f", mem))) @@ -141,7 +141,7 @@ end ["widget_mem_perc"] = { type = "text", value = [[ -do return random(100) .. "%" end +--do return random(100) .. "%" end mem, percent, memdiff, totalMem, totaldiff = GetMemUsage("StarTip") if mem then if totaldiff == 0 then totaldiff = 1 end @@ -158,7 +158,7 @@ end ["widget_mem_bar"] = { type = "bar", expression = [[ -do return random(100) end +--do return random(100) end mem, percent, memdiff, totalMem, totaldiff = GetMemUsage("StarTip") if mem then if totaldiff == 0 then return 0 end @@ -172,7 +172,7 @@ end ["widget_mem_histogram"] = { type = "histogram", expression = [[ -do return random(100) end +--do return random(100) end mem, percent, memdiff, totalMem, totaldiff = GetMemUsage("StarTip") if mem then if totaldiff == 0 then return 0 end @@ -194,7 +194,7 @@ end ["widget_cpu"] = { type = "text", value = [[ -do return timeshort(random(10000)) end +--do return timeshort(random(10000)) end cpu = GetCPUUsage("StarTip") if cpu then return timeshort(cpu) @@ -207,7 +207,7 @@ end ["widget_cpu_bar"] = { type = "bar", expression = [[ -do return random(100) end +--do return random(100) end cpu, percent, cpudiff, totalCPU, totaldiff = GetCPUUsage("StarTip") if cpu then if totaldiff == 0 then return 0 end @@ -221,7 +221,7 @@ end ["widget_cpu_histogram"] = { type = "histogram", expression = [[ -do return random(100) end +--do return random(100) end cpu, percent, cpudiff, totalCPU, totaldiff = GetCPUUsage("StarTip") if cpu then if totaldiff == 0 then return 0 end @@ -236,7 +236,7 @@ end ["widget_cpu_perc"] = { type = "text", value = [[ -do return format("------%d%%-------", random(100)) end +--do return format("------%d%%-------", random(100)) end cpu, percent,cpudiff, totalCpu, totaldiff = GetMemUsage("StarTip") if cpu then if totaldiff == 0 then totaldiff = 1 end -- 1.7.9.5