Skip to content

Commit

Permalink
feat: enable virtualization
Browse files Browse the repository at this point in the history
DorielRivalet committed Mar 22, 2023
1 parent e06681a commit f68c7cc
Showing 3 changed files with 92 additions and 85 deletions.
158 changes: 80 additions & 78 deletions MHFZ_Overlay/ConfigWindow.xaml

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions MHFZ_Overlay/ConfigWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -556,7 +556,7 @@ public ConfigWindow(MainWindow mainWindow)
MonsterNameList.Add(monsterInfos[i].Name);
}

MonsterNameListBox.ItemsSource = MonsterNameList;
MonsterNameComboBox.ItemsSource = MonsterNameList;

_ = GetRepoStats();

@@ -1138,10 +1138,10 @@ private void ChangeMonsterInfo()
//TODO can be handled more elegantly
//see this
//string selectedOverlayMode = ((ComboBoxItem)configWindow.OverlayModeComboBox.SelectedItem).Content.ToString();
string selectedName = MonsterNameListBox.SelectedItem.ToString() + "";
string selectedName = MonsterNameComboBox.SelectedItem.ToString() + "";
selectedName = selectedName.Replace("System.Windows.Controls.ComboBoxItem: ", "");

string selectedMatchup = WeaponMatchupListBox.SelectedItem.ToString() + " " + MonsterNameListBox.SelectedItem.ToString();
string selectedMatchup = WeaponMatchupComboBox.SelectedItem.ToString() + " " + MonsterNameComboBox.SelectedItem.ToString();
selectedMatchup = selectedMatchup.Replace("System.Windows.Controls.ComboBoxItem: ", "");

if (!MonsterFeriasOptionDictionary.TryGetValue(selectedName, out string? val1) || !MonsterWikiOptionDictionary.TryGetValue(selectedName, out string? val2))
@@ -1158,12 +1158,12 @@ private void ChangeMonsterInfo()
//https://stackoverflow.com/questions/1265812/howto-define-the-auto-width-of-the-wpf-gridview-column-in-code
DockPanelMonsterInfo.Width = Double.NaN;//Auto
DockPanelMonsterInfo.Height = Double.NaN;//Auto
webViewMonsterInfo.CoreWebView2.Navigate(MonsterFeriasOptionDictionary[MonsterNameListBox.SelectedItem.ToString() + ""]);
webViewMonsterInfo.CoreWebView2.Navigate(MonsterFeriasOptionDictionary[MonsterNameComboBox.SelectedItem.ToString() + ""]);
return;
case 1://wiki
DockPanelMonsterInfo.Width = Double.NaN;//Auto
DockPanelMonsterInfo.Height = Double.NaN;//Auto
webViewMonsterInfo.CoreWebView2.Navigate(MonsterWikiOptionDictionary[MonsterNameListBox.SelectedItem.ToString() + ""]);
webViewMonsterInfo.CoreWebView2.Navigate(MonsterWikiOptionDictionary[MonsterNameComboBox.SelectedItem.ToString() + ""]);
return;
case 2://youtube
if (MonsterVideoLinkOptionDictionary.TryGetValue(selectedMatchup, out string? videoval) && MonsterVideoLinkOptionDictionary[selectedMatchup] != "")
@@ -1189,7 +1189,7 @@ private void ChangeMonsterInfo()
}
}

private void MonsterNameListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void MonsterNameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ChangeMonsterInfo();
}
@@ -1199,7 +1199,7 @@ private void MonsterInfoSource_SelectionChanged(object sender, SelectionChangedE
ChangeMonsterInfo();
}

private void WeaponMatchupListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void WeaponMatchupComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ChangeMonsterInfo();
}
5 changes: 5 additions & 0 deletions MHFZ_Overlay/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -461,6 +461,11 @@ public MainWindow()

logger.Info("PROGRAM OPERATION: Loading dependency data\n{0}", dependenciesInfo);

// The rendering tier corresponds to the high-order word of the Tier property.
int renderingTier = (RenderCapability.Tier >> 16);

logger.Info("PROGRAM OPERATION: Found rendering tier {0}", renderingTier);

DataLoader.model.ShowSaveIcon = false;

splashScreen.Close(TimeSpan.FromSeconds(0.1));

0 comments on commit f68c7cc

Please sign in to comment.