Skip to content

Commit

Permalink
Updated mod finder, download process, update check;
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmann committed May 22, 2017
1 parent ccef302 commit 6a06707
Show file tree
Hide file tree
Showing 27 changed files with 274 additions and 198 deletions.
17 changes: 16 additions & 1 deletion VMM/forms/About.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions VMM/forms/About.vb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Public Class About
Private Sub _update_check_NoUpdate() Handles _update_check.NoUpdate
lbl_up_to_date.Visible = True
lbl_checking_update.Visible = False
pb_up_to_date.Visible = True
End Sub

Private Sub _update_check_UpdateAvailable(File As FileInfo) Handles _update_check.UpdateAvailable
Expand All @@ -24,6 +25,8 @@ Public Class About
lbl_update.Visible = False
btn_update.Visible = False
lbl_checking_update.Visible = True
pb_up_to_date.Visible = False
lbl_up_to_date.Visible = False
_update_check.CheckForUpdate()
End Sub
End Class
29 changes: 22 additions & 7 deletions VMM/forms/Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,30 @@ Public Class main
Private Sub _download_mod_DownloadFinished() Handles _download_mod.DownloadFinished
_mods = ModHelper.FindMods()

_mod_module.Close()
_mod_module = New ModuleMods() '_profiles, _settings, _mods)
_mod_module.Show(DockPanel1, DockState.Document)
Me.SuspendLayout()
DockPanel1.SuspendLayout()
'_mod_module.Close()
'_mod_module = New ModuleMods() '_profiles, _settings, _mods)
'_mod_module.Show(DockPanel1, DockState.Document)
_mod_module.UpdateData(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
_mod_module.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
show_modules()
DockPanel1.ResumeLayout()
Me.ResumeLayout()

_controls.UpdateUI(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
End Sub

Private Sub _mod_downloader_DownloadFinished() Handles _mod_downloader.DownloadFinished
_download_mod_DownloadFinished()

Me.SuspendLayout()
DockPanel1.SuspendLayout()
If _mod_downloader.DockState = DockState.Document Then
_mod_downloader.Show(DockPanel1, DockState.Document)
End If
DockPanel1.ResumeLayout()
Me.ResumeLayout()

End Sub

Expand All @@ -128,7 +137,7 @@ Public Class main
SettingsBakery.Save(_settings)
End Sub

Private Sub _controls_ManageProfiles() Handles _controls.ManageProfiles
Private Sub _controls_ManageProfiles() Handles _controls.ManageProfiles, _mod_module.ManageProfiles
'Dim pm As New ProfileManager() '_profiles)
'pm.ShowDialog()
_profile_manager.Show(DockPanel1, DockState.Document)
Expand Down Expand Up @@ -178,10 +187,12 @@ Public Class main
_mod_module = New ModuleMods
_mod_module.Show(DockPanel1, DockState.Document)
_mod_module.UpdateData(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
_mod_module.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))

_controls = New ModuleControl()
_controls.Show(DockPanel1, DockState.DockTop)
_controls.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
_controls.UpdateUI(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
'_controls.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))

'_read_me = New ModuleReadMe()
_output = New ModuleOutput
Expand Down Expand Up @@ -243,7 +254,7 @@ Public Class main
Output("Settings saved.")
'_settings.Patched = Not _settings.Patched
'_controls.OnInstallerRun()
_controls.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
_mod_module.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
_mod_module.UpdateData(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
End Sub

Expand Down Expand Up @@ -297,12 +308,16 @@ Public Class main

Dim _pane As DockPane = Nothing

Me.SuspendLayout()
DockPanel1.SuspendLayout()
If _settings.HideModule.Contains("Output") Then
_output.Show(DockPanel1, DockState.DockBottomAutoHide)
Else
_output.Show(DockPanel1, DockState.DockBottom)
End If
_mod_module.ShowModules(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
DockPanel1.ResumeLayout()
Me.ResumeLayout()
'If _settings.HideModule.Contains("ReadMe") Then
' _read_me.Show(DockPanel1, DockState.DockRightAutoHide)
'Else
Expand Down Expand Up @@ -365,7 +380,7 @@ Public Class main
End Sub

Private Sub _profile_manager_UpdateProfiles() Handles _profile_manager.UpdateProfiles
_controls.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
_mod_module.UpdateProfiles(New ModuleArgs(_profiles, _settings, _mods, selected_profile()))
End Sub

Private Sub _controls_FindMods() Handles _controls.FindMods
Expand Down
25 changes: 3 additions & 22 deletions VMM/forms/Modules/ModuleControl.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 34 additions & 33 deletions VMM/forms/Modules/ModuleControl.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Public Class ModuleControl

' ##### Events ################################################################################

Private Sub cmb_profiles_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmb_profiles.SelectedIndexChanged
handle_combobox()
End Sub
'Private Sub cmb_profiles_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmb_profiles.SelectedIndexChanged
' handle_combobox()
'End Sub

Private Sub btn_install_Click(sender As Object, e As EventArgs) Handles btn_install.Click
RaiseEvent InstallFramework()
Expand Down Expand Up @@ -46,12 +46,12 @@ Public Class ModuleControl
update_ui(Args.Settings)
End Sub

Public Sub UpdateProfiles(Args As main.ModuleArgs)
'list_profiles(Args.Profiles)
'cmb_profiles.SelectedItem = Args.SelectedProfile.Name
'update_ui(Args.Settings)
update_profiles(Args)
End Sub
'Public Sub UpdateProfiles(Args As main.ModuleArgs)
' 'list_profiles(Args.Profiles)
' 'cmb_profiles.SelectedItem = Args.SelectedProfile.Name
' 'update_ui(Args.Settings)
' update_profiles(Args)
'End Sub

' ##### Functionality ################################################################################

Expand All @@ -64,31 +64,32 @@ Public Class ModuleControl
btn_install.Image = My.Resources.uninstall_16
End If
btn_install.Enabled = PathHelper.HasFiles(PathHelper.Mods)
cmb_profiles.Enabled = Settings.Patched And PathHelper.HasFiles(PathHelper.Mods)
End Sub

Private Sub update_profiles(Args As main.ModuleArgs)
list_profiles(Args.Profiles)
cmb_profiles.SelectedItem = Args.SelectedProfile.Name
update_ui(Args.Settings)
btn_find_mods.Enabled = Settings.Patched And PathHelper.HasFiles(PathHelper.Repository)
'cmb_profiles.Enabled = Settings.Patched And PathHelper.HasFiles(PathHelper.Mods)
End Sub

Private Sub list_profiles(Profiles As List(Of VermintideProfile))
cmb_profiles.Items.Clear()
cmb_profiles.Items.Add("[Manage]")
For Each p As VermintideProfile In Profiles
cmb_profiles.Items.Add(p.Name)
Next
End Sub

Private Sub handle_combobox()
If cmb_profiles.SelectedIndex = 0 Then
cmb_profiles.SelectedIndex = exclude_manage
RaiseEvent ManageProfiles()
Else
exclude_manage = cmb_profiles.SelectedIndex
RaiseEvent SelectProfile(cmb_profiles.Items(cmb_profiles.SelectedIndex))
End If
End Sub
'Private Sub update_profiles(Args As main.ModuleArgs)
' list_profiles(Args.Profiles)
' cmb_profiles.SelectedItem = Args.SelectedProfile.Name
' update_ui(Args.Settings)
'End Sub

'Private Sub list_profiles(Profiles As List(Of VermintideProfile))
' cmb_profiles.Items.Clear()
' cmb_profiles.Items.Add("[Manage]")
' For Each p As VermintideProfile In Profiles
' cmb_profiles.Items.Add(p.Name)
' Next
'End Sub

'Private Sub handle_combobox()
' If cmb_profiles.SelectedIndex = 0 Then
' cmb_profiles.SelectedIndex = exclude_manage
' RaiseEvent ManageProfiles()
' Else
' exclude_manage = cmb_profiles.SelectedIndex
' RaiseEvent SelectProfile(cmb_profiles.Items(cmb_profiles.SelectedIndex))
' End If
'End Sub

End Class
1 change: 1 addition & 0 deletions VMM/forms/Modules/ModuleDownload.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion VMM/forms/Modules/ModuleModBrowser.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions VMM/forms/Modules/ModuleModBrowser.vb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Public Class ModuleModBrowser

Private Sub list_files(Files As List(Of FileInfo))
RaiseEvent RequestCheckModsInstalled(Files)
Dim scroll As Integer = DataGridView1.FirstDisplayedScrollingRowIndex
DataGridView1.Rows.Clear()
For Each file As FileInfo In Files
DataGridView1.Rows.Add(file.DisplayName, file.Version, String.Format("{0} KB", FormatNumber(file.Size / 1024, 2)), "", "", file.Type)
Expand All @@ -84,6 +85,9 @@ Public Class ModuleModBrowser

End If
Next
If scroll >= 0 And scroll <= DataGridView1.Rows.Count Then
DataGridView1.FirstDisplayedScrollingRowIndex = scroll
End If
End Sub

Private Sub _fetcher_DoWork(sender As Object, e As DoWorkEventArgs) Handles _fetcher.DoWork
Expand Down
1 change: 1 addition & 0 deletions VMM/forms/Modules/ModuleModContent.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion VMM/forms/Modules/ModuleModContent.resx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC4
DAAAAk1TRnQBSQFMAgEBBQEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DAAAAk1TRnQBSQFMAgEBBQEAATgBAAE4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
Expand Down
Loading

0 comments on commit 6a06707

Please sign in to comment.