示例#1
0
    public void SetupFeedItem(string[] _itemData, OnPopupPageOpen _pageToOpen)
    {
        themeFont = ChangeColourScheme.GetCurrentFont();
        foreach (FontChanger f in GetComponentsInChildren <FontChanger> ())
        {
            f.ChangeMyFont(themeFont);
        }

        challengeName.text = _itemData [3];
        skill1.text        = _itemData [4];
        skill2.text        = _itemData [5];
        skill3.text        = _itemData [6];
        rewardPoints.text  = _itemData [11] + " points";

        challengeIcon.sprite = DummyPullDataFromID.GetChallengeImage(_itemData [0]);

        if (_itemData [13] == "true")
        {
            bgColour.color = Color.white;
        }
        else
        {
            bgColour.color = new Color32(255, 174, 174, 255);
        }

        listener.SetResource(_itemData);
        listener.SetPageToOpen(_pageToOpen);
    }
    public void UpdatePoints()
    {
        int points = 0;

        int.TryParse(DummyPullDataFromID.PullPersonalRewardPoints(), out points);
        StartCoroutine(CountUp(points));
    }
    public void SaveFeedback()
    {
        bool allVerified = true;

        foreach (FeedbackItem f in feedbackItems)
        {
            if (f.VerifyItem() == false)
            {
                allVerified = false;
            }
        }

        if (allVerified == false)
        {
            return;
        }

        foreach (FeedbackItem f in feedbackItems)
        {
            DummyPullDataFromID.AddFeedback(f.GetFeedbackData());
        }

        DummyPullDataFromID.MarkChallengeAsComplete(challengeID);
        GetComponent <OnPopupPageOpen> ().ForceExit();
    }
示例#4
0
    public void SaveChanges()
    {
        List <string> returnList = new List <string> ();

        returnList.Add(myData [0]);

        for (int i = 0; i < textInputBoxes.Length; i++)
        {
            if (textInputBoxes [i].text == null || textInputBoxes [i].text == "")
            {
                returnList.Add(myData [i + 1]);
            }
            else
            {
                returnList.Add(textInputBoxes [i].text);
            }
            textInputBoxes [i].text = "";
        }

        returnList.Add(myData [8]);
        returnList.Add(myData [9]);

        DummyPullDataFromID.UpdatePersonalInfo(returnList.ToArray());
        profile.FillInformation();
        gameObject.GetComponent <OnPopupPageOpen> ().ForceExit();
    }
    public void FillInformation()
    {
        myInformation = DummyPullDataFromID.PullPersonalInformation();


        name.text          = myInformation [1];
        skillOne.text      = myInformation [2];
        skillTwo.text      = myInformation [3];
        skillThree.text    = myInformation [4];
        interestOne.text   = myInformation [5];
        interestTwo.text   = myInformation [6];
        interestThree.text = myInformation [7];

        editProfileButton.SetResource(myInformation);

        int points = 0;

        int.TryParse(myInformation[8], out points);
        StartCoroutine(CountUpPoints(points));

        float rating = 0;

        float.TryParse(myInformation[9], out rating);
        StartCoroutine(CountUpRating(rating));
    }
示例#6
0
    public void FillData(string[] _resource, AccountType _viewChallengePageType)
    {
        resID = _resource [0];

        challengeTitle.text       = _resource [3];
        skillOne.text             = _resource [4];
        skillTwo.text             = _resource [5];
        SkillThree.text           = _resource [6];
        challengeDescription.text = _resource [7];
        challengeDate.text        = _resource [8];
        challengeDeadline.text    = _resource [9];
        challengerName.text       = _resource [10];

        challengeIcon.sprite = DummyPullDataFromID.GetChallengeImage(_resource [0]);

        listener.SetResource(_resource);
        if (_viewChallengePageType == AccountType.Youth)
        {
            SortYouthButtons(_resource);
        }
        else if (_viewChallengePageType == AccountType.Challenger)
        {
            SortChallengerButtons(_resource);
        }
        else if (_viewChallengePageType == AccountType.Admin)
        {
        }
    }
示例#7
0
    public void AcceptReward()
    {
        string ID = GetComponent <FillRewardItems> ().GetID();

        DummyPullDataFromID.RemoveReward(ID);
        refreshScript.UpdatePoints();
    }
示例#8
0
    public void SetupPage()
    {
        ClearEverything();

        myData = DummyPullDataFromID.PullMyChallengerInfo();

        challengerName.text = myData [1];
    }
示例#9
0
 public void FillData(string[] _myData)
 {
     myData            = _myData;
     name.text         = _myData [1];
     email.text        = _myData [2];
     phone.text        = _myData [3];
     description.text  = _myData [4];
     profilePic.sprite = DummyPullDataFromID.GetChallengerProfileImage(_myData [0]);
 }
    public void FillInformation(string _challengerID)
    {
        string[] resource = DummyPullDataFromID.PullChallengerInfoByString(_challengerID);

        name.text        = resource [1];
        email.text       = resource [2];
        number.text      = resource [3];
        description.text = resource [4];

        profilePic.sprite = DummyPullDataFromID.GetChallengerProfileImage(resource [0]);
    }
 public void AcceptChallenge()
 {
     if (resource != null)
     {
         DummyPullDataFromID.UpdateData(resource [0], 1, "true");
         DummyPullDataFromID.AddToAcceptedChallenges(resource [0]);
     }
     else
     {
         Debug.Log("Resource empty @ DummyAcceptChallenge");
     }
 }
示例#12
0
 public string[] GetFeedbackData()
 {
     string[] feedbackData = new string[] {
         challengeInfo[0],
         youthID,
         textFeedbackInput.text,
         ratingInput.text,
         DummyPullDataFromID.PullMyChallengerInfo()[0],
         challengeInfo[3]
     };
     return(feedbackData);
 }
 public void OptOut()
 {
     if (resource != null)
     {
         DummyPullDataFromID.UpdateData(resource [0], 1, "false");
         DummyPullDataFromID.RemoveFromAcceptedChallenges(resource [0]);
     }
     else
     {
         Debug.Log("Resource empty @ DummyOptOut");
     }
 }
    public void FillInformation()
    {
        myInformation = DummyPullDataFromID.PullMyChallengerInfo();

        name.text        = myInformation [1];
        email.text       = myInformation [2];
        number.text      = myInformation [3];
        description.text = myInformation [4];

        profilePic.sprite = DummyPullDataFromID.GetChallengerProfileImage(myInformation [0]);

        editProfileButton.SetResource(myInformation);
    }
    public void CanRedeem()
    {
        int tempRewardPoints = int.Parse(DummyPullDataFromID.PullPersonalInformation() [8]);

        Debug.Log("Mine: " + tempRewardPoints + ", target: " + rewardCost);
        if (tempRewardPoints >= rewardCost)
        {
            GetComponent <ClickForDialogueBox> ().SetupDialogue();
        }
        else
        {
            GetComponent <ClickForInformationBox> ().SetupInfo();
        }
    }
示例#16
0
    public void SortChallengerButtons(string[] _resource)
    {
        foreach (GameObject g in DisplayButtons)
        {
            g.SetActive(false);
        }
        if (_resource [13] == "true" && DummyPullDataFromID.HasChallengeBeenAccepted(_resource[0]) && _resource [2] == "false")
        {
            DisplayButtons [4].SetActive(true);
            DisplayButtons [4].GetComponent <ClickForPopupPage> ().SetResource(_resource);
        }

        DisplayButtons [3].SetActive(true);
        DisplayButtons [3].GetComponent <ClickForPopupPage> ().SetResource(_resource);
    }
    public void FillData(string[] _resource)
    {
        myData = _resource;

        ClearEverything();

        challengeTitle.text    = _resource[3];
        challengerName.text    = _resource[10];
        skill1.text            = _resource[4];
        skill2.text            = _resource[5];
        skill3.text            = _resource[6];
        challengeDate.text     = _resource[8];
        challengeDeadline.text = _resource[9];
        description.text       = _resource[7];
        challengePic.sprite    = DummyPullDataFromID.GetChallengeImage(_resource [0]);
    }
    public void FillItems(string[] _rewardData, GameObject _parentScrollRect)
    {
        themeFont = ChangeColourScheme.GetCurrentFont();
        foreach (FontChanger f in GetComponentsInChildren <FontChanger> ())
        {
            f.ChangeMyFont(themeFont);
        }

        rewardID               = _rewardData [0];
        rewardTitle.text       = _rewardData [1];
        rewardDescription.text = _rewardData [2];
        rewardPoints.text      = _rewardData [3];
        rewardCost             = int.Parse(_rewardData [3]);

        rewardImage.sprite = DummyPullDataFromID.GetRewardImage(_rewardData [0]);

        GetComponent <OnClickHandler> ().SetParentScrollRect(_parentScrollRect);
    }
示例#19
0
    void Start()
    {
        for (int s = 0; s < challengeImages.Length; s++)
        {
            DummyPullDataFromID.SetChallengeImage(challengeImages [s], IDsForChallengeImages [s]);
        }

        for (int s = 0; s < challengerProfileImages.Length; s++)
        {
            DummyPullDataFromID.SetChallengerProfileImage(challengerProfileImages [s], IDsForChallengerProfileImages [s]);
        }

        for (int s = 0; s < rewardImages.Length; s++)
        {
            Debug.Log(s);
            DummyPullDataFromID.SetRewardImage(rewardImages [s], IDsForRewardImages [s]);
        }
    }
示例#20
0
    private void FillData()
    {
        switch (pageType)
        {
        case PageType.CHALLENGER_PROFILE:
            gameObject.GetComponent <DummyChallengerProfile> ().FillInformation(resource[12]);
            triggerExitEvent = new exitEvent(RefreshSecondaryPage);
            break;

        case PageType.CHALLENGE_INFO:
            gameObject.GetComponent <DummyChallengeInfo> ().FillData(resource, DummyPullDataFromID.GetActiveAccountType());
            triggerExitEvent = new exitEvent(RefreshMasterPage);
            break;

        case PageType.EDIT_PROFILE:
            gameObject.GetComponent <DummyEditInformation> ().FillData(resource);
            gameObject.GetComponent <DummyEditInformation> ().ToggleSavebutton(true);
            triggerExitEvent = new exitEvent(ExitEditProfile);
            break;

        case PageType.CHALLENGER_EDIT_PROFILE:
            gameObject.GetComponent <DummyEditChallengerProfile> ().FillData(resource);
            gameObject.GetComponent <DummyEditChallengerProfile> ().ToggleSavebutton(true);
            triggerExitEvent = new exitEvent(ExitChallengerEditProfile);
            break;

        case PageType.CHALLENGER_EDIT_CHALLENGE:
            gameObject.GetComponent <DummyEditChallenge> ().FillData(resource);
            triggerExitEvent = new exitEvent(ExitChallengerEditChallenge);
            break;

        case PageType.CHALLENGER_NEW_CHALLENGE:
            gameObject.GetComponent <DummyAddChallenge> ().SetupPage();
            triggerExitEvent = new exitEvent(RefreshMasterPage);
            break;

        case PageType.CHALLENGER_LEAVE_FEEDBACK:
            gameObject.GetComponent <LeaveFeedback> ().FillData(resource, DummyPullDataFromID.PullPersonalInformation()[0]);
            triggerExitEvent = new exitEvent(RefreshSecondaryPage);
            break;
        }
        anim.SetInteger("Show", 1);
    }
示例#21
0
 private void PullChallengerUpcoming()
 {
     displayedItems = DummyPullDataFromID.GetChallengerUpcoming();
 }
示例#22
0
 private void PullCompleted()
 {
     displayedItems = DummyPullDataFromID.PullCompleted();
 }
示例#23
0
 public void RefreshResource()
 {
     resource = DummyPullDataFromID.PullArrayByID(resource [0]);
 }
示例#24
0
 private void PullFeedback()
 {
     displayedItems = DummyPullDataFromID.PullFeedback();
 }
示例#25
0
 private void PullRewards()
 {
     displayedItems = DummyPullDataFromID.PullRewards();
 }
 void Start()
 {
     DummyPullDataFromID.SetTestImage(testImage);
 }
示例#27
0
 private void PullChallengerCompleted()
 {
     displayedItems = DummyPullDataFromID.GetChallengerCompleted();
 }
 public void FillFeedbackPanel(string _challengeID)
 {
     feedbackPanel.FillItems(DummyPullDataFromID.PullFeedbackByChallenge(_challengeID));
 }
示例#29
0
 public void SetChallengerID(string _ID)
 {
     DummyPullDataFromID.SetChallengerID(_ID);
     splashPage.RefreshFeed();
     DummyPullDataFromID.SetActiveAccountType(AccountType.Challenger);
 }
示例#30
0
 public void SetupItem(string _youthID, string[] _challengeInfo)
 {
     youthID        = _youthID;
     challengeInfo  = _challengeInfo;
     youthName.text = DummyPullDataFromID.PullYouthInfoByID(_youthID)[1];
 }