public HappeningOption(string id, int i) { Happening = HappeningRegistry.Get(id); Id = id; var name = Locale.Get($"happening_{id}"); Num = i; Name = name.ToLower(); Label = $"#{i} {name}"; LabelWidth = Font.Small.MeasureString($"{Label} (100%)").Width; }
private void AddOption(string id, int i) { var happening = HappeningRegistry.Get(id); if (happening == null) { return; } var option = new HappeningOption(id, i); options.Add(option); float x = Display.UiWidth; foreach (var o in options) { x -= o.LabelWidth + 8; } option.Position = new Vector2(x, 18); }
public override void Run(Console Console, string[] Args) { if (Args.Length == 1) { var h = HappeningRegistry.Get(Args[0]); if (h == null) { return; } try { var p = LocalPlayer.Locate(Engine.Instance.State.Area); h.Happen(p); Timer.Add(() => { h.End(p); }, h.GetVoteDelay()); } catch (Exception e) { Log.Error(e); } } }