public void SelectProfile(InputInstance instance) { if (instance.IsNull()) { return; } if (this.profiles.Count < 1) { this.CreateProfile("Default"); Events.AddLimited("On Profile Edited", () => this.SelectProfile(instance), 1, this); return; } if (this.uiState == InputUIState.SelectProfile) { Events.AddLimited("On Profile Selected", () => this.SelectProfile(instance), 1, this); return; } this.ShowProfiles(); this.selectionHeader = instance.alias; Method selected = () => { this.instanceProfile[instance.name] = this.activeProfile; instance.joystickID = ""; instance.profile = this.activeProfile; instance.Save(); }; Events.AddLimited("On Profile Selected", selected, 1, this); }
public void OnEnable() { this.Setup(); InputGroup.Load(); if (!Proxy.IsPlaying()) { return; } this.Validate(); if (this.disabled) { return; } InputProfile.Load(); InputInstance.Load(); Console.AddKeyword("inputShowProfiles", this.ShowProfiles); Console.AddKeyword("inputAssignProfile", this.AssignProfile); Console.AddKeyword("inputCreateProfile", this.CreateProfile); Console.AddKeyword("inputEditProfile", this.EditProfile); Console.AddKeyword("inputRemoveProfile", this.RemoveProfile); Events.Register("On Profile Selected", this); Events.Register("On Profile Edited", this); Events.Add("On Update", this.Update); Events.Add("On Fixed Update", this.FixedUpdate); Events.Add("On GUI", this.OnGUI); this.DetectGamepads(); }
//=============== // Interface //=============== public InputProfile GetInstanceProfile(InputInstance instance) { string name = instance.alias.ToPascalCase(); if (this.instanceProfile.ContainsKey(name)) { return(this.instanceProfile[name]); } return(null); }