Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ME] Fix toggle shortcuts for the character also reacting in studio #264

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 41 additions & 38 deletions src/MaterialEditor.Core/Core.MaterialEditor.CharaController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,45 +158,48 @@ protected override void OnReload(GameMode currentGameMode, bool maintainState)
base.Update();
if (MaterialEditorPlugin.PurgeOrphanedPropertiesHotkey.Value.IsDown())
PurgeOrphanedProperties();
else if (MaterialEditorPlugin.DisableShadowCastingHotkey.Value.IsDown())
if (MakerAPI.InsideMaker)
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "0");
MaterialEditorPlugin.Logger.LogMessage($"Disabled ShadowCasting");
}
else if (MaterialEditorPlugin.EnableShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "1");
MaterialEditorPlugin.Logger.LogMessage($"Enabled ShadowCasting");
}
else if (MaterialEditorPlugin.TwoSidedShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "2");
MaterialEditorPlugin.Logger.LogMessage($"Two Sided ShadowCasting");
}
else if (MaterialEditorPlugin.ShadowsOnlyShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "3");
MaterialEditorPlugin.Logger.LogMessage($"Shadows Only ShadowCasting");
}
else if (MaterialEditorPlugin.ResetShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "-1");
MaterialEditorPlugin.Logger.LogMessage($"Reset ShadowCasting ShadowCasting");
}
else if (MaterialEditorPlugin.DisableReceiveShadows.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ReceiveShadows, "0");
MaterialEditorPlugin.Logger.LogMessage($"Disabled ReceiveShadows");
}
else if (MaterialEditorPlugin.EnableReceiveShadows.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ReceiveShadows, "1");
MaterialEditorPlugin.Logger.LogMessage($"Enabled ReceiveShadows");
}
else if (MaterialEditorPlugin.ResetReceiveShadows.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ReceiveShadows, "-1");
MaterialEditorPlugin.Logger.LogMessage($"Reset ReceiveShadows");
if (MaterialEditorPlugin.DisableShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "0");
MaterialEditorPlugin.Logger.LogMessage($"Disabled ShadowCasting");
}
else if (MaterialEditorPlugin.EnableShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "1");
MaterialEditorPlugin.Logger.LogMessage($"Enabled ShadowCasting");
}
else if (MaterialEditorPlugin.TwoSidedShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "2");
MaterialEditorPlugin.Logger.LogMessage($"Two Sided ShadowCasting");
}
else if (MaterialEditorPlugin.ShadowsOnlyShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "3");
MaterialEditorPlugin.Logger.LogMessage($"Shadows Only ShadowCasting");
}
else if (MaterialEditorPlugin.ResetShadowCastingHotkey.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ShadowCastingMode, "-1");
MaterialEditorPlugin.Logger.LogMessage($"Reset ShadowCasting ShadowCasting");
}
else if (MaterialEditorPlugin.DisableReceiveShadows.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ReceiveShadows, "0");
MaterialEditorPlugin.Logger.LogMessage($"Disabled ReceiveShadows");
}
else if (MaterialEditorPlugin.EnableReceiveShadows.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ReceiveShadows, "1");
MaterialEditorPlugin.Logger.LogMessage($"Enabled ReceiveShadows");
}
else if (MaterialEditorPlugin.ResetReceiveShadows.Value.IsDown())
{
SetRendererPropertyRecursive(RendererProperties.ReceiveShadows, "-1");
MaterialEditorPlugin.Logger.LogMessage($"Reset ReceiveShadows");
}
}
}

Expand Down