From 991248deb89bbcf0b1215b398abdb87b3d5aa313 Mon Sep 17 00:00:00 2001 From: acmgit Date: Tue, 2 Aug 2016 20:34:35 +0200 Subject: Filenameparameter in nodes.lua added. --- README.md | 11 ++--------- init.lua | 22 ++++++++++------------ nodes.lua | 30 +++++++++++++++++++++++------- textures/aikido.jpg | Bin 0 -> 31236 bytes textures/aikido.png | Bin 0 -> 157284 bytes textures/army.jpg | Bin 0 -> 37469 bytes textures/army.png | Bin 0 -> 278232 bytes textures/detergen.jpg | Bin 0 -> 28806 bytes textures/detergen.png | Bin 0 -> 220503 bytes textures/mesedrink.jpg | Bin 0 -> 21930 bytes textures/mesedrink.png | Bin 0 -> 116924 bytes textures/meseforte.jpg | Bin 0 -> 18977 bytes textures/meseforte.png | Bin 0 -> 148629 bytes textures/mesewave.jpg | Bin 0 -> 21936 bytes textures/mesewave.png | Bin 0 -> 154606 bytes textures/newspaper.jpg | Bin 0 -> 16951 bytes textures/newspaper.png | Bin 0 -> 141975 bytes 17 files changed, 35 insertions(+), 28 deletions(-) create mode 100644 textures/aikido.jpg create mode 100644 textures/aikido.png create mode 100644 textures/army.jpg create mode 100644 textures/army.png create mode 100644 textures/detergen.jpg create mode 100644 textures/detergen.png create mode 100644 textures/mesedrink.jpg create mode 100644 textures/mesedrink.png create mode 100644 textures/meseforte.jpg create mode 100644 textures/meseforte.png create mode 100644 textures/mesewave.jpg create mode 100644 textures/mesewave.png create mode 100644 textures/newspaper.jpg create mode 100644 textures/newspaper.png diff --git a/README.md b/README.md index 64f9676..b55075c 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,8 @@ https://github.com/crazyginger72/billboard.git This Mod adds signlike Billboards and different sizes with Craftrecipes. You only need a Texture for the Billboard. -To add a Billboard, save the Texture in textures, rename the image in shape of: - -bb_itemname_color_color.png - -then add an Entry in nodes.lua like: - -{ itemname, color, color, size, imagetyp } - -then craft your Billboard in Minetest. +To add a new or own Billboard: +Save your Image in textures and add an Entry in nodes.lua. #*Depends:* diff --git a/init.lua b/init.lua index b05303b..d85cd4f 100644 --- a/init.lua +++ b/init.lua @@ -10,25 +10,23 @@ for i,n in ipairs(bb_boardlist) do -- For Recipe: Item isn't given? if n.item1 == nil then n.item1 = "sign_wall_wood" - end - if n.item2 == nil then + elseif n.item2 == nil then n.item2 = "white" - end - if n.item3 == nil then + elseif n.item3 == nil then n.item3 = "white" end -- scale isn't given or 0 (invalid)? if n.scale == nil or n.scale == 0 then n.scale = 1 - end - -- scale has a negative value? - if n.scale < 0 then + elseif n.scale < 0 then -- scale has a negative value? n.scale = n.scale * -1 end - -- no Imagetyp is given? - if n.imgtyp == nil then + -- Filename isn't given? + if n.filename == nil then + n.filename = "bb_" .. n.item1 .. "_" .. n.item2 .. "_" .. n.item3 + elseif n.imgtyp == nil then -- no Imagetyp is given? n.imgtyp = "png" end @@ -38,10 +36,10 @@ for i,n in ipairs(bb_boardlist) do drawtype = "signlike", visual_scale = n.scale, tiles = { - "bb_"..n.item1.."_"..n.item2.."_"..n.item3.."."..n.imgtyp + n.filename .. "." ..n.imgtyp }, - inventory_image = "bb_"..n.item1.."_"..n.item2.."_"..n.item3.."."..n.imgtyp, - wield_image = "bb_"..n.item1.."_"..n.item2.."_"..n.item3.."."..n.imgtyp, + inventory_image = n.filename .."."..n.imgtyp, + wield_image = n.filename .. "." ..n.imgtyp, paramtype = "light", paramtype2 = "wallmounted", sunlight_propagates = true, diff --git a/nodes.lua b/nodes.lua index 615e2bc..7bd0a73 100644 --- a/nodes.lua +++ b/nodes.lua @@ -15,6 +15,8 @@ bb_boardlist = Size of the Billboard in Blocks scale = number , default = 0 + filename = Filename for the Image, default = bb_item1_item2_item3 + Typ of the taken Image (must be in textures) imgtyp = "Typ" , default = "png" } @@ -26,48 +28,62 @@ bb_boardlist = item2 = "white", item3 = "white", scale = 3.0, - imgtyp = "jpg" }, + filename = "aikido", + imgtyp = "jpg" + }, { title = "Detergen Billboard", item1 = "sign_wall_wood", item2 = "yellow", item3 = "yellow", scale = 3.0, - imgtyp = "jpg" }, + filename = "detergen", + imgtyp = "jpg" + }, { title = "Mesedrink Billboard", item1 = "sign_wall_wood", item2 = "black", item3 = "yellow", scale = 3.5, - imgtyp = "jpg" }, + filename = "mesedrink", + imgtyp = "jpg" + }, { title = "Meseforte Billboard", item1 = "sign_wall_wood", item2 = "green", item3 = "blue", scale = 3.0, - imgtyp = "png" }, + filename = "meseforte", + imgtyp = "png" + }, { title = "Mesewave Billboard", item1 = "sign_wall_wood", item2 = "blue", item3 = "yellow", scale = 2.0, - imgtyp = "jpg" }, + filename = "mesewave", + imgtyp = "jpg" + }, { title = "Newspaper Billboard", item1 = "paper", item2 = "black", item3 = "orange", scale = 2.5, - imgtyp = "jpg" }, + filename = "newspaper", + imgtyp = "jpg" + }, { title = "Army Billboard", item1 = "paper", item2 = "green", item3 = "green", scale = 2.0, - imgtyp = "png" } + filename = "army", + imgtyp = "png" + } } diff --git a/textures/aikido.jpg b/textures/aikido.jpg new file mode 100644 index 0000000..6df3aee Binary files /dev/null and b/textures/aikido.jpg differ diff --git a/textures/aikido.png b/textures/aikido.png new file mode 100644 index 0000000..5865706 Binary files /dev/null and b/textures/aikido.png differ diff --git a/textures/army.jpg b/textures/army.jpg new file mode 100644 index 0000000..a48b6a8 Binary files /dev/null and b/textures/army.jpg differ diff --git a/textures/army.png b/textures/army.png new file mode 100644 index 0000000..4f6686d Binary files /dev/null and b/textures/army.png differ diff --git a/textures/detergen.jpg b/textures/detergen.jpg new file mode 100644 index 0000000..c5f080b Binary files /dev/null and b/textures/detergen.jpg differ diff --git a/textures/detergen.png b/textures/detergen.png new file mode 100644 index 0000000..7e659de Binary files /dev/null and b/textures/detergen.png differ diff --git a/textures/mesedrink.jpg b/textures/mesedrink.jpg new file mode 100644 index 0000000..3b17cbb Binary files /dev/null and b/textures/mesedrink.jpg differ diff --git a/textures/mesedrink.png b/textures/mesedrink.png new file mode 100644 index 0000000..e11b72b Binary files /dev/null and b/textures/mesedrink.png differ diff --git a/textures/meseforte.jpg b/textures/meseforte.jpg new file mode 100644 index 0000000..8b2355b Binary files /dev/null and b/textures/meseforte.jpg differ diff --git a/textures/meseforte.png b/textures/meseforte.png new file mode 100644 index 0000000..5aad220 Binary files /dev/null and b/textures/meseforte.png differ diff --git a/textures/mesewave.jpg b/textures/mesewave.jpg new file mode 100644 index 0000000..582af14 Binary files /dev/null and b/textures/mesewave.jpg differ diff --git a/textures/mesewave.png b/textures/mesewave.png new file mode 100644 index 0000000..a6df1ba Binary files /dev/null and b/textures/mesewave.png differ diff --git a/textures/newspaper.jpg b/textures/newspaper.jpg new file mode 100644 index 0000000..9021a8d Binary files /dev/null and b/textures/newspaper.jpg differ diff --git a/textures/newspaper.png b/textures/newspaper.png new file mode 100644 index 0000000..67880b6 Binary files /dev/null and b/textures/newspaper.png differ -- cgit v1.2.3