Dialogues: Made multi-option dialogue less tall, negative option now normally spaced compared to the rest of the buttons.
Slight code cleanup.
This commit is contained in:
parent
0b0abc4706
commit
da30d96395
@ -28,13 +28,13 @@ function npc.dialogue.show_options_dialogue(self,
|
|||||||
dismiss_option_label,
|
dismiss_option_label,
|
||||||
player_name)
|
player_name)
|
||||||
local options_length = table.getn(responses) + 1
|
local options_length = table.getn(responses) + 1
|
||||||
local formspec_height = (options_length * 0.7) + 0.7
|
local formspec_height = (options_length * 0.7) + 0.4
|
||||||
local formspec = "size[7,"..tostring(formspec_height).."]"
|
local formspec = "size[7,"..tostring(formspec_height).."]"
|
||||||
|
|
||||||
for i = 1, #responses do
|
for i = 1, #responses do
|
||||||
local y = 0.7;
|
local y = 0.8;
|
||||||
if i > 1 then
|
if i > 1 then
|
||||||
y = (y * i)
|
y = (0.7 * i)
|
||||||
end
|
end
|
||||||
formspec = formspec.."button_exit[0.5,"
|
formspec = formspec.."button_exit[0.5,"
|
||||||
..(y - 0.5)..";6,0.5;opt"..tostring(i)..";"..responses[i].text.."]"
|
..(y - 0.5)..";6,0.5;opt"..tostring(i)..";"..responses[i].text.."]"
|
||||||
|
6
npc.lua
6
npc.lua
@ -11,11 +11,6 @@ npc.MALE = "male"
|
|||||||
|
|
||||||
npc.INVENTORY_ITEM_MAX_STACK = 99
|
npc.INVENTORY_ITEM_MAX_STACK = 99
|
||||||
|
|
||||||
mobs.npc_drops = {
|
|
||||||
"default:pick_steel", "mobs:meat", "default:sword_steel",
|
|
||||||
"default:shovel_steel", "farming:bread", "bucket:bucket_water"
|
|
||||||
}
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------
|
||||||
-- General functions
|
-- General functions
|
||||||
---------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------
|
||||||
@ -107,7 +102,6 @@ end
|
|||||||
-- the item string or nil if not found
|
-- the item string or nil if not found
|
||||||
function npc.inventory_contains(self, item_name)
|
function npc.inventory_contains(self, item_name)
|
||||||
for key,value in pairs(self.inventory) do
|
for key,value in pairs(self.inventory) do
|
||||||
minetest.log("Key: "..dump(key)..", value: "..dump(value))
|
|
||||||
if value ~= "" and string.find(value, item_name) then
|
if value ~= "" and string.find(value, item_name) then
|
||||||
return {slot=key, item_string=value}
|
return {slot=key, item_string=value}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user