コード例 #1
0
        public static void Unsubscribe(ulong id)
        {
            SteamAPIWrapper.Init();

            SteamUGC.UnsubscribeItem(id.ToPublishedFileID());
            SteamAPIWrapper.RunCallbacks();
        }
コード例 #2
0
        public QueryUGCChildren WaitForResult()
        {
            if (DependencyCount == 0)
            {
                return(this);
            }

            // Wait for Response
            while (!Finished && !Cancelled)
            {
                Thread.Sleep(10);
                SteamAPIWrapper.RunCallbacks();
            }

            if (Cancelled)
            {
                return(this);
            }

            var idList = new PublishedFileId_t[DependencyCount];

            Success = SteamUGC.GetQueryUGCChildren(_queryHandle, 0, idList, (uint)idList.Length);
            SteamUGC.ReleaseQueryUGCRequest(_queryHandle);
            Result = idList.ToList().ConvertAll(item => item.m_PublishedFileId);

            return(this);
        }
コード例 #3
0
        public ItemDetailsRequest WaitForResult()
        {
            // Wait for Response
            while (!Finished && !Cancelled)
            {
                Thread.Sleep(10);
                SteamAPIWrapper.RunCallbacks();
            }

            if (Cancelled)
            {
                return(this);
            }

            Result = new List <SteamUGCDetails_t>();

            for (uint i = 0; i < Identifiers.Count; i++)
            {
                // Retrieve Value
                Success = SteamUGC.GetQueryUGCResult(_queryHandle, i, out var result);
                Result.Add(result);
            }

            SteamUGC.ReleaseQueryUGCRequest(_queryHandle);
            return(this);
        }
コード例 #4
0
        public MainForm(Settings settings)
        {
            InitializeComponent();

            appRestartPendingLabel.Visible = false;

            // Settings
            SteamAPIWrapper.Init();
            Settings = settings;

            // Restore states
            showHiddenModsToolStripMenuItem.Checked = settings.ShowHiddenElements;

            // Hide WotC and Challenge Mode buttons if necessary
            if (settings.GamePath != "")
            {
                var wotcAvailable = Directory.Exists(settings.GamePath + @"\XCom2-WarOfTheChosen");
                runWarOfTheChosenToolStripMenuItem.Visible = wotcAvailable;
                runChallengeModeToolStripMenuItem.Visible  = wotcAvailable;
                importFromWotCToolStripMenuItem.Visible    = wotcAvailable;
            }

            // Init interface
            InitObjectListView();
            UpdateInterface();
            RegisterEvents();

            //Other intialization
            InitializeTabImages();

            // Init the argument checkboxes
            UpdateQuickArgumentsMenu();

#if !DEBUG
            // Check for Updates
            CheckSteamForUpdates();
#endif

            // Run callbacks
            var t1 = new Timer();
            t1.Tick    += (sender, e) => { SteamAPIWrapper.RunCallbacks(); };
            t1.Interval = 10;
            t1.Start();

            // Check for running downloads
#if DEBUG
            if (Settings.GetWorkshopPath() != null)
            {
                CheckSteamForNewMods();

                var t2 = new Timer();
                t2.Tick    += (sender, e) => { CheckSteamForNewMods(); };
                t2.Interval = 30000;
                t2.Start();
            }
#endif
        }
コード例 #5
0
        private void Update()
        {
            if (!m_bInitialized)
            {
                return;
            }

            // Run Steam client callbacks
            SteamAPIWrapper.RunCallbacks();
        }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: tobiathar/xcom2-launcher
        public MainForm(Settings settings)
        {
            //
            InitializeComponent();

            // Settings
            SteamAPIWrapper.InitSafe();
            Settings = settings;

            // Restore states
            showHiddenModsToolStripMenuItem.Checked = settings.ShowHiddenElements;

            // Hide WotC button if necessary
            runWarOfTheChosenToolStripMenuItem.Visible = Directory.Exists(settings.GamePath + @"\XCom2-WarOfTheChosen");

            // Init interface
            InitObjectListView();
            UpdateInterface();
            RegisterEvents();

            //Other intialization
            InitializeTabImages();

            // Init the argument checkboxes
            LogLaunchArgument.Settings          = settings;
            NoRedscreensLaunchArgument.Settings = settings;

#if !DEBUG
            // Check for Updates
            CheckSteamForUpdates();
#endif

            // Run callbacks
            var t1 = new Timer();
            t1.Tick    += (sender, e) => { SteamAPIWrapper.RunCallbacks(); };
            t1.Interval = 10;
            t1.Start();

            // Check for running downloads
#if DEBUG
            if (Settings.GetWorkshopPath() != null)
            {
                CheckSteamForNewMods();

                var t2 = new Timer();
                t2.Tick    += (sender, e) => { CheckSteamForNewMods(); };
                t2.Interval = 30000;
                t2.Start();
            }
#endif
        }
コード例 #7
0
ファイル: MainForm.cs プロジェクト: Tidaka/xcom2-launcher
        public MainForm(Settings settings)
        {
            //
            InitializeComponent();

            // Settings
            SteamAPIWrapper.InitSafe();
            Settings = settings;

            // Restore states
            showHiddenModsToolStripMenuItem.Checked = settings.ShowHiddenElements;

            // Init interface
            InitObjectListView();
            UpdateInterface();
            RegisterEvents();

            //Other intialization
            InitializeTabImages();

#if !DEBUG
            // Check for Updates
            CheckSteamForUpdates();
#endif

            // Run callbacks
            var t1 = new Timer();
            t1.Tick    += (sender, e) => { SteamAPIWrapper.RunCallbacks(); };
            t1.Interval = 10;
            t1.Start();

            // Check for running downloads
#if DEBUG
            if (Settings.GetWorkshopPath() != null)
            {
                CheckSteamForNewMods();

                var t2 = new Timer();
                t2.Tick    += (sender, e) => { CheckSteamForNewMods(); };
                t2.Interval = 30000;
                t2.Start();
            }
#endif
        }
コード例 #8
0
        public ItemDetailsRequest WaitForResult()
        {
            // Wait for Response
            while (!Finished && !Cancelled)
            {
                Thread.Sleep(10);
                SteamAPIWrapper.RunCallbacks();
            }

            if (Cancelled)
            {
                return(this);
            }

            // Retrieve Value
            SteamUGCDetails_t result;

            Success = SteamUGC.GetQueryUGCResult(_queryHandle, 0, out result);

            Result = result;
            return(this);
        }
コード例 #9
0
        public MainForm(Settings settings)
        {
            InitializeComponent();

            appRestartPendingLabel.Visible           = false;
            progress_toolstrip_progressbar.Visible   = false;
            aboutToolStripMenuItem.DropDownDirection = ToolStripDropDownDirection.BelowLeft;

            // Settings
            SteamAPIWrapper.Init();
            Settings = settings;

            // Restore states
            InitMainGui(settings);

            // Init interface
            InitModListView();
            InitDependencyListViews();
            UpdateInterface();
            RegisterEvents();

            // Other intialization
            InitializeTabImages();

            // Init the argument checkboxes
            InitQuickArgumentsMenu(settings);

            #if !DEBUG
            // Update mod information
            var mods = Settings.Mods.All.ToList();

            if (settings.OnlyUpdateEnabledOrNewModsOnStartup)
            {
                mods = mods.Where(mod => mod.isActive || mod.State.HasFlag(ModState.New)).ToList();
            }

            UpdateMods(mods, () =>
            {
                modlist_ListObjectListView.RefreshObjects(mods);
            });
            #endif

            // Run callbacks
            var t1 = new Timer();
            t1.Tick    += (sender, e) => { SteamAPIWrapper.RunCallbacks(); };
            t1.Interval = 10;
            t1.Start();

/*
 *          // Check for running downloads
 #if DEBUG
 *          if (Settings.GetWorkshopPath() != null)
 *          {
 *              CheckSteamForNewMods();
 *
 *              var t2 = new Timer();
 *              t2.Tick += (sender, e) => { CheckSteamForNewMods(); };
 *              t2.Interval = 30000;
 *              t2.Start();
 *          }
 #endif
 */
        }
コード例 #10
0
        public MainForm(Settings settings)
        {
            InitializeComponent();

            appRestartPendingLabel.Visible           = false;
            aboutToolStripMenuItem.DropDownDirection = ToolStripDropDownDirection.BelowLeft;

            // Settings
            SteamAPIWrapper.Init();
            Settings = settings;

            // Restore states
            showHiddenModsToolStripMenuItem.Checked = settings.ShowHiddenElements;
            cShowStateFilter.Checked       = settings.ShowStateFilter;
            cEnableGrouping.Checked        = settings.ShowModListGroups;
            cShowPrimaryDuplicates.Checked = Settings.ShowPrimaryDuplicateAsDependency;
            cShowPrimaryDuplicates.Visible = Settings.EnableDuplicateModIdWorkaround;
            modlist_ListObjectListView.UseTranslucentSelection = Settings.UseTranslucentModListSelection;
            olvRequiredMods.UseTranslucentSelection            = Settings.UseTranslucentModListSelection;
            olvDependentMods.UseTranslucentSelection           = Settings.UseTranslucentModListSelection;

            // Set visibility of some controls depending on game type
            var wotcAvailable = Directory.Exists(settings.GamePath + @"\XCom2-WarOfTheChosen");

            runXCOM2ToolStripMenuItem.Visible               = Program.XEnv.Game == GameId.X2;
            runWarOfTheChosenToolStripMenuItem.Visible      = wotcAvailable && Program.XEnv.Game == GameId.X2;
            runChallengeModeToolStripMenuItem.Visible       = wotcAvailable && Program.XEnv.Game == GameId.X2;
            importFromWotCToolStripMenuItem.Visible         = wotcAvailable && Program.XEnv.Game == GameId.X2;
            importFromXCOM2ToolStripMenuItem.Visible        = Program.XEnv.Game == GameId.X2;
            runChimeraSquadToolStripMenuItem.Visible        = Program.XEnv.Game == GameId.ChimeraSquad;
            importFromChimeraSquadToolStripMenuItem.Visible = Program.XEnv.Game == GameId.ChimeraSquad;

            if (Program.XEnv.Game != GameId.X2)
            {
                modlist_ListObjectListView.AllColumns.Remove(olvForWOTC);
                modlist_ListObjectListView.RebuildColumns();
                olvDependentMods.AllColumns.Remove(olvColDepModsWotc);
                olvDependentMods.RebuildColumns();
                olvRequiredMods.AllColumns.Remove(olvColReqModsWotc);
                olvRequiredMods.RebuildColumns();
            }

            // If game path is not configured, hide several function/options.
            if (string.IsNullOrEmpty(settings.GamePath))
            {
                runWarOfTheChosenToolStripMenuItem.Enabled      = false;
                runChallengeModeToolStripMenuItem.Enabled       = false;
                importFromWotCToolStripMenuItem.Enabled         = false;
                importFromXCOM2ToolStripMenuItem.Enabled        = false;
                importFromChimeraSquadToolStripMenuItem.Enabled = false;
            }

            // Init interface
            InitModListView();
            InitDependencyListViews();
            UpdateInterface();
            RegisterEvents();

            // Other intialization
            InitializeTabImages();

            // Init the argument checkboxes
            InitQuickArgumentsMenu(settings);

#if !DEBUG
            // Update mod information
            var mods = Settings.Mods.All.ToList();

            UpdateMods(mods, () =>
            {
                modlist_ListObjectListView.RefreshObjects(mods);
            });
#endif
            // Run callbacks
            var t1 = new Timer();
            t1.Tick    += (sender, e) => { SteamAPIWrapper.RunCallbacks(); };
            t1.Interval = 10;
            t1.Start();

/*
 *          // Check for running downloads
 #if DEBUG
 *          if (Settings.GetWorkshopPath() != null)
 *          {
 *              CheckSteamForNewMods();
 *
 *              var t2 = new Timer();
 *              t2.Tick += (sender, e) => { CheckSteamForNewMods(); };
 *              t2.Interval = 30000;
 *              t2.Start();
 *          }
 #endif
 */
        }