public void OnCategorySelection() { EnsureAvatarConfigController(); AvatarPartConfigurationController selectedPartController = avatarConfigurationController.AvatarPartControllers[categoryToggles.CurrentIndex].ConfigurationController; UpdateModelChooser(selectedPartController); }
/// <summary> /// Applies the avatar part configuration for a specific part controller /// </summary> /// <param name="partController">The part controller to which the properties should be applied</param> /// <param name="partName">The name of the part (used in the hastable keys)</param> private void ApplyCustomProperty(AvatarPartConfigurationController partController, string partName) { partController.ModelIndex = PlayerPropertyUtilities.GetValueOrDefault <byte>(photonView.Owner.CustomProperties, partName + modelKeySuffix, 0); partController.MaterialIndex = PlayerPropertyUtilities.GetValueOrDefault <byte>(photonView.Owner.CustomProperties, partName + materialKeySuffix, 0); partController.ColorIndex = PlayerPropertyUtilities.GetValueOrDefault <byte>(photonView.Owner.CustomProperties, partName + colorKeySuffix, 0); partController.ApplyConfiguration(); }
private void UpdateMaterialChooser(AvatarPartConfigurationController selectedPartController) { materialSelector.Items = selectedPartController.AvatarPartMaterials; materialSelector.SelectedIndex = selectedPartController.MaterialIndex; materialSelector.Page = materialSelector.SelectedIndex / materialSelector.ItemFrameCount; UpdateColorChooser(selectedPartController); }
private void UpdateModelChooser(AvatarPartConfigurationController selectedPartController) { modelSelector.Items = selectedPartController.AvatarParts; modelSelector.SelectedIndex = selectedPartController.ModelIndex; modelSelector.Page = modelSelector.SelectedIndex / modelSelector.ItemFrameCount; UpdateMaterialChooser(selectedPartController); }
private void ColorItemSelected(object sender, EventArgs e) { EnsureAvatarConfigController(); AvatarPartConfigurationController selectedPartController = GetSelectedController(); selectedPartController.ColorIndex = colorSelector.SelectedIndex; selectedPartController.ApplyConfiguration(); PlayerPropertyUtilities.SetProperty( avatarConfigurationController.AvatarPartControllers[categoryToggles.CurrentIndex].Name + "Color", (byte)colorSelector.SelectedIndex); }
private void MaterialItemSelected(object sender, EventArgs e) { EnsureAvatarConfigController(); AvatarPartConfigurationController selectedPartController = GetSelectedController(); selectedPartController.MaterialIndex = materialSelector.SelectedIndex; selectedPartController.ApplyConfiguration(); PlayerPropertyUtilities.SetProperty( avatarConfigurationController.AvatarPartControllers[categoryToggles.CurrentIndex].Name + "Material", (byte)materialSelector.SelectedIndex); UpdateColorChooser(selectedPartController); }
private void ModelItemSelected(object sender, EventArgs e) { EnsureAvatarConfigController(); AvatarPartConfigurationController selectedPartController = GetSelectedController(); selectedPartController.ModelIndex = modelSelector.SelectedIndex; selectedPartController.ApplyConfiguration(); PlayerPropertyUtilities.SetProperty( avatarConfigurationController.AvatarPartControllers[categoryToggles.CurrentIndex].Name + AvatarAppearanceSynchronizer.modelKeySuffix, (byte)selectedPartController.ModelIndex); PlayerPropertyUtilities.SetProperty( avatarConfigurationController.AvatarPartControllers[categoryToggles.CurrentIndex].Name + AvatarAppearanceSynchronizer.materialKeySuffix, (byte)selectedPartController.MaterialIndex); PlayerPropertyUtilities.SetProperty( avatarConfigurationController.AvatarPartControllers[categoryToggles.CurrentIndex].Name + AvatarAppearanceSynchronizer.colorKeySuffix, (byte)selectedPartController.ColorIndex); UpdateMaterialChooser(selectedPartController); }
private void UpdateColorChooser(AvatarPartConfigurationController selectedPartController) { colorSelector.Items = selectedPartController.AvatarPartColorsAsItems; colorSelector.SelectedIndex = selectedPartController.ColorIndex; colorSelector.Page = colorSelector.SelectedIndex / colorSelector.ItemFrameCount; }