public override void OnDraw(int windowId)
        {
            Window(this.title);

            sectionMain.Begin(0, WINDOW_TITLE_HEIGHT + sectionMain.ControlPadding, this.ParentContainer.width, this.ParentContainer.height);

            if (selectedSave == null && selectedBackup == null)
            {
                switch (this.viewState)
                {
                    case ViewState.LIST_SAVES:
                        if (selectedSave == null)
                        {
                            if (sectionMain.CheckBox("Auto Backup", ref modSettings.isAutoBackupsEnabled))
                            {
                                modSettings.saveSettings();
                            }
                        }
                        sectionMain.LabelCentered("Saves");
                        break;

                    case ViewState.LIST_BACKUPS:
                        sectionMain.LabelCentered("Backups");
                        break;
                }
            }

            sectionScroll.Begin(0, sectionMain.ControlYPosition - sectionScroll.ControlMargin, this.ParentContainer.width, sectionMain.ControlHeight * 10);

            switch (this.viewState)
            {
                case ViewState.LIST_SAVES:
                    if (selectedSave == null)
                    {
                        foreach (GameSaveService.SaveGameInfo saveGameInfo in this.gameSaves)
                        {
                            if (sectionScroll.Button(saveGameInfo.Name))
                            {
                                selectedSave = saveGameInfo;
                            }
                        }
                    }
                    else
                    {
                        sectionScroll.LabelCentered(selectedSave.Name);
                        sectionScroll.LabelCentered(gameSaveService.getDate(selectedSave));

                        if (sectionScroll.Button("Backup"))
                        {
                            gameSaveService.createBackup(selectedSave);
                            selectedSave = null;
                        }

                        if (sectionScroll.Button("Delete"))
                        {
                            gameSaveService.deleteSave(selectedSave);
                            selectedSave = null;
                        }
                    }

                    break;

                case ViewState.LIST_BACKUPS:
                    if (selectedBackup == null)
                    {
                        foreach (GameSaveService.SaveGameInfo saveGameInfo in this.backups)
                        {
                            if (sectionScroll.Button(gameSaveService.getSettlementName(saveGameInfo)))
                            {
                                selectedBackup = saveGameInfo;
                            }

                            sectionScroll.LabelCentered(gameSaveService.getDate(saveGameInfo));
                        }
                    }
                    else
                    {
                        sectionScroll.LabelCentered(gameSaveService.getSettlementName(selectedBackup));
                        sectionScroll.LabelCentered(gameSaveService.getDate(selectedBackup));

                        if (sectionScroll.Button("Restore"))
                        {
                            gameSaveService.restoreBackup(selectedBackup);
                            selectedBackup = null;
                        }

                        if (sectionScroll.Button("Delete"))
                        {
                            gameSaveService.deleteSave(selectedBackup);
                            selectedBackup = null;
                        }
                    }

                    break;
            }

            sectionScroll.End();

            if (sectionScroll.hasChildren)
            {
                sectionMain.addSection(sectionScroll);
            }

            sectionMain.LabelLeft(String.Empty);

            switch (this.viewState)
            {
                case ViewState.LIST_SAVES:
                    if (selectedSave == null)
                    {
                        if (sectionMain.Button("Restore"))
                        {
                            this.viewState = ViewState.LIST_BACKUPS;
                        }
                    }
                    else
                    {
                        if (sectionMain.Button("Cancel"))
                        {
                            selectedSave = null;
                        }
                    }
                    break;

                case ViewState.LIST_BACKUPS:
                    if (selectedBackup == null)
                    {
                        if (sectionMain.Button("Cancel"))
                        {
                            this.viewState = ViewState.LIST_SAVES;
                        }
                    }
                    else
                    {
                        if (sectionMain.Button("Cancel"))
                        {
                            selectedBackup = null;
                        }
                    }
                    break;
            }

            sectionMain.End();

            GUI.DragWindow();

            if (sectionMain.hasChildren)
            {
                this.containerHeight = sectionMain.ControlYPosition + sectionMain.ControlMargin;
            }
            else this.containerHeight = sectionMain.ControlYPosition;
        }
 private void fileSystemWatcher_Changed(object sender, FileSystemEventArgs e)
 {
     if (modSettings.isAutoBackupsEnabled)
     {
         if (gameSaveService.isGameSave(e.FullPath))
         {
             GameSaveService.SaveGameInfo saveGameInfo = new GameSaveService.SaveGameInfo(e.FullPath);
             gameSaveService.createBackup(saveGameInfo);
             log("Backup saved for: " + saveGameInfo.Name);
         }
     }
 }