Skip to content

Commit

Permalink
Merge pull request #647 from qixils/color-revert
Browse files Browse the repository at this point in the history
Revert color updates in favor of global color conversion functions
  • Loading branch information
alesan99 authored Aug 21, 2024
2 parents d612fcd + de1f6b0 commit 39d3e63
Show file tree
Hide file tree
Showing 78 changed files with 1,461 additions and 1,311 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ jobs:
id: build-android
uses: qixils/love-actions-android@v1
with:
app-name: "Mari0: AE"
app-name: ${{ steps.metadata.outputs.title }}
bundle-id: love.to.androidmari0 # backwards compatibility
product-name: ${{ steps.metadata.outputs.id }}
resource-path: "main/.android-resources"
love-ref: 11.5a
love-ref: 11.x
love-package: main/makelove-build/love/${{ env.ARTIFACT_NAME_LOVE }}
remote-libs: "https://github.com/qixils/lua-https"
version-string: ${{ steps.metadata.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion JSON.lua
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ local function grok_array(self, text, start, etc)
return VALUE, i + 1
end
if text:sub(i, i) ~= ',' then
self:onDecodeError("expected comma or '['", text, i, etc)
self:onDecodeError("expected comma or ']'", text, i, etc)
end
i = skip_whitespace(text, i + 1)
end
Expand Down
2 changes: 1 addition & 1 deletion andgate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ end

function andgate:draw()
if self.visible then
love.graphics.setColor(1, 1, 1)
love.graphics.setColor(255, 255, 255)
love.graphics.draw(gateimg, gatequad[9], math.floor((self.x-1-xscroll)*16*scale), ((self.y-1-yscroll)*16-8)*scale, 0, scale, scale)
--love.graphics.draw(andgateimg, math.floor((self.x-1-xscroll)*16*scale), ((self.y-yscroll-1)*16-8)*scale, 0, scale, scale)
end
Expand Down
12 changes: 6 additions & 6 deletions android.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ function androidLoad()
buttons["portal1"].portal = true
buttons["portal2"] = touchButton:new("r", "2", t["portal2"][1],t["portal2"][2],t["portal2"][3],t["portal2"][4], "round")
buttons["portal2"].portal = true
buttons["portal1"].color = {60/255, 188/255, 252/255}
buttons["portal2"].color = {232/255, 130/255, 30/255}
buttons["portal1"].color = {60, 188, 252}
buttons["portal2"].color = {232, 130, 30}

-- shift keys to left
if fourbythree then
Expand Down Expand Up @@ -216,7 +216,7 @@ function androidDraw()
local x, y, w, h = skin["center"][1]:getViewport()
skinSpriteBatch:add(skin["center"][1], skinData["center"][1], skinData["center"][2], 0, skinData["center"][3]/w, skinData["center"][4]/h)
end
love.graphics.setColor(1,1,1)
love.graphics.setColor(255,255,255)
love.graphics.draw(skinSpriteBatch,0,0)
for name, b in pairs(buttons) do
if skinData.highlightonpress or not b.held then
Expand All @@ -231,12 +231,12 @@ function androidDraw()
end

--[[touch debug
love.graphics.setColor(1,0,0)
love.graphics.setColor(255,0,0)
local mx,my= androidGetCoords(mouseTouchX,mouseTouchY)
love.graphics.circle("fill",mx,my,2)
love.graphics.setColor(1,1,0)
love.graphics.setColor(255,255,0)
love.graphics.circle("fill",lastTouchX,lastTouchY,1)
love.graphics.setColor(0,1,1)
love.graphics.setColor(0,255,255)
love.graphics.circle("fill",lastReleaseX,lastReleaseY,1)]]

if not androidLowRes then
Expand Down
14 changes: 7 additions & 7 deletions androidbutton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,27 @@ function touchButton:draw(spriteBatch, quad)
love.graphics.setLineWidth(1)
end
if self.held then
love.graphics.setColor(100/255, 100/255, 100/255, 140/255)
love.graphics.setColor(100, 100, 100, 140)
elseif highlight then
love.graphics.setColor(90/255, 90/255, 90/255, 140/255)
love.graphics.setColor(90, 90, 90, 140)
elseif self.color then
love.graphics.setColor(self.color[1], self.color[2], self.color[3], 80/255)
love.graphics.setColor(self.color[1], self.color[2], self.color[3], 80)
else
love.graphics.setColor(30/255, 30/255, 30/255, 80/255)
love.graphics.setColor(30, 30, 30, 80)
end
if self.round then
local x, y, r = self.x+self.w/2, self.y+self.h/2,self.r
love.graphics.circle("fill", x, y, r, 8)
love.graphics.setColor(1, 1, 1, 140/255)
love.graphics.setColor(255, 255, 255, 140)
love.graphics.circle("line", x, y, r, 8)
else
local x, y, w, h = self.x, self.y, self.w, self.h
love.graphics.rectangle("fill", x, y, w, h)
love.graphics.setColor(1, 1, 1, 140/255)
love.graphics.setColor(255, 255, 255, 140)
love.graphics.rectangle("line", x+.5, y+.5, w, h)
end

love.graphics.setColor(1, 1, 1)
love.graphics.setColor(255, 255, 255)
if self.text then
properprintfast(self.text, math.floor(self.x+self.w/2-string.len(self.text)*4), math.floor(self.y+self.h/2-4))
elseif self.img then
Expand Down
2 changes: 1 addition & 1 deletion animation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ function animation:update(dt)
playmusic()
end
elseif v[1] == "changebackgroundcolor" then
love.graphics.setBackgroundColor((tonumber(v[2]) or 255)/255, (tonumber(v[3]) or 255)/255, (tonumber(v[4]) or 255)/255)
love.graphics.setBackgroundColor(tonumber(v[2]) or 255, tonumber(v[3]) or 255, tonumber(v[4]) or 255)
elseif v[1] == "killplayer" then
if v[2] == "everyone" then
for i = 1, players do
Expand Down
10 changes: 5 additions & 5 deletions animationguiline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1986,13 +1986,13 @@ function animationguiline:init(tabl, t2)
local firstwidth = 22--#animationstrings[self.type][start]

self.deletebutton = guielement:new("button", 0, 0, "x", function() self:delete() end, nil, nil, nil, 8, 0.1)
self.deletebutton.textcolor = {200/255, 0, 0}
self.deletebutton.textcolor = {200, 0, 0}

self.downbutton = guielement:new("button", 0, 0, "", function() self:movedown() end, nil, nil, nil, 8, 0.1)
self.downbutton.textcolor = {1, 1, 1}
self.downbutton.textcolor = {255, 255, 255}

self.upbutton = guielement:new("button", 0, 0, "", function() self:moveup() end, nil, nil, nil, 8, 0.1)
self.upbutton.textcolor = {1, 1, 1}
self.upbutton.textcolor = {255, 255, 255}

self.elements[1].gui = guielement:new("dropdown", 0, 0, firstwidth, function(val) self:changemainthing(val) end, start, unpack(animationstrings[self.type]))
self.elements[1].width = 14+firstwidth*8
Expand Down Expand Up @@ -2204,7 +2204,7 @@ end
function animationguiline:draw(x, y)
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("fill", x*scale, y*scale, (width*16-x)*scale, 11*scale)
love.graphics.setColor(1, 1, 1)
love.graphics.setColor(255, 255, 255)

local xadd = 0
self.deletebutton.x = x+xadd
Expand All @@ -2224,7 +2224,7 @@ function animationguiline:draw(x, y)

for i = 1, #self.elements do
if self.elements[i].t == "text" then
love.graphics.setColor(1, 1, 1)
love.graphics.setColor(255, 255, 255)
properprintF(self.elements[i].value, (x+xadd-1)*scale, (y+2)*scale)
xadd = xadd + self.elements[i].width
else
Expand Down
2 changes: 1 addition & 1 deletion belt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function drawbelt(x, y, length, i, color) --for editor
end
x, y = x-1, y-1
length = math.min(99, math.max(2, math.floor(tonumber(length or 3))))
love.graphics.setColor(1, 1, 1)
love.graphics.setColor(255, 255, 255)
love.graphics.draw(img, beltquad[row][1], math.floor((x-xscroll)*16*scale), math.floor((y-yscroll-.5)*16*scale), 0, scale, scale)
for i = 1, length-2 do
love.graphics.draw(img, beltquad[row][2], math.floor((x+i-xscroll)*16*scale), math.floor((y-yscroll-.5)*16*scale), 0, scale, scale)
Expand Down
4 changes: 2 additions & 2 deletions blocktogglebutton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ end

function blocktogglebutton:draw()
if not self.drawable then
love.graphics.setColor(1, 1, 1)
love.graphics.setColor(255, 255, 255)
love.graphics.draw(self.graphic, self.quad, math.floor(((self.x-xscroll)*16+self.offsetX)*scale), math.floor(((self.y-yscroll)*16-self.offsetY)*scale), self.rotation, scale, scale, self.quadcenterX, self.quadcenterY)
end
end
Expand Down Expand Up @@ -435,7 +435,7 @@ function buttonblock:init(x, y, color, solid)
end

function buttonblock:draw()
--love.graphics.setColor(1, 1, 1)
--love.graphics.setColor(255, 255, 255)
love.graphics.draw(self.graphic, self.quad, math.floor(((self.x-xscroll)*16+self.offsetX)*scale), math.floor(((self.y-yscroll)*16-self.offsetY)*scale), 0, scale, scale, self.quadcenterX, self.quadcenterY)
end

Expand Down
2 changes: 1 addition & 1 deletion cappy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function cappy:draw()
if self.hat == 1 then
love.graphics.setColor(self.player.colors[1])
else
love.graphics.setColor(1, 1, 1)
love.graphics.setColor(255, 255, 255)
end
local graphic = hat[self.hat].graphic
local quad = hat[self.hat].quad[1]
Expand Down
Loading

0 comments on commit 39d3e63

Please sign in to comment.