PC-954 Tweak error message when no reports are available for handling
Also close gui after clicking item and remove old un-necessary code.
This commit is contained in:
parent
f42678a9ef
commit
ca09253292
@ -5,7 +5,6 @@ import java.util.Optional;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.HandlerList;
|
|
||||||
|
|
||||||
import mineplex.core.account.CoreClient;
|
import mineplex.core.account.CoreClient;
|
||||||
import mineplex.core.chatsnap.SnapshotManager;
|
import mineplex.core.chatsnap.SnapshotManager;
|
||||||
@ -51,9 +50,6 @@ public class ReportCreatePage extends SimpleGui implements ReportCategoryCallba
|
|||||||
|
|
||||||
public void addReport(ReportCategory category)
|
public void addReport(ReportCategory category)
|
||||||
{
|
{
|
||||||
_reporter.closeInventory();
|
|
||||||
unregisterListener();
|
|
||||||
|
|
||||||
if (category == ReportCategory.CHAT_ABUSE)
|
if (category == ReportCategory.CHAT_ABUSE)
|
||||||
{
|
{
|
||||||
if (hasSentMessage(_suspect.getAccountId()))
|
if (hasSentMessage(_suspect.getAccountId()))
|
||||||
@ -106,14 +102,10 @@ public class ReportCreatePage extends SimpleGui implements ReportCategoryCallba
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unregisterListener()
|
|
||||||
{
|
|
||||||
HandlerList.unregisterAll(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void click(ReportCategoryButton button)
|
public void click(ReportCategoryButton button)
|
||||||
{
|
{
|
||||||
|
_reporter.closeInventory();
|
||||||
addReport(button.getCategory());
|
addReport(button.getCategory());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ public class ReportHandlePage extends SimpleGui implements ReportCategoryCallbac
|
|||||||
@Override
|
@Override
|
||||||
public void click(ReportCategoryButton button)
|
public void click(ReportCategoryButton button)
|
||||||
{
|
{
|
||||||
|
_handler.closeInventory();
|
||||||
handleReport(button.getCategory());
|
handleReport(button.getCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +108,7 @@ public class ReportHandlePage extends SimpleGui implements ReportCategoryCallbac
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UtilPlayer.message(_handler, F.main(_plugin.getName(), C.cRed + "No report found, report queue is empty."));
|
UtilPlayer.message(_handler, F.main(_plugin.getName(), C.cRed + "No open " + F.elem(category.getName()) + " report(s) found."));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user