Skip to content

Commit a43d1ae

Browse files
committed
1.19.4
1 parent 7629d10 commit a43d1ae

File tree

2 files changed

+29
-43
lines changed

2 files changed

+29
-43
lines changed

gradle.properties

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
org.gradle.jvmargs=-Xmx1G
33
# Fabric Properties
44
# check these on https://fabricmc.net/develop
5-
minecraft_base_version=1.19.3
6-
minecraft_version=1.19.3
7-
yarn_mappings=1.19.3+build.4
8-
loader_version=0.14.12
5+
minecraft_base_version=1.19.4
6+
minecraft_version=1.19.4
7+
yarn_mappings=1.19.4+build.1
8+
loader_version=0.14.18
99
# Mod Properties
1010
mod_version=0.3.2
1111
maven_group=com.glisco
1212
archives_base_name=deathlog
1313
# Dependencies
14-
fabric_version=0.76.0+1.19.3
14+
fabric_version=0.76.0+1.19.4
1515

1616
# https://github.com/emilyploszaj/trinkets/releases
17-
trinkets_version=3.5.1
17+
trinkets_version=3.6.0
1818

1919
# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu
20-
modmenu_version=5.0.2
20+
modmenu_version=6.1.0-rc.4
2121

2222
# https://maven.wispforest.io/io/wispforest/owo-lib/
23-
owo_version=0.10.3+1.19.3
23+
owo_version=0.10.3+1.19.4
2424

src/main/java/com/glisco/deathlog/client/gui/DeathLogScreen.java

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public class DeathLogScreen extends BaseUIModelScreen<FlowLayout> {
3232
private final DirectDeathLogStorage storage;
3333

3434
private FlowLayout detailPanel;
35-
private DropdownComponent activeDropdown = null;
3635

3736
private final Observable<String> currentSearchTerm = Observable.of("");
3837
private boolean canRestore = true;
@@ -118,28 +117,29 @@ private void buildDeathList() {
118117
container.mouseDown().subscribe((mouseX, mouseY, button) -> {
119118
if (button != GLFW.GLFW_MOUSE_BUTTON_RIGHT) return false;
120119

121-
this.uiAdapter.rootComponent.removeChild(this.activeDropdown);
122-
this.uiAdapter.rootComponent.child(Components.dropdown(Sizing.content()).<DropdownComponent>configure(dropdown -> {
123-
this.activeDropdown = dropdown;
124-
125-
if (this.canRestore) {
126-
dropdown.button(Text.translatable("text.deathlog.action.restore"), dropdown_ -> {
127-
this.storage.restore(infoIndex);
128-
this.removeDropdown();
129-
});
130-
}
131-
132-
dropdown.button(Text.translatable("text.deathlog.action.delete"), dropdown_ -> {
120+
var root = this.uiAdapter.rootComponent;
121+
DropdownComponent.openContextMenu(
122+
this,
123+
root, FlowLayout::child,
124+
container.x() - root.padding().get().left() + mouseX,
125+
container.y() - root.padding().get().top() + mouseY,
126+
dropdown -> {
127+
dropdown.surface(Surface.flat(0xBB000000).and(Surface.outline(0xA75F5F5F)));
128+
129+
if (this.canRestore) {
130+
dropdown.button(Text.translatable("text.deathlog.action.restore"), dropdown_ -> {
131+
this.storage.restore(infoIndex);
132+
dropdown.remove();
133+
});
134+
}
135+
136+
dropdown.button(Text.translatable("text.deathlog.action.delete"), dropdown_ -> {
133137
this.storage.delete(deathInfo);
134138
this.buildDeathList();
135-
this.removeDropdown();
136-
})
137-
.surface(Surface.flat(0xBB000000))
138-
.positioning(Positioning.absolute(
139-
container.x() + (int) mouseX - this.uiAdapter.rootComponent.padding().get().left(),
140-
container.y() + (int) mouseY - this.uiAdapter.rootComponent.padding().get().top()
141-
));
142-
}));
139+
dropdown.remove();
140+
});
141+
}
142+
);
143143

144144
return true;
145145
});
@@ -242,20 +242,6 @@ private ItemComponent makeItem(ItemStack stack, Insets margins) {
242242
return item;
243243
}
244244

245-
private void removeDropdown() {
246-
this.uiAdapter.rootComponent.removeChild(this.activeDropdown);
247-
this.activeDropdown = null;
248-
}
249-
250-
@Override
251-
public boolean mouseClicked(double mouseX, double mouseY, int button) {
252-
if (this.activeDropdown != null && !this.activeDropdown.isInBoundingBox(mouseX, mouseY)) {
253-
this.removeDropdown();
254-
}
255-
256-
return super.mouseClicked(mouseX, mouseY, button);
257-
}
258-
259245
@Override
260246
public void close() {
261247
this.client.setScreen(this.parent);

0 commit comments

Comments
 (0)