/// <summary> /// Displays appropriate help based on the current action. /// </summary> private void OnActionChanged(object stateObj, FishingActionEventArgs e) { FishingState state = (FishingState)stateObj; if (_showCastingGuide) { switch (e.Action) { case FishingAction.Idle: _text.Show(Resources.GuideCastingStart); break; case FishingAction.Swing: _text.Show(Resources.GuideCastingRelease); break; case FishingAction.Cast: _text.Hide(); break; case FishingAction.Reel: _text.Show(Resources.GuideReelIn); _textTimeout = new DelayAnimation(ReelInGuideTime); _showCastingGuide = false; // no guide after first successful cast _showChainGuide = true; // show how to catch better fish now break; } } if (e.Action != FishingAction.Idle && _showingIdleGuide) { // message is only valid in idle state _text.Hide(); _showingIdleGuide = false; } }
/// <summary> /// Displays the type of fish caught and its value. /// </summary> private void OnFishingEvent(object stateObj, FishingEventArgs e) { FishingState state = (FishingState)stateObj; switch (e.Event) { case FishingEvent.FishHooked: if (_showChainGuide && e.Fish.Description.Size == FishSize.Small && state.Lure != Lures.Basic) { _text.Show(Resources.GuideLureSmallFish); _textTimeout = new DelayAnimation(GuideTime); } if (e.Fish.Description.Size == FishSize.Large) { _text.Show(Resources.GuideReelInLarge); _textTimeout = new DelayAnimation(GuideTime); } break; case FishingEvent.FishEaten: if (_showChainGuide && e.Fish.Description.Size == FishSize.Small) { _showChainGuide = false; _text.Show(Resources.GuideLureMediumFish); _textTimeout = new DelayAnimation(GuideTime); } if (e.Fish.Description.Size == FishSize.Medium) { _text.Show(Resources.GuideReelInLarge); _textTimeout = new DelayAnimation(GuideTime); } break; case FishingEvent.LureBroke: _text.Show(Resources.GuideLureBroke); _textTimeout = new DelayAnimation(GuideTime); break; case FishingEvent.LureChanged: _text.Hide(); _showLureGuide = false; break; case FishingEvent.FishCaught: _text.Show(String.Format(Resources.Caught, e.Fish.Description.Name), e.Fish.Description.Value); _textTimeout = new DelayAnimation(CaughtTime); break; case FishingEvent.LureIsland: _text.Show(Resources.GuideReelInIsland); _textTimeout = new DelayAnimation(GuideTime); break; } }