bool OnNpcTextEvent(NpcTextEvent e, Action continuation) { var state = Resolve <IGameState>(); var sheet = state.GetNpc(e.NpcId); var eventManager = Resolve <IEventManager>(); var mapManager = Resolve <IMapManager>(); var(useEventText, textSourceId) = eventManager.Context?.Source switch { EventSource.Map map => (false, (int)map.MapId), EventSource.EventSet eventSet => (true, (int)eventSet.EventSetId), _ => (false, (int)mapManager.Current.MapId) }; var textEvent = useEventText ? (BaseTextEvent) new EventTextEvent( (EventSetId)textSourceId, e.TextId, TextLocation.TextInWindowWithPortrait, sheet.PortraitId) : new MapTextEvent( (MapDataId)textSourceId, e.TextId, TextLocation.TextInWindowWithPortrait, sheet.PortraitId); return(OnBaseTextEvent(textEvent, continuation)); }
bool OnNpcTextEvent(NpcTextEvent e, Action continuation) { var textEvent = new MapTextEvent(ContextTextSource, e.TextId, TextLocation.PortraitLeft2, e.NpcId); return(OnBaseTextEvent(textEvent, continuation)); }