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 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 { } }