Skip to content

Commit

Permalink
Merge pull request #748 from dlamkins/feat/nvidia-and-about-updates
Browse files Browse the repository at this point in the history
About view revisions, Nvidia check extension, and README/License udpates.
  • Loading branch information
dlamkins authored Sep 6, 2022
2 parents de83257 + 4e9ec57 commit 736ba25
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 61 deletions.
1 change: 0 additions & 1 deletion Blish HUD/Blish HUD.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@
<PackageReference Include="NAudio.Wasapi" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="[13.0.1]" />
<PackageReference Include="NLog" Version="4.6.7" PrivateAssets="all" />
<PackageReference Include="Octokit" Version="0.32.0" PrivateAssets="all" />
<PackageReference Include="Ookii.Dialogs.WinForms" Version="4.0.0" />
<PackageReference Include="SemanticVersioning" Version="1.2.2" PrivateAssets="all" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.1" />
Expand Down
21 changes: 10 additions & 11 deletions Blish HUD/GameServices/Debug/ContingencyChecks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,31 @@ private static void CheckControlledFolderAccessBlocking() {

private static void CheckNvidiaControlPanelSettings() {
try {
CustomSettingNames customSettingNames = CustomSettingNames.FactoryLoadFromString(nspector.Properties.Resources.CustomSettingNames);
CustomSettingNames referenceSettingNames = CustomSettingNames.FactoryLoadFromString(nspector.Properties.Resources.ReferenceSettingNames);
var customSettingNames = CustomSettingNames.FactoryLoadFromString(nspector.Properties.Resources.CustomSettingNames);
var referenceSettingNames = CustomSettingNames.FactoryLoadFromString(nspector.Properties.Resources.ReferenceSettingNames);

DrsSettingsMetaService metaService = new DrsSettingsMetaService(customSettingNames, referenceSettingNames);
DrsDecrypterService decrypterService = new DrsDecrypterService(metaService);
DrsScannerService scannerService = new DrsScannerService(metaService, decrypterService);
DrsSettingsService settingService = new DrsSettingsService(metaService, decrypterService);
var metaService = new DrsSettingsMetaService(customSettingNames, referenceSettingNames);
var decrypterService = new DrsDecrypterService(metaService);
var scannerService = new DrsScannerService(metaService, decrypterService);
var settingService = new DrsSettingsService(metaService, decrypterService);

// this might be nicer as a resource or a config file?
Dictionary<ESetting, HashSet<uint>> forbiddenValues = new Dictionary<ESetting, HashSet<uint>>() {
var forbiddenValues = new Dictionary<ESetting, HashSet<uint>>() {
[ESetting.FXAA_ENABLE_ID] = new HashSet<uint>() { 1 },
[ESetting.MAXWELL_B_SAMPLE_INTERLEAVE_ID] = new HashSet<uint>() { 1 }
};

// stored using forward slashes for some reason
string exePath = Application.ExecutablePath.Replace('\\', '/');
string blishProfileName = scannerService.FindProfilesUsingApplication(exePath);

List<string> errors = new List<string>();
var errors = new List<string>();
foreach (KeyValuePair<ESetting, HashSet<uint>> pair in forbiddenValues) {
SettingMeta settingMeta = metaService.GetSettingMeta((uint)pair.Key);
uint value = settingService.GetDwordValueFromProfile(blishProfileName, (uint)pair.Key);

if (pair.Value.Contains(value)) {
SettingValue<uint> settingValue = settingMeta.DwordValues.FirstOrDefault(val => val.Value == value);
string val = settingValue?.ValueName != null ? settingValue.ValueName : value.ToString();
string val = settingValue?.ValueName ?? value.ToString();

errors.Add($"'{settingMeta.SettingName}' = '{val}'");
}
Expand All @@ -105,7 +105,6 @@ private static void CheckNvidiaControlPanelSettings() {
if (errors.Any()) {
Contingency.NotifyNvidiaSettings(string.Join(Environment.NewLine, errors));
}

} catch (Exception) {
// we don't really care if we error here - usually means a non-nvidia system,
// in which case the check is useless anyway.
Expand Down
179 changes: 135 additions & 44 deletions Blish HUD/GameServices/Overlay/UI/Views/AboutView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Blish_HUD.Graphics.UI;
using System;
using System.Diagnostics;
using Blish_HUD.Content;
using Blish_HUD.Controls;
using Blish_HUD.Overlay.UI.Presenters;
Expand All @@ -18,79 +19,171 @@ protected override void Build(Container buildPanel) {
};

var infoPanel = new Panel() {
Width = buildPanel.Width,
Width = buildPanel.Width,
Height = 32,
Bottom = buildPanel.Bottom,
Parent = buildPanel
};

var aboutPanel = new Panel() {
ShowBorder = true,
Width = buildPanel.Width,
Height = buildPanel.Height - infoPanel.Height,
Parent = buildPanel,
CanScroll = true,
Width = buildPanel.Width,
Height = buildPanel.Height - infoPanel.Height,
Parent = buildPanel,
CanScroll = true,
};

#region "Love Message"

var lovePanel = new Panel() {
Size = new Point(aboutPanel.Width - 128, 128),
Left = (aboutPanel.Width / 2) - ((aboutPanel.Width - 128) / 3),
Parent = aboutPanel
Size = new Point(aboutPanel.Width - 128, 128),
Left = (aboutPanel.Width / 2) - ((aboutPanel.Width - 128) / 3),
Parent = aboutPanel,
};

var heart = new Image(AsyncTexture2D.FromAssetId(156127)) {
Size = new Point(64, 64),
Location = new Point(0, lovePanel.Height / 2 - 32),
Parent = lovePanel
Size = new Point(64, 64),
Location = new Point(0, lovePanel.Height / 2 - 32),
Parent = lovePanel
};

_ = new Label() {
Font = GameService.Content.DefaultFont16,
Text = Strings.GameServices.OverlayService.AboutLoveMessage,
AutoSizeWidth = true,
Height = lovePanel.Height,
Left = heart.Right,
Font = GameService.Content.DefaultFont16,
Text = Strings.GameServices.OverlayService.AboutLoveMessage,
AutoSizeWidth = true,
Height = lovePanel.Height,
Left = heart.Right,
VerticalAlignment = VerticalAlignment.Middle,
StrokeText = true,
Parent = lovePanel
StrokeText = true,
Parent = lovePanel
};

var gw2CopyrightStatement = new Label() {
Font = GameService.Content.DefaultFont16,
Text = string.Format(Strings.GameServices.OverlayService.AboutAnetNotice, DateTime.Now.Year),
AutoSizeHeight = true,
Width = aboutPanel.Width,
Top = lovePanel.Bottom,
StrokeText = true,
#endregion

#region "Discord Callout"

var discordSection = new Image(GameService.Content.GetTexture("views/about/section-splitter")) {
Parent = aboutPanel,
Width = aboutPanel.Width - 64,
Left = 32,
Height = 16,
Top = lovePanel.Bottom,
Opacity = 0.5f
};

var discordNote = new FormattedLabelBuilder()
.CreatePart(Strings.GameServices.OverlayService.About_DiscordCallToAction1, b => b.SetFontSize(ContentService.FontSize.Size16))
.CreatePart(Strings.GameServices.OverlayService.About_DiscordCallToAction2, b => b.SetFontSize(ContentService.FontSize.Size16).SetTextColor(Color.FromNonPremultiplied(88, 101, 242, 255)).MakeBold())
.CreatePart(Strings.GameServices.OverlayService.About_DiscordCallToAction3, b => b.SetFontSize(ContentService.FontSize.Size16))
.SetWidth((int)(discordSection.Width * 0.5f) - 48)
.AutoSizeHeight()
.SetHorizontalAlignment(HorizontalAlignment.Center)
.Wrap()
.Build();

discordNote.Top = discordSection.Bottom + 8;
discordNote.Left = discordSection.Left + 48;
discordNote.Parent = aboutPanel;

var callToAction = new Label() {
Font = GameService.Content.DefaultFont16,
Text = Strings.GameServices.OverlayService.About_DiscordCallToAction_Question,
Top = discordNote.Top - 4,
Width = discordNote.Width,
AutoSizeHeight = true,
Left = discordNote.Right + 32,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
VerticalAlignment = VerticalAlignment.Top,
StrokeText = true,
Parent = aboutPanel
};

var discordBttn = new StandardButton() {
Text = Strings.GameServices.OverlayService.About_DiscordCallToAction_Button,
Left = callToAction.Left + callToAction.Width / 2 - 85,
Top = callToAction.Bottom,
Width = 170,
Parent = aboutPanel
};

discordBttn.Click += (s, e) => Process.Start("https://link.blishhud.com/discord");

var bottomDiscordSection = new Image(GameService.Content.GetTexture("views/about/section-splitter")) {
Parent = aboutPanel,
Width = aboutPanel.Width - 64,
Left = 32,
Height = 16,
Top = discordNote.Bottom + 8,
Opacity = 0.5f
};

int fadeTop = discordSection.Top + discordSection.Height / 2;
int fadeBottom = bottomDiscordSection.Top + bottomDiscordSection.Height / 2;

var leftFade = new Image(AsyncTexture2D.FromAssetId(156044)) {
Width = bottomDiscordSection.Width / 2,
Left = bottomDiscordSection.Left,
Top = fadeTop,
ZIndex = -1,
Height = fadeBottom - fadeTop,
Parent = aboutPanel,
SpriteEffects = SpriteEffects.FlipHorizontally,
Opacity = 0.4f
};

_ = new Image(AsyncTexture2D.FromAssetId(156044)) {
Width = bottomDiscordSection.Width / 2,
Left = leftFade.Right,
Top = fadeTop,
ZIndex = -1,
Height = fadeBottom - fadeTop,
Parent = aboutPanel,
Opacity = 0.4f
};

#endregion

var gw2CopyrightStatement = new Label() {
Font = GameService.Content.DefaultFont16,
Text = string.Format(Strings.GameServices.OverlayService.AboutAnetNotice, DateTime.Now.Year),
AutoSizeHeight = true,
Width = aboutPanel.Width,
StrokeText = true,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
Parent = aboutPanel
};

gw2CopyrightStatement.Bottom = aboutPanel.Height - 48;

#region "Software Licenses"

var thirdPartySoftwareHeading = new Label() {
Font = GameService.Content.DefaultFont16,
Text = Strings.GameServices.OverlayService.AboutThirdPartySoftwareHeading,
Top = gw2CopyrightStatement.Bottom + 64,
Width = aboutPanel.Width,
StrokeText = true,
Font = GameService.Content.DefaultFont16,
Text = Strings.GameServices.OverlayService.AboutThirdPartySoftwareHeading,
Top = gw2CopyrightStatement.Bottom + 64,
Width = aboutPanel.Width,
StrokeText = true,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
Parent = aboutPanel,
VerticalAlignment = VerticalAlignment.Top,
Parent = aboutPanel,
};

var thirdPartySoftwareStatement = new Label() {
Font = GameService.Content.DefaultFont14,
Text = Strings.GameServices.OverlayService.AboutThirdPartySoftware,
AutoSizeHeight = true,
Top = thirdPartySoftwareHeading.Bottom + 32,
Width = aboutPanel.Width,
Left = 24,
StrokeText = false,
Font = GameService.Content.DefaultFont14,
Text = Strings.GameServices.OverlayService.AboutThirdPartySoftware,
AutoSizeHeight = true,
Top = thirdPartySoftwareHeading.Bottom + 32,
Width = aboutPanel.Width,
Left = 24,
StrokeText = false,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Parent = aboutPanel,
VerticalAlignment = VerticalAlignment.Top,
Parent = aboutPanel,
};

#endregion

var version = new Label() {
AutoSizeHeight = true,
Width = infoPanel.Width,
Expand All @@ -103,8 +196,6 @@ protected override void Build(Container buildPanel) {
Parent = infoPanel
};

//version.Location = new Point(infoPanel.Width - version.Width + 8, infoPanel.Height - version.Height);

var mumbleConnection = new ViewContainer() {
Size = new Point(128, 20),
Left = 8,
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ If you have an anti-virus or third party firewall utility, please ensure that Bl
Please explicitly allow Blish HUD in your "Controlled Folder Access" settings or review the troubleshooting guide linked below.</value>
</data>
<data name="NvidiaSettings_Description" xml:space="preserve">
<value>The following NVIDIA settings cause known compatability issues:</value>
<value>The NVIDIA settings are known to compatibility issues and should be toggled. See the linked troubleshooting guide for more information.</value>
</data>
<data name="NvidiaSettings_OpenControlPanelAction" xml:space="preserve">
<value>Open NVIDIA Control Panel</value>
Expand Down
51 changes: 50 additions & 1 deletion Blish HUD/Strings/GameServices/OverlayService.Designer.cs

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

22 changes: 22 additions & 0 deletions Blish HUD/Strings/GameServices/OverlayService.resx
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,26 @@ WARNING: Prerelease modules or Blish HUD versions may be unstable. By enabling
<data name="Setting_StayInTray_AppendDisabled" xml:space="preserve">
<value> (Disabled because you launched Blish HUD with --startgw2, --pid, -g, or -P)</value>
</data>
<data name="About_DiscordCallToAction1" xml:space="preserve">
<value>
The majority of Blish HUD's feedback, development, and other discussions take place in our</value>

</data>
<data name="About_DiscordCallToAction2" xml:space="preserve">
<value>Discord</value>

</data>
<data name="About_DiscordCallToAction3" xml:space="preserve">
<value> channel.
</value>

</data>
<data name="About_DiscordCallToAction_Question" xml:space="preserve">
<value>
Need help or just want to
participate in the conversation?</value>
</data>
<data name="About_DiscordCallToAction_Button" xml:space="preserve">
<value>Join our Discord</value>
</data>
</root>
Binary file added Blish HUD/ref/views/about/section-splitter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 736ba25

Please sign in to comment.