mirror of
https://github.com/mt-mods/hangglider.git
synced 2025-09-17 22:05:23 +02:00
fix mtg dye colors not working
This commit is contained in:
21
crafts.lua
21
crafts.lua
@@ -1,9 +1,7 @@
|
|||||||
|
|
||||||
local get_dye_color
|
local has_unifieddyes = minetest.get_modpath("unifieddyes")
|
||||||
if minetest.get_modpath("unifieddyes") then
|
|
||||||
get_dye_color = unifieddyes.get_color_from_dye_name
|
local dye_colors = {
|
||||||
else
|
|
||||||
local colors = {
|
|
||||||
white = "ffffff",
|
white = "ffffff",
|
||||||
grey = "888888",
|
grey = "888888",
|
||||||
dark_grey = "444444",
|
dark_grey = "444444",
|
||||||
@@ -20,12 +18,19 @@ else
|
|||||||
magenta = "ff00ff",
|
magenta = "ff00ff",
|
||||||
pink = "ff7f9f",
|
pink = "ff7f9f",
|
||||||
}
|
}
|
||||||
get_dye_color = function(name)
|
|
||||||
local color = string.match(name, "^dye:(%w+)$")
|
local function get_dye_color(name)
|
||||||
|
local color
|
||||||
|
if has_unifieddyes then
|
||||||
|
color = unifieddyes.get_color_from_dye_name(name)
|
||||||
|
end
|
||||||
|
if not color then
|
||||||
|
color = string.match(name, "^dye:(%w+)$")
|
||||||
if color then
|
if color then
|
||||||
return colors[color]
|
color = dye_colors[color]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return color
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_color_name(name)
|
local function get_color_name(name)
|
||||||
|
Reference in New Issue
Block a user