Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus committed Mar 6, 2021
1 parent 5177be5 commit 25458b5
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
id 'eclipse'
}

version '1.2.1'

repositories {
mavenCentral()
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots' }
Expand All @@ -14,5 +16,7 @@ repositories {
dependencies {
implementation 'org.eclipse.jdt:org.eclipse.jdt.annotation:1.1.0'
implementation 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
implementation 'com.github.SkriptLang:Skript:2.3'
implementation ('com.github.SkriptLang:Skript:2.3') {
transitive = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
" This effect can be used within a GUI close section.",
" A 1 tick delay is applied by this effect."
})
@Examples({"create a gui with virtual chest inventory with 3 rows named \"My GUI\"",
@Examples({"create a gui with virtual chest inventory with 3 rows named \"My GUI\":",
"\trun on gui close:",
"\t\tcancel the gui closing"
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package io.github.apickledwalrus.skriptgui.elements.expressions;

import ch.njol.skript.Skript;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;
import io.github.apickledwalrus.skriptgui.SkriptGUI;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;

public class ExprGUIIdentifiers extends SimpleExpression<String> {

static {
Skript.registerExpression(ExprGUIIdentifiers.class, String.class, ExpressionType.SIMPLE,
"[(all [[of] the]|the)] (global|registered) gui identifiers"
);
}

@Override
public boolean init(Expression<?>[] expressions, int i, Kleenean kleenean, ParseResult parseResult) {
return true;
}

@Override
protected String[] get(Event e) {
return SkriptGUI.getGUIManager().getGlobalIdentifiers();
}

@Override
public boolean isSingle() {
return false;
}

@Override
public Class<? extends String> getReturnType() {
return String.class;
}

@Override
public String toString(@Nullable Event event, boolean b) {
return "all of the registered gui identifiers";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public GUI getGlobalGUI(String id) {
return id != null ? globalGUIs.get(id) : null;
}

public String[] getGlobalIdentifiers() {
return globalGUIs.keySet().toArray(new String[0]);
}

public void addGlobalGUI(String id, GUI gui) {
if (id != null && gui != null)
globalGUIs.put(id, gui);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: skript-gui
main: io.github.apickledwalrus.skriptgui.SkriptGUI
version: 1.2.0
version: 1.2.1
authors: [APickledWalrus, Tuke_Nuke]
description: Enables the easy creation of advanced and organized GUIs with Skript.
website: https://github.com/APickledWalrus/skript-gui
Expand Down

0 comments on commit 25458b5

Please sign in to comment.