lots of changes

This commit is contained in:
Ryan Ward 2019-07-15 21:04:41 -04:00
parent 63f3f165ca
commit 2e19a444da
1016 changed files with 1939 additions and 34 deletions

View File

@ -36,12 +36,12 @@ new=function(r,b,g)
__unm = function (c1)
return Color.new(-c1[1],-c1[2],-c1[2])
end,
__tostring = function(c)
return "("..c[1]..","..c[2]..","..c[3]..")"
end,
__eq = Color.EQ,
__lt = Color.LT,
__le = Color.LE,
__tostring = function(self)
return "("..self[1] ..","..self[1] ..","..self[1] ..")"
end
}
local temp = {r/255,b/255,g/255,1}
setmetatable(temp, mt)
@ -63,23 +63,27 @@ IndexColor=function(name,r,b,g)
if type(r)=="string" then
r,b,g=tonumber(string.sub(r,1,2),16),tonumber(string.sub(r,3,4),16),tonumber(string.sub(r,5,6),16)
end
Color[string.lower(name)]=Color.new(r,b,g)
Color[string.upper(name)]=Color.new(r,b,g)
Color[string.upper(string.sub(name,1,1))..string.lower(string.sub(name,2))]=Color.new(r,b,g)
_Color[string.lower(name)]=Color.new(r,b,g)
_Color[string.upper(name)]=Color.new(r,b,g)
_Color[string.upper(string.sub(name,1,1))..string.lower(string.sub(name,2))]=Color.new(r,b,g)
end,
Darken=function(color,v)
currentR=color[1]
currentG=color[2]
currentB=color[3]
return Color.new((currentR*255) * (1 - v),(currentG*255) * (1 - v),(currentB*255) * (1 - v))
return Color.new((color[1]*255) * (1 - v),(color[2]*255) * (1 - v),(color[3]*255) * (1 - v))
end,
Lighten=function(color,v)
currentR=color[1]
currentG=color[2]
currentB=color[3]
return Color.new(currentR*255 + (255 - (currentR*255)) * v,currentG*255 + (255 - (currentG*255)) * v,currentB*255 + (255 - (currentB*255)) * v)
return Color.new(color[1]*255 + (255 - (color[1]*255)) * v,color[2]*255 + (255 - (color[2]*255)) * v,color[3]*255 + (255 - (color[3]*255)) * v)
end
}
_Color = {}
setmetatable(Color,{
__index = function(self,k)
local c = _Color[k]
return Color.new(c[1]*255,c[2]*255,c[3]*255)
end,
})
Color.IndexColor("Black",20,20,20)
Color.IndexColor("WHITE",255,255,255)
Color.IndexColor("MAROON",128,20,20)

View File

@ -54,8 +54,11 @@ function gui:Clickable()
if not(x) then
return true
end
if self.isclipped then
return not(mx>x+w or mx<x or my>y+h or my<y)
end
return true
end
function gui:canPress()
local ref = self
if self.ClipReference then ref = self.ClipReference end

View File

@ -17,13 +17,16 @@ function gui:drawR()
self.height=(self.Parent.height*self.scale.size.y)+self.offset.size.y
local b=true
for i,v in pairs(_GuiPro.Clips) do
if self:isDescendant(v)==true then
if self:isDescendant(v) then
b=false
end
end
if b==true then
self.isclipped = false
if b then
love.graphics.setStencilTest()
love.graphics.setScissor()
else
self.isclipped = true
end
if self.DrawRulesB then
for dr=1,#self.DrawRulesB do
@ -54,21 +57,17 @@ 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)
end
if string.find(self.Type, "Text") 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)
if self.text~=nil and self.TextFormat == "center" then
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)
elseif self.text~=nil and self.TextFormat == "middlecenter" then
love.graphics.printf(self.text, self.x + (self.XTween or 0), self.y+(self.height-self.Font:getHeight())/2, self.width, "center",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

View File

@ -5,10 +5,11 @@ function gui:newImageButton(i,name, x, y, w, h, sx ,sy ,sw ,sh)
c.Visibility=0
c.ImageVisibility=1
c.rotation=0
c:OnEnter(function()
c.BorderSize = 0
c:OnMouseEnter(function()
love.mouse.setCursor(_GuiPro.CursorH)
end)
c:OnExit(function()
c:OnMouseExit(function()
love.mouse.setCursor(_GuiPro.CursorN)
end)
return c

View File

@ -6,5 +6,6 @@ function gui:newImageLabel(i,name, x, y, w, h, sx ,sy ,sw ,sh)
c.Visibility=0
c.ImageVisibility=1
c.rotation=0
c.BorderSize = 0
return c
end

View File

@ -1,4 +1,4 @@
function gui:newScrollMenu(name)
function gui:newScrollMenu(name,SC,MC)
local temp = self:newFullFrame(name)
temp.ref = {
[[setNewFont(16)]],
@ -9,10 +9,13 @@ function gui:newScrollMenu(name)
temp.Visibility = 0
local ScrollY = temp:newFrame(name.."ScrollY",-20,0,20,0,1,0,0,1)
temp.scroll = ScrollY
ScrollY.Color=Color.new(80,80,80)
local cc = self.Color
local c1,c2=Color.new(cc[1]*255,cc[2]*255,cc[3]*255),Color.new(cc[1]*255+20,cc[2]*255+20,cc[3]*255+20)
print(cc[1]-20,cc[2]-20,cc[3]-20)
ScrollY.Color=SC or c1
ScrollY.allowOverlapping = true
ScrollY.Mover = ScrollY:newFrame(name.."MoverY",5,5,10,80)
ScrollY.Mover.Color = Color.new(60,60,60)
ScrollY.Mover.Color = MC or c2
local func = function(b,self,x,y,nn)
temp.symbolicY = y
if y>45 and y<self.height-45 then
@ -65,17 +68,29 @@ function gui:newScrollMenu(name)
local height = height or 30
temp.max = temp.max + padding-- + height
if obj then
obj:SetDualDim(nil,temp.max-padding,nil,height,nil,nil,1)
obj:SetDualDim(0,temp.max-padding+padding,0,height,0,0,1)
obj:setParent(self.first)
end
local c = obj or self.first:newTextLabel(text,text,0,temp.max-padding,0,height,0,0,1)
local c = obj or self.first:newTextLabel(text,text,0,temp.max-padding+padding,0,height,0,0,1)
if not obj then
c:Mutate(temp.ref)
end
c.adjustment = padding + height
temp.max = temp.max + height
c.staticpos = temp.max
c.LID = #temp.list
temp.list[#temp.list+1] = c
return c
end
function temp:removeItem(obj)
local id = obj.LID
if not id then error("GUI object is not part of this menu!") end
self.max = self.max - obj.adjustment
local adj = obj.adjustment
obj:Destroy()
for i = id+1,#self.list do
self.list[i]:setDualDim(nil,self.list[i].offset.pos.y-adj)
end
end
return temp
end

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

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