From b1eeee3a080e71a5afd75c45eca3036c8e2f0cf5 Mon Sep 17 00:00:00 2001 From: DarkGod <darkgod@net-core.org> Date: Fri, 18 Oct 2019 13:07:39 +0200 Subject: [PATCH] plop --- game/engines/default/engine/ui/Dialog.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/engines/default/engine/ui/Dialog.lua b/game/engines/default/engine/ui/Dialog.lua index ee516c2b4f..7f65c552fb 100644 --- a/game/engines/default/engine/ui/Dialog.lua +++ b/game/engines/default/engine/ui/Dialog.lua @@ -89,10 +89,10 @@ function _M:simpleWaiterTip(title, text, tip, width, count, max) end --- Requests a simple, press any key, dialog -function _M:listPopup(title, text, list, w, h, fct) +function _M:listPopup(title, text, list, w, h, fct, select_fct) local d = new(title, 1, 1) local desc = require("engine.ui.Textzone").new{width=w, auto_height=true, text=text, scrollbar=true} - local l = require("engine.ui.List").new{width=w, height=h-16 - desc.h, list=list, fct=function() d.key:triggerVirtual("ACCEPT") end} + local l = require("engine.ui.List").new{width=w, height=h-16 - desc.h, list=list, fct=function() d.key:triggerVirtual("ACCEPT") end, select=function(item) if select_fct then select_fct(item) end end} d:loadUI{ {left = 3, top = 3, ui=desc}, {left = 3, top = 3 + desc.h + 3, ui=require("engine.ui.Separator").new{dir="vertical", size=w - 12}}, -- GitLab