annotate ObjectiveTracker/ObjectiveWidgets.lua @ 23:e837384ac363

Separating objective tracker module
author Nenue
date Sun, 10 Apr 2016 04:35:32 -0400
parents ObjectiveWidgets.lua@9b3fa734abff
children 66b927b46776
rev   line source
Nenue@13 1 local B = select(2,...).frame
Nenue@13 2 local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
Nenue@13 3 local print = B.print('WidgetFactory')
Nenue@13 4 local UIParent = UIParent
Nenue@13 5 local GetQuestLogSpecialItemInfo, IsQuestLogSpecialItemInRange, GetQuestLogSpecialItemCooldown = GetQuestLogSpecialItemInfo, IsQuestLogSpecialItemInRange, GetQuestLogSpecialItemCooldown
Nenue@13 6 local CooldownFrame_SetTimer, SetItemButtonTextureVertexColor, CreateFrame, VeneerObjectiveScroll = CooldownFrame_SetTimer, SetItemButtonTextureVertexColor, CreateFrame, VeneerObjectiveScroll
Nenue@13 7 local tremove, tinsert, tContains, pairs, setmetatable = tremove, tinsert, tContains, pairs, setmetatable
Nenue@14 8
Nenue@14 9 --- frame refs
Nenue@14 10 local Wrapper = _G.VeneerObjectiveWrapper
Nenue@14 11 local Scroller = Wrapper.scrollArea
Nenue@14 12 local CloseButton = Wrapper.CloseButton
Nenue@14 13 local QuestMapButton = Wrapper.QuestMapButton
Nenue@14 14 local Scroll = _G.VeneerObjectiveScroll
Nenue@14 15
Nenue@14 16 local panelButtons = {
Nenue@14 17 CloseButton = {
Nenue@14 18 closedSwatch = {
Nenue@14 19 [[Interface\Buttons\UI-Panel-QuestHideButton]],
Nenue@14 20 [[Interface\Buttons\UI-Panel-QuestHideButton]],
Nenue@14 21 0, 0.5, 0.5, 1,
Nenue@14 22 0.5, 1, 0.5, 1,
Nenue@14 23 },
Nenue@14 24 openSwatch = {
Nenue@14 25 [[Interface\Buttons\UI-Panel-QuestHideButton]],
Nenue@14 26 [[Interface\Buttons\UI-Panel-QuestHideButton]],
Nenue@14 27 0.5, 1, 0.5, 1,
Nenue@14 28 0, 0.5, 0.5, 1,
Nenue@14 29 },
Nenue@14 30 parent = 'VeneerObjectiveWrapper'
Nenue@14 31 },
Nenue@14 32 QuestMapButton = {
Nenue@14 33 closedSwatch = {
Nenue@14 34 [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]],
Nenue@14 35 [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]],
Nenue@14 36 0, 1, 0.5, 1,
Nenue@14 37 0, 1, 0, 0.5,
Nenue@14 38 },
Nenue@14 39 openSwatch = {
Nenue@14 40 [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]],
Nenue@14 41 [[Interface\QUESTFRAME\UI-QUESTMAP_BUTTON]],
Nenue@14 42 0, 1, 0, 0.5,
Nenue@14 43 0, 1, 0.5, 1,
Nenue@14 44 }
Nenue@14 45 }
Nenue@14 46 }
Nenue@14 47
Nenue@14 48 local Scroller_OnShow = function()
Nenue@14 49 Wrapper.watchMoneyReasons = 0;
Nenue@19 50 --mod:Update()
Nenue@19 51 --mod:OnInitialize()
Nenue@14 52 for i, region in ipairs(Wrapper.headerComplex) do
Nenue@14 53 region:Show()
Nenue@14 54 end
Nenue@14 55 end
Nenue@14 56
Nenue@14 57 local Scroller_OnHide = function()
Nenue@14 58 local self = Wrapper
Nenue@14 59 Wrapper:UnregisterAllEvents()
Nenue@14 60 Wrapper:SetScript('OnEvent', nil)
Nenue@14 61 for i, region in ipairs(Wrapper.headerComplex) do
Nenue@14 62 region:Hide()
Nenue@14 63 end
Nenue@14 64 end
Nenue@14 65
Nenue@14 66 local Scroller_OnMouseWheel = function(self, delta)
Nenue@14 67 local r = Scroll:GetHeight() - Scroller:GetHeight()
Nenue@14 68 local s = B.Conf.ObjectiveScroll - delta * floor(r/5+.5)
Nenue@14 69 local from = self:GetVerticalScroll()
Nenue@21 70 print('|cFF00FF00OnMouseWheel', 'scroll =', s)
Nenue@14 71 if s >= r then
Nenue@14 72 s = r
Nenue@14 73 elseif s < 1 then
Nenue@14 74 s = 0
Nenue@14 75 end
Nenue@14 76 self:SetVerticalScroll(s)
Nenue@14 77 B.Conf.ObjectiveScroll = s
Nenue@14 78 print('|cFF00FF00OnMouseWheel', 'from = ', from, 'scroll =', s, ' range =', r, 'current =', self:GetVerticalScroll())
Nenue@14 79
Nenue@14 80 mod.UpdateActionButtons('SCROLLING')
Nenue@14 81 end
Nenue@14 82
Nenue@14 83 local UpdatePanelButton = function (self, state)
Nenue@14 84 state = state and B.Conf.FrameState[state] or 1
Nenue@14 85 local swatch = (state == 1) and self.openSwatch or self.closedSwatch
Nenue@14 86 self:SetNormalTexture(swatch[1])
Nenue@14 87 self:SetPushedTexture(swatch[2])
Nenue@14 88 if #swatch >= 6 then
Nenue@14 89 self:GetNormalTexture():SetTexCoord(swatch[3], swatch[4], swatch[5], swatch[6])
Nenue@14 90 end
Nenue@14 91 if #swatch == 10 then
Nenue@14 92 self:GetPushedTexture():SetTexCoord(swatch[7], swatch[8], swatch[9], swatch[10])
Nenue@14 93 end
Nenue@14 94
Nenue@14 95 end
Nenue@14 96
Nenue@14 97 local OnClick = {}
Nenue@14 98 OnClick.CloseButton = function(self)
Nenue@14 99 Wrapper:Minimize()
Nenue@14 100 UpdatePanelButton(self, self.parent)
Nenue@14 101 end
Nenue@14 102
Nenue@14 103 OnClick.QuestMapButton = function()
Nenue@14 104 ToggleWorldMap()
Nenue@14 105 end
Nenue@14 106
Nenue@22 107
Nenue@19 108 mod.InitializeWidgets = function()
Nenue@14 109 --- tracker scroll
Nenue@14 110 Scroller:SetScript('OnMouseWheel', Scroller_OnMouseWheel)
Nenue@14 111 Scroller:SetScript('OnShow', Scroller_OnShow)
Nenue@14 112 Scroller:SetScript('OnHide', Scroller_OnHide)
Nenue@14 113 for name, swatch in pairs(panelButtons) do
Nenue@14 114 local source = swatch and swatch or panelButtons.CloseButton
Nenue@14 115 local button = Wrapper[name]
Nenue@14 116 button.parent = swatch.parent
Nenue@14 117 button.openSwatch = source.openSwatch
Nenue@14 118 button.closedSwatch = source.closedSwatch
Nenue@14 119 if OnClick[name] then
Nenue@14 120 button:SetScript('OnClick', OnClick[name])
Nenue@14 121 end
Nenue@14 122 UpdatePanelButton(button, button.parent)
Nenue@14 123 end
Nenue@14 124 end
Nenue@14 125
Nenue@13 126 ----------------------------------------------------------------------------------------
Nenue@13 127 --- XML and script code lifted from "QuestKing 2" by Barjack,
Nenue@13 128 --- found at http://mods.curse.com/addons/wow/questking
Nenue@13 129 ----------------------------------------------------------------------------------------
Nenue@13 130 local usedButtons = mod.Quest.itemButtons
Nenue@13 131 local freeButtons = mod.Quest.freeButtons
Nenue@13 132 mod.SetItemButton = function(block, info)
Nenue@13 133 local itemInfo = info.specialItem
Nenue@13 134 if not itemInfo then
Nenue@13 135 return
Nenue@13 136 end
Nenue@13 137
Nenue@13 138 --- Quest.GetInfo().specialItem :: {link = link, charges = charges, icon = icon, start = start, duration = duration, enable = enable}
Nenue@13 139
Nenue@13 140
Nenue@13 141 local itemButton
Nenue@13 142 if not info.itemButton then
Nenue@13 143 if #freeButtons >= 1 then
Nenue@13 144 print(' |cFF00FFFFfound a free button')
Nenue@13 145 itemButton = freeButtons[#freeButtons]
Nenue@13 146 freeButtons[#freeButtons] = nil
Nenue@13 147 if itemButton.block then
Nenue@13 148 itemButton.block.itemButton = nil
Nenue@13 149 itemButton.block = nil
Nenue@13 150 end
Nenue@13 151 else
Nenue@13 152 local buttonIndex = mod.Quest.numButtons + #freeButtons + 1
Nenue@13 153 itemButton = CreateFrame('Button', 'VeneerQuestItemButton' .. buttonIndex, UIParent, 'VeneerItemButtonTemplate')
Nenue@13 154 itemButton.buttonIndex = buttonIndex
Nenue@13 155 itemButton:SetSize(36, 36)
Nenue@13 156 itemButton:GetNormalTexture():SetSize(36 * (5/3), 36 * (5/3))
Nenue@13 157 print(' |cFFFF4400starting new button', itemButton:GetName())
Nenue@13 158 end
Nenue@13 159 mod.Quest.numButtons = mod.Quest.numButtons + 1
Nenue@13 160 else
Nenue@13 161 itemButton = info.itemButton
Nenue@13 162 print(' |cFF00FF00found assigned button', itemButton:GetName())
Nenue@13 163
Nenue@13 164 end
Nenue@13 165 -- set values
Nenue@13 166
Nenue@13 167 info.itemButton = itemButton
Nenue@13 168 usedButtons[info.questID] = itemButton
Nenue@13 169 print(' |cFF8800FFassigning|r', itemButton:GetName(), 'to quest|cFF00FF00', info.questID, '|rat|cFFFFFF00', block:GetName(),'|r')
Nenue@13 170
Nenue@13 171 for k,v in pairs(usedButtons) do
Nenue@13 172 print('|cFFFF44DD'..k..'|r', v:GetName())
Nenue@13 173 end
Nenue@13 174
Nenue@13 175 itemButton:SetAttribute("type", "item")
Nenue@13 176 itemButton:SetAttribute("item", itemInfo.link)
Nenue@13 177
Nenue@13 178 itemButton.questID = info.questID
Nenue@13 179 itemButton.questLogIndex = info.questLogIndex
Nenue@13 180 itemButton.charges = itemInfo.charges
Nenue@13 181 itemButton.rangeTimer = -1
Nenue@13 182 itemButton.block = block
Nenue@13 183
Nenue@13 184 SetItemButtonTexture(itemButton, itemInfo.icon)
Nenue@13 185 SetItemButtonCount(itemButton, itemInfo.charges)
Nenue@13 186 Veneer_QuestObjectiveItem_UpdateCooldown(itemButton);
Nenue@13 187
Nenue@13 188 return itemButton
Nenue@13 189 end
Nenue@13 190 --- Clear an itemButton from the given block
Nenue@13 191 mod.FreeItemButtons = function(block)
Nenue@13 192
Nenue@13 193 if block.itemButton then
Nenue@13 194 local itemButton = block.itemButton
Nenue@13 195 if itemButton.questID ~= block.info.questID then
Nenue@13 196 block.itemButton = nil
Nenue@13 197 itemButton.block = mod.Quest.InfoBlock[itemButton.questID]
Nenue@13 198 else
Nenue@13 199 itemButton.block = nil
Nenue@13 200 itemButton:Hide()
Nenue@13 201
Nenue@13 202 usedButtons[itemButton.questID] = nil
Nenue@13 203 freeButtons[#freeButtons + 1] = itemButton
Nenue@13 204 mod.Quest.numButtons = mod.Quest.numButtons - 1
Nenue@13 205 print('|cFFFF0088released', itemButton:GetName(),'and', block:GetName())
Nenue@13 206 end
Nenue@13 207 end
Nenue@13 208 end
Nenue@13 209
Nenue@13 210 function Veneer_QuestObjectiveItem_OnUpdate (self, elapsed)
Nenue@13 211 -- Handle range indicator
Nenue@13 212 local rangeTimer = self.rangeTimer
Nenue@13 213 if (rangeTimer) then
Nenue@13 214 rangeTimer = rangeTimer - elapsed
Nenue@13 215 if (rangeTimer <= 0) then
Nenue@13 216 local link, item, charges, showItemWhenComplete = GetQuestLogSpecialItemInfo(self.questLogIndex)
Nenue@13 217 if ((not charges) or (charges ~= self.charges)) then
Nenue@22 218 mod:Update()
Nenue@13 219 return
Nenue@13 220 end
Nenue@13 221
Nenue@13 222 local count = self.HotKey
Nenue@13 223 local valid = IsQuestLogSpecialItemInRange(self.questLogIndex)
Nenue@13 224 if (valid == 0) then
Nenue@13 225 count:Show()
Nenue@13 226 count:SetVertexColor(1.0, 0.1, 0.1)
Nenue@13 227 elseif (valid == 1) then
Nenue@13 228 count:Show()
Nenue@13 229 count:SetVertexColor(0.6, 0.6, 0.6)
Nenue@13 230 else
Nenue@13 231 count:Hide()
Nenue@13 232 end
Nenue@13 233 rangeTimer = TOOLTIP_UPDATE_TIME
Nenue@13 234 end
Nenue@13 235
Nenue@13 236 self.rangeTimer = rangeTimer
Nenue@13 237 end
Nenue@13 238 end
Nenue@13 239
Nenue@13 240 function Veneer_QuestObjectiveItem_UpdateCooldown (itemButton)
Nenue@13 241 local start, duration, enable = GetQuestLogSpecialItemCooldown(itemButton.questLogIndex)
Nenue@13 242 if (start) then
Nenue@13 243 CooldownFrame_SetTimer(itemButton.Cooldown, start, duration, enable)
Nenue@13 244 if (duration > 0 and enable == 0) then
Nenue@13 245 SetItemButtonTextureVertexColor(itemButton, 0.4, 0.4, 0.4)
Nenue@13 246 else
Nenue@13 247 SetItemButtonTextureVertexColor(itemButton, 1, 1, 1)
Nenue@13 248 end
Nenue@13 249 end
Nenue@13 250 end
Nenue@13 251
Nenue@13 252 -----------------------------------------
Nenue@13 253 -- Criteria frames
Nenue@13 254
Nenue@13 255 --[[
Nenue@13 256 text = description,
Nenue@13 257 type = type,
Nenue@13 258 finished = completed,
Nenue@13 259 quantity = quantity,
Nenue@13 260 requiredQuantity = requiredQuantity,
Nenue@13 261 characterName = characterName,
Nenue@13 262 flags = flags,
Nenue@13 263 assetID = assetID,
Nenue@13 264 quantityString = quantityString,
Nenue@13 265 criteriaID = criteriaID,
Nenue@13 266 ]]
Nenue@13 267 local newWidgetID = 0
Nenue@13 268 mod.WidgetRegistry = {}
Nenue@13 269 local wr = mod.WidgetRegistry
Nenue@13 270
Nenue@13 271 --- Get a usable widget for the given achievement criteria set.
Nenue@13 272 -- Returns a frame object with dimensioning parameters needed to size the receiving tracker block
Nenue@21 273 mod.SetWidget = function(line, data, objectiveType, objectiveKey)
Nenue@13 274 local print = B.print('ObjectiveWidgets')
Nenue@14 275 local widgetType = objectiveType
Nenue@13 276 local widget
Nenue@14 277 if wr[widgetType] and wr[widgetType].used[objectiveKey] then
Nenue@14 278 widget = wr[widgetType].used[objectiveKey]
Nenue@14 279 print('|cFF00FF00Updating ('..objectiveKey..')', widget)
Nenue@13 280 elseif not wr[widgetType] or #wr[widgetType].free == 0 then
Nenue@13 281 widget = CreateFrame('Frame', 'VeneerObjective' .. widgetType .. (wr[widgetType] and (wr[widgetType].lastn+1) or (1)), VeneerObjectiveScroll, 'VeneerObjectiveCriteria' .. widgetType)
Nenue@13 282
Nenue@13 283 print('|cFFFF0088Creating `'..widget:GetName()..'` id', wr[widgetType].lastn)
Nenue@13 284 else
Nenue@13 285 widget = tremove(wr[widgetType].free)
Nenue@13 286 print('|cFFFFFF00Acquiring released widget', widget:GetName())
Nenue@13 287 end
Nenue@13 288
Nenue@14 289
Nenue@14 290 wr[widgetType].used[objectiveKey] = widget
Nenue@14 291 widget.line = line
Nenue@21 292 widget.objective = data
Nenue@14 293 widget.key = objectiveKey
Nenue@13 294 mod.InitializeWidget(widget)
Nenue@13 295 return widget
Nenue@13 296 end
Nenue@13 297
Nenue@13 298 --- WidgetTemplate 'OnLoad'
Nenue@13 299 mod.RegisterWidget = function(frame)
Nenue@13 300 local print = B.print('ObjectiveWidgets')
Nenue@13 301 local widgetType = frame.widgetType
Nenue@13 302 if not wr[frame.widgetType] then
Nenue@13 303 print('|cFFFF4400[[WidgetTemplate]]|r', widgetType)
Nenue@13 304 wr[widgetType] = { lastn = 1, free = {}, used = {}, usedIndex = {}, freeIndex = {} }
Nenue@13 305 else
Nenue@13 306 print('|cFF0088FF+ [[WidgetTemplate]]r', widgetType, wr[widgetType].lastn)
Nenue@13 307 wr[widgetType].lastn = wr[widgetType].lastn + 1
Nenue@13 308 end
Nenue@13 309 end
Nenue@13 310
Nenue@13 311 --- WidgetTemplate 'OnShow'
Nenue@13 312 mod.InitializeWidget = setmetatable({}, {
Nenue@13 313 __call = function(t, frame)
Nenue@13 314 -- todo: config pull
Nenue@13 315
Nenue@19 316 frame:SetWidth(mod.Conf.Wrapper.Width - mod.Conf.Style.Format.status.Indent * 2)
Nenue@13 317 frame:SetScript('OnEvent', mod.UpdateWidget[frame.widgetType])
Nenue@13 318 frame:RegisterEvent('TRACKED_ACHIEVEMENT_UPDATE')
Nenue@13 319 frame:RegisterEvent('TRACKED_ACHIEVEMENT_LIST_CHANGED')
Nenue@13 320 frame:RegisterEvent('CRITERIA_UPDATE')
Nenue@13 321 frame:RegisterEvent('CRITERIA_COMPLETE')
Nenue@13 322 frame:RegisterEvent('CRITERIA_EARNED')
Nenue@14 323 t[frame.widgetType](frame)
Nenue@14 324 mod.UpdateWidget[frame.widgetType](frame)
Nenue@13 325 end,
Nenue@13 326 })
Nenue@13 327
Nenue@13 328 --- WidgetTemplate 'OnEvent'
Nenue@13 329 mod.UpdateWidget = setmetatable({}, {
Nenue@13 330 __call = function(t, frame)
Nenue@13 331 if not frame.widgetType then
Nenue@13 332 error('Invalid widget template, needs .widgetType')
Nenue@13 333 return
Nenue@13 334 end
Nenue@13 335
Nenue@13 336 return t[frame.widgetType](frame)
Nenue@13 337 end
Nenue@13 338 })
Nenue@13 339
Nenue@13 340 --- WidgetTemplate 'OnHide'
Nenue@13 341 mod.ReleaseWidget = function(frame)
Nenue@16 342 --[[
Nenue@13 343 local print = B.print('ObjectiveWidgets')
Nenue@13 344 local reg = wr[frame.widgetType]
Nenue@14 345 if reg and reg.used[frame.key] then
Nenue@14 346 reg.used[frame.key] = nil
Nenue@14 347 frame.line = nil
Nenue@13 348 frame.info = nil
Nenue@13 349 frame:UnregisterAllEvents()
Nenue@13 350 tinsert(reg.free, frame)
Nenue@13 351 print('|cFFBBBBBBreleased from service', frame:GetName())
Nenue@13 352 end
Nenue@16 353 ]]
Nenue@13 354 end
Nenue@13 355
Nenue@13 356 --- RemoveTrackedAchievement post-hook
Nenue@13 357 mod.CleanWidgets = function()
Nenue@13 358 local print = B.print('ObjectiveWidgets')
Nenue@13 359 local tracked = {GetTrackedAchievements() }
Nenue@14 360 local tasks = GetTasksTable()
Nenue@13 361 for type, reg in pairs(mod.WidgetRegistry) do
Nenue@13 362 print('collecting', type)
Nenue@14 363 for key, frame in pairs(reg.used) do
Nenue@21 364 if frame.objective.cheevID then
Nenue@21 365 local id = frame.objective.cheevID
Nenue@13 366
Nenue@14 367 if id and not tContains(tracked, id) then
Nenue@13 368
Nenue@14 369 print(' untracked achievement', id, 'associated with', key, frame:GetName())
Nenue@14 370 frame:Hide()
Nenue@14 371 end
Nenue@21 372 elseif frame.objective.questID then
Nenue@14 373 -- do something for quest task
Nenue@13 374 end
Nenue@13 375 end
Nenue@13 376 end
Nenue@13 377 end
Nenue@13 378
Nenue@13 379
Nenue@14 380
Nenue@14 381 mod.defaults.WidgetStyle = {
Nenue@21 382
Nenue@13 383 }
Nenue@21 384
Nenue@21 385 local progressHeight = 16
Nenue@22 386 local progressBorder = 1
Nenue@21 387 local progressIndent = 3
Nenue@21 388 local progressFont = _G.VeneerCriteriaFontNormal
Nenue@21 389
Nenue@21 390
Nenue@13 391 mod.InitializeWidget.ProgressBar = function(self)
Nenue@21 392 local c = mod.Conf.Wrapper
Nenue@21 393 self.height = progressHeight + c.TextSpacing
Nenue@21 394 self.width = c.Width - c.TextSpacing
Nenue@21 395 self.indent = progressIndent
Nenue@21 396
Nenue@21 397 self:SetHeight(progressHeight)
Nenue@21 398 self.bg:SetHeight(progressHeight)
Nenue@21 399 self.bg:SetWidth(self.width)
Nenue@13 400 self.fg:ClearAllPoints()
Nenue@22 401 self.fg:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', progressBorder, progressBorder)
Nenue@22 402 self.fg:SetHeight(progressHeight - progressBorder * 2)
Nenue@21 403 self.status:SetFontObject(progressFont)
Nenue@21 404 self.status:SetText(self.objective.quantityString)
Nenue@13 405 end
Nenue@13 406
Nenue@13 407 mod.UpdateWidget.ProgressBar = function (self)
Nenue@21 408 local quantity, requiredQuantity = self.objective.value, self.objective.maxValue
Nenue@14 409 print('update vals:')
Nenue@14 410 for k,v in pairs(self.line) do
Nenue@14 411 print(k, v)
Nenue@14 412 end
Nenue@13 413
Nenue@14 414 if self.line.format then
Nenue@21 415 self.status:SetFormattedText(self.line.format, quantity, requiredQuantity)
Nenue@14 416 end
Nenue@14 417
Nenue@21 418 local progress = (quantity / requiredQuantity)
Nenue@21 419 if progress >= 1 then
Nenue@21 420 self.fg:Show()
Nenue@22 421 self.fg:SetWidth(self.width - progressBorder * 2)
Nenue@21 422 elseif progress > 0 then
Nenue@21 423 self.fg:Show()
Nenue@21 424 print('color:', 1-progress*2 , progress*2 - 1,0,1)
Nenue@22 425 print('width:', (self.width -progressBorder * 2) * progress)
Nenue@21 426 self.fg:SetTexture(1-progress*2 , progress*2,0,1)
Nenue@22 427 self.fg:SetWidth((self.width -progressBorder * 2) * progress)
Nenue@21 428 else
Nenue@15 429 self.fg:Hide()
Nenue@13 430 end
Nenue@13 431 end
Nenue@13 432
Nenue@13 433
Nenue@13 434 mod.InitializeWidget.Hidden = function (self)
Nenue@13 435 self.height = 0
Nenue@13 436 end
Nenue@13 437 mod.UpdateWidget.Hidden = function (self)
Nenue@13 438 self.height= 0
Nenue@13 439 end