mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-25 00:32:59 +00:00
fixed colour offset bug and refactored hex values
This commit is contained in:
parent
7f2be74580
commit
98a74c63dc
1 changed files with 7 additions and 7 deletions
|
@ -68,14 +68,14 @@ end
|
||||||
|
|
||||||
local number_colours = {
|
local number_colours = {
|
||||||
"#FF0000",
|
"#FF0000",
|
||||||
"#FF8800",
|
"#ff6800",
|
||||||
"#FFFF00",
|
"#FFD700",
|
||||||
"#88FF00",
|
"#CCFF00",
|
||||||
"#00FF00",
|
"#00FF00",
|
||||||
"#00FF88",
|
"#00FFAA",
|
||||||
"#00FFFF",
|
"#00FFFF",
|
||||||
"#0088FF",
|
"#0088FF",
|
||||||
"#0000FF",
|
"#5058FF",
|
||||||
"#8800ff",
|
"#8800ff",
|
||||||
"#FF00ff",
|
"#FF00ff",
|
||||||
"#FF0088"
|
"#FF0088"
|
||||||
|
@ -93,7 +93,7 @@ local function set_number(entity, display_number)
|
||||||
texture_name = texture_name.."^worldeditadditions_r"..number_right..".png"
|
texture_name = texture_name.."^worldeditadditions_r"..number_right..".png"
|
||||||
print("DEBUG:set_number number_left", number_left, "number_right", number_right)
|
print("DEBUG:set_number number_left", number_left, "number_right", number_right)
|
||||||
|
|
||||||
local colour_id = (display_number % 12) + 1 -- Lua starts from 1, not 0 :-/
|
local colour_id = ((display_number - 1) % 12) + 1 -- Lua starts from 1, not 0 :-/
|
||||||
texture_name = "("..texture_name..")^[colorize:"..number_colours[colour_id]..":255"
|
texture_name = "("..texture_name..")^[colorize:"..number_colours[colour_id]..":255"
|
||||||
end
|
end
|
||||||
if #texture_name > 0 then
|
if #texture_name > 0 then
|
||||||
|
@ -118,4 +118,4 @@ anchor = EventEmitter.new({
|
||||||
set_number = set_number
|
set_number = set_number
|
||||||
})
|
})
|
||||||
|
|
||||||
return anchor
|
return anchor
|
||||||
|
|
Loading…
Reference in a new issue