-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70bd136
commit 09e715a
Showing
12 changed files
with
128 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/fr/yuki/yrpf/luaapi/map/AddMapCustomMarkerEF.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package fr.yuki.yrpf.luaapi.map; | ||
|
||
import net.onfirenetwork.onsetjava.plugin.ExportFunction; | ||
|
||
public class AddMapCustomMarkerEF implements ExportFunction { | ||
@Override | ||
public Object call(Object[] objects) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/fr/yuki/yrpf/luaapi/worldui/SetImageWUIEF.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package fr.yuki.yrpf.luaapi.worldui; | ||
|
||
import fr.yuki.yrpf.manager.WorldUIManager; | ||
import fr.yuki.yrpf.world.WImageContainerWUI; | ||
import fr.yuki.yrpf.world.WProgressBarWUI; | ||
import fr.yuki.yrpf.world.WorldUI; | ||
import net.onfirenetwork.onsetjava.plugin.ExportFunction; | ||
|
||
public class SetImageWUIEF implements ExportFunction { | ||
@Override | ||
public Object call(Object[] objects) { | ||
WorldUI worldUI = WorldUIManager.findWorldUIByID(Integer.parseInt(objects[0].toString())); | ||
if(worldUI == null) return false; | ||
if(!worldUI.getUiType().equals("wImageContainer")) { | ||
return false; | ||
} | ||
WImageContainerWUI wImageContainerWUI = (WImageContainerWUI)worldUI; | ||
wImageContainerWUI.setImageUrl(objects[1].toString()); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/fr/yuki/yrpf/net/payload/SetImageWUIPayload.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package fr.yuki.yrpf.net.payload; | ||
|
||
public class SetImageWUIPayload { | ||
private String imageUrl; | ||
private String type; | ||
|
||
public SetImageWUIPayload(String imageUrl) { | ||
this.type = "SET_IMAGE_WUI"; | ||
this.imageUrl = imageUrl; | ||
} | ||
|
||
public String getImageUrl() { | ||
return imageUrl; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package fr.yuki.yrpf.world; | ||
|
||
import com.google.gson.Gson; | ||
import fr.yuki.yrpf.net.payload.SetImageWUIPayload; | ||
import fr.yuki.yrpf.net.payload.SetProgressWUIPayload; | ||
import net.onfirenetwork.onsetjava.data.Vector; | ||
import net.onfirenetwork.onsetjava.entity.Player; | ||
|
||
public class WImageContainerWUI extends WorldUI { | ||
private String imageUrl = ""; | ||
|
||
public WImageContainerWUI(Vector position, Vector rotation, int width, int height, String uiType) { | ||
super(position, rotation, width, height, uiType); | ||
} | ||
|
||
public void setImageUrl(String url) { | ||
if(url.startsWith("http")) { | ||
this.imageUrl = url; | ||
} else { | ||
this.imageUrl = "../../../../" + url; | ||
} | ||
this.syncAll(); | ||
} | ||
|
||
@Override | ||
public void sync(Player player) { | ||
this.dispatchToPlayerUI(player, new Gson().toJson(new SetImageWUIPayload(this.imageUrl))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters