public override Task OnRefreshState() { RaceStateCollection RSC = RaceClient.Instance.States; commonState = RSC.GetState <CommonState>(); creatorState = RSC.GetState <CreatorState>(); creatorState.PlaceCheckpoint.Observe( (state) => { checkpointState = state == true ? 1u : 0u; OnCheckpointStateChange(); } ); return(Wait(100)); }
public void OnCreatorAddCheckpoint() { CommonState common = RC.States.GetState <CommonState>(); CreatorState creator = RC.States.GetState <CreatorState>(); if (!common.IsInCreator.Get()) { ChatHelper.SendMessage("Creator", "You must be in creator mode to add checkpoints.", 255, 150, 0); return; } if (creator.PlaceCheckpoint.Get()) { ChatHelper.SendMessage("Creator", "Already placing a new checkpoint...", 255, 0, 0); return; } creator.PlaceCheckpoint.Set(true); }
public void OnCreatorOption(string optionName, bool state) { ChatHelper.SendMessage("Creator", $"{optionName}: {state}", 255, 0, 0); CreatorState creator = RC.States.GetState <CreatorState>(); if (string.Compare(optionName, "zfix", true) == 0) { creator.ZFix = state; } else if (string.Compare(optionName, "preview") == 0) { creator.OptionPreview = state; } else { ChatHelper.SendMessage("Creator", $"Option {optionName} was not found", 255, 0, 0); } }