// Decompiled with JetBrains decompiler
// Type: FiestaLauncher.Services.FeedbackService
// Assembly: FiestaOnline, Version=2019.5.22.0, Culture=neutral, PublicKeyToken=null
// MVID: 2FD5EB61-BC25-469D-997E-88998E849F6A
// Assembly location: C:\Users\marbo\Documents\Gamigo 2020 Client\FiestaOnline.exe

using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace FiestaLauncher.Services
{
  public static class FeedbackService
  {
    internal static long LastWebPop;

    internal static void Exception(System.Exception ee)
    {
      FeedbackService.PopError("Unfortunately, Fiesta Launcher has stopped working." + Environment.NewLine + Environment.NewLine + ee.Message + ee.StackTrace, false);
      Environment.Exit(0);
    }

    internal static void OpenBrowser(string p)
    {
      long currentMilliseconds = ResourceService.GetCurrentMilliseconds();
      if (currentMilliseconds - FeedbackService.LastWebPop < 500L)
        return;
      FeedbackService.LastWebPop = currentMilliseconds;
      Process.Start(p);
    }

    internal static void PopError(string msg, bool fatal = false)
    {
      int num = (int) MessageBox.Show(msg, "Fiesta Launcher Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
      if (!fatal)
        return;
      Environment.Exit(0);
    }

    internal static void SwfButton(string p)
    {
      if (!(gFiestaLauncher.Settings["swf." + p] != ""))
        return;
      FeedbackService.OpenBrowser(gFiestaLauncher.Settings["swf." + p]);
    }
  }
}
