Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
apply from: 'https://raw.githubusercontent.com/ldtteam/OperaPublicaCreator/ng7/gradle/mod.gradle'

runs {
client {
systemProperty 'blockui.debug', 'true'
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.configuration-cache=true

modId=blockui
modGroup=com.ldtteam
modVersion=0.0.1
modVersion=1.0.200

javaVersion=21
useJavaToolChains=true
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gradle.startParameter.setProjectProperties(new HashMap<>(gradle.startParameter.getProjectProperties()))
gradle.startParameter.getProjectProperties().put("build.start", Long.toString(System.currentTimeMillis()))

rootProject.name = "blockui"
rootProject.name = "blockui"
30 changes: 30 additions & 0 deletions src/main/java/com/ldtteam/blockui/LayoutContext.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.ldtteam.blockui;

import org.jetbrains.annotations.Nullable;

import java.util.Map;

/**
* Carries slot content and an optional position override during layout expansion.
* Each slot name maps to exactly ONE PaneParams (slots are unique).
* {@code null} slot name in the caller is normalized to {@link #DEFAULT_SLOT_KEY}.
* {@code posOverride} is non-null when the use-site {@code <layout>} tag specifies a {@code pos}, {@code x}, or {@code y} attribute,
* in which case the layout file's single root child has its position replaced with these values.
*/
public record LayoutContext(Map<String, PaneParams> slotContent, @Nullable int[] posOverride)
{
public static final LayoutContext EMPTY = new LayoutContext(Map.of(), null);

static final String DEFAULT_SLOT_KEY = "default";

@Nullable
public PaneParams get(final String slotName)
{
return slotContent.get(slotName);
}

public boolean hasPosOverride()
{
return posOverride != null;
}
}
Loading
Loading