Example #1
0
 private void RestoreDefaults()
 {
     Settings = new LuaConsoleSettings();
     LuaListView.AllColumns.Clear();
     SetColumns();
     UpdateDialog();
 }
Example #2
0
        private void LuaConsole_Load(object sender, EventArgs e)
        {
            // Hack for previous config settings
            if (Settings.Columns.Any(c => c.Text == null))
            {
                Settings = new LuaConsoleSettings();
            }

            LuaImp.ScriptList.ChangedCallback = SessionChangedCallback;
            LuaImp.ScriptList.LoadCallback    = ClearOutputWindow;

            if (Global.Config.RecentLuaSession.AutoLoad && !Global.Config.RecentLuaSession.Empty)
            {
                LoadSessionFromRecent(Global.Config.RecentLuaSession.MostRecent);
            }
            else if (Global.Config.RecentLua.AutoLoad)
            {
                if (!Global.Config.RecentLua.Empty)
                {
                    LoadLuaFromRecent(Global.Config.RecentLua.MostRecent);
                }
            }

            LuaListView.AllColumns.Clear();
            SetColumns();
        }
Example #3
0
        public LuaConsole()
        {
            Settings          = new LuaConsoleSettings();
            _sortReverse      = false;
            _lastColumnSorted = "";

            InitializeComponent();

            Closing += (o, e) =>
            {
                if (AskSaveChanges())
                {
                    SaveColumnInfo(LuaListView, Settings.Columns);

                    GlobalWin.DisplayManager.ClearLuaSurfaces();
                    LuaImp.GuiLibrary.DrawFinish();
                    CloseLua();
                }
                else
                {
                    e.Cancel = true;
                }
            };

            LuaListView.QueryItemText    += LuaListView_QueryItemText;
            LuaListView.QueryItemBkColor += LuaListView_QueryItemBkColor;
            LuaListView.QueryItemImage   += LuaListView_QueryItemImage;
            LuaListView.QueryItemIndent  += LuaListView_QueryItemIndent;
            LuaListView.VirtualMode       = true;

            // this is bad, in case we ever have more than one gui part running lua.. not sure how much other badness there is like that
            LuaSandbox.DefaultLogger = ConsoleLog;
        }
Example #4
0
        public LuaConsole()
        {
            Settings          = new LuaConsoleSettings();
            _sortReverse      = false;
            _lastColumnSorted = "";

            InitializeComponent();

            Closing += (o, e) =>
            {
                if (AskSaveChanges())
                {
                    Settings.Columns = LuaListView.AllColumns;

                    GlobalWin.DisplayManager.ClearLuaSurfaces();

                    if (GlobalWin.DisplayManager.ClientExtraPadding != Padding.Empty)
                    {
                        GlobalWin.DisplayManager.ClientExtraPadding = new Padding(0);
                        GlobalWin.MainForm.FrameBufferResized();
                    }

                    if (GlobalWin.DisplayManager.GameExtraPadding != Padding.Empty)
                    {
                        GlobalWin.DisplayManager.GameExtraPadding = new Padding(0);
                        GlobalWin.MainForm.FrameBufferResized();
                    }

                    LuaImp.GuiLibrary.DrawFinish();
                    CloseLua();
                }
                else
                {
                    e.Cancel = true;
                }
            };

            LuaListView.QueryItemText    += LuaListView_QueryItemText;
            LuaListView.QueryItemBkColor += LuaListView_QueryItemBkColor;
            LuaListView.QueryItemIcon    += LuaListView_QueryItemImage;

            // this is bad, in case we ever have more than one gui part running lua.. not sure how much other badness there is like that
            LuaSandbox.DefaultLogger = ConsoleLog;
        }
Example #5
0
		public LuaConsole()
		{
			Settings = new LuaConsoleSettings();
			_sortReverse = false;
			_lastColumnSorted = string.Empty;
			_luaList = new LuaFileList
			{
				ChangedCallback = SessionChangedCallback,
				LoadCallback = ClearOutputWindow
			};

			InitializeComponent();

			Closing += (o, e) =>
			{
				if (AskSaveChanges())
				{
					SaveColumnInfo(LuaListView, Settings.Columns);
					CloseLua();
					GlobalWin.DisplayManager.ClearLuaSurfaces();
				}
				else
				{
					e.Cancel = true;
				}
			};

			LuaListView.QueryItemText += LuaListView_QueryItemText;
			LuaListView.QueryItemBkColor += LuaListView_QueryItemBkColor;
			LuaListView.QueryItemImage += LuaListView_QueryItemImage;
			LuaListView.QueryItemIndent += LuaListView_QueryItemIndent;
			LuaListView.VirtualMode = true;

			LuaSandbox.SetLogger(this.ConsoleLog);
			LuaSandbox.SetCurrentDirectory(PathManager.GetLuaPath());
		}
Example #6
0
		public LuaConsole()
		{
			Settings = new LuaConsoleSettings();
			_sortReverse = false;
			_lastColumnSorted = string.Empty;
			_luaList = new LuaFileList
			{
				ChangedCallback = SessionChangedCallback,
				LoadCallback = ClearOutputWindow
			};

			InitializeComponent();

			Closing += (o, e) =>
			{
				if (AskSaveChanges())
				{
					SaveColumnInfo(LuaListView, Settings.Columns);
					CloseLua();
					GlobalWin.DisplayManager.ClearLuaSurfaces();
				}
				else
				{
					e.Cancel = true;
				}
			};

			LuaListView.QueryItemText += LuaListView_QueryItemText;
			LuaListView.QueryItemBkColor += LuaListView_QueryItemBkColor;
			LuaListView.QueryItemImage += LuaListView_QueryItemImage;
			LuaListView.QueryItemIndent += LuaListView_QueryItemIndent;
			LuaListView.VirtualMode = true;

			//this is bad, in case we ever have more than one gui part running lua.. not sure how much other badness there is like that
			LuaSandbox.DefaultLogger = ConsoleLog;
		}