forked from LambdAurora/SpruceUI
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
83 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -26,12 +27,12 @@ | |
import java.util.function.Consumer; | ||
|
||
/** | ||
* Represents the SpruceUI test mod. | ||
* Represents the ObsidianUI test mod on Fabric. | ||
* | ||
* @author LambdAurora | ||
*/ | ||
public class ObsidianUITest implements ClientModInitializer { | ||
private static ObsidianUITest INSTANCE; | ||
public class ObsidianUITestFabric implements ClientModInitializer { | ||
private static ObsidianUITestFabric INSTANCE; | ||
|
||
private final SpruceOption booleanOption; | ||
private final SpruceOption checkboxOption; | ||
|
@@ -55,7 +56,7 @@ public class ObsidianUITest implements ClientModInitializer { | |
|
||
public Consumer<SpruceButtonWidget> resetConsumer; | ||
|
||
public ObsidianUITest() { | ||
public ObsidianUITestFabric() { | ||
this.booleanOption = new SpruceBooleanOption("obsidianui_test.option.boolean", | ||
() -> this.aBoolean, | ||
newValue -> this.aBoolean = newValue, | ||
|
@@ -203,7 +204,7 @@ public static SpruceContainerWidget buildTextAreaContainer(Position position, in | |
return container; | ||
} | ||
|
||
public static ObsidianUITest get() { | ||
public static ObsidianUITestFabric get() { | ||
return INSTANCE; | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
test-fabric/src/main/java/org/thinkingstudio/obsidianui/test/fabric/TestEnum.java
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -19,7 +20,7 @@ | |
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Represents a screen to navigate to the different SpruceUI test screens. | ||
* Represents a screen to navigate to the different ObsidianUI test screens. | ||
* | ||
* @author LambdAurora | ||
*/ | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -13,7 +14,7 @@ | |
import org.thinkingstudio.obsidianui.SpruceTexts; | ||
import org.thinkingstudio.obsidianui.option.SpruceOption; | ||
import org.thinkingstudio.obsidianui.screen.SpruceScreen; | ||
import org.thinkingstudio.obsidianui.test.fabric.ObsidianUITest; | ||
import org.thinkingstudio.obsidianui.test.fabric.ObsidianUITestFabric; | ||
import org.thinkingstudio.obsidianui.widget.SpruceButtonWidget; | ||
import org.thinkingstudio.obsidianui.widget.container.SpruceOptionListWidget; | ||
import net.minecraft.client.gui.DrawContext; | ||
|
@@ -47,8 +48,8 @@ protected void init() { | |
|
||
// Button list. | ||
//this.list = new ButtonListWidget(this.client, this.width, this.height, 43, this.height - 29 - this.getTextHeight(), 25); | ||
this.list = ObsidianUITest.get().buildOptionList(Position.of(0, 22), this.width, this.height - 35 - 22); | ||
ObsidianUITest.get().resetConsumer = btn -> { | ||
this.list = ObsidianUITestFabric.get().buildOptionList(Position.of(0, 22), this.width, this.height - 35 - 22); | ||
ObsidianUITestFabric.get().resetConsumer = btn -> { | ||
// Re-initialize the screen to update all the values. | ||
this.init(this.client, this.client.getWindow().getScaledWidth(), this.client.getWindow().getScaledHeight()); | ||
}; | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -12,7 +13,7 @@ | |
import org.thinkingstudio.obsidianui.Position; | ||
import org.thinkingstudio.obsidianui.SpruceTexts; | ||
import org.thinkingstudio.obsidianui.screen.SpruceScreen; | ||
import org.thinkingstudio.obsidianui.test.fabric.ObsidianUITest; | ||
import org.thinkingstudio.obsidianui.test.fabric.ObsidianUITestFabric; | ||
import org.thinkingstudio.obsidianui.widget.SpruceButtonWidget; | ||
import org.thinkingstudio.obsidianui.widget.SpruceLabelWidget; | ||
import org.thinkingstudio.obsidianui.widget.container.SpruceContainerWidget; | ||
|
@@ -28,7 +29,7 @@ public class SpruceTabbedTestScreen extends SpruceScreen { | |
private SpruceTabbedWidget tabbedWidget; | ||
|
||
protected SpruceTabbedTestScreen(@Nullable Screen parent) { | ||
super(Text.literal("ObsidianUI Test Tabbed Screen")); | ||
super(Text.literal("Test Tabbed Screen")); | ||
this.parent = parent; | ||
} | ||
|
||
|
@@ -52,9 +53,9 @@ protected void init() { | |
}); | ||
this.tabbedWidget.addSeparatorEntry(Text.literal("Separator")); | ||
this.tabbedWidget.addTabEntry(Text.literal("Option Test"), Text.literal("useful for config stuff.").formatted(Formatting.GRAY), | ||
(width, height) -> ObsidianUITest.get().buildOptionList(Position.origin(), width, height)); | ||
(width, height) -> ObsidianUITestFabric.get().buildOptionList(Position.origin(), width, height)); | ||
this.tabbedWidget.addTabEntry(Text.literal("Text Area"), Text.literal("to edit stuff on multiple lines.").formatted(Formatting.GRAY), | ||
(width, height) -> ObsidianUITest.buildTextAreaContainer(Position.origin(), width, height, | ||
(width, height) -> ObsidianUITestFabric.buildTextAreaContainer(Position.origin(), width, height, | ||
textArea -> { | ||
}, null)); | ||
this.addDrawableChild(this.tabbedWidget); | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -11,7 +12,7 @@ | |
|
||
import org.thinkingstudio.obsidianui.Position; | ||
import org.thinkingstudio.obsidianui.screen.SpruceScreen; | ||
import org.thinkingstudio.obsidianui.test.fabric.ObsidianUITest; | ||
import org.thinkingstudio.obsidianui.test.fabric.ObsidianUITestFabric; | ||
import org.thinkingstudio.obsidianui.widget.text.SpruceTextAreaWidget; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.screen.Screen; | ||
|
@@ -37,7 +38,7 @@ protected void init() { | |
super.init(); | ||
|
||
var containerWidget = | ||
ObsidianUITest.buildTextAreaContainer(Position.of(this, 0, 50), this.width, this.height - 50, | ||
ObsidianUITestFabric.buildTextAreaContainer(Position.of(this, 0, 50), this.width, this.height - 50, | ||
textArea -> { | ||
if (this.textArea != null) { | ||
textArea.setText(this.textArea.getText()); | ||
|
5 changes: 3 additions & 2 deletions
5
...ic/src/main/java/org/thinkingstudio/obsidianui/test/fabric/mixin/GameMenuScreenMixin.java
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
5 changes: 3 additions & 2 deletions
5
...abric/src/main/java/org/thinkingstudio/obsidianui/test/fabric/mixin/TitleScreenMixin.java
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
This file contains 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 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -27,13 +28,13 @@ | |
import java.util.function.Consumer; | ||
|
||
/** | ||
* Represents the SpruceUI test mod. | ||
* Represents the ObsidianUI test mod on NeoForge. | ||
* | ||
* @author LambdAurora | ||
* @author TexTrue, LambdAurora | ||
*/ | ||
@Mod(value = "obsidianui_test", dist = Dist.CLIENT) | ||
public class ObsidianUITest { | ||
private static ObsidianUITest INSTANCE; | ||
public class ObsidianUITestNeoForge { | ||
private static ObsidianUITestNeoForge INSTANCE; | ||
|
||
private final SpruceOption booleanOption; | ||
private final SpruceOption checkboxOption; | ||
|
@@ -57,7 +58,7 @@ public class ObsidianUITest { | |
|
||
public Consumer<SpruceButtonWidget> resetConsumer; | ||
|
||
public ObsidianUITest() { | ||
public ObsidianUITestNeoForge() { | ||
INSTANCE = this; | ||
|
||
this.booleanOption = new SpruceBooleanOption("obsidianui_test.option.boolean", | ||
|
@@ -202,7 +203,7 @@ public static SpruceContainerWidget buildTextAreaContainer(Position position, in | |
return container; | ||
} | ||
|
||
public static ObsidianUITest get() { | ||
public static ObsidianUITestNeoForge get() { | ||
return INSTANCE; | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
test-neoforge/src/main/java/org/thinkingstudio/obsidianui/test/neoforge/TestEnum.java
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -19,7 +20,7 @@ | |
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Represents a screen to navigate to the different SpruceUI test screens. | ||
* Represents a screen to navigate to the different ObsidianUI test screens. | ||
* | ||
* @author LambdAurora | ||
*/ | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -13,7 +14,7 @@ | |
import org.thinkingstudio.obsidianui.SpruceTexts; | ||
import org.thinkingstudio.obsidianui.option.SpruceOption; | ||
import org.thinkingstudio.obsidianui.screen.SpruceScreen; | ||
import org.thinkingstudio.obsidianui.test.neoforge.ObsidianUITest; | ||
import org.thinkingstudio.obsidianui.test.neoforge.ObsidianUITestNeoForge; | ||
import org.thinkingstudio.obsidianui.widget.SpruceButtonWidget; | ||
import org.thinkingstudio.obsidianui.widget.container.SpruceOptionListWidget; | ||
import net.minecraft.client.gui.DrawContext; | ||
|
@@ -47,8 +48,8 @@ protected void init() { | |
|
||
// Button list. | ||
//this.list = new ButtonListWidget(this.client, this.width, this.height, 43, this.height - 29 - this.getTextHeight(), 25); | ||
this.list = ObsidianUITest.get().buildOptionList(Position.of(0, 22), this.width, this.height - 35 - 22); | ||
ObsidianUITest.get().resetConsumer = btn -> { | ||
this.list = ObsidianUITestNeoForge.get().buildOptionList(Position.of(0, 22), this.width, this.height - 35 - 22); | ||
ObsidianUITestNeoForge.get().resetConsumer = btn -> { | ||
// Re-initialize the screen to update all the values. | ||
this.init(this.client, this.client.getWindow().getScaledWidth(), this.client.getWindow().getScaledHeight()); | ||
}; | ||
|
This file contains 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/* | ||
* Copyright © 2020 LambdAurora <[email protected]> | ||
* Copyright © 2020~2024 LambdAurora <[email protected]> | ||
* Copyright © 2024 ThinkingStudio | ||
* | ||
* This file is part of SpruceUI. | ||
* This file is part of ObsidianUI. | ||
* | ||
* Licensed under the MIT license. For more information, | ||
* see the LICENSE file. | ||
|
@@ -12,7 +13,7 @@ | |
import org.thinkingstudio.obsidianui.Position; | ||
import org.thinkingstudio.obsidianui.SpruceTexts; | ||
import org.thinkingstudio.obsidianui.screen.SpruceScreen; | ||
import org.thinkingstudio.obsidianui.test.neoforge.ObsidianUITest; | ||
import org.thinkingstudio.obsidianui.test.neoforge.ObsidianUITestNeoForge; | ||
import org.thinkingstudio.obsidianui.widget.SpruceButtonWidget; | ||
import org.thinkingstudio.obsidianui.widget.SpruceLabelWidget; | ||
import org.thinkingstudio.obsidianui.widget.container.SpruceContainerWidget; | ||
|
@@ -28,7 +29,7 @@ public class SpruceTabbedTestScreen extends SpruceScreen { | |
private SpruceTabbedWidget tabbedWidget; | ||
|
||
protected SpruceTabbedTestScreen(@Nullable Screen parent) { | ||
super(Text.literal("ObsidianUI Test Tabbed Screen")); | ||
super(Text.literal("Test Tabbed Screen")); | ||
this.parent = parent; | ||
} | ||
|
||
|
@@ -52,9 +53,9 @@ protected void init() { | |
}); | ||
this.tabbedWidget.addSeparatorEntry(Text.literal("Separator")); | ||
this.tabbedWidget.addTabEntry(Text.literal("Option Test"), Text.literal("useful for config stuff.").formatted(Formatting.GRAY), | ||
(width, height) -> ObsidianUITest.get().buildOptionList(Position.origin(), width, height)); | ||
(width, height) -> ObsidianUITestNeoForge.get().buildOptionList(Position.origin(), width, height)); | ||
this.tabbedWidget.addTabEntry(Text.literal("Text Area"), Text.literal("to edit stuff on multiple lines.").formatted(Formatting.GRAY), | ||
(width, height) -> ObsidianUITest.buildTextAreaContainer(Position.origin(), width, height, | ||
(width, height) -> ObsidianUITestNeoForge.buildTextAreaContainer(Position.origin(), width, height, | ||
textArea -> { | ||
}, null)); | ||
this.addDrawableChild(this.tabbedWidget); | ||
|
Oops, something went wrong.