|
7 | 7 | local S = minetest.get_translator("bones") |
8 | 8 |
|
9 | 9 | local bones_max_slots = tonumber(minetest.settings:get("bones_max_slots")) or 15 * 10 |
10 | | -local min_inv_size = 4 * 8 -- display and provide at least this many slots |
| 10 | +local min_inv_size = 4 * 8 -- display and provide at least this many slots |
11 | 11 |
|
12 | 12 | bones = {} |
13 | 13 |
|
@@ -44,14 +44,13 @@ local function get_bones_formspec_for_size(numitems) |
44 | 44 | end |
45 | 45 | local output={} |
46 | 46 | appendmulti(output, "size[", 8.5, ",", 9, "]") |
47 | | - if scroll then |
48 | | - -- ok so I don't want to figure out the constants for (rows-delta)*multiplier so I'll let this code do it for me |
| 47 | + if scroll then |
49 | 48 | local row_05=13.2 |
50 | 49 | local row_15=128 |
51 | 50 | local multiplier=(row_15-row_05)/10 |
52 | 51 | appendmulti(output, "scrollbaroptions[max=",(rows-5)*multiplier+row_05,"]") |
53 | | - appendmulti(output, "scrollbar[8,0;0.3,4.5;vertical;bones_scroll;0]") |
54 | | - appendmulti(output, "scroll_container[0,0.3;10.3,4.95;bones_scroll;vertical;0.1]") |
| 52 | + appendmulti(output, "scrollbar[8,0;0.3,4.5;vertical;bones_scroll;0]", |
| 53 | + "scroll_container[0,0.3;10.3,4.95;bones_scroll;vertical;0.1]") |
55 | 54 | end |
56 | 55 | appendmulti(output, "list[current_name;main;0,0;", cols, ",", rows, ";]") |
57 | 56 | if scroll then |
@@ -362,7 +361,8 @@ local function place_bones(player, bones_pos, items) |
362 | 361 | bones_meta:set_string("owner", player_name) |
363 | 362 | if share_bones_time ~= 0 then |
364 | 363 | bones_meta:set_string("infotext", S("@1's fresh bones", player_name)) |
365 | | - if share_bones_time_early == 0 or not minetest.is_protected(bones_pos, player_name) then |
| 364 | + if share_bones_time_early == 0 or |
| 365 | + not minetest.is_protected(bones_pos, player_name) then |
366 | 366 | bones_meta:set_int("time", 0) |
367 | 367 | else |
368 | 368 | bones_meta:set_int("time", share_bones_time - share_bones_time_early) |
|
0 commit comments