public void onTouchPcSelector(MouseEventArgs e, MouseEventType.EventType eventType) { try { btnReturn.glowOn = false; switch (eventType) { case MouseEventType.EventType.MouseDown: case MouseEventType.EventType.MouseMove: int x = (int)e.X; int y = (int)e.Y; if (btnReturn.getImpact(x, y)) { btnReturn.glowOn = true; } break; case MouseEventType.EventType.MouseUp: x = (int)e.X; y = (int)e.Y; btnReturn.glowOn = false; Player pc = gv.mod.playerList[pcSelectorPcIndex]; if (btnReturn.getImpact(x, y)) { if (pcSelectorType.Equals("spellcaster")) { gv.screenType = "main"; } } for (int j = 0; j < gv.mod.playerList.Count; j++) { if (btnPartyIndex[j].getImpact(x, y)) { pcSelectorPcIndex = j; } } break; } } catch { } }
public void onTouchLauncher(MouseEventArgs e, MouseEventType.EventType eventType) { try { btnLeft.glowOn = false; btnRight.glowOn = false; btnModuleName.glowOn = false; btnExit.glowOn = false; switch (eventType) { case MouseEventType.EventType.MouseUp: int x = (int)e.X; int y = (int)e.Y; btnLeft.glowOn = false; btnRight.glowOn = false; btnModuleName.glowOn = false; btnExit.glowOn = false; if (btnLeft.getImpact(x, y)) { if (moduleIndex > 0) { moduleIndex--; btnModuleName.Text = moduleList[moduleIndex].moduleName; } } else if (btnRight.getImpact(x, y)) { if (moduleIndex < moduleList.Count - 1) { moduleIndex++; btnModuleName.Text = moduleList[moduleIndex].moduleName; } } else if (btnModuleName.getImpact(x, y)) { gv.mod = moduleList[moduleIndex]; gv.resetGame(); gv.cc.LoadSaveListItems(); gv.screenType = "title"; } else if (btnExit.getImpact(x, y)) { gv.Close(); } break; case MouseEventType.EventType.MouseMove: case MouseEventType.EventType.MouseDown: x = (int)e.X; y = (int)e.Y; if (btnLeft.getImpact(x, y)) { btnLeft.glowOn = true; } else if (btnRight.getImpact(x, y)) { btnRight.glowOn = true; } else if (btnModuleName.getImpact(x, y)) { btnModuleName.glowOn = true; } else if (btnExit.getImpact(x, y)) { btnExit.glowOn = true; } break; } } catch { } }
public void onTouchCastSelector(MouseEventArgs e, MouseEventType.EventType eventType, bool inCombat) { btnHelp.glowOn = false; btnExit.glowOn = false; btnSelect.glowOn = false; btnTokensLeft.glowOn = false; btnTokensRight.glowOn = false; btnPageIndex.glowOn = false; switch (eventType) { case MouseEventType.EventType.MouseDown: case MouseEventType.EventType.MouseMove: int x = (int)e.X; int y = (int)e.Y; if (btnHelp.getImpact(x, y)) { btnHelp.glowOn = true; } else if (btnSelect.getImpact(x, y)) { btnSelect.glowOn = true; } else if (btnExit.getImpact(x, y)) { btnExit.glowOn = true; } else if (btnTokensLeft.getImpact(x, y)) { btnTokensLeft.glowOn = true; } else if (btnTokensRight.getImpact(x, y)) { btnTokensRight.glowOn = true; } else if (btnPageIndex.getImpact(x, y)) { btnPageIndex.glowOn = true; } break; case MouseEventType.EventType.MouseUp: x = (int)e.X; y = (int)e.Y; btnHelp.glowOn = false; //btnInfo.glowOn = false; btnExit.glowOn = false; btnSelect.glowOn = false; btnTokensLeft.glowOn = false; btnTokensRight.glowOn = false; btnPageIndex.glowOn = false; for (int j = 0; j < slotsPerPage; j++) { if (btnSpellSlots[j].getImpact(x, y)) { spellSlotIndex = j; } } if (btnTokensLeft.getImpact(x, y)) { if (tknPageIndex > 0) { tknPageIndex--; btnPageIndex.Text = (tknPageIndex + 1) + "/" + maxPages; } } else if (btnTokensRight.getImpact(x, y)) { if (tknPageIndex < maxPages) { tknPageIndex++; btnPageIndex.Text = (tknPageIndex + 1) + "/" + maxPages; } } else if (btnHelp.getImpact(x, y)) { tutorialMessageCastingScreen(); } else if (btnSelect.getImpact(x, y)) { doSelectedSpell(inCombat); } else if (btnExit.getImpact(x, y)) { if (inCombat) { if (gv.screenCombat.canMove) { gv.screenCombat.currentCombatMode = "move"; } else { gv.screenCombat.currentCombatMode = "attack"; } gv.screenType = "combat"; doCleanUp(); } else { gv.screenType = "main"; doCleanUp(); } } break; } }
public void onTouchTokenSelector(MouseEventArgs e, MouseEventType.EventType eventType) { try { btnTokensLeft.glowOn = false; btnTokensRight.glowOn = false; btnAction.glowOn = false; btnExit.glowOn = false; switch (eventType) { case MouseEventType.EventType.MouseDown: case MouseEventType.EventType.MouseMove: int x = (int)e.X; int y = (int)e.Y; if (btnTokensLeft.getImpact(x, y)) { btnTokensLeft.glowOn = true; } else if (btnTokensRight.getImpact(x, y)) { btnTokensRight.glowOn = true; } else if (btnAction.getImpact(x, y)) { btnAction.glowOn = true; } else if (btnExit.getImpact(x, y)) { btnExit.glowOn = true; } break; case MouseEventType.EventType.MouseUp: x = (int)e.X; y = (int)e.Y; btnTokensLeft.glowOn = false; btnTokensRight.glowOn = false; btnAction.glowOn = false; btnExit.glowOn = false; for (int j = 0; j < slotsPerPage; j++) { if (btnTokenSlot[j].getImpact(x, y)) { if (tknSlotIndex == j) { //return to calling screen if (callingScreen.Equals("party")) { gv.screenParty.gv.mod.playerList[gv.cc.partyScreenPcIndex].tokenFilename = playerTokenList[GetIndex()]; gv.screenType = "party"; gv.screenParty.tokenLoad(gv.screenParty.gv.mod.playerList[gv.cc.partyScreenPcIndex]); } else if (callingScreen.Equals("pcCreation")) { //set PC token filename to the currently selected image gv.screenPcCreation.pc.tokenFilename = playerTokenList[GetIndex()]; gv.screenType = "pcCreation"; gv.screenPcCreation.tokenLoad(gv.screenPcCreation.pc); } doCleanUp(); } tknSlotIndex = j; } } if (btnTokensLeft.getImpact(x, y)) { if (tknPageIndex > 0) { tknPageIndex--; btnPageIndex.Text = (tknPageIndex + 1) + "/" + maxPages; } } else if (btnTokensRight.getImpact(x, y)) { if (tknPageIndex < maxPages) { tknPageIndex++; btnPageIndex.Text = (tknPageIndex + 1) + "/" + maxPages; } } else if (btnAction.getImpact(x, y)) { //return to calling screen if (callingScreen.Equals("party")) { gv.screenParty.gv.mod.playerList[gv.cc.partyScreenPcIndex].tokenFilename = playerTokenList[GetIndex()]; gv.screenType = "party"; gv.screenParty.tokenLoad(gv.screenParty.gv.mod.playerList[gv.cc.partyScreenPcIndex]); } else if (callingScreen.Equals("pcCreation")) { //set PC portrait filename to the currently selected image gv.screenPcCreation.pc.tokenFilename = playerTokenList[GetIndex()]; gv.screenType = "pcCreation"; gv.screenPcCreation.tokenLoad(gv.screenPcCreation.pc); } doCleanUp(); } else if (btnExit.getImpact(x, y)) { //do nothing, return to calling screen if (callingScreen.Equals("party")) { gv.screenType = "party"; } else if (callingScreen.Equals("pcCreation")) { gv.screenType = "pcCreation"; } doCleanUp(); } break; } } catch { } }
public void onTouchPartyBuild(MouseEventArgs e, MouseEventType.EventType eventType) { try { btnAdd.glowOn = false; btnRemove.glowOn = false; btnLeft.glowOn = false; btnRight.glowOn = false; btnCreate.glowOn = false; btnHelp.glowOn = false; btnReturn.glowOn = false; switch (eventType) { case MouseEventType.EventType.MouseDown: case MouseEventType.EventType.MouseMove: int x = (int)e.X; int y = (int)e.Y; if (btnAdd.getImpact(x, y)) { btnAdd.glowOn = true; } else if (btnRemove.getImpact(x, y)) { btnRemove.glowOn = true; } else if (btnLeft.getImpact(x, y)) { btnLeft.glowOn = true; } else if (btnPcListIndex.getImpact(x, y)) { btnPcListIndex.glowOn = true; } else if (btnRight.getImpact(x, y)) { btnRight.glowOn = true; } else if (btnCreate.getImpact(x, y)) { btnCreate.glowOn = true; } else if (btnHelp.getImpact(x, y)) { btnHelp.glowOn = true; } else if (btnReturn.getImpact(x, y)) { btnReturn.glowOn = true; } break; case MouseEventType.EventType.MouseUp: x = (int)e.X; y = (int)e.Y; btnAdd.glowOn = false; btnRemove.glowOn = false; btnLeft.glowOn = false; btnRight.glowOn = false; btnPcListIndex.glowOn = false; btnCreate.glowOn = false; btnHelp.glowOn = false; btnReturn.glowOn = false; if (btnAdd.getImpact(x, y)) { gv.PlaySound("btn_click"); //add selected PC to partyList and remove from pcList if ((pcList.Count > 0) && (gv.mod.playerList.Count < gv.mod.numberOfPlayerMadePcsAllowed)) { Player copyPC = pcList[pcIndex].DeepCopy(); copyPC.token = gv.cc.LoadBitmap(copyPC.tokenFilename); copyPC.portrait = gv.cc.LoadBitmap(copyPC.portraitFilename); copyPC.playerClass = gv.mod.getPlayerClass(copyPC.classTag); copyPC.race = gv.mod.getRace(copyPC.raceTag); gv.mod.playerList.Add(copyPC); pcList.RemoveAt(pcIndex); } } else if (btnRemove.getImpact(x, y)) { gv.PlaySound("btn_click"); //remove selected from partyList and add to pcList if (gv.mod.playerList.Count > 0) { Player copyPC = gv.mod.playerList[partyScreenPcIndex].DeepCopy(); copyPC.token = gv.cc.LoadBitmap(copyPC.tokenFilename); copyPC.portrait = gv.cc.LoadBitmap(copyPC.portraitFilename); copyPC.playerClass = gv.mod.getPlayerClass(copyPC.classTag); copyPC.race = gv.mod.getRace(copyPC.raceTag); pcList.Add(copyPC); gv.mod.playerList.RemoveAt(partyScreenPcIndex); } } else if (btnLeft.getImpact(x, y)) { gv.PlaySound("btn_click"); //change index of pcList lastClickedPlayerList = false; if (pcIndex > 0) { pcIndex--; } } else if (btnPcListIndex.getImpact(x, y)) { gv.PlaySound("btn_click"); //change index of pcList lastClickedPlayerList = false; } else if (btnRight.getImpact(x, y)) { gv.PlaySound("btn_click"); //change index of pcList lastClickedPlayerList = false; if (pcIndex < pcList.Count - 1) { pcIndex++; } } else if (btnCreate.getImpact(x, y)) { gv.PlaySound("btn_click"); //switch to PcCreation screen gv.screenPcCreation.CreateRaceList(); gv.screenPcCreation.resetPC(); gv.screenType = "pcCreation"; } else if (btnHelp.getImpact(x, y)) { gv.PlaySound("btn_click"); tutorialPartyBuild(); } else if (btnReturn.getImpact(x, y)) { gv.PlaySound("btn_click"); if (gv.mod.playerList.Count > 0 && gv.mod.playerList.Count >= gv.mod.numberOfPlayerMadePcsRequired && gv.mod.playerList.Count <= gv.mod.numberOfPlayerMadePcsAllowed) { gv.mod.PlayerLocationX = gv.mod.startingPlayerPositionX; gv.mod.PlayerLocationY = gv.mod.startingPlayerPositionY; gv.mod.playerList[0].mainPc = true; gv.mod.playerList[0].nonRemoveablePc = true; foreach (Player p in gv.mod.playerList) { gv.sf.UpdateStats(p); } gv.log.tagStack.Clear(); gv.log.logLinesList.Clear(); gv.log.currentTopLineIndex = 0; gv.cc.tutorialMessageMainMap(); gv.screenType = "main"; gv.cc.doUpdate(); } } for (int j = 0; j < gv.mod.playerList.Count; j++) { if (btnPartyIndex[j].getImpact(x, y)) { gv.PlaySound("btn_click"); partyScreenPcIndex = j; lastClickedPlayerList = true; } } break; } } catch { } }
public void onTouchJournal(MouseEventArgs e, MouseEventType.EventType eventType) { //1 try { //2 ctrlUpArrow.glowOn = false; ctrlDownArrow.glowOn = false; ctrlLeftArrow.glowOn = false; ctrlRightArrow.glowOn = false; btnReturnJournal.glowOn = false; switch (eventType) {//3 case MouseEventType.EventType.MouseDown: case MouseEventType.EventType.MouseMove: int x = (int)e.X; int y = (int)e.Y; if (ctrlUpArrow.getImpact(x, y)) { ctrlUpArrow.glowOn = true; } else if (ctrlDownArrow.getImpact(x, y)) { ctrlDownArrow.glowOn = true; } else if (ctrlLeftArrow.getImpact(x, y)) { ctrlLeftArrow.glowOn = true; } else if (ctrlRightArrow.getImpact(x, y)) { ctrlRightArrow.glowOn = true; } else if (btnReturnJournal.getImpact(x, y)) { btnReturnJournal.glowOn = true; } break; case MouseEventType.EventType.MouseUp: x = (int)e.X; y = (int)e.Y; ctrlUpArrow.glowOn = false; ctrlDownArrow.glowOn = false; ctrlLeftArrow.glowOn = false; ctrlRightArrow.glowOn = false; btnReturnJournal.glowOn = false; if (ctrlUpArrow.getImpact(x, y)) { if (journalScreenQuestIndex > 0) { journalScreenQuestIndex--; journalScreenEntryIndex = gv.mod.partyJournalQuests[journalScreenQuestIndex].Entries.Count - 1; } } else if (ctrlDownArrow.getImpact(x, y)) { if (journalScreenQuestIndex < gv.mod.partyJournalQuests.Count - 1) { journalScreenQuestIndex++; journalScreenEntryIndex = gv.mod.partyJournalQuests[journalScreenQuestIndex].Entries.Count - 1; } } else if (ctrlLeftArrow.getImpact(x, y)) { if (journalScreenEntryIndex > 0) { journalScreenEntryIndex--; } } else if (ctrlRightArrow.getImpact(x, y)) { if (journalScreenEntryIndex < gv.mod.partyJournalQuests[journalScreenQuestIndex].Entries.Count - 1) { journalScreenEntryIndex++; } } else if (btnReturnJournal.getImpact(x, y)) { gv.screenType = "main"; journalBack = null; btnReturnJournal = null; ctrlUpArrow = null; ctrlDownArrow = null; ctrlLeftArrow = null; ctrlRightArrow = null; } break; } //3 } //2 catch { } }
public void onTouchTitle(MouseEventArgs e, MouseEventType.EventType eventType) { try { btnNewGame.glowOn = false; btnLoadSavedGame.glowOn = false; btnPlayerGuide.glowOn = false; btnBeginnerGuide.glowOn = false; btnAbout.glowOn = false; btnExit.glowOn = false; switch (eventType) { case MouseEventType.EventType.MouseUp: int x = (int)e.X; int y = (int)e.Y; btnNewGame.glowOn = false; btnLoadSavedGame.glowOn = false; btnAbout.glowOn = false; btnExit.glowOn = false; btnPlayerGuide.glowOn = false; btnBeginnerGuide.glowOn = false; if (btnNewGame.getImpact(x, y)) { gv.PlaySound("btn_click"); if (gv.mod.mustUsePreMadePC) { //no spell selection offered gv.log.tagStack.Clear(); gv.log.logLinesList.Clear(); gv.log.currentTopLineIndex = 0; gv.cc.tutorialMessageMainMap(); gv.screenType = "main"; gv.cc.doUpdate(); } else { gv.screenType = "partyBuild"; gv.screenPartyBuild.loadPlayerList(); } } else if (btnLoadSavedGame.getImpact(x, y)) { gv.PlaySound("btn_click"); if (gv.cc.slot5.Equals("")) { //Toast.makeText(gv.gameContext, "Still Loading Data... try again in a second", Toast.LENGTH_SHORT).show(); } else { gv.cc.doLoadSaveGameDialog(); } } else if (btnPlayerGuide.getImpact(x, y)) { gv.PlaySound("btn_click"); gv.cc.tutorialPlayersGuide(); } else if (btnBeginnerGuide.getImpact(x, y)) { gv.PlaySound("btn_click"); gv.cc.tutorialBeginnersGuide(); } else if (btnAbout.getImpact(x, y)) { gv.PlaySound("btn_click"); gv.cc.doAboutDialog(); } else if (btnExit.getImpact(x, y)) { gv.PlaySound("btn_click"); gv.Close(); } break; case MouseEventType.EventType.MouseDown: case MouseEventType.EventType.MouseMove: x = (int)e.X; y = (int)e.Y; if (btnNewGame.getImpact(x, y)) { btnNewGame.glowOn = true; } else if (btnLoadSavedGame.getImpact(x, y)) { btnLoadSavedGame.glowOn = true; } else if (btnAbout.getImpact(x, y)) { btnAbout.glowOn = true; } else if (btnExit.getImpact(x, y)) { btnExit.glowOn = true; } else if (btnPlayerGuide.getImpact(x, y)) { btnPlayerGuide.glowOn = true; } else if (btnBeginnerGuide.getImpact(x, y)) { btnBeginnerGuide.glowOn = true; } break; } } catch { } }
public void onTouchPartyRoster(MouseEventArgs e, MouseEventType.EventType eventType) { try { btnDown.glowOn = false; btnUp.glowOn = false; btnHelp.glowOn = false; btnReturn.glowOn = false; switch (eventType) { case MouseEventType.EventType.MouseDown: case MouseEventType.EventType.MouseMove: int x = (int)e.X; int y = (int)e.Y; if (btnDown.getImpact(x, y)) { btnDown.glowOn = true; } else if (btnUp.getImpact(x, y)) { btnUp.glowOn = true; } else if (btnHelp.getImpact(x, y)) { btnHelp.glowOn = true; } else if (btnReturn.getImpact(x, y)) { btnReturn.glowOn = true; } break; case MouseEventType.EventType.MouseUp: x = (int)e.X; y = (int)e.Y; btnDown.glowOn = false; btnUp.glowOn = false; btnHelp.glowOn = false; btnReturn.glowOn = false; if (btnUp.getImpact(x, y)) { //add selected PC to partyList and remove from pcList if ((gv.mod.partyRosterList.Count > 0) && (gv.mod.playerList.Count < gv.mod.MaxPartySize)) { Player copyPC = gv.mod.partyRosterList[partyRosterPcIndex].DeepCopy(); gv.cc.DisposeOfBitmap(ref copyPC.token); copyPC.token = gv.cc.LoadBitmap(copyPC.tokenFilename); gv.cc.DisposeOfBitmap(ref copyPC.portrait); copyPC.portrait = gv.cc.LoadBitmap(copyPC.portraitFilename); copyPC.playerClass = gv.mod.getPlayerClass(copyPC.classTag); copyPC.race = gv.mod.getRace(copyPC.raceTag); //Player copyPC = gv.mod.partyRosterList[partyRosterPcIndex]; gv.mod.playerList.Add(copyPC); gv.mod.partyRosterList.RemoveAt(partyRosterPcIndex); } } else if (btnDown.getImpact(x, y)) { //remove selected from partyList and add to pcList if (gv.mod.playerList.Count > 0) { Player copyPC = gv.mod.playerList[partyScreenPcIndex].DeepCopy(); gv.cc.DisposeOfBitmap(ref copyPC.token); copyPC.token = gv.cc.LoadBitmap(copyPC.tokenFilename); gv.cc.DisposeOfBitmap(ref copyPC.portrait); copyPC.portrait = gv.cc.LoadBitmap(copyPC.portraitFilename); copyPC.playerClass = gv.mod.getPlayerClass(copyPC.classTag); copyPC.race = gv.mod.getRace(copyPC.raceTag); gv.mod.partyRosterList.Add(copyPC); gv.mod.playerList.RemoveAt(partyScreenPcIndex); } } else if (btnHelp.getImpact(x, y)) { tutorialPartyRoster(); } else if (btnReturn.getImpact(x, y)) { if (gv.mod.playerList.Count > 0) { //check to see if any non-removeable PCs are in roster if (checkForNoneRemovablePcInRoster()) { return; } //check to see if mainPc is in party if (checkForMainPc()) { gv.screenType = "main"; } else { gv.sf.MessageBoxHtml("You must have the Main PC (the first PC you created) in your party before exiting this screen"); } } } for (int j = 0; j < gv.mod.playerList.Count; j++) { if (btnPartyIndex[j].getImpact(x, y)) { partyScreenPcIndex = j; lastClickedPlayerList = true; } } for (int j = 0; j < gv.mod.partyRosterList.Count; j++) { if (btnPartyRosterIndex[j].getImpact(x, y)) { partyRosterPcIndex = j; lastClickedPlayerList = false; } } break; } } catch { } }