fix(redstoner): rendre la recherche du terminal cliquable #135
@@ -6,6 +6,12 @@ Ce journal suit les **versions du modpack**. Lorsqu'un seul module change, sa ve
|
||||
- Depuis `26.2.0-alpha.6`, le pack et les modules ont des versions indépendantes. I Like To Move It et Only Fun deviennent les cinquième et sixième modules actifs dans l'alpha 46.
|
||||
- Les versions ci-dessous ont été reconstituées à partir des JAR archivés, des packs locaux et du code source actuel. Les dates n'étant pas enregistrées de manière fiable, elles ne sont pas inventées.
|
||||
|
||||
## Non publié
|
||||
|
||||
Module modifié : **Red-Stoner `0.0.0-alpha.14`**.
|
||||
|
||||
- rend le champ de recherche du terminal inactif à l’ouverture puis focalisable au clic, libère le focus au clic extérieur et laisse toujours la touche d’inventaire fermer le terminal ;
|
||||
|
||||
## `26.2.0-alpha.227`
|
||||
|
||||
Modules modifiés : **Sanctuary `0.0.0-alpha.131`** et **Another World `0.0.0-alpha.57`**.
|
||||
|
||||
+34
-10
@@ -3692,7 +3692,7 @@ tasks.register("verifyMirrorLavenderDrawerRelease") {
|
||||
def drawerRecipe = file("redstoner/src/main/resources/data/redstoner/recipe/drawer.json")
|
||||
if (rootProject.pack_version != "26.2.0-alpha.227"
|
||||
|| rootProject.anotherworld_version != "0.0.0-alpha.57"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.13"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.14"
|
||||
|| release.pack_version != rootProject.pack_version || index.versionId != rootProject.pack_version
|
||||
|| migration.source?.pack_version != "26.2.0-alpha.191"
|
||||
|| migration.source?.modules != [anotherworld: "0.0.0-alpha.48", redstoner: "0.0.0-alpha.9"]
|
||||
@@ -4310,7 +4310,7 @@ project(":redstoner") {
|
||||
"src/main/resources/data/redstoner/recipe/controller.json"))
|
||||
def terminalRecipe = new JsonSlurper().parse(file(
|
||||
"src/main/resources/data/redstoner/recipe/storage_terminal.json"))
|
||||
if (project.version.toString() != "0.0.0-alpha.13"
|
||||
if (project.version.toString() != "0.0.0-alpha.14"
|
||||
|| manifest.custom?.sanctuary26?.data_version != 3
|
||||
|| manifest.custom?.sanctuary26?.network_protocol != 7
|
||||
|| terminalMigration.source?.pack_version != "26.2.0-alpha.217"
|
||||
@@ -4351,7 +4351,7 @@ project(":redstoner") {
|
||||
P: "anotherworld:silver_plate", G: "minecraft:tinted_glass",
|
||||
C: "redstoner:controller", T: "anotherworld:titanium_ingot"]
|
||||
|| terminalRecipe.result != [id: "redstoner:storage_terminal", count: 1]) {
|
||||
throw new GradleException("Red-Stoner alpha.13 Storage Terminal contract is incomplete")
|
||||
throw new GradleException("Red-Stoner alpha.14 Storage Terminal contract is incomplete")
|
||||
}
|
||||
if (file("src/main/resources/data/redstoner/recipe/personal_computer.json").exists()
|
||||
|| file("src/main/resources/data/redstoner/recipe/drawer.json").exists()
|
||||
@@ -6659,7 +6659,7 @@ tasks.register("verifyAlpha218Release") {
|
||||
"file = \"mods/${id}-${version}.jar\""
|
||||
}
|
||||
if (rootProject.pack_version != "26.2.0-alpha.227"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.13"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.14"
|
||||
|| currentModules.findAll { id, version ->
|
||||
id != "redstoner" && id != "sanctuary" && id != "onlyfun" && id != "iliketomoveit"
|
||||
}.any {
|
||||
@@ -6848,7 +6848,7 @@ tasks.register("verifyAlpha220Release") {
|
||||
def networking = file(
|
||||
"redstoner/src/main/java/fr/koka99cab/sanctuary26/redstoner/network/RedStonerNetworking.java").text
|
||||
if (rootProject.pack_version != "26.2.0-alpha.227"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.13"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.14"
|
||||
|| migration.source?.pack_version != "26.2.0-alpha.219"
|
||||
|| migration.source?.modules != [redstoner: "0.0.0-alpha.11"]
|
||||
|| migration.target?.pack_version != "26.2.0-alpha.220"
|
||||
@@ -7077,7 +7077,7 @@ tasks.register("verifyAlpha222Release") {
|
||||
it.path == "mods/jei-26.2-fabric-30.29.0.199.jar"
|
||||
}
|
||||
if (rootProject.pack_version != "26.2.0-alpha.227"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.13"
|
||||
|| rootProject.redstoner_version != "0.0.0-alpha.14"
|
||||
|| rootProject.sanctuary_version != "0.0.0-alpha.131"
|
||||
|| migration.source?.pack_version != "26.2.0-alpha.221"
|
||||
|| migration.source?.modules != [
|
||||
@@ -7132,7 +7132,6 @@ tasks.register("verifyAlpha222Release") {
|
||||
|| !search.contains("Normalizer.Form.NFD")
|
||||
|| !search.contains("BuiltInRegistries.ITEM.getKey")
|
||||
|| !screen.contains("new EditBox")
|
||||
|| !screen.contains("setInitialFocus(searchBox)")
|
||||
|| !screen.contains("searchBox.setResponder(this::searchChanged)")
|
||||
|| !smoke.contains("verifySearch()")
|
||||
|| !smoke.contains("verifyStableLayout()")
|
||||
@@ -7171,6 +7170,27 @@ tasks.register("verifyAlpha222Release") {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("verifyStorageTerminalSearchFocus") {
|
||||
group = "verification"
|
||||
description = "Checks clickable storage-terminal search focus and vanilla inventory-key closing."
|
||||
inputs.file(file(
|
||||
"redstoner/src/main/java/fr/koka99cab/sanctuary26/redstoner/client/gui/StorageTerminalScreen.java"))
|
||||
doLast {
|
||||
def screen = file(
|
||||
"redstoner/src/main/java/fr/koka99cab/sanctuary26/redstoner/client/gui/StorageTerminalScreen.java").text
|
||||
if (screen.contains("setInitialFocus(searchBox)")
|
||||
|| !screen.contains("searchBox.isMouseOver(event.x(), event.y())")
|
||||
|| !screen.contains("minecraft.options.keyInventory.matches(event)")
|
||||
|| screen.count("clearSearchFocus();") != 2
|
||||
|| !screen.contains("searchBox.setFocused(false)")
|
||||
|| !screen.contains("setFocused(null)")
|
||||
|| !screen.contains("return super.mouseClicked(event, doubleClick)")
|
||||
|| !screen.contains("return super.keyPressed(event)")) {
|
||||
throw new GradleException("The storage-terminal search focus regression contract is incomplete")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("verifyAlpha223Release") {
|
||||
group = "verification"
|
||||
description = "Checks the Sanctuary 26.2.0-alpha.223 inventory-sort and quest-tracker display release."
|
||||
@@ -7483,7 +7503,8 @@ tasks.register("verifyAlpha225Release") {
|
||||
def workspaceModules = moduleIds.collectEntries { id ->
|
||||
[(id): project(":${id}").version.toString()]
|
||||
}
|
||||
def releasedModules = workspaceModules
|
||||
def releasedModules = workspaceModules + [
|
||||
redstoner: "0.0.0-alpha.13"]
|
||||
def requiredJars = releasedModules.collect { id, version ->
|
||||
"file = \"mods/${id}-${version}.jar\""
|
||||
}
|
||||
@@ -7643,7 +7664,8 @@ tasks.register("verifyAlpha226Release") {
|
||||
def workspaceModules = moduleIds.collectEntries { id ->
|
||||
[(id): project(":${id}").version.toString()]
|
||||
}
|
||||
def releasedModules = workspaceModules
|
||||
def releasedModules = workspaceModules + [
|
||||
redstoner: "0.0.0-alpha.13"]
|
||||
def requiredJars = releasedModules.collect { id, version ->
|
||||
"file = \"mods/${id}-${version}.jar\""
|
||||
}
|
||||
@@ -7734,7 +7756,8 @@ tasks.register("verifyAlpha227Release") {
|
||||
def workspaceModules = moduleIds.collectEntries { id ->
|
||||
[(id): project(":${id}").version.toString()]
|
||||
}
|
||||
def requiredJars = workspaceModules.collect { id, version ->
|
||||
def releasedModules = workspaceModules + [redstoner: "0.0.0-alpha.13"]
|
||||
def requiredJars = releasedModules.collect { id, version ->
|
||||
"file = \"mods/${id}-${version}.jar\""
|
||||
}
|
||||
if (rootProject.pack_version != "26.2.0-alpha.227"
|
||||
@@ -7802,6 +7825,7 @@ tasks.named("verifyWorkspace") {
|
||||
dependsOn tasks.named("verifyAlpha220Release")
|
||||
dependsOn tasks.named("verifyAlpha221Release")
|
||||
dependsOn tasks.named("verifyAlpha222Release")
|
||||
dependsOn tasks.named("verifyStorageTerminalSearchFocus")
|
||||
dependsOn tasks.named("verifyAlpha223Release")
|
||||
dependsOn tasks.named("verifyAlpha224Release")
|
||||
dependsOn tasks.named("verifyAlpha225Release")
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ mod_version=0.0.0-alpha.0
|
||||
module_lifecycle=standby
|
||||
ambiance_version=0.0.0-alpha.22
|
||||
ambiance_lifecycle=active
|
||||
redstoner_version=0.0.0-alpha.13
|
||||
redstoner_version=0.0.0-alpha.14
|
||||
redstoner_lifecycle=active
|
||||
anotherworld_version=0.0.0-alpha.57
|
||||
anotherworld_lifecycle=active
|
||||
|
||||
+12
-4
@@ -46,7 +46,6 @@ public final class StorageTerminalScreen extends AbstractContainerScreen<Storage
|
||||
searchBox.setHint(Component.translatable("screen.redstoner.storage_terminal.search"));
|
||||
searchBox.setValue(searchValue);
|
||||
searchBox.setResponder(this::searchChanged);
|
||||
setInitialFocus(searchBox);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,6 +113,10 @@ public final class StorageTerminalScreen extends AbstractContainerScreen<Storage
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(MouseButtonEvent event, boolean doubleClick) {
|
||||
if (searchBox != null && searchBox.isFocused()
|
||||
&& !searchBox.isMouseOver(event.x(), event.y())) {
|
||||
clearSearchFocus();
|
||||
}
|
||||
if (event.button() == 0
|
||||
&& isHovering(SCROLL_X - 2, TERMINAL_TOP, SCROLL_WIDTH + 4, TERMINAL_HEIGHT,
|
||||
event.x(), event.y())) {
|
||||
@@ -127,9 +130,9 @@ public final class StorageTerminalScreen extends AbstractContainerScreen<Storage
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(KeyEvent event) {
|
||||
if (searchBox != null && searchBox.isFocused() && event.key() != 256) {
|
||||
searchBox.keyPressed(event);
|
||||
return true;
|
||||
if (searchBox != null && searchBox.isFocused() && minecraft != null
|
||||
&& minecraft.options.keyInventory.matches(event)) {
|
||||
clearSearchFocus();
|
||||
}
|
||||
return super.keyPressed(event);
|
||||
}
|
||||
@@ -173,6 +176,11 @@ public final class StorageTerminalScreen extends AbstractContainerScreen<Storage
|
||||
}
|
||||
}
|
||||
|
||||
private void clearSearchFocus() {
|
||||
searchBox.setFocused(false);
|
||||
setFocused(null);
|
||||
}
|
||||
|
||||
private void extractScrollBar(GuiGraphicsExtractor graphics) {
|
||||
int x = leftPos + SCROLL_X;
|
||||
int y = topPos + TERMINAL_TOP;
|
||||
|
||||
Reference in New Issue
Block a user