1
0
mirror of https://github.com/mt-mods/unifieddyes.git synced 2024-11-20 08:50:19 +01:00
Commit Graph

159 Commits

Author SHA1 Message Date
Vanessa Dannenberg
414d72d2a6 new punch-to-colorize scheme
using a tool, the airbrush, for the job

point at air/nothing and punch while wielding the airbrush
to open the color selection form.
2018-08-26 07:10:00 -04:00
Vanessa Dannenberg
568168fe1f better handling of the register_on_placenode rotation fix 2018-08-26 07:09:20 -04:00
Vanessa Dannenberg
c005dc358a minor changes to colorwallmounted palette
got rid of the separate brown swatch in the colorwallmounted palette, as
it was being bypassed by the brown-> medium orange translation --
replaced it with light green.

fixed missing colorwallmounted light blue/azure check-and-return in
get_paletteidx()
2018-08-25 02:40:17 -04:00
Vanessa Dannenberg
c7fc48c8d0 fix some broken aliases,
add some corresponding ones (unifieddyes:* vs. dye:*)
2018-08-25 00:38:24 -04:00
Vanessa Dannenberg
0d00a7eae6 workaround for placing nodes with no color info in itemstack 2018-08-24 11:13:42 -04:00
Vanessa Dannenberg
adf1bc2c50 remove the old obsolete on_use stuff
(was applied to dye items, obsolete now)
2018-08-24 05:41:27 -04:00
Vanessa Dannenberg
d3274ab66f remove debug prints 2018-08-22 20:07:15 -04:00
Vanessa Dannenberg
d2512952d9 forgot to add pink to craft helper 2018-08-22 20:06:29 -04:00
Vanessa Dannenberg
5557178cb4 proper handling of 89-color "split" palette in craft helper 2018-08-22 20:01:03 -04:00
Vanessa Dannenberg
4847b926d5 preserve color bits in rotation fixup calls 2018-08-22 04:25:43 -04:00
Vanessa Dannenberg
e3648f77e2 remove debug prints 2018-08-22 03:27:17 -04:00
Vanessa Dannenberg
b49ed1724b fix hue table type for wallmounted in craft helper 2018-08-22 03:14:20 -04:00
Vanessa Dannenberg
a55f6faa14 further refine how colored itemstacks work 2018-08-21 23:28:17 -04:00
Vanessa Ezekowitz
a8caed8195 separate the make-colored-itemstack code into its own function 2017-06-20 17:01:54 -04:00
Vanessa Ezekowitz
731c7d133e disable old after_dig_node() callbacks
(don't split a digged node into neutral+dye)
2017-06-20 17:01:54 -04:00
Vanessa Ezekowitz
ad8ab99bd8 disable auto-coloring code entirely 2017-06-20 17:01:54 -04:00
Vanessa Ezekowitz
07101b99fe add helper function for crafting param2-colorized items
One call registers the full set of 32, 89, or 256 colors.

Pass it a recipe of the following general form

```lua
unifieddyes.register_color_craft({
        output = "mymod:colorized_node",
        type = <nil or "shapeless">
        palette = <see below>,
        neutral_node = "some_mod:neutral_node",
        recipe = {
                <see below>
        }
})
```

palette may be either "wallmounted" (32 colors), false or omitted
entirely (89 colors), or "extended" (256 colors).

The recipe section is either a shapeless list, or a standard three-line
shaped recipe, same as the regular register_craft() function.  The key
difference is two placeholder keys that are now supported:

  * if an item in the recipe is "MAIN_DYE", then Unified Dyes will, with
    each pass of its registration loop, substitute the actual "dye:foo"
    craft item in its place which corresponds with the current loop's color.
  * if an item in the recipe list is "NEUTRAL_NODE", then the value of the
    "neutral_node" field will be substituted in its place.

The expectation here is that the modder probably has some base recipe in
mind that, given no dyes, would result in a neutral, uncolored node.  This
call creates all the recipes that would be needed to craft colored versions
of that neutral node either using that base recipe with dye added, or by
crafting the neutral node with some dye after the fact.
2017-06-20 17:01:54 -04:00
Vanessa Ezekowitz
495479c6a2 remove a few redundant aliases 2017-06-20 16:11:15 -04:00
Vanessa Ezekowitz
0822757382 add alternate recipe for dark orange 2017-06-20 16:04:00 -04:00
Vanessa Ezekowitz
ffd03b9c3c clean-up of dark/medium orange and light/red
(fixes #13)
2017-06-20 15:44:28 -04:00
Vanessa Ezekowitz
8b20a069d3 rotation fixes for compat with minetest 0.4.16 2017-06-04 16:17:37 -04:00
Vanessa Ezekowitz
9dd533f4a0 Merge pull request #9 from AntumDeluge/settings
Replace deprecated 'setting_getbool' with 'settings:get_bool'
2017-05-18 05:44:39 -04:00
AntumDeluge
73e05d9c76 Replace deprecated 'setting_getbool' with 'settings:get_bool' 2017-05-13 16:55:37 -07:00
AntumDeluge
df3f1b18ab Replace deprecated call to 'get_look_yaw' with 'get_look_horizontal' 2017-05-03 23:05:40 -07:00
Vanessa Ezekowitz
df177c26a7 allow shift-punching on a colorable node, to cancel auto-coloring
also add a message in the chat when auto-color is activated, and with what.
2017-03-18 15:56:28 -04:00
Vanessa Ezekowitz
cf186f5f9c make sure the pointed thing is a node before checking protection 2017-03-18 14:37:09 -04:00
Vanessa Ezekowitz
726bb75e1d add recolor-on-place helper
if you add `after_place_node = unifieddyes.recolor_on_place,`
to your node def, UD will automatically colorize the node when
placed, using the last dye you colored that kind of node with.

If you switch to some other colorable node, or you run out of whatever
color dye you were using at the time, a warning message will be printed
and the autocolor will be reset back to neutral.

If a player signs off, autocolor for him/her is reset to neutral
(this also helps prevent a minor memory leak)

also get rid of one or two debug prints.
2017-03-18 03:26:05 -04:00
Vanessa Ezekowitz
8fc5468212 remove outdated comment 2017-03-17 22:26:51 -04:00
Vanessa Ezekowitz
63153f1093 protection check on_use 2017-03-17 03:18:06 -04:00
Vanessa Ezekowitz
15b6016f0f on_construct for nodes that were 89-color or static,
but now use an LBM to convert to the 256-color palette
2017-03-14 02:05:52 -04:00
Vanessa Ezekowitz
978e88bda5 don't crash if the dye target is an unknown node :P 2017-03-11 21:20:10 -05:00
Vanessa Ezekowitz
70b1f9fbc9 made base_color_crafts, shade_crafts,
and greymixes tables globally accessible
2017-02-26 22:32:56 -05:00
Vanessa Ezekowitz
2804327825 get rid of some redundant variables
(just directly reference the table elements instead)
2017-02-26 18:56:12 -05:00
Vanessa Ezekowitz
315dfb8283 add another recipe 2017-02-26 18:39:41 -05:00
Vanessa Ezekowitz
f852fb6861 add more hue recipes
also fix a variable that got capitalized for some reason
2017-02-26 18:37:34 -05:00
Vanessa Ezekowitz
2b9831a869 add more "direct" recipes
for the more esoteric colors
2017-02-26 17:57:44 -05:00
Vanessa Ezekowitz
0cd0758c08 only use the node def's palette entry to check palette type
(don't assume it has to be paramtype2="color", otherwise that screws up
uncolored nodes that need this check for on_use)
2017-02-26 10:55:49 -05:00
Vanessa Ezekowitz
46a55946ef define on_use for default dyes
(forgot to include the overrides)
2017-02-25 16:45:57 -05:00
Vanessa Ezekowitz
dcf9bf648f override default dyes to keep their hues/shades consistent
with how this mod uses them.  Also fix missing aliases for same.
2017-02-25 16:41:16 -05:00
Vanessa Ezekowitz
58cac62bf4 clean up greyscale portion of extended palette
remap greys slightly, tweak related recipes
2017-02-25 15:41:14 -05:00
Vanessa Ezekowitz
22243fa684 add grey crafts and consolidate slightly 2017-02-25 14:41:53 -05:00
Vanessa Ezekowitz
9f36afaf50 greys were mapped slightly wrong, fixed 2017-02-25 14:07:35 -05:00
Vanessa Ezekowitz
3f9e8e4554 fix missing full-s50 defs,
fix a couple more broken recipes
2017-02-25 13:22:08 -05:00
Vanessa Ezekowitz
92da3a5345 add crafting recipes for all hues and some greys
also fix broken light grey registration
2017-02-25 12:44:22 -05:00
Vanessa Ezekowitz
91d260b538 make some color tables globally accessible (in unifieddyes namespace) 2017-02-24 22:52:05 -05:00
Vanessa Ezekowitz
e3f73e07e7 remove some debug statements 2017-02-24 21:56:29 -05:00
Vanessa Ezekowitz
fe455a7e44 dyes -> not in creative inv 2017-02-24 20:42:04 -05:00
Vanessa Ezekowitz
d2819353c2 fix greys in palette conversion table 2017-02-24 20:13:43 -05:00
Vanessa Ezekowitz
fbe762cf19 it's okay to use an oversized palette
also formula for 89->256 table was wrong
2017-02-24 19:57:48 -05:00
Vanessa Ezekowitz
e0c87656ed Mark the node via its metadata if it's been painted with 256-color palette 2017-02-24 19:21:15 -05:00
Vanessa Ezekowitz
cf89bc6a24 translate new dye names to old for 89-color palette check 2017-02-24 18:48:02 -05:00
Vanessa Ezekowitz
50013d21d1 Add detection and setting of new palette
(with any luck, all that's left now is to update the mods that use
Unified Dyes, where the new palette is wanted)
2017-02-24 18:38:15 -05:00
Vanessa Ezekowitz
9ad1f28ae1 auto-generate the various dye craftitems
and base them all on a single colorized texture.
2017-02-24 17:40:37 -05:00
Vanessa Ezekowitz
68f8c18bc3 get rid of HUES2 table (use string ops to replace it) 2017-02-24 14:28:38 -05:00
Vanessa Ezekowitz
0ceb8f0afe add extended palette
full 256-color range:
24 full hues, with four lighter shades and two darker shades, plus
low-saturation versions of the full and darker shades,
and 16 levels of greyscale
2017-02-24 14:21:59 -05:00
adrido
34299b01a0 fix not being able to pick up dropped objects while wielding dye 2017-02-21 07:46:38 -05:00
Vanessa Ezekowitz
295cd027f2 add on_rotate handler
to correct rotation for "fake wallmounted" nodes so that they always appear
to be on the floor, pointing at one of the four NSEW directions.
2017-02-18 13:00:06 -05:00
Vanessa Ezekowitz
aacb377f8c "widen" the range for floor/ceiling placement checking
in fix_rotation function
2017-02-17 23:13:22 -05:00
Vanessa Ezekowitz
80e5429bf3 add helper functions for rotation correction 2017-02-17 23:04:47 -05:00
Vanessa Ezekowitz
b0ccff164d add light_blue to wallmounted palette 2017-02-06 09:30:04 -05:00
Vanessa Ezekowitz
4d11406f8d Pink/brown color translation tweaks
Only perform pink -> light_red and brown -> dark_orange translations if
not using the "colorwallmounted" palette.
2017-02-06 09:22:10 -05:00
Vanessa Ezekowitz
e3b7e9d534 fix broken check-for-colorable 2017-02-05 20:21:04 -05:00
Vanessa Ezekowitz
e981b29cd2 use on_use instead of on_rightclick to apply dyes
also add some useful messages if the target was already
the same color as the dye, can't be colored, can't take
the requested color, etc.
2017-02-04 19:40:15 -05:00
Vanessa Ezekowitz
935f15c343 don't set a custom param2 if the placed node has no facedir/wallmount 2017-01-30 05:50:02 -05:00
Vanessa Ezekowitz
de61a1333b fix wallmounted grey numbering 2017-01-30 05:32:17 -05:00
Vanessa Ezekowitz
1b0e384278 fix messed-up grayscale color select logic 2017-01-29 00:06:08 -05:00
Vanessa Ezekowitz
3b942c352f remove some debug statements 2017-01-28 21:57:14 -05:00
Vanessa Ezekowitz
8ea8b01dcc add API option for "colorwallmounted" paramtype2
(pass "wallmounted" to the "is_color_fdir" field where needed)

Comes with an abridged, 32-color version of the master palette,
containing Red, Orange, Yellow, Green, Cyan, Blue, Violet, and Magenta,
in three shades each, plus the usual black/three greys/white, plus pink
and brown in two of the extrs spaces.
2017-01-28 21:51:46 -05:00
Vanessa Ezekowitz
966166b1b9 only crop the palleteidx if param2 is colorfacedir
(prevent a potential bug later: some day, maybe there
will be more than 89 colors in UD)
2017-01-28 18:19:58 -05:00
Vanessa Ezekowitz
aef03c1932 colorfdir -> is_color_fdir
(preparing for later inclusion of some kind of wallmounted palette)
2017-01-28 18:18:27 -05:00
Vanessa Ezekowitz
e146c55ca0 fix a couple more missing aliases 2017-01-28 09:37:10 -05:00
Vanessa Ezekowitz
2fcae9d17d fix several dye-handling bugs 2017-01-28 09:02:14 -05:00
Vanessa Ezekowitz
aeb179a129 API CHANGE: after_dig_node instead of on_destruct
This also fixes the case where digging a block just drops
the dye on the ground instead of putting it in the player's inv.
2017-01-28 08:05:44 -05:00
Vanessa Ezekowitz
0fbf6baa72 fix facedir not being set when simple node placement fall-through is called 2017-01-28 07:19:30 -05:00
Vanessa Ezekowitz
4622d25e76 fix wrong param2 setting 2017-01-26 19:02:55 -05:00
Vanessa Ezekowitz
3e93c10cfd handle both cases of nodes being set with facedir 2017-01-26 15:49:06 -05:00
Vanessa Ezekowitz
2959698111 remove debug statements 2017-01-26 14:21:54 -05:00
Vanessa Ezekowitz
b42376ba3d improve handling of greyscale in get-hsv function 2017-01-26 13:51:38 -05:00
Vanessa Ezekowitz
1c5d79800f add an alternate "find HSV" function.
Note that if the result is greyscale, the name ("black", "grey", ...) is
returned in the "hue" field, sat is empty string, and val is "light",
"dark", or empty string.
2017-01-26 13:42:36 -05:00
Vanessa Ezekowitz
b1ad76ab72 handle a few more color-to-grey and grey-to-color cases 2017-01-26 11:23:34 -05:00
Vanessa Ezekowitz
3f7fb1af74 Just do the node's color search manually
(to handle cases where the node has more than just the standard-format
nodename:[shade_]hue[_s50] naming, e.g. stairsplus nodes like:

nodename:stair_[shade_]hue[_s50][_some_extra_details]
2017-01-26 11:06:31 -05:00
Vanessa Ezekowitz
4f1303aac1 handle special cases for greyscale dyes and unpainted nodes 2017-01-26 07:10:48 -05:00
Vanessa Ezekowitz
1773af6868 rework how split palettes are handled 2017-01-26 06:18:37 -05:00
Vanessa Ezekowitz
1c7f403f29 add "split" palette for mods that need facedir + param2 color 2017-01-25 18:21:26 -05:00
Vanessa Ezekowitz
00459f8859 only allow placing the wielded thing if it's actually a node 2017-01-25 16:05:24 -05:00
Vanessa Ezekowitz
7c48587c6a add a few missing aliases 2017-01-25 13:19:20 -05:00
Vanessa Ezekowitz
17522711de Add some helper functions to support the new param2-style coloring
Most of the code came from cheapie's plasticbox mod
2017-01-25 12:59:49 -05:00
Vanessa Ezekowitz
127caef5b3 use current intllib API 2014-12-27 01:02:35 -05:00
Xanthin
4191f40c7c add support for intllib translation mod 2014-03-20 02:11:30 +01:00
Vanessa Ezekowitz
08fe211bde local-ize a few variables/tables 2013-12-15 13:03:38 -05:00
Vanessa Ezekowitz
9ea6469506 fix brain-o (copy&paste error) in groups for light grey 2013-08-11 23:59:16 -04:00
Vanessa Ezekowitz
6d71b346a1 removed all dye colors from the creative inventory, to reduce clutter. 2013-07-21 05:04:05 -04:00
Vanessa Ezekowitz
58d07ae30e Removed "Full" from descriptions - it's redundant if everything else says
"light", "medium", or "dark".
2013-04-30 22:20:38 -04:00
Vanessa Ezekowitz
a9c803b14f Refactored the code to use default "common" dyes
rather than directly from flowers.

This mod now depends on "default" and "dye" from the Minetest common
sub-game.  Since the default dye mod uses default flowers, this mod no
longer checks for what version of flowers you're using, or even depends
on it.

Bottle-based textures have been replaced with piles of dye powder, based
on the default red dye texture.

All dyes are obtained by crafting, not cooking, for consistency with the
default dye mod.

The somewhat-complicated method using separate "pigment" powders, glass
bottles and "liquid dye base" has been done away with.  Now it's just
dry dye powders, as with the default dye mod.

Also, got rid of the whole paint scheme, in favor of dry powders.

All old dyes, paints, and Unified Dyes pigment powders have been aliased
back to the standard dye powders.
2013-04-30 06:08:34 -04:00
Vanessa Ezekowitz
411cc8de39 Added licensing information headers and LICENSE file. 2013-02-07 01:38:34 -05:00
Vanessa Ezekowitz
04b07689da fixed missing replacements for white paint -> empty bucket
when crafting light colors.
2013-01-30 17:32:50 -05:00
Vanessa Ezekowitz
2f02d5c345 fixed incorrect groups setting for blue dye. 2012-08-19 21:05:00 -04:00
Vanessa Ezekowitz
1c8945b9d8 forgot to add in the recipes to make blue and violet dyes after adding the
special case for the existence of geraniums.
2012-08-05 23:41:22 -04:00
Vanessa Ezekowitz
48356ea59c Added a "version" check for the flowers dependency:
If the flowers mod defines "flowers:flower_geranium" (as is the case with my update of 2012-08-01), then those will
be used to get blue pigment powder, and violas will produce violet powder, both of which can be directly used to
create their respective liquid dye colors.  If it is not defined (e.g. the user has an older version of the flowers
mod), then violas produce blue dye powder.  Violet dye can still be formed by mixing blue and magenta or blue and
red dyes, as before.
2012-08-01 19:14:49 -04:00
Vanessa Ezekowitz
821e64db90 Changed glass bottle recycling so that it uses the vessel mod's "glass
fragments" in the process instead of direct-to-glass-blocks.
2012-07-31 20:12:00 -04:00