public void PressEventEncounter(string info = "") { GD.Print("PressEventEncounter -info " + info); pressEvent = CareerDb.LoadPressEvent(info); Session.ChangeMenu(Menu.Menus.PressEvent); }
public void Init(float minX, float minY, float maxX, float maxY) { pressEvent = Session.session.career.pressEvent; InitControls(); ScaleControls(); GetTree().GetRoot().Connect("size_changed", this, "ScaleControls"); }
// Update is called once per frame void Update() { if (inputSystem == null) { return; } if (Input.GetMouseButtonDown(0)) { GameMsg msg = new GameMsg(); PressEvent arg = new PressEvent(); arg.pressType = 0; msg.arguement = arg; inputSystem.Receive(msg); } if (Input.GetMouseButtonUp(0)) { GameMsg msg = new GameMsg(); PressEvent arg = new PressEvent(); arg.pressType = 1; msg.arguement = arg; inputSystem.Receive(msg); } inputSystem.mousePosition = Input.mousePosition; }
public ClickPacket(Point point, MouseButtons buttons, PressEvent pressEvent) : base(0x14) { Point = point; Buttons = buttons; PressEvent = pressEvent; }
private void StartEvent(PressEvent pressEvent) { _worldState.Date = pressEvent.Date; if (pressEvent.IsTerminating) { _scenarios.Clear(); } }
void Start() { _scheduler = GameInit.CreateEventScheduler(WorldStateProvider.State); _currentEvent = _scheduler.PopNextEvent(); if (_currentEvent != null) { _currentEvent.ProcessEvent(Processor); } }
public PressEvent PeekNextEvent() { PressEvent next = GetFirstSatisfied(); if (next == null) { return(null); } next.Date = _worldState.Date; return(next); }
public PressEvent PopNextEvent() { PressEvent next = GetFirstSatisfied(); if (next == null) { return(null); } next.Date = _worldState.Date; _events.Remove(next); return(next); }
private void PrepareNextEvent() { if (_eventQueue.Count == 0) { _nextEvent = null; IsTerminated = true; return; } var pressEventDao = _eventQueue.Dequeue(); Debug.Assert(!string.IsNullOrEmpty(pressEventDao.Date), "Story events should contain date."); _nextEvent = pressEventDao.Process(_processor); }
public override void Receive(GameMsg msg) { PressEvent arg = msg.arguement as PressEvent; if (arg != null) { InputEvent evt = new InputEvent(); evt.inputType = arg.pressType; GameMsg msg0 = new GameMsg(); msg0.arguement = evt; Send(msg0); } }
private void PrepareNextEvent() { _lastDate = _lastDate.AddDays(Algorithms.RandomPauseBetweenEvents()); _converter.AssignedDate = _lastDate; if (_eventIndexQueue.Count > 0) { var eventDao = _events[_eventIndexQueue.Dequeue()]; Debug.Assert(string.IsNullOrEmpty(eventDao.Date)); _currentEvent = eventDao.Process(_converter); } else { _currentEvent = null; IsTerminated = true; } }
public void Publish(PressEvent e, Choice choice) { _event = e; _choice = choice; Debug.Log("Start publishing multiple choice event: " + _event.Date + " choice: " + choice.Title); gameObject.SetActive(true); // Title and desc Title.GetComponent <Text>().text = choice.Title; Description.GetComponent <Text>().text = choice.Description; // Image bool isImage = choice.ImagePath != null; ImageFixedARParent.SetActive(isImage); ImageDescription.SetActive(isImage); if (isImage) { string path = Path.Combine(Constants.ArticleImagesResourceFolder, choice.ImagePath).Replace('\\', '/'); Debug.Log("Loading a publishing image from: " + path); var texture = Resources.Load <Texture>(path); Assert.IsNotNull(texture, "Wrongly specified image in " + name); if (texture != null) { var image = Image.GetComponent <RawImage>(); image.texture = texture; Image.GetComponent <AspectRatioFitter>().aspectRatio = texture.width / (float)texture.height; ImageDescription.GetComponent <Text>().text = choice.ImageLabel; } } // Article text bool isArticleText = !string.IsNullOrEmpty(choice.ArticleText); Text.SetActive(isArticleText); if (isArticleText) { Text.GetComponent <Text>().text = choice.ArticleText; } }
private void PlaySound(PressEvent e) { if (string.IsNullOrEmpty(e.SoundPath)) { return; } string path = Path.Combine(Constants.SoundsResFolder, e.SoundPath).Replace('\\', '/'); var audioSource = AudioPlayer.GetComponent <AudioSource>(); var ac = Resources.Load(path) as AudioClip; Debug.Assert(ac != null, "Wrong sound name."); if (ac == null) { return; } audioSource.PlayOneShot(ac); }
// Update is called once per frame void Update() { if (buttonApply) { buttonApply = false; for (int i = 0; i < skipEventsCount; i++) { _scheduler.PopNextEvent(); } var info = Attribs.GetAttribByName("Info"); var panic = Attribs.GetAttribByName("Panic"); var fun = Attribs.GetAttribByName("Fun"); var tom = Attribs.GetAttribByName("Tom"); var alice = Attribs.GetAttribByName("Alice"); var s = WorldStateProvider.State; s.AddToValue(alice, addToAttributeAlice); s.AddToValue(panic, addToAttributePanic); s.AddToValue(tom, addToAttributeTom); s.AddToValue(fun, addToAttributeFun); s.AddToValue(info, addToAttributeInfo); } if (_currentEvent == null) { return; } if (_currentEvent.IsFinished) { _currentEvent = _scheduler.PopNextEvent(); if (_currentEvent != null) { _currentEvent.ProcessEvent(Processor); } else { GetComponent <ScenePicker>().LoadScene(); } } }
bool IsEdit = false; //是否编辑中 public InputFieldEx() { BeginEdit = new PressEvent(); }
public KeyboardPacket(Keys key, PressEvent pressEvent) : base(0x15) { Key = key; PressEvent = pressEvent; }
public virtual bool StartEvent(PressEvent key, ref int x, ref int y) => false;
public virtual bool React(ref int x, ref int y, PressEvent press) => false;
public void OnPress(Android.Views.Keycode primaryCode) { PressEvent?.Invoke(primaryCode); }