Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyhorgan authored Jul 22, 2021
1 parent 6b2eb31 commit f8d37aa
Show file tree
Hide file tree
Showing 56 changed files with 12,654 additions and 0 deletions.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chmod 777 love && ./love installer
Binary file added installer/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 152 additions & 0 deletions installer/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
local nuklear = require "nuklear"

function love.load()
ui = nuklear.newUI()

WIDTH = 250
HEIGHT = 590

love.window.setMode(WIDTH, HEIGHT)

icon = love.image.newImageData("icon.png")

love.window.setIcon(icon)

love.window.setTitle("Lovely Engine Installer")

win32 = {value = false}
win64 = {value = false}
macos = {value = false}
linux32 = {value = false}
linux64 = {value = false}
web = {value = false}
lite = {value = false}
novels = {value = false}
end

function install()
os.execute("git clone https://github.com/vinnyhorgan/lovely-utility")

if win32["value"] == true then
os.execute("mkdir -p ./export")
os.execute("tar -xvf ./lovely-utility/win32.tar.xz")
os.execute("mv win32 ./export")
end

if win64["value"] == true then
os.execute("mkdir -p ./export")
os.execute("tar -xvf ./lovely-utility/win64.tar.xz")
os.execute("mv win64 ./export")
end

if macos["value"] == true then
os.execute("mkdir -p ./export")
os.execute("tar -xvf ./lovely-utility/macos.tar.xz")
os.execute("mv macos ./export")
end

if linux32["value"] == true then
os.execute("mkdir -p ./export")
os.execute("tar -xvf ./lovely-utility/linux32.tar.xz")
os.execute("mv linux32 ./export")
end

if linux64["value"] == true then
os.execute("mkdir -p ./export")
os.execute("tar -xvf ./lovely-utility/linux64.tar.xz")
os.execute("mv linux64 ./export")
end

if web["value"] == true then
os.execute("mkdir -p ./export")
os.execute("tar -xvf ./lovely-utility/web.tar.xz")
os.execute("mv web ./export")
end

if lite["value"] == true then
os.execute("mkdir -p ./plugins")
os.execute("tar -xvf ./lovely-utility/lite.tar.xz")
os.execute("mv ./lite/lite.lua ./plugins")
end

if novels["value"] == true then
os.execute("mkdir -p ./plugins")
os.execute("tar -xvf ./lovely-utility/novels.tar.xz")
os.execute("mv ./novels/novels.lua ./plugins")
end

os.execute("rm -rf lovely-utility")
end

function love.update(dt)
ui:frameBegin()

if ui:windowBegin("", 0, 0, WIDTH, HEIGHT, "border") then
ui:layoutRow("dynamic", 30, 1)

ui:label("INSTALL PACKAGES", "centered")

ui:spacing(1)

ui:label("EXPORT TEMPLATES")

ui:spacing(1)

ui:checkbox("Windows x86", win32)
ui:checkbox("Windows x86_64", win64)
ui:checkbox("MacOS", macos)
ui:checkbox("Linux x86", linux32)
ui:checkbox("Linux x86_64", linux64)
ui:checkbox("Web", web)

ui:spacing(1)

ui:label("PLUGINS")

ui:spacing(1)

ui:checkbox("Lite Editor Plugin", lite)
ui:checkbox("Novels Plugin", novels)

ui:spacing(1)

if ui:button("Install") then
install()
end
end
ui:windowEnd()

ui:frameEnd()
end

function love.draw()
ui:draw()
end

function love.keypressed(key, scancode, isrepeat)
ui:keypressed(key, scancode, isrepeat)
end

function love.keyreleased(key, scancode)
ui:keyreleased(key, scancode)
end

function love.mousepressed(x, y, button, istouch, presses)
ui:mousepressed(x, y, button, istouch, presses)
end

function love.mousereleased(x, y, button, istouch, presses)
ui:mousereleased(x, y, button, istouch, presses)
end

function love.mousemoved(x, y, dx, dy, istouch)
ui:mousemoved(x, y, dx, dy, istouch)
end

function love.textinput(text)
ui:textinput(text)
end

function love.wheelmoved(x, y)
ui:wheelmoved(x, y)
end
Binary file added installer/nuklear.so
Binary file not shown.
90 changes: 90 additions & 0 deletions libs/log.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
--
-- log.lua
--
-- Copyright (c) 2016 rxi
--
-- This library is free software; you can redistribute it and/or modify it
-- under the terms of the MIT license. See LICENSE for details.
--

local log = { _version = "0.1.0" }

log.usecolor = true
log.outfile = nil
log.level = "trace"


local modes = {
{ name = "trace", color = "\27[34m", },
{ name = "debug", color = "\27[36m", },
{ name = "info", color = "\27[32m", },
{ name = "warn", color = "\27[33m", },
{ name = "error", color = "\27[31m", },
{ name = "fatal", color = "\27[35m", },
}


local levels = {}
for i, v in ipairs(modes) do
levels[v.name] = i
end


local round = function(x, increment)
increment = increment or 1
x = x / increment
return (x > 0 and math.floor(x + .5) or math.ceil(x - .5)) * increment
end


local _tostring = tostring

local tostring = function(...)
local t = {}
for i = 1, select('#', ...) do
local x = select(i, ...)
if type(x) == "number" then
x = round(x, .01)
end
t[#t + 1] = _tostring(x)
end
return table.concat(t, " ")
end


for i, x in ipairs(modes) do
local nameupper = x.name:upper()
log[x.name] = function(...)

-- Return early if we're below the log level
if i < levels[log.level] then
return
end

local msg = tostring(...)
local info = debug.getinfo(2, "Sl")
local lineinfo = info.short_src .. ":" .. info.currentline

-- Output to console
print(string.format("%s[%-6s%s]%s %s: %s",
log.usecolor and x.color or "",
nameupper,
os.date("%H:%M:%S"),
log.usecolor and "\27[0m" or "",
lineinfo,
msg))

-- Output to log file
if log.outfile then
local fp = io.open(log.outfile, "a")
local str = string.format("[%-6s%s] %s: %s\n",
nameupper, os.date(), lineinfo, msg)
fp:write(str)
fp:close()
end

end
end


return log
Binary file added love
Binary file not shown.
Loading

0 comments on commit f8d37aa

Please sign in to comment.