protected virtual void HandleEvent(MouseAction action) { Trace.WriteLine("Route:HandleEvent:" + CurrentButtons.ToString()); CurrentMousePosition = action.MousePosition; CurrentButtons = Control.MouseButtons; // Issue #39: Mouse Move event fires even for button press when mouse hasn't moved! IEnumerable <MouseRouter> routes = router.Where(r => (action.MouseEvent != MouseEvent.MouseMove && r.MouseEvent == action.MouseEvent) || ((action.MouseEvent == MouseEvent.MouseMove && r.MouseEvent == action.MouseEvent && MouseHasReallyMoved()))); routes.ForEach(r => { Trace.WriteLine("Route:Executing Route:" + r.RouteName.ToString()); r.Debug?.Invoke(); // Test condition every time after executing a route handler, as the handler may change state for the next condition. if (r.Condition()) { Trace.WriteLine("Route:Executing Route:" + r.RouteName.ToString()); r.Action(action.MouseEventArgs); } else { r.Else?.Invoke(); } }); LastMousePosition = CurrentMousePosition; }
public void LoadRestingButtons() { CurrentButtons.Clear(); CurrentButtons.Add(Buttons["Reinforce Button"]); CurrentButtons.Add(Buttons["Green Ration Button"]); CurrentButtons.Add(Buttons["Heal Button"]); }
void CreateButtons(TextPiece next) { foreach (var piece in next.Buttons) { var btn = piece.CreateButton(buttonsAnchor, this); CurrentButtons.Add(btn); } }
private void CreateButtons(TextPiece next) { foreach (TextButton piece in next.Buttons) { DialogButton btn = piece.CreateButton(buttonsAnchor, this); CurrentButtons.Add(btn); } }
/// <summary> /// Load Spells Buttons Method /// </summary> public void LoadSpellsButtons() { CurrentButtons.Clear(); CurrentButtons.Add(Buttons["Green Fireball Spell Button"]); CurrentButtons.Add(Buttons["Green Ice Spell Button"]); CurrentButtons.Add(Buttons["Green Poison Spell Button"]); CurrentButtons.Add(Buttons["Green Healing Spell Button"]); //CurrentButtons.Add(Buttons["Done Button"]); }
/// <summary> /// Load Merchant Buttons Method /// </summary> public void LoadMerchantButtons() { CurrentButtons.Clear(); CurrentButtons.Add(Buttons["Green Ration Button"]); CurrentButtons.Add(Buttons["Green Health Potion Button"]); CurrentButtons.Add(Buttons["Green Big Health Potion Button"]); CurrentButtons.Add(Buttons["Green Armor Piece Button"]); CurrentButtons.Add(Buttons["Green Spells Button"]); }
void ClearButtons() { for (var i = 0; i < CurrentButtons.Count; i++) { Destroy(CurrentButtons[i].gameObject); } CurrentButtons.Clear(); }
//---------------------- METHODS ----------------------------- public override bool HandleCard(Player player, MouseState current, MouseState previous, float xPos, float yPos) { XPos = xPos; YPos = yPos; CurrentMouseState = current; PreviousMouseState = previous; switch (eventCardTurnState) { case EventCardTurnState.INITIAL_ROLL: SkillCheck = false; HandleButtons(player); return(false); case EventCardTurnState.ROLLANIMATION: if (AnimationCounter < 60) { RollAnimation(); } else { if (SkillCheck) { SkillCheckResult = player.playerDice.RollDice(); EventDie.CurrentTexture = EventDie.DieTextures["Roll " + SkillCheckResult]; if (SkillCheckResult <= player.Rank) { CurrentButtons.Clear(); LoadSkillCheckButtons(); eventCardTurnState = EventCardTurnState.ADJUSTOPTION; } else { eventCardTurnState = EventCardTurnState.HANDLE_EVENT; } AnimationCounter = 0; } else { Option = player.playerDice.RollDice(); EventDie.CurrentTexture = EventDie.DieTextures["Roll " + Option]; LoadInitialRollButtons(Option); eventCardTurnState = EventCardTurnState.SKILL_CHECK; AnimationCounter = 0; } } return(false); case EventCardTurnState.SKILL_CHECK: HandleButtons(player); return(false); case EventCardTurnState.ADJUSTOPTION: HandleButtons(player); return(false); case EventCardTurnState.HANDLE_EVENT: HandleButtons(player); return(false); case EventCardTurnState.FIGHT_MONSTER: HandleButtons(player); return(false); case EventCardTurnState.COMBAT: if (CurrentCombat.HandleCombat(player, CurrentMouseState, PreviousMouseState, XPos, yPos, false, true)) { eventCardTurnState = EventCardTurnState.COMPLETE; } return(false); case EventCardTurnState.COMPLETE: return(true); default: return(false); } }
public void LoadSkillCheckButtons() { switch (Option) { case 1: CurrentButtons.Add(Buttons["Found Ration Highlight"]); CurrentButtons.Add(Buttons["Health Potion Highlight"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster Highlight"]); break; case 2: CurrentButtons.Add(Buttons["Found Ration Highlight"]); CurrentButtons.Add(Buttons["Health Potion Highlight"]); CurrentButtons.Add(Buttons["Found Loot Highlight"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster"]); Option = 2; break; case 3: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion Highlight"]); CurrentButtons.Add(Buttons["Found Loot Highlight"]); CurrentButtons.Add(Buttons["Whetstone Highlight"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster"]); break; case 4: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot Highlight"]); CurrentButtons.Add(Buttons["Whetstone Highlight"]); CurrentButtons.Add(Buttons["Found Shield Highlight"]); CurrentButtons.Add(Buttons["Monster"]); break; case 5: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone Highlight"]); CurrentButtons.Add(Buttons["Found Shield Highlight"]); CurrentButtons.Add(Buttons["Monster Highlight"]); break; case 6: CurrentButtons.Add(Buttons["Found Ration Highlight"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield Highlight"]); CurrentButtons.Add(Buttons["Monster Highlight"]); break; default: break; } }
public void LoadInitialRollButtons(int roll) { switch (roll) { case 1: CurrentButtons.Add(Buttons["Found Ration Highlight"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster"]); Option = 1; break; case 2: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion Highlight"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster"]); Option = 2; break; case 3: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot Highlight"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster"]); Option = 3; break; case 4: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone Highlight"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster"]); Option = 4; break; case 5: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield Highlight"]); CurrentButtons.Add(Buttons["Monster"]); Option = 5; break; case 6: CurrentButtons.Add(Buttons["Found Ration"]); CurrentButtons.Add(Buttons["Health Potion"]); CurrentButtons.Add(Buttons["Found Loot"]); CurrentButtons.Add(Buttons["Whetstone"]); CurrentButtons.Add(Buttons["Found Shield"]); CurrentButtons.Add(Buttons["Monster Highlight"]); Option = 6; break; default: break; } }