Skip to content

Commit

Permalink
Fixed Remove Sprite Not Working
Browse files Browse the repository at this point in the history
  • Loading branch information
Iteranya committed Nov 13, 2024
1 parent b5581dd commit e4bb91d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ private static void serverSideExecute(Player player, String scriptFileName) {
List<Map<String,Object>> script = ScriptLoader.loadScript(scriptFileName,uid);
if(script!=null){
VisualNovelEngine vnEngine = new VisualNovelEngine(script, scriptFileName, uid,day,inventory);
sendClientMessage(player, "Trying to load the file config/mobtalkerredux/" + scriptFileName);
sendClientMessage(player, "Trying to load the file mobtalkerredux/" + scriptFileName);
clientSideRenderDialogueScreen(vnEngine);
}
else{
sendClientMessage(player, "Failed to find the file config/mobtalkerredux/" + scriptFileName);
sendClientMessage(player, "Failed to find the file mobtalkerredux/" + scriptFileName);
}
} catch (IOException e) {
sendClientMessage(player, "Failed to find the file config/mobtalkerredux/" + scriptFileName);
sendClientMessage(player, "Failed to find the file mobtalkerredux/" + scriptFileName);
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ private void processAction(Map<String, Object> action) {
updateSprite(action, this);
return;
case "remove_sprite":
removeSprite((String) action.get("sprite"), state);
removeSprite((String) action.get("sprite"), this);
return;
case "dialogue":
updateDialogue(
(String) action.get("label"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.arsparadox.mobtalkerredux.vn.controller.vnmodules;

import org.arsparadox.mobtalkerredux.vn.controller.VisualNovelEngine;
import org.arsparadox.mobtalkerredux.vn.data.DialogueState;
import org.arsparadox.mobtalkerredux.vn.data.SpriteState;

import java.util.List;
Expand All @@ -10,8 +9,9 @@

public class SpriteHandler {

public static void removeSprite(String remove, DialogueState state){
removeSpriteByFolder(state.getSprites(), remove);
public static void removeSprite(String remove,VisualNovelEngine vn){
removeSpriteByFolder(vn.state.getSprites(), remove);
vn.currentState.incrementAndGet();
}

public static void updateSprite(Map<String, Object> sprite, VisualNovelEngine vn) {
Expand Down

0 comments on commit e4bb91d

Please sign in to comment.