forked from mtcontrib/maidroid
Divide scope
This commit is contained in:
parent
83d2c0ca94
commit
88ee24b140
@ -3,35 +3,14 @@
|
|||||||
-- https://github.com/tacigar/maidroid
|
-- https://github.com/tacigar/maidroid
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
local dye_item_map = {
|
do -- register egg writer
|
||||||
["dye:red"] = "maidroid:maidroid_mk1_egg",
|
|
||||||
}
|
|
||||||
|
|
||||||
local formspec = { -- want to change.
|
local dye_item_map = {
|
||||||
["inactive"] = "size[8,9]"
|
["dye:red"] = "maidroid:maidroid_mk1_egg",
|
||||||
.. default.gui_bg
|
}
|
||||||
.. default.gui_bg_img
|
|
||||||
.. default.gui_slots
|
|
||||||
.. "label[3.75,0;Egg]"
|
|
||||||
.. "list[current_name;main;3.5,0.5;1,1;]"
|
|
||||||
.. "label[2.75,2;Coal]"
|
|
||||||
.. "list[current_name;fuel;2.5,2.5;1,1;]"
|
|
||||||
.. "label[4.75,2;Dye]"
|
|
||||||
.. "list[current_name;dye;4.5,2.5;1,1;]"
|
|
||||||
.. "image[3.5,1.5;1,2;maidroid_tool_gui_arrow.png]"
|
|
||||||
.. "image[3.1,3.5;2,1;maidroid_tool_gui_meter.png^[transformR270]"
|
|
||||||
.. "list[current_player;main;0,5;8,1;]"
|
|
||||||
.. "list[current_player;main;0,6.2;8,3;8]",
|
|
||||||
|
|
||||||
["active"] = function(time)
|
local formspec = { -- want to change.
|
||||||
local arrow_percent = (100 / 40) * time
|
["inactive"] = "size[8,9]"
|
||||||
local merter_percent = 0
|
|
||||||
if time % 16 >= 8 then
|
|
||||||
meter_percent = (8 - (time % 8)) * (100 / 8)
|
|
||||||
else
|
|
||||||
meter_percent = (time % 8) * (100 / 8)
|
|
||||||
end
|
|
||||||
return "size[8,9]"
|
|
||||||
.. default.gui_bg
|
.. default.gui_bg
|
||||||
.. default.gui_bg_img
|
.. default.gui_bg_img
|
||||||
.. default.gui_slots
|
.. default.gui_slots
|
||||||
@ -41,55 +20,84 @@ local formspec = { -- want to change.
|
|||||||
.. "list[current_name;fuel;2.5,2.5;1,1;]"
|
.. "list[current_name;fuel;2.5,2.5;1,1;]"
|
||||||
.. "label[4.75,2;Dye]"
|
.. "label[4.75,2;Dye]"
|
||||||
.. "list[current_name;dye;4.5,2.5;1,1;]"
|
.. "list[current_name;dye;4.5,2.5;1,1;]"
|
||||||
.. "image[3.5,1.5;1,2;maidroid_tool_gui_arrow.png^[lowpart:"
|
.. "image[3.5,1.5;1,2;maidroid_tool_gui_arrow.png]"
|
||||||
.. arrow_percent
|
.. "image[3.1,3.5;2,1;maidroid_tool_gui_meter.png^[transformR270]"
|
||||||
.. ":maidroid_tool_gui_arrow_filled.png]"
|
|
||||||
.. "image[3.1,3.5;2,1;maidroid_tool_gui_meter.png^[lowpart:"
|
|
||||||
.. meter_percent
|
|
||||||
.. ":maidroid_tool_gui_meter_filled.png^[transformR270]"
|
|
||||||
.. "list[current_player;main;0,5;8,1;]"
|
.. "list[current_player;main;0,5;8,1;]"
|
||||||
.. "list[current_player;main;0,6.2;8,3;8]"
|
.. "list[current_player;main;0,6.2;8,3;8]",
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
local tiles = {
|
["active"] = function(time)
|
||||||
["active"] = {
|
local arrow_percent = (100 / 40) * time
|
||||||
"default_stone.png",
|
local merter_percent = 0
|
||||||
},
|
if time % 16 >= 8 then
|
||||||
|
meter_percent = (8 - (time % 8)) * (100 / 8)
|
||||||
|
else
|
||||||
|
meter_percent = (time % 8) * (100 / 8)
|
||||||
|
end
|
||||||
|
return "size[8,9]"
|
||||||
|
.. default.gui_bg
|
||||||
|
.. default.gui_bg_img
|
||||||
|
.. default.gui_slots
|
||||||
|
.. "label[3.75,0;Egg]"
|
||||||
|
.. "list[current_name;main;3.5,0.5;1,1;]"
|
||||||
|
.. "label[2.75,2;Coal]"
|
||||||
|
.. "list[current_name;fuel;2.5,2.5;1,1;]"
|
||||||
|
.. "label[4.75,2;Dye]"
|
||||||
|
.. "list[current_name;dye;4.5,2.5;1,1;]"
|
||||||
|
.. "image[3.5,1.5;1,2;maidroid_tool_gui_arrow.png^[lowpart:"
|
||||||
|
.. arrow_percent
|
||||||
|
.. ":maidroid_tool_gui_arrow_filled.png]"
|
||||||
|
.. "image[3.1,3.5;2,1;maidroid_tool_gui_meter.png^[lowpart:"
|
||||||
|
.. meter_percent
|
||||||
|
.. ":maidroid_tool_gui_meter_filled.png^[transformR270]"
|
||||||
|
.. "list[current_player;main;0,5;8,1;]"
|
||||||
|
.. "list[current_player;main;0,6.2;8,3;8]"
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
["inactive"] = {
|
local tiles = {
|
||||||
"default_stone.png",
|
["active"] = {
|
||||||
},
|
"default_stone.png",
|
||||||
}
|
},
|
||||||
|
|
||||||
local node_box = {
|
["inactive"] = {
|
||||||
type = "fixed",
|
"default_stone.png",
|
||||||
fixed = {
|
},
|
||||||
{-0.4375, -0.3125, -0.4375, -0.375, 0.4375, 0.4375},
|
}
|
||||||
{-0.4375, -0.3125, -0.4375, 0.4375, 0.4375, -0.375},
|
|
||||||
{ 0.375, -0.3125, -0.4375, 0.4375, 0.4375, 0.4375},
|
|
||||||
{-0.4375, -0.3125, 0.375, 0.4375, 0.4375, 0.4375},
|
|
||||||
{-0.4375, -0.25, -0.375, 0.4375, 0.25, 0.375},
|
|
||||||
{ -0.5, 0, -0.5, 0.5, 0.125, 0.5},
|
|
||||||
{ -0.25, -0.5, -0.3125, 0.25, -0.3125, 0.3125},
|
|
||||||
{-0.3125, -0.5, -0.25, 0.3125, -0.3125, 0.25},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
local selection_box = {
|
local node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
{-0.4375, -0.5, -0.4375, 0.4375, 0.4375, 0.4375},
|
{-0.4375, -0.3125, -0.4375, -0.375, 0.4375, 0.4375},
|
||||||
},
|
{-0.4375, -0.3125, -0.4375, 0.4375, 0.4375, -0.375},
|
||||||
}
|
{ 0.375, -0.3125, -0.4375, 0.4375, 0.4375, 0.4375},
|
||||||
|
{-0.4375, -0.3125, 0.375, 0.4375, 0.4375, 0.4375},
|
||||||
|
{-0.4375, -0.25, -0.375, 0.4375, 0.25, 0.375},
|
||||||
|
{ -0.5, 0, -0.5, 0.5, 0.125, 0.5},
|
||||||
|
{ -0.25, -0.5, -0.3125, 0.25, -0.3125, 0.3125},
|
||||||
|
{-0.3125, -0.5, -0.25, 0.3125, -0.3125, 0.25},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
maidroid_tool.register_writer("maidroid_tool:egg_writer", {
|
local selection_box = {
|
||||||
description = "maidroid tool : egg writer",
|
type = "fixed",
|
||||||
formspec = formspec,
|
fixed = {
|
||||||
tiles = tiles,
|
{-0.4375, -0.5, -0.4375, 0.4375, 0.4375, 0.4375},
|
||||||
node_box = node_box,
|
},
|
||||||
selection_box = selection_box,
|
}
|
||||||
duration = 40,
|
|
||||||
empty_itemname = "maidroid:empty_egg",
|
maidroid_tool.register_writer("maidroid_tool:egg_writer", {
|
||||||
dye_item_map = dye_item_map,
|
description = "maidroid tool : egg writer",
|
||||||
})
|
formspec = formspec,
|
||||||
|
tiles = tiles,
|
||||||
|
node_box = node_box,
|
||||||
|
selection_box = selection_box,
|
||||||
|
duration = 40,
|
||||||
|
empty_itemname = "maidroid:empty_egg",
|
||||||
|
dye_item_map = dye_item_map,
|
||||||
|
})
|
||||||
|
|
||||||
|
end -- register egg writer
|
||||||
|
|
||||||
|
do -- register a definition of an egg entity
|
||||||
|
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user