1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-07-29 12:50:24 +02:00

Add tile image in class switches' parameters and tweak colors

- Refers to #216
This commit is contained in:
LeMagnesium
2015-08-17 10:53:13 +02:00
parent 26fae174b1
commit 2cd80bccf1
6 changed files with 22 additions and 9 deletions

View File

@ -61,16 +61,18 @@ local classes_items = {
["hunter"] = "throwing:bow_minotaur_horn_improved",
["warrior"] = "default:dungeon_master_s_blood_sword",
["admin"] = "maptools:pick_admin",
["adventurer"] = "unified_inventory:bag_large"
["adventurer"] = "unified_inventory:bag_large",
["wizard"] = "default:book"
}
function pclasses.register_class_switch(cname, color)
color = color or { r = 255, g = 255, b = 255 }
function pclasses.register_class_switch(cname, params)
local color = params.color or { r = 255, g = 255, b = 255 }
local txtcolor = string.format("#%02x%02x%02x", color.r, color.g, color.b)
local overlay = "pclasses_class_switch_orb_overlay.png"
print((params.tile or overlay))
minetest.register_node(":pclasses:class_switch_" .. cname, {
description = "Class switch orb (" .. cname .. ")",
tiles = {overlay .. "^[colorize:" .. txtcolor .. "^" .. overlay},
tiles = {(params.tile or overlay) .. "^[colorize:" .. txtcolor .. ":200"},
drawtype = "nodebox",
node_box = { type = "fixed", fixed = {
{-7/16, -8/16, -7/16, 7/16, -7/16, 7/16}, -- bottom plate