cursor only shows for specific items
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-05 16:04:14 -04:00
parent f755cea74e
commit 3338487241
2 changed files with 22 additions and 0 deletions

View File

@ -1450,6 +1450,7 @@ Static rocks which harvest into rock items that spawn in forest
(04/05/2025)
Stone Axe item
Fix human data for RH sword slash attack moves
Cursor only for specific items

View File

@ -44,6 +44,11 @@ public class ClientToolbarState implements BehaviorTree {
*/
public static final int MAX_TOOLBAR_SIZE = 10;
/**
* Token for displaying cursor
*/
public static final String CURSOR_TOKEN = "CURSOR";
/**
* The selected toolbar slot
*/
@ -171,6 +176,18 @@ public class ClientToolbarState implements BehaviorTree {
Globals.clientSceneWrapper.getScene().removeEntityFromTag(toEquip, EntityTags.TARGETABLE);
GravityUtils.clientAttemptDeactivateGravity(toEquip);
}
//cursor logic
if(targetPoint != null){
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(toEquip);
if(Globals.playerCursor != null){
if(itemData.getTokens().contains(ClientToolbarState.CURSOR_TOKEN)){
Globals.clientSceneWrapper.getScene().registerEntityToTag(Globals.playerCursor, EntityTags.DRAWABLE);
} else {
Globals.clientSceneWrapper.getScene().removeEntityFromTag(Globals.playerCursor, EntityTags.DRAWABLE);
}
}
}
}
/**
@ -233,6 +250,10 @@ public class ClientToolbarState implements BehaviorTree {
}
}
if(Globals.playerCursor != null){
Globals.clientSceneWrapper.getScene().removeEntityFromTag(Globals.playerCursor, EntityTags.DRAWABLE);
}
//null out the attached entity
this.equippedEntity = null;
}