This commit is contained in:
parent
b3af26b6a0
commit
b8a0db5974
BIN
assets/Audio/ui/items/specific/Drop Metal A.wav
Normal file
BIN
assets/Audio/ui/items/specific/Drop Metal A.wav
Normal file
Binary file not shown.
BIN
assets/Audio/ui/items/specific/Pick Up Metal A.wav
Normal file
BIN
assets/Audio/ui/items/specific/Pick Up Metal A.wav
Normal file
Binary file not shown.
BIN
assets/Audio/ui/menu/Close Inventory Bag A.wav
Normal file
BIN
assets/Audio/ui/menu/Close Inventory Bag A.wav
Normal file
Binary file not shown.
BIN
assets/Audio/ui/menu/Open Inventory Bag A.wav
Normal file
BIN
assets/Audio/ui/menu/Open Inventory Bag A.wav
Normal file
Binary file not shown.
@ -101,6 +101,10 @@
|
|||||||
"equipData": {
|
"equipData": {
|
||||||
"equipClass" : "weapon2H"
|
"equipClass" : "weapon2H"
|
||||||
},
|
},
|
||||||
|
"itemAudio": {
|
||||||
|
"uiGrabAudio" : "Audio/ui/items/specific/Pick Up Metal A.wav",
|
||||||
|
"uiReleaseAudio" : "Audio/ui/items/specific/Drop Metal A.wav"
|
||||||
|
},
|
||||||
"tokens" : [
|
"tokens" : [
|
||||||
"GRAVITY",
|
"GRAVITY",
|
||||||
"MELEE",
|
"MELEE",
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
Ticketed randomizer node for BTs to more heavily weight attacking and waiting
|
Ticketed randomizer node for BTs to more heavily weight attacking and waiting
|
||||||
|
|
||||||
+ feedback driven requirements
|
+ feedback driven requirements
|
||||||
Much much much much more UI sound effects
|
|
||||||
UI spacing and scaling
|
UI spacing and scaling
|
||||||
Come up with a title for the game and create a title menu for it (ideally with some animation and music)
|
Come up with a title for the game and create a title menu for it (ideally with some animation and music)
|
||||||
Better skybox
|
Better skybox
|
||||||
@ -31,6 +30,7 @@
|
|||||||
- Spawn player in a town with a quest to complete a nearby dungeon
|
- Spawn player in a town with a quest to complete a nearby dungeon
|
||||||
|
|
||||||
+ bug fixes
|
+ bug fixes
|
||||||
|
Fix skeleton right strafe
|
||||||
Fix return to title menu synchronization bug
|
Fix return to title menu synchronization bug
|
||||||
|
|
||||||
+ unreproducible bugs
|
+ unreproducible bugs
|
||||||
|
|||||||
@ -789,6 +789,9 @@ Refactor menus to package under client
|
|||||||
Fix buffered scrollable regression in above work
|
Fix buffered scrollable regression in above work
|
||||||
Memory fix
|
Memory fix
|
||||||
Start proliferating audio through ui
|
Start proliferating audio through ui
|
||||||
|
Item-based ui audio
|
||||||
|
Better sfx for opening/closing inventory menu
|
||||||
|
Different title menu audio
|
||||||
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
import electrosphere.client.ui.menu.WindowUtils;
|
import electrosphere.client.ui.menu.WindowUtils;
|
||||||
import electrosphere.client.ui.menu.ingame.MenuGeneratorsTerrainEditing;
|
import electrosphere.client.ui.menu.ingame.MenuGeneratorsTerrainEditing;
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
|
import electrosphere.engine.assetmanager.AssetDataStrings;
|
||||||
import electrosphere.engine.loadingthreads.LoadingThread;
|
import electrosphere.engine.loadingthreads.LoadingThread;
|
||||||
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
|
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
|
||||||
import electrosphere.entity.scene.SceneFile;
|
import electrosphere.entity.scene.SceneFile;
|
||||||
@ -85,7 +86,7 @@ public class MenuGeneratorsLevelEditor {
|
|||||||
Button deleteButton = Button.createButton(" X ", () -> {
|
Button deleteButton = Button.createButton(" X ", () -> {
|
||||||
SaveUtils.deleteSave(saveName);
|
SaveUtils.deleteSave(saveName);
|
||||||
WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu());
|
WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu());
|
||||||
});
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE);
|
||||||
deleteButton.setMarginRight(10);
|
deleteButton.setMarginRight(10);
|
||||||
|
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ public class MenuGeneratorsLevelEditor {
|
|||||||
Globals.RUN_CLIENT = true;
|
Globals.RUN_CLIENT = true;
|
||||||
Globals.RUN_SERVER = true;
|
Globals.RUN_SERVER = true;
|
||||||
Globals.threadManager.start(loadingThread);
|
Globals.threadManager.start(loadingThread);
|
||||||
});
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE);
|
||||||
|
|
||||||
//
|
//
|
||||||
//button (edit Level)
|
//button (edit Level)
|
||||||
@ -105,7 +106,7 @@ public class MenuGeneratorsLevelEditor {
|
|||||||
//launch level editor
|
//launch level editor
|
||||||
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.LEVEL_EDITOR, saveName);
|
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.LEVEL_EDITOR, saveName);
|
||||||
Globals.threadManager.start(loadingThread);
|
Globals.threadManager.start(loadingThread);
|
||||||
});
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE);
|
||||||
|
|
||||||
//create row
|
//create row
|
||||||
Div row = Div.createRow(
|
Div row = Div.createRow(
|
||||||
@ -208,7 +209,7 @@ public class MenuGeneratorsLevelEditor {
|
|||||||
//launch level editor
|
//launch level editor
|
||||||
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.LEVEL_EDITOR, inFlightLevel);
|
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.LEVEL_EDITOR, inFlightLevel);
|
||||||
Globals.threadManager.start(loadingThread);
|
Globals.threadManager.start(loadingThread);
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
|
|
||||||
return rVal;
|
return rVal;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package electrosphere.client.ui.menu.mainmenu;
|
|||||||
import electrosphere.client.ui.menu.MenuGenerators;
|
import electrosphere.client.ui.menu.MenuGenerators;
|
||||||
import electrosphere.client.ui.menu.WindowUtils;
|
import electrosphere.client.ui.menu.WindowUtils;
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
|
import electrosphere.engine.assetmanager.AssetDataStrings;
|
||||||
import electrosphere.engine.loadingthreads.LoadingThread;
|
import electrosphere.engine.loadingthreads.LoadingThread;
|
||||||
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
|
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
|
||||||
import electrosphere.renderer.ui.elements.Button;
|
import electrosphere.renderer.ui.elements.Button;
|
||||||
@ -37,22 +38,22 @@ public class MenuGeneratorsTitleMenu {
|
|||||||
//button (multiplayer)
|
//button (multiplayer)
|
||||||
rVal.addChild(Button.createButtonCentered("Singleplayer", () -> {
|
rVal.addChild(Button.createButtonCentered("Singleplayer", () -> {
|
||||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
|
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
//button (multiplayer)
|
//button (multiplayer)
|
||||||
rVal.addChild(Button.createButtonCentered("Multiplayer", () -> {
|
rVal.addChild(Button.createButtonCentered("Multiplayer", () -> {
|
||||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createMultiplayerMenu());
|
WindowUtils.replaceMainMenuContents(MenuGenerators.createMultiplayerMenu());
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
//button (static level)
|
//button (static level)
|
||||||
rVal.addChild(Button.createButtonCentered("Level Editor", () -> {
|
rVal.addChild(Button.createButtonCentered("Level Editor", () -> {
|
||||||
WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu());
|
WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu());
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
//button (options)
|
//button (options)
|
||||||
rVal.addChild(Button.createButtonCentered("Options", () -> {
|
rVal.addChild(Button.createButtonCentered("Options", () -> {
|
||||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createOptionsMainMenu());
|
WindowUtils.replaceMainMenuContents(MenuGenerators.createOptionsMainMenu());
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
//button (sp debug)
|
//button (sp debug)
|
||||||
rVal.addChild(Button.createButtonCentered("Debug SP Quickstart", () -> {
|
rVal.addChild(Button.createButtonCentered("Debug SP Quickstart", () -> {
|
||||||
@ -60,17 +61,17 @@ public class MenuGeneratorsTitleMenu {
|
|||||||
Globals.RUN_CLIENT = true;
|
Globals.RUN_CLIENT = true;
|
||||||
Globals.RUN_SERVER = true;
|
Globals.RUN_SERVER = true;
|
||||||
Globals.threadManager.start(loadingThread);
|
Globals.threadManager.start(loadingThread);
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
//button (ui testing)
|
//button (ui testing)
|
||||||
rVal.addChild(Button.createButtonCentered("UI Testing", () -> {
|
rVal.addChild(Button.createButtonCentered("UI Testing", () -> {
|
||||||
WindowUtils.replaceMainMenuContents(MenuGeneratorsUITesting.createUITestMenu());
|
WindowUtils.replaceMainMenuContents(MenuGeneratorsUITesting.createUITestMenu());
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
//button (Viewport Test)
|
//button (Viewport Test)
|
||||||
rVal.addChild(Button.createButtonCentered("Viewport Test", () -> {
|
rVal.addChild(Button.createButtonCentered("Viewport Test", () -> {
|
||||||
Globals.threadManager.start(new LoadingThread(LoadingThreadType.LOAD_VIEWPORT));
|
Globals.threadManager.start(new LoadingThread(LoadingThreadType.LOAD_VIEWPORT));
|
||||||
}));
|
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||||
|
|
||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -989,7 +989,7 @@ public class ControlHandler {
|
|||||||
Globals.controlHandler.hintUpdateControlState(ControlsState.INVENTORY);
|
Globals.controlHandler.hintUpdateControlState(ControlsState.INVENTORY);
|
||||||
//play sound effect
|
//play sound effect
|
||||||
if(Globals.virtualAudioSourceManager != null){
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_TONE_CONFIRM_PRIMARY, VirtualAudioSourceType.UI, false);
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_INVENTORY_OPEN, VirtualAudioSourceType.UI, false);
|
||||||
}
|
}
|
||||||
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(true);
|
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(true);
|
||||||
//
|
//
|
||||||
@ -997,6 +997,9 @@ public class ControlHandler {
|
|||||||
} else if(InventoryUtils.hasNaturalInventory(Globals.playerEntity) && Globals.elementService.getWindow(WindowStrings.WINDOW_CHARACTER) != null){
|
} else if(InventoryUtils.hasNaturalInventory(Globals.playerEntity) && Globals.elementService.getWindow(WindowStrings.WINDOW_CHARACTER) != null){
|
||||||
Globals.elementService.closeWindow(WindowStrings.WINDOW_CHARACTER);
|
Globals.elementService.closeWindow(WindowStrings.WINDOW_CHARACTER);
|
||||||
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(false);
|
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(false);
|
||||||
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_INVENTORY_CLOSE, VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
controls.get(INPUT_CODE_INVENTORY_OPEN).setRepeatTimeout(0.5f * Main.targetFrameRate);
|
controls.get(INPUT_CODE_INVENTORY_OPEN).setRepeatTimeout(0.5f * Main.targetFrameRate);
|
||||||
|
|||||||
@ -540,8 +540,6 @@ public class Globals {
|
|||||||
*/
|
*/
|
||||||
public static void initDefaultAudioResources(){
|
public static void initDefaultAudioResources(){
|
||||||
String[] audioToInit = new String[]{
|
String[] audioToInit = new String[]{
|
||||||
"/Audio/inventoryGrabItem.ogg",
|
|
||||||
"/Audio/inventorySlotItem.ogg",
|
|
||||||
"/Audio/ambienceWind1SeamlessMono.ogg",
|
"/Audio/ambienceWind1SeamlessMono.ogg",
|
||||||
"/Audio/weapons/swordUnsheath1.ogg",
|
"/Audio/weapons/swordUnsheath1.ogg",
|
||||||
"/Audio/weapons/swoosh-03.ogg",
|
"/Audio/weapons/swoosh-03.ogg",
|
||||||
@ -563,6 +561,11 @@ public class Globals {
|
|||||||
AssetDataStrings.UI_TONE_BACK_SECONDARY,
|
AssetDataStrings.UI_TONE_BACK_SECONDARY,
|
||||||
AssetDataStrings.UI_TONE_ERROR_PRIMARY,
|
AssetDataStrings.UI_TONE_ERROR_PRIMARY,
|
||||||
AssetDataStrings.UI_TONE_ERROR_SECONDARY,
|
AssetDataStrings.UI_TONE_ERROR_SECONDARY,
|
||||||
|
AssetDataStrings.UI_TONE_BUTTON_TITLE,
|
||||||
|
AssetDataStrings.UI_SFX_ITEM_GRAB,
|
||||||
|
AssetDataStrings.UI_SFX_ITEM_RELEASE,
|
||||||
|
AssetDataStrings.UI_SFX_INVENTORY_OPEN,
|
||||||
|
AssetDataStrings.UI_SFX_INVENTORY_CLOSE,
|
||||||
};
|
};
|
||||||
LoggerInterface.loggerStartup.INFO("Loading default audio resources");
|
LoggerInterface.loggerStartup.INFO("Loading default audio resources");
|
||||||
for(String path : audioToInit){
|
for(String path : audioToInit){
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class AssetDataStrings {
|
|||||||
public static final String UNITCUBE = "unitCube";
|
public static final String UNITCUBE = "unitCube";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UI audio
|
* UI generic audio
|
||||||
*/
|
*/
|
||||||
public static final String UI_TONE_CONFIRM_PRIMARY = "Audio/ui/generic/confirm_style_4_001.wav";
|
public static final String UI_TONE_CONFIRM_PRIMARY = "Audio/ui/generic/confirm_style_4_001.wav";
|
||||||
public static final String UI_TONE_CONFIRM_SECONDARY = "Audio/ui/generic/confirm_style_4_003.wav";
|
public static final String UI_TONE_CONFIRM_SECONDARY = "Audio/ui/generic/confirm_style_4_003.wav";
|
||||||
@ -28,4 +28,21 @@ public class AssetDataStrings {
|
|||||||
public static final String UI_TONE_ERROR_PRIMARY = "Audio/ui/generic/error_style_4_002.wav";
|
public static final String UI_TONE_ERROR_PRIMARY = "Audio/ui/generic/error_style_4_002.wav";
|
||||||
public static final String UI_TONE_ERROR_SECONDARY = "Audio/ui/generic/error_style_4_001.wav";
|
public static final String UI_TONE_ERROR_SECONDARY = "Audio/ui/generic/error_style_4_001.wav";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UI button-specific audio
|
||||||
|
*/
|
||||||
|
public static final String UI_TONE_BUTTON_TITLE = "Audio/ui/generic/back_style_4_007.wav";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UI menu audio
|
||||||
|
*/
|
||||||
|
public static final String UI_SFX_INVENTORY_OPEN = "Audio/ui/menu/Open Inventory Bag A.wav";
|
||||||
|
public static final String UI_SFX_INVENTORY_CLOSE = "Audio/ui/menu/Close Inventory Bag A.wav";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UI item audio
|
||||||
|
*/
|
||||||
|
public static final String UI_SFX_ITEM_GRAB = "Audio/ui/items/inventoryGrabItem.ogg";
|
||||||
|
public static final String UI_SFX_ITEM_RELEASE = "Audio/ui/items/inventorySlotItem.ogg";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import electrosphere.entity.state.gravity.ServerGravityTree;
|
|||||||
import electrosphere.entity.state.hitbox.HitboxCollectionState;
|
import electrosphere.entity.state.hitbox.HitboxCollectionState;
|
||||||
import electrosphere.entity.types.EntityTypes.EntityType;
|
import electrosphere.entity.types.EntityTypes.EntityType;
|
||||||
import electrosphere.entity.types.common.CommonEntityUtils;
|
import electrosphere.entity.types.common.CommonEntityUtils;
|
||||||
|
import electrosphere.game.data.item.ItemAudio;
|
||||||
import electrosphere.game.data.item.type.EquipData;
|
import electrosphere.game.data.item.type.EquipData;
|
||||||
import electrosphere.game.data.item.type.EquipWhitelist;
|
import electrosphere.game.data.item.type.EquipWhitelist;
|
||||||
import electrosphere.game.data.item.type.Item;
|
import electrosphere.game.data.item.type.Item;
|
||||||
@ -75,6 +76,15 @@ public class ItemUtils {
|
|||||||
} else {
|
} else {
|
||||||
rVal.putData(EntityDataStrings.ITEM_ICON,genericItemIconPath);
|
rVal.putData(EntityDataStrings.ITEM_ICON,genericItemIconPath);
|
||||||
}
|
}
|
||||||
|
if(item.getItemAudio() != null){
|
||||||
|
ItemAudio audio = item.getItemAudio();
|
||||||
|
if(audio.getUIGrabAudio() != null && audio.getUIGrabAudio() != ""){
|
||||||
|
Globals.assetManager.addAudioPathToQueue(audio.getUIGrabAudio());
|
||||||
|
}
|
||||||
|
if(audio.getUIReleaseAudio() != null && audio.getUIReleaseAudio() != ""){
|
||||||
|
Globals.assetManager.addAudioPathToQueue(audio.getUIReleaseAudio());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|||||||
34
src/main/java/electrosphere/game/data/item/ItemAudio.java
Normal file
34
src/main/java/electrosphere/game/data/item/ItemAudio.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package electrosphere.game.data.item;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Audio data related to the item
|
||||||
|
*/
|
||||||
|
public class ItemAudio {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The audio to play on grabbing the item icon in the ui
|
||||||
|
*/
|
||||||
|
String uiGrabAudio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The audio to play on releasing the item icon in the ui
|
||||||
|
*/
|
||||||
|
String uiReleaseAudio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the audio to play on grabbing the item icon in the ui
|
||||||
|
* @return The audio path if it exists, null otherwise
|
||||||
|
*/
|
||||||
|
public String getUIGrabAudio(){
|
||||||
|
return uiGrabAudio;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the audio to play on releasing the item icon in the ui
|
||||||
|
* @return The audio path if it exists, null otherwise
|
||||||
|
*/
|
||||||
|
public String getUIReleaseAudio(){
|
||||||
|
return uiReleaseAudio;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package electrosphere.game.data.item.type;
|
package electrosphere.game.data.item.type;
|
||||||
|
|
||||||
import electrosphere.game.data.common.CommonEntityType;
|
import electrosphere.game.data.common.CommonEntityType;
|
||||||
|
import electrosphere.game.data.item.ItemAudio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data on a given item
|
* Data on a given item
|
||||||
@ -16,6 +17,11 @@ public class Item extends CommonEntityType {
|
|||||||
//The data defining how this item is equipped
|
//The data defining how this item is equipped
|
||||||
EquipData equipData;
|
EquipData equipData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The audio data for the item
|
||||||
|
*/
|
||||||
|
ItemAudio itemAudio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the idle animation for the item
|
* the idle animation for the item
|
||||||
* @return
|
* @return
|
||||||
@ -47,5 +53,13 @@ public class Item extends CommonEntityType {
|
|||||||
public EquipData getEquipData(){
|
public EquipData getEquipData(){
|
||||||
return equipData;
|
return equipData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the item audio data
|
||||||
|
* @return The audio data if specified, null otherwise
|
||||||
|
*/
|
||||||
|
public ItemAudio getItemAudio(){
|
||||||
|
return itemAudio;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import electrosphere.entity.state.inventory.RelationalInventoryState;
|
|||||||
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
||||||
import electrosphere.entity.types.item.ItemUtils;
|
import electrosphere.entity.types.item.ItemUtils;
|
||||||
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
import electrosphere.game.data.creature.type.equip.EquipPoint;
|
||||||
|
import electrosphere.game.data.item.type.Item;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.renderer.ui.elements.Div;
|
import electrosphere.renderer.ui.elements.Div;
|
||||||
import electrosphere.renderer.ui.elements.ImagePanel;
|
import electrosphere.renderer.ui.elements.ImagePanel;
|
||||||
@ -52,6 +53,15 @@ public class EquipmentInventoryPanel {
|
|||||||
div.setOnDragRelease(new DragEventCallback() {public boolean execute(DragEvent event){
|
div.setOnDragRelease(new DragEventCallback() {public boolean execute(DragEvent event){
|
||||||
LoggerInterface.loggerUI.INFO("Character inventory received drag release event");
|
LoggerInterface.loggerUI.INFO("Character inventory received drag release event");
|
||||||
if(Globals.draggedItem != null){
|
if(Globals.draggedItem != null){
|
||||||
|
//play sound effect
|
||||||
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
|
||||||
|
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
||||||
|
} else {
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventorySlotItem.ogg", VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
//null out global state
|
//null out global state
|
||||||
Globals.dragSourceInventory = null;
|
Globals.dragSourceInventory = null;
|
||||||
Globals.draggedItem = null;
|
Globals.draggedItem = null;
|
||||||
@ -92,16 +102,17 @@ public class EquipmentInventoryPanel {
|
|||||||
String texturePath = "Textures/ui/uiFrame1.png";
|
String texturePath = "Textures/ui/uiFrame1.png";
|
||||||
boolean hasItem = false;
|
boolean hasItem = false;
|
||||||
String slotId = slots.get(i);
|
String slotId = slots.get(i);
|
||||||
|
Entity currentItem = null;
|
||||||
equipPoint = inventory.getEquipPointFromSlot(slotId);
|
equipPoint = inventory.getEquipPointFromSlot(slotId);
|
||||||
if(!equipPoint.isCombinedPoint()){
|
if(!equipPoint.isCombinedPoint()){
|
||||||
if(inventory.getItemSlot(slotId) != null && inventory.getItemSlot(slotId) != Globals.draggedItem){
|
if(inventory.getItemSlot(slotId) != null && inventory.getItemSlot(slotId) != Globals.draggedItem){
|
||||||
Entity currentItem = inventory.getItemSlot(slotId);
|
currentItem = inventory.getItemSlot(slotId);
|
||||||
//get texture path from item
|
//get texture path from item
|
||||||
texturePath = ItemUtils.getItemIcon(currentItem);
|
texturePath = ItemUtils.getItemIcon(currentItem);
|
||||||
//flag that this isn't an empty slot
|
//flag that this isn't an empty slot
|
||||||
hasItem = true;
|
hasItem = true;
|
||||||
} else if(inventory.getCombinedPoint(slotId) != null && inventory.hasItemInSlot(inventory.getCombinedPoint(slotId).getEquipPointId()) && inventory.getItemSlot(inventory.getCombinedPoint(slotId).getEquipPointId()) != Globals.draggedItem){
|
} else if(inventory.getCombinedPoint(slotId) != null && inventory.hasItemInSlot(inventory.getCombinedPoint(slotId).getEquipPointId()) && inventory.getItemSlot(inventory.getCombinedPoint(slotId).getEquipPointId()) != Globals.draggedItem){
|
||||||
Entity currentItem = inventory.getItemSlot(inventory.getCombinedPoint(slotId).getEquipPointId());
|
currentItem = inventory.getItemSlot(inventory.getCombinedPoint(slotId).getEquipPointId());
|
||||||
//get texture path from item
|
//get texture path from item
|
||||||
texturePath = ItemUtils.getItemIcon(currentItem);
|
texturePath = ItemUtils.getItemIcon(currentItem);
|
||||||
//flag that this isn't an empty slot
|
//flag that this isn't an empty slot
|
||||||
@ -109,6 +120,7 @@ public class EquipmentInventoryPanel {
|
|||||||
equipPoint = inventory.getCombinedPoint(slotId);
|
equipPoint = inventory.getCombinedPoint(slotId);
|
||||||
slotId = equipPoint.getEquipPointId();
|
slotId = equipPoint.getEquipPointId();
|
||||||
}
|
}
|
||||||
|
Entity finalEnt = currentItem;
|
||||||
if(!Globals.assetManager.hasLoadedTexture(texturePath)){
|
if(!Globals.assetManager.hasLoadedTexture(texturePath)){
|
||||||
Globals.assetManager.addTexturePathtoQueue(texturePath);
|
Globals.assetManager.addTexturePathtoQueue(texturePath);
|
||||||
}
|
}
|
||||||
@ -139,7 +151,12 @@ public class EquipmentInventoryPanel {
|
|||||||
WindowUtils.replaceWindow(WindowStrings.WINDOW_CHARACTER, PlayerInventoryWindow.createPlayerInventoryWindow(Globals.playerEntity));
|
WindowUtils.replaceWindow(WindowStrings.WINDOW_CHARACTER, PlayerInventoryWindow.createPlayerInventoryWindow(Globals.playerEntity));
|
||||||
//play sound effect
|
//play sound effect
|
||||||
if(Globals.virtualAudioSourceManager != null){
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventoryGrabItem.ogg", VirtualAudioSourceType.UI, false);
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(finalEnt));
|
||||||
|
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIGrabAudio() != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIGrabAudio(), VirtualAudioSourceType.UI, false);
|
||||||
|
} else {
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventoryGrabItem.ogg", VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}});
|
}});
|
||||||
@ -166,29 +183,37 @@ public class EquipmentInventoryPanel {
|
|||||||
int itemId = i;
|
int itemId = i;
|
||||||
panel.setOnDragRelease(new DragEventCallback(){public boolean execute(DragEvent event){
|
panel.setOnDragRelease(new DragEventCallback(){public boolean execute(DragEvent event){
|
||||||
if(Globals.dragSourceInventory instanceof RelationalInventoryState){
|
if(Globals.dragSourceInventory instanceof RelationalInventoryState){
|
||||||
Entity item = Globals.draggedItem;
|
if(ItemUtils.getContainingParent(Globals.draggedItem) != Globals.playerEntity){
|
||||||
if(ItemUtils.getContainingParent(item) != Globals.playerEntity){
|
|
||||||
throw new UnsupportedOperationException("Unimplemented!");
|
throw new UnsupportedOperationException("Unimplemented!");
|
||||||
}
|
}
|
||||||
} else if(Globals.dragSourceInventory instanceof UnrelationalInventoryState){
|
} else if(Globals.dragSourceInventory instanceof UnrelationalInventoryState){
|
||||||
Entity item = Globals.draggedItem;
|
if(inventory.canEquipItemToSlot(Globals.draggedItem, slots.get(itemId))){
|
||||||
if(inventory.canEquipItemToSlot(item, slots.get(itemId))){
|
|
||||||
//fire equip event to equip state
|
//fire equip event to equip state
|
||||||
ClientEquipState equipState = ClientEquipState.getEquipState(Globals.playerEntity);
|
ClientEquipState equipState = ClientEquipState.getEquipState(Globals.playerEntity);
|
||||||
equipState.commandAttemptEquip(item,inventory.getEquipPointFromSlot(slots.get(itemId)));
|
equipState.commandAttemptEquip(Globals.draggedItem,inventory.getEquipPointFromSlot(slots.get(itemId)));
|
||||||
//play sound effect
|
//play sound effect
|
||||||
if(Globals.virtualAudioSourceManager != null){
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventorySlotItem.ogg", VirtualAudioSourceType.UI, false);
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(finalEnt));
|
||||||
|
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
||||||
|
} else {
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventorySlotItem.ogg", VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if(inventory.canEquipItemToCombinedSlot(item, slots.get(itemId))){
|
} else if(inventory.canEquipItemToCombinedSlot(Globals.draggedItem, slots.get(itemId))){
|
||||||
EquipPoint combinedPoint = inventory.getCombinedPoint(slots.get(itemId));
|
EquipPoint combinedPoint = inventory.getCombinedPoint(slots.get(itemId));
|
||||||
//fire equip event to equip state
|
//fire equip event to equip state
|
||||||
ClientEquipState equipState = ClientEquipState.getEquipState(Globals.playerEntity);
|
ClientEquipState equipState = ClientEquipState.getEquipState(Globals.playerEntity);
|
||||||
equipState.commandAttemptEquip(item,combinedPoint);
|
equipState.commandAttemptEquip(Globals.draggedItem,combinedPoint);
|
||||||
//play sound effect
|
}
|
||||||
if(Globals.virtualAudioSourceManager != null){
|
}
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventorySlotItem.ogg", VirtualAudioSourceType.UI, false);
|
//play sound effect
|
||||||
}
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
|
||||||
|
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
||||||
|
} else {
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventorySlotItem.ogg", VirtualAudioSourceType.UI, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update ui
|
//update ui
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import electrosphere.entity.state.inventory.InventoryUtils;
|
|||||||
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
import electrosphere.entity.state.inventory.RelationalInventoryState;
|
||||||
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
import electrosphere.entity.state.inventory.UnrelationalInventoryState;
|
||||||
import electrosphere.entity.types.item.ItemUtils;
|
import electrosphere.entity.types.item.ItemUtils;
|
||||||
|
import electrosphere.game.data.item.type.Item;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
import electrosphere.renderer.ui.elements.Div;
|
import electrosphere.renderer.ui.elements.Div;
|
||||||
import electrosphere.renderer.ui.elements.ImagePanel;
|
import electrosphere.renderer.ui.elements.ImagePanel;
|
||||||
@ -70,6 +71,15 @@ public class NaturalInventoryPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//play sound effect
|
||||||
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
|
||||||
|
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
||||||
|
} else {
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventorySlotItem.ogg", VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
//clear ui
|
//clear ui
|
||||||
WindowUtils.cleanItemDraggingWindow();
|
WindowUtils.cleanItemDraggingWindow();
|
||||||
//re-render inventory
|
//re-render inventory
|
||||||
@ -96,13 +106,15 @@ public class NaturalInventoryPanel {
|
|||||||
for(int i = 0; i < inventory.getCapacity(); i++){
|
for(int i = 0; i < inventory.getCapacity(); i++){
|
||||||
String texturePath = "Textures/ui/uiFrame1.png";
|
String texturePath = "Textures/ui/uiFrame1.png";
|
||||||
boolean hasItem = false;
|
boolean hasItem = false;
|
||||||
|
Entity currentItem = null;
|
||||||
if(i < inventory.getItems().size() && inventory.getItems().get(i) != Globals.draggedItem){
|
if(i < inventory.getItems().size() && inventory.getItems().get(i) != Globals.draggedItem){
|
||||||
Entity currentItem = inventory.getItems().get(i);
|
currentItem = inventory.getItems().get(i);
|
||||||
//get texture path from item
|
//get texture path from item
|
||||||
texturePath = ItemUtils.getItemIcon(currentItem);
|
texturePath = ItemUtils.getItemIcon(currentItem);
|
||||||
//flag that this isn't an empty slot
|
//flag that this isn't an empty slot
|
||||||
hasItem = true;
|
hasItem = true;
|
||||||
}
|
}
|
||||||
|
Entity finalEnt = currentItem;
|
||||||
if(!Globals.assetManager.hasLoadedTexture(texturePath)){
|
if(!Globals.assetManager.hasLoadedTexture(texturePath)){
|
||||||
Globals.assetManager.addTexturePathtoQueue(texturePath);
|
Globals.assetManager.addTexturePathtoQueue(texturePath);
|
||||||
}
|
}
|
||||||
@ -133,7 +145,12 @@ public class NaturalInventoryPanel {
|
|||||||
WindowUtils.replaceWindow(WindowStrings.WINDOW_CHARACTER, PlayerInventoryWindow.createPlayerInventoryWindow(Globals.playerEntity));
|
WindowUtils.replaceWindow(WindowStrings.WINDOW_CHARACTER, PlayerInventoryWindow.createPlayerInventoryWindow(Globals.playerEntity));
|
||||||
//play sound effect
|
//play sound effect
|
||||||
if(Globals.virtualAudioSourceManager != null){
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventoryGrabItem.ogg", VirtualAudioSourceType.UI, false);
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(finalEnt));
|
||||||
|
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIGrabAudio() != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIGrabAudio(), VirtualAudioSourceType.UI, false);
|
||||||
|
} else {
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventoryGrabItem.ogg", VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}});
|
}});
|
||||||
@ -158,18 +175,22 @@ public class NaturalInventoryPanel {
|
|||||||
} else {
|
} else {
|
||||||
panel.setOnDragRelease(new DragEventCallback(){public boolean execute(DragEvent event){
|
panel.setOnDragRelease(new DragEventCallback(){public boolean execute(DragEvent event){
|
||||||
if(Globals.dragSourceInventory instanceof RelationalInventoryState){
|
if(Globals.dragSourceInventory instanceof RelationalInventoryState){
|
||||||
Entity item = Globals.draggedItem;
|
|
||||||
if(ClientEquipState.hasEquipState(entity) && InventoryUtils.hasEquipInventory(entity)){
|
if(ClientEquipState.hasEquipState(entity) && InventoryUtils.hasEquipInventory(entity)){
|
||||||
RelationalInventoryState equipInventory = InventoryUtils.getEquipInventory(entity);
|
RelationalInventoryState equipInventory = InventoryUtils.getEquipInventory(entity);
|
||||||
ClientEquipState equipState = ClientEquipState.getEquipState(entity);
|
ClientEquipState equipState = ClientEquipState.getEquipState(entity);
|
||||||
equipState.commandAttemptUnequip(equipInventory.getItemSlot(item));
|
equipState.commandAttemptUnequip(equipInventory.getItemSlot(Globals.draggedItem));
|
||||||
}
|
}
|
||||||
} else if(Globals.dragSourceInventory instanceof UnrelationalInventoryState){
|
} else if(Globals.dragSourceInventory instanceof UnrelationalInventoryState){
|
||||||
Entity item = Globals.draggedItem;
|
if(ItemUtils.getContainingParent(Globals.draggedItem) != Globals.playerEntity){
|
||||||
if(ItemUtils.getContainingParent(item) != Globals.playerEntity){
|
|
||||||
throw new UnsupportedOperationException("Unimplemented!");
|
throw new UnsupportedOperationException("Unimplemented!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
|
||||||
|
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
||||||
|
} else {
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource("/Audio/inventorySlotItem.ogg", VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
//update ui
|
//update ui
|
||||||
Globals.dragSourceInventory = null;
|
Globals.dragSourceInventory = null;
|
||||||
Globals.draggedItem = null;
|
Globals.draggedItem = null;
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package electrosphere.renderer.ui.components;
|
package electrosphere.renderer.ui.components;
|
||||||
|
|
||||||
|
import electrosphere.audio.VirtualAudioSourceManager.VirtualAudioSourceType;
|
||||||
import electrosphere.client.ui.menu.WindowStrings;
|
import electrosphere.client.ui.menu.WindowStrings;
|
||||||
import electrosphere.client.ui.menu.WindowUtils;
|
import electrosphere.client.ui.menu.WindowUtils;
|
||||||
import electrosphere.controls.ControlHandler.ControlsState;
|
import electrosphere.controls.ControlHandler.ControlsState;
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
|
import electrosphere.engine.assetmanager.AssetDataStrings;
|
||||||
import electrosphere.engine.signal.Signal.SignalType;
|
import electrosphere.engine.signal.Signal.SignalType;
|
||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
import electrosphere.entity.state.inventory.InventoryUtils;
|
import electrosphere.entity.state.inventory.InventoryUtils;
|
||||||
@ -50,6 +52,9 @@ public class PlayerInventoryWindow {
|
|||||||
} else {
|
} else {
|
||||||
Globals.controlHandler.hintUpdateControlState(ControlsState.IN_GAME_FREE_CAMERA);
|
Globals.controlHandler.hintUpdateControlState(ControlsState.IN_GAME_FREE_CAMERA);
|
||||||
}
|
}
|
||||||
|
if(Globals.virtualAudioSourceManager != null){
|
||||||
|
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_INVENTORY_CLOSE, VirtualAudioSourceType.UI, false);
|
||||||
|
}
|
||||||
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(false);
|
Globals.renderingEngine.getPostProcessingPipeline().setApplyBlur(false);
|
||||||
return false;
|
return false;
|
||||||
}});
|
}});
|
||||||
|
|||||||
@ -298,8 +298,9 @@ public class Button extends StandardContainerElement implements DrawableElement,
|
|||||||
* Sets the audio path to play on click
|
* Sets the audio path to play on click
|
||||||
* @param audioPath The audio path
|
* @param audioPath The audio path
|
||||||
*/
|
*/
|
||||||
public void setOnClickAudio(String audioPath){
|
public Button setOnClickAudio(String audioPath){
|
||||||
this.audioPathOnClick = audioPath;
|
this.audioPathOnClick = audioPath;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user