-
Notifications
You must be signed in to change notification settings - Fork 4
Bugfixes #60
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
Merged
Merged
Bugfixes #60
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0269695
Easy fixes
flibber-hk 66f7ba5
Add test
flibber-hk d7290d5
Minor changes
flibber-hk 5ce742f
Remove FontScaleOnHandheld components
flibber-hk 1753693
Make large size smaller
flibber-hk a79daca
Bump version as directed by the PR template
flibber-hk d4090e9
Add spaces
flibber-hk b75149b
Un-remove AutoLocalizeTextUI where possible
flibber-hk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| using Silksong.ModMenu.Elements; | ||
| using Silksong.ModMenu.Screens; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
|
|
||
| namespace Silksong.ModMenuTesting.Tests; | ||
|
|
||
| internal class ElementSizesTest : ModMenuTest | ||
| { | ||
| internal override string Name => "ElementSizesTest"; | ||
flibber-hk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| internal override AbstractMenuScreen BuildMenuScreen() | ||
| { | ||
| PaginatedMenuScreenBuilder builder = new(Name); | ||
|
|
||
| TextButton makeSmall = new("Make Small"); | ||
| TextButton makeMedium = new("Make Medium"); | ||
| TextButton makeLarge = new("Make Large"); | ||
|
|
||
| builder.Add(makeSmall); | ||
| builder.Add(makeMedium); | ||
| builder.Add(makeLarge); | ||
|
|
||
| List<MenuElement> elements = StandardElementsTest.CreateUnboundElements().ToList(); | ||
|
|
||
| makeSmall.OnSubmit += () => elements.ForEach(x => x.SetFontSizes(FontSizes.Small)); | ||
| makeMedium.OnSubmit += () => elements.ForEach(x => x.SetFontSizes(FontSizes.Medium)); | ||
| makeLarge.OnSubmit += () => elements.ForEach(x => x.SetFontSizes(FontSizes.Large)); | ||
|
|
||
| builder.AddRange(elements); | ||
|
|
||
| return builder.Build(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| using Silksong.ModMenu.Elements; | ||
| using Silksong.ModMenu.Models; | ||
| using Silksong.ModMenu.Screens; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace Silksong.ModMenuTesting.Tests; | ||
|
|
||
| internal class StandardElementsTest : ModMenuTest | ||
| { | ||
| private static void Log(string message) => ModMenuTestingPlugin.InstanceLogger.LogInfo(message); | ||
|
|
||
| internal override string Name => "StandardElements"; | ||
|
|
||
| /// <summary> | ||
| /// Yields common elements that log their value when changed. | ||
| /// </summary> | ||
| internal static IEnumerable<MenuElement> CreateUnboundElements() | ||
| { | ||
| { | ||
| TextButton button = new("The Text Button"); | ||
| button.OnSubmit += () => Log($"Pressed text button"); | ||
| yield return button; | ||
| } | ||
|
|
||
| { | ||
| IntSliderModel sliderModel = new(3, 8); | ||
| SliderElement<int> intSliderElement = new("The Int Slider", sliderModel); | ||
| sliderModel.SetValue(6); | ||
| sliderModel.OnValueChanged += n => Log($"Int slider -> {n}"); | ||
| yield return intSliderElement; | ||
| } | ||
|
|
||
| { | ||
| ListChoiceModel<string> listChoiceModel = new(["First", "Second", "Third"]); | ||
| ChoiceElement<string> choiceElement = new("The List Choice", listChoiceModel, "Here is where to choose option(s)"); | ||
| listChoiceModel.OnValueChanged += v => Log($"List choice -> {v}"); | ||
| yield return choiceElement; | ||
| } | ||
|
|
||
| { | ||
| TextLabel label = new("The Label"); | ||
| // Commented out because this is bugged ATM | ||
dplochcoder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // yield return label; | ||
| } | ||
|
|
||
| { | ||
| KeyBindElement keybindElement = new("The Keybind"); | ||
| keybindElement.Model.OnValueChanged += k => Log($"Keybind value -> {k}"); | ||
| yield return keybindElement; | ||
| } | ||
|
|
||
| { | ||
| ITextModel<string> textModel = TextModels.ForStrings(); | ||
| TextInput<string> stringInput = new("The Text Input", textModel, "Here is where to input text"); | ||
| textModel.OnValueChanged += s => Log($"Text model -> {s}"); | ||
| yield return stringInput; | ||
| } | ||
| } | ||
|
|
||
| internal override AbstractMenuScreen BuildMenuScreen() | ||
| { | ||
| PaginatedMenuScreenBuilder builder = new(Name); | ||
| builder.AddRange(CreateUnboundElements()); | ||
| return builder.Build(); | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.