Mercurial > wow > skeletonkey
changeset 2:f7a0898d293c
adding library files, toc files, and a missing XML to versioning
author | Nenue |
---|---|
date | Tue, 21 Jun 2016 08:10:36 -0400 |
parents | cd7d06bcd98d |
children | 07293831dd7b |
files | SkeletonStats/SkeletonStats.toc SkeletonUnit/SkeletonUnit.toc SkeletonUnit/UnitFrame.xml libKT/libKT-1.0.lua libKT/libKT-1.0.xml libKT/libKT.iml libKT/libKT.toc |
diffstat | 7 files changed, 617 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SkeletonStats/SkeletonStats.toc Tue Jun 21 08:10:36 2016 -0400 @@ -0,0 +1,15 @@ +## Interface: 70000 +## Title: Skeleton Stats +## Notes: Combat statistics for dinosaurs +## Author: Krakyn +## Version: 1.0-@project-revision@ +## SavedVariables: SkeletonStatsDB +## X-Category: Interface Enhancements +## DefaultState: Enabled +## LoadOnDemand: 0 +## OptionalDeps: libKT + +libKT-1.0\libKT-1.0.xml + +DamageMeter.xml +DamageMeter.lua \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SkeletonUnit/SkeletonUnit.toc Tue Jun 21 08:10:36 2016 -0400 @@ -0,0 +1,15 @@ +## Interface: 70000 +## Title: Skeleton Unit +## Notes: Unit Frames for dinosaurs +## Author: Krakyn +## SavedVariables: FossilDB +## Version: 1.0-@project-revision@ +## X-Category: Interface Enhancements +## DefaultState: Enabled +## LoadOnDemand: 0 +## OptionalDeps: libKT + +libKT-1.0\libKT-1.0.xml + +UnitFrame.xml +UnitFrame.lua \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SkeletonUnit/UnitFrame.xml Tue Jun 21 08:10:36 2016 -0400 @@ -0,0 +1,74 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + + <Texture name="KTStatusBar" virtual="true" /> + <Frame name="SkeletonUnits" parent="UIParent"></Frame> + + <Frame name="KTUnitFrame" parent="UIParent" virtual="true"> + <Size x="250" y="50" /> + <Layers> + <Layer level="BACKGROUND"> + <Texture name="$parentHealthBG" inherits="KTStatusBar" parentKey="bg"> + <Color r="0" g="0" b="0" a="1" /> + </Texture> + </Layer> + <Layer level="ARTWORK"> + <Texture name="$parentHealth" inherits="KTStatusBar" parentKey="healthbar"> + <Anchors> + <Anchor point="LEFT" /> + <Anchor point="TOP" /> + <Anchor point="BOTTOM" relativePoint="TOP" x="0" y="-20" /> + + </Anchors> + <Color r="1" g="1" b="1" a="1" /> + </Texture> + <Texture name="$parentPower" inherits="KTStatusBar" parentKey="powerbar"> + <Anchors> + <Anchor point="LEFT" /> + <Anchor point="TOP" x="0" y="-20" /> + <Anchor point="BOTTOM" /> + + </Anchors> + <Color r="1" g="0" b=".5" a="1" /> + </Texture> + </Layer> + <Layer level="OVERLAY"> + + <FontString inherits="NumberFont_Outline_Large" parentKey="healthtext" text="HEALTH_TEXT"> + <Anchors> + <Anchor point="LEFT" relativeKey="$parent.healthbar" /> + </Anchors> + </FontString> + + <FontString inherits="NumberFont_Outline_Large" parentKey="powertext" text="POWER_TEXT"> + <Anchors> + <Anchor point="RIGHT" relativeKey="$parent.healthbar" /> + </Anchors> + </FontString> + </Layer> + </Layers> + </Frame> + + <Frame name="KTplayerFrame" inherits="KTUnitFrame"> + + <Anchors> + <Anchor point="BOTTOM" x="0" y="260" /> + </Anchors> + </Frame> + <Frame name="KTpetFrame" inherits="KTUnitFrame"> + + <Anchors> + <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" relativeTo="KTplayerFrame" x="-2" /> + </Anchors> + </Frame> + <Frame name="KTtargetFrame" inherits="KTUnitFrame"> + + + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="4" y="0" relativeTo="KTplayerFrame" /> + </Anchors> + </Frame> + + <Frame name="KTfocusFrame" inherits="KTUnitFrame" /> + +</Ui> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libKT/libKT-1.0.lua Tue Jun 21 08:10:36 2016 -0400 @@ -0,0 +1,244 @@ +--[[ Implements +-- KT.register(frame) to hook the following (all optional): +-- frame:init() run immediately after KT sets itself up +-- frame:profile("Name-TruncatedRealm") called the first time SavedVars data becomes available +-- frame:variables() called by PLAYER_ENTERING_WORLD +-- frame:event(event, ...) replaces the event callback +-- frame:ui() called by /ui when activating +]]-- + +--GLOBALS: LibKT, KrakTool, KTErrorFrame, LibKTError, SlashCmdList, SLASH_RL1, SLASH_UI1 +local CreateFrame, debugstack, tostring, select = CreateFrame, debugstack, tostring, select +local print, max, unpack, tinsert = print, max, unpack, tinsert +local ipairs, xpcall = ipairs, xpcall +local UI_TOGGLE = false + +KrakTool = CreateFrame('Frame', 'KrakTool', UIParent) +LibKT = select(2, ...) +local KT = LibKT +KT.handler = KrakTool +KT.frames = {} + +SLASH_RL1 = "/rl" +SlashCmdList.RL = function () + ReloadUI() +end + +SLASH_UI1 = "/ui" +SlashCmdList.UI = function () + if UI_TOGGLE then + UI_TOGGLE = false + else + UI_TOGGLE = true + end + for i, frame in pairs(KT.frames) do + if UI_TOGGLE then + if frame.close then + frame.close() + else + frame:Hide() + end + else + if frame.ui then + frame.ui() + end + frame:Show() + end + end +end + +LibKTError = function(msg) + local dstack = debugstack() + :gsub("Interface\\AddOns\\",'~\\') + :gsub("<(.-)>", function(a) return '|cFF00FFFF<'.. a ..'>|r' end) + KTErrorFrame.errmsg:SetText(msg) + KTErrorFrame.debugstack:SetText(dstack) + KTErrorFrame:SetHeight(KTErrorFrame.debugstack:GetStringHeight() + KTErrorFrame.errmsg:GetStringHeight() + 12) + KTErrorFrame:Show() +end + +local initStack = {} +local eventStub = function(self, event, ...) + local isHandled + local nodebug + + if self.event then + nodebug = self.event(self, event, ...) + end + + if self[event] then + nodebug = nodebug or self[event](self, event, ...) + self.missed = 0 + self.handled = self.handled + 1 + isHandled = true + else + self.firstEvent = false + self.unhandled = self.unhandled + 1 + self.missed = self.missed + 1 + end + + if nodebug then + return + end + + print(self:GetName(), event, ...) + + -- debug outputs + if self.status then + self.status:SetText(event .. '\n|cFF00FF00' .. self.handled .. '|r |cFFFF8800' .. self.missed .. '|r |cFFFF4400' .. self.unhandled .. '|r') + if isHandled then + self.status:SetTextColor(0,1,0) + if self.log then + local logtext = event + for i = 1, select('#',...) do + logtext = logtext .. '\n' .. i .. ':' .. tostring(select(i,...)) + end + self.log:SetText('|cFFFFFF00last|r\n' .. logtext) + local newWidth = self.log:GetStringWidth() + + if self.logfirst then + if not self.firstEvent then + self.firstEvent = event + self.logfirst:SetText('|cFF00FF88first|r\n' .. logtext) + end + + newWidth = newWidth + self.logfirst:GetStringWidth() + end + if self.logdiff then + if not event ~= self.firstEvent then + self.firstEvent = event + self.logdiff:SetText('|cFF0088FFdiff|r\n' .. logtext) + end + newWidth = newWidth + self.logdiff:GetStringWidth() + end + --self:SetWidth(newWidth) + end + else + self.status:SetTextColor(1,0,0) + end + end +end + +KT.register = function(frame, name, noGUI) + if not name then + name = frame:GetName() + end + + KT.frames[name] = frame + frame:SetScript('OnEvent', eventStub) + frame.unhandled = 0 + frame.missed = 0 + frame.handled = 0 + frame.firstEvent = false + tinsert(initStack, frame) + + if noGUI then + return + end + + frame.UIPanelAnchor = {'TOPLEFT', frame, 'TOPLEFT', 12, -12 } + frame.UIPanelGrowth = {'TOPLEFT', 'TOPRIGHT', 14, 0} + frame.button = KT.button + frame.uibutton = KT.uibutton + frame.tab = KT.tab + frame.print = KT.print + + return KT +end + +KT.handler:RegisterEvent('VARIABLES_LOADED') +KT.handler:SetScript('OnEvent', function(self, event, ...) + print('KrakTool', event, ...) + if not LibKTDB then + LibKTDB = {} + end + KT.db = LibKTDB + + KT.db.runcount = KT.db.runcount or 1 + KT.db.runcount = KT.db.runcount + 1 + print(KT.db.runcount) + + for i, frame in ipairs(initStack) do + print('|cFF00FF00', i, '|r', frame:GetName()) + if frame.init then + xpcall(frame.init, LibKTError) + end + end + + self:RegisterEvent('PLAYER_ENTERING_WORLD') + self:SetScript('OnEvent', function() + for i, frame in ipairs(initStack) do + print('|cFF00FFFF', i, '|r', frame:GetName()) + if frame.variables then + xpcall(frame.variables, LibKTError) + end + end + end) +end) + +KT.print = function(module, ...) + print('|cFF00FFFF'..module:GetName()..'|r:', ...) +end + +--- Button generators + +local GetButtonTemplate = function(name, parent, template, onClick) + if _G[name] then + return _G[name] + end + + local button = CreateFrame('Button', name, parent, template) + button:SetScript('OnMouseUp', onClick) + return button +end + +local SetButtonAnchor = function(self, collector, anchor, growth) + if self:GetID() == 0 then + self:SetID(#collector) + print('registered TabButton #', self:GetID()) + end + + if self:GetID() == 1 then + self:SetPoint(unpack(anchor)) + else + growth[2] = collector[self:GetID()-1] + self:SetPoint(unpack(growth)) + end +end + +KT.tab = function(self, name, tooltip, texture, coords) + local button = GetButtonTemplate(name, self, 'KTTabButton', self.SelectTab) + button.icon:SetTexture(texture) + button.tooltip = tooltip + button:SetSize(unpack(self.tabSize)) + if coords then + button.icon:SetTexCoord(unpack(coords)) + end + SetButtonAnchor(button, self.tabButtons, self.tabAnchor, self.tabGrowth) + return button +end + +KT.button = function(self, name, text, tooltip, onClick) + local button = GetButtonTemplate(name, self, 'KTButton', onClick) + + button.tooltip = tooltip + button:SetText(text) + button:SetWidth(max(button:GetWidth(), button:GetFontString():GetStringWidth() + 12)) + + SetButtonAnchor(button, self.controls, self.controlsAnchor, self.controlsGrowth) + return button +end + +KT.uibutton = function(self, name, text, tooltip, onClick, texture, coords) + local button = GetButtonTemplate(name, self, 'KTUIPanelButton', onClick) + + button.tooltip = tooltip + button:SetText(text) + button.icon:SetTexture(texture) + button:SetWidth(button:GetFontString():GetStringWidth() + button.icon:GetWidth()/1.5) + if coords then + button.icon:SetTexCoord(unpack(coords)) + end + SetButtonAnchor(button, self.UIPanels, self.UIPanelAnchor, self.UIPanelGrowth) + return button +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libKT/libKT-1.0.xml Tue Jun 21 08:10:36 2016 -0400 @@ -0,0 +1,249 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + + <Script file="libKT-1.0.lua" /> + + <FontString name="LogString" virtual="true" justifyH="LEFT" justifyV="TOP" inherits="GameFontHighlight"> + <Anchors> + <Anchor point="TOP" /> + </Anchors> + </FontString> + + <Font name="KTHeaderFont" virtual="true" inherits="NumberFontNormal"> + <FontHeight val="18" /> + </Font> + + + <Button name="KTButton" parentArray="controls" virtual="true"> + <Scripts> + <OnEnter> + if self.tooltip then + GameTooltip:SetOwner(self) + GameTooltip:SetAnchorType('ANCHOR_TOPRIGHT') + GameTooltip:SetText(self.tooltip) + GameTooltip:Show() + end + </OnEnter> + <OnLeave> + GameTooltip:Hide() + </OnLeave> + </Scripts> + <NormalFont style="NumberFontNormal" /> + <NormalTexture setAllPoints="true"> + <Color a="1" r="0" g=".4" b="1" /> + </NormalTexture> + <DisabledTexture> + <Color a="1" r="0.5" b="0.5" g="0.5" /> + </DisabledTexture> + <DisabledColor a="0.5" r="1" g="1" b="1" /> + <PushedTexture> + <Color a="1" r="1" g="0.25" b="0.25" /> + </PushedTexture> + <HighlightTexture alphaMode="ADD"> + <Color a="0.25" r="1" g="0" b=".5" /> + </HighlightTexture> + <Size x="72" y="28" /> + </Button> + + <!-- style for Blizzard UIPanel activators + // The template anchor gets overwritten for successive iterations --> + <Button name="KTUIPanelButton" virtual="true" parentArray="UIPanels"> + <Scripts> + <OnEnter> + if self.tooltip then + GameTooltip:SetOwner(self) + GameTooltip:SetAnchorType('ANCHOR_TOPRIGHT') + GameTooltip:SetText(self.tooltip) + GameTooltip:Show() + end + </OnEnter> + <OnLeave> + GameTooltip:Hide() + </OnLeave> + </Scripts> + <Layers> + <Layer level="OVERLAY"> + <Texture parentKey="icon"> + <Size x="24" y="24" /> + <Anchors> + <Anchor point="LEFT" x="-12" y="0" /> + </Anchors> + </Texture> + </Layer> + </Layers> + + <NormalFont style="NumberFontNormalRight" /> + <NormalTexture> + <Color a="1" r=".4" g="0" b="1" /> + </NormalTexture> + <PushedTexture> + <Color a="1" r=".6" g=".2" b="1" /> + </PushedTexture> + <HighlightTexture> + <Size x="3" /> + <Anchors> + <Anchor point="BOTTOM" /> + <Anchor point="TOP" /> + <Anchor point="RIGHT" /> + </Anchors> + <Color a="1" r="1" g="0" b="0.5" /> + </HighlightTexture> + <Size x="84" y="24" /> + + </Button> + + <Button name="KTTabButton" virtual="true" parentArray="tabButtons"> + <Scripts> + <OnEnter> + + if not self.tooltip then + return + end + GameTooltip:SetOwner(self) + GameTooltip:SetAnchorType('LEFT') + GameTooltip:SetText(self.tooltip) + GameTooltip:Show() + </OnEnter> + <OnLeave> + + if not self.tooltip then + return + end + GameTooltip:Hide() + </OnLeave> + </Scripts> + <Size x="40" y="40" /> + <Layers> + <Layer level="BACKGROUND"> + </Layer> + <Layer level="BORDER"> + <Texture parentKey="icon"> + <Color a="1" r="1" g="0" b="0" /> + <Anchors> + <Anchor point="TOPLEFT" x="2" y="-2"/> + <Anchor point="BOTTOMRIGHT" x="-2" y="2"/> + </Anchors> + </Texture> + </Layer> + <Layer level="ARTWORK"> + </Layer> + </Layers> + + <NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-Quickslot2"> + <Anchors> + <Anchor point="TOPLEFT" x="-12" y="12"/> + <Anchor point="BOTTOMRIGHT" x="13" y="-13"/> + </Anchors> + </NormalTexture> + <PushedTexture file="Interface\Buttons\UI-Quickslot-Depress"/> + <HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/> + </Button> + + <!-- inherited to generate event feedback --> + <Frame name="KTDebugTemplate" virtual="true"> + <Layers> + <Layer level="OVERLAY"> + <FontString inherits="GameFontNormal" parentKey="status" text="text thing here"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" /> + </Anchors> + </FontString> + <FontString inherits="LogString" parentKey="logfirst" text="First"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="0" relativeKey="$parent.status" /> + </Anchors> + </FontString> + <FontString inherits="LogString" parentKey="logdiff" text="Different"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeKey="$parent.logfirst" /> + </Anchors> + </FontString> + <FontString inherits="LogString" parentKey="log" text="Last"> + <Anchors> + <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeKey="$parent.logdiff" /> + </Anchors> + </FontString> + </Layer> + </Layers> + </Frame> + + + + <Frame name="KTErrorFrame" parent="UIParent" toplevel="true" movable="true" enableMouse="true" hidden="true" clampedToScreen="true"> + <Size x="450" y="280" /> + <Anchors> + <Anchor point="CENTER" /> + </Anchors> + <Scripts> + <OnLoad> + self:RegisterForDrag('LeftButton') + </OnLoad> + <OnDragStart> + self:StartMoving() + </OnDragStart> + <OnDragStop> + self:StopMovingOrSizing() + </OnDragStop> + </Scripts> + <Layers> + <Layer level="BACKGROUND"> + <Texture setAllPoints="true"> + <Color a="1" r="0" g="0" b="0" /> + </Texture> + </Layer> + <Layer level="OVERLAY"> + <FontString inherits="NumberFont_Outline_Huge" text="KrakTool Error"> + <Anchors> + <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" /> + </Anchors> + </FontString> + <FontString inherits="NumberFont_Outline_Large" parentKey="errmsg" justifyH="LEFT" spacing="3"> + <Anchors> + <Anchor point="TOP" /> + <Anchor point="LEFT" /> + <Anchor point="RIGHT" /> + </Anchors> + </FontString> + <FontString inherits="NumberFont_Outline_Large" parentKey="debugstack" justifyH="LEFT" spacing="3"> + <Anchors> + <Anchor point="LEFT" /> + <Anchor point="RIGHT" /> + <Anchor point="TOP" relativePoint="BOTTOM" relativeKey="$parent.errmsg" x="0" y="-8" /> + </Anchors> + </FontString> + </Layer> + </Layers> + </Frame> + + <Frame name="KTAuraButton" virtual="true"> + <Scripts> + <OnLoad> + self.count = self.overlay.count + </OnLoad> + </Scripts> + <Layers> + <Layer level="ARTWORK"> + <Texture setAllPoints="true" name="$parentIcon" parentKey="icon" /> + </Layer> + <Layer level="OVERLAY"> + </Layer> + </Layers> + <Frames> + <Cooldown parentKey="cooldown" setAllPoints="true" inherits="CooldownFrameTemplate"/> + <Frame name="$parentOverLayer" parentKey="overlay" setAllPoints="true"> + + <Layers> + <Layer level="OVERLAY"> + + <FontString parentKey="count" name="$parentCount" inherits="NumberFontNormal" text="count number"> + <Anchors> + <Anchor point="BOTTOMRIGHT" /> + </Anchors> + </FontString> + </Layer> + </Layers> + </Frame> + + </Frames> + </Frame> +</Ui> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libKT/libKT.iml Tue Jun 21 08:10:36 2016 -0400 @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="LUA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" /> + </content> + <orderEntry type="jdk" jdkName="WoW 7.0.3" jdkType="Lua SDK" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libKT/libKT.toc Tue Jun 21 08:10:36 2016 -0400 @@ -0,0 +1,9 @@ +## Interface: 70000 +## Title: Lib:KT +## Notes: AddOn framework for dinosaurs +## Author: Krakyn +## Version: 1.0-@project-revision@ +## SavedVariables: LibKTDB +## X-Category: Library +## DefaultState: Enabled +libKT-1.0.xml