Fix right-click on town plot markers.
Additionally: - address some deprecated procedure calls. - ensure doors are not "group:wood" (only planks are used in crafting, and tidies crafting guide)pull/37/head
parent
e18250bcda
commit
93b57256af
|
@ -75,14 +75,6 @@ local function adventuretest_dignode(pos, node, digger)
|
|||
-- ENERGY
|
||||
pd.increment(name,"energy",-0.05)
|
||||
|
||||
-- EXPERIENCE
|
||||
if minetest.registered_nodes[node.name] ~= nil then
|
||||
if minetest.registered_nodes[node.name]["skill"] ~= nil then
|
||||
default.drop_item(pos,"experience:1_exp")
|
||||
skills.add_exp(name,5)
|
||||
end
|
||||
end
|
||||
|
||||
pd.increment(name,STAT_DUG,1)
|
||||
local dug = pd.get(name,STAT_DUG)
|
||||
if dug % 100 == 0 then
|
||||
|
|
|
@ -79,7 +79,7 @@ function boat.on_rightclick(self, clicker)
|
|||
minetest.after(0.2, function()
|
||||
default.player_set_animation(clicker, "sit" , 30)
|
||||
end)
|
||||
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
|
||||
self.object:setyaw(clicker:get_look_horizontal() - math.pi / 2)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
-- * table - very simple one
|
||||
-- * shelf - for storing things; this one is 3d
|
||||
-- * stovepipe - so that the smoke from the furnace can get away
|
||||
-- * washing place - put it over a water source and you can 'wash' yourshelf
|
||||
-- * washing place - put it over a water source and you can 'wash' yourself
|
||||
---------------------------------------------------------------------------------------
|
||||
-- TODO: change the textures of the bed (make the clothing white, foot path not entirely covered with cloth)
|
||||
|
||||
|
@ -224,8 +224,8 @@ minetest.register_node("cottages:shelf", {
|
|||
meta:set_string("formspec",
|
||||
"size[8,8]"..
|
||||
"list[current_name;main;0,0;8,3;]"..
|
||||
"list[current_player;main;0,4;8,4;]"
|
||||
.."listring[current_name;main]".."listring[current_player;main]")
|
||||
"list[current_player;main;0,4;8,4;]"..
|
||||
"listring[current_name;main]".."listring[current_player;main]")
|
||||
meta:set_string("infotext", S("open storage shelf"))
|
||||
local inv = meta:get_inventory();
|
||||
inv:set_size("main", 24);
|
||||
|
|
|
@ -815,16 +815,16 @@ minetest.register_node("default:sign_wall", {
|
|||
default.chest_formspec =
|
||||
"size[8,9]"..
|
||||
"list[current_name;main;0,0;8,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
.."listring[current_name;main]".."listring[current_player;main]"
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[]"
|
||||
|
||||
function default.get_locked_chest_formspec(pos)
|
||||
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||
local formspec =
|
||||
"size[8,9]"..
|
||||
"list[nodemeta:".. spos .. ";main;0,0;8,4;]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
.."listring[[nodemeta:".. spos ..";main]".."listring[current_player;main]"
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[]"
|
||||
return formspec
|
||||
end
|
||||
|
||||
|
|
|
@ -42,15 +42,15 @@ dofile(handle_schematics.modpath.."/replacements_get_table.lua")
|
|||
|
||||
-- uses build_chest.* namespace
|
||||
-- a chest for spawning buildings manually
|
||||
--dofile(handle_schematics.modpath.."/build_chest.lua")
|
||||
dofile(handle_schematics.modpath.."/build_chest.lua")
|
||||
-- makes the replacements from replacements_group.* available to the build chest
|
||||
--dofile(handle_schematics.modpath.."/build_chest_handle_replacements.lua");
|
||||
dofile(handle_schematics.modpath.."/build_chest_handle_replacements.lua");
|
||||
-- creates 2d previews of the schematic from left/right/back/front/top
|
||||
--dofile(handle_schematics.modpath.."/build_chest_preview_image.lua");
|
||||
dofile(handle_schematics.modpath.."/build_chest_preview_image.lua");
|
||||
-- reads a file and adds the files listed there as menu entries
|
||||
--dofile(handle_schematics.modpath.."/build_chest_add_schems_from_file.lua");
|
||||
dofile(handle_schematics.modpath.."/build_chest_add_schems_from_file.lua");
|
||||
-- locate schematics through directories
|
||||
--dofile(handle_schematics.modpath.."/build_chest_add_schems_by_directory.lua");
|
||||
dofile(handle_schematics.modpath.."/build_chest_add_schems_by_directory.lua");
|
||||
|
||||
-- the main functionality of the mod;
|
||||
-- provides the function handle_schematics.place_building_from_file
|
||||
|
|
|
@ -139,7 +139,7 @@ local magicmissle_spell = {
|
|||
local dir = user:get_look_dir()
|
||||
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
|
||||
obj:setacceleration({x=dir.x*-3, y=-1, z=dir.z*-3})
|
||||
obj:setyaw(user:get_look_yaw()+math.pi)
|
||||
obj:setyaw(user:get_look_horizontal()+math.pi)
|
||||
obj:get_luaentity().player = user
|
||||
magic.update_magic(user,name)
|
||||
else
|
||||
|
|
|
@ -128,7 +128,7 @@ mg_villages.map_of_world = function( pname )
|
|||
end
|
||||
|
||||
-- code and arrows taken from mapp mod
|
||||
local yaw = player:get_look_yaw()
|
||||
local yaw = player:get_look_horizontal()
|
||||
local rotate = 0;
|
||||
if yaw ~= nil then
|
||||
-- Find rotation and texture based on yaw.
|
||||
|
|
|
@ -44,8 +44,8 @@ minetest.is_protected = function(pos, name)
|
|||
local is_houseowner = false;
|
||||
for nr, p in pairs( mg_villages.all_villages[ village_id ].to_add_data.bpos ) do
|
||||
|
||||
trustedusers = p.can_edit
|
||||
trustedUser = false
|
||||
local trustedusers = p.can_edit
|
||||
local trustedUser = false
|
||||
if trustedusers ~= nil then
|
||||
for _,trusted in pairs(trustedusers) do
|
||||
if trusted == name then
|
||||
|
@ -136,8 +136,10 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
|
|||
return;
|
||||
end
|
||||
|
||||
local owner = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner;
|
||||
local btype = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].btype;
|
||||
local village = mg_villages.all_villages[ village_id ];
|
||||
local plot = village.to_add_data.bpos[ plot_nr ];
|
||||
-- local owner = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner;
|
||||
local btype = plot.btype;
|
||||
|
||||
local owner_name = plot.owner;
|
||||
if( not( owner_name ) or owner_name == "" ) then
|
||||
|
@ -160,8 +162,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
|
|||
-- create the header
|
||||
local formspec = "size[13,10]"..
|
||||
"label[3.3,0.0;Plot No.: "..tostring( plot_nr )..", with "..tostring( mg_villages.BUILDINGS[ plot.btype ].scm ).."]"..
|
||||
"label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..", which is "..tostring( distance ).." m away]"
|
||||
.."label[7.3,0.4;from the village center]"..
|
||||
"label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..", which is "..tostring( distance ).."m from the village center]"..
|
||||
"label[0.3,0.8;Part of village:]" .."label[3.3,0.8;"..(village.name or "- name unknown -").."]"
|
||||
.."label[7.3,0.8;located at "..(village_pos).."]"..
|
||||
"label[0.3,1.2;Owned by:]" .."label[3.3,1.2;"..(owner_name).."]"..
|
||||
|
@ -338,10 +339,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
|
|||
local original_formspec = "size[8,3]"..
|
||||
"button[7.0,0.0;1.0,0.5;info;Info]"..
|
||||
"label[1.0,0.5;Plot No.: "..tostring( plot_nr ).."]"..
|
||||
"label[2.5,0.5;Building:]"..
|
||||
"label[3.5,0.5;"..tostring( mg_villages.BUILDINGS[btype].scm ).."]"..
|
||||
"label[2.5,0.5;Building: "..tostring( mg_villages.BUILDINGS[btype].scm ).." ]"..
|
||||
"field[20,20;0.1,0.1;pos2str;Pos;"..minetest.pos_to_string( pos ).."]";
|
||||
local formspec = "";
|
||||
local formspec = "";
|
||||
local ifinhabit = "";
|
||||
|
||||
-- Get Price
|
||||
|
@ -368,8 +368,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
|
|||
if (not(owner) or owner=='') then
|
||||
|
||||
formspec = original_formspec ..
|
||||
"label[1,1;You can buy this plot for]"..
|
||||
"label[3.8,1;"..tostring( price_stack:get_count() ).." x ]"..
|
||||
--"label[1,1;You can buy this plot for]"..
|
||||
--"label[3.8,1;"..tostring( price_stack:get_count() ).." x ]"..
|
||||
"label[1,1;You can buy this plot for "..tostring( price_stack:get_count() ).." x ]"..
|
||||
"item_image[4.3,0.8;1,1;"..( price_stack:get_name() ).."]"..
|
||||
ifinhabit..
|
||||
"button[2,2.5;1.5,0.5;buy;Buy plot]"..
|
||||
|
|
|
@ -321,10 +321,14 @@ function circular_saw.on_construct(pos)
|
|||
"button[1,3.2;1,1;Set;" ..S("Set").. "]" ..
|
||||
"list[current_name;output;2.8,0;8,6;]" ..
|
||||
"list[current_player;main;1.5,6.25;8,4;]"..
|
||||
"listring[current_name;output]".."listring[current_player;main]"..
|
||||
"listring[current_name;input]".."listring[current_player;main]"..
|
||||
"listring[current_name;micro]".."listring[current_player;main]"..
|
||||
"listring[current_name;recyle]".."listring[current_player;main]"..
|
||||
"listring[current_name;output]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;input]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;micro]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;recyle]"..
|
||||
"listring[current_player;main]"
|
||||
)
|
||||
|
||||
meta:set_int("anz", 0) -- No microblocks inside yet.
|
||||
|
|
|
@ -21,7 +21,7 @@ local throwing_shoot_arrow = function(itemstack, player)
|
|||
local dir = player:get_look_dir()
|
||||
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
|
||||
obj:setacceleration({x=dir.x*-3, y=weapon_def.drop_rate, z=dir.z*-3})
|
||||
obj:setyaw(player:get_look_yaw()+math.pi)
|
||||
obj:setyaw(player:get_look_horizontal()+math.pi)
|
||||
obj:get_luaentity().player = player
|
||||
obj:get_luaentity().max_damage = obj:get_luaentity().max_damage + weapon_def.damage_modifier
|
||||
minetest.sound_play("throwing_sound", {object=player})
|
||||
|
|
|
@ -14,7 +14,7 @@ function ts_doors.register_door(recipe, description, texture)
|
|||
tiles = {{ name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base.png^[noalpha^[makealpha:0,255,0", backface_culling = true }},
|
||||
description = description .. " Door",
|
||||
inventory_image = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_inv.png^[noalpha^[makealpha:0,255,0",
|
||||
groups = groups,
|
||||
groups = door_groups,
|
||||
recipe = {
|
||||
{recipe, recipe},
|
||||
{recipe, recipe},
|
||||
|
@ -23,14 +23,14 @@ function ts_doors.register_door(recipe, description, texture)
|
|||
})
|
||||
|
||||
|
||||
groups.level = 2
|
||||
door_groups.level = 2
|
||||
|
||||
doors.register("ts_door_locked_" .. recipe:gsub(":", "_"), {
|
||||
tiles = {{ name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_locked.png^[noalpha^[makealpha:0,255,0", backface_culling = true }},
|
||||
description = description .. " Locked Door",
|
||||
inventory_image = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_locked_inv.png^[noalpha^[makealpha:0,255,0",
|
||||
protected = true,
|
||||
groups = groups,
|
||||
groups = door_groups,
|
||||
sound_open = "doors_steel_door_open",
|
||||
sound_close = "doors_steel_door_close",
|
||||
recipe = {
|
||||
|
|
|
@ -49,6 +49,8 @@ local function inventory_set_formspec(player, size)
|
|||
.."list[current_player;main;"..(fsize_x-msize_x)..","..(fsize_y-msize_y+1.25)..";"..msize_x..","..(msize_y - 1)..";"..msize_x.."]"
|
||||
.."list[current_player;craft;"..(fsize_x-size-2)..",0;"..size..","..size..";]"
|
||||
.."list[current_player;craftpreview;"..(fsize_x-1)..","..(size/2-0.5)..";1,1;]"
|
||||
.."listring[current_player;main]"
|
||||
.."listring[current_player;craft]"
|
||||
for i = 0, msize_x - 1, 1 do
|
||||
formspec = formspec.."image["..(fsize_x-msize_x + i)..","..(fsize_y-msize_y)..";1,1;gui_hb_bg.png]"
|
||||
end
|
||||
|
@ -56,8 +58,8 @@ local function inventory_set_formspec(player, size)
|
|||
-- add the shortcut buttons
|
||||
if size ~= 3 then
|
||||
formspec = formspec .. "image_button[0.25,0.25;1,1;inventory_plus_zcg.png;zcg;]"
|
||||
formspec = formspec .. "image_button[1.25,0.25;1,1;inventory_plus_skins.png;skins;]"
|
||||
formspec = formspec .. "image_button[0.25,1.25;1,1;inventory_plus_armor.png;armor;]"
|
||||
.. "image_button[1.25,0.25;1,1;inventory_plus_skins.png;skins;]"
|
||||
.. "image_button[0.25,1.25;1,1;inventory_plus_armor.png;armor;]"
|
||||
end
|
||||
|
||||
player:set_inventory_formspec(formspec)
|
||||
|
|
Loading…
Reference in New Issue