Skip to content

Commit b84b4c0

Browse files
KirbyKid256qixils
andauthored
Fixed Certain Colors not Working (alesan99#615)
* Fixed Certain Colors and some Nitpicks The more important parts were fixing the custom background color in the menu, the dialogue text, enemy colors so Kirby would be fixed, and fixed not detecting half slants with the tiles. The rest are just nitpicks of mine like Toad's colors, P2 Mario's hat, the Ice Flower Entity Tooltip, and some global color var tweaking * Fixed Custom Powerup Colors Also fuck it I'm making `convertcolors` global, I'm gonna need that * fix: parse user input `curcolor` comes from user input along the lines of %rrr,ggg,bbb%; for backwards compatibility it needs to be parsed as 0..255 then converted to 0..1 --------- Co-authored-by: Lexi Larkin <[email protected]>
1 parent 095a0f0 commit b84b4c0

File tree

9 files changed

+22
-12
lines changed

9 files changed

+22
-12
lines changed

alesans_entities/characters/mario/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[134,112,0],
77
[252,151,58]],
88

9-
[[225,255,255],
9+
[[255,255,255],
1010
[0,168,0],
1111
[252,151,58]],
1212

alesans_entities/characters/toad/config.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
"defaultcolors": [
1515
[[252,252,252],
1616
[32,56,236],
17-
[252,151,58]],
17+
[252,152,56]],
1818

19-
[[225,255,255],
19+
[[252,252,252],
2020
[255,160,68],
21-
[252, 188, 176]],
21+
[252,152,56]],
2222

2323
[[252,252,252],
2424
[216,40,0],
25-
[252,151,58]],
25+
[252,152,56]],
2626

2727
[[252,252,252],
2828
[0,168,0],
29-
[252,151,58]]
29+
[252,152,56]]
3030
],
3131
"flowercolor": [[60,188,252], [216,40,0], [252,152,56]],
3232
"hammersuitcolor": [[252,252,252], [0,0,0], [252,152,56]],

characters.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local function iscolorvariable(key)
1313
return false
1414
end
1515

16-
local function convertcolors(table)
16+
function convertcolors(table)
1717
if table == nil or #table == 0 then
1818
return
1919
end

game.lua

+11-2
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,12 @@ function drawentity(j, w, i, v, currentscissor, drop)
30493049
else
30503050
if v.graphic and v.quad then
30513051
if v.graphiccolor and (not drop) then
3052-
love.graphics.setColor(v.graphiccolor)
3052+
local graphiccolor = {}
3053+
for gci = 1, #v.graphiccolor do
3054+
local color = tonumber(v.graphiccolor[gci])
3055+
graphiccolor[gci] = color
3056+
end
3057+
love.graphics.setColor(graphiccolor)
30533058
end
30543059
love.graphics.draw(v.graphic, v.quad, math.floor(((v.x-xscroll)*16+v.offsetX)*scale), math.floor(((v.y-yscroll)*16-v.offsetY)*scale), v.rotation, dirscale, horscale, v.quadcenterX, v.quadcenterY)
30553060
if v.overlaygraphic then
@@ -3097,7 +3102,11 @@ function drawentity(j, w, i, v, currentscissor, drop)
30973102
else
30983103
if v.graphic and v.quad then
30993104
if v.graphiccolor and (not drop) then
3100-
love.graphics.setColor(v.graphiccolor)
3105+
local graphiccolor = {}
3106+
for gci = 1, #v.graphiccolor do
3107+
graphiccolor[gci] = tonumber(v.graphiccolor[i])
3108+
end
3109+
love.graphics.setColor(graphiccolor)
31013110
end
31023111
love.graphics.draw(v.graphic, v.quad, math.floor(((px-xscroll)*16+v.offsetX)*scale), math.floor(((py-yscroll)*16-v.offsetY)*scale), pr, dirscale, horscale, v.quadcenterX, v.quadcenterY)
31033112
if v.overlaygraphic then

graphics/entitytooltips/iceflower.png

-33 Bytes
Loading

main.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ function defaultconfig()
15901590
--3: skin (yellow-orange)
15911591

15921592
mariocolors = {}
1593-
mariocolors[1] = {{224/255, 32/255, 0}, {136/255, 112/255, 0}, {252/255, 152/255, 56/255}}
1593+
mariocolors[1] = {{225/255, 32/255, 0}, {136/255, 112/255, 0}, {252/255, 152/255, 56/255}}
15941594
mariocolors[2] = {{ 1, 1, 1}, { 0, 160/255, 0}, {252/255, 152/255, 56/255}}
15951595
mariocolors[3] = {{ 0, 0, 0}, {200/255, 76/255, 12/255}, {252/255, 188/255, 176/255}}
15961596
mariocolors[4] = {{ 32/255, 56/255, 236/255}, { 0, 128/255, 136/255}, {252/255, 152/255, 56/255}}

mario.lua

+1
Original file line numberDiff line numberDiff line change
@@ -6363,6 +6363,7 @@ function mario:globalcollide(a, b)
63636363
self.fireenemy = b.makesmarioshoot
63646364
self.dofireenemy = self.fireenemy
63656365
if b.makesmariocolor then
6366+
convertcolors(b.makesmariocolor)
63666367
self.customcolors = b.makesmariocolor
63676368
for i, v in pairs(self.customcolors) do
63686369
for j, w in pairs(v) do

menu.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ function loadbackground(background)
18031803
else
18041804
local s4 = s3[2]:split(",")
18051805
local backgroundrgbon = true
1806-
local backgroundrgb = {tonumber(s4[1]), tonumber(s4[2]), tonumber(s4[3])}
1806+
local backgroundrgb = {tonumber(s4[1])/255, tonumber(s4[2])/255, tonumber(s4[3])/255}
18071807
love.graphics.setBackgroundColor(unpack(backgroundrgb))
18081808
end
18091809
elseif s3[1] == "spriteset" then

variables.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ flowercolor = {{252/255, 216/255, 168/255}, {216/255, 40/255, 0}, {252/255, 152/
4444
hammersuitcolor = {{0, 0, 0}, {1, 1, 1}, {252/255, 152/255, 56/255}}
4545
frogsuitcolor = {{0, 168/255, 0}, {0, 0, 0}, {252/255, 152/255, 56/255}}
4646
leafcolor = {{224/255, 32/255, 0}, {136/255, 112/255, 0}, {252/255, 152/255, 56/255}}
47-
iceflowercolor = {{1, 1, 1}, {60/255, 188/255, 252/255}, {252/255, 152/255, 56/255}}
47+
iceflowercolor = {{225/255,1,1}, {60/255, 188/255, 252/255}, {252/255, 152/255, 56/255}}
4848
tanookisuitcolor = {{200/255, 76/255, 12/255}, {0, 0, 0}, {252/255, 152/255, 56/255}}
4949
statuecolor = {{116/255, 116/255, 116/255}, {0, 0, 0}, {188/255, 188/255, 188/255}}
5050
superballcolor = {{100/255, 100/255, 50/255}, {160/255, 160/255, 110/255}, {230/255, 230/255, 180/255}}

0 commit comments

Comments
 (0)