示例#1
0
 public void LoadMatch(bool twoDee)
 {
     setToTwoDee = twoDee;
     if (!availableOffline)
     {
         matchChainedTask = TaskMaker.DownloadMatch(this, twoDee, !twoDee, true, true);
     }
     else
     {
         matchChainedTask = TaskMaker.GenerateMatchInfo(this, twoDee, !twoDee, true, true);
     }
 }
示例#2
0
 public static bool RunHelper(object Item)
 {
     try
     {
         TaskMaker.GenerateTask(((Item)Item).Helper).RunSynchronously();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#3
0
    public void DownloadPreview()
    {
        MapData currentMap = MapLoaderController.mapLoaderInScene.currentMap;

        if (currentMap != null && !currentMap.IsPreviewAvailable() && SteamController.steamInScene.ManifestHasPreview(currentMap.mapName))
        {
            //SteamController.LogToConsole("Downloading " + currentMap.mapName + " preview");
            TaskMaker.DownloadPreview(currentMap, () =>
            {
                SetPreview(currentMap);
            });
        }
    }
    private void Update()
    {
        bool loading = IsLoading;

        downloadButton.button.interactable = !TaskMaker.IsBusy() || loading;
        downloadButton.buttonText.text     = loading ? "Cancel" : "Download/Update";
        loadingBarBack.SetActive(loading);
        if (loading)
        {
            loadingBar.fillAmount = DepotDownloader.ContentDownloader.DownloadPercent;
        }

        UpdateFilterButtons();
    }
示例#5
0
//--------------------------------------------------//
//       WARNING! Altering the Main function        //
//  may cause Programming Taskbook to malfunction.  //
//--------------------------------------------------//
        public static int Main(string[] args)
        {
            TaskMaker.StartCS();
            try
            {
                MyTask.Solve();
            }
            catch (Exception ex)
            {
                TaskMaker.RaisePT(ex);
            }
            TaskMaker.FreePT();
            return(0);
        }
 public override bool UpdateRoutine()
 {
     if (!start)
     {
         task_patterns = TaskMaker.generateTaskPattern(TaskManager.I.isDelayDiscTask);
         StartCoroutine(TaskCoroutine());
         start = true;
     }
     if (finish)
     {
         return(true);
     }
     return(false);
 }
示例#7
0
 public bool AdicionarItem()
 {
     if (Accessible)
     {
         string nome   = MyInputBox.InputBox.Show("", "Tarefa:");
         State  estado = State.Doing;
         Items.Add(new Item(this)
         {
             Description = nome, Value = estado, Helper = TaskMaker.Show()
         });
         this.WriteConfigs();
         return(true);
     }
     return(false);
 }
示例#8
0
    private void Update()
    {
        noMatchPanel.SetActive(match == null);
        viewingMatchPanel.SetActive(match != null);
        if (match != null)
        {
            RefreshLoadingBar();

            bool isLoading = match.IsLoading;
            watch3DButton.buttonText.text = isLoading ? "Cancel" : "Watch 3D";
            watch2DButton.gameObject.SetActive(!isLoading);

            bool taskMakerBusy = !isLoading && TaskMaker.IsBusy();
            watch3DButton.button.interactable = !taskMakerBusy;
            watch2DButton.button.interactable = !taskMakerBusy;
        }
    }
示例#9
0
    private void UpdateMapUI()
    {
        emptyListLabel.text = SteamController.steamInScene.IsLoggedIn ? loggedInEmptyListMessage : notLoggedInEmptyListMessage;

        MapData currentMap = MapLoaderController.mapLoaderInScene.currentMap;

        noMapSelectedPanel.SetActive(currentMap == null);
        mapSelectedPanel.SetActive(currentMap != null);
        if (currentMap != null)
        {
            mapPreview.gameObject.SetActive(currentPreview != null);
            if (currentPreview != null)
            {
                mapPreview.sprite = currentPreview;
            }

            bool mapLoading2D = currentMap.IsLoading2D;
            bool mapLoading3D = currentMap.IsLoading3D;

            bool taskMakerBusy = TaskMaker.IsBusy();
            twoDeeViewButton.button.interactable   = !taskMakerBusy || mapLoading2D;
            threeDeeViewButton.button.interactable = !taskMakerBusy || mapLoading3D;

            loadingBar.SetActive(mapLoading2D || mapLoading3D);
            loadingBarBar.fillAmount = (currentMap.IsDownloading2D || currentMap.IsDownloading3D || currentMap.IsDownloadingDependencies) ? DepotDownloader.ContentDownloader.DownloadPercent : currentMap.GetPercentBuilt();
            loadingText.text         = mapLoading3D ? currentMap.GetStatus3D() : currentMap.GetStatus2D();

            //bool overviewAvailable = currentMap.IsOverviewAvailable();
            twoDeeViewButton.leftHalf.gameObject.SetActive(!mapLoading2D && !currentMap.IsOverviewAvailable());
            twoDeeViewButton.buttonText.text = !mapLoading2D ? "2D View" : "Cancel";
            //twoDeeViewButton.icon.sprite = !overviewAvailable ? downloadIcon : (currentMap.IsDownloading2D ? downloadingIcon : builtIcon);

            threeDeeViewButton.leftHalf.gameObject.SetActive((!currentMap.IsMapAvailable() || currentMap.IsBuilt) && !mapLoading3D);
            threeDeeViewButton.icon.sprite     = currentMap.IsBuilt ? builtIcon : downloadIcon;
            threeDeeViewButton.buttonText.text = !currentMap.IsLoading3D ? "3D View" : "Cancel";

            titleText.text = currentMap.GetMapName();
        }

        bottomLoadingPanel.SetActive(SteamController.steamInScene.isManifestDownloading);
        if (SteamController.steamInScene.isManifestDownloading)
        {
            bottomLoadingText.text = "Retrieving maps from Steam";
        }
    }
示例#10
0
    /*public void Download3DMapPrompt(Action<bool, ChainedTask> onDecisionMade = null)
     * {
     *  SteamController.ShowPromptPopup(mapName, "Would you like to download the map dependencies as well (textures & models, usually more than 1GB)?", (response) =>
     *  {
     *      var task = TaskMaker.DownloadMap3D(this, response, response, true);
     *      onDecisionMade?.Invoke(response, task);
     *  }, "Yes", "No");
     * }*/

    public void LoadMap2D(bool showMap, bool showControls)
    {
        if (!IsOverviewAvailable())
        {
            if (SteamController.steamInScene.IsLoggedIn)
            {
                map2DChainTask = TaskMaker.DownloadMap2D(this, showMap, showControls);
            }
            else
            {
                SteamController.ShowErrorPopup("Download Error", "You must be logged in to download a map");
            }
        }
        else
        {
            map2DChainTask = TaskMaker.InvokeMapReady2D(this, showMap, showControls);
        }
    }
 public void Download()
 {
     CancelUpdateChecks();
     if (!IsLoading)
     {
         SettingsController.SaveSettings();
         if (SteamController.steamInScene.IsLoggedIn)
         {
             var paksToDownload = SettingsController.GetTrackedPaks();
             downloadTask = TaskMaker.DownloadFromSteam(paksToDownload);
         }
         else
         {
             SteamController.ShowErrorPopup("Download Error", "You must be logged in to download resources");
         }
     }
     else
     {
         downloadTask.Cancel();
         downloadTask = null;
     }
 }
示例#12
0
 public void LoadMap3D(bool showMap, bool showControls)
 {
     if (!IsMapAvailable())
     {
         if (SteamController.steamInScene.IsLoggedIn)
         {
             map3DChainTask = TaskMaker.DownloadMap3D(this, SettingsController.autoResourcePerMap, SettingsController.autoResourcePerMap, true, showMap, showControls);
         }
         else
         {
             SteamController.ShowErrorPopup("Download Error", "You must be logged in to download a map");
         }
     }
     else if (IsBuilt)
     {
         map3DChainTask = TaskMaker.InvokeMapReady3D(this, showMap, showControls);
     }
     else
     {
         map3DChainTask = TaskMaker.LoadMap(this, showMap, showControls);
     }
 }
    private void RefreshItemInfo()
    {
        if (item != null && item is DepotDownloader.ProtoManifest.FileData)
        {
            var resourcePakData = (DepotDownloader.ProtoManifest.FileData)item;

            var fullFilePath = Path.Combine(SettingsController.gameLocation, resourcePakData.FileName);

            packNameLabel.text        = Path.GetFileNameWithoutExtension(resourcePakData.FileName);
            packSizeLabel.text        = (resourcePakData.TotalSize / 1000000) + "MB";
            deleteButton.interactable = File.Exists(fullFilePath);
            downloadToggle.isOn       = SettingsController.HasPak(resourcePakData.FileName);

            fileNeedsUpdate = false;
            if (!TaskMaker.IsBusy() && deleteButton.interactable)
            {
                if (resourcePakData.Chunks != null && resourcePakData.Chunks.Count > 0)
                {
                    hashTask = UnityHelpers.TaskManagerController.CreateTask((ct) => { CheckForUpdates(fullFilePath, resourcePakData, ct); });
                    UnityHelpers.TaskManagerController.QueueTask(hashTask);
                }
            }
        }
    }
示例#14
0
 private void OnEnable()
 {
     taskMakerInScene = this;
 }