public void clickNotification(int idx) { for (int i = 0; i < entryList.Count; ++i) { if (entryList [i].index != idx) { entryList [i].targetOpacity = 0.0f; } else { entryList [i].blink(); } } status = AlphabetState.reading; }
public void goBack() { if ((status == AlphabetState.initial) || (status == AlphabetState.listing)) { fader._wa_fadeOut(this); this.isWaitingForActionToComplete = true; status = AlphabetState.exitting; } if (status == AlphabetState.reading) { for (int i = 0; i < entryList.Count; ++i) { entryList [i].reset(); } status = AlphabetState.listing; dialogueController._wm_clear(); } }
// Use this for initialization new void Start() { mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript> (); rosetta = GameObject.Find("Rosetta").GetComponent <Rosetta> (); ds = mcRef.getStorage(); status = AlphabetState.initial; scrollbar.gameObject.SetActive(false); conversationList = new List <StoredConversation> (); entryList = new List <AlphabetEntry> (); lastScroll = 0.0f; StoredConversation con; int numberOfConversations = ds.retrieveIntValue("NumberOfStoredConversations"); for (int index = 0; index < numberOfConversations; ++index) { con = new StoredConversation(); con.initialize(); string title; title = ds.retrieveStringValue("TitleOfConversation" + index); con.setTitle(rosetta.retrieveString(title)); int nBubbles = ds.retrieveIntValue("LengthOfConversation" + index); for (int jindex = 0; jindex < nBubbles; ++jindex) { string contents = ds.retrieveStringValue("Conversation" + index + "_" + jindex); StoredConversationSpeaker convSpeak = StoredConversationSpeaker.player; string speaker = ds.retrieveStringValue("Conversation" + index + "_" + jindex + "Speaker"); if (speaker.Equals("Player")) { convSpeak = StoredConversationSpeaker.player; } if (speaker.Equals("NPC1")) { convSpeak = StoredConversationSpeaker.npc0; } if (speaker.Equals("NPC2")) { convSpeak = StoredConversationSpeaker.npc1; } con.addBubble(rosetta.retrieveString(contents), convSpeak); } conversationList.Add(con); } conversationBarGO = new List <GameObject> (); for (int i = 0; i < conversationList.Count; ++i) { GameObject newBar; newBar = new GameObject(); AlphabetEntry entry = newBar.AddComponent <AlphabetEntry> (); entry.theParent = container; entry.yPos = 253 - 106 - i * 100; entry.timeDelay = i * 0.25f; entry.theConversation = conversationList [i]; entry.initialize(); entry.index = i; entry.dialogueController = dialogueController; entry.theController = this.GetComponent <AlphabetController> (); conversationBarGO.Add(newBar); entryList.Add(entry); // if the list is too long, enable scrollbar if (entry.yPos < (-400 + 100)) { //scrollbar.GetComponent<Image>().enabled = true; scrollbar.gameObject.SetActive(true); } } this.isWaitingForActionToComplete = false; }