예제 #1
0
        void CboxScriptNameChangedHandler(object sender, EventArgs args)
        {
            var name = cboxScriptName.Text;

            if (name == preScriptName)
            {
                return;
            }

            if (IsChanged() && !VgcApis.Misc.UI.Confirm(I18N.DiscardUnsavedChanges))
            {
                cboxScriptName.Text = preScriptName;
                return;
            }

            preScriptName    = name;
            preScriptContent = settings.GetLuaCoreSettings()
                               .Where(s => s.name == name)
                               .FirstOrDefault()
                               ?.script
                               ?? string.Empty;

            editor.Text = preScriptContent;
            SetCurFileName("");
        }
예제 #2
0
 string LoadScriptByName(string name) =>
 settings.GetLuaCoreSettings()
 .Where(s => s.name == name)
 .FirstOrDefault()
 ?.script
 ?? string.Empty;