public void ListAllCollectedClues(ClueSpaceUI caller)
    {
        CaseData openedCase = InvestigationManager.GetCase();

        Open();
        Erase();
        Files files = Files.Load();

        this.caller = caller;
        var l = files.GetCaseStatus().clues;

        for (int i = 0; i < l.Count; i++)
        {
            var      clue = l[i];
            ClueData cd   = openedCase.GetClueData(clue);
            var      go   = Instantiate(cluePrefab, root);
            go.GetComponent <ClueForListUI>().SetInfo(cd);
            go.GetComponent <Button>().onClick.AddListener(
                delegate {
                ClueData c = cd;
                Choose(c);
            });
            if (i == 0)
            {
                go.GetComponent <Button>().Select();
            }
        }
    }
    void selectClue(ClueData clue)
    {
        clueSprite.sprite = clue.sprite;
        clueText.text     = clue.title;

        currentClue = clue;
    }
    // randomly chooses a clue
    void ClueSetUp(List <ClueData> clues)
    {
        ClueData chosenClue = clues[Random.Range(0, clues.Count)];

        clueText.text = chosenClue.clueText;
        currentClue   = chosenClue;
    }
 public void SelectClue(ClueData clue)
 {
     transform.GetChild(0).GetComponent <CanvasGroup>().alpha = 1;
     selectedClue = clue;
     title.text   = clue.clueName;
     icon.sprite  = clue.img;
 }
    // assigns which bottles should be clicked based on clue
    void BottleSetUp(List <Bottle> bottles, ClueData clue)
    {
        foreach (Bottle b in bottles)

        {
            foreach (string m in clue.molecules)
            {
                if (b.chemicalName == m)
                {
                    b.shouldBeClicked = true;
                }
            }
        }
    }
    private void HighlightSpots()
    {
        ClueData.RowCol pos       = ClueData.Instance.GetPlayerRowCol(turnManager.CurrentTurn - 1);
        List <int[]>    positions = PossibleBoardLocations.GetBoardLocations(pos.row, pos.col, diceRoller.DiceValue, (i => IsValid(i)));

        for (int i = 0; i < positions.Count; i++)
        {
            Vector3    spawn = boardManager.RowColToBoardLocation(positions[i][0], positions[i][1], 5e-4f);
            GameObject tile  = Instantiate(highlight, spawn, Quaternion.identity);
            tile.GetComponent <TileSelector>().cgm       = this;
            tile.GetComponent <TileSelector>().location  = ClueData.GetRowColl(positions[i]);
            tile.GetComponent <TileSelector>().clickable = IsCurrentTurnHuman();
            highlights.Push(tile);
        }
    }
Exemple #7
0
    public void Ask(ClueData clue)
    {
        CaseData openedCase = InvestigationManager.GetCase();

        foreach (var testimony in data.testimonys)
        {
            if (testimony.clue == clue)
            {
                Files files = Files.Load();
                bool  added = files.GetCaseStatus().AddTestimony(openedCase.GetTestimonyFromData(testimony));
                files.Save();
                DialogUI.StartDialog(testimony.findingDialog, added, DialogType.TESTIMONY);
                return;
            }
        }
        DialogUI.StartDialog(data.genericNegativeAnswers[Random.Range(0, data.genericNegativeAnswers.Count)]);
    }
    protected void FoundClue(ClueData clue)
    {
        CaseData openedCase = InvestigationManager.GetCase();
        int      clueIndex  = openedCase.GetClueIndexFromData(clue);

        if (clueIndex >= 0)
        {
            Files files = Files.Load();
            bool  added = files.GetCaseStatus().AddClue(openedCase.GetClueIndexFromData(clue));
            files.Save();
            Debug.Log("ADDED: " + added);
            DialogUI.StartDialog(clue.findingDialog, added, DialogType.CLUE);
        }
        else
        {
            NoClueFound();
        }
    }
Exemple #9
0
    private void InitClueWidgets(CaseData caseData)
    {
        // First, create enough widgets for the current case
        // there may already be one or more widgets under cluesGrid to visualize better
        // in the editor, so only add what you need.
        // We assume all children of cluesGrid are actually clue widgets, so just count them.
        // If you open the Clues page for the second time in this mission, nothing should be added.
        int currentButtonsCount = cluesGrid.transform.childCount;

        for (int i = currentButtonsCount; i < caseData.clueDataArray.Length; i++)
        {
            Instantiate(clueButtonPrefab, cluesGrid.transform);
        }

        // Second, disable any extra widgets (e.g. created from a previous case that had more clues than the current one)
        for (int i = caseData.clueDataArray.Length; i < currentButtonsCount; i++)
        {
            cluesGrid.transform.GetChild(i).gameObject.SetActive(false);
        }

        // Third, setup the scene widgets for each available scene
        for (int i = 0; i < caseData.clueDataArray.Length; i++)
        {
            // get widget script
            Transform widgetTr = cluesGrid.transform.GetChild(i);
            Debug.AssertFormat(widgetTr != null, cluesGrid,
                               "Scene widget grid {0} has no child of index {1}, yet we should have created up to {2} widgets " +
                               "after the existing {3}.", cluesGrid, i, caseData.clueDataArray.Length, currentButtonsCount);
            var widget = widgetTr.GetComponentOrFail <CaseFileClueWidget>();

            // get clue data
            ClueData clueData = caseData.clueDataArray[i];

            // check if clue has been found
            bool isClueFound = CaseManager.Instance.CurrentCaseProgress.HasFoundClue(clueData.stringID);

            // init clue button widget
            widget.Init(clueData, isClueFound);
        }
    }
    public void SetObject(ClueData clue, bool full = true)
    {
        CaseData openedCase = InvestigationManager.GetCase();

        GetComponent <CanvasGroup>().alpha = 1;
        string fullDescription = clue.clueDescription;
        Files  files           = Files.Load();

        if (full)
        {
            int clueIndex = openedCase.GetClueIndexFromData(clue);
            fullDescription += "\n\nTESTEMUNHOS:";
            foreach (Testimony t in files.GetCaseStatus().testimonys)
            {
                if (t.clue == clueIndex)
                {
                    TestimonyData td = openedCase.GetTestimonyData(t);
                    fullDescription += "\n" + "* " + td.witness.witnessName + ": " + td.description;
                }
            }
            fullDescription += "\n\nINSIGHTS:";
            foreach (int i in files.GetCaseStatus().insights)
            {
                InsightData id = openedCase.GetInsightData(i);
                if ((openedCase.GetClueIndexFromData(id.firstClue) == clueIndex) ||
                    (openedCase.GetClueIndexFromData(id.secondClue) == clueIndex))
                {
                    fullDescription += "\n* [" + id.firstClue.clueName + ":" + id.secondClue.clueName + "]"
                                       + id.description;
                }
            }
        }
        description.text = fullDescription;
        title.text       = clue.clueName;
        icon.sprite      = clue.img;
    }
 public void AskWitness(ClueData clue)
 {
     collidingWitness[0].Ask(clue);
 }
Exemple #12
0
 private void OnClueSelected(ClueData clueData)
 {
     clueDescriptionWidget.text = clueData.description;
 }
Exemple #13
0
 public static void InvokeClueSelected(ClueData clueData)
 {
     clueSelected?.Invoke(clueData);
 }
Exemple #14
0
 public void SetInfo(ClueData data)
 {
     this.data        = data;
     this.icon.sprite = data.img;
     this.header.text = data.clueName;
 }
 void Start()
 {
     d    = Dialogtext.GetInstance();
     data = ClueData.getInstance();
 }
 public void SetInfo(ClueData data)
 {
     title.text = data.clueName;
     obj        = data;
     type       = DataType.CLUE;
 }
Exemple #17
0
 public int GetClueIndexFromData(ClueData data)
 {
     return(clues.IndexOf(data));
 }
 public bool IsValid(int[] position)
 {
     return(IsValid(ClueData.GetRowColl(position)));
 }
Exemple #19
0
 public void Init(ClueData clueData, bool isClueFound)
 {
     m_ClueData          = clueData;
     clueNameWidget.text = clueData.clueName;
     button.interactable = isClueFound;
 }
Exemple #20
0
 public void Choose(ClueData cd)
 {
     caller.SelectClue(cd);
     Close();
 }
 public void SetInfo(ClueData cd)
 {
     clueData    = cd;
     name.text   = cd.clueName;
     icon.sprite = cd.img;
 }
 public void SetInfo(string question, ClueData data)
 {
     this.question.text = question;
     this.answer.text   = data.name;
 }