Changed the Gui interface, started working on debugging support

This commit is contained in:
Ryan Ward 2019-06-29 09:50:04 -04:00
parent abf90042e7
commit 59dc3d1da7
102 changed files with 157 additions and 75 deletions

View File

@ -59,7 +59,7 @@ end
function gui:canPress() function gui:canPress()
local ref = self local ref = self
if self.ClipReference then ref = self.ClipReference end if self.ClipReference then ref = self.ClipReference end
if self.Visible==true and self:parentVisible() and not(self:isBeingCovering()) then if self.Active and self.Visible==true and self:parentVisible() and not(self:isBeingCovering()) then
local x,y = love.mouse.getX(),love.mouse.getY() local x,y = love.mouse.getX(),love.mouse.getY()
if (x > ref.x and x < ref.x+ref.width and y > ref.y and y < ref.y+ref.height) and (x > self.x and x < self.x+self.width and y > self.y and y < self.y+self.height and self:Clickable() and (self:eventable() or self:touchable())) then if (x > ref.x and x < ref.x+ref.width and y > ref.y and y < ref.y+ref.height) and (x > self.x and x < self.x+self.width and y > self.y and y < self.y+self.height and self:Clickable() and (self:eventable() or self:touchable())) then
return true return true

View File

@ -54,14 +54,22 @@ function gui:drawR()
love.graphics.rectangle("line", self.x-(b/2), self.y-(b/2), self.width+b, self.height+b,(self.rx or 1)*self.DPI,(self.ry or 1)*self.DPI,(self.segments or 1)*self.DPI) love.graphics.rectangle("line", self.x-(b/2), self.y-(b/2), self.width+b, self.height+b,(self.rx or 1)*self.DPI,(self.ry or 1)*self.DPI,(self.segments or 1)*self.DPI)
end end
if string.find(self.Type, "Text") then if string.find(self.Type, "Text") then
if self.text~=nil and self.TextFormat ~= "center" then if self.text~=nil and self.TextFormat == "center" then
love.graphics.setColor(self.TextColor[1],self.TextColor[2],self.TextColor[3],self.TextVisibility)
love.graphics.setFont(self.Font)
love.graphics.printf(self.text, self.x, self.y, self.width, self.TextFormat,self.TextRotaion)
elseif self.text~=nil and self.TextFormat == "center" then
love.graphics.setColor(self.TextColor[1],self.TextColor[2],self.TextColor[3],self.TextVisibility) love.graphics.setColor(self.TextColor[1],self.TextColor[2],self.TextColor[3],self.TextVisibility)
love.graphics.setFont(self.Font) love.graphics.setFont(self.Font)
love.graphics.printf(self.text, self.x+(self.width-self.Font:getWidth(self.text))/2, self.y+(self.height-self.Font:getHeight())/2, self.width, "left",self.TextRotaion) love.graphics.printf(self.text, self.x+(self.width-self.Font:getWidth(self.text))/2, self.y+(self.height-self.Font:getHeight())/2, self.width, "left",self.TextRotaion)
elseif self.text~=nil and self.TextFormat == "middleleft" then
love.graphics.setColor(self.TextColor[1],self.TextColor[2],self.TextColor[3],self.TextVisibility)
love.graphics.setFont(self.Font)
love.graphics.printf(self.text, self.x + (self.XTween or 0), self.y+(self.height-self.Font:getHeight())/2, self.width, "left",self.TextRotaion)
elseif self.text~=nil and self.TextFormat == "middleright" then
love.graphics.setColor(self.TextColor[1],self.TextColor[2],self.TextColor[3],self.TextVisibility)
love.graphics.setFont(self.Font)
love.graphics.printf(self.text, self.x + (self.XTween or 0), self.y+(self.height-self.Font:getHeight())/2, self.width, "right",self.TextRotaion)
else
love.graphics.setColor(self.TextColor[1],self.TextColor[2],self.TextColor[3],self.TextVisibility)
love.graphics.setFont(self.Font)
love.graphics.printf(self.text, self.x + (self.XTween or 0), self.y, self.width, self.TextFormat,self.TextRotaion)
end end
end end
if self.DrawRulesE then if self.DrawRulesE then

View File

@ -32,7 +32,7 @@ _GuiPro.rotate=0
_defaultfont = love.graphics.setNewFont(12) _defaultfont = love.graphics.setNewFont(12)
setmetatable(_GuiPro, gui) setmetatable(_GuiPro, gui)
function gui:LoadInterface(file) function gui:LoadInterface(file)
local add=".int" local add=".lua"
if string.find(file,".",1,true) then add="" end if string.find(file,".",1,true) then add="" end
if love.filesystem.getInfo(file..add) then if love.filesystem.getInfo(file..add) then
a,b=pcall(love.filesystem.load(file..add)) a,b=pcall(love.filesystem.load(file..add))
@ -49,7 +49,7 @@ end
function gui.LoadAll(dir) function gui.LoadAll(dir)
files=love.filesystem.getDirectoryItems(dir) files=love.filesystem.getDirectoryItems(dir)
for i=1,#files do for i=1,#files do
if string.sub(files[i],-4)==".int" then if string.sub(files[i],-4)==".lua" then
gui:LoadInterface(dir.."/"..files[i]) gui:LoadInterface(dir.."/"..files[i])
end end
end end

View File

@ -1,66 +0,0 @@
return {
init = function(frame, parseManager, multi)
frame.Visibility = 0
local workspace = frame:newImageLabel(nil,"Workspace", 0,0,0,0,0,0,1,1)
workspace.Color = Color.Green
local HUD = frame:newFullFrame("HUD")
local go = false
HUD.Visibility = 0
local handle = parseManager:load("init.dms")
handle:define{
sleep = thread.sleep
}
local chat = HUD:newTextLabel("","",0,0,0,0,.5/40,31/40,39/40,1/5)
local name = chat:newTextLabel("Name","Name",0,0,80,0,0,-1.165/5,0,1/5)
name.Visible = false
name:fitFont()
name:widthToTextSize()
name:setRoundness(6,6,180)
local disp = chat:newTextLabel("","",15/2,15/2,-15,-15,0,0,1,1)
disp.TextFormat = "left"
disp.Font = name.Font
disp.Visibility = 0
disp.BorderSize = 0
chat:setRoundness(15,15,180)
workspace:OnReleased(function(b,self)
if b == "l" then
go = true
else
HUD.Visible = not HUD.Visible
end
end)
parseManager.print("\n"..handle:dump())
handle.__TEXT = function(text) -- change the default text stuff
local pan = false
local n,txt = text:match("([%w ]+):(.+)")
if n then
text = txt
name.text = n
name:widthToTextSize()
name.Visible = true
end
multi:newThread("UpdateText",function()
disp.text = ""
for i in text:gmatch(".") do
disp.text = disp.text .. i
thread.sleep(.05)
if go then disp.text = text go = false pan = true break end
end
pan = true
go = false
end)
thread.hold(function()
return pan
end)
pan = false
end
multi:newThread("Runner",function()
local active = true
while true do
thread.skip()
active = handle:think()
end
end)
return frame
end
}

View File

@ -0,0 +1,60 @@
local vncore = require("VNCore")
local multi = require("multi")
if not vncore.loaded then
error("The vncore module needs to be loaded and initiated before it can be used!")
end
local debug = {}
local taskmanagerDetails = {}
local debugF = gui:newFrame("DebugFrame",0,0,0,0,0,0,1,1)
debugF.Visibility = 0--.5
debugF.Color = Color.Black
vncore.getWorkspace().Active = false
vncore.getWorkspace().Visibility = 1
-- debugF.Visible = false
local taskmanager = debugF:newFrame("TaskManager",0,0,400,500,0,0)
taskmanager.scroll = taskmanager:newFrame("ScrollBar",-20,30,20,-60,1,0,0,1)
taskmanager.header = taskmanager:newTextLabel(" Task Manager","Task Manager",1,1,-2,29,0,0,1)
taskmanager.header.X = taskmanager.header:newTextButton("X","X",-25,5,20,20,1)
taskmanager.header.X.Color = Color.Red
taskmanager.header.X:setRoundness(4,4,60)
taskmanager.details = taskmanager:newTextLabel(" Details","",1,-31,-2,30,0,1,1)
taskmanager.header:AddDrawRuleE(function(self)
love.graphics.line(self.x, self.y+self.height, self.x+self.width, self.y+self.height)
end)
taskmanager.details:AddDrawRuleE(function(self)
love.graphics.line(self.x, self.y+1, self.x+self.width, self.y+1)
end)
--taskmanager.frame = taskmanager:new
taskmanager:setRoundness(8,8,180)
gui.massMutate({
TextFormat = "middleleft",
BorderSize = 0,
[[setRoundness(8,8,180)]],
},taskmanager.header,taskmanager.details)
taskmanager:centerX()
taskmanager:centerY()
function debug:show(frame)
vncore.getWorkspace().Active = false -- Prevents click events from functioning
if not frame then
-- Show the console
elseif frame == "tasks" then
-- Show the task manager
end
end
function debug:hide(frame)
vncore.getWorkspace().Active = true -- Reinstates the click events on the workspace
if not frame then
-- Hide everything
end
end
multi:newThread("DebugHandler",function()
while true do
thread.hold(function()
return debugF.Visible -- If the debug frame is not in view dont bother process any debug info
end)
thread.sleep(.1)
taskmanagerDetails = multi:getTasksDetails("t")
debugF:TopStack()
end
end)
return debug

Some files were not shown because too many files have changed in this diff Show More