Skip to content

Commit

Permalink
🎨 improve toggle source generator
Browse files Browse the repository at this point in the history
  • Loading branch information
lxymahatma committed Mar 12, 2024
1 parent 0e14745 commit 3b4450d
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,8 @@ namespace {{@namespace}};
partial class {{className}}
{
{{GetGeneratedCodeAttribute(nameof(PnlMenuToggleGenerator))}}
private static void Register{{variableName}}PnlMenuToggle(object? sender, PnlMenuEventArgs args) =>
{{variableName}} = CreatePnlMenuToggle("{{toggleName}}", "{{toggleText}}", {{boolName}}, new Action<bool>(val => {{boolName}} = val));
{{GetGeneratedCodeAttribute(nameof(PnlMenuToggleGenerator))}}
internal static void Register{{className}}{{variableName}}ToPnlMenuEvent() => PnlMenuPatch += Register{{variableName}}PnlMenuToggle;
internal static void Register{{className}}{{variableName}}ToPnlMenuEvent() =>
PnlMenuPatch += (_,_) => {{variableName}} = CreatePnlMenuToggle("{{toggleName}}", "{{toggleText}}", {{boolName}}, new Action<bool>(val => {{boolName}} = val));
}
""");
}
Expand Down

0 comments on commit 3b4450d

Please sign in to comment.