internal bool HandleMouseClick() { if (selectedAbility == null) { AbilitySelectTab temp = equippedAbilities.Find(tab => tab.containsMouseRight(KeyboardMouseUtility.uiMousePos)); if (temp != default(AbilitySelectTab)) { bCursorFocusRight = false; SwitchLeftRight(); Select(temp); return(true); } temp = availableAbilities.Find(tab => tab.containsMouseLeft(KeyboardMouseUtility.uiMousePos)); if (temp != default(AbilitySelectTab)) { bCursorFocusRight = true; SwitchLeftRight(); Select(temp); return(true); } } else { if (bCursorFocusRight) { if (selectedAbility.containsMouseRight(KeyboardMouseUtility.uiMousePos)) { bc.CCC.abiEquipList.Remove(selectedAbility.getParent()); GameMenuHandler.selectedCharacterContext.abilityLineupInfo = new AbilityLineupInfo(GameMenuHandler.selectedCharacterContext.abilityLineupInfo.bc); return(false); } else { selectedAbility = null; return(HandleMouseClick()); } } else { if (selectedAbility.containsMouseLeft(KeyboardMouseUtility.uiMousePos)) { if (bc.CCC.abiEquipList.CanAddAbility(selectedAbility.getParent())) { bc.CCC.abiEquipList.Add(selectedAbility.getParent()); GameMenuHandler.selectedCharacterContext.abilityLineupInfo = new AbilityLineupInfo(GameMenuHandler.selectedCharacterContext.abilityLineupInfo.bc); } } else { selectedAbility = null; return(HandleMouseClick()); } } } return(false); }
internal void SwitchLeftRight() { bCursorFocusRight = !bCursorFocusRight; selectedAbility = null; if (selectionTimer == null) { selectionTimer = new TimingUtility(30, true, StopSelectionTimerWhen); selectionTimer.SetStepTimer(40); } }
internal void Draw(SpriteBatch sb) { sb.End(); sb.GraphicsDevice.SetRenderTarget(render); sb.GraphicsDevice.Clear(Color.TransparentBlack); sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp); float opacityMod = 0.8f; if (bCursorFocusRight) { bgPanelLeft.Draw(sb, Color.White); if (bBuildUp) { bgPanelRight.Draw(sb, Color.White * ((selectionTimer.percentageDone() + opacityMod) * opacityMod)); } else { bgPanelRight.Draw(sb, Color.White * ((1.0f + opacityMod - selectionTimer.percentageDone()) * opacityMod)); } } else { bgPanelRight.Draw(sb, Color.White); if (bBuildUp) { bgPanelLeft.Draw(sb, Color.White * ((selectionTimer.percentageDone() + opacityMod) * opacityMod)); } else { bgPanelLeft.Draw(sb, Color.White * ((1.0f + opacityMod - selectionTimer.percentageDone()) * opacityMod)); } } TextUtility.Draw(sb, rightPanelTitle.getText() + " (" + bc.CCC.abiEquipList.abilities.Count + @"/" + bc.CCC.abiEquipList.amount + ")", TitleFont, rightPanelTitlePosition, TextUtility.OutLining.Left, Color.White, 1f, true, default(Matrix), Color.Silver, false); // sb.Draw(Game1.WhiteTex, rightPanelAbilityLineup, Color.Red); sb.Draw(AbilitySelectTab.GetRenderRight(), new Rectangle(0, 0, 1366, 768), Color.White); TextUtility.Draw(sb, leftPanelTitle.getText(), TitleFont, leftPanelTitlePosition, TextUtility.OutLining.Left, Color.White, 1f, true, default(Matrix), Color.Silver, false); sb.Draw(AbilitySelectTab.GetRenderLeft(), new Rectangle(0, 0, 1366, 768), Color.White); if (selectedAbility != null && selectedAbility.asd != null) { selectedAbility.asd.Draw(sb); } sb.End(); sb.GraphicsDevice.SetRenderTarget(null); }
internal void setSelectedAbility(AbilitySelectTab abilitySelectTab) { if (selectedAbility != null) { selectedAbility.asd.Close(); } selectedAbility = abilitySelectTab; if (selectedAbility != null) { selectedAbility.asd = new AbilitySelectDescription(bc, selectedAbility.getParent(), new Rectangle(450, selectedAbility.distanceY() - 300, 250, 400)); } }
internal void GenerateRenders(SpriteBatch sb) { Draw(sb); if (selectedAbility != null && selectedAbility.asd != null) { selectedAbility.asd.GenerateRender(sb); } for (int i = 0; i < equippedAbilities.Count; i++) { equippedAbilities[i].Draw(sb); } for (int i = 0; i < availableAbilities.Count; i++) { availableAbilities[i].Draw(sb); } AbilitySelectTab.GenerateCompleteRenderLeft(sb, availableAbilities); AbilitySelectTab.GenerateCompleteRenderRight(sb, equippedAbilities); }
internal void Select(AbilitySelectTab ast) { ast.Select(); }