Skip to content

Commit

Permalink
remove OverlayHider and OverlayZCorrector
Browse files Browse the repository at this point in the history
  • Loading branch information
marzent committed Sep 18, 2022
1 parent d87ba84 commit 013a912
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 249 deletions.
36 changes: 0 additions & 36 deletions OverlayPlugin.Core/Controls/GeneralConfigTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ public GeneralConfigTab(TinyIoCContainer container) {
cbUpdateCheck.Checked = config.UpdateCheck;
cbHideOverlaysWhenNotActive.Checked = config.HideOverlaysWhenNotActive;
cbHideOverlaysDuringCutscene.Checked = config.HideOverlayDuringCutscene;

// Attach the event handlers only *after* loading the configuration because we'd otherwise trigger them ourselves.
cbErrorReports.CheckedChanged += CbErrorReports_CheckedChanged;
cbUpdateCheck.CheckedChanged += CbUpdateCheck_CheckedChanged;
cbHideOverlaysWhenNotActive.CheckedChanged += cbHideOverlaysWhenNotActive_CheckedChanged;
cbHideOverlaysDuringCutscene.CheckedChanged += cbHideOverlaysDuringCutscene_CheckedChanged;
}

public void SetReadmeVisible(bool visible) {
Expand All @@ -58,36 +52,6 @@ private void btnUpdateCheck_MouseClick(object sender, MouseEventArgs e) {
});
}

private void CbErrorReports_CheckedChanged(object sender, EventArgs e) {
try {
}
catch (Exception ex) {
logger.Log(LogLevel.Error, $"Failed to switch error reports: {ex}");
cbErrorReports.Checked = !cbErrorReports.Checked;

MessageBox.Show($"Failed to switch error reports: {ex}", "OverlayPlugin", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

config.ErrorReports = cbErrorReports.Checked;

MessageBox.Show("You have to restart ACT to apply this change.", "OverlayPlugin", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

private void CbUpdateCheck_CheckedChanged(object sender, EventArgs e) {
config.UpdateCheck = cbUpdateCheck.Checked;
}

private void cbHideOverlaysWhenNotActive_CheckedChanged(object sender, EventArgs e) {
config.HideOverlaysWhenNotActive = cbHideOverlaysWhenNotActive.Checked;
container.Resolve<OverlayHider>().UpdateOverlays();
}

private void cbHideOverlaysDuringCutscene_CheckedChanged(object sender, EventArgs e) {
config.HideOverlayDuringCutscene = cbHideOverlaysDuringCutscene.Checked;
container.Resolve<OverlayHider>().UpdateOverlays();
}

private void lnkGithubRepo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
System.Diagnostics.Process.Start(lnkGithubRepo.Text);
}
Expand Down
140 changes: 0 additions & 140 deletions OverlayPlugin.Core/OverlayHider.cs

This file was deleted.

67 changes: 0 additions & 67 deletions OverlayPlugin.Core/OverlayZCorrector.cs

This file was deleted.

6 changes: 0 additions & 6 deletions OverlayPlugin.Core/PluginMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ public void InitPlugin(Panel pluginScreenSpace, Label pluginStatusText) {
InitializeOverlays();

this._label.Text = @"Init Phase 2: Overlay tasks";
_container.Register(new OverlayHider(_container));
_container.Register(new OverlayZCorrector(_container));

// WSServer has to start after the LoadAddons() call because clients can connect immediately
// after it's initialized and that requires the event sources to be initialized.
Expand Down Expand Up @@ -303,10 +301,6 @@ internal void RemoveOverlay(IOverlay overlay) {
public void DeInitPlugin() {
SaveConfig(true);

if (_container.TryResolve(out OverlayZCorrector corrector)) {
corrector.DeInit();
}

if (Overlays != null) {
foreach (var overlay in this.Overlays) {
overlay.Dispose();
Expand Down

0 comments on commit 013a912

Please sign in to comment.