Exemplo n.º 1
0
    /// <summary>
    /// Sets the sprite on this UI's checkbox based on the status of the task.
    /// </summary>
    private void SetCheckboxSprite(bool isPop, TweenToggle slash)
    {
        // get the status
        WellapadTaskCompletionStates eStatus = WellapadMissionController.Instance.GetTaskStatus(task, isPop);

        // show the tween only if the status is complete OR the status is recently completed and we are popping the task status
        if (eStatus == WellapadTaskCompletionStates.Completed ||
            (eStatus == WellapadTaskCompletionStates.RecentlyCompleted && isPop))
        {
            // mark this task as done
            slash.gameObject.SetActive(true);
            StartCoroutine(CheckboxSpriteShowHelper(slash));                    // Show after one frame
        }
    }
Exemplo n.º 2
0
 public MutableDataWellapadTask(ImmutableDataWellapadTask data, WellapadTaskCompletionStates completionStatus = WellapadTaskCompletionStates.Uncompleted)
 {
     TaskID = data.GetTaskID();
     if (data.GetCategory() == "Critical")
     {
         Category = MiniGameCategory.Critical;
     }
     else
     {
         Category = MiniGameCategory.Regular;
     }
     Amount    = data.GetRandomCompleteCondition();
     Completed = completionStatus;
 }
    /// <summary>
    /// Sets the sprite on this UI's checkbox based on the status of the task.
    /// </summary>
    private void SetCheckboxSprite(bool bPop)
    {
        // get the status
        WellapadTaskCompletionStates status = WellapadMissionController.Instance.GetTaskStatus(task, bPop);

        // show the tween only if the status is complete OR the status is recently completed and we are popping the task status
        if (status == WellapadTaskCompletionStates.Completed ||
            (status == WellapadTaskCompletionStates.RecentlyCompleted && bPop))
        {
            // mark this task as done
            checkTween.gameObject.SetActive(true);
            StartCoroutine(CheckboxSpriteShowHelper());                 // Show after one frame
            rewardButton.SetActive(true);
        }
    }
Exemplo n.º 4
0
    /// <summary>
    /// Gets the task status. Returns whether the user has completed the incoming
    /// task or not.
    /// </summary>
    /// <returns>The task status.</returns>
    /// <param name="task">Task.</param>
    public WellapadTaskCompletionStates GetTaskStatus(MutableDataWellapadTask task, bool bPop = false)
    {
        WellapadTaskCompletionStates status = WellapadTaskCompletionStates.Uncompleted;

        string taskID = task.TaskID;

        if (DataManager.Instance.GameData.Wellapad.CurrentTasks.ContainsKey(taskID) &&
            DataManager.Instance.GameData.Wellapad.CurrentTasks.ContainsKey(taskID))
        {
            status = DataManager.Instance.GameData.Wellapad.CurrentTasks[taskID].Completed;

            // if the status is recently completed and we are popping, "pop" it by setting it to just plain completed now
            if (bPop && status == WellapadTaskCompletionStates.RecentlyCompleted)
            {
                DataManager.Instance.GameData.Wellapad.CurrentTasks[taskID].Completed = WellapadTaskCompletionStates.Completed;
            }
        }
        else
        {
            Debug.LogError("Can't find task " + taskID + " in saved data");
        }

        return(status);
    }