Version 0.9.5.2 - Alpha (see changelog.txt)

This commit is contained in:
Kenny Shields 2013-02-24 11:59:03 -05:00
parent d1826e7f22
commit b834300a58
36 changed files with 383 additions and 3417 deletions

View File

@ -1,3 +1,17 @@
================================================
Version 0.9.5.2 - Alpha (February 24 - 2013)
================================================
[ADDED] a new slider method: SetEnabled(bool)
[ADDED] a new slider method: GetEnabled()
[FIXED] a resizing/layout issue with the columnlist object
[FIXED] base:GetChildren being declared twice and base:GetInternals never being declared
[CHANGED] major performance improvements for the default skins Blue and Orange
[REMOVED] the "Blue (basic)" skin
[REMOVED] the "Orange (basic)" skin
================================================
Version 0.9.5.1 - Alpha (February 17 - 2013)
================================================

View File

@ -9,7 +9,7 @@ loveframes = {}
-- library info
loveframes.info = {}
loveframes.info.author = "Kenny Shields"
loveframes.info.version = "0.9.5.1"
loveframes.info.version = "0.9.5.2"
loveframes.info.stage = "Alpha"
-- library configurations

View File

@ -39,12 +39,13 @@ function newobject:update(dt)
end
local children = self.children
local internals = self.internals
for k, v in ipairs(children) do
v:update(dt)
end
for k, v in ipairs(self.internals) do
for k, v in ipairs(internals) do
v:update(dt)
end
@ -64,6 +65,7 @@ function newobject:draw()
end
local children = self.children
local internals = self.internals
-- set the object's draw order
self:SetDrawOrder()
@ -72,7 +74,7 @@ function newobject:draw()
v:draw()
end
for k, v in ipairs(self.internals) do
for k, v in ipairs(internals) do
v:draw()
end
@ -820,7 +822,7 @@ end
- func: GetInternals()
- desc: returns the object's internals
--]]---------------------------------------------------------
function newobject:GetChildren()
function newobject:GetInternals()
local internals = self.internals

View File

@ -296,9 +296,12 @@ function newobject:SetSize(width, height)
self.width = width
self.height = height
self:AdjustColumns()
list:SetSize(width, height)
list:SetPos(0, 0)
list:CalculateSize()
list:RedoLayout()
end
@ -312,9 +315,12 @@ function newobject:SetWidth(width)
local list = internals[1]
self.width = width
self:AdjustColumns()
list:SetSize(width)
list:SetPos(0, 0)
list:CalculateSize()
list:RedoLayout()
end
@ -328,9 +334,12 @@ function newobject:SetHeight(height)
local list = internals[1]
self.height = height
self:AdjustColumns()
list:SetSize(height)
list:SetPos(0, 0)
list:CalculateSize()
list:RedoLayout()
end

View File

@ -96,7 +96,6 @@ function newobject:update(dt)
if v.lastheight ~= v.height then
self:CalculateSize()
self:RedoLayout()
print("!")
end
end
end

View File

@ -24,6 +24,7 @@ function newobject:initialize()
self.scrollincrease = 1
self.scrolldecrease = 1
self.scrollable = true
self.enabled = true
self.internal = false
self.internals = {}
self.OnValueChanged = nil
@ -159,6 +160,12 @@ function newobject:mousepressed(x, y, button)
if not visible then
return
end
local enabled = self.enabled
if not enabled then
return
end
local internals = self.internals
local hover = self.hover
@ -202,7 +209,6 @@ function newobject:mousepressed(x, y, button)
local newvalue = value - decrease
self:SetValue(newvalue)
end
for k, v in ipairs(internals) do
v:mousepressed(x, y, button)
@ -492,4 +498,24 @@ function newobject:GetScrollDecrease()
return self.scrolldecrease
end
--[[---------------------------------------------------------
- func: SetEnabled(bool)
- desc: sets whether or not the object is enabled
--]]---------------------------------------------------------
function newobject:SetEnabled(bool)
self.enabled = bool
end
--[[---------------------------------------------------------
- func: GetEnabled()
- desc: gets whether or not the object is enabled
--]]---------------------------------------------------------
function newobject:GetEnabled()
return self.enabled
end

View File

@ -303,9 +303,9 @@ function newobject:AddTab(name, object, tip, image, onopened, onclosed)
self:AddScrollButtons()
if autosize and not retainsize then
object:SetSize(self.width - padding*2, (self.height - tabheight) - padding*2)
object:SetSize(self.width - padding * 2, (self.height - tabheight) - padding * 2)
end
end
--[[---------------------------------------------------------

View File

@ -10,9 +10,8 @@ local newobject = loveframes.NewObject("textinput", "loveframes_object_textinput
- func: initialize()
- desc: initializes the object
--]]---------------------------------------------------------
function newobject:initialize()
self.type = "textinput"
self.keydown = "none"
self.tabreplacement = " "
@ -732,9 +731,8 @@ function newobject:RunKey(key, unicode)
curline = lines[line]
text = curline
if not multiline then
local twidth = font:getWidth(text)
local cwidth = font:getWidth(ckey)
local twidth = font:getWidth(text)
local cwidth = font:getWidth(ckey)
-- swidth - 1 is for the "-" character
if (twidth + textoffsetx) >= (swidth - 1) then
self.offsetx = self.offsetx + cwidth

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View File

@ -19,104 +19,72 @@ local bordercolor = {143, 143, 143, 255}
skin.controls = {}
-- frame
skin.controls.frame_border_color = bordercolor
skin.controls.frame_body_color = {232, 232, 232, 255}
skin.controls.frame_top_color = {102, 194, 255, 255}
skin.controls.frame_name_color = {255, 255, 255, 255}
skin.controls.frame_name_font = smallfont
-- button
skin.controls.button_border_down_color = bordercolor
skin.controls.button_border_nohover_color = bordercolor
skin.controls.button_border_hover_color = bordercolor
skin.controls.button_body_down_color = {128, 204, 255, 255}
skin.controls.button_body_nohover_color = {255, 255, 255, 255}
skin.controls.button_body_hover_color = {153, 214, 255, 255}
skin.controls.button_text_down_color = {255, 255, 255, 255}
skin.controls.button_text_nohover_color = {0, 0, 0, 200}
skin.controls.button_text_hover_color = {255, 255, 255, 255}
skin.controls.button_body_nonclickable_color = {220, 220, 220, 255}
skin.controls.button_text_nonclickable_color = {0, 0, 0, 100}
skin.controls.button_text_font = smallfont
-- image button
-- imagebutton
skin.controls.imagebutton_text_down_color = {255, 255, 255, 255}
skin.controls.imagebutton_text_nohover_color = {255, 255, 255, 200}
skin.controls.imagebutton_text_hover_color = {255, 255, 255, 255}
skin.controls.imagebutton_text_font = imagebuttonfont
-- close button
-- closebutton
skin.controls.closebutton_body_down_color = {255, 255, 255, 255}
skin.controls.closebutton_body_nohover_color = {255, 255, 255, 255}
skin.controls.closebutton_body_hover_color = {255, 255, 255, 255}
-- progress bar
skin.controls.progressbar_border_color = bordercolor
-- progressbar
skin.controls.progressbar_body_color = {255, 255, 255, 255}
skin.controls.progressbar_bar_color = {0, 255, 0, 255}
skin.controls.progressbar_text_color = {0, 0, 0, 255}
skin.controls.progressbar_text_font = smallfont
-- list
skin.controls.list_border_color = bordercolor
skin.controls.list_body_color = {232, 232, 232, 255}
-- scrollbar
skin.controls.scrollbar_border_down_color = bordercolor
skin.controls.scrollbar_border_hover_color = bordercolor
skin.controls.scrollbar_border_nohover_color = bordercolor
skin.controls.scrollbar_body_down_color = {128, 204, 255, 255}
skin.controls.scrollbar_body_nohover_color = {255, 255, 255, 255}
skin.controls.scrollbar_body_hover_color = {153, 214, 255, 255}
-- scrollarea
skin.controls.scrollarea_body_color = {200, 200, 200, 255}
skin.controls.scrollarea_border_color = bordercolor
-- scrollbody
skin.controls.scrollbody_body_color = {0, 0, 0, 0}
-- panel
skin.controls.panel_body_color = {232, 232, 232, 255}
skin.controls.panel_border_color = bordercolor
-- tab panel
-- tabpanel
skin.controls.tabpanel_body_color = {232, 232, 232, 255}
skin.controls.tabpanel_border_color = bordercolor
-- tab button
skin.controls.tab_border_nohover_color = bordercolor
skin.controls.tab_border_hover_color = bordercolor
skin.controls.tab_body_nohover_color = {255, 255, 255, 255}
skin.controls.tab_body_hover_color = {153, 214, 255, 255}
-- tabbutton
skin.controls.tab_text_nohover_color = {0, 0, 0, 200}
skin.controls.tab_text_hover_color = {255, 255, 255, 255}
skin.controls.tab_text_font = smallfont
-- multichoice
skin.controls.multichoice_body_color = {240, 240, 240, 255}
skin.controls.multichoice_border_color = bordercolor
skin.controls.multichoice_text_color = {0, 0, 0, 255}
skin.controls.multichoice_text_font = smallfont
-- multichoicelist
skin.controls.multichoicelist_body_color = {240, 240, 240, 200}
skin.controls.multichoicelist_border_color = bordercolor
-- multichoicerow
skin.controls.multichoicerow_body_nohover_color = {240, 240, 240, 255}
skin.controls.multichoicerow_body_hover_color = {51, 204, 255, 255}
skin.controls.multichoicerow_border_color = {50, 50, 50, 255}
skin.controls.multichoicerow_text_nohover_color = {0, 0, 0, 150}
skin.controls.multichoicerow_text_hover_color = {255, 255, 255, 255}
skin.controls.multichoicerow_text_font = smallfont
-- tooltip
skin.controls.tooltip_border_color = bordercolor
skin.controls.tooltip_body_color = {255, 255, 255, 255}
-- text input
skin.controls.textinput_border_color = bordercolor
-- textinput
skin.controls.textinput_body_color = {240, 240, 240, 255}
skin.controls.textinput_indicator_color = {0, 0, 0, 255}
skin.controls.textinput_text_normal_color = {0, 0, 0, 255}
@ -124,11 +92,9 @@ skin.controls.textinput_text_selected_color = {255, 255, 255, 255}
skin.controls.textinput_highlight_bar_color = {51, 204, 255, 255}
-- slider
skin.controls.slider_bar_color = bordercolor
skin.controls.slider_bar_outline_color = {220, 220, 220, 255}
-- checkbox
skin.controls.checkbox_border_color = bordercolor
skin.controls.checkbox_body_color = {255, 255, 255, 255}
skin.controls.checkbox_check_color = {128, 204, 255, 255}
skin.controls.checkbox_text_color = {0, 0, 0, 255}
@ -136,33 +102,21 @@ skin.controls.checkbox_text_font = smallfont
-- collapsiblecategory
skin.controls.collapsiblecategory_text_color = {0, 0, 0, 255}
skin.controls.collapsiblecategory_body_color = {255, 255, 255, 255}
skin.controls.collapsiblecategory_border_color = bordercolor
-- columnlist
skin.controls.columnlist_border_color = bordercolor
skin.controls.columnlist_body_color = {232, 232, 232, 255}
-- columlistarea
skin.controls.columnlistarea_border_color = bordercolor
skin.controls.columnlistarea_body_color = {232, 232, 232, 255}
-- columnlistheader
skin.controls.columnlistheader_border_down_color = bordercolor
skin.controls.columnlistheader_border_nohover_color = bordercolor
skin.controls.columnlistheader_border_hover_color = bordercolor
skin.controls.columnlistheader_body_down_color = {128, 204, 255, 255}
skin.controls.columnlistheader_body_nohover_color = {255, 255, 255, 255}
skin.controls.columnlistheader_body_hover_color = {153, 214, 255, 255}
skin.controls.columnlistheader_text_down_color = {255, 255, 255, 255}
skin.controls.columnlistheader_text_nohover_color = {0, 0, 0, 200}
skin.controls.columnlistheader_text_hover_color = {255, 255, 255, 255}
skin.controls.columnlistheader_text_font = smallfont
-- columnlistrow
skin.controls.columnlistrow_border1_color = bordercolor
skin.controls.columnlistrow_body1_color = {232, 232, 232, 255}
skin.controls.columnlistrow_border2_color = bordercolor
skin.controls.columnlistrow_body2_color = {200, 200, 200, 255}
skin.controls.columnlistrow_text_color = {100, 100, 100, 255}
@ -170,7 +124,6 @@ skin.controls.columnlistrow_text_color = {100, 100, 100, 255}
skin.controls.modalbackground_body_color = {255, 255, 255, 100}
-- linenumberspanel
skin.controls.linenumberspanel_border_color = bordercolor
skin.controls.linenumberspanel_text_color = {100, 100, 100, 255}
--[[---------------------------------------------------------
@ -206,24 +159,6 @@ function skin.OutlinedRectangle(x, y, width, height, ovt, ovb, ovl, ovr)
end
--[[---------------------------------------------------------
- func: skin.DrawGradient(x, y, width, height, color)
- desc: draws a gradient
--]]---------------------------------------------------------
function skin.DrawGradient(x, y, width, height, color)
local color = color
local percent = 0
for i=1, (height - 1) do
percent = i/height * 255
color[4] = loveframes.util.Round(percent)
love.graphics.setColor(unpack(color))
love.graphics.rectangle("fill", x, y + i, width, 1)
end
end
--[[---------------------------------------------------------
- func: DrawFrame(object)
- desc: draws the frame object
@ -238,19 +173,23 @@ function skin.DrawFrame(object)
local name = object:GetName()
local bodycolor = skin.controls.frame_body_color
local topcolor = skin.controls.frame_top_color
local bordercolor = skin.controls.frame_border_color
local namecolor = skin.controls.frame_name_color
local font = skin.controls.frame_name_font
local gradientcolor = {topcolor[1] - 20, topcolor[2] - 20, topcolor[3] - 20, 255}
local image = skin.images["frame-topbar.png"]
local imageheight = image:getHeight()
local scaley = 25/imageheight
-- button body
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- frame body
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
-- frame top bar
love.graphics.setColor(topcolor)
love.graphics.rectangle("fill", x, y, width, 25)
skin.DrawGradient(x, y, width, 25, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y + 25, width, 1)
@ -283,73 +222,69 @@ function skin.DrawButton(object)
local down = object.down
local enabled = object:GetEnabled()
local clickable = object:GetClickable()
local bodydowncolor = skin.controls.button_body_down_color
local textdowncolor = skin.controls.button_text_down_color
local borderdowncolor = skin.controls.button_border_down_color
local bodyhovercolor = skin.controls.button_body_hover_color
local texthovercolor = skin.controls.button_text_hover_color
local borderhovercolor = skin.controls.button_border_down_color
local bodynohvercolor = skin.controls.button_body_nohover_color
local textnohovercolor = skin.controls.button_text_nohover_color
local bordernohovercolor = skin.controls.button_border_down_color
local bodynonclickablecolor = skin.controls.button_body_nonclickable_color
local textnonclickablecolor = skin.controls.button_text_nonclickable_color
local gradientcolor = {}
if not enabled or not clickable then
local image = skin.images["button-unclickable.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodynonclickablecolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynonclickablecolor[1] - 20, bodynonclickablecolor[2] - 20, bodynonclickablecolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textnonclickablecolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
return
end
if down then
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textdowncolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(texthovercolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(borderhovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
else
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodynohvercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohvercolor[1] - 20, bodynohvercolor[2] - 20, bodynohvercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textnohovercolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -496,15 +431,15 @@ function skin.DrawProgressBar(object)
local bodycolor = skin.controls.progressbar_body_color
local barcolor = skin.controls.progressbar_bar_color
local textcolor = skin.controls.progressbar_text_color
local bordercolor = skin.controls.progressbar_border_color
local gradientcolor = {barcolor[1], barcolor[2] - 20, barcolor[3], 255}
local image = skin.images["progressbar.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- progress bar body
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(barcolor)
love.graphics.rectangle("fill", x, y, barwidth, height)
skin.DrawGradient(x, y, barwidth, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, barwidth, scaley)
love.graphics.setFont(font)
love.graphics.setColor(textcolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
@ -527,7 +462,6 @@ function skin.DrawScrollArea(object)
local height = object:GetHeight()
local bartype = object:GetBarType()
local bodycolor = skin.controls.scrollarea_body_color
local bordercolor = skin.controls.scrollarea_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
@ -555,43 +489,42 @@ function skin.DrawScrollBar(object)
local hover = object:GetHover()
local bartype = object:GetBarType()
local bodydowncolor = skin.controls.scrollbar_body_down_color
local borderdowncolor = skin.controls.scrollbar_border_down_color
local bodyhovercolor = skin.controls.scrollbar_body_hover_color
local borderhovercolor = skin.controls.scrollbar_border_hover_color
local bodynohvercolor = skin.controls.scrollbar_body_nohover_color
local bordernohovercolor = skin.controls.scrollbar_border_nohover_color
local gradientcolor = {}
if dragging then
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y, width, height, gradientcolor)
love.graphics.setColor(borderdowncolor)
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y, width, height, gradientcolor)
love.graphics.setColor(borderhovercolor)
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
love.graphics.setColor(bodynohvercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohvercolor[1] - 20, bodynohvercolor[2] - 20, bodynohvercolor[3] - 20, 255}
skin.DrawGradient(x, y, width, height, gradientcolor)
love.graphics.setColor(bordernohovercolor)
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
if bartype == "vertical" then
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + 3, y + height/2 - 3, width - 6, 1)
love.graphics.rectangle("fill", x + 3, y + height/2, width - 6, 1)
love.graphics.rectangle("fill", x + 3, y + height/2 + 3, width - 6, 1)
else
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + width/2 - 3, y + 3, 1, height - 6)
love.graphics.rectangle("fill", x + width/2, y + 3, 1, height - 6)
love.graphics.rectangle("fill", x + width/2 + 3, y + 3, 1, height - 6)
@ -627,7 +560,6 @@ function skin.DrawPanel(object)
local width = object:GetWidth()
local height = object:GetHeight()
local bodycolor = skin.controls.panel_body_color
local bordercolor = skin.controls.panel_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
@ -663,9 +595,8 @@ function skin.DrawOverList(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordrcolor = skin.controls.list_border_color
love.graphics.setColor(bordrcolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -682,7 +613,6 @@ function skin.DrawTabPanel(object)
local height = object:GetHeight()
local buttonheight = object:GetHeightOfButtons()
local bodycolor = skin.controls.tabpanel_body_color
local bordercolor = skin.controls.tabpanel_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y + buttonheight, width, height - buttonheight)
@ -712,12 +642,8 @@ function skin.DrawTabButton(object)
local theight = font:getHeight(object.text)
local imagewidth = 0
local imageheight = 0
local bordercolor = skin.controls.tabpanel_border_color
local bodyhovercolor = skin.controls.button_body_hover_color
local texthovercolor = skin.controls.button_text_hover_color
local bodynohovercolor = skin.controls.button_body_nohover_color
local textnohovercolor = skin.controls.button_text_nohover_color
local gradientcolor = {}
if image then
image:setFilter("nearest", "nearest")
@ -742,10 +668,11 @@ function skin.DrawTabButton(object)
if tabnumber == ptabnumber then
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x, y, width, height)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local gradient = skin.images["button-hover.png"]
local gradientheight = gradient:getHeight()
local scaley = height/gradientheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(gradient, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -765,10 +692,11 @@ function skin.DrawTabButton(object)
end
else
-- button body
love.graphics.setColor(bodynohovercolor)
love.graphics.rectangle("fill", x, y, width, height)
gradientcolor = {bodynohovercolor[1] - 20, bodynohovercolor[2] - 20, bodynohovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local gradient = skin.images["button-nohover.png"]
local gradientheight = gradient:getHeight()
local scaley = height/gradientheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(gradient, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -807,7 +735,6 @@ function skin.DrawMultiChoice(object)
local theight = font:getHeight("a")
local bodycolor = skin.controls.multichoice_body_color
local textcolor = skin.controls.multichoice_text_color
local bordercolor = skin.controls.multichoice_border_color
image:setFilter("nearest", "nearest")
@ -858,7 +785,6 @@ function skin.DrawOverMultiChoiceList(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordercolor = skin.controls.multichoicelist_border_color
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y - 1, width, height + 1)
@ -909,7 +835,6 @@ function skin.DrawToolTip(object)
local width = object:GetWidth()
local height = object:GetHeight()
local bodycolor = skin.controls.tooltip_body_color
local bordercolor = skin.controls.tooltip_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
@ -968,6 +893,9 @@ function skin.DrawTextInput(object)
if multiline then
for i=1, #lines do
local twidth = font:getWidth(lines[i])
if twidth == 0 then
twidth = 5
end
love.graphics.setColor(highlightbarcolor)
love.graphics.rectangle("fill", textx, texty + bary, twidth, theight)
bary = bary + theight
@ -1062,7 +990,6 @@ function skin.DrawOverTextInput(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordercolor = skin.controls.textinput_border_color
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -1083,40 +1010,39 @@ function skin.DrawScrollButton(object)
local scrolltype = object:GetScrollType()
local down = object.down
local bodydowncolor = skin.controls.button_body_down_color
local borderdowncolor = skin.controls.button_border_down_color
local bodyhovercolor = skin.controls.button_body_hover_color
local borderhovercolor = skin.controls.button_border_hover_color
local bodynohovercolor = skin.controls.button_body_nohover_color
local bordernohovercolor = skin.controls.button_border_nohover_color
local gradientcolor = {}
if down then
-- button body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderhovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
-- button body
love.graphics.setColor(bodynohovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohovercolor[1] - 20, bodynohovercolor[2] - 20, bodynohovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -1180,17 +1106,16 @@ function skin.DrawSlider(object)
local height = object:GetHeight()
local slidtype = object:GetSlideType()
local baroutlinecolor = skin.controls.slider_bar_outline_color
local barcolor = skin.controls.slider_bar_color
if slidtype == "horizontal" then
love.graphics.setColor(baroutlinecolor)
love.graphics.rectangle("fill", x, y + height/2 - 5, width, 10)
love.graphics.setColor(barcolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + 5, y + height/2, width - 10, 1)
elseif slidtype == "vertical" then
love.graphics.setColor(baroutlinecolor)
love.graphics.rectangle("fill", x + width/2 - 5, y, 10, height)
love.graphics.setColor(barcolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + width/2, y + 5, 1, height - 10)
end
@ -1208,40 +1133,54 @@ function skin.DrawSliderButton(object)
local height = object:GetHeight()
local hover = object:GetHover()
local down = object.down
local parent = object:GetParent()
local enabled = parent:GetEnabled()
local bodydowncolor = skin.controls.button_body_down_color
local borderdowncolor = skin.controls.button_border_down_color
local bodyhovercolor = skin.controls.button_body_hover_color
local borderhovercolor = skin.controls.button_border_down_color
local bodynohvercolor = skin.controls.button_body_nohover_color
local bordernohovercolor = skin.controls.button_border_down_color
local gradientcolor = {}
if not enabled then
local image = skin.images["button-unclickable.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
return
end
if down then
-- button body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderhovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
-- button body
love.graphics.setColor(bodynohvercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohvercolor[1] - 20, bodynohvercolor[2] - 20, bodynohvercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -1260,7 +1199,6 @@ function skin.DrawCheckBox(object)
local checked = object:GetChecked()
local hover = object:GetHover()
local bodycolor = skin.controls.checkbox_body_color
local bordercolor = skin.controls.checkbox_border_color
local checkcolor = skin.controls.checkbox_check_color
love.graphics.setColor(bodycolor)
@ -1292,17 +1230,14 @@ function skin.DrawCollapsibleCategory(object)
local width = object:GetWidth()
local height = object:GetHeight()
local text = object:GetText()
local bodycolor = skin.controls.collapsiblecategory_body_color
local textcolor = skin.controls.collapsiblecategory_text_color
local bordercolor = skin.controls.collapsiblecategory_border_color
local font = smallfont
local gradientcolor = {bodycolor[1] - 20, bodycolor[2] - 20, bodycolor[3] - 20, 255}
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(gradientcolor)
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setFont(font)
love.graphics.setColor(textcolor)
@ -1348,53 +1283,52 @@ function skin.DrawColumnListHeader(object)
local theight = font:getHeight(object.name)
local bodydowncolor = skin.controls.columnlistheader_body_down_color
local textdowncolor = skin.controls.columnlistheader_text_down_color
local borderdowncolor = skin.controls.columnlistheader_border_down_color
local bodyhovercolor = skin.controls.columnlistheader_body_hover_color
local textdowncolor = skin.controls.columnlistheader_text_hover_color
local borderdowncolor = skin.controls.columnlistheader_border_down_color
local nohovercolor = skin.controls.columnlistheader_body_nohover_color
local textnohovercolor = skin.controls.columnlistheader_text_nohover_color
local bordernohovercolor = skin.controls.columnlistheader_border_down_color
local gradientcolor = {}
if down then
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- header body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 1, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- header name
love.graphics.setFont(font)
love.graphics.setColor(textdowncolor)
love.graphics.print(name, x + width/2 - twidth/2, y + height/2 - theight/2)
-- header border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, false, false, false, true)
elseif hover then
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- header body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 1, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- header name
love.graphics.setFont(font)
love.graphics.setColor(textdowncolor)
love.graphics.print(name, x + width/2 - twidth/2, y + height/2 - theight/2)
-- header border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, false, false, false, true)
else
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- header body
love.graphics.setColor(nohovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 1, height - 2)
gradientcolor = {nohovercolor[1] - 20, nohovercolor[2] - 20, nohovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- header name
love.graphics.setFont(font)
love.graphics.setColor(textnohovercolor)
love.graphics.print(name, x + width/2 - twidth/2, y + height/2 - theight/2)
-- header border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, false, false, false, true)
end
@ -1427,7 +1361,6 @@ function skin.DrawOverColumnListArea(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordercolor = skin.controls.columnlist_border_color
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -1453,9 +1386,7 @@ function skin.DrawColumnListRow(object)
local cwidth, cheight = parent:GetParent():GetColumnSize()
local theight = font:getHeight("a")
local body1color = skin.controls.columnlistrow_body1_color
local border1color = skin.controls.columnlistrow_border1_color
local body2color = skin.controls.columnlistrow_body2_color
local border2color = skin.controls.columnlistrow_border2_color
local textcolor = skin.controls.columnlistrow_text_color
object:SetTextPos(5, height/2 - theight/2)
@ -1463,12 +1394,12 @@ function skin.DrawColumnListRow(object)
if colorindex == 1 then
love.graphics.setColor(body1color)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
love.graphics.setColor(border1color)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, true, false, true, true)
else
love.graphics.setColor(body2color)
love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(border2color)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, true, false, true, true)
end
@ -1513,7 +1444,6 @@ function skin.DrawLineNumbersPanel(object)
local lines = parent:GetLines()
local font = parent:GetFont()
local theight = font:getHeight("a")
local bordercolor = skin.controls.linenumberspanel_border_color
local textcolor = skin.controls.linenumberspanel_text_color
local mody = y

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View File

@ -19,104 +19,72 @@ local bordercolor = {143, 143, 143, 255}
skin.controls = {}
-- frame
skin.controls.frame_border_color = bordercolor
skin.controls.frame_body_color = {232, 232, 232, 255}
skin.controls.frame_top_color = {255, 153, 0, 255}
skin.controls.frame_name_color = {255, 255, 255, 255}
skin.controls.frame_name_font = smallfont
-- button
skin.controls.button_border_down_color = bordercolor
skin.controls.button_border_nohover_color = bordercolor
skin.controls.button_border_hover_color = bordercolor
skin.controls.button_body_down_color = {255, 173, 51, 255}
skin.controls.button_body_nohover_color = {255, 255, 255, 255}
skin.controls.button_body_hover_color = {255, 184, 77, 255}
skin.controls.button_text_down_color = {255, 255, 255, 255}
skin.controls.button_text_nohover_color = {0, 0, 0, 200}
skin.controls.button_text_hover_color = {255, 255, 255, 255}
skin.controls.button_body_nonclickable_color = {220, 220, 220, 255}
skin.controls.button_text_nonclickable_color = {0, 0, 0, 100}
skin.controls.button_text_font = smallfont
-- image button
-- imagebutton
skin.controls.imagebutton_text_down_color = {255, 255, 255, 255}
skin.controls.imagebutton_text_nohover_color = {255, 255, 255, 200}
skin.controls.imagebutton_text_hover_color = {255, 255, 255, 255}
skin.controls.imagebutton_text_font = imagebuttonfont
-- close button
-- closebutton
skin.controls.closebutton_body_down_color = {255, 255, 255, 255}
skin.controls.closebutton_body_nohover_color = {255, 255, 255, 255}
skin.controls.closebutton_body_hover_color = {255, 255, 255, 255}
-- progress bar
skin.controls.progressbar_border_color = bordercolor
-- progressbar
skin.controls.progressbar_body_color = {255, 255, 255, 255}
skin.controls.progressbar_bar_color = {0, 255, 0, 255}
skin.controls.progressbar_text_color = {0, 0, 0, 255}
skin.controls.progressbar_text_font = smallfont
-- list
skin.controls.list_border_color = bordercolor
skin.controls.list_body_color = {232, 232, 232, 255}
-- scrollbar
skin.controls.scrollbar_border_down_color = bordercolor
skin.controls.scrollbar_border_hover_color = bordercolor
skin.controls.scrollbar_border_nohover_color = bordercolor
skin.controls.scrollbar_body_down_color = {255, 173, 51, 255}
skin.controls.scrollbar_body_nohover_color = {255, 255, 255, 255}
skin.controls.scrollbar_body_hover_color = {255, 184, 77, 255}
-- scrollarea
skin.controls.scrollarea_body_color = {200, 200, 200, 255}
skin.controls.scrollarea_border_color = bordercolor
-- scrollbody
skin.controls.scrollbody_body_color = {0, 0, 0, 0}
-- panel
skin.controls.panel_body_color = {232, 232, 232, 255}
skin.controls.panel_border_color = bordercolor
-- tab panel
-- tabpanel
skin.controls.tabpanel_body_color = {232, 232, 232, 255}
skin.controls.tabpanel_border_color = bordercolor
-- tab button
skin.controls.tab_border_nohover_color = bordercolor
skin.controls.tab_border_hover_color = bordercolor
skin.controls.tab_body_nohover_color = {255, 255, 255, 255}
skin.controls.tab_body_hover_color = {255, 173, 51, 255}
-- tabbutton
skin.controls.tab_text_nohover_color = {0, 0, 0, 200}
skin.controls.tab_text_hover_color = {255, 255, 255, 255}
skin.controls.tab_text_font = smallfont
-- multichoice
skin.controls.multichoice_body_color = {240, 240, 240, 255}
skin.controls.multichoice_border_color = bordercolor
skin.controls.multichoice_text_color = {0, 0, 0, 255}
skin.controls.multichoice_text_font = smallfont
-- multichoicelist
skin.controls.multichoicelist_body_color = {240, 240, 240, 200}
skin.controls.multichoicelist_border_color = bordercolor
-- multichoicerow
skin.controls.multichoicerow_body_nohover_color = {240, 240, 240, 255}
skin.controls.multichoicerow_body_hover_color = {255, 117, 26, 255}
skin.controls.multichoicerow_border_color = {50, 50, 50, 255}
skin.controls.multichoicerow_body_hover_color = {255, 153, 0, 255}
skin.controls.multichoicerow_text_nohover_color = {0, 0, 0, 150}
skin.controls.multichoicerow_text_hover_color = {255, 255, 255, 255}
skin.controls.multichoicerow_text_font = smallfont
-- tooltip
skin.controls.tooltip_border_color = bordercolor
skin.controls.tooltip_body_color = {255, 255, 255, 255}
-- text input
skin.controls.textinput_border_color = bordercolor
-- textinput
skin.controls.textinput_body_color = {240, 240, 240, 255}
skin.controls.textinput_indicator_color = {0, 0, 0, 255}
skin.controls.textinput_text_normal_color = {0, 0, 0, 255}
@ -124,45 +92,31 @@ skin.controls.textinput_text_selected_color = {255, 255, 255, 255}
skin.controls.textinput_highlight_bar_color = {51, 204, 255, 255}
-- slider
skin.controls.slider_bar_color = bordercolor
skin.controls.slider_bar_outline_color = {220, 220, 220, 255}
-- checkbox
skin.controls.checkbox_border_color = bordercolor
skin.controls.checkbox_body_color = {255, 255, 255, 255}
skin.controls.checkbox_check_color = {255, 173, 51, 255}
skin.controls.checkbox_check_color = {255, 153, 0, 255}
skin.controls.checkbox_text_color = {0, 0, 0, 255}
skin.controls.checkbox_text_font = smallfont
-- collapsiblecategory
skin.controls.collapsiblecategory_text_color = {0, 0, 0, 255}
skin.controls.collapsiblecategory_body_color = {255, 255, 255, 255}
skin.controls.collapsiblecategory_border_color = bordercolor
-- columnlist
skin.controls.columnlist_border_color = bordercolor
skin.controls.columnlist_body_color = {232, 232, 232, 255}
-- columlistarea
skin.controls.columnlistarea_border_color = bordercolor
skin.controls.columnlistarea_body_color = {232, 232, 232, 255}
-- columnlistheader
skin.controls.columnlistheader_border_down_color = bordercolor
skin.controls.columnlistheader_border_nohover_color = bordercolor
skin.controls.columnlistheader_border_hover_color = bordercolor
skin.controls.columnlistheader_body_down_color = {255, 173, 51, 255}
skin.controls.columnlistheader_body_nohover_color = {255, 255, 255, 255}
skin.controls.columnlistheader_body_hover_color = {255, 184, 77, 255}
skin.controls.columnlistheader_text_down_color = {255, 255, 255, 255}
skin.controls.columnlistheader_text_nohover_color = {0, 0, 0, 200}
skin.controls.columnlistheader_text_hover_color = {255, 255, 255, 255}
skin.controls.columnlistheader_text_font = smallfont
-- columnlistrow
skin.controls.columnlistrow_border1_color = bordercolor
skin.controls.columnlistrow_body1_color = {232, 232, 232, 255}
skin.controls.columnlistrow_border2_color = bordercolor
skin.controls.columnlistrow_body2_color = {200, 200, 200, 255}
skin.controls.columnlistrow_text_color = {100, 100, 100, 255}
@ -170,7 +124,6 @@ skin.controls.columnlistrow_text_color = {100, 100, 100, 255}
skin.controls.modalbackground_body_color = {255, 255, 255, 100}
-- linenumberspanel
skin.controls.linenumberspanel_border_color = bordercolor
skin.controls.linenumberspanel_text_color = {100, 100, 100, 255}
--[[---------------------------------------------------------
@ -206,24 +159,6 @@ function skin.OutlinedRectangle(x, y, width, height, ovt, ovb, ovl, ovr)
end
--[[---------------------------------------------------------
- func: skin.DrawGradient(x, y, width, height, color)
- desc: draws a gradient
--]]---------------------------------------------------------
function skin.DrawGradient(x, y, width, height, color)
local color = color
local percent = 0
for i=1, (height - 1) do
percent = i/height * 255
color[4] = loveframes.util.Round(percent)
love.graphics.setColor(unpack(color))
love.graphics.rectangle("fill", x, y + i, width, 1)
end
end
--[[---------------------------------------------------------
- func: DrawFrame(object)
- desc: draws the frame object
@ -238,19 +173,23 @@ function skin.DrawFrame(object)
local name = object:GetName()
local bodycolor = skin.controls.frame_body_color
local topcolor = skin.controls.frame_top_color
local bordercolor = skin.controls.frame_border_color
local namecolor = skin.controls.frame_name_color
local font = skin.controls.frame_name_font
local gradientcolor = {topcolor[1] - 20, topcolor[2] - 20, topcolor[3], 255}
local image = skin.images["frame-topbar.png"]
local imageheight = image:getHeight()
local scaley = 25/imageheight
-- button body
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- frame body
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
-- frame top bar
love.graphics.setColor(topcolor)
love.graphics.rectangle("fill", x, y, width, 25)
skin.DrawGradient(x, y, width, 25, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y + 25, width, 1)
@ -283,73 +222,69 @@ function skin.DrawButton(object)
local down = object.down
local enabled = object:GetEnabled()
local clickable = object:GetClickable()
local bodydowncolor = skin.controls.button_body_down_color
local textdowncolor = skin.controls.button_text_down_color
local borderdowncolor = skin.controls.button_border_down_color
local bodyhovercolor = skin.controls.button_body_hover_color
local texthovercolor = skin.controls.button_text_hover_color
local borderhovercolor = skin.controls.button_border_down_color
local bodynohvercolor = skin.controls.button_body_nohover_color
local textnohovercolor = skin.controls.button_text_nohover_color
local bordernohovercolor = skin.controls.button_border_down_color
local bodynonclickablecolor = skin.controls.button_body_nonclickable_color
local textnonclickablecolor = skin.controls.button_text_nonclickable_color
local gradientcolor = {}
if not enabled or not clickable then
local image = skin.images["button-unclickable.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodynonclickablecolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynonclickablecolor[1] - 20, bodynonclickablecolor[2] - 20, bodynonclickablecolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textnonclickablecolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
return
end
if down then
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textdowncolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(texthovercolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(borderhovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
else
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(bodynohvercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohvercolor[1] - 20, bodynohvercolor[2] - 20, bodynohvercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textnohovercolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -496,15 +431,15 @@ function skin.DrawProgressBar(object)
local bodycolor = skin.controls.progressbar_body_color
local barcolor = skin.controls.progressbar_bar_color
local textcolor = skin.controls.progressbar_text_color
local bordercolor = skin.controls.progressbar_border_color
local gradientcolor = {barcolor[1], barcolor[2] - 20, barcolor[3], 255}
local image = skin.images["progressbar.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- progress bar body
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(barcolor)
love.graphics.rectangle("fill", x, y, barwidth, height)
skin.DrawGradient(x, y, barwidth, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, barwidth, scaley)
love.graphics.setFont(font)
love.graphics.setColor(textcolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height/2 - theight/2)
@ -527,7 +462,6 @@ function skin.DrawScrollArea(object)
local height = object:GetHeight()
local bartype = object:GetBarType()
local bodycolor = skin.controls.scrollarea_body_color
local bordercolor = skin.controls.scrollarea_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
@ -555,43 +489,42 @@ function skin.DrawScrollBar(object)
local hover = object:GetHover()
local bartype = object:GetBarType()
local bodydowncolor = skin.controls.scrollbar_body_down_color
local borderdowncolor = skin.controls.scrollbar_border_down_color
local bodyhovercolor = skin.controls.scrollbar_body_hover_color
local borderhovercolor = skin.controls.scrollbar_border_hover_color
local bodynohvercolor = skin.controls.scrollbar_body_nohover_color
local bordernohovercolor = skin.controls.scrollbar_border_nohover_color
local gradientcolor = {}
if dragging then
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y, width, height, gradientcolor)
love.graphics.setColor(borderdowncolor)
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y, width, height, gradientcolor)
love.graphics.setColor(borderhovercolor)
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
love.graphics.setColor(bodynohvercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohvercolor[1] - 20, bodynohvercolor[2] - 20, bodynohvercolor[3] - 20, 255}
skin.DrawGradient(x, y, width, height, gradientcolor)
love.graphics.setColor(bordernohovercolor)
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
if bartype == "vertical" then
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + 3, y + height/2 - 3, width - 6, 1)
love.graphics.rectangle("fill", x + 3, y + height/2, width - 6, 1)
love.graphics.rectangle("fill", x + 3, y + height/2 + 3, width - 6, 1)
else
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + width/2 - 3, y + 3, 1, height - 6)
love.graphics.rectangle("fill", x + width/2, y + 3, 1, height - 6)
love.graphics.rectangle("fill", x + width/2 + 3, y + 3, 1, height - 6)
@ -627,7 +560,6 @@ function skin.DrawPanel(object)
local width = object:GetWidth()
local height = object:GetHeight()
local bodycolor = skin.controls.panel_body_color
local bordercolor = skin.controls.panel_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
@ -663,9 +595,8 @@ function skin.DrawOverList(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordrcolor = skin.controls.list_border_color
love.graphics.setColor(bordrcolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -682,7 +613,6 @@ function skin.DrawTabPanel(object)
local height = object:GetHeight()
local buttonheight = object:GetHeightOfButtons()
local bodycolor = skin.controls.tabpanel_body_color
local bordercolor = skin.controls.tabpanel_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y + buttonheight, width, height - buttonheight)
@ -712,12 +642,8 @@ function skin.DrawTabButton(object)
local theight = font:getHeight(object.text)
local imagewidth = 0
local imageheight = 0
local bordercolor = skin.controls.tabpanel_border_color
local bodyhovercolor = skin.controls.button_body_hover_color
local texthovercolor = skin.controls.button_text_hover_color
local bodynohovercolor = skin.controls.button_body_nohover_color
local textnohovercolor = skin.controls.button_text_nohover_color
local gradientcolor = {}
if image then
image:setFilter("nearest", "nearest")
@ -742,10 +668,11 @@ function skin.DrawTabButton(object)
if tabnumber == ptabnumber then
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x, y, width, height)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local gradient = skin.images["button-hover.png"]
local gradientheight = gradient:getHeight()
local scaley = height/gradientheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(gradient, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -765,10 +692,11 @@ function skin.DrawTabButton(object)
end
else
-- button body
love.graphics.setColor(bodynohovercolor)
love.graphics.rectangle("fill", x, y, width, height)
gradientcolor = {bodynohovercolor[1] - 20, bodynohovercolor[2] - 20, bodynohovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local gradient = skin.images["button-nohover.png"]
local gradientheight = gradient:getHeight()
local scaley = height/gradientheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(gradient, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -779,12 +707,12 @@ function skin.DrawTabButton(object)
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textnohovercolor)
love.graphics.print(object.text, x + imagewidth + 10, y + height/2 - theight/2)
love.graphics.print(text, x + imagewidth + 10, y + height/2 - theight/2)
else
-- button text
love.graphics.setFont(font)
love.graphics.setColor(textnohovercolor)
love.graphics.print(object.text, x + 5, y + height/2 - theight/2)
love.graphics.print(text, x + 5, y + height/2 - theight/2)
end
end
@ -807,7 +735,6 @@ function skin.DrawMultiChoice(object)
local theight = font:getHeight("a")
local bodycolor = skin.controls.multichoice_body_color
local textcolor = skin.controls.multichoice_text_color
local bordercolor = skin.controls.multichoice_border_color
image:setFilter("nearest", "nearest")
@ -858,7 +785,6 @@ function skin.DrawOverMultiChoiceList(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordercolor = skin.controls.multichoicelist_border_color
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y - 1, width, height + 1)
@ -909,7 +835,6 @@ function skin.DrawToolTip(object)
local width = object:GetWidth()
local height = object:GetHeight()
local bodycolor = skin.controls.tooltip_body_color
local bordercolor = skin.controls.tooltip_border_color
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
@ -968,6 +893,9 @@ function skin.DrawTextInput(object)
if multiline then
for i=1, #lines do
local twidth = font:getWidth(lines[i])
if twidth == 0 then
twidth = 5
end
love.graphics.setColor(highlightbarcolor)
love.graphics.rectangle("fill", textx, texty + bary, twidth, theight)
bary = bary + theight
@ -1062,7 +990,6 @@ function skin.DrawOverTextInput(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordercolor = skin.controls.textinput_border_color
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -1083,40 +1010,39 @@ function skin.DrawScrollButton(object)
local scrolltype = object:GetScrollType()
local down = object.down
local bodydowncolor = skin.controls.button_body_down_color
local borderdowncolor = skin.controls.button_border_down_color
local bodyhovercolor = skin.controls.button_body_hover_color
local borderhovercolor = skin.controls.button_border_hover_color
local bodynohovercolor = skin.controls.button_body_nohover_color
local bordernohovercolor = skin.controls.button_border_nohover_color
local gradientcolor = {}
if down then
-- button body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderhovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
-- button body
love.graphics.setColor(bodynohovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohovercolor[1] - 20, bodynohovercolor[2] - 20, bodynohovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -1180,17 +1106,16 @@ function skin.DrawSlider(object)
local height = object:GetHeight()
local slidtype = object:GetSlideType()
local baroutlinecolor = skin.controls.slider_bar_outline_color
local barcolor = skin.controls.slider_bar_color
if slidtype == "horizontal" then
love.graphics.setColor(baroutlinecolor)
love.graphics.rectangle("fill", x, y + height/2 - 5, width, 10)
love.graphics.setColor(barcolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + 5, y + height/2, width - 10, 1)
elseif slidtype == "vertical" then
love.graphics.setColor(baroutlinecolor)
love.graphics.rectangle("fill", x + width/2 - 5, y, 10, height)
love.graphics.setColor(barcolor)
love.graphics.setColor(bordercolor)
love.graphics.rectangle("fill", x + width/2, y + 5, 1, height - 10)
end
@ -1208,40 +1133,54 @@ function skin.DrawSliderButton(object)
local height = object:GetHeight()
local hover = object:GetHover()
local down = object.down
local parent = object:GetParent()
local enabled = parent:GetEnabled()
local bodydowncolor = skin.controls.button_body_down_color
local borderdowncolor = skin.controls.button_border_down_color
local bodyhovercolor = skin.controls.button_body_hover_color
local borderhovercolor = skin.controls.button_border_down_color
local bodynohvercolor = skin.controls.button_body_nohover_color
local bordernohovercolor = skin.controls.button_border_down_color
local gradientcolor = {}
if not enabled then
local image = skin.images["button-unclickable.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- button body
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
return
end
if down then
-- button body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
elseif hover then
-- button body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(borderhovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
else
-- button body
love.graphics.setColor(bodynohvercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
gradientcolor = {bodynohvercolor[1] - 20, bodynohvercolor[2] - 20, bodynohvercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- button border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
end
@ -1260,7 +1199,6 @@ function skin.DrawCheckBox(object)
local checked = object:GetChecked()
local hover = object:GetHover()
local bodycolor = skin.controls.checkbox_body_color
local bordercolor = skin.controls.checkbox_border_color
local checkcolor = skin.controls.checkbox_check_color
love.graphics.setColor(bodycolor)
@ -1292,17 +1230,14 @@ function skin.DrawCollapsibleCategory(object)
local width = object:GetWidth()
local height = object:GetHeight()
local text = object:GetText()
local bodycolor = skin.controls.collapsiblecategory_body_color
local textcolor = skin.controls.collapsiblecategory_text_color
local bordercolor = skin.controls.collapsiblecategory_border_color
local font = smallfont
local gradientcolor = {bodycolor[1] - 20, bodycolor[2] - 20, bodycolor[3] - 20, 255}
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(gradientcolor)
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setFont(font)
love.graphics.setColor(textcolor)
@ -1348,53 +1283,52 @@ function skin.DrawColumnListHeader(object)
local theight = font:getHeight(object.name)
local bodydowncolor = skin.controls.columnlistheader_body_down_color
local textdowncolor = skin.controls.columnlistheader_text_down_color
local borderdowncolor = skin.controls.columnlistheader_border_down_color
local bodyhovercolor = skin.controls.columnlistheader_body_hover_color
local textdowncolor = skin.controls.columnlistheader_text_hover_color
local borderdowncolor = skin.controls.columnlistheader_border_down_color
local nohovercolor = skin.controls.columnlistheader_body_nohover_color
local textnohovercolor = skin.controls.columnlistheader_text_nohover_color
local bordernohovercolor = skin.controls.columnlistheader_border_down_color
local gradientcolor = {}
if down then
local image = skin.images["button-down.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- header body
love.graphics.setColor(bodydowncolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 1, height - 2)
gradientcolor = {bodydowncolor[1] - 20, bodydowncolor[2] - 20, bodydowncolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- header name
love.graphics.setFont(font)
love.graphics.setColor(textdowncolor)
love.graphics.print(name, x + width/2 - twidth/2, y + height/2 - theight/2)
-- header border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, false, false, false, true)
elseif hover then
local image = skin.images["button-hover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- header body
love.graphics.setColor(bodyhovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 1, height - 2)
gradientcolor = {bodyhovercolor[1] - 20, bodyhovercolor[2] - 20, bodyhovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- header name
love.graphics.setFont(font)
love.graphics.setColor(textdowncolor)
love.graphics.print(name, x + width/2 - twidth/2, y + height/2 - theight/2)
-- header border
love.graphics.setColor(borderdowncolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, false, false, false, true)
else
local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight()
local scaley = height/imageheight
-- header body
love.graphics.setColor(nohovercolor)
love.graphics.rectangle("fill", x + 1, y + 1, width - 1, height - 2)
gradientcolor = {nohovercolor[1] - 20, nohovercolor[2] - 20, nohovercolor[3] - 20, 255}
skin.DrawGradient(x, y - 1, width, height, gradientcolor)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(image, x, y, 0, width, scaley)
-- header name
love.graphics.setFont(font)
love.graphics.setColor(textnohovercolor)
love.graphics.print(name, x + width/2 - twidth/2, y + height/2 - theight/2)
-- header border
love.graphics.setColor(bordernohovercolor)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, false, false, false, true)
end
@ -1427,7 +1361,6 @@ function skin.DrawOverColumnListArea(object)
local y = object:GetY()
local width = object:GetWidth()
local height = object:GetHeight()
local bordercolor = skin.controls.columnlist_border_color
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height)
@ -1453,9 +1386,7 @@ function skin.DrawColumnListRow(object)
local cwidth, cheight = parent:GetParent():GetColumnSize()
local theight = font:getHeight("a")
local body1color = skin.controls.columnlistrow_body1_color
local border1color = skin.controls.columnlistrow_border1_color
local body2color = skin.controls.columnlistrow_body2_color
local border2color = skin.controls.columnlistrow_border2_color
local textcolor = skin.controls.columnlistrow_text_color
object:SetTextPos(5, height/2 - theight/2)
@ -1463,12 +1394,12 @@ function skin.DrawColumnListRow(object)
if colorindex == 1 then
love.graphics.setColor(body1color)
love.graphics.rectangle("fill", x + 1, y + 1, width - 2, height - 2)
love.graphics.setColor(border1color)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, true, false, true, true)
else
love.graphics.setColor(body2color)
love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(border2color)
love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height, true, false, true, true)
end
@ -1513,7 +1444,6 @@ function skin.DrawLineNumbersPanel(object)
local lines = parent:GetLines()
local font = parent:GetFont()
local theight = font:getHeight("a")
local bordercolor = skin.controls.linenumberspanel_border_color
local textcolor = skin.controls.linenumberspanel_text_color
local mody = y