Skip to content

Commit

Permalink
Close screen when report is sent
Browse files Browse the repository at this point in the history
  • Loading branch information
RappyTV committed Nov 25, 2023
1 parent bddb478 commit 1643929
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.rappytv.globaltags.activities;

import com.rappytv.globaltags.GlobalTagAddon;
import net.labymod.api.Laby;
import net.labymod.api.client.component.Component;
import net.labymod.api.client.component.format.NamedTextColor;
import net.labymod.api.client.gui.icon.Icon;
import net.labymod.api.client.gui.screen.Parent;
import net.labymod.api.client.gui.screen.ScreenInstance;
import net.labymod.api.client.gui.screen.activity.AutoActivity;
import net.labymod.api.client.gui.screen.activity.Link;
import net.labymod.api.client.gui.screen.activity.types.SimpleActivity;
Expand Down Expand Up @@ -48,9 +50,10 @@ public void initialize(Parent parent) {
.updateComponent(Component.translatable("globaltags.report.send", NamedTextColor.RED))
.addId("report-button");
button.setEnabled(false);
button.setActionListener(() ->
addon.getApiHandler().reportPlayer(uuid, textField.getText())
);
button.setActionListener(() -> {
Laby.labyAPI().minecraft().minecraftWindow().displayScreen((ScreenInstance) null);
addon.getApiHandler().reportPlayer(uuid, textField.getText());
});
textField.updateListener((text) -> button.setEnabled(!text.isBlank()));

profileWrapper.addEntry(headWidget);
Expand Down

0 comments on commit 1643929

Please sign in to comment.