comparison Devian.xml @ 14:5254d1ba6013 v1.2-r15

Multiple output windows can be created for different output prefixes, and prefixes can be designated to an existing or new "console" with /dvn <prefix> <console> Frame objects are generated directly from XML data, and their state information is stored in the object itself to resolve issues with GetWidth() returning old info in some cases. StackFrames and DistributeFrames methods can be invoked from /script to arrange the buffers.
author Nenue
date Sun, 20 Dec 2015 00:46:42 -0500
parents 080dfa4990fb
children 31ca76e04766
comparison
equal deleted inserted replaced
13:080dfa4990fb 14:5254d1ba6013
1 <Ui> 1 <Ui>
2
3 <Texture name="DevianBorder" virtual="true" setAllPoints="false">
4 <Color r="1" g="0" b="0" a="1" />
5 <Size x="2" y="2" />
6 </Texture>
7
2 <Frame 8 <Frame
3 name="DevianConsole" 9 name="DevianConsole"
4 parent="UIParent" 10 parent="UIParent"
5 enableMouse="true" 11 enableMouse="true"
6 enableMouseWheel="true" 12 enableMouseWheel="true"
8 movable="true" 14 movable="true"
9 resizable="true" 15 resizable="true"
10 toplevel="true" 16 toplevel="true"
11 hidden="true" 17 hidden="true"
12 virtual="true"> 18 virtual="true">
13 <KeyValues>
14 <KeyValue key="index" type="number" value="1" />
15 <KeyValue key="name" value="Devian" />
16 <KeyValue key="format" value="Devian [%s]" />
17 </KeyValues>
18 <ResizeBounds> 19 <ResizeBounds>
19 <minResize x="200" y="20" /> 20 <minResize x="200" y="20" />
20 <maxResize x="1920" y="1200" /> 21 <maxResize x="1920" y="1200" />
21 </ResizeBounds> 22 </ResizeBounds>
22 <Scripts> 23 <Scripts>
24 <OnShow></OnShow>
23 <OnMouseDown> 25 <OnMouseDown>
26 self:ToFront()
24 if button == 'LeftButton' then 27 if button == 'LeftButton' then
25 if self.grip:IsMouseOver() then 28 if self.out.grip:IsMouseOver() then
26 return self:StartSizing() 29 return self:StartSizing()
27 end 30 end
28 return self:StartMoving() 31 return self:StartMoving()
29 end 32 end
30 </OnMouseDown> 33 </OnMouseDown>
31 <OnMouseUp> 34 <OnMouseUp>
32 if button == 'RightButton' then 35 if button == 'RightButton' then
33 return self:MinMax() 36 return self:MinMax()
34 end 37 end
35 self:StopMovingOrSizing() 38 self:StopMovingOrSizing()
39 self.x = nil -- free these up
40 self.y = nil
41 self.width = nil
42 self.height = nil
36 self:Save() 43 self:Save()
37 </OnMouseUp> 44 </OnMouseUp>
38 <OnMouseWheel> 45 <OnMouseWheel>
39 local up = delta > 0 46 local up = delta > 0
40 if IsControlKeyDown() then 47 if IsControlKeyDown() then
54 elseif (GetTime()-self.throttle &lt; 0.2) then 61 elseif (GetTime()-self.throttle &lt; 0.2) then
55 return 62 return
56 else 63 else
57 self.throttle = GetTime() 64 self.throttle = GetTime()
58 end 65 end
59 66 local text = string.gsub(self.format, '%%t', GetTime(), 1)
60 self.header:SetText(string.format(self.format, GetTime())) 67 text = string.gsub(text, '%%n', self.signature, 1)
68 self.header:SetText(text)
61 </OnUpdate> 69 </OnUpdate>
62 </Scripts> 70 </Scripts>
63 71
64 <Frames> 72 <Frames>
65 <ScrollingMessageFrame 73 <ScrollingMessageFrame
90 <MinColor r="0" g="0" b="0" a="0.7"/> 98 <MinColor r="0" g="0" b="0" a="0.7"/>
91 <MaxColor r="0" g="0" b="0" a="0.3"/> 99 <MaxColor r="0" g="0" b="0" a="0.3"/>
92 </Gradient> 100 </Gradient>
93 </Texture> 101 </Texture>
94 </Layer> 102 </Layer>
103 <Layer level="OVERLAY">
104 <Texture name="DevianGripper" file="Interface\Addons\Devian\corner.blp" parentKey="grip" strata="HIGH" alphaMode="ADD">
105 <Anchors>
106 <Anchor point="BOTTOMRIGHT" x="-1" y="1" />
107 </Anchors>
108 <Size x="18" y="18" />
109 <Color r="1" g="1" b="1" a="1"/>
110 <Gradient orientation="VERTICAL">
111 <MaxColor r="0.2" g="0.2" b="0.2" a="1"/>
112 <MinColor r="0.5" g="0.5" b="0.5" a="1"/>
113 </Gradient>
114 </Texture>
115 </Layer>
95 </Layers> 116 </Layers>
96 </ScrollingMessageFrame> 117 </ScrollingMessageFrame>
97 </Frames> 118 </Frames>
98 <Layers> 119 <Layers>
99 <Layer level="BORDER"> 120 <Layer level="BORDER">
120 <FontHeight> 141 <FontHeight>
121 <AbsValue val="12"/> 142 <AbsValue val="12"/>
122 </FontHeight> 143 </FontHeight>
123 </FontString> 144 </FontString>
124 </Layer> 145 </Layer>
125 <Layer level="OVERLAY"> 146 <Layer level="BORDER">
126 <Texture parentKey="grip" strata="HIGH" alphaMode="ADD"> 147 <Texture name="DevBorderUR" parentArray="border" inherits="DevianBorder">
127 <Anchors> 148 <Anchors>
128 <Anchor point="BOTTOMRIGHT" x="-1" y="1" /> 149 <Anchor point="BOTTOMLEFT" relativePoint="TOPRIGHT" />
129 </Anchors> 150 </Anchors>
130 <Size x="18" y="18" /> 151 </Texture>
131 <Color r="1" g="1" b="1" a="1"/> 152 <Texture name="DevBorderU" parentArray="border" inherits="DevianBorder">
132 <Gradient orientation="VERTICAL"> 153 <Anchors>
133 <MaxColor r="0.2" g="0.2" b="0.2" a="1"/> 154 <Anchor point="TOPLEFT" y="2" />
134 <MinColor r="0.5" g="0.5" b="0.5" a="1"/> 155 <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" />
135 </Gradient> 156 </Anchors>
157 </Texture>
158 <Texture name="DevBorderUL" parentArray="border" inherits="DevianBorder">
159 <Anchors>
160 <Anchor point="BOTTOMRIGHT" parentArray="border" relativePoint="TOPLEFT" />
161 </Anchors>
162 </Texture>
163 <Texture name="DevBorderL" parentArray="border" inherits="DevianBorder">
164 <Anchors>
165 <Anchor point="TOPLEFT" x="-2" />
166 <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMLEFT" />
167 </Anchors>
168 </Texture>
169 <Texture name="DevBorderBL" parentArray="border" inherits="DevianBorder">
170 <Anchors>
171 <Anchor point="TOPRIGHT" relativePoint="BOTTOMLEFT" />
172 </Anchors>
173 </Texture>
174 <Texture name="DevBorderB" parentArray="border" inherits="DevianBorder">
175 <Anchors>
176 <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" />
177 <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" y="-2" />
178 </Anchors>
179 </Texture>
180 <Texture name="DevBorderBR" parentArray="border" inherits="DevianBorder">
181 <Anchors>
182 <Anchor point="TOPLEFT" relativePoint="BOTTOMRIGHT" />
183 </Anchors>
184 </Texture>
185 <Texture name="DevBorderR" parentArray="border" inherits="DevianBorder">
186 <Anchors>
187 <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" />
188 <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="2" />
189 </Anchors>
136 </Texture> 190 </Texture>
137 </Layer> 191 </Layer>
138 </Layers> 192 </Layers>
139 </Frame> 193 </Frame>
140 </Ui> 194 </Ui>