Update to 11.0

This commit is contained in:
linux-man 2018-04-15 02:23:26 +01:00
parent d22aa28502
commit cb2b21b2b8
9 changed files with 158 additions and 157 deletions

View File

@ -43,25 +43,25 @@ function loveframes.debug.draw()
if topcol.type == "frame" then if topcol.type == "frame" then
for k, v in pairs(topcol.dockzones) do for k, v in pairs(topcol.dockzones) do
love.graphics.setLineWidth(1) love.graphics.setLineWidth(1)
love.graphics.setColor(255, 0, 0, 100) love.graphics.setColor(255/255, 0, 0, 100/255)
love.graphics.rectangle("fill", v.x, v.y, v.width, v.height) love.graphics.rectangle("fill", v.x, v.y, v.width, v.height)
love.graphics.setColor(255, 0, 0, 255) love.graphics.setColor(255/255, 0, 0, 255/255)
love.graphics.rectangle("line", v.x, v.y, v.width, v.height) love.graphics.rectangle("line", v.x, v.y, v.width, v.height)
end end
end end
-- outline the object that the mouse is hovering over -- outline the object that the mouse is hovering over
love.graphics.setColor(255, 204, 51, 255) love.graphics.setColor(255/255, 204/255, 51/255, 255/255)
love.graphics.setLineWidth(2) love.graphics.setLineWidth(2)
love.graphics.rectangle("line", topcol.x - 1, topcol.y - 1, topcol.width + 2, topcol.height + 2) love.graphics.rectangle("line", topcol.x - 1, topcol.y - 1, topcol.width + 2, topcol.height + 2)
-- draw main debug box -- draw main debug box
love.graphics.setFont(font) love.graphics.setFont(font)
love.graphics.setColor(0, 0, 0, 200) love.graphics.setColor(0, 0, 0, 200/255)
love.graphics.rectangle("fill", infox, infoy, 200, 70) love.graphics.rectangle("fill", infox, infoy, 200, 70)
love.graphics.setColor(255, 0, 0, 255) love.graphics.setColor(255/255, 0, 0, 255/255)
love.graphics.print("Love Frames - Debug (" ..version.. " - " ..stage.. ")", infox + 5, infoy + 5) love.graphics.print("Love Frames - Debug (" ..version.. " - " ..stage.. ")", infox + 5, infoy + 5)
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.print("LOVE Version: " ..loveversion, infox + 10, infoy + 20) love.graphics.print("LOVE Version: " ..loveversion, infox + 10, infoy + 20)
love.graphics.print("FPS: " ..fps, infox + 10, infoy + 30) love.graphics.print("FPS: " ..fps, infox + 10, infoy + 30)
love.graphics.print("Delta Time: " ..deltatime, infox + 10, infoy + 40) love.graphics.print("Delta Time: " ..deltatime, infox + 10, infoy + 40)
@ -69,11 +69,11 @@ function loveframes.debug.draw()
-- draw object information if needed -- draw object information if needed
if topcol.type ~= "base" then if topcol.type ~= "base" then
love.graphics.setColor(0, 0, 0, 200) love.graphics.setColor(0, 0, 0, 200/255)
love.graphics.rectangle("fill", infox, infoy + 75, 200, 100) love.graphics.rectangle("fill", infox, infoy + 75, 200, 100)
love.graphics.setColor(255, 0, 0, 255) love.graphics.setColor(255/255, 0, 0, 255/255)
love.graphics.print("Object Information", infox + 5, infoy + 80) love.graphics.print("Object Information", infox + 5, infoy + 80)
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.print("Type: " ..topcol.type, infox + 10, infoy + 95) love.graphics.print("Type: " ..topcol.type, infox + 10, infoy + 95)
if topcol.children then if topcol.children then
love.graphics.print("# of children: " .. #topcol.children, infox + 10, infoy + 105) love.graphics.print("# of children: " .. #topcol.children, infox + 10, infoy + 105)

View File

@ -43,13 +43,13 @@ function loveframes.skins.Register(skin)
end end
local dir = skin.directory or loveframes.config["DIRECTORY"] .. "/skins/" ..name local dir = skin.directory or loveframes.config["DIRECTORY"] .. "/skins/" ..name
local dircheck = love.filesystem.isDirectory(dir) local dircheck = love.filesystem.getInfo(dir) ~= nil and love.filesystem.getInfo(dir)["type"] == "directory"
if not dircheck then if not dircheck then
loveframes.util.Error("Skin registration error: Could not find a directory for skin '" ..name.. "'.") loveframes.util.Error("Skin registration error: Could not find a directory for skin '" ..name.. "'.")
end end
local imagedir = skin.imagedir or dir .. "/images" local imagedir = skin.imagedir or dir .. "/images"
local imagedircheck = love.filesystem.isDirectory(imagedir) local imagedircheck = love.filesystem.getInfo(imagedir) ~= nil and love.filesystem.getInfo(imagedir)["type"] == "directory"
if not imagedircheck then if not imagedircheck then
loveframes.util.Error("Skin registration error: Could not find an image directory for skin '" ..name.. "'.") loveframes.util.Error("Skin registration error: Could not find an image directory for skin '" ..name.. "'.")
end end
@ -188,7 +188,7 @@ function loveframes.skins.ReloadImages(name)
if skin and indeximages then if skin and indeximages then
local basedir = loveframes.config["DIRECTORY"] local basedir = loveframes.config["DIRECTORY"]
local imagedir = skin.imagedir or basedir .. "/skins/" ..name.. "/images" local imagedir = skin.imagedir or basedir .. "/skins/" ..name.. "/images"
local dircheck = love.filesystem.isDirectory(imagedir) local dircheck = love.filesystem.getInfo(imagedir) ~= nil and love.filesystem.getInfo(imagedir)["type"] == "directory"
if dircheck then if dircheck then
local images = loveframes.util.GetDirectoryContents(imagedir) local images = loveframes.util.GetDirectoryContents(imagedir)
for k, v in ipairs(images) do for k, v in ipairs(images) do

View File

@ -146,7 +146,7 @@ function loveframes.util.GetDirectoryContents(dir, t)
local files = love.filesystem.getDirectoryItems(dir) local files = love.filesystem.getDirectoryItems(dir)
for k, v in ipairs(files) do for k, v in ipairs(files) do
local isdir = love.filesystem.isDirectory(dir.. "/" ..v) local isdir = love.filesystem.getInfo(dir.. "/" ..v) ~= nil and love.filesystem.getInfo(dir.. "/" ..v)["type"] == "directory" --love.filesystem.isDirectory(dir.. "/" ..v)
if isdir == true then if isdir == true then
table.insert(dirs, dir.. "/" ..v) table.insert(dirs, dir.. "/" ..v)
else else

View File

@ -28,7 +28,7 @@ function newobject:initialize()
self.sheary = 0 self.sheary = 0
self.internal = false self.internal = false
self.image = nil self.image = nil
self.imagecolor = {255, 255, 255, 255} self.imagecolor = {255/255, 255/255, 255/255, 255/255}
end end

View File

@ -24,7 +24,7 @@ function newobject:initialize()
self.clickable = true self.clickable = true
self.enabled = true self.enabled = true
self.image = nil self.image = nil
self.imagecolor = {255, 255, 255, 255} self.imagecolor = {255/255, 255/255, 255/255, 255/255}
self.OnClick = nil self.OnClick = nil
self.groupIndex = 0 self.groupIndex = 0
self.checked = false self.checked = false

View File

@ -32,10 +32,10 @@ function newobject:initialize()
self.lines = 0 self.lines = 0
self.formattedtext = {} self.formattedtext = {}
self.original = {} self.original = {}
self.defaultcolor = {0, 0, 0, 255} self.defaultcolor = {0, 0, 0, 255/255}
self.shadowcolor = {0, 0, 0, 255} self.shadowcolor = {0, 0, 0, 255/255}
self.linkcolor = {0, 102, 255, 255} self.linkcolor = {0, 102/255, 255/255, 255/255}
self.linkhovercolor = {0, 0, 255, 255} self.linkhovercolor = {0, 0, 255/255, 255/255}
self.ignorenewlines = false self.ignorenewlines = false
self.shadow = false self.shadow = false
self.linkcol = false self.linkcol = false

View File

@ -2,8 +2,7 @@
## Information ## Information
Love Frames is a GUI library for [LÖVE](https://love2d.org/). Information on installation and usage can be found in the [documentation](https://github.com/KennyShields/LoveFrames/wiki). A demo of the library can be found at: https://github.com/KennyShields/LoveFrames-demo Love Frames is a GUI library for [LÖVE](https://love2d.org/).
This fork contains fixes for (yet unreleased) LÖVE 0.10.0.
## License ## License
@ -19,6 +18,8 @@ Created by Kenny Shields
What's new: What's new:
Compatible with 11.0
textinput - Unicode support. textinput - Unicode support.
Properties: Properties:

View File

@ -17,7 +17,7 @@ skin.version = "1.0"
local smallfont = love.graphics.newFont(10) local smallfont = love.graphics.newFont(10)
local imagebuttonfont = love.graphics.newFont(15) local imagebuttonfont = love.graphics.newFont(15)
local bordercolor = {143, 143, 143, 255} local bordercolor = {143/255, 143/255, 143/255, 255/255}
-- add skin directives to this table -- add skin directives to this table
skin.directives = {} skin.directives = {}
@ -26,138 +26,138 @@ skin.directives = {}
skin.controls = {} skin.controls = {}
-- frame -- frame
skin.controls.frame_body_color = {232, 232, 232, 255} skin.controls.frame_body_color = {232/255, 232/255, 232/255, 255/255}
skin.controls.frame_name_color = {255, 255, 255, 255} skin.controls.frame_name_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.frame_name_font = smallfont skin.controls.frame_name_font = smallfont
-- button -- button
skin.controls.button_text_down_color = {255, 255, 255, 255} skin.controls.button_text_down_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.button_text_nohover_color = {0, 0, 0, 200} skin.controls.button_text_nohover_color = {0, 0, 0, 200/255}
skin.controls.button_text_hover_color = {255, 255, 255, 255} skin.controls.button_text_hover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.button_text_nonclickable_color = {0, 0, 0, 100} skin.controls.button_text_nonclickable_color = {0, 0, 0, 100/255}
skin.controls.button_text_font = smallfont skin.controls.button_text_font = smallfont
-- imagebutton -- imagebutton
skin.controls.imagebutton_text_down_color = {255, 255, 255, 255} skin.controls.imagebutton_text_down_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.imagebutton_text_nohover_color = {255, 255, 255, 200} skin.controls.imagebutton_text_nohover_color = {255/255, 255/255, 255/255, 200/255}
skin.controls.imagebutton_text_hover_color = {255, 255, 255, 255} skin.controls.imagebutton_text_hover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.imagebutton_text_font = imagebuttonfont skin.controls.imagebutton_text_font = imagebuttonfont
-- closebutton -- closebutton
skin.controls.closebutton_body_down_color = {255, 255, 255, 255} skin.controls.closebutton_body_down_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.closebutton_body_nohover_color = {255, 255, 255, 255} skin.controls.closebutton_body_nohover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.closebutton_body_hover_color = {255, 255, 255, 255} skin.controls.closebutton_body_hover_color = {255/255, 255/255, 255/255, 255/255}
-- progressbar -- progressbar
skin.controls.progressbar_body_color = {255, 255, 255, 255} skin.controls.progressbar_body_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.progressbar_text_color = {0, 0, 0, 255} skin.controls.progressbar_text_color = {0, 0, 0, 255/255}
skin.controls.progressbar_text_font = smallfont skin.controls.progressbar_text_font = smallfont
-- list -- list
skin.controls.list_body_color = {232, 232, 232, 255} skin.controls.list_body_color = {232/255, 232/255, 232/255, 255/255}
-- scrollarea -- scrollarea
skin.controls.scrollarea_body_color = {220, 220, 220, 255} skin.controls.scrollarea_body_color = {220/255, 220/255, 220/255, 255/255}
-- scrollbody -- scrollbody
skin.controls.scrollbody_body_color = {0, 0, 0, 0} skin.controls.scrollbody_body_color = {0, 0, 0, 0}
-- panel -- panel
skin.controls.panel_body_color = {232, 232, 232, 255} skin.controls.panel_body_color = {232/255, 232/255, 232/255, 255/255}
-- tabpanel -- tabpanel
skin.controls.tabpanel_body_color = {232, 232, 232, 255} skin.controls.tabpanel_body_color = {232/255, 232/255, 232/255, 255/255}
-- tabbutton -- tabbutton
skin.controls.tab_text_nohover_color = {0, 0, 0, 200} skin.controls.tab_text_nohover_color = {0, 0, 0, 200/255}
skin.controls.tab_text_hover_color = {255, 255, 255, 255} skin.controls.tab_text_hover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.tab_text_font = smallfont skin.controls.tab_text_font = smallfont
-- multichoice -- multichoice
skin.controls.multichoice_body_color = {240, 240, 240, 255} skin.controls.multichoice_body_color = {240/255, 240/255, 240/255, 255/255}
skin.controls.multichoice_text_color = {0, 0, 0, 255} skin.controls.multichoice_text_color = {0, 0, 0, 255/255}
skin.controls.multichoice_text_font = smallfont skin.controls.multichoice_text_font = smallfont
-- multichoicelist -- multichoicelist
skin.controls.multichoicelist_body_color = {240, 240, 240, 200} skin.controls.multichoicelist_body_color = {240/255, 240/255, 240/255, 200/255}
-- multichoicerow -- multichoicerow
skin.controls.multichoicerow_body_nohover_color = {240, 240, 240, 255} skin.controls.multichoicerow_body_nohover_color = {240/255, 240/255, 240/255, 255/255}
skin.controls.multichoicerow_body_hover_color = {51, 204, 255, 255} skin.controls.multichoicerow_body_hover_color = {51/255, 204/255, 255/255, 255/255}
skin.controls.multichoicerow_text_nohover_color = {0, 0, 0, 150} skin.controls.multichoicerow_text_nohover_color = {0, 0, 0, 150/255}
skin.controls.multichoicerow_text_hover_color = {255, 255, 255, 255} skin.controls.multichoicerow_text_hover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.multichoicerow_text_font = smallfont skin.controls.multichoicerow_text_font = smallfont
-- tooltip -- tooltip
skin.controls.tooltip_body_color = {255, 255, 255, 255} skin.controls.tooltip_body_color = {255/255, 255/255, 255/255, 255/255}
-- textinput -- textinput
skin.controls.textinput_body_color = {250, 250, 250, 255} skin.controls.textinput_body_color = {250/255, 250/255, 250/255, 255/255}
skin.controls.textinput_indicator_color = {0, 0, 0, 255} skin.controls.textinput_indicator_color = {0, 0, 0, 255/255}
skin.controls.textinput_text_normal_color = {0, 0, 0, 255} skin.controls.textinput_text_normal_color = {0, 0, 0, 255/255}
skin.controls.textinput_text_placeholder_color = {127, 127, 127, 255} skin.controls.textinput_text_placeholder_color = {127/255, 127/255, 127/255, 255/255}
skin.controls.textinput_text_selected_color = {255, 255, 255, 255} skin.controls.textinput_text_selected_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.textinput_highlight_bar_color = {51, 204, 255, 255} skin.controls.textinput_highlight_bar_color = {51/255, 204/255, 255/255, 255/255}
-- slider -- slider
skin.controls.slider_bar_outline_color = {220, 220, 220, 255} skin.controls.slider_bar_outline_color = {220/255, 220/255, 220/255, 255/255}
-- checkbox -- checkbox
skin.controls.checkbox_body_color = {255, 255, 255, 255} skin.controls.checkbox_body_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.checkbox_check_color = {128, 204, 255, 255} skin.controls.checkbox_check_color = {128/255, 204/255, 255/255, 255/255}
skin.controls.checkbox_text_font = smallfont skin.controls.checkbox_text_font = smallfont
-- radiobutton -- radiobutton
skin.controls.radiobutton_body_color = {255, 255, 255, 255} skin.controls.radiobutton_body_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.radiobutton_check_color = {128, 204, 255, 255} skin.controls.radiobutton_check_color = {128/255, 204/255, 255/255, 255/255}
skin.controls.radiobutton_inner_border_color = {77, 184, 255, 255} skin.controls.radiobutton_inner_border_color = {77/255, 184/255, 255/255, 255/255}
skin.controls.radiobutton_text_font = smallfont skin.controls.radiobutton_text_font = smallfont
-- collapsiblecategory -- collapsiblecategory
skin.controls.collapsiblecategory_text_color = {255, 255, 255, 255} skin.controls.collapsiblecategory_text_color = {255/255, 255/255, 255/255, 255/255}
-- columnlist -- columnlist
skin.controls.columnlist_body_color = {232, 232, 232, 255} skin.controls.columnlist_body_color = {232/255, 232/255, 232/255, 255/255}
-- columlistarea -- columlistarea
skin.controls.columnlistarea_body_color = {232, 232, 232, 255} skin.controls.columnlistarea_body_color = {232/255, 232/255, 232/255, 255/255}
-- columnlistheader -- columnlistheader
skin.controls.columnlistheader_text_down_color = {255, 255, 255, 255} skin.controls.columnlistheader_text_down_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.columnlistheader_text_nohover_color = {0, 0, 0, 200} skin.controls.columnlistheader_text_nohover_color = {0, 0, 0, 200/255}
skin.controls.columnlistheader_text_hover_color = {255, 255, 255, 255} skin.controls.columnlistheader_text_hover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.columnlistheader_text_font = smallfont skin.controls.columnlistheader_text_font = smallfont
-- columnlistrow -- columnlistrow
skin.controls.columnlistrow_body1_color = {245, 245, 245, 255} skin.controls.columnlistrow_body1_color = {245/255, 245/255, 245/255, 255/255}
skin.controls.columnlistrow_body2_color = {255, 255, 255, 255} skin.controls.columnlistrow_body2_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.columnlistrow_body_selected_color = {26, 198, 255, 255} skin.controls.columnlistrow_body_selected_color = {26/255, 198/255, 255/255, 255/255}
skin.controls.columnlistrow_body_hover_color = {102, 217, 255, 255} skin.controls.columnlistrow_body_hover_color = {102/255, 217/255, 255/255, 255/255}
skin.controls.columnlistrow_text_color = {100, 100, 100, 255} skin.controls.columnlistrow_text_color = {100/255, 100/255, 100/255, 255/255}
skin.controls.columnlistrow_text_hover_color = {255, 255, 255, 255} skin.controls.columnlistrow_text_hover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.columnlistrow_text_selected_color = {255, 255, 255, 255} skin.controls.columnlistrow_text_selected_color = {255/255, 255/255, 255/255, 255/255}
-- modalbackground -- modalbackground
skin.controls.modalbackground_body_color = {255, 255, 255, 100} skin.controls.modalbackground_body_color = {255/255, 255/255, 255/255, 100/255}
-- linenumberspanel -- linenumberspanel
skin.controls.linenumberspanel_text_color = {170, 170, 170, 255} skin.controls.linenumberspanel_text_color = {170/255, 170/255, 170/255, 255/255}
skin.controls.linenumberspanel_body_color = {235, 235, 235, 255} skin.controls.linenumberspanel_body_color = {235/255, 235/255, 235/255, 255/255}
-- grid -- grid
skin.controls.grid_body_color = {230, 230, 230, 255} skin.controls.grid_body_color = {230/255, 230/255, 230/255, 255/255}
-- form -- form
skin.controls.form_text_color = {0, 0, 0, 255} skin.controls.form_text_color = {0, 0, 0, 255/255}
skin.controls.form_text_font = smallfont skin.controls.form_text_font = smallfont
-- menu -- menu
skin.controls.menu_body_color = {255, 255, 255, 255} skin.controls.menu_body_color = {255/255, 255/255, 255/255, 255/255}
-- menuoption -- menuoption
skin.controls.menuoption_body_hover_color = {51, 204, 255, 255} skin.controls.menuoption_body_hover_color = {51/255, 204/255, 255/255, 255/255}
skin.controls.menuoption_text_hover_color = {255, 255, 255, 255} skin.controls.menuoption_text_hover_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.menuoption_text_color = {180, 180, 180, 255} skin.controls.menuoption_text_color = {180/255, 180/255, 180/255, 255/255}
local function ParseHeaderText(str, hx, hwidth, tx) local function ParseHeaderText(str, hx, hwidth, tx)
@ -262,11 +262,11 @@ function skin.DrawFrame(object)
local bodyimage_scaley = height/bodyimage_height local bodyimage_scaley = height/bodyimage_height
-- frame body -- frame body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(bodyimage, x, y, 0, bodyimage_scalex, bodyimage_scaley) love.graphics.draw(bodyimage, x, y, 0, bodyimage_scalex, bodyimage_scaley)
-- frame top bar -- frame top bar
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(topbarimage, x, y, 0, topbarimage_scalex, topbarimage_scaley) love.graphics.draw(topbarimage, x, y, 0, topbarimage_scalex, topbarimage_scaley)
-- frame name section -- frame name section
@ -276,7 +276,7 @@ function skin.DrawFrame(object)
local iconwidth = icon:getWidth() local iconwidth = icon:getWidth()
local iconheight = icon:getHeight() local iconheight = icon:getHeight()
icon:setFilter("nearest", "nearest") icon:setFilter("nearest", "nearest")
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(icon, x + 5, y + 5) love.graphics.draw(icon, x + 5, y + 5)
love.graphics.setColor(namecolor) love.graphics.setColor(namecolor)
love.graphics.print(name, x + iconwidth + 10, y + 5) love.graphics.print(name, x + iconwidth + 10, y + 5)
@ -289,10 +289,10 @@ function skin.DrawFrame(object)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
love.graphics.setColor(255, 255, 255, 70) love.graphics.setColor(255/255, 255/255, 255/255, 70/255)
skin.OutlinedRectangle(x + 1, y + 1, width - 2, 24) skin.OutlinedRectangle(x + 1, y + 1, width - 2, 24)
love.graphics.setColor(220, 220, 220, 255) love.graphics.setColor(220/255, 220/255, 220/255, 255/255)
skin.OutlinedRectangle(x + 1, y + 25, width - 2, height - 26) skin.OutlinedRectangle(x + 1, y + 25, width - 2, height - 26)
end end
@ -326,7 +326,7 @@ function skin.DrawButton(object)
if not enabled or not clickable then if not enabled or not clickable then
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(skin.images["button-unclickable.png"], x, y, 0, width, scaley) love.graphics.draw(skin.images["button-unclickable.png"], x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
@ -342,7 +342,7 @@ function skin.DrawButton(object)
if hover then if hover then
if down then if down then
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(skin.images["button-down.png"], x, y, 0, width, scaley) love.graphics.draw(skin.images["button-down.png"], x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
@ -353,7 +353,7 @@ function skin.DrawButton(object)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
else else
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image_hover, x, y, 0, width, scaley) love.graphics.draw(image_hover, x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
@ -366,7 +366,7 @@ function skin.DrawButton(object)
else else
if object.toggle then if object.toggle then
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(skin.images["button-down.png"], x, y, 0, width, scaley) love.graphics.draw(skin.images["button-down.png"], x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
@ -377,7 +377,7 @@ function skin.DrawButton(object)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
else else
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(skin.images["button-nohover.png"], x, y, 0, width, scaley) love.graphics.draw(skin.images["button-nohover.png"], x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
@ -391,12 +391,12 @@ function skin.DrawButton(object)
else else
if down or checked then if down or checked then
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(skin.images["button-down.png"], x, y, 0, width, scaley) love.graphics.draw(skin.images["button-down.png"], x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
if object.image then if object.image then
love.graphics.setColor(255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255)
love.graphics.draw(object.image, x + 2, y + height/2 - object.image:getHeight()/2) love.graphics.draw(object.image, x + 2, y + height/2 - object.image:getHeight()/2)
love.graphics.setColor(textdowncolor) love.graphics.setColor(textdowncolor)
local text = object.text local text = object.text
@ -415,12 +415,12 @@ function skin.DrawButton(object)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
elseif hover then elseif hover then
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image_hover, x, y, 0, width, scaley) love.graphics.draw(image_hover, x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
if object.image then if object.image then
love.graphics.setColor(255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255)
love.graphics.draw(object.image, x + 2, y + height/2 - object.image:getHeight()/2) love.graphics.draw(object.image, x + 2, y + height/2 - object.image:getHeight()/2)
love.graphics.setColor(texthovercolor) love.graphics.setColor(texthovercolor)
local text = object.text local text = object.text
@ -439,12 +439,12 @@ function skin.DrawButton(object)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
else else
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(skin.images["button-nohover.png"], x, y, 0, width, scaley) love.graphics.draw(skin.images["button-nohover.png"], x, y, 0, width, scaley)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
if object.image then if object.image then
love.graphics.setColor(255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255)
love.graphics.draw(object.image, object:GetX() + 2, object:GetY() + object:GetHeight()/2 - object.image:getHeight()/2) love.graphics.draw(object.image, object:GetX() + 2, object:GetY() + object:GetHeight()/2 - object.image:getHeight()/2)
love.graphics.setColor(textnohovercolor) love.graphics.setColor(textnohovercolor)
local text = object.text local text = object.text
@ -464,7 +464,7 @@ function skin.DrawButton(object)
end end
end end
love.graphics.setColor(255, 255, 255, 150) love.graphics.setColor(255/255, 255/255, 255/255, 150/255)
skin.OutlinedRectangle(x + 1, y + 1, width - 2, height - 2) skin.OutlinedRectangle(x + 1, y + 1, width - 2, height - 2)
end end
@ -533,7 +533,7 @@ function skin.DrawImage(object)
love.graphics.setColor(color) love.graphics.setColor(color)
love.graphics.draw(image, x, y, orientation, scalex, scaley, offsetx, offsety, shearx, sheary) love.graphics.draw(image, x, y, orientation, scalex, scaley, offsetx, offsety, shearx, sheary)
else else
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, orientation, scalex, scaley, offsetx, offsety, shearx, sheary) love.graphics.draw(image, x, y, orientation, scalex, scaley, offsetx, offsety, shearx, sheary)
end end
@ -553,7 +553,7 @@ function skin.DrawImageButton(object)
local text = object:GetText() local text = object:GetText()
local hover = object:GetHover() local hover = object:GetHover()
local image = object:GetImage() local image = object:GetImage()
local imagecolor = object.imagecolor or {255, 255, 255, 255} local imagecolor = object.imagecolor or {255/255, 255/255, 255/255, 255/255}
local down = object.down local down = object.down
local font = skin.controls.imagebutton_text_font local font = skin.controls.imagebutton_text_font
local twidth = font:getWidth(object.text) local twidth = font:getWidth(object.text)
@ -569,7 +569,7 @@ function skin.DrawImageButton(object)
love.graphics.draw(image, x + 1, y + 1) love.graphics.draw(image, x + 1, y + 1)
end end
love.graphics.setFont(font) love.graphics.setFont(font)
love.graphics.setColor(0, 0, 0, 255) love.graphics.setColor(0, 0, 0, 255/255)
love.graphics.print(text, x + width/2 - twidth/2 + 1, y + height - theight - 5 + 1) love.graphics.print(text, x + width/2 - twidth/2 + 1, y + height - theight - 5 + 1)
love.graphics.setColor(textdowncolor) love.graphics.setColor(textdowncolor)
love.graphics.print(text, x + width/2 - twidth/2 + 1, y + height - theight - 6 + 1) love.graphics.print(text, x + width/2 - twidth/2 + 1, y + height - theight - 6 + 1)
@ -579,7 +579,7 @@ function skin.DrawImageButton(object)
love.graphics.draw(image, x, y) love.graphics.draw(image, x, y)
end end
love.graphics.setFont(font) love.graphics.setFont(font)
love.graphics.setColor(0, 0, 0, 255) love.graphics.setColor(0, 0, 0, 255/255)
love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 5) love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 5)
love.graphics.setColor(texthovercolor) love.graphics.setColor(texthovercolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 6) love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 6)
@ -589,7 +589,7 @@ function skin.DrawImageButton(object)
love.graphics.draw(image, x, y) love.graphics.draw(image, x, y)
end end
love.graphics.setFont(font) love.graphics.setFont(font)
love.graphics.setColor(0, 0, 0, 255) love.graphics.setColor(0, 0, 0, 255/255)
love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 5) love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 5)
love.graphics.setColor(textnohovercolor) love.graphics.setColor(textnohovercolor)
love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 6) love.graphics.print(text, x + width/2 - twidth/2, y + height - theight - 6)
@ -631,7 +631,7 @@ function skin.DrawProgressBar(object)
-- progress bar body -- progress bar body
love.graphics.setColor(bodycolor) love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height) love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, barwidth, scaley) love.graphics.draw(image, x, y, 0, barwidth, scaley)
love.graphics.setFont(font) love.graphics.setFont(font)
love.graphics.setColor(textcolor) love.graphics.setColor(textcolor)
@ -693,7 +693,7 @@ function skin.DrawScrollBar(object)
local image = skin.images["button-down.png"] local image = skin.images["button-down.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
@ -701,7 +701,7 @@ function skin.DrawScrollBar(object)
local image = skin.images["button-hover.png"] local image = skin.images["button-hover.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
@ -709,7 +709,7 @@ function skin.DrawScrollBar(object)
local image = skin.images["button-nohover.png"] local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
@ -751,7 +751,7 @@ function skin.DrawPanel(object)
love.graphics.setColor(bodycolor) love.graphics.setColor(bodycolor)
love.graphics.rectangle("fill", x, y, width, height) love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setColor(255, 255, 255, 200) love.graphics.setColor(255/255, 255/255, 255/255, 200/255)
skin.OutlinedRectangle(x + 1, y + 1, width - 2, height - 2) skin.OutlinedRectangle(x + 1, y + 1, width - 2, height - 2)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -872,14 +872,14 @@ function skin.DrawTabButton(object)
local gradient = skin.images["button-hover.png"] local gradient = skin.images["button-hover.png"]
local gradientheight = gradient:getHeight() local gradientheight = gradient:getHeight()
local scaley = height/gradientheight local scaley = height/gradientheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(gradient, x, y, 0, width, scaley) love.graphics.draw(gradient, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
if image then if image then
-- button image -- button image
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x + 5, y + height/2 - imageheight/2) love.graphics.draw(image, x + 5, y + height/2 - imageheight/2)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
@ -896,14 +896,14 @@ function skin.DrawTabButton(object)
local gradient = skin.images["button-nohover.png"] local gradient = skin.images["button-nohover.png"]
local gradientheight = gradient:getHeight() local gradientheight = gradient:getHeight()
local scaley = height/gradientheight local scaley = height/gradientheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(gradient, x, y, 0, width, scaley) love.graphics.draw(gradient, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
if image then if image then
-- button image -- button image
love.graphics.setColor(255, 255, 255, 150) love.graphics.setColor(255/255, 255/255, 255/255, 150/255)
love.graphics.draw(image, x + 5, y + height/2 - imageheight/2) love.graphics.draw(image, x + 5, y + height/2 - imageheight/2)
-- button text -- button text
love.graphics.setFont(font) love.graphics.setFont(font)
@ -952,7 +952,7 @@ function skin.DrawMultiChoice(object)
love.graphics.print(choice, x + 5, y + height/2 - theight/2) love.graphics.print(choice, x + 5, y + height/2 - theight/2)
end end
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x + width - 20, y + 5) love.graphics.draw(image, x + width - 20, y + 5)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1211,7 +1211,7 @@ function skin.DrawTextInput(object)
love.graphics.print(#str > 0 and str or placeholder, textx, texty) love.graphics.print(#str > 0 and str or placeholder, textx, texty)
end end
love.graphics.setColor(230, 230, 230, 255) love.graphics.setColor(230/255, 230/255, 230/255, 255/255)
skin.OutlinedRectangle(x + 1, y + 1, width - 2, height - 2) skin.OutlinedRectangle(x + 1, y + 1, width - 2, height - 2)
end end
@ -1256,7 +1256,7 @@ function skin.DrawScrollButton(object)
local image = skin.images["button-down.png"] local image = skin.images["button-down.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1267,7 +1267,7 @@ function skin.DrawScrollButton(object)
local image = skin.images["button-hover.png"] local image = skin.images["button-hover.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1277,7 +1277,7 @@ function skin.DrawScrollButton(object)
local image = skin.images["button-nohover.png"] local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1290,9 +1290,9 @@ function skin.DrawScrollButton(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
image:setFilter("nearest", "nearest") image:setFilter("nearest", "nearest")
if hover then if hover then
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
else else
love.graphics.setColor(255, 255, 255, 150) love.graphics.setColor(255/255, 255/255, 255/255, 150/255)
end end
love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2) love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2)
elseif scrolltype == "down" then elseif scrolltype == "down" then
@ -1301,9 +1301,9 @@ function skin.DrawScrollButton(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
image:setFilter("nearest", "nearest") image:setFilter("nearest", "nearest")
if hover then if hover then
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
else else
love.graphics.setColor(255, 255, 255, 150) love.graphics.setColor(255/255, 255/255, 255/255, 150/255)
end end
love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2) love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2)
elseif scrolltype == "left" then elseif scrolltype == "left" then
@ -1312,9 +1312,9 @@ function skin.DrawScrollButton(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
image:setFilter("nearest", "nearest") image:setFilter("nearest", "nearest")
if hover then if hover then
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
else else
love.graphics.setColor(255, 255, 255, 150) love.graphics.setColor(255/255, 255/255, 255/255, 150/255)
end end
love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2) love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2)
elseif scrolltype == "right" then elseif scrolltype == "right" then
@ -1323,9 +1323,9 @@ function skin.DrawScrollButton(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
image:setFilter("nearest", "nearest") image:setFilter("nearest", "nearest")
if hover then if hover then
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
else else
love.graphics.setColor(255, 255, 255, 150) love.graphics.setColor(255/255, 255/255, 255/255, 150/255)
end end
love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2) love.graphics.draw(image, x + width/2 - imagewidth/2, y + height/2 - imageheight/2)
end end
@ -1384,7 +1384,7 @@ function skin.DrawSliderButton(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
-- button body -- button body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1397,7 +1397,7 @@ function skin.DrawSliderButton(object)
local image = skin.images["button-down.png"] local image = skin.images["button-down.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1407,7 +1407,7 @@ function skin.DrawSliderButton(object)
local image = skin.images["button-hover.png"] local image = skin.images["button-hover.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1417,7 +1417,7 @@ function skin.DrawSliderButton(object)
local image = skin.images["button-nohover.png"] local image = skin.images["button-nohover.png"]
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- button border -- button border
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1520,27 +1520,27 @@ function skin.DrawCollapsibleCategory(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(topbarimage, x, y, 0, topbarimage_scalex, topbarimage_scaley) love.graphics.draw(topbarimage, x, y, 0, topbarimage_scalex, topbarimage_scaley)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
skin.OutlinedRectangle(x, y, width, height) skin.OutlinedRectangle(x, y, width, height)
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
if open then if open then
local icon = skin.images["collapse.png"] local icon = skin.images["collapse.png"]
icon:setFilter("nearest", "nearest") icon:setFilter("nearest", "nearest")
love.graphics.draw(icon, x + width - 21, y + 5) love.graphics.draw(icon, x + width - 21, y + 5)
love.graphics.setColor(255, 255, 255, 70) love.graphics.setColor(255/255, 255/255, 255/255, 70/255)
skin.OutlinedRectangle(x + 1, y + 1, width - 2, 24) skin.OutlinedRectangle(x + 1, y + 1, width - 2, 24)
else else
local icon = skin.images["expand.png"] local icon = skin.images["expand.png"]
icon:setFilter("nearest", "nearest") icon:setFilter("nearest", "nearest")
love.graphics.draw(icon, x + width - 21, y + 5) love.graphics.draw(icon, x + width - 21, y + 5)
love.graphics.setColor(255, 255, 255, 70) love.graphics.setColor(255/255, 255/255, 255/255, 70/255)
skin.OutlinedRectangle(x + 1, y + 1, width - 2, 23) skin.OutlinedRectangle(x + 1, y + 1, width - 2, 23)
end end
@ -1598,7 +1598,7 @@ function skin.DrawColumnListHeader(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
-- header body -- header body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- header name -- header name
love.graphics.setFont(font) love.graphics.setFont(font)
@ -1612,7 +1612,7 @@ function skin.DrawColumnListHeader(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
-- header body -- header body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- header name -- header name
love.graphics.setFont(font) love.graphics.setFont(font)
@ -1626,7 +1626,7 @@ function skin.DrawColumnListHeader(object)
local imageheight = image:getHeight() local imageheight = image:getHeight()
local scaley = height/imageheight local scaley = height/imageheight
-- header body -- header body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
-- header name -- header name
love.graphics.setFont(font) love.graphics.setFont(font)
@ -1665,7 +1665,7 @@ function skin.DrawColumnListArea(object)
local scaley = cheight/image:getHeight() local scaley = cheight/image:getHeight()
-- header body -- header body
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, x, y, 0, width, scaley) love.graphics.draw(image, x, y, 0, width, scaley)
love.graphics.setColor(bordercolor) love.graphics.setColor(bordercolor)
@ -1941,7 +1941,7 @@ function skin.DrawMenuOption(object)
if option_type == "divider" then if option_type == "divider" then
love.graphics.setColor(200, 200, 200, 255) love.graphics.setColor(200/255, 200/255, 200/255, 255/255)
love.graphics.rectangle("fill", x + 4, y + 2, width - 8, 1) love.graphics.rectangle("fill", x + 4, y + 2, width - 8, 1)
object.contentheight = 10 object.contentheight = 10
else else
@ -1956,7 +1956,7 @@ function skin.DrawMenuOption(object)
love.graphics.print(text, x + 26, y + 5) love.graphics.print(text, x + 26, y + 5)
end end
if icon then if icon then
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(icon, x + 5, y + 5) love.graphics.draw(icon, x + 5, y + 5)
end end
object.contentwidth = twidth + 31 object.contentwidth = twidth + 31
@ -1973,7 +1973,7 @@ function skin.DrawTree(object)
local width = object:GetWidth() local width = object:GetWidth()
local height = object:GetHeight() local height = object:GetHeight()
love.graphics.setColor(200, 200, 200, 255) love.graphics.setColor(200/255, 200/255, 200/255, 255/255)
love.graphics.rectangle("fill", x, y, width, height) love.graphics.rectangle("fill", x, y, width, height)
end end
@ -2001,15 +2001,15 @@ function skin.DrawTreeNode(object)
local theight = loveframes.basicfont:getHeight(object.text) local theight = loveframes.basicfont:getHeight(object.text)
if object.tree.selectednode == object then if object.tree.selectednode == object then
love.graphics.setColor(102, 140, 255, 255) love.graphics.setColor(102/255, 140/255, 255/255, 255/255)
love.graphics.rectangle("fill", x + leftpadding + 2 + iconwidth, object.y + 2, twidth, theight) love.graphics.rectangle("fill", x + leftpadding + 2 + iconwidth, object.y + 2, twidth, theight)
end end
width = width + iconwidth + loveframes.basicfont:getWidth(object.text) + leftpadding width = width + iconwidth + loveframes.basicfont:getWidth(object.text) + leftpadding
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(icon, x + leftpadding, object.y) love.graphics.draw(icon, x + leftpadding, object.y)
love.graphics.setFont(loveframes.basicfont) love.graphics.setFont(loveframes.basicfont)
love.graphics.setColor(0, 0, 0, 255) love.graphics.setColor(0, 0, 0, 255/255)
love.graphics.print(object.text, x + leftpadding + 2 + iconwidth, object.y + 2) love.graphics.print(object.text, x + leftpadding + 2 + iconwidth, object.y + 2)
object:SetWidth(width + 5) object:SetWidth(width + 5)
@ -2029,7 +2029,7 @@ function skin.DrawTreeNodeButton(object)
image:setFilter("nearest", "nearest") image:setFilter("nearest", "nearest")
love.graphics.setColor(255, 255, 255, 255) love.graphics.setColor(255/255, 255/255, 255/255, 255/255)
love.graphics.draw(image, object.x, object.y) love.graphics.draw(image, object.x, object.y)
object:SetPos(2 + leftpadding, 3) object:SetPos(2 + leftpadding, 3)

View File

@ -20,27 +20,27 @@ skin.base = "Blue"
skin.controls = {} skin.controls = {}
-- multichoicerow -- multichoicerow
skin.controls.multichoicerow_body_hover_color = {255, 153, 0, 255} skin.controls.multichoicerow_body_hover_color = {255/255, 153/255, 0, 255/255}
-- slider -- slider
skin.controls.slider_bar_outline_color = {220, 220, 220, 255} skin.controls.slider_bar_outline_color = {220/255, 220/255, 220/255, 255/255}
-- checkbox -- checkbox
skin.controls.checkbox_check_color = {255, 153, 0, 255} skin.controls.checkbox_check_color = {255/255, 153/255, 0, 255/255}
-- radiobutton -- radiobutton
skin.controls.radiobutton_body_color = {255, 255, 255, 255} skin.controls.radiobutton_body_color = {255/255, 255/255, 255/255, 255/255}
skin.controls.radiobutton_check_color = {255, 153, 0, 255} skin.controls.radiobutton_check_color = {255/255, 153/255, 0, 255/255}
skin.controls.radiobutton_inner_border_color = {204, 122, 0, 255} skin.controls.radiobutton_inner_border_color = {204/255, 122/255, 0, 255/255}
skin.controls.radiobutton_text_font = smallfont skin.controls.radiobutton_text_font = smallfont
-- columnlistrow -- columnlistrow
skin.controls.columnlistrow_body_selected_color = {255, 153, 0, 255} skin.controls.columnlistrow_body_selected_color = {255/255, 153/255, 0, 255/255}
skin.controls.columnlistrow_body_hover_color = {255, 173, 51, 255} skin.controls.columnlistrow_body_hover_color = {255/255, 173/255, 51/255, 255/255}
-- menuoption -- menuoption
skin.controls.menuoption_body_hover_color = {255, 153, 0, 255} skin.controls.menuoption_body_hover_color = {255/255, 153/255, 0, 255/255}
-- register the skin -- register the skin
loveframes.skins.Register(skin) loveframes.skins.Register(skin)