예제 #1
0
    public override void _Ready()
    {
        logo = GetNode <Control>(LogoPath);
        revolutionaryGames = GetNode <Control>(RevolutionaryGamesPath);
        supportedBy        = GetNode <Control>(SupportedByPath);
        developersHeading  = GetNode <Control>(DevelopersHeadingPath);

        if (TeamNameFont == null)
        {
            throw new InvalidOperationException($"{nameof(TeamNameFont)} not set");
        }

        if (SectionNameFont == null)
        {
            throw new InvalidOperationException($"{nameof(SectionNameFont)} not set");
        }

        credits = SimulationParameters.Instance.GetCredits();

        steamVersion = SteamHandler.IsTaggedSteamRelease();

        if (phase == CreditsPhase.NotRunning && AutoStart)
        {
            Setup();
        }
    }
예제 #2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
         instance = this;
     }
     //DontDestroyOnLoad(gameObject);
 }
예제 #3
0
        public string?LocateGamePath()
        {
            var steam = new SteamHandler();

            if (steam.FindAllGames() && steam.TryGetByID(895870, out var steamGame) && !string.IsNullOrWhiteSpace(steamGame?.Path))
            {
                return(steamGame.Path);
            }

            var gog = new GOGHandler();

            if (gog.FindAllGames() && gog.Games.Any() && gog.Games.FirstOrDefault(g => g.GameID == 1609812781) is { } gogEntry)
            {
                return(gogEntry.Path);
            }

            return(null);
        }
예제 #4
0
        private static void FinalizeShutdown()
        {
            HistoryManager.FlushBuffer();
            Conf.IsFirstRun = false;

            if (Conf.DiscardPlayerName == true)
            {
                Conf.LobbyPlayerName = "";
            }
            if (Conf.DiscardPassword == true)
            {
                Conf.LobbyPlayerPassword = "";
            }

            SaveConfig();
            try
            {
                if (!Debugger.IsAttached)
                {
                    mutex.ReleaseMutex();
                }
            }
            catch { }
            try
            {
                if (ToolTip != null)
                {
                    ToolTip.Dispose();
                }
                if (Downloader != null)
                {
                    Downloader.Dispose();
                }
                if (SpringScanner != null)
                {
                    SpringScanner.Dispose();
                }
                if (SteamHandler != null)
                {
                    SteamHandler.Dispose();
                }
            }
            catch { }
        }
예제 #5
0
 public SteamHandler()
 {
     instance = this;
 }