` worldNPCDialogText = "" worldPlayerDialogChoices = {} previousTop = nil scrolled = false scrollToBottom = false function dialogEntryGreyed() return not worldScreen:GetInControlOfDialog() end function resizeDialog() previousTop = nil scrolled = false end function dialogScroll(top, height, contentHeight) if scrolled then if scrollToBottom and contentHeight > height then scrollToBottom = false return height - contentHeight end return nil end if previousTop ~= nil and top ~= previousTop then scrolled = true scrollToBottom = true return -1 end previousTop = -1 return -1 end function getDialogEntryText(row) local text = worldPlayerDialogChoices[row - 2].text if (row == worldPlayerDialogSelection) then --Color the text white when selected text = string.gsub(text, "%^0xff212eff", "^0xFFFFFFFF") end return text end function mergeDialog(t) local dialog = {} for key, value in pairs(t) do dialog[key] = value end table.insert(dialog, 1, '') table.insert(dialog, 1, '') return dialog end ` menu { name 'WORLD_DIALOG' offset 0 -57 align center bottom ignoreEsc onOpen " local x,y,w,h = Infinity_GetArea('worldDialogBackground') toolbarTop = toolbarTop + h Infinity_PushMenu('WORLD_DIALOG_CONFIRM') greySidebars() previousTop = nil scrolled = false scrollToBottom = false " onClose " local x,y,w,h = Infinity_GetArea('worldDialogBackground') toolbarTop = toolbarTop - h Infinity_PopMenu('WORLD_DIALOG_CONFIRM') ungreySidebars() " label { name "worldDialogBackground" area 0 0 863 253 rectangle 4 } label { name "worldDialogPortraitArea" area 24 24 54 84 bitmap lua "worldNPCDialogPortrait" } list { column { width 100 label { area 0 0 -1 1 enabled "rowNumber == 1 and not scrolled" } text { area 0 0 -1 -1 pad 0 0 0 12 enabled "rowNumber == 2 and scrolled" text lua "worldMessageBoxText" text style "gamelog" } text { area 0 0 -1 -1 pad 0 0 0 12 enabled "rowNumber == 2 and not scrolled" text lua "worldNPCDialogText:gsub('\n', ': ', 1)" text style "gamelog" } label { area 0 0 -1 -1 pad 12 0 0 0 enabled "rowNumber > 2 and dialogEntryGreyed()" rectangle 1 rectangle opacity 100 } text { area 0 0 -1 -1 pad 12 0 0 0 enabled "rowNumber > 2" text lua "getDialogEntryText(rowNumber)" text style "gamelog" } } name "worldPlayerDialogChoicesList" area 88 24 756 205 rowheight dynamic hideHighlight table "mergeDialog(worldPlayerDialogChoices)" var "worldPlayerDialogSelection" scrollbar 'GUISCRC' scrollbar func "dialogScroll" actionEnter " worldPlayerDialogSelection = mouseoverRow " actionExit " worldPlayerDialogSelection = 0 " action " if (worldPlayerDialogChoices[worldPlayerDialogSelection - 2] == nil) then return end worldScreen:OnDialogReplyClick(worldPlayerDialogChoices[worldPlayerDialogSelection - 2].marker) worldPlayerDialogSelection = 0 " } } ` function getDialogButtonEnabled() return (#worldPlayerDialogChoices == 0) end ` menu { name 'WORLD_DIALOG_CONFIRM' align center bottom ignoreEsc button { area 0 0 300 45 bam GUIBUTWT text lua "dialogButtonText" enabled "getDialogButtonEnabled()" text style "button" action " worldScreen:StepDialog() " } }