From 493713fc7595c4520eac54f146366f5a3a363f0b Mon Sep 17 00:00:00 2001 From: Elkien3 Date: Thu, 19 Oct 2017 09:05:58 -0500 Subject: [PATCH] Fix ctf diplo scrolling there are only 4 entries shown, not 5. tweaked some other things too --- mods/ctf_pvp_engine/ctf/gui.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mods/ctf_pvp_engine/ctf/gui.lua b/mods/ctf_pvp_engine/ctf/gui.lua index 67d0e61..4fc473b 100644 --- a/mods/ctf_pvp_engine/ctf/gui.lua +++ b/mods/ctf_pvp_engine/ctf/gui.lua @@ -157,18 +157,18 @@ ctf.gui.register_tab("diplo", "Diplomacy", function(name, tname) for i = 1, #data do scroll_max = i end - scroll_max = scroll_max - 5 + scroll_max = scroll_max - 4 - if scroll_diplomacy > (scroll_max+5) then - scroll_diplomacy = (scroll_max+5) + if scroll_diplomacy > (scroll_max+4) then + scroll_diplomacy = (scroll_max+4) end if scroll_diplomacy > 0 then result = result .. "button[9.2,0.44;1,3;scroll_up;Up]" - end - if scroll_diplomacy <= scroll_max then + end + if scroll_diplomacy < scroll_max then result = result .. "button[9.2,3.8;1,3;scroll_down;Down]" - end + end for i = 1, #data do amount = i @@ -325,7 +325,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) ctf.gui.show(name, "diplo", cur_team) end if fields.scroll_down then - if scroll_diplomacy < (scroll_max+5) then + if scroll_diplomacy < (scroll_max) then scroll_diplomacy = scroll_diplomacy + 1 else scroll_diplomacy = scroll_max