From e4e625fcf6352ab70d0e0f4e8514fad0a713ed83 Mon Sep 17 00:00:00 2001 From: 140bpmdubstep Date: Fri, 28 Aug 2020 10:43:04 +0400 Subject: [PATCH] Allow to title file dialogs via Title field --- Internal/UI/Dialog.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Internal/UI/Dialog.lua b/Internal/UI/Dialog.lua index 10e9282..8175c27 100644 --- a/Internal/UI/Dialog.lua +++ b/Internal/UI/Dialog.lua @@ -409,14 +409,14 @@ function Dialog.FileDialog(Options) Options.AllowMultiSelect = Options.AllowMultiSelect == nil and true or Options.AllowMultiSelect Options.Directory = Options.Directory == nil and nil or Options.Directory Options.Type = Options.Type == nil and 'openfile' or Options.Type + Options.Title = Options.Title == "File dialog" or Options.Title Options.Filters = Options.Filters == nil and {{"*.*", "All Files"}} or Options.Filters - local Title = "Open File" if Options.Type == 'savefile' then Options.AllowMultiSelect = false - Title = "Save File" + if not Options.Title then Options.Title = "Save File" end elseif Options.Type == 'opendirectory' then - Title = "Open Directory" + if not Options.Title then Options.Title = "Open Directory" end end local Result = {Button = "", Files = {}} @@ -426,7 +426,7 @@ function Dialog.FileDialog(Options) local W = love.graphics.getWidth() * 0.65 local H = love.graphics.getHeight() * 0.65 if Dialog.Begin('FileDialog', { - Title = Title, + Title = Options.Title, AutoSizeWindow = false, W = W, H = H,