mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
fancydialogs: Add input types for dialog interactions
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package com.fancyinnovations.fancydialogs.api.input;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public record CheckboxInput(
|
||||
@NotNull String label,
|
||||
boolean initial,
|
||||
@NotNull String onTrue,
|
||||
@NotNull String onFalse
|
||||
) implements DialogInput {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.fancyinnovations.fancydialogs.api.input;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record ComboboxInput (
|
||||
int width,
|
||||
@NotNull List<Entry> entries,
|
||||
@NotNull String label,
|
||||
boolean labelVisible
|
||||
) implements DialogInput {
|
||||
|
||||
public record Entry(
|
||||
@NotNull String id,
|
||||
@Nullable String display,
|
||||
boolean initial
|
||||
) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.fancyinnovations.fancydialogs.api.input;
|
||||
|
||||
public interface DialogInput {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.fancyinnovations.fancydialogs.api.input;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public record SliderInput(
|
||||
int width,
|
||||
@NotNull String label,
|
||||
@NotNull String labelFormat,
|
||||
@NotNull RangeInfo rangeInfo
|
||||
) implements DialogInput {
|
||||
|
||||
public record RangeInfo(
|
||||
double start,
|
||||
double end,
|
||||
@Nullable Double initial,
|
||||
int steps
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.fancyinnovations.fancydialogs.api.input;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public record TextInput(
|
||||
int width,
|
||||
@NotNull String label,
|
||||
boolean labelVisible,
|
||||
@Nullable String initial
|
||||
) implements DialogInput {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user