added ability to disable/enable full/med/low-glow glass independently

This commit is contained in:
andersje 2013-08-30 20:52:19 -05:00
parent ef0071fd77
commit da48353f86
4 changed files with 277 additions and 257 deletions

View File

@ -1,7 +1,6 @@
Doyousketch2's Stained Glass mod
ver 1.4
ver 1.6
Image: http://oi47.tinypic.com/hst6s3.jpg
@ -87,6 +86,8 @@ The Palette includes:
Full & half-saturation, medium and dark shades have been included
as well as light, pastel, and faint tints.
Look at settings.txt to see how you can enable/disable full-glow, half-glow and no-glow blocks -- tested in all combinations. enjoy.
==============================================================================
@ -101,6 +102,9 @@ or /giveme stained_glass:pastel_yellow
or /giveme stained_glass:faint_yellow
or /giveme stained_glass:yellow
or /giveme stained_glass:lowglow_yellow
or /giveme stained_glass:noglow_dark_green
You get the idea.

View File

@ -2,6 +2,10 @@
Changelog
---------
ver 1.6
Fri 30 Aug 2013
added configfile settings.txt to allow disabling of full_light (super_glow_glass-based), med_light (glow_glass-based) and no_light (default:glass) blocks. just set the relevant fields to 'false' and they will not be loaded when you start the game.
ver 1.5.1
Mon 26 Aug 2013

View File

@ -94,25 +94,24 @@ function stained_glass_define(arg)
local mydye=arg.recipe
local myshadename=arg.shade
local stained_glass_blocktype = {
[""]="moreblocks:super_glow_glass" ,
["lowglow_"]="moreblocks:glow_glass",
["noglow_"]="default:glass",
-- here you can define alternate glowlevels, with
-- what type of glass they should use.
-- levels added here must be added
-- below (in stained_glass_lightlevel), too.
}
local stained_glass_blocktype = { }
local stained_glass_lightlevel = {
["noglow_"] = 0,
[""] = LIGHT_MAX,
["lowglow_"] = LIGHT_MAX-3,
local stained_glass_lightlevel = { }
-- define alternate light levels here, with a new
-- prefix name and a new light level. perhaps you'd
-- like "dim" at a level of '6' for example.
}
if stained_glass.full_light then
stained_glass_lightlevel[""] = LIGHT_MAX
stained_glass_blocktype[""] = "moreblocks:super_glow_glass"
end -- see settings.txt for these settings.
if stained_glass.med_light then
stained_glass_lightlevel["lowglow_"] = LIGHT_MAX-3
stained_glass_blocktype["lowglow_"] = "moreblocks:glow_glass"
end
if stained_glass.no_light then
stained_glass_lightlevel["noglow_"] = 0
stained_glass_blocktype["noglow_"] = "default:glass"
end
for myprefix,myglow in pairs(stained_glass_lightlevel) do
local glasstype = stained_glass_blocktype[myprefix]
@ -161,6 +160,16 @@ end
-- (perhaps because the related groups overlap two or more distinct colors)
-- false means the recipe uses "group:dye,unicolor_xxxxx"
stained_glass= {}
local worldpath=minetest.get_worldpath()
local modpath=minetest.get_modpath("stained_glass")
dofile(modpath .. "/settings.txt")
-- the new settings.txt file has a variety of possible settings.
-- see the file for examples. We'll access those settings where its important, in
-- the stained glass module, where we'll build up the tables to contain
-- only what we need.
stained_glass_hues = {
{ "yellow", true },
{ "lime", false },

3
settings.txt Normal file
View File

@ -0,0 +1,3 @@
stained_glass.full_light = true
stained_glass.med_light = true
stained_glass.no_light = true